Commit 4dc5f8ba authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: rtl8723au: Eliminate struct HT_info_element

Yet another duplicate version of struct ieee80211_ht_operation
Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6594c965
...@@ -652,7 +652,7 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf) ...@@ -652,7 +652,7 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf)
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
struct wlan_bssid_ex *pnetwork_mlmeext = &pmlmeinfo->network; struct wlan_bssid_ex *pnetwork_mlmeext = &pmlmeinfo->network;
struct HT_info_element *pht_info = NULL; struct ieee80211_ht_operation *pht_info = NULL;
int bcn_fixed_size; int bcn_fixed_size;
bcn_interval = (u16)pnetwork->BeaconPeriod; bcn_interval = (u16)pnetwork->BeaconPeriod;
...@@ -736,18 +736,20 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf) ...@@ -736,18 +736,20 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf)
pnetwork->IEs + bcn_fixed_size, pnetwork->IEs + bcn_fixed_size,
pnetwork->IELength - bcn_fixed_size); pnetwork->IELength - bcn_fixed_size);
if (p && p[1]) { if (p && p[1]) {
pht_info = (struct HT_info_element *)(p + 2); pht_info = (struct ieee80211_ht_operation *)(p + 2);
if (pregpriv->cbw40_enable && pht_info->infos[0] & BIT(2)) { if (pregpriv->cbw40_enable && pht_info->ht_param &
IEEE80211_HT_PARAM_CHAN_WIDTH_ANY) {
/* switch to the 40M Hz mode */ /* switch to the 40M Hz mode */
cur_bwmode = HT_CHANNEL_WIDTH_40; cur_bwmode = HT_CHANNEL_WIDTH_40;
switch (pht_info->infos[0] & 0x3) { switch (pht_info->ht_param &
case 1: IEEE80211_HT_PARAM_CHA_SEC_OFFSET) {
case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
/* pmlmeext->cur_ch_offset = /* pmlmeext->cur_ch_offset =
HAL_PRIME_CHNL_OFFSET_LOWER; */ HAL_PRIME_CHNL_OFFSET_LOWER; */
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER; cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER;
break; break;
case 3: case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER; cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER;
break; break;
default: default:
......
...@@ -859,7 +859,7 @@ void rtw_get_bcn_info23a(struct wlan_network *pnetwork) ...@@ -859,7 +859,7 @@ void rtw_get_bcn_info23a(struct wlan_network *pnetwork)
u8 bencrypt = 0; u8 bencrypt = 0;
/* u8 wpa_ie[255], rsn_ie[255]; */ /* u8 wpa_ie[255], rsn_ie[255]; */
u16 wpa_len = 0, rsn_len = 0; u16 wpa_len = 0, rsn_len = 0;
struct HT_info_element *pht_info; struct ieee80211_ht_operation *pht_info;
struct ieee80211_ht_cap *pht_cap; struct ieee80211_ht_cap *pht_cap;
const u8 *p; const u8 *p;
...@@ -916,8 +916,8 @@ void rtw_get_bcn_info23a(struct wlan_network *pnetwork) ...@@ -916,8 +916,8 @@ void rtw_get_bcn_info23a(struct wlan_network *pnetwork)
pnetwork->network.IEs + _FIXED_IE_LENGTH_, pnetwork->network.IEs + _FIXED_IE_LENGTH_,
pnetwork->network.IELength - _FIXED_IE_LENGTH_); pnetwork->network.IELength - _FIXED_IE_LENGTH_);
if (p && p[1] > 0) { if (p && p[1] > 0) {
pht_info = (struct HT_info_element *)(p + 2); pht_info = (struct ieee80211_ht_operation *)(p + 2);
pnetwork->BcnInfo.ht_info_infos_0 = pht_info->infos[0]; pnetwork->BcnInfo.ht_info_infos_0 = pht_info->ht_param;
} else } else
pnetwork->BcnInfo.ht_info_infos_0 = 0; pnetwork->BcnInfo.ht_info_infos_0 = 0;
} }
......
...@@ -394,8 +394,8 @@ u16 rtw_get_cur_max_rate23a(struct rtw_adapter *adapter) ...@@ -394,8 +394,8 @@ u16 rtw_get_cur_max_rate23a(struct rtw_adapter *adapter)
/* cur_bwmod is updated by beacon, pmlmeinfo is /* cur_bwmod is updated by beacon, pmlmeinfo is
updated by association response */ updated by association response */
bw_40MHz = (pmlmeext->cur_bwmode && bw_40MHz = (pmlmeext->cur_bwmode &&
(IEEE80211_HT_PARAM_CHAN_WIDTH_ANY & (pmlmeinfo->HT_info.ht_param &
pmlmeinfo->HT_info.infos[0])) ? 1:0; IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) ? 1:0;
/* short_GI = (pht_capie->cap_info & (IEEE80211_HT_CAP /* short_GI = (pht_capie->cap_info & (IEEE80211_HT_CAP
_SGI_20|IEEE80211_HT_CAP_SGI_40)) ? 1 : 0; */ _SGI_20|IEEE80211_HT_CAP_SGI_40)) ? 1 : 0; */
......
...@@ -2322,7 +2322,7 @@ void rtw_update_ht_cap23a(struct rtw_adapter *padapter, u8 *pie, uint ie_len) ...@@ -2322,7 +2322,7 @@ void rtw_update_ht_cap23a(struct rtw_adapter *padapter, u8 *pie, uint ie_len)
if (pregistrypriv->cbw40_enable && if (pregistrypriv->cbw40_enable &&
pmlmeinfo->ht_cap.cap_info & pmlmeinfo->ht_cap.cap_info &
cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH_20_40) && cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH_20_40) &&
pmlmeinfo->HT_info.infos[0] & BIT(2)) { pmlmeinfo->HT_info.ht_param & IEEE80211_HT_PARAM_CHAN_WIDTH_ANY) {
int i; int i;
u8 rf_type; u8 rf_type;
...@@ -2339,13 +2339,13 @@ void rtw_update_ht_cap23a(struct rtw_adapter *padapter, u8 *pie, uint ie_len) ...@@ -2339,13 +2339,13 @@ void rtw_update_ht_cap23a(struct rtw_adapter *padapter, u8 *pie, uint ie_len)
} }
/* switch to the 40M Hz mode accoring to the AP */ /* switch to the 40M Hz mode accoring to the AP */
pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40; pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40;
switch ((pmlmeinfo->HT_info.infos[0] & 0x3)) switch (pmlmeinfo->HT_info.ht_param &
{ IEEE80211_HT_PARAM_CHAN_WIDTH_ANY) {
case HT_EXTCHNL_OFFSET_UPPER: case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER; pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER;
break; break;
case HT_EXTCHNL_OFFSET_LOWER: case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER; pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER;
break; break;
...@@ -2368,7 +2368,9 @@ void rtw_update_ht_cap23a(struct rtw_adapter *padapter, u8 *pie, uint ie_len) ...@@ -2368,7 +2368,9 @@ void rtw_update_ht_cap23a(struct rtw_adapter *padapter, u8 *pie, uint ie_len)
/* */ /* */
/* Config current HT Protection mode. */ /* Config current HT Protection mode. */
/* */ /* */
pmlmeinfo->HT_protection = pmlmeinfo->HT_info.infos[1] & 0x3; pmlmeinfo->HT_protection =
le16_to_cpu(pmlmeinfo->HT_info.operation_mode) &
IEEE80211_HT_OP_MODE_PROTECTION;
} }
void rtw_issue_addbareq_cmd23a(struct rtw_adapter *padapter, void rtw_issue_addbareq_cmd23a(struct rtw_adapter *padapter,
......
...@@ -4640,9 +4640,9 @@ int collect_bss_info23a(struct rtw_adapter *padapter, ...@@ -4640,9 +4640,9 @@ int collect_bss_info23a(struct rtw_adapter *padapter,
bssid->IEs + ie_offset, bssid->IEs + ie_offset,
bssid->IELength - ie_offset); bssid->IELength - ie_offset);
if (p) { if (p) {
struct HT_info_element *HT_info = struct ieee80211_ht_operation *HT_info =
(struct HT_info_element *)(p + 2); (struct ieee80211_ht_operation *)(p + 2);
bssid->DSConfig = HT_info->primary_channel; bssid->DSConfig = HT_info->primary_chan;
} else /* use current channel */ } else /* use current channel */
bssid->DSConfig = rtw_get_oper_ch23a(padapter); bssid->DSConfig = rtw_get_oper_ch23a(padapter);
} }
...@@ -5959,7 +5959,7 @@ int join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf) ...@@ -5959,7 +5959,7 @@ int join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network; struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
const struct wlan_bssid_ex *pparm = (struct wlan_bssid_ex *)pbuf; const struct wlan_bssid_ex *pparm = (struct wlan_bssid_ex *)pbuf;
struct HT_info_element *pht_info; struct ieee80211_ht_operation *pht_info;
u32 i; u32 i;
int bcn_fixed_size; int bcn_fixed_size;
u8 *p; u8 *p;
...@@ -6028,20 +6028,21 @@ int join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf) ...@@ -6028,20 +6028,21 @@ int join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
/* spec case only for cisco's ap because cisco's ap /* spec case only for cisco's ap because cisco's ap
* issue assoc rsp using mcs rate @40MHz or @20MHz */ * issue assoc rsp using mcs rate @40MHz or @20MHz */
pht_info = (struct HT_info_element *)(p + 2); pht_info = (struct ieee80211_ht_operation *)(p + 2);
if ((pregpriv->cbw40_enable) && if (pregpriv->cbw40_enable &&
(pht_info->infos[0] & BIT(2))) { (pht_info->ht_param &
IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) {
/* switch to the 40M Hz mode according to AP */ /* switch to the 40M Hz mode according to AP */
pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40; pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40;
switch (pht_info->infos[0] & 0x3) switch (pht_info->ht_param &
{ IEEE80211_HT_PARAM_CHA_SEC_OFFSET) {
case 1: case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
pmlmeext->cur_ch_offset = pmlmeext->cur_ch_offset =
HAL_PRIME_CHNL_OFFSET_LOWER; HAL_PRIME_CHNL_OFFSET_LOWER;
break; break;
case 3: case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
pmlmeext->cur_ch_offset = pmlmeext->cur_ch_offset =
HAL_PRIME_CHNL_OFFSET_UPPER; HAL_PRIME_CHNL_OFFSET_UPPER;
break; break;
......
...@@ -635,7 +635,7 @@ void WMMOnAssocRsp23a(struct rtw_adapter *padapter) ...@@ -635,7 +635,7 @@ void WMMOnAssocRsp23a(struct rtw_adapter *padapter)
static void bwmode_update_check(struct rtw_adapter *padapter, u8 *p) static void bwmode_update_check(struct rtw_adapter *padapter, u8 *p)
{ {
struct HT_info_element *pHT_info; struct ieee80211_ht_operation *pHT_info;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
...@@ -648,19 +648,20 @@ static void bwmode_update_check(struct rtw_adapter *padapter, u8 *p) ...@@ -648,19 +648,20 @@ static void bwmode_update_check(struct rtw_adapter *padapter, u8 *p)
return; return;
if (!phtpriv->ht_option) if (!phtpriv->ht_option)
return; return;
if (p[1] > sizeof(struct HT_info_element)) if (p[1] != sizeof(struct ieee80211_ht_operation))
return; return;
pHT_info = (struct HT_info_element *)(p + 2); pHT_info = (struct ieee80211_ht_operation *)(p + 2);
if ((pHT_info->infos[0] & BIT(2)) && pregistrypriv->cbw40_enable) { if ((pHT_info->ht_param & IEEE80211_HT_PARAM_CHAN_WIDTH_ANY) &&
pregistrypriv->cbw40_enable) {
new_bwmode = HT_CHANNEL_WIDTH_40; new_bwmode = HT_CHANNEL_WIDTH_40;
switch (pHT_info->infos[0] & 0x3) { switch (pHT_info->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET){
case 1: case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
new_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER; new_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER;
break; break;
case 3: case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
new_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER; new_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER;
break; break;
default: default:
...@@ -786,7 +787,7 @@ void HT_info_handler23a(struct rtw_adapter *padapter, u8 *p) ...@@ -786,7 +787,7 @@ void HT_info_handler23a(struct rtw_adapter *padapter, u8 *p)
if (phtpriv->ht_option == false) if (phtpriv->ht_option == false)
return; return;
if (p[1] > sizeof(struct HT_info_element)) if (p[1] != sizeof(struct ieee80211_ht_operation))
return; return;
pmlmeinfo->HT_info_enable = 1; pmlmeinfo->HT_info_enable = 1;
...@@ -883,7 +884,7 @@ int rtw_check_bcn_info23a(struct rtw_adapter *Adapter, ...@@ -883,7 +884,7 @@ int rtw_check_bcn_info23a(struct rtw_adapter *Adapter,
struct ieee80211_mgmt *mgmt, u32 pkt_len) struct ieee80211_mgmt *mgmt, u32 pkt_len)
{ {
struct wlan_network *cur_network = &Adapter->mlmepriv.cur_network; struct wlan_network *cur_network = &Adapter->mlmepriv.cur_network;
struct HT_info_element *pht_info; struct ieee80211_ht_operation *pht_info;
struct ieee80211_ht_cap *pht_cap; struct ieee80211_ht_cap *pht_cap;
struct wlan_bssid_ex *bssid; struct wlan_bssid_ex *bssid;
unsigned short val16; unsigned short val16;
...@@ -952,8 +953,8 @@ int rtw_check_bcn_info23a(struct rtw_adapter *Adapter, ...@@ -952,8 +953,8 @@ int rtw_check_bcn_info23a(struct rtw_adapter *Adapter,
/* parsing HT_INFO_IE */ /* parsing HT_INFO_IE */
p = cfg80211_find_ie(WLAN_EID_HT_OPERATION, pie, pie_len); p = cfg80211_find_ie(WLAN_EID_HT_OPERATION, pie, pie_len);
if (p && p[1] > 0) { if (p && p[1] > 0) {
pht_info = (struct HT_info_element *)(p + 2); pht_info = (struct ieee80211_ht_operation *)(p + 2);
ht_info_infos_0 = pht_info->infos[0]; ht_info_infos_0 = pht_info->ht_param;
} else { } else {
pht_info = NULL; pht_info = NULL;
ht_info_infos_0 = 0; ht_info_infos_0 = 0;
...@@ -985,7 +986,7 @@ int rtw_check_bcn_info23a(struct rtw_adapter *Adapter, ...@@ -985,7 +986,7 @@ int rtw_check_bcn_info23a(struct rtw_adapter *Adapter,
p = cfg80211_find_ie(WLAN_EID_HT_OPERATION, pie, pie_len); p = cfg80211_find_ie(WLAN_EID_HT_OPERATION, pie, pie_len);
if (pht_info) if (pht_info)
bcn_channel = pht_info->primary_channel; bcn_channel = pht_info->primary_chan;
else { /* we don't find channel IE, so don't check it */ else { /* we don't find channel IE, so don't check it */
DBG_8723A("Oops: %s we don't find channel IE, so don't " DBG_8723A("Oops: %s we don't find channel IE, so don't "
"check it\n", __func__); "check it\n", __func__);
......
...@@ -367,7 +367,7 @@ struct mlme_ext_info ...@@ -367,7 +367,7 @@ struct mlme_ext_info
struct ADDBA_request ADDBA_req; struct ADDBA_request ADDBA_req;
struct WMM_para_element WMM_param; struct WMM_para_element WMM_param;
struct ieee80211_ht_cap ht_cap; struct ieee80211_ht_cap ht_cap;
struct HT_info_element HT_info; struct ieee80211_ht_operation HT_info;
struct wlan_bssid_ex network;/* join network or bss_network, if in ap mode, it is the same to cur_network.network */ struct wlan_bssid_ex network;/* join network or bss_network, if in ap mode, it is the same to cur_network.network */
struct FW_Sta_Info FW_sta_info[NUM_STA]; struct FW_Sta_Info FW_sta_info[NUM_STA];
}; };
......
...@@ -89,17 +89,6 @@ enum ht_channel_width { ...@@ -89,17 +89,6 @@ enum ht_channel_width {
HT_CHANNEL_WIDTH_10 = 4, HT_CHANNEL_WIDTH_10 = 4,
}; };
/* */
/* Represent Extention Channel Offset in HT Capabilities */
/* This is available only in 40Mhz mode. */
/* */
enum {
HT_EXTCHNL_OFFSET_NO_EXT = 0,
HT_EXTCHNL_OFFSET_UPPER = 1,
HT_EXTCHNL_OFFSET_NO_DEF = 2,
HT_EXTCHNL_OFFSET_LOWER = 3,
};
/* 2007/11/15 MH Define different RF type. */ /* 2007/11/15 MH Define different RF type. */
enum { enum {
RF_1T2R = 0, RF_1T2R = 0,
......
...@@ -63,17 +63,6 @@ ...@@ -63,17 +63,6 @@
Below is the definition for 802.11n Below is the definition for 802.11n
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
/* struct rtw_ieee80211_ht_cap - HT additional information
*
* This structure refers to "HT information element" as
* described in 802.11n draft section 7.3.2.53
*/
struct HT_info_element {
unsigned char primary_channel;
unsigned char infos[5];
unsigned char MCS_rate[16];
} __packed;
struct AC_param { struct AC_param {
unsigned char ACI_AIFSN; unsigned char ACI_AIFSN;
unsigned char CW; unsigned char CW;
......
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