Commit 7882ef45 authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: rtl8723au: Rewrite update_beacon23a_info() tto use cfg80211_find_ie()

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e3916153
......@@ -789,7 +789,6 @@ OnBeacon23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)
struct sta_priv *pstapriv = &padapter->stapriv;
struct sk_buff *skb = precv_frame->pkt;
struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) skb->data;
u8 *pframe = skb->data;
int pkt_len = skb->len;
struct wlan_bssid_ex *pbss;
int ret = _SUCCESS;
......@@ -869,7 +868,7 @@ OnBeacon23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)
the number of the beacon received */
if ((sta_rx_pkts(psta) & 0xf) == 0) {
/* DBG_8723A("update_bcn_info\n"); */
update_beacon23a_info(padapter, pframe,
update_beacon23a_info(padapter, mgmt,
pkt_len, psta);
}
}
......@@ -881,7 +880,7 @@ OnBeacon23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)
number of the beacon received */
if ((sta_rx_pkts(psta) & 0xf) == 0) {
/* DBG_8723A("update_bcn_info\n"); */
update_beacon23a_info(padapter, pframe,
update_beacon23a_info(padapter, mgmt,
pkt_len, psta);
}
} else {
......
......@@ -633,7 +633,7 @@ void WMMOnAssocRsp23a(struct rtw_adapter *padapter)
return;
}
static void bwmode_update_check(struct rtw_adapter *padapter, u8 *p)
static void bwmode_update_check(struct rtw_adapter *padapter, const u8 *p)
{
struct ieee80211_ht_operation *pHT_info;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
......@@ -774,7 +774,7 @@ void HT_caps_handler23a(struct rtw_adapter *padapter, u8 *p)
return;
}
void HT_info_handler23a(struct rtw_adapter *padapter, u8 *p)
void HT_info_handler23a(struct rtw_adapter *padapter, const u8 *p)
{
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
......@@ -830,7 +830,7 @@ void HTOnAssocRsp23a(struct rtw_adapter *padapter)
rtl8723a_set_ampdu_factor(padapter, max_AMPDU_len);
}
void ERP_IE_handler23a(struct rtw_adapter *padapter, u8 *p)
void ERP_IE_handler23a(struct rtw_adapter *padapter, const u8 *p)
{
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
......@@ -1091,32 +1091,24 @@ int rtw_check_bcn_info23a(struct rtw_adapter *Adapter,
return _FAIL;
}
void update_beacon23a_info(struct rtw_adapter *padapter, u8 *pframe,
void update_beacon23a_info(struct rtw_adapter *padapter,
struct ieee80211_mgmt *mgmt,
uint pkt_len, struct sta_info *psta)
{
unsigned int i;
unsigned int len;
u8 *p;
len = pkt_len -
(_BEACON_IE_OFFSET_ + sizeof(struct ieee80211_hdr_3addr));
const u8 *p;
for (i = 0; i < len;) {
p = (u8 *)(pframe + (_BEACON_IE_OFFSET_ + sizeof(struct ieee80211_hdr_3addr)) + i);
len = pkt_len - offsetof(struct ieee80211_mgmt, u.beacon.variable);
switch (p[0]) {
case WLAN_EID_HT_OPERATION: /* HT info */
/* HT_info_handler23a(padapter, pIE); */
p = cfg80211_find_ie(WLAN_EID_HT_OPERATION, mgmt->u.beacon.variable,
len);
if (p)
bwmode_update_check(padapter, p);
break;
case WLAN_EID_ERP_INFO:
p = cfg80211_find_ie(WLAN_EID_ERP_INFO, mgmt->u.beacon.variable, len);
if (p) {
ERP_IE_handler23a(padapter, p);
VCS_update23a(padapter, psta);
break;
default:
break;
}
i += (p[1] + 2);
}
}
......
......@@ -514,13 +514,14 @@ int WMM_param_handler23a(struct rtw_adapter *padapter, u8 *p);
void WMMOnAssocRsp23a(struct rtw_adapter *padapter);
void HT_caps_handler23a(struct rtw_adapter *padapter, u8 *p);
void HT_info_handler23a(struct rtw_adapter *padapter, u8 *p);
void HT_info_handler23a(struct rtw_adapter *padapter, const u8 *p);
void HTOnAssocRsp23a(struct rtw_adapter *padapter);
void ERP_IE_handler23a(struct rtw_adapter *padapter, u8 *p);
void ERP_IE_handler23a(struct rtw_adapter *padapter, const u8 *p);
void VCS_update23a(struct rtw_adapter *padapter, struct sta_info *psta);
void update_beacon23a_info(struct rtw_adapter *padapter, u8 *pframe, uint len,
void update_beacon23a_info(struct rtw_adapter *padapter,
struct ieee80211_mgmt *mgmt, uint len,
struct sta_info *psta);
int rtw_check_bcn_info23a(struct rtw_adapter *Adapter,
struct ieee80211_mgmt *mgmt, u32 packet_len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment