mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 05:29:04 -04:00
qcacld-3.0: Add 80+80 restricted BW support
Add support for restricted 80+80 bandwidth in STA and SAP modes. Change-Id: Id1a61b853584fa84db3bb8f0f2aaf68eecabeaac CRs-Fixed: 2570023
This commit is contained in:
parent
111f5602b3
commit
571f0d3e65
8 changed files with 104 additions and 1 deletions
|
|
@ -844,6 +844,7 @@ struct mlme_vht_capabilities_info {
|
|||
uint8_t extended_nss_bw_supp;
|
||||
uint8_t vht_extended_nss_bw_cap;
|
||||
uint8_t max_nsts_total;
|
||||
bool restricted_80p80_bw_supp;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3833,6 +3833,24 @@ QDF_STATUS
|
|||
ucfg_mlme_set_obss_color_collision_offload_enabled(
|
||||
struct wlan_objmgr_psoc *psoc, uint8_t value);
|
||||
|
||||
/**
|
||||
* ucfg_mlme_set_restricted_80p80_bw_supp() - Set the restricted 80p80 support
|
||||
* @psoc: pointer to psoc object
|
||||
* @restricted_80p80_supp: Value to be set from the caller
|
||||
*
|
||||
* Return: QDF Status
|
||||
*/
|
||||
QDF_STATUS ucfg_mlme_set_restricted_80p80_bw_supp(struct wlan_objmgr_psoc *psoc,
|
||||
bool restricted_80p80_supp);
|
||||
|
||||
/**
|
||||
* ucfg_mlme_get_restricted_80p80_bw_supp() - Get the restricted 80p80 support
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* Return: true or false
|
||||
*/
|
||||
bool ucfg_mlme_get_restricted_80p80_bw_supp(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* ucfg_mlme_get_channel_bonding_24ghz() - get channel bonding mode of 24ghz
|
||||
* @psoc: pointer to psoc object
|
||||
|
|
|
|||
|
|
@ -1720,6 +1720,33 @@ ucfg_mlme_set_obss_color_collision_offload_enabled(
|
|||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_mlme_set_restricted_80p80_bw_supp(struct wlan_objmgr_psoc *psoc,
|
||||
bool restricted_80p80_supp)
|
||||
{
|
||||
struct wlan_mlme_psoc_ext_obj *mlme_obj;
|
||||
|
||||
mlme_obj = mlme_get_psoc_ext_obj(psoc);
|
||||
if (!mlme_obj)
|
||||
return QDF_STATUS_E_INVAL;
|
||||
|
||||
mlme_obj->cfg.vht_caps.vht_cap_info.restricted_80p80_bw_supp =
|
||||
restricted_80p80_supp;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
bool ucfg_mlme_get_restricted_80p80_bw_supp(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_mlme_psoc_ext_obj *mlme_obj;
|
||||
|
||||
mlme_obj = mlme_get_psoc_ext_obj(psoc);
|
||||
|
||||
if (!mlme_obj)
|
||||
return true;
|
||||
|
||||
return mlme_obj->cfg.vht_caps.vht_cap_info.restricted_80p80_bw_supp;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
ucfg_mlme_get_channel_bonding_24ghz(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t *val)
|
||||
|
|
|
|||
|
|
@ -3712,6 +3712,8 @@ int wlan_hdd_set_channel(struct wiphy *wiphy,
|
|||
sap_config = &((WLAN_HDD_GET_AP_CTX_PTR(adapter))->sap_config);
|
||||
sap_config->chan_freq = chandef->chan->center_freq;
|
||||
sap_config->ch_params.center_freq_seg1 = channel_seg2;
|
||||
sap_config->ch_params.center_freq_seg0 =
|
||||
ieee80211_frequency_to_channel(chandef->center_freq1);
|
||||
|
||||
if (QDF_SAP_MODE == adapter->device_mode) {
|
||||
/* set channel to what hostapd configured */
|
||||
|
|
@ -5433,6 +5435,18 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
|
|||
}
|
||||
|
||||
config->ch_params.ch_width = config->ch_width_orig;
|
||||
if ((config->ch_params.ch_width == CH_WIDTH_80P80MHZ) &&
|
||||
ucfg_mlme_get_restricted_80p80_bw_supp(hdd_ctx->psoc)) {
|
||||
if (!((config->ch_params.center_freq_seg0 == 138 &&
|
||||
config->ch_params.center_freq_seg1 == 155) ||
|
||||
(config->ch_params.center_freq_seg1 == 138 &&
|
||||
config->ch_params.center_freq_seg0 == 155))) {
|
||||
config->ch_params.center_freq_seg1 = 0;
|
||||
config->ch_width_orig = CH_WIDTH_80MHZ;
|
||||
config->ch_params.ch_width = config->ch_width_orig;
|
||||
}
|
||||
}
|
||||
|
||||
wlan_reg_set_channel_params_for_freq(hdd_ctx->pdev, config->chan_freq,
|
||||
config->sec_ch_freq,
|
||||
&config->ch_params);
|
||||
|
|
|
|||
|
|
@ -2207,6 +2207,11 @@ int hdd_update_tgt_cfg(hdd_handle_t hdd_handle, struct wma_tgt_cfg *cfg)
|
|||
hdd_err("set tx_bfee_ant_supp failed");
|
||||
}
|
||||
|
||||
status = ucfg_mlme_set_restricted_80p80_bw_supp(hdd_ctx->psoc,
|
||||
cfg->restricted_80p80_bw_supp);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
hdd_err("Failed to set MLME restircted 80p80 BW support");
|
||||
|
||||
if ((value > MLME_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_FW_DEF) &&
|
||||
!cfg->tx_bfee_8ss_enabled) {
|
||||
status = ucfg_mlme_cfg_set_vht_tx_bfee_ant_supp(hdd_ctx->psoc,
|
||||
|
|
|
|||
|
|
@ -315,6 +315,7 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie,
|
|||
uint8_t chan_center_freq_seg1;
|
||||
tDot11fIEVHTCaps *vht_caps;
|
||||
uint8_t channel = 0;
|
||||
struct mlme_vht_capabilities_info *mlme_vht_cap;
|
||||
|
||||
beacon_struct = qdf_mem_malloc(sizeof(tSirProbeRespBeacon));
|
||||
if (!beacon_struct)
|
||||
|
|
@ -332,6 +333,7 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie,
|
|||
return;
|
||||
}
|
||||
|
||||
mlme_vht_cap = &mac_ctx->mlme_cfg->vht_caps.vht_cap_info;
|
||||
if (beacon_struct->wmeInfoPresent ||
|
||||
beacon_struct->wmeEdcaPresent ||
|
||||
beacon_struct->HTCaps.present)
|
||||
|
|
@ -405,6 +407,21 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie,
|
|||
|
||||
fw_vht_ch_wd = wma_get_vht_ch_width();
|
||||
vht_ch_wd = QDF_MIN(fw_vht_ch_wd, ap_bcon_ch_width);
|
||||
|
||||
if ((vht_ch_wd > WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) &&
|
||||
(ap_bcon_ch_width ==
|
||||
WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ) &&
|
||||
mlme_vht_cap->restricted_80p80_bw_supp) {
|
||||
if ((chan_center_freq_seg1 == 138 &&
|
||||
vht_op->chan_center_freq_seg0 == 155) ||
|
||||
(vht_op->chan_center_freq_seg0 == 138 &&
|
||||
chan_center_freq_seg1 == 155))
|
||||
vht_ch_wd =
|
||||
WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ;
|
||||
else
|
||||
vht_ch_wd =
|
||||
WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ;
|
||||
}
|
||||
/*
|
||||
* If the supported channel width is greater than 80MHz and
|
||||
* AP supports Nss > 1 in 160MHz mode then connect the STA
|
||||
|
|
|
|||
|
|
@ -175,6 +175,7 @@ struct board_info {
|
|||
* @obss_color_collision_offloaded: obss color collision offloaded to firmware
|
||||
* @sar_version: Version of SAR supported by firmware
|
||||
* @bcast_twt_support: braodcast twt support
|
||||
* @restricted_80p80_bw_supp: Restricted 80+80MHz(165MHz BW) support
|
||||
*/
|
||||
struct wma_tgt_cfg {
|
||||
uint32_t target_fw_version;
|
||||
|
|
@ -215,5 +216,6 @@ struct wma_tgt_cfg {
|
|||
enum sar_version sar_version;
|
||||
struct nan_tgt_caps nan_caps;
|
||||
bool bcast_twt_support;
|
||||
bool restricted_80p80_bw_supp;
|
||||
};
|
||||
#endif /* WMA_TGT_CFG_H */
|
||||
|
|
|
|||
|
|
@ -5177,6 +5177,25 @@ static void wma_update_obss_color_collision_support(tp_wma_handle wh,
|
|||
tgt_cfg->obss_color_collision_offloaded = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* wma_update_restricted_80p80_bw_support() - update restricted 80+80 supprot
|
||||
* @wh: wma handle
|
||||
* @tgt_cfg: target configuration to be updated
|
||||
*
|
||||
* Update restricted 80+80MHz (165MHz) BW support based on service bit.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static void wma_update_restricted_80p80_bw_support(tp_wma_handle wh,
|
||||
struct wma_tgt_cfg *tgt_cfg)
|
||||
{
|
||||
if (wmi_service_enabled(wh->wmi_handle,
|
||||
wmi_service_bw_165mhz_support))
|
||||
tgt_cfg->restricted_80p80_bw_supp = true;
|
||||
else
|
||||
tgt_cfg->restricted_80p80_bw_supp = false;
|
||||
}
|
||||
|
||||
#ifdef WLAN_SUPPORT_GREEN_AP
|
||||
static void wma_green_ap_register_handlers(tp_wma_handle wma_handle)
|
||||
{
|
||||
|
|
@ -5421,7 +5440,7 @@ static int wma_update_hdd_cfg(tp_wma_handle wma_handle)
|
|||
wma_update_hdd_cfg_ndp(wma_handle, &tgt_cfg);
|
||||
wma_update_nan_target_caps(wma_handle, &tgt_cfg);
|
||||
wma_update_bcast_twt_support(wma_handle, &tgt_cfg);
|
||||
|
||||
wma_update_restricted_80p80_bw_support(wma_handle, &tgt_cfg);
|
||||
/* Take the max of chains supported by FW, which will limit nss */
|
||||
for (i = 0; i < tgt_hdl->info.total_mac_phy_cnt; i++)
|
||||
wma_fill_chain_cfg(tgt_hdl, i);
|
||||
|
|
|
|||
Loading…
Reference in a new issue