From: Jes Sorensen Date: Tue, 15 Apr 2014 17:43:54 +0000 (+0200) Subject: staging: rtl8723au: rtw_update_protection23a(): Use cfg80211_find_ie() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4bf954b2f93e5c0e5389d40fb34a0595038dc817;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git staging: rtl8723au: rtw_update_protection23a(): Use cfg80211_find_ie() Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c b/drivers/staging/rtl8723au/core/rtw_xmit.c index c0eaf5e21057..e7252d16c989 100644 --- a/drivers/staging/rtl8723au/core/rtw_xmit.c +++ b/drivers/staging/rtl8723au/core/rtw_xmit.c @@ -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;