From: Jes Sorensen Date: Wed, 21 May 2014 07:38:01 +0000 (+0200) Subject: staging: rtl8723au: Get rid of ugly SetDuration() macro usage X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=fd602993ba7c975c143356968001b713f20b3ccd;p=openwrt%2Fstaging%2Fblogic.git staging: rtl8723au: Get rid of ugly SetDuration() macro usage Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c index bfe754fef8ca..a58de6775bca 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c @@ -306,7 +306,8 @@ _ConstructBeacon: } -static void ConstructPSPoll(struct rtw_adapter *padapter, u8 *pframe, u32 *pLength) +static void ConstructPSPoll(struct rtw_adapter *padapter, + u8 *pframe, u32 *pLength) { struct ieee80211_hdr *pwlanhdr; __le16 *fctrl; @@ -322,7 +323,7 @@ static void ConstructPSPoll(struct rtw_adapter *padapter, u8 *pframe, u32 *pLeng SetFrameSubType(pframe, WIFI_PSPOLL); /* AID. */ - SetDuration(pframe, (pmlmeinfo->aid | 0xc000)); + pwlanhdr->duration_id = cpu_to_le16(pmlmeinfo->aid | 0xc000); /* BSSID. */ memcpy(pwlanhdr->addr1, get_my_bssid23a(&pmlmeinfo->network), ETH_ALEN); diff --git a/drivers/staging/rtl8723au/include/wifi.h b/drivers/staging/rtl8723au/include/wifi.h index 8d3066c1817a..3791561ac3a8 100644 --- a/drivers/staging/rtl8723au/include/wifi.h +++ b/drivers/staging/rtl8723au/include/wifi.h @@ -93,10 +93,6 @@ enum WIFI_FRAME_SUBTYPE { *(__le16 *)(pbuf) |= cpu_to_le16(type); \ } while (0) -#define SetDuration(pbuf, dur) \ - (*(__le16 *)((unsigned long)(pbuf) + 2) = \ - cpu_to_le16(0xffff & (dur))) - #define SetPriority(pbuf, tid) \ (*(__le16 *)(pbuf) |= cpu_to_le16(tid & 0xf))