staging: rtl8723au: Use _FIXED_IE_LEN_ instead of hard coded value
authorJes Sorensen <Jes.Sorensen@redhat.com>
Tue, 24 Jun 2014 13:03:22 +0000 (15:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Jun 2014 17:50:58 +0000 (13:50 -0400)
This should help catching all the users once we stop carrying the
fixed beacon elements in the IE array.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_mlme.c
drivers/staging/rtl8723au/core/rtw_mlme_ext.c

index b7a35288a1f0b3acccaa42fd052da3f205d8f3d3..66f24dcb20a8f242131cefaecd609b09a2958abe 100644 (file)
@@ -1929,7 +1929,7 @@ int rtw_restruct_wmm_ie23a(struct rtw_adapter *adapter, u8 *in_ie,
        unsigned int ielength = 0;
        unsigned int i, j;
 
-       i = 12; /* after the fixed IE */
+       i = _FIXED_IE_LENGTH_; /* after the fixed IE */
        while (i < in_len) {
                ielength = initial_out_len;
 
@@ -2039,8 +2039,8 @@ int rtw_restruct_sec_ie23a(struct rtw_adapter *adapter, u8 *in_ie, u8 *out_ie,
                  "ndissecuritytype=%d\n", ndisauthmode, ndissecuritytype));
 
        /* copy fixed ie only */
-       memcpy(out_ie, in_ie, 12);
-       ielength = 12;
+       memcpy(out_ie, in_ie, _FIXED_IE_LENGTH_);
+       ielength = _FIXED_IE_LENGTH_;
        if (ndisauthmode == Ndis802_11AuthModeWPA ||
            ndisauthmode == Ndis802_11AuthModeWPAPSK)
                authmode = WLAN_EID_VENDOR_SPECIFIC;
@@ -2171,7 +2171,8 @@ bool rtw_restructure_ht_ie23a(struct rtw_adapter *padapter, u8 *in_ie,
 
        phtpriv->ht_option = false;
 
-       p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, in_ie + 12, in_len -12);
+       p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, in_ie + _FIXED_IE_LENGTH_,
+                            in_len - _FIXED_IE_LENGTH_);
 
        if (p && p[1] > 0) {
                u32 rx_packet_offset, max_recvbuf_sz;
@@ -2216,8 +2217,9 @@ bool rtw_restructure_ht_ie23a(struct rtw_adapter *padapter, u8 *in_ie,
 
                phtpriv->ht_option = true;
 
-               p = cfg80211_find_ie(WLAN_EID_HT_OPERATION, in_ie + 12,
-                                    in_len -12);
+               p = cfg80211_find_ie(WLAN_EID_HT_OPERATION,
+                                    in_ie + _FIXED_IE_LENGTH_,
+                                    in_len - _FIXED_IE_LENGTH_);
                if (p && (p[1] == sizeof(struct ieee80211_ht_operation))) {
                        out_len = *pout_len;
                        pframe = rtw_set_ie23a(out_ie + out_len,
index 03ced01ef82b19b927b24090afbc22a797e2c27d..6791ad7f9ade3c210e8552e8de0c396ce10ec3aa 100644 (file)
@@ -4254,7 +4254,7 @@ static struct wlan_bssid_ex *collect_bss_info(struct rtw_adapter *padapter,
                memcpy(bssid->SupportedRates + i, p + 2, p[1]);
        }
 
-       if (bssid->IELength < 12)
+       if (bssid->IELength < _FIXED_IE_LENGTH_)
                goto fail;
 
        /*  Checking for DSConfig */