staging: rtl8723au: OnAssocReq23a(): Use cfg80211_find_ie() to locate HT caps
authorJes Sorensen <Jes.Sorensen@redhat.com>
Tue, 15 Apr 2014 17:44:15 +0000 (19:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Apr 2014 18:04:03 +0000 (11:04 -0700)
Use cfg80211 interface to search for HT capabilities.

This was the last user of struct rtw_ieee802_11_elems, which can now
be removed.

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

index e1e8f2831478bdcc9f559b0fda01a338cc26b4d7..f0e24e33f5d8322be69979a3c5a66fe343a80b0c 100644 (file)
@@ -1471,13 +1471,14 @@ OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)
 
        /* save HT capabilities in the sta object */
        memset(&pstat->htpriv.ht_cap, 0, sizeof(struct ieee80211_ht_cap));
-       if (elems.ht_capabilities && elems.ht_capabilities_len >=
-           sizeof(struct ieee80211_ht_cap)) {
+       p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, pos, left);
+
+       if (p && p[1] >= sizeof(struct ieee80211_ht_cap)) {
                pstat->flags |= WLAN_STA_HT;
 
                pstat->flags |= WLAN_STA_WME;
 
-               memcpy(&pstat->htpriv.ht_cap, elems.ht_capabilities,
+               memcpy(&pstat->htpriv.ht_cap, p + 2,
                       sizeof(struct ieee80211_ht_cap));
        } else
                pstat->flags &= ~WLAN_STA_HT;