rtl8188eu: Replace rtw_ieee80211_ht_cap with standard kernel version

As shown in the previous commits, keeping alignment beetween the private header
and the kernel version is a problem. Solve the issue by using the kernel
version.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2015-04-08 13:43:40 -05:00
parent 5e6362f3da
commit 8eb572bc42
10 changed files with 29 additions and 48 deletions

View file

@ -467,7 +467,7 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level)
limit = 8;/* 1R */ limit = 8;/* 1R */
for (i = 0; i < limit; i++) { for (i = 0; i < limit; i++) {
if (psta_ht->ht_cap.supp_mcs_set[i/8] & BIT(i%8)) if (psta_ht->ht_cap.mcs.rx_mask[i/8] & BIT(i%8))
tx_ra_bitmap |= BIT(i+12); tx_ra_bitmap |= BIT(i+12);
} }
@ -1027,7 +1027,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
(pbss_network->IELength - _BEACON_IE_OFFSET_)); (pbss_network->IELength - _BEACON_IE_OFFSET_));
if (p && ie_len > 0) { if (p && ie_len > 0) {
u8 rf_type; u8 rf_type;
struct rtw_ieee80211_ht_cap *pht_cap = (struct rtw_ieee80211_ht_cap *)(p+2); struct ieee80211_ht_cap *pht_cap = (struct ieee80211_ht_cap *)(p+2);
pHT_caps_ie = p; pHT_caps_ie = p;
ht_cap = true; ht_cap = true;
@ -1045,8 +1045,8 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_FACTOR & 0x03); pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_FACTOR & 0x03);
if(rf_type == RF_1T1R) { if(rf_type == RF_1T1R) {
pht_cap->supp_mcs_set[0] = 0xff; pht_cap->mcs.rx_mask[0] = 0xff;
pht_cap->supp_mcs_set[1] = 0x0; pht_cap->mcs.rx_mask[1] = 0x0;
} }
memcpy(&pmlmepriv->htpriv.ht_cap, p+2, ie_len); memcpy(&pmlmepriv->htpriv.ht_cap, p+2, ie_len);
} }

View file

@ -1456,7 +1456,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
__le16 le_tmp; __le16 le_tmp;
u16 wpa_len = 0, rsn_len = 0; u16 wpa_len = 0, rsn_len = 0;
struct HT_info_element *pht_info = NULL; struct HT_info_element *pht_info = NULL;
struct rtw_ieee80211_ht_cap *pht_cap = NULL; struct ieee80211_ht_cap *pht_cap = NULL;
unsigned int len; unsigned int len;
unsigned char *p; unsigned char *p;
@ -1492,7 +1492,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
/* parsing HT_CAP_IE */ /* parsing HT_CAP_IE */
p = rtw_get_ie(pnetwork->network.IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, pnetwork->network.IELength - _FIXED_IE_LENGTH_); p = rtw_get_ie(pnetwork->network.IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, pnetwork->network.IELength - _FIXED_IE_LENGTH_);
if (p && len > 0) { if (p && len > 0) {
pht_cap = (struct rtw_ieee80211_ht_cap *)(p + 2); pht_cap = (struct ieee80211_ht_cap *)(p + 2);
pnetwork->BcnInfo.ht_cap_info = le16_to_cpu(pht_cap->cap_info); pnetwork->BcnInfo.ht_cap_info = le16_to_cpu(pht_cap->cap_info);
} else { } else {
pnetwork->BcnInfo.ht_cap_info = 0; pnetwork->BcnInfo.ht_cap_info = 0;

View file

@ -1007,7 +1007,7 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter)
struct registry_priv *pregistrypriv = &adapter->registrypriv; struct registry_priv *pregistrypriv = &adapter->registrypriv;
struct mlme_priv *pmlmepriv = &adapter->mlmepriv; struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network; struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network;
struct rtw_ieee80211_ht_cap *pht_capie; struct ieee80211_ht_cap *pht_capie;
u8 rf_type = 0; u8 rf_type = 0;
u8 bw_40MHz = 0, short_GI_20 = 0, short_GI_40 = 0; u8 bw_40MHz = 0, short_GI_20 = 0, short_GI_40 = 0;
u16 mcs_rate = 0; u16 mcs_rate = 0;
@ -1025,9 +1025,9 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter)
if (pmlmeext->cur_wireless_mode & (WIRELESS_11_24N|WIRELESS_11_5N)) { if (pmlmeext->cur_wireless_mode & (WIRELESS_11_24N|WIRELESS_11_5N)) {
p = rtw_get_ie(&pcur_bss->IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pcur_bss->IELength-12); p = rtw_get_ie(&pcur_bss->IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pcur_bss->IELength-12);
if (p && ht_ielen > 0) { if (p && ht_ielen > 0) {
pht_capie = (struct rtw_ieee80211_ht_cap *)(p+2); pht_capie = (struct ieee80211_ht_cap *)(p+2);
memcpy(&mcs_rate, pht_capie->supp_mcs_set, 2); memcpy(&mcs_rate , pht_capie->mcs.rx_mask, 2);
/* cur_bwmod is updated by beacon, pmlmeinfo is updated by association response */ /* cur_bwmod is updated by beacon, pmlmeinfo is updated by association response */
bw_40MHz = (pmlmeext->cur_bwmode && (HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH & pmlmeinfo->HT_info.infos[0])) ? 1 : 0; bw_40MHz = (pmlmeext->cur_bwmode && (HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH & pmlmeinfo->HT_info.infos[0])) ? 1 : 0;

View file

@ -2127,7 +2127,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_
u32 ielen, out_len; u32 ielen, out_len;
enum ht_cap_ampdu_factor max_rx_ampdu_factor; enum ht_cap_ampdu_factor max_rx_ampdu_factor;
unsigned char *p; unsigned char *p;
struct rtw_ieee80211_ht_cap ht_capie; struct ieee80211_ht_cap ht_capie;
unsigned char WMM_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00}; unsigned char WMM_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00};
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct qos_priv *pqospriv = &pmlmepriv->qospriv; struct qos_priv *pqospriv = &pmlmepriv->qospriv;
@ -2149,7 +2149,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_
out_len = *pout_len; out_len = *pout_len;
memset(&ht_capie, 0, sizeof(struct rtw_ieee80211_ht_cap)); memset(&ht_capie, 0, sizeof(struct ieee80211_ht_cap));
ht_capie.cap_info = cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH | ht_capie.cap_info = cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH |
IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_20 |
@ -2174,7 +2174,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_
ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&0x00); ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&0x00);
rtw_set_ie(out_ie+out_len, _HT_CAPABILITY_IE_, rtw_set_ie(out_ie+out_len, _HT_CAPABILITY_IE_,
sizeof(struct rtw_ieee80211_ht_cap), (unsigned char *)&ht_capie, pout_len); sizeof(struct ieee80211_ht_cap), (unsigned char *)&ht_capie, pout_len);
phtpriv->ht_option = true; phtpriv->ht_option = true;
@ -2192,7 +2192,7 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len)
{ {
u8 *p, max_ampdu_sz; u8 *p, max_ampdu_sz;
int len; int len;
struct rtw_ieee80211_ht_cap *pht_capie; struct ieee80211_ht_cap *pht_capie;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct ht_priv *phtpriv = &pmlmepriv->htpriv; struct ht_priv *phtpriv = &pmlmepriv->htpriv;
struct registry_priv *pregistrypriv = &padapter->registrypriv; struct registry_priv *pregistrypriv = &padapter->registrypriv;
@ -2221,7 +2221,7 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len)
len = 0; len = 0;
p = rtw_get_ie(pie+sizeof(struct ndis_802_11_fixed_ie), _HT_CAPABILITY_IE_, &len, ie_len-sizeof(struct ndis_802_11_fixed_ie)); p = rtw_get_ie(pie+sizeof(struct ndis_802_11_fixed_ie), _HT_CAPABILITY_IE_, &len, ie_len-sizeof(struct ndis_802_11_fixed_ie));
if (p && len > 0) { if (p && len > 0) {
pht_capie = (struct rtw_ieee80211_ht_cap *)(p+2); pht_capie = (struct ieee80211_ht_cap *)(p+2);
max_ampdu_sz = (pht_capie->ampdu_params_info & IEEE80211_HT_CAP_AMPDU_FACTOR); max_ampdu_sz = (pht_capie->ampdu_params_info & IEEE80211_HT_CAP_AMPDU_FACTOR);
max_ampdu_sz = 1 << (max_ampdu_sz+3); /* max_ampdu_sz (kbytes); */ max_ampdu_sz = 1 << (max_ampdu_sz+3); /* max_ampdu_sz (kbytes); */
phtpriv->rx_ampdu_maxlen = max_ampdu_sz; phtpriv->rx_ampdu_maxlen = max_ampdu_sz;

View file

@ -1304,13 +1304,13 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame
} }
/* save HT capabilities in the sta object */ /* save HT capabilities in the sta object */
memset(&pstat->htpriv.ht_cap, 0, sizeof(struct rtw_ieee80211_ht_cap)); memset(&pstat->htpriv.ht_cap, 0, sizeof(struct ieee80211_ht_cap));
if (elems.ht_capabilities && elems.ht_capabilities_len >= sizeof(struct rtw_ieee80211_ht_cap)) { if (elems.ht_capabilities && elems.ht_capabilities_len >= sizeof(struct ieee80211_ht_cap)) {
pstat->flags |= WLAN_STA_HT; pstat->flags |= WLAN_STA_HT;
pstat->flags |= WLAN_STA_WME; pstat->flags |= WLAN_STA_WME;
memcpy(&pstat->htpriv.ht_cap, elems.ht_capabilities, sizeof(struct rtw_ieee80211_ht_cap)); memcpy(&pstat->htpriv.ht_cap, elems.ht_capabilities, sizeof(struct ieee80211_ht_cap));
} else { } else {
pstat->flags &= ~WLAN_STA_HT; pstat->flags &= ~WLAN_STA_HT;
} }

View file

@ -914,7 +914,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
u8 *pbssid = GetAddr3Ptr(pframe); u8 *pbssid = GetAddr3Ptr(pframe);
u32 hidden_ssid = 0; u32 hidden_ssid = 0;
struct HT_info_element *pht_info = NULL; struct HT_info_element *pht_info = NULL;
struct rtw_ieee80211_ht_cap *pht_cap = NULL; struct ieee80211_ht_cap *pht_cap = NULL;
u32 bcn_channel; u32 bcn_channel;
unsigned short ht_cap_info; unsigned short ht_cap_info;
unsigned char ht_info_infos_0; unsigned char ht_info_infos_0;
@ -954,7 +954,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
/* parsing HT_CAP_IE */ /* parsing HT_CAP_IE */
p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_); p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
if (p && len > 0) { if (p && len > 0) {
pht_cap = (struct rtw_ieee80211_ht_cap *)(p + 2); pht_cap = (struct ieee80211_ht_cap *)(p + 2);
ht_cap_info = le16_to_cpu(pht_cap->cap_info); ht_cap_info = le16_to_cpu(pht_cap->cap_info);
} else { } else {
ht_cap_info = 0; ht_cap_info = 0;

View file

@ -241,7 +241,7 @@ struct ieee_param {
u16 capability; u16 capability;
int flags; int flags;
u8 tx_supp_rates[16]; u8 tx_supp_rates[16];
struct rtw_ieee80211_ht_cap ht_cap; struct ieee80211_ht_cap ht_cap;
} add_sta; } add_sta;
struct { struct {
u8 reserved[2];/* for set max_num_sta */ u8 reserved[2];/* for set max_num_sta */
@ -266,7 +266,7 @@ struct sta_data {
u32 sta_set; u32 sta_set;
u8 tx_supp_rates[16]; u8 tx_supp_rates[16];
u32 tx_supp_rates_len; u32 tx_supp_rates_len;
struct rtw_ieee80211_ht_cap ht_cap; struct ieee80211_ht_cap ht_cap;
u64 rx_pkts; u64 rx_pkts;
u64 rx_bytes; u64 rx_bytes;
u64 rx_drops; u64 rx_drops;

View file

@ -38,7 +38,7 @@ struct ht_priv {
u8 agg_enable_bitmap; u8 agg_enable_bitmap;
u8 candidate_tid_bitmap; u8 candidate_tid_bitmap;
struct rtw_ieee80211_ht_cap ht_cap; struct ieee80211_ht_cap ht_cap;
}; };
#endif /* _RTL871X_HT_H_ */ #endif /* _RTL871X_HT_H_ */

View file

@ -625,26 +625,7 @@ struct rtw_ieee80211_bar {
#define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004 #define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004
/** /**
* struct rtw_ieee80211_ht_cap - HT capabilities * struct ieee80211_ht_cap - HT additional information
*
* This structure refers to "HT capabilities element" as
* described in 802.11n draft section 7.3.2.52
*/
struct rtw_ieee80211_ht_cap {
__le16 cap_info;
u8 ampdu_params_info;
union {
struct ieee80211_mcs_info mcs;
u8 supp_mcs_set[16];
};
__le16 extended_ht_cap_info;
__le32 tx_BF_cap_info;
u8 antenna_selection_info;
} __packed;
/**
* struct rtw_ieee80211_ht_cap - HT additional information
* *
* This structure refers to "HT information element" as * This structure refers to "HT information element" as
* described in 802.11n draft section 7.3.2.53 * described in 802.11n draft section 7.3.2.53

View file

@ -244,11 +244,11 @@ static char *translate_scan(struct adapter *padapter,
p = rtw_get_ie(&pnetwork->network.IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pnetwork->network.IELength-12); p = rtw_get_ie(&pnetwork->network.IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pnetwork->network.IELength-12);
if (p && ht_ielen > 0) { if (p && ht_ielen > 0) {
struct rtw_ieee80211_ht_cap *pht_capie; struct ieee80211_ht_cap *pht_capie;
ht_cap = true; ht_cap = true;
pht_capie = (struct rtw_ieee80211_ht_cap *)(p+2); pht_capie = (struct ieee80211_ht_cap *)(p+2);
memcpy(&mcs_rate, pht_capie->supp_mcs_set, 2); memcpy(&mcs_rate, pht_capie->mcs.rx_mask, 2);
bw_40MHz = (le16_to_cpu(pht_capie->cap_info) & bw_40MHz = (le16_to_cpu(pht_capie->cap_info) &
IEEE80211_HT_CAP_SUP_WIDTH) ? 1 : 0; IEEE80211_HT_CAP_SUP_WIDTH) ? 1 : 0;
short_GI = (le16_to_cpu(pht_capie->cap_info) & short_GI = (le16_to_cpu(pht_capie->cap_info) &
@ -5173,7 +5173,7 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param)
if (WLAN_STA_HT&flags) { if (WLAN_STA_HT&flags) {
psta->htpriv.ht_option = true; psta->htpriv.ht_option = true;
psta->qos_option = 1; psta->qos_option = 1;
memcpy((void *)&psta->htpriv.ht_cap, (void *)&param->u.add_sta.ht_cap, sizeof(struct rtw_ieee80211_ht_cap)); memcpy((void *)&psta->htpriv.ht_cap, (void *)&param->u.add_sta.ht_cap, sizeof(struct ieee80211_ht_cap));
} else { } else {
psta->htpriv.ht_option = false; psta->htpriv.ht_option = false;
} }
@ -5269,7 +5269,7 @@ static int rtw_ioctl_get_sta_data(struct net_device *dev, struct ieee_param *par
(psta->ht_20mhz_set << 5)); (psta->ht_20mhz_set << 5));
psta_data->tx_supp_rates_len = psta->bssratelen; psta_data->tx_supp_rates_len = psta->bssratelen;
memcpy(psta_data->tx_supp_rates, psta->bssrateset, psta->bssratelen); memcpy(psta_data->tx_supp_rates, psta->bssrateset, psta->bssratelen);
memcpy(&psta_data->ht_cap, &psta->htpriv.ht_cap, sizeof(struct rtw_ieee80211_ht_cap)); memcpy(&psta_data->ht_cap, &psta->htpriv.ht_cap, sizeof(struct ieee80211_ht_cap));
psta_data->rx_pkts = psta->sta_stats.rx_data_pkts; psta_data->rx_pkts = psta->sta_stats.rx_data_pkts;
psta_data->rx_bytes = psta->sta_stats.rx_bytes; psta_data->rx_bytes = psta->sta_stats.rx_bytes;
psta_data->rx_drops = psta->sta_stats.rx_drops; psta_data->rx_drops = psta->sta_stats.rx_drops;