staging: rtl8723au: update_sta_support_rate23a(): Use cfg80211_find_ie()
authorJes Sorensen <Jes.Sorensen@redhat.com>
Tue, 15 Apr 2014 17:44:01 +0000 (19:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Apr 2014 18:04:01 +0000 (11:04 -0700)
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_wlan_util.c

index 43bfefcc1b7bce435d1fc9abdb38f77e7be53fd9..909acb97f16e2ab0156b8725a0e3a52eef3f0d81 100644 (file)
@@ -1570,26 +1570,25 @@ void update_bmc_sta_support_rate23a(struct rtw_adapter *padapter, u32 mac_id)
        }
 }
 
-int update_sta_support_rate23a(struct rtw_adapter *padapter, u8 *pvar_ie, uint var_ie_len, int cam_idx)
+int update_sta_support_rate23a(struct rtw_adapter *padapter, u8 *pvar_ie,
+                              uint var_ie_len, int cam_idx)
 {
-       unsigned int    ie_len;
-       struct ndis_802_11_var_ies *pIE;
-       int     supportRateNum = 0;
+       int supportRateNum = 0;
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
+       const u8 *p;
 
-       pIE = (struct ndis_802_11_var_ies *)rtw_get_ie23a(pvar_ie,
-                                                         WLAN_EID_SUPP_RATES,
-                                                         &ie_len, var_ie_len);
-       if (pIE == NULL)
+       p = cfg80211_find_ie(WLAN_EID_SUPP_RATES, pvar_ie, var_ie_len);
+       if (!p)
                return _FAIL;
 
-       memcpy(pmlmeinfo->FW_sta_info[cam_idx].SupportedRates, pIE->data, ie_len);
-       supportRateNum = ie_len;
+       memcpy(pmlmeinfo->FW_sta_info[cam_idx].SupportedRates, p + 2, p[1]);
+       supportRateNum = p[1];
 
-       pIE = (struct ndis_802_11_var_ies *)rtw_get_ie23a(pvar_ie, WLAN_EID_EXT_SUPP_RATES, &ie_len, var_ie_len);
-       if (pIE)
-               memcpy((pmlmeinfo->FW_sta_info[cam_idx].SupportedRates + supportRateNum), pIE->data, ie_len);
+       p = cfg80211_find_ie(WLAN_EID_EXT_SUPP_RATES, pvar_ie, var_ie_len);
+       if (p)
+               memcpy(pmlmeinfo->FW_sta_info[cam_idx].SupportedRates +
+                      supportRateNum, p + 2, p[1]);
        return _SUCCESS;
 }