From 5ca12b78995aeb9cbe5c127342e8ca27f1e6d038 Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Fri, 9 May 2014 15:03:30 +0200 Subject: [PATCH] staging: rtl8723au: Remove to_fr_ds packet attribute This is only used in one place - do the work there properly. Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723au/core/rtw_recv.c | 18 ++++++------------ drivers/staging/rtl8723au/include/rtw_recv.h | 1 - drivers/staging/rtl8723au/include/wifi.h | 3 --- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_recv.c b/drivers/staging/rtl8723au/core/rtw_recv.c index 76873664d432..fd0958b675d5 100644 --- a/drivers/staging/rtl8723au/core/rtw_recv.c +++ b/drivers/staging/rtl8723au/core/rtw_recv.c @@ -1334,36 +1334,32 @@ static int validate_recv_data_frame(struct rtw_adapter *adapter, ether_addr_copy(pattrib->bssid, pbssid); - switch (pattrib->to_fr_ds) - { - case 0: + switch (hdr->frame_control & + cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) { + case cpu_to_le16(0): ether_addr_copy(pattrib->ra, pda); ether_addr_copy(pattrib->ta, psa); ret = sta2sta_data_frame(adapter, precv_frame, &psta); break; - case 1: + case cpu_to_le16(IEEE80211_FCTL_FROMDS): ether_addr_copy(pattrib->ra, pda); ether_addr_copy(pattrib->ta, pbssid); ret = ap2sta_data_frame(adapter, precv_frame, &psta); break; - case 2: + case cpu_to_le16(IEEE80211_FCTL_TODS): ether_addr_copy(pattrib->ra, pbssid); ether_addr_copy(pattrib->ta, psa); ret = sta2ap_data_frame(adapter, precv_frame, &psta); break; - case 3: + case cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS): ether_addr_copy(pattrib->ra, hdr->addr1); ether_addr_copy(pattrib->ta, hdr->addr2); ret = _FAIL; RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" case 3\n")); break; - - default: - ret = _FAIL; - break; } if ((ret == _FAIL) || (ret == RTW_RX_HANDLED)) @@ -1524,8 +1520,6 @@ static int validate_recv_frame(struct rtw_adapter *adapter, goto exit; } - pattrib->to_fr_ds = get_tofr_ds(hdr->frame_control); - seq_ctrl = le16_to_cpu(hdr->seq_ctrl); pattrib->frag_num = seq_ctrl & IEEE80211_SCTL_FRAG; pattrib->seq_num = seq_ctrl >> 4; diff --git a/drivers/staging/rtl8723au/include/rtw_recv.h b/drivers/staging/rtl8723au/include/rtw_recv.h index 1f18af8dcc04..0a88506ab859 100644 --- a/drivers/staging/rtl8723au/include/rtw_recv.h +++ b/drivers/staging/rtl8723au/include/rtw_recv.h @@ -99,7 +99,6 @@ struct rx_pkt_attrib { u8 drvinfo_sz; u8 shift_sz; u8 hdrlen; /* the WLAN Header Len */ - u8 to_fr_ds; u8 amsdu; u8 qos; u8 priority; diff --git a/drivers/staging/rtl8723au/include/wifi.h b/drivers/staging/rtl8723au/include/wifi.h index aebc05d8a123..e7c34b73ff1d 100644 --- a/drivers/staging/rtl8723au/include/wifi.h +++ b/drivers/staging/rtl8723au/include/wifi.h @@ -87,9 +87,6 @@ enum WIFI_REG_DOMAIN { #define SetFrDs(pbuf) \ (*(__le16 *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_FROMDS)) -#define get_tofr_ds(pframe) ((ieee80211_has_tods(pframe) << 1) | \ - ieee80211_has_fromds(pframe)) - #define SetMFrag(pbuf) \ (*(__le16 *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_MOREFRAGS)) -- 2.20.1