staging: rtl8723au: Get rid of SetPrivacy()/SetPwrMgt()/SetMData() macros
authorJes Sorensen <Jes.Sorensen@redhat.com>
Wed, 21 May 2014 07:38:02 +0000 (09:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 May 2014 07:27:46 +0000 (16:27 +0900)
Set these bits directly in the code instead of fiddling with wrapper
macros.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_mlme_ext.c
drivers/staging/rtl8723au/core/rtw_xmit.c
drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
drivers/staging/rtl8723au/include/wifi.h

index b8d829f95da01ab4b379a7a9968344e370eb500c..2c12ba68e8901e4a21861fb6e7f545a3e27d09dc 100644 (file)
@@ -3091,7 +3091,8 @@ void issue_auth23a(struct rtw_adapter *padapter, struct sta_info *psta,
                                               pmlmeinfo->chg_txt,
                                               &pattrib->pktlen);
 
-                       SetPrivacy(fctrl);
+                       pwlanhdr->frame_control |=
+                               cpu_to_le16(IEEE80211_FCTL_PROTECTED);
 
                        pattrib->hdrlen = sizeof(struct ieee80211_hdr_3addr);
 
@@ -3573,7 +3574,7 @@ static int _issue_nulldata23a(struct rtw_adapter *padapter, unsigned char *da,
                SetToDs(fctrl);
 
        if (power_mode)
-               SetPwrMgt(fctrl);
+               pwlanhdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PM);
 
        ether_addr_copy(pwlanhdr->addr1, da);
        ether_addr_copy(pwlanhdr->addr2, myid(&padapter->eeprompriv));
@@ -3697,7 +3698,7 @@ static int _issue_qos_nulldata23a(struct rtw_adapter *padapter,
                SetToDs(fctrl);
 
        if (pattrib->mdata)
-               SetMData(fctrl);
+               pwlanhdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_MOREDATA);
 
        qc = (unsigned short *)(pframe + pattrib->hdrlen - 2);
 
index 2ebb3df876902a78016e0ee88ed06062160b7f09..a82afcb88518452cabb8438d7e979d2cc65926fa 100644 (file)
@@ -936,9 +936,11 @@ static int rtw_make_wlanhdr(struct rtw_adapter *padapter, u8 *hdr,
                        goto exit;
                }
                if (pattrib->mdata)
-                       SetMData(fctrl);
+                       pwlanhdr->frame_control |=
+                               cpu_to_le16(IEEE80211_FCTL_MOREDATA);
                if (pattrib->encrypt)
-                       SetPrivacy(fctrl);
+                       pwlanhdr->frame_control |=
+                               cpu_to_le16(IEEE80211_FCTL_PROTECTED);
                if (qos_option) {
                        qc = (unsigned short *)(hdr + pattrib->hdrlen - 2);
                        if (pattrib->priority)
index a58de6775bca52df3a26dd4ceee0a982fb97cfd9..dc044cf4031d3b6b97a04aadb634c5b8c1d04eef 100644 (file)
@@ -310,16 +310,13 @@ static void ConstructPSPoll(struct rtw_adapter *padapter,
                            u8 *pframe, u32 *pLength)
 {
        struct ieee80211_hdr *pwlanhdr;
-       __le16 *fctrl;
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
 
        pwlanhdr = (struct ieee80211_hdr *)pframe;
 
        /*  Frame control. */
-       fctrl = &pwlanhdr->frame_control;
-       *(fctrl) = 0;
-       SetPwrMgt(fctrl);
+       pwlanhdr->frame_control = cpu_to_le16(IEEE80211_FCTL_PM);
        SetFrameSubType(pframe, WIFI_PSPOLL);
 
        /*  AID. */
@@ -355,7 +352,7 @@ ConstructNullFunctionData(struct rtw_adapter *padapter, u8 *pframe,
        fctrl = &pwlanhdr->frame_control;
 
        if (bForcePowerSave)
-               SetPwrMgt(fctrl);
+               pwlanhdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PM);
 
        switch (cur_network->network.ifmode) {
        case NL80211_IFTYPE_P2P_CLIENT:
index 3791561ac3a80efd6d23e6cc7a2245bf42abff5f..4052de75fe125e6b302994f3a8a1c81b97c86a17 100644 (file)
@@ -72,15 +72,6 @@ enum WIFI_FRAME_SUBTYPE {
 #define SetFrDs(pbuf)  \
        (*(__le16 *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_FROMDS))
 
-#define SetPwrMgt(pbuf)        \
-       (*(__le16 *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_PM))
-
-#define SetMData(pbuf) \
-       (*(__le16 *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_MOREDATA))
-
-#define SetPrivacy(pbuf)       \
-       (*(__le16 *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_PROTECTED))
-
 #define SetFrameType(pbuf, type)       \
        do {    \
                *(__le16 *)(pbuf) &= __constant_cpu_to_le16(~(BIT(3) | BIT(2))); \