qcacld-3.0: Add 320MHz support in WMA layer

As part of 320MHz bandwidth support for 11BE, add 320MHz bandwidth
in WMA layer, where in particular set bw_320 to 1 in wma_send_peer_assoc
and populate ch_width to 320MHz in wma_update_channel_list.

Change-Id: I61793add8d86b0557bd4eed78233860e6ade1c18
CRs-Fixed: 2935851
This commit is contained in:
Jia Ding
2021-02-23 16:48:47 +08:00
committed by Madan Koyyalamudi
parent d846a3f774
commit 3644001a81
8 changed files with 98 additions and 1 deletions

View File

@@ -81,4 +81,10 @@
#define WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ 2
#define WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ 3
#ifdef WLAN_FEATURE_11BE
#define WNI_CFG_EHT_CHANNEL_WIDTH_80MHZ 4
#define WNI_CFG_EHT_CHANNEL_WIDTH_160MHZ 5
#define WNI_CFG_EHT_CHANNEL_WIDTH_320MHZ 6
#endif
#endif /* __MAC_PROP_EXTS_H */

View File

@@ -1500,6 +1500,16 @@ int wma_mgmt_tx_completion_handler(void *handle, uint8_t *cmpl_event_params,
int wma_mgmt_tx_bundle_completion_handler(void *handle,
uint8_t *cmpl_event_params, uint32_t len);
uint32_t wma_get_vht_ch_width(void);
#ifdef WLAN_FEATURE_11BE
uint32_t wma_get_eht_ch_width(void);
#else
static inline uint32_t wma_get_eht_ch_width(void)
{
return 0;
}
#endif
QDF_STATUS
wma_config_debug_module_cmd(wmi_unified_t wmi_handle, A_UINT32 param,
A_UINT32 val, A_UINT32 *module_id_bitmap,

View File

@@ -203,3 +203,10 @@ QDF_STATUS wma_get_eht_capabilities(struct eht_capability *eht_cap)
eht_cap->mac_cap = wma_handle->eht_cap.mac_cap;
return QDF_STATUS_SUCCESS;
}
void wma_set_peer_assoc_params_bw_320(struct peer_assoc_params *params,
enum phy_ch_width ch_width)
{
if (ch_width == CH_WIDTH_320MHZ)
params->bw_320 = 1;
}

View File

@@ -145,6 +145,18 @@ static inline bool wma_is_peer_eht_capable(tpAddStaParams params)
* Return: QDF_STATUS
*/
QDF_STATUS wma_get_eht_capabilities(struct eht_capability *eht_cap);
/**
* wma_set_peer_assoc_params_bw_320() - Set bw_320 based on ch_width
* @params: pointer to peer assoc params
* @ch_width: enum phy_ch_width
*
* If ch_width is CH_WIDTH_320MHZ, set params->bw_320 to 1
*
* Return: None
*/
void wma_set_peer_assoc_params_bw_320(struct peer_assoc_params *params,
enum phy_ch_width ch_width);
#else
static inline void wma_eht_update_tgt_services(struct wmi_unified *wmi_handle,
struct wma_tgt_services *cfg)
@@ -200,5 +212,10 @@ static inline bool wma_is_peer_eht_capable(tpAddStaParams params)
return false;
}
static inline
void wma_set_peer_assoc_params_bw_320(struct peer_assoc_params *params,
enum phy_ch_width ch_width)
{
}
#endif
#endif

View File

@@ -6357,6 +6357,10 @@ static enum hw_mode_bandwidth wma_map_wmi_channel_width_to_hw_mode_bw(
return HW_MODE_5_MHZ;
case WMI_CHAN_WIDTH_10:
return HW_MODE_10_MHZ;
#ifdef WLAN_FEATURE_11BE
case WMI_CHAN_WIDTH_320:
return HW_MODE_320_MHZ;
#endif
default:
return HW_MODE_BW_NONE;
}

View File

@@ -1533,6 +1533,8 @@ QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma,
else if (params->ch_width == CH_WIDTH_80P80MHZ)
cmd->bw_160 = 1;
wma_set_peer_assoc_params_bw_320(cmd, params->ch_width);
cmd->peer_vht_caps = params->vht_caps;
if (params->p2pCapableSta) {
cmd->p2p_capable_sta = 1;

View File

@@ -115,6 +115,10 @@ wma_map_phy_ch_bw_to_wmi_channel_width(enum phy_ch_width ch_width)
return WMI_HOST_CHAN_WIDTH_5;
case CH_WIDTH_10MHZ:
return WMI_HOST_CHAN_WIDTH_10;
#ifdef WLAN_FEATURE_11BE
case CH_WIDTH_320MHZ:
return WMI_HOST_CHAN_WIDTH_320;
#endif
default:
return WMI_HOST_CHAN_WIDTH_20;
}
@@ -125,6 +129,18 @@ wma_map_phy_ch_bw_to_wmi_channel_width(enum phy_ch_width ch_width)
#define WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ 2
#define WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ 3
#ifdef WLAN_FEATURE_11BE
static void wma_update_ch_list_11be_params(struct ch_params *ch)
{
ch->ch_width = CH_WIDTH_320MHZ;
}
#else /* !WLAN_FEATURE_11BE */
static void wma_update_ch_list_11be_params(struct ch_params *ch)
{
ch->ch_width = CH_WIDTH_160MHZ;
}
#endif /* WLAN_FEATURE_11BE */
/**
* wma_update_channel_list() - update channel list
* @handle: wma handle
@@ -206,7 +222,8 @@ QDF_STATUS wma_update_channel_list(WMA_HANDLE handle,
/*TODO: WMI_SET_CHANNEL_REG_CLASSID */
chan_p->maxregpower = chan_list->chanParam[i].pwr;
ch_params.ch_width = CH_WIDTH_160MHZ;
wma_update_ch_list_11be_params(&ch_params);
wlan_reg_set_channel_params_for_freq(wma_handle->pdev,
chan_p->mhz, 0,
&ch_params);

View File

@@ -4792,3 +4792,37 @@ int wma_oem_event_handler(void *wma_ctx, uint8_t *event_buff, uint32_t len)
return QDF_STATUS_SUCCESS;
}
#endif
/**
* wma_get_eht_ch_width - return eht channel width
*
* Return: return eht channel width
*/
#ifdef WLAN_FEATURE_11BE
uint32_t wma_get_eht_ch_width(void)
{
#ifdef TBD
uint32_t fw_ch_wd = WNI_CFG_EHT_CHANNEL_WIDTH_80MHZ;
tp_wma_handle wm_hdl = cds_get_context(QDF_MODULE_ID_WMA);
struct target_psoc_info *tgt_hdl;
int eht_cap_info;
if (!wm_hdl)
return fw_ch_wd;
tgt_hdl = wlan_psoc_get_tgt_if_handle(wm_hdl->psoc);
if (!tgt_hdl)
return fw_ch_wd;
eht_cap_info = target_if_get_eht_cap_info(tgt_hdl);
if (eht_cap_info & WMI_EHT_CAP_CH_WIDTH_160MHZ)
fw_ch_wd = WNI_CFG_EHT_CHANNEL_WIDTH_160MHZ;
else if (eht_cap_info & WMI_EHT_CAP_CH_WIDTH_320MHZ)
fw_ch_wd = WNI_CFG_EHT_CHANNEL_WIDTH_320MHZ;
return fw_ch_wd;
#else
return WNI_CFG_EHT_CHANNEL_WIDTH_320MHZ;
#endif
}
#endif