replace rtw_ieee80211_ht_cap with ieee80211_ht_cap

port 042ca34b9ab19d0a52c3b01862a6c07fcb032e86
This commit is contained in:
Carlos Garces 2021-10-18 17:09:47 +02:00
parent b4be42500f
commit 04a730b326
11 changed files with 34 additions and 50 deletions

View File

@ -2242,7 +2242,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
if (p && ie_len > 0) {
u8 rf_type = 0;
enum ieee80211_max_ampdu_length_exp max_rx_ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K;
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);
if (0) {
RTW_INFO(FUNC_ADPT_FMT" HT_CAP_IE from upper layer:\n", FUNC_ADPT_ARG(padapter));
@ -5416,11 +5416,11 @@ void rtw_ap_parse_sta_ht_ie(_adapter *adapter, struct sta_info *sta, struct rtw_
goto exit;
/* save HT capabilities in the sta object */
memset(&sta->htpriv.ht_cap, 0, sizeof(struct rtw_ieee80211_ht_cap));
if (elems->ht_capabilities && elems->ht_capabilities_len >= sizeof(struct rtw_ieee80211_ht_cap)) {
memset(&sta->htpriv.ht_cap, 0, sizeof(struct ieee80211_ht_cap));
if (elems->ht_capabilities && elems->ht_capabilities_len >= sizeof(struct ieee80211_ht_cap)) {
sta->flags |= WLAN_STA_HT;
sta->flags |= WLAN_STA_WME;
memcpy(&sta->htpriv.ht_cap, elems->ht_capabilities, sizeof(struct rtw_ieee80211_ht_cap));
memcpy(&sta->htpriv.ht_cap, elems->ht_capabilities, sizeof(struct ieee80211_ht_cap));
if (elems->ht_operation && elems->ht_operation_len == HT_OP_IE_LEN) {
memcpy(sta->htpriv.ht_op, elems->ht_operation, HT_OP_IE_LEN);

View File

@ -733,7 +733,7 @@ u16 rtw_get_cur_max_rate(_adapter *adapter)
max_rate = rtw_mcs_rate(rf_type
, (psta->cmn.bw_mode == CHANNEL_WIDTH_40) ? 1 : 0
, short_GI
, psta->htpriv.ht_cap.supp_mcs_set
, psta->htpriv.ht_cap.mcs.rx_mask
);
}
#ifdef CONFIG_80211AC_VHT

View File

@ -4621,7 +4621,7 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui
enum ieee80211_max_ampdu_length_exp max_rx_ampdu_factor;
enum ieee80211_min_mpdu_spacing best_ampdu_density;
unsigned char *p, *pframe;
struct rtw_ieee80211_ht_cap ht_capie;
struct ieee80211_ht_cap ht_capie;
u8 cbw40_enable = 0, rf_type = 0, rf_num = 0, rx_stbc_nss = 0, rx_nss = 0;
struct registry_priv *pregistrypriv = &padapter->registrypriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@ -4637,7 +4637,7 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui
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 = IEEE80211_HT_CAP_DSSSCCK40;
@ -4741,7 +4741,7 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui
}
/* fill default supported_mcs_set */
memcpy(ht_capie.supp_mcs_set, pmlmeext->default_supported_mcs_set, 16);
memcpy(ht_capie.mcs.rx_mask, pmlmeext->default_supported_mcs_set, 16);
/* update default supported_mcs_set */
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
@ -4749,21 +4749,21 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui
switch (rx_nss) {
case 1:
set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_1R);
set_mcs_rate_by_mask(ht_capie.mcs.rx_mask, MCS_RATE_1R);
break;
case 2:
#ifdef CONFIG_DISABLE_MCS13TO15
if (cbw40_enable && pregistrypriv->wifi_spec != 1)
set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_2R_13TO15_OFF);
set_mcs_rate_by_mask(ht_capie.mcs.rx_mask, MCS_RATE_2R_13TO15_OFF);
else
#endif
set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_2R);
set_mcs_rate_by_mask(ht_capie.mcs.rx_mask, MCS_RATE_2R);
break;
case 3:
set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_3R);
set_mcs_rate_by_mask(ht_capie.mcs.rx_mask, MCS_RATE_3R);
break;
case 4:
set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_4R);
set_mcs_rate_by_mask(ht_capie.mcs.rx_mask, MCS_RATE_4R);
break;
default:
RTW_WARN("rf_type:%d or rx_nss:%u is not expected\n", rf_type, hal_spec->rx_nss_num);
@ -4847,7 +4847,7 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui
#endif/*CONFIG_BEAMFORMING*/
pframe = rtw_set_ie(out_ie + out_len, WLAN_EID_HT_CAPABILITY,
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;
@ -4869,7 +4869,7 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len, u8 channel)
u8 *p, max_ampdu_sz;
int len;
/* struct sta_info *bmc_sta, *psta; */
struct rtw_ieee80211_ht_cap *pht_capie;
struct ieee80211_ht_cap *pht_capie;
struct ieee80211_ht_addt_info *pht_addtinfo;
/* struct recv_reorder_ctrl *preorder_ctrl; */
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@ -4905,7 +4905,7 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len, u8 channel)
len = 0;
p = rtw_get_ie(pie + sizeof(NDIS_802_11_FIXED_IEs), WLAN_EID_HT_CAPABILITY, &len, ie_len - sizeof(NDIS_802_11_FIXED_IEs));
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_AMPDU_PARM_FACTOR);
max_ampdu_sz = 1 << (max_ampdu_sz + 3); /* max_ampdu_sz (kbytes); */

View File

@ -3473,7 +3473,7 @@ u8 rx_ampdu_size_sta_limit(_adapter *adapter, struct sta_info *sta)
#endif
if (is_supported_ht(sta->wireless_mode)) {
nss = rtw_min(rtw_ht_mcsset_to_nss(mlmeinfo->HT_caps.u.HT_cap_element.MCS_rate)
, rtw_ht_mcsset_to_nss(sta->htpriv.ht_cap.supp_mcs_set));
, rtw_ht_mcsset_to_nss(sta->htpriv.ht_cap.mcs.rx_mask));
}
if (nss >= 1)
@ -12190,7 +12190,7 @@ void update_sta_info(_adapter *padapter, struct sta_info *psta)
psta->htpriv.stbc_cap = pmlmepriv->htpriv.stbc_cap;
psta->htpriv.beamform_cap = pmlmepriv->htpriv.beamform_cap;
memcpy(&psta->htpriv.ht_cap, &pmlmeinfo->HT_caps, sizeof(struct rtw_ieee80211_ht_cap));
memcpy(&psta->htpriv.ht_cap, &pmlmeinfo->HT_caps, sizeof(struct ieee80211_ht_cap));
#ifdef CONFIG_BEAMFORMING
psta->htpriv.beamform_cap = pmlmepriv->htpriv.beamform_cap;
psta->cmn.bf_info.ht_beamform_cap = pmlmepriv->htpriv.beamform_cap;

View File

@ -425,12 +425,12 @@ void rtw_tdls_process_ht_cap(_adapter *padapter, struct sta_info *ptdls_sta, u8
u8 cur_ldpc_cap = 0, cur_stbc_cap = 0, cur_beamform_cap = 0;
/* Save HT capabilities in the sta object */
memset(&ptdls_sta->htpriv.ht_cap, 0, sizeof(struct rtw_ieee80211_ht_cap));
if (data && Length >= sizeof(struct rtw_ieee80211_ht_cap)) {
memset(&ptdls_sta->htpriv.ht_cap, 0, sizeof(struct ieee80211_ht_cap));
if (data && Length >= sizeof(struct ieee80211_ht_cap)) {
ptdls_sta->flags |= WLAN_STA_HT;
ptdls_sta->flags |= WLAN_STA_WME;
memcpy(&ptdls_sta->htpriv.ht_cap, data, sizeof(struct rtw_ieee80211_ht_cap));
memcpy(&ptdls_sta->htpriv.ht_cap, data, sizeof(struct ieee80211_ht_cap));
} else {
ptdls_sta->flags &= ~WLAN_STA_HT;
return;

View File

@ -154,7 +154,7 @@ s8 rtw_get_sta_rx_nss(_adapter *adapter, struct sta_info *psta)
else
#endif /* CONFIG_80211AC_VHT */
if (psta->htpriv.ht_option)
nss = rtw_min(nss, rtw_ht_mcsset_to_nss(psta->htpriv.ht_cap.supp_mcs_set));
nss = rtw_min(nss, rtw_ht_mcsset_to_nss(psta->htpriv.ht_cap.mcs.rx_mask));
#endif /*CONFIG_80211N_HT*/
RTW_INFO("%s: %d SS\n", __func__, nss);
return nss;
@ -183,7 +183,7 @@ s8 rtw_get_sta_tx_nss(_adapter *adapter, struct sta_info *psta)
else
#endif /* CONFIG_80211AC_VHT */
if (psta->htpriv.ht_option)
nss = rtw_min(nss, rtw_ht_mcsset_to_nss(psta->htpriv.ht_cap.supp_mcs_set));
nss = rtw_min(nss, rtw_ht_mcsset_to_nss(psta->htpriv.ht_cap.mcs.rx_mask));
#endif /*CONFIG_80211N_HT*/
RTW_INFO("%s: %d SS\n", __func__, nss);
return nss;

View File

@ -2088,7 +2088,7 @@ if (padapter->registrypriv.ht_enable && is_supported_ht(padapter->registrypriv.w
}
}
tmp64 = rtw_ht_mcs_set_to_bitmap(psta->htpriv.ht_cap.supp_mcs_set, tx_nss);
tmp64 = rtw_ht_mcs_set_to_bitmap(psta->htpriv.ht_cap.mcs.rx_mask, tx_nss);
tx_ra_bitmap |= (tmp64 << 12);
}
}

View File

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

View File

@ -46,7 +46,7 @@ struct ht_priv {
u8 op_present:1; /* ht_op is present */
struct rtw_ieee80211_ht_cap ht_cap;
struct ieee80211_ht_cap ht_cap;
u8 ht_op[HT_OP_IE_LEN];
};

View File

@ -566,23 +566,7 @@ struct rtw_ieee80211_bar {
#endif
/**
* struct rtw_ieee80211_ht_cap - HT capabilities
*
* This structure refers to "HT capabilities element" as
* described in 802.11n draft section 7.3.2.52
*/
struct rtw_ieee80211_ht_cap {
unsigned short cap_info;
unsigned char ampdu_params_info;
unsigned char supp_mcs_set[16];
unsigned short extended_ht_cap_info;
unsigned int tx_BF_cap_info;
unsigned char antenna_selection_info;
} __attribute__((packed));
/**
* struct rtw_ieee80211_ht_cap - HT additional information
* struct ieee80211_ht_cap - HT additional information
*
* This structure refers to "HT information element" as
* described in 802.11n draft section 7.3.2.53

View File

@ -425,10 +425,10 @@ static inline char *iwe_stream_rate_process(_adapter *padapter,
if(is_supported_ht(padapter->registrypriv.wireless_mode)) {
p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], WLAN_EID_HT_CAPABILITY, &ht_ielen, pnetwork->network.IELength - ie_offset);
if (p && ht_ielen > 0) {
struct rtw_ieee80211_ht_cap *pht_capie;
struct ieee80211_ht_cap *pht_capie;
ht_cap = _TRUE;
pht_capie = (struct rtw_ieee80211_ht_cap *)(p + 2);
memcpy(&mcs_rate , pht_capie->supp_mcs_set, 2);
pht_capie = (struct ieee80211_ht_cap *)(p + 2);
memcpy(&mcs_rate , pht_capie->mcs.rx_mask, 2);
bw_40MHz = (pht_capie->cap_info & IEEE80211_HT_CAP_SUP_WIDTH_20_40) ? 1 : 0;
short_GI = (pht_capie->cap_info & (IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40)) ? 1 : 0;
}
@ -7226,7 +7226,7 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param)
(WLAN_STA_HT & flags)) {
psta->htpriv.ht_option = _TRUE;
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
psta->htpriv.ht_option = _FALSE;
@ -7325,7 +7325,7 @@ static int rtw_ioctl_get_sta_data(struct net_device *dev, struct ieee_param *par
u32 sta_set;
u8 tx_supp_rates[16];
u32 tx_supp_rates_len;
struct rtw_ieee80211_ht_cap ht_cap;
struct ieee80211_ht_cap ht_cap;
u64 rx_pkts;
u64 rx_bytes;
u64 rx_drops;
@ -7358,7 +7358,7 @@ static int rtw_ioctl_get_sta_data(struct net_device *dev, struct ieee_param *par
memcpy(psta_data->tx_supp_rates, psta->bssrateset, psta->bssratelen);
#ifdef CONFIG_80211N_HT
if(padapter->registrypriv.ht_enable && is_supported_ht(padapter->registrypriv.wireless_mode))
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));
#endif /* CONFIG_80211N_HT */
psta_data->rx_pkts = psta->sta_stats.rx_data_pkts;
psta_data->rx_bytes = psta->sta_stats.rx_bytes;