staging: rtl8723au: rtw_update_protection23a(): Use cfg80211_find_ie()
authorJes Sorensen <Jes.Sorensen@redhat.com>
Tue, 15 Apr 2014 17:43:54 +0000 (19:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Apr 2014 18:04:00 +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_xmit.c

index c0eaf5e21057114376a2bb8f7081d948f578343f..e7252d16c989a82a577ec8ecb1c7bfb9d807e91b 100644 (file)
@@ -1319,11 +1319,10 @@ s32 rtw_put_snap23a(u8 *data, u16 h_proto)
 
 void rtw_update_protection23a(struct rtw_adapter *padapter, u8 *ie, uint ie_len)
 {
-       struct  xmit_priv *pxmitpriv = &padapter->xmitpriv;
-       struct  registry_priv *pregistrypriv = &padapter->registrypriv;
-       uint    protection;
-       u8      *perp;
-       int      erp_len;
+       struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
+       struct registry_priv *pregistrypriv = &padapter->registrypriv;
+       uint protection;
+       const u8 *p;
 
        switch (pxmitpriv->vcs_setting) {
        case DISABLE_VCS:
@@ -1333,11 +1332,11 @@ void rtw_update_protection23a(struct rtw_adapter *padapter, u8 *ie, uint ie_len)
                break;
        case AUTO_VCS:
        default:
-               perp = rtw_get_ie23a(ie, WLAN_EID_ERP_INFO, &erp_len, ie_len);
-               if (perp == NULL) {
+               p = cfg80211_find_ie(WLAN_EID_ERP_INFO, ie, ie_len);
+               if (!p)
                        pxmitpriv->vcs = NONE_VCS;
-               else {
-                       protection = (*(perp + 2)) & BIT(1);
+               else {
+                       protection = (*(p + 2)) & BIT(1);
                        if (protection) {
                                if (pregistrypriv->vcs_type == RTS_CTS)
                                        pxmitpriv->vcs = RTS_CTS;