struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
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;
bcn_interval = (u16)pnetwork->BeaconPeriod;
pnetwork->IEs + bcn_fixed_size,
pnetwork->IELength - bcn_fixed_size);
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 */
cur_bwmode = HT_CHANNEL_WIDTH_40;
- switch (pht_info->infos[0] & 0x3) {
- case 1:
+ switch (pht_info->ht_param &
+ IEEE80211_HT_PARAM_CHA_SEC_OFFSET) {
+ case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
/* pmlmeext->cur_ch_offset =
HAL_PRIME_CHNL_OFFSET_LOWER; */
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER;
break;
- case 3:
+ case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER;
break;
default:
u8 bencrypt = 0;
/* u8 wpa_ie[255], rsn_ie[255]; */
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;
const u8 *p;
pnetwork->network.IEs + _FIXED_IE_LENGTH_,
pnetwork->network.IELength - _FIXED_IE_LENGTH_);
if (p && p[1] > 0) {
- pht_info = (struct HT_info_element *)(p + 2);
- pnetwork->BcnInfo.ht_info_infos_0 = pht_info->infos[0];
+ pht_info = (struct ieee80211_ht_operation *)(p + 2);
+ pnetwork->BcnInfo.ht_info_infos_0 = pht_info->ht_param;
} else
pnetwork->BcnInfo.ht_info_infos_0 = 0;
}
/* cur_bwmod is updated by beacon, pmlmeinfo is
updated by association response */
bw_40MHz = (pmlmeext->cur_bwmode &&
- (IEEE80211_HT_PARAM_CHAN_WIDTH_ANY &
- pmlmeinfo->HT_info.infos[0])) ? 1:0;
+ (pmlmeinfo->HT_info.ht_param &
+ IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) ? 1:0;
/* short_GI = (pht_capie->cap_info & (IEEE80211_HT_CAP
_SGI_20|IEEE80211_HT_CAP_SGI_40)) ? 1 : 0; */
if (pregistrypriv->cbw40_enable &&
pmlmeinfo->ht_cap.cap_info &
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;
u8 rf_type;
}
/* switch to the 40M Hz mode accoring to the AP */
pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40;
- switch ((pmlmeinfo->HT_info.infos[0] & 0x3))
- {
- case HT_EXTCHNL_OFFSET_UPPER:
+ switch (pmlmeinfo->HT_info.ht_param &
+ IEEE80211_HT_PARAM_CHAN_WIDTH_ANY) {
+ case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER;
break;
- case HT_EXTCHNL_OFFSET_LOWER:
+ case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER;
break;
/* */
/* 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,
bssid->IEs + ie_offset,
bssid->IELength - ie_offset);
if (p) {
- struct HT_info_element *HT_info =
- (struct HT_info_element *)(p + 2);
- bssid->DSConfig = HT_info->primary_channel;
+ struct ieee80211_ht_operation *HT_info =
+ (struct ieee80211_ht_operation *)(p + 2);
+ bssid->DSConfig = HT_info->primary_chan;
} else /* use current channel */
bssid->DSConfig = rtw_get_oper_ch23a(padapter);
}
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
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;
int bcn_fixed_size;
u8 *p;
/* spec case only for cisco's ap because cisco's ap
* 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) &&
- (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 according to AP */
pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40;
- switch (pht_info->infos[0] & 0x3)
- {
- case 1:
+ switch (pht_info->ht_param &
+ IEEE80211_HT_PARAM_CHA_SEC_OFFSET) {
+ case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
pmlmeext->cur_ch_offset =
HAL_PRIME_CHNL_OFFSET_LOWER;
break;
- case 3:
+ case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
pmlmeext->cur_ch_offset =
HAL_PRIME_CHNL_OFFSET_UPPER;
break;
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_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
return;
if (!phtpriv->ht_option)
return;
- if (p[1] > sizeof(struct HT_info_element))
+ if (p[1] != sizeof(struct ieee80211_ht_operation))
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;
- switch (pHT_info->infos[0] & 0x3) {
- case 1:
+ switch (pHT_info->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET){
+ case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
new_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER;
break;
- case 3:
+ case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
new_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER;
break;
default:
if (phtpriv->ht_option == false)
return;
- if (p[1] > sizeof(struct HT_info_element))
+ if (p[1] != sizeof(struct ieee80211_ht_operation))
return;
pmlmeinfo->HT_info_enable = 1;
struct ieee80211_mgmt *mgmt, u32 pkt_len)
{
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 wlan_bssid_ex *bssid;
unsigned short val16;
/* parsing HT_INFO_IE */
p = cfg80211_find_ie(WLAN_EID_HT_OPERATION, pie, pie_len);
if (p && p[1] > 0) {
- pht_info = (struct HT_info_element *)(p + 2);
- ht_info_infos_0 = pht_info->infos[0];
+ pht_info = (struct ieee80211_ht_operation *)(p + 2);
+ ht_info_infos_0 = pht_info->ht_param;
} else {
pht_info = NULL;
ht_info_infos_0 = 0;
p = cfg80211_find_ie(WLAN_EID_HT_OPERATION, pie, pie_len);
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 */
DBG_8723A("Oops: %s we don't find channel IE, so don't "
"check it\n", __func__);
struct ADDBA_request ADDBA_req;
struct WMM_para_element WMM_param;
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 FW_Sta_Info FW_sta_info[NUM_STA];
};
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. */
enum {
RF_1T2R = 0,
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 {
unsigned char ACI_AIFSN;
unsigned char CW;