#define _RTW_RECV_C_
+#include <linux/ieee80211.h>
#include "../include/osdep_service.h"
#include "../include/drv_types.h"
#include "../include/recv_osdep.h"
/* then call check if rx seq/frag. duplicated. */
- u8 type;
u8 subtype;
int retval = _SUCCESS;
u8 bDumpRxPkt;
struct rx_pkt_attrib *pattrib = &precv_frame->attrib;
u8 *ptr = precv_frame->rx_data;
+ __le16 fc = *(__le16 *)ptr;
u8 ver = (unsigned char)(*ptr) & 0x3;
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
goto exit;
}
- type = GetFrameType(ptr);
subtype = GetFrameSubType(ptr); /* bit(7)~bit(2) */
pattrib->to_fr_ds = get_tofr_ds(ptr);
/* Dump rx packets */
GetHalDefVar8188EUsb(adapter, HAL_DEF_DBG_DUMP_RXPKT, &bDumpRxPkt);
- switch (type) {
- case IEEE80211_FTYPE_MGMT:
+
+ if (ieee80211_is_mgmt(fc)) {
validate_recv_mgnt_frame(adapter, precv_frame);
retval = _FAIL; /* only data frame return _SUCCESS */
- break;
- case WIFI_CTRL_TYPE: /* ctrl */
+ } else if (ieee80211_is_ctl(fc)) {
validate_recv_ctrl_frame(adapter, precv_frame);
retval = _FAIL; /* only data frame return _SUCCESS */
- break;
- case WIFI_DATA_TYPE: /* data */
+ } else if (ieee80211_is_data(fc)) {
rtw_led_control(adapter, LED_CTL_RX);
pattrib->qos = (subtype & BIT(7)) ? 1 : 0;
retval = validate_recv_data_frame(adapter, precv_frame);
struct recv_priv *precvpriv = &adapter->recvpriv;
precvpriv->rx_drop++;
}
- break;
- default:
+ } else
retval = _FAIL;
- break;
- }
exit: