Replace AMPDU emun structures with kernel provided

Port 98b32c71a455ff289442779fee02ad60a6217006
This commit is contained in:
Carlos Garces 2021-10-18 16:28:25 +02:00
parent c5f30cb5cc
commit 3acac3288c
6 changed files with 13 additions and 37 deletions

View File

@ -1898,7 +1898,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
u8 channel, network_type, supportRate[NDIS_802_11_LENGTH_RATES_EX]; u8 channel, network_type, supportRate[NDIS_802_11_LENGTH_RATES_EX];
int supportRateNum = 0; int supportRateNum = 0;
u8 WMM_PARA_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01}; u8 WMM_PARA_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01};
HT_CAP_AMPDU_DENSITY best_ampdu_density; enum ieee80211_min_mpdu_spacing best_ampdu_density;
struct registry_priv *pregistrypriv = &padapter->registrypriv; struct registry_priv *pregistrypriv = &padapter->registrypriv;
struct security_priv *psecuritypriv = &padapter->securitypriv; struct security_priv *psecuritypriv = &padapter->securitypriv;
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
@ -2241,7 +2241,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_HT_CAPABILITY, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_HT_CAPABILITY, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
if (p && ie_len > 0) { if (p && ie_len > 0) {
u8 rf_type = 0; u8 rf_type = 0;
HT_CAP_AMPDU_FACTOR max_rx_ampdu_factor = MAX_AMPDU_FACTOR_64K; 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 rtw_ieee80211_ht_cap *pht_cap = (struct rtw_ieee80211_ht_cap *)(p + 2);
if (0) { if (0) {

View File

@ -4618,8 +4618,8 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui
{ {
u32 ielen, out_len; u32 ielen, out_len;
u32 rx_packet_offset, max_recvbuf_sz; u32 rx_packet_offset, max_recvbuf_sz;
HT_CAP_AMPDU_FACTOR max_rx_ampdu_factor; enum ieee80211_max_ampdu_length_exp max_rx_ampdu_factor;
HT_CAP_AMPDU_DENSITY best_ampdu_density; enum ieee80211_min_mpdu_spacing best_ampdu_density;
unsigned char *p, *pframe; unsigned char *p, *pframe;
struct rtw_ieee80211_ht_cap ht_capie; struct rtw_ieee80211_ht_cap ht_capie;
u8 cbw40_enable = 0, rf_type = 0, rf_num = 0, rx_stbc_nss = 0, rx_nss = 0; u8 cbw40_enable = 0, rf_type = 0, rf_num = 0, rx_stbc_nss = 0, rx_nss = 0;
@ -4791,7 +4791,7 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui
*/ */
if (padapter->driver_rx_ampdu_factor != 0xFF) if (padapter->driver_rx_ampdu_factor != 0xFF)
max_rx_ampdu_factor = (HT_CAP_AMPDU_FACTOR)padapter->driver_rx_ampdu_factor; max_rx_ampdu_factor = (enum ieee80211_max_ampdu_length_exp)padapter->driver_rx_ampdu_factor;
else else
rtw_hal_get_def_var(padapter, HW_VAR_MAX_RX_AMPDU_FACTOR, &max_rx_ampdu_factor); rtw_hal_get_def_var(padapter, HW_VAR_MAX_RX_AMPDU_FACTOR, &max_rx_ampdu_factor);

View File

@ -3255,7 +3255,7 @@ exit:
u8 rtw_rx_ampdu_size(_adapter *adapter) u8 rtw_rx_ampdu_size(_adapter *adapter)
{ {
u8 size; u8 size;
HT_CAP_AMPDU_FACTOR max_rx_ampdu_factor; enum ieee80211_max_ampdu_length_exp max_rx_ampdu_factor;
#ifdef CONFIG_BT_COEXIST #ifdef CONFIG_BT_COEXIST
if (rtw_btcoex_IsBTCoexCtrlAMPDUSize(adapter) == _TRUE) { if (rtw_btcoex_IsBTCoexCtrlAMPDUSize(adapter) == _TRUE) {
@ -3275,7 +3275,7 @@ u8 rtw_rx_ampdu_size(_adapter *adapter)
/* default value based on max_rx_ampdu_factor */ /* default value based on max_rx_ampdu_factor */
if (adapter->driver_rx_ampdu_factor != 0xFF) if (adapter->driver_rx_ampdu_factor != 0xFF)
max_rx_ampdu_factor = (HT_CAP_AMPDU_FACTOR)adapter->driver_rx_ampdu_factor; max_rx_ampdu_factor = (enum ieee80211_max_ampdu_length_exp)adapter->driver_rx_ampdu_factor;
else else
rtw_hal_get_def_var(adapter, HW_VAR_MAX_RX_AMPDU_FACTOR, &max_rx_ampdu_factor); rtw_hal_get_def_var(adapter, HW_VAR_MAX_RX_AMPDU_FACTOR, &max_rx_ampdu_factor);
@ -3286,13 +3286,13 @@ u8 rtw_rx_ampdu_size(_adapter *adapter)
MSDU or AMSDU. MSDU or AMSDU.
The size variable means how many MSDUs or AMSDUs, it's not Kbytes. The size variable means how many MSDUs or AMSDUs, it's not Kbytes.
*/ */
if (MAX_AMPDU_FACTOR_64K == max_rx_ampdu_factor) if (IEEE80211_HT_MAX_AMPDU_64K == max_rx_ampdu_factor)
size = 64; size = 64;
else if (MAX_AMPDU_FACTOR_32K == max_rx_ampdu_factor) else if (IEEE80211_HT_MAX_AMPDU_32K == max_rx_ampdu_factor)
size = 32; size = 32;
else if (MAX_AMPDU_FACTOR_16K == max_rx_ampdu_factor) else if (IEEE80211_HT_MAX_AMPDU_16K == max_rx_ampdu_factor)
size = 16; size = 16;
else if (MAX_AMPDU_FACTOR_8K == max_rx_ampdu_factor) else if (IEEE80211_HT_MAX_AMPDU_8K == max_rx_ampdu_factor)
size = 8; size = 8;
else else
size = 64; size = 64;

View File

@ -4509,7 +4509,7 @@ GetHalDefVar8192E(
*((u32 *)pValue) = 8; *((u32 *)pValue) = 8;
break; break;
case HW_VAR_BEST_AMPDU_DENSITY: case HW_VAR_BEST_AMPDU_DENSITY:
*((u32 *)pValue) = AMPDU_DENSITY_VALUE_7; *((u32 *)pValue) = IEEE80211_HT_MPDU_DENSITY_16;
break; break;
default: default:
bResult = GetHalDefVar(Adapter, eVariable, pValue); bResult = GetHalDefVar(Adapter, eVariable, pValue);

View File

@ -1710,7 +1710,7 @@ GetHalDefVar8192EUsb(
switch (eVariable) { switch (eVariable) {
case HW_VAR_MAX_RX_AMPDU_FACTOR: case HW_VAR_MAX_RX_AMPDU_FACTOR:
*((u32 *)pValue) = MAX_AMPDU_FACTOR_64K; /* MAX_AMPDU_FACTOR_64K; */ *((u32 *)pValue) = IEEE80211_HT_MAX_AMPDU_64K; /* IEEE80211_HT_MAX_AMPDU_64K; */
break; break;
default: default:
GetHalDefVar8192E(Adapter, eVariable, pValue); GetHalDefVar8192E(Adapter, eVariable, pValue);

View File

@ -636,31 +636,7 @@ struct ADDBA_request {
unsigned short BA_starting_seqctrl; unsigned short BA_starting_seqctrl;
} __attribute__((packed)); } __attribute__((packed));
typedef enum _HT_CAP_AMPDU_FACTOR {
MAX_AMPDU_FACTOR_8K = 0,
MAX_AMPDU_FACTOR_16K = 1,
MAX_AMPDU_FACTOR_32K = 2,
MAX_AMPDU_FACTOR_64K = 3,
} HT_CAP_AMPDU_FACTOR;
typedef enum _VHT_CAP_AMPDU_FACTOR {
MAX_AMPDU_FACTOR_128K = 4,
MAX_AMPDU_FACTOR_256K = 5,
MAX_AMPDU_FACTOR_512K = 6,
MAX_AMPDU_FACTOR_1M = 7,
} VHT_CAP_AMPDU_FACTOR;
typedef enum _HT_CAP_AMPDU_DENSITY {
AMPDU_DENSITY_VALUE_0 = 0 , /* For no restriction */
AMPDU_DENSITY_VALUE_1 = 1 , /* For 1/4 us */
AMPDU_DENSITY_VALUE_2 = 2 , /* For 1/2 us */
AMPDU_DENSITY_VALUE_3 = 3 , /* For 1 us */
AMPDU_DENSITY_VALUE_4 = 4 , /* For 2 us */
AMPDU_DENSITY_VALUE_5 = 5 , /* For 4 us */
AMPDU_DENSITY_VALUE_6 = 6 , /* For 8 us */
AMPDU_DENSITY_VALUE_7 = 7 , /* For 16 us */
} HT_CAP_AMPDU_DENSITY;
/* 802.11n HT capabilities masks */ /* 802.11n HT capabilities masks */
#define IEEE80211_HT_CAP_RX_STBC_1R 0x0100 #define IEEE80211_HT_CAP_RX_STBC_1R 0x0100