staging: r8723au: Fix endian errors for frame control
authorLarry Finger <Larry.Finger@lwfinger.net>
Sat, 26 Apr 2014 16:55:42 +0000 (18:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Apr 2014 17:16:21 +0000 (10:16 -0700)
The following locations in the code treat the frame control as u16 rather than
the correct __le16:

drivers/staging/rtl8723au/core/rtw_mlme_ext.c:2471:15:    expected unsigned short *fctrl
drivers/staging/rtl8723au/core/rtw_mlme_ext.c:2644:15:    expected unsigned short *fctrl
drivers/staging/rtl8723au/core/rtw_mlme_ext.c:2849:15:    expected unsigned short *fctrl
drivers/staging/rtl8723au/core/rtw_mlme_ext.c:2994:15:    expected unsigned short *fctrl
drivers/staging/rtl8723au/core/rtw_mlme_ext.c:3308:15:    expected unsigned short *fctrl
drivers/staging/rtl8723au/core/rtw_mlme_ext.c:3578:15:    expected unsigned short *fctrl
drivers/staging/rtl8723au/core/rtw_mlme_ext.c:3699:15:    expected unsigned short *fctrl
drivers/staging/rtl8723au/core/rtw_mlme_ext.c:3821:15:    expected unsigned short *fctrl
drivers/staging/rtl8723au/core/rtw_mlme_ext.c:3932:15:    expected unsigned short *fctrl
drivers/staging/rtl8723au/core/rtw_mlme_ext.c:4004:15:    expected unsigned short [usertype] *fctrl
drivers/staging/rtl8723au/core/rtw_mlme_ext.c:4194:15:    expected unsigned short *fctrl
drivers/staging/rtl8723au/core/rtw_xmit.c:911:23:    expected unsigned short [usertype] *fctrl
drivers/staging/rtl8723au/hal/rtl8723a_cmd.c:216:15:    expected unsigned short [usertype] *fctrl
drivers/staging/rtl8723au/hal/rtl8723a_cmd.c:313:15:    expected unsigned short [usertype] *fctrl
drivers/staging/rtl8723au/hal/rtl8723a_cmd.c:350:15:    expected unsigned short [usertype] *fctrl
drivers/staging/rtl8723au/hal/rtl8723a_cmd.c:419:15:    expected unsigned short [usertype] *fctrl
drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c:314:15:    expected unsigned short *fctrl
drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c:2357:15:    expected unsigned short *fctrl

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
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/os_dep/ioctl_cfg80211.c

index abaedd21fe03ea4bce715ea43a92a42e5cc22f47..eb7b98e2e5be6eff5b22112acc7fc8acf6a3d103 100644 (file)
@@ -2435,7 +2435,7 @@ void issue_beacon23a(struct rtw_adapter *padapter, int timeout_ms)
        struct pkt_attrib *pattrib;
        unsigned char *pframe;
        struct ieee80211_hdr *pwlanhdr;
-       unsigned short *fctrl;
+       __le16 *fctrl;
        unsigned int rate_len;
        struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
        struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@@ -2603,7 +2603,7 @@ void issue_probersp23a(struct rtw_adapter *padapter, unsigned char *da,
        struct pkt_attrib *pattrib;
        unsigned char *pframe;
        struct ieee80211_hdr *pwlanhdr;
-       unsigned short *fctrl;
+       __le16 *fctrl;
        unsigned char *mac, *bssid;
        struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 #ifdef CONFIG_8723AU_AP_MODE
@@ -2820,7 +2820,7 @@ static int _issue_probereq23a(struct rtw_adapter *padapter,
        struct pkt_attrib               *pattrib;
        unsigned char                   *pframe;
        struct ieee80211_hdr    *pwlanhdr;
-       unsigned short          *fctrl;
+       __le16          *fctrl;
        unsigned char                   *mac;
        unsigned char                   bssrate[NumRates];
        struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
@@ -2846,7 +2846,7 @@ static int _issue_probereq23a(struct rtw_adapter *padapter,
 
        mac = myid(&padapter->eeprompriv);
 
-       fctrl = &pwlanhdr->frame_control;
+               fctrl = &pwlanhdr->frame_control;
        *fctrl = 0;
 
        if (da) {
@@ -2971,7 +2971,7 @@ void issue_auth23a(struct rtw_adapter *padapter, struct sta_info *psta,
        struct pkt_attrib *pattrib;
        unsigned char *pframe;
        struct ieee80211_hdr *pwlanhdr;
-       unsigned short *fctrl;
+       __le16 *fctrl;
        unsigned int val32;
        unsigned short val16;
        int use_shared_key = 0;
@@ -3280,7 +3280,7 @@ void issue_assocreq23a(struct rtw_adapter *padapter)
        unsigned char *pframe;
        const u8 *p;
        struct ieee80211_hdr *pwlanhdr;
-       unsigned short *fctrl;
+       __le16 *fctrl;
        unsigned int i, j, index = 0;
        unsigned char rf_type, bssrate[NumRates], sta_bssrate[NumRates];
        struct ndis_802_11_var_ies *pIE;
@@ -3548,7 +3548,7 @@ static int _issue_nulldata23a(struct rtw_adapter *padapter, unsigned char *da,
        struct pkt_attrib *pattrib;
        unsigned char *pframe;
        struct ieee80211_hdr *pwlanhdr;
-       unsigned short *fctrl;
+       __le16 *fctrl;
        struct xmit_priv *pxmitpriv;
        struct mlme_ext_priv *pmlmeext;
        struct mlme_ext_info *pmlmeinfo;
@@ -3671,7 +3671,8 @@ static int _issue_qos_nulldata23a(struct rtw_adapter *padapter,
        struct pkt_attrib *pattrib;
        unsigned char *pframe;
        struct ieee80211_hdr *pwlanhdr;
-       unsigned short *fctrl, *qc;
+       __le16 *fctrl;
+       u16 *qc;
        struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
@@ -3797,7 +3798,7 @@ static int _issue_deauth23a(struct rtw_adapter *padapter, unsigned char *da,
        struct pkt_attrib *pattrib;
        unsigned char *pframe;
        struct ieee80211_hdr *pwlanhdr;
-       unsigned short *fctrl;
+       __le16 *fctrl;
        struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
@@ -3908,7 +3909,7 @@ void issue_action_spct_ch_switch23a(struct rtw_adapter *padapter,
        struct pkt_attrib *pattrib;
        unsigned char *pframe;
        struct ieee80211_hdr *pwlanhdr;
-       unsigned short *fctrl;
+       __le16 *fctrl;
        struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
        u8 category, action;
@@ -3975,7 +3976,7 @@ void issue_action_BA23a(struct rtw_adapter *padapter,
        struct pkt_attrib *pattrib;
        u8 *pframe;
        struct ieee80211_hdr *pwlanhdr;
-       u16 *fctrl;
+       __le16 *fctrl;
        struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
@@ -4155,7 +4156,7 @@ static void issue_action_BSSCoexistPacket(struct rtw_adapter *padapter)
        struct pkt_attrib *pattrib;
        u8 *pframe;
        struct ieee80211_hdr *pwlanhdr;
-       unsigned short *fctrl;
+       __le16 *fctrl;
        struct wlan_network *pnetwork;
        struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
        struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
index e7252d16c989a82a577ec8ecb1c7bfb9d807e91b..31a44feaab1d8432ee09211d73f4aecb6e3f5f20 100644 (file)
@@ -908,7 +908,7 @@ s32 rtw_make_wlanhdr23a(struct rtw_adapter *padapter, u8 *hdr,
        struct qos_priv *pqospriv = &pmlmepriv->qospriv;
        u8 qos_option = false;
        int res = _SUCCESS;
-       u16 *fctrl = &pwlanhdr->frame_control;
+       __le16 *fctrl = &pwlanhdr->frame_control;
 
        struct sta_info *psta;
 
index be9d724c827ea96d04b97c511dac73dcf636e6f8..ffd6b73eb6a89aa25272fc7f063cdf40ad0b36ee 100644 (file)
@@ -202,7 +202,7 @@ void rtl8723a_set_FwPwrMode_cmd(struct rtw_adapter *padapter, u8 Mode)
 static void ConstructBeacon(struct rtw_adapter *padapter, u8 *pframe, u32 *pLength)
 {
        struct ieee80211_hdr *pwlanhdr;
-       u16 *fctrl;
+       __le16 *fctrl;
        u32 rate_len, pktlen;
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
@@ -303,7 +303,7 @@ _ConstructBeacon:
 static void ConstructPSPoll(struct rtw_adapter *padapter, u8 *pframe, u32 *pLength)
 {
        struct ieee80211_hdr *pwlanhdr;
-       u16 *fctrl;
+       __le16 *fctrl;
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
 
@@ -338,7 +338,7 @@ static void ConstructNullFunctionData(
        u8 bForcePowerSave)
 {
        struct ieee80211_hdr *pwlanhdr;
-       u16 *fctrl;
+       __le16 *fctrl;
        u32 pktlen;
        struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
        struct wlan_network             *cur_network = &pmlmepriv->cur_network;
@@ -402,7 +402,7 @@ static void ConstructNullFunctionData(
 static void ConstructProbeRsp(struct rtw_adapter *padapter, u8 *pframe, u32 *pLength, u8 *StaAddr, bool bHideSSID)
 {
        struct ieee80211_hdr *pwlanhdr;
-       u16 *fctrl;
+       __le16 *fctrl;
        u8 *mac, *bssid;
        u32 pktlen;
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
index 14331e474f0b66a57b2a01c199e6edd9c1df4c97..ca100dcc27631dc0796101f78b30a784bf03f69d 100644 (file)
@@ -262,7 +262,7 @@ static int rtw_cfg80211_inform_bss(struct rtw_adapter *padapter,
        u8 buf[MAX_BSSINFO_LEN], *pbuf;
        size_t len;
        struct ieee80211_hdr *pwlanhdr;
-       unsigned short *fctrl;
+       __le16 *fctrl;
 
        struct wireless_dev *wdev = padapter->rtw_wdev;
        struct wiphy *wiphy = wdev->wiphy;
@@ -2332,7 +2332,7 @@ void rtw_cfg80211_indicate_sta_disassoc(struct rtw_adapter *padapter,
        u8 *pmgmt_frame;
        uint frame_len;
        struct ieee80211_hdr *pwlanhdr;
-       unsigned short *fctrl;
+       __le16 *fctrl;
        u8 mgmt_buf[128] = { 0 };
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;