Replace custom defimitions OP_MODE_ and HT_INFO_HT_PARAM_

Use the values provided by linux/ieee80211.h
IEEE80211_HT_OP_*
IEEE80211_HT_PARAM_*
This commit is contained in:
Carlos Garces 2021-10-18 18:26:28 +02:00
parent db6ccf24e0
commit 0242513fe3
3 changed files with 16 additions and 36 deletions

View File

@ -1813,7 +1813,7 @@ update_beacon:
if ((atomic_read(&mlme->olbc) == _TRUE) || (atomic_read(&mlme->olbc_ht) == _TRUE)) {
/* AP is not starting a 40 MHz BSS in presence of an 802.11g BSS. */
mlme->ht_op_mode &= (~HT_INFO_OPERATION_MODE_OP_MODE_MASK);
mlme->ht_op_mode |= OP_MODE_MAY_BE_LEGACY_STAS;
mlme->ht_op_mode |= IEEE80211_HT_OP_MODE_PROTECTION_NONMEMBER;
update_beacon(pdvobj->padapters[i], WLAN_EID_HT_OPERATION, NULL, _FALSE);
}
#endif
@ -3118,7 +3118,7 @@ static void update_bcn_htinfo_ie(_adapter *padapter)
SET_HT_OP_ELE_2ND_CHL_OFFSET(pht_info,
(pmlmeext->cur_ch_offset == HAL_PRIME_CHNL_OFFSET_LOWER) ?
HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE : HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW);
IEEE80211_HT_PARAM_CHA_SEC_ABOVE : IEEE80211_HT_PARAM_CHA_SEC_BELOW);
pmlmepriv->sw_to_20mhz = 0;
/*
@ -3443,28 +3443,28 @@ int rtw_ht_operation_update(_adapter *padapter)
RTW_INFO("%s current operation mode=0x%X\n",
__FUNCTION__, pmlmepriv->ht_op_mode);
if (!(pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT)
if (!(pmlmepriv->ht_op_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT)
&& pmlmepriv->num_sta_ht_no_gf) {
pmlmepriv->ht_op_mode |=
HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT;
IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT;
op_mode_changes++;
} else if ((pmlmepriv->ht_op_mode &
HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT) &&
IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT) &&
pmlmepriv->num_sta_ht_no_gf == 0) {
pmlmepriv->ht_op_mode &=
~HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT;
~IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT;
op_mode_changes++;
}
if (!(pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT) &&
if (!(pmlmepriv->ht_op_mode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT) &&
(pmlmepriv->num_sta_no_ht || atomic_read(&pmlmepriv->olbc_ht))) {
pmlmepriv->ht_op_mode |= HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT;
pmlmepriv->ht_op_mode |= IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT;
op_mode_changes++;
} else if ((pmlmepriv->ht_op_mode &
HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT) &&
IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT) &&
(pmlmepriv->num_sta_no_ht == 0 && !atomic_read(&pmlmepriv->olbc_ht))) {
pmlmepriv->ht_op_mode &=
~HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT;
~IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT;
op_mode_changes++;
}
@ -3474,15 +3474,15 @@ int rtw_ht_operation_update(_adapter *padapter)
*/
new_op_mode = 0;
if (pmlmepriv->num_sta_no_ht /*||
(pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT)*/)
new_op_mode = OP_MODE_MIXED;
(pmlmepriv->ht_op_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT)*/)
new_op_mode = IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED;
else if ((phtpriv_ap->ht_cap.cap_info & IEEE80211_HT_CAP_SUP_WIDTH_20_40)
&& pmlmepriv->num_sta_ht_20mhz)
new_op_mode = OP_MODE_20MHZ_HT_STA_ASSOCED;
new_op_mode = IEEE80211_HT_OP_MODE_PROTECTION_20MHZ;
else if (atomic_read(&pmlmepriv->olbc_ht))
new_op_mode = OP_MODE_MAY_BE_LEGACY_STAS;
new_op_mode = IEEE80211_HT_OP_MODE_PROTECTION_NONMEMBER;
else
new_op_mode = OP_MODE_PURE;
new_op_mode = IEEE80211_HT_OP_MODE_PROTECTION_NONE;
cur_op_mode = pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_OP_MODE_MASK;
if (cur_op_mode != new_op_mode) {

View File

@ -2181,7 +2181,7 @@ void VCS_update(_adapter *padapter, struct sta_info *psta)
case 2: /* auto */
default:
if (((pmlmeinfo->ERP_enable) && (pmlmeinfo->ERP_IE & BIT(1)))
/*||(pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT)*/
/*||(pmlmepriv->ht_op_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT)*/
) {
if (pregpriv->vcs_type == 1) {
psta->rtsen = 1;

View File

@ -619,28 +619,8 @@ struct ADDBA_request {
#define IEEE80211_MAX_AMPDU_BUF 0x40
#endif
#define OP_MODE_PURE 0
#define OP_MODE_MAY_BE_LEGACY_STAS 1
#define OP_MODE_20MHZ_HT_STA_ASSOCED 2
#define OP_MODE_MIXED 3
#define HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK ((u8) BIT(0) | BIT(1))
#define HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE ((u8) BIT(0))
#define HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW ((u8) BIT(0) | BIT(1))
#define HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH ((u8) BIT(2))
#define HT_INFO_HT_PARAM_RIFS_MODE ((u8) BIT(3))
#define HT_INFO_HT_PARAM_CTRL_ACCESS_ONLY ((u8) BIT(4))
#define HT_INFO_HT_PARAM_SRV_INTERVAL_GRANULARITY ((u8) BIT(5))
#define HT_INFO_OPERATION_MODE_OP_MODE_MASK \
((u16) (0x0001 | 0x0002))
#define HT_INFO_OPERATION_MODE_OP_MODE_OFFSET 0
#define HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT ((u8) BIT(2))
#define HT_INFO_OPERATION_MODE_TRANSMIT_BURST_LIMIT ((u8) BIT(3))
#define HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT ((u8) BIT(4))
/* #endif */