diff --git a/mlme/core/src/wlan_mlme_main.c b/mlme/core/src/wlan_mlme_main.c index 204497d995..3d79b91dd3 100644 --- a/mlme/core/src/wlan_mlme_main.c +++ b/mlme/core/src/wlan_mlme_main.c @@ -267,6 +267,9 @@ static void mlme_init_chainmask_cfg(struct wlan_objmgr_psoc *psoc, chainmask_info->rx_chain_mask_5g = cfg_get(psoc, CFG_RX_CHAIN_MASK_5G); + + chainmask_info->enable_bt_chain_separation = + cfg_get(psoc, CFG_ENABLE_BT_CHAIN_SEPARATION); } #ifdef WLAN_FEATURE_11W @@ -690,6 +693,8 @@ static void mlme_init_qos_cfg(struct wlan_objmgr_psoc *psoc, cfg_get(psoc, CFG_TX_NON_AGGR_SW_RETRY_VO); qos_aggr_params->sap_max_inactivity_override = cfg_get(psoc, CFG_SAP_MAX_INACTIVITY_OVERRIDE); + qos_aggr_params->sap_uapsd_enabled = + cfg_get(psoc, CFG_SAP_QOS_UAPSD); } static void mlme_init_mbo_cfg(struct wlan_objmgr_psoc *psoc, @@ -877,6 +882,10 @@ static void mlme_init_sap_protection_cfg(struct wlan_objmgr_psoc *psoc, cfg_default(CFG_FORCE_POLICY_PROTECTION); sap_protection_params->ignore_peer_ht_opmode = cfg_get(psoc, CFG_IGNORE_PEER_HT_MODE); + sap_protection_params->enable_ap_obss_protection = + cfg_get(psoc, CFG_AP_OBSS_PROTECTION_ENABLE); + sap_protection_params->ap_protection_mode = + cfg_get(psoc, CFG_AP_PROTECTION_MODE); } #ifdef WLAN_FEATURE_11AX diff --git a/mlme/dispatcher/inc/cfg_mlme_chainmask.h b/mlme/dispatcher/inc/cfg_mlme_chainmask.h index 21d8c96bd4..0aa1c48359 100644 --- a/mlme/dispatcher/inc/cfg_mlme_chainmask.h +++ b/mlme/dispatcher/inc/cfg_mlme_chainmask.h @@ -318,6 +318,32 @@ CFG_VALUE_OR_DEFAULT, \ "5Ghz Tx Chainmask") +/* + * + * enable_bt_chain_separation - Enables/disables bt /wlan chainmask assignment + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini disables/enables chainmask setting on 2x2, mainly used for ROME + * BT/WLAN chainmask assignment. + * + * 0, Disable + * 1, Enable + * + * Related: NA + * + * Supported Feature: 11n/11ac + * + * Usage: External + * + * + */ +#define CFG_ENABLE_BT_CHAIN_SEPARATION CFG_INI_BOOL( \ + "enableBTChainSeparation", \ + 0, \ + "Enable/disable BT chainmask assignment") + #define CFG_CHAINMASK_ALL \ CFG(CFG_VHT_ENABLE_1x1_TX_CHAINMASK) \ CFG(CFG_VHT_ENABLE_1x1_RX_CHAINMASK) \ @@ -328,6 +354,7 @@ CFG(CFG_TX_CHAIN_MASK_2G) \ CFG(CFG_RX_CHAIN_MASK_2G) \ CFG(CFG_TX_CHAIN_MASK_5G) \ - CFG(CFG_RX_CHAIN_MASK_5G) + CFG(CFG_RX_CHAIN_MASK_5G) \ + CFG(CFG_ENABLE_BT_CHAIN_SEPARATION) #endif /* __CFG_CHAINMASK_H */ diff --git a/mlme/dispatcher/inc/cfg_qos.h b/mlme/dispatcher/inc/cfg_qos.h index 0213b961fe..9069c33b49 100644 --- a/mlme/dispatcher/inc/cfg_qos.h +++ b/mlme/dispatcher/inc/cfg_qos.h @@ -425,6 +425,28 @@ 0, \ "SAP maximum inactivity override flag") +/* + * + * gEnableApUapsd - Enable/disable UAPSD for SoftAP + * @Min: 0 + * @Max: 1 + * @Default: 1 + * + * This ini is used to setup setup U-APSD for Acs at association + * + * Related: None. + * + * Supported Feature: SAP + * + * Usage: Internal/External + * + * + */ +#define CFG_SAP_QOS_UAPSD CFG_INI_BOOL( \ + "gEnableApUapsd", \ + 1, \ + "Enable UAPSD for SAP") + #define CFG_QOS_ALL \ CFG(CFG_SAP_MAX_INACTIVITY_OVERRIDE) \ CFG(CFG_TX_AGGREGATION_SIZE) \ @@ -440,6 +462,7 @@ CFG(CFG_TX_NON_AGGR_SW_RETRY_BE) \ CFG(CFG_TX_NON_AGGR_SW_RETRY_BK) \ CFG(CFG_TX_NON_AGGR_SW_RETRY_VI) \ - CFG(CFG_TX_NON_AGGR_SW_RETRY_VO) + CFG(CFG_TX_NON_AGGR_SW_RETRY_VO) \ + CFG(CFG_SAP_QOS_UAPSD) #endif /* __CFG_MLME_QOS_H */ diff --git a/mlme/dispatcher/inc/cfg_sap_protection.h b/mlme/dispatcher/inc/cfg_sap_protection.h index e80034f182..2a271db1a6 100644 --- a/mlme/dispatcher/inc/cfg_sap_protection.h +++ b/mlme/dispatcher/inc/cfg_sap_protection.h @@ -61,9 +61,66 @@ 0, \ "ignore the peer ht mode") +/* + * + * gApProtection - Set AP protection parameter + * @Min: 0x0 + * @Max: 0xFFFF + * @Default: 0xBFFF + * + * This ini is used to set AP protection parameter + * Bit map for CFG_AP_PROTECTION_MODE_DEFAULT + * LOWER byte for associated stations + * UPPER byte for overlapping stations + * each byte will have the following info + * bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 + * OBSS RIFS LSIG_TXOP NON_GF HT20 FROM_11G FROM_11B FROM_11A + * bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 + * OBSS RIFS LSIG_TXOP NON_GF HT_20 FROM_11G FROM_11B FROM_11A + * + * Related: None. + * + * Supported Feature: SAP + * + * Usage: Internal/External + * + * + */ +#define CFG_AP_PROTECTION_MODE CFG_INI_UINT( \ + "gApProtection", \ + 0x0, \ + 0xFFFF, \ + 0xBFFF, \ + CFG_VALUE_OR_DEFAULT, \ + "AP protection mode bitmap") + +/* + * + * gEnableApOBSSProt - Enable/Disable AP OBSS protection + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to enable/disable AP OBSS protection + * + * Related: None. + * + * Supported Feature: SAP + * + * Usage: Internal/External + * + * + */ +#define CFG_AP_OBSS_PROTECTION_ENABLE CFG_INI_BOOL( \ + "gEnableApOBSSProt", \ + 0, \ + "Enable/Disable AP OBSS protection") + #define CFG_SAP_PROTECTION_ALL \ CFG(CFG_PROTECTION_ENABLED) \ CFG(CFG_FORCE_POLICY_PROTECTION) \ - CFG(CFG_IGNORE_PEER_HT_MODE) + CFG(CFG_IGNORE_PEER_HT_MODE) \ + CFG(CFG_AP_PROTECTION_MODE) \ + CFG(CFG_AP_OBSS_PROTECTION_ENABLE) #endif /* __CFG_MLME_SAP_PROTECTION_H */ diff --git a/mlme/dispatcher/inc/wlan_mlme_api.h b/mlme/dispatcher/inc/wlan_mlme_api.h index f13e6985b5..7a1e6384bc 100644 --- a/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/mlme/dispatcher/inc/wlan_mlme_api.h @@ -372,7 +372,6 @@ wlan_mlme_get_acs_support_for_dfs_ltecoex(struct wlan_objmgr_psoc *psoc, /** * wlan_mlme_get_external_acs_policy() - Get the flag for external acs policy - * * @psoc: pointer to psoc object * @value: Value that needs to be set from the caller * @@ -405,7 +404,6 @@ QDF_STATUS wlan_mlme_get_ignore_peer_ht_mode(struct wlan_objmgr_psoc *psoc, bool *value); /** * wlan_mlme_get_tx_chainmask_cck() - Get the tx_chainmask_cfg value - * * @psoc: pointer to psoc object * @value: Value that needs to be set from the caller * @@ -416,9 +414,8 @@ QDF_STATUS wlan_mlme_get_tx_chainmask_cck(struct wlan_objmgr_psoc *psoc, /** * wlan_mlme_get_tx_chainmask_1ss() - Get the tx_chainmask_1ss value - * * @psoc: pointer to psoc object - * @value: Value that needs to be set from the caller + * @value: Value that caller needs to get * * Return: QDF_STATUS_FAILURE or QDF_STATUS_SUCCESS */ @@ -427,7 +424,6 @@ QDF_STATUS wlan_mlme_get_tx_chainmask_1ss(struct wlan_objmgr_psoc *psoc, /** * wlan_mlme_get_num_11b_tx_chains() - Get the number of 11b only tx chains - * * @psoc: pointer to psoc object * @value: Value that needs to be set from the caller * @@ -438,9 +434,8 @@ QDF_STATUS wlan_mlme_get_num_11b_tx_chains(struct wlan_objmgr_psoc *psoc, /** * wlan_mlme_get_num_11ag_tx_chains() - get the total number of 11a/g tx chains - * * @psoc: pointer to psoc object - * @value: Value that needs to be set from the caller + * @value: Value that caller needs to get * * Return: QDF_STATUS_FAILURE or QDF_STATUS_SUCCESS */ @@ -448,8 +443,17 @@ QDF_STATUS wlan_mlme_get_num_11ag_tx_chains(struct wlan_objmgr_psoc *psoc, uint16_t *value); /** - * wlan_mlme_configure_chain_mask() - configure chainmask parameters + * wlan_mlme_get_bt_chain_separation_flag() - get the enable_bt_chain_separation + * flag + * @psoc: pointer to psoc object + * @value: Value that needs to be set from the caller * + * Return: QDF_STATUS_FAILURE or QDF_STATUS_SUCCESS + */ +QDF_STATUS wlan_mlme_get_bt_chain_separation_flag(struct wlan_objmgr_psoc *psoc, + bool *value); +/** + * wlan_mlme_configure_chain_mask() - configure chainmask parameters * @psoc: pointer to psoc object * @session_id: vdev_id * @@ -737,6 +741,27 @@ QDF_STATUS mlme_update_tgt_he_caps_in_cfg(struct wlan_objmgr_psoc *psoc, struct wma_tgt_cfg *cfg); #endif +/** + * wlan_mlme_get_ap_protection_mode() - Get ap_protection_mode value + * @psoc: pointer to psoc object + * @value: pointer to the value which needs to be filled for the caller + * + * Return: QDF Status + */ +QDF_STATUS wlan_mlme_get_ap_protection_mode(struct wlan_objmgr_psoc *psoc, + uint16_t *value); + +/** + * wlan_mlme_is_ap_obss_prot_enabled() - Get ap_obss_protection is + * enabled/disabled + * @psoc: pointer to psoc object + * @value: pointer to the value which needs to be filled for the caller + * + * Return: QDF Status + */ +QDF_STATUS wlan_mlme_is_ap_obss_prot_enabled(struct wlan_objmgr_psoc *psoc, + bool *value); + /** * wlan_mlme_get_rts_threshold() - Get the RTS threshold config * @psoc: pointer to psoc object @@ -1794,4 +1819,23 @@ QDF_STATUS mlme_update_vht_cap(struct wlan_objmgr_psoc *psoc, */ QDF_STATUS mlme_update_nss_vht_cap(struct wlan_objmgr_psoc *psoc); +/** + * wlan_mlme_is_sap_uapsd_enabled() - Get if SAP UAPSD is enabled/disabled + * @psoc: psoc context + * @value: value to be filled for caller + * + * Return: QDF_STATUS + */ +QDF_STATUS wlan_mlme_is_sap_uapsd_enabled(struct wlan_objmgr_psoc *psoc, + bool *value); + +/** + * wlan_mlme_set_sap_uapsd_flag() - Enable/Disable SAP UAPSD + * @psoc: psoc context + * @value: Enable/Disable control value for sap_uapsd_enabled field + * + * Return: QDF_STATUS + */ +QDF_STATUS wlan_mlme_set_sap_uapsd_flag(struct wlan_objmgr_psoc *psoc, + bool value); #endif /* _WLAN_MLME_API_H_ */ diff --git a/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/mlme/dispatcher/inc/wlan_mlme_public_struct.h index bdfe8e6f1e..161f6ae2ac 100644 --- a/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -697,6 +697,7 @@ struct wlan_mlme_vht_caps { * @tx_non_aggr_sw_retry_threshold_vo: non aggr sw retry threshold for VO * @sap_max_inactivity_override: Override updating ap_sta_inactivity from * hostapd.conf + * @sap_uapsd_enabled: Flag to enable/disable UAPSD for SAP */ struct wlan_mlme_qos { uint32_t tx_aggregation_size; @@ -714,6 +715,7 @@ struct wlan_mlme_qos { uint32_t tx_non_aggr_sw_retry_threshold_vi; uint32_t tx_non_aggr_sw_retry_threshold_vo; bool sap_max_inactivity_override; + bool sap_uapsd_enabled; }; #ifdef WLAN_FEATURE_11AX @@ -818,21 +820,22 @@ struct wlan_mlme_feature_flag { /* * struct wlan_mlme_sap_protection_cfg - SAP erp protection config items - * - * @protection_enabled: Force enable protection. static via cfg - * @protection_force_policy: Protection force policy. Static via cfg * @ignore_peer_ht_opmode: Ignore the ht opmode of the peer. Dynamic via INI - * + * @enable_ap_obss_protection: enable/disable AP OBSS protection + * @protection_force_policy: Protection force policy. Static via cfg + * @ap_protection_mode: AP protection bitmap + * @protection_enabled: Force enable protection. static via cfg */ struct wlan_mlme_sap_protection { - uint32_t protection_enabled; - uint8_t protection_force_policy; bool ignore_peer_ht_opmode; + bool enable_ap_obss_protection; + uint8_t protection_force_policy; + uint16_t ap_protection_mode; + uint32_t protection_enabled; }; /* * struct wlan_mlme_chainmask - All chainmask related cfg items - * * @txchainmask1x1: To set transmit chainmask * @rxchainmask1x1: To set rx chainmask * @tx_chain_mask_cck: Used to enable/disable Cck ChainMask @@ -843,6 +846,7 @@ struct wlan_mlme_sap_protection { * @rx_chain_mask_2g: Tx chain mask for 2g * @tx_chain_mask_5g: Tx chain mask for 5g * @rx_chain_mask_5g: Rx chain mask for 5g + * @enable_bt_chain_separation: Enable/Disable BT/WLAN Host chain seperation */ struct wlan_mlme_chainmask { uint8_t txchainmask1x1; @@ -855,6 +859,7 @@ struct wlan_mlme_chainmask { uint8_t rx_chain_mask_2g; uint8_t tx_chain_mask_5g; uint8_t rx_chain_mask_5g; + bool enable_bt_chain_separation; }; /* struct wlan_mlme_generic - Generic CFG config items diff --git a/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index bc73a35fd4..1aeeb7f344 100644 --- a/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -626,6 +626,20 @@ QDF_STATUS ucfg_mlme_get_num_11ag_tx_chains(struct wlan_objmgr_psoc *psoc, return wlan_mlme_get_num_11ag_tx_chains(psoc, value); } +/** + * ucfg_mlme_get_bt_chain_separation_flag() - bt chain separation enable/disable + * @psoc: pointer to psoc object + * @value: Value that needs to be got for the caller + * + * Return: QDF_STATUS_FAILURE or QDF_STATUS_SUCCESS + */ +static inline +QDF_STATUS ucfg_mlme_get_bt_chain_separation_flag(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + return wlan_mlme_get_bt_chain_separation_flag(psoc, value); +} + /** * ucfg_mlme_configure_chain_mask() - configure chainmask parameters * @@ -1152,6 +1166,40 @@ QDF_STATUS ucfg_mlme_get_oce_sap_enabled_info(struct wlan_objmgr_psoc *psoc, return wlan_mlme_get_oce_sap_enabled_info(psoc, value); } +/** + * ucfg_mlme_get_ap_protection_mode() - Get ap protection mode info + * @psoc: pointer to psoc object + * @value: pointer to the value which will be filled for the caller + * + * Inline UCFG API to be used by HDD/OSIF callers to get the + * ap protection mode value + * + * Return: QDF_STATUS_SUCCESS or QDF_STATUS_FAILURE + */ +static inline +QDF_STATUS ucfg_mlme_get_ap_protection_mode(struct wlan_objmgr_psoc *psoc, + uint16_t *value) +{ + return wlan_mlme_get_ap_protection_mode(psoc, value); +} + +/** + * ucfg_mlme_is_ap_obss_prot_enabled() - Get ap obss protection enable/disable + * @psoc: pointer to psoc object + * @value: pointer to the value which will be filled for the caller + * + * Inline UCFG API to be used by HDD/OSIF callers to get the + * obss protection enable value + * + * Return: QDF_STATUS_SUCCESS or QDF_STATUS_FAILURE + */ +static inline +QDF_STATUS ucfg_mlme_is_ap_obss_prot_enabled(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + return wlan_mlme_is_ap_obss_prot_enabled(psoc, value); +} + /** * ucfg_mlme_get_rts_threshold() - Get the rts threshold config * @psoc: pointer to psoc object @@ -2458,6 +2506,7 @@ ucfg_mlme_get_ts_info_ack_policy(struct wlan_objmgr_psoc *psoc, * @psoc: pointer to psoc object * @value: Value that needs to be get from the caller * + * * Inline UCFG API to be used by HDD/OSIF callers * * Return: QDF Status @@ -2468,4 +2517,34 @@ ucfg_mlme_get_ts_acm_value_for_ac(struct wlan_objmgr_psoc *psoc, bool *value) return wlan_mlme_get_ts_acm_value_for_ac(psoc, value); } +/* + * ucfg_mlme_is_sap_uapsd_enabled() - SAP UAPSD enabled status. + * @psoc: pointer to psoc object + * @value: sap uapsd enabled flag value requested from the caller + * + * Inline UCFG API to be used by HDD/OSIF callers + * + * Return: QDF Status + */ +static inline QDF_STATUS +ucfg_mlme_is_sap_uapsd_enabled(struct wlan_objmgr_psoc *psoc, bool *value) +{ + return wlan_mlme_is_sap_uapsd_enabled(psoc, value); +} + +/* + * ucfg_mlme_set_sap_uapsd_flag() - SAP UAPSD enabled status. + * @psoc: pointer to psoc object + * @value: Value that needs to be set from the caller + * + * Inline UCFG API to be used by HDD/OSIF callers + * + * Return: QDF Status + */ +static inline QDF_STATUS +ucfg_mlme_set_sap_uapsd_flag(struct wlan_objmgr_psoc *psoc, bool value) +{ + return wlan_mlme_set_sap_uapsd_flag(psoc, value); +} + #endif /* _WLAN_MLME_UCFG_API_H_ */ diff --git a/mlme/dispatcher/src/wlan_mlme_api.c b/mlme/dispatcher/src/wlan_mlme_api.c index 8b0f5436a7..906b7b41d9 100644 --- a/mlme/dispatcher/src/wlan_mlme_api.c +++ b/mlme/dispatcher/src/wlan_mlme_api.c @@ -816,6 +816,20 @@ QDF_STATUS wlan_mlme_get_num_11b_tx_chains(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +QDF_STATUS wlan_mlme_get_bt_chain_separation_flag(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + struct wlan_mlme_psoc_obj *mlme_obj = mlme_get_psoc_obj(psoc); + + if (!mlme_obj) { + mlme_err("Failed to get MLME Obj"); + return QDF_STATUS_E_FAILURE; + } + + *value = mlme_obj->cfg.chainmask_cfg.enable_bt_chain_separation; + return QDF_STATUS_SUCCESS; +} + QDF_STATUS wlan_mlme_get_num_11ag_tx_chains(struct wlan_objmgr_psoc *psoc, uint16_t *value) { @@ -1935,6 +1949,36 @@ QDF_STATUS wlan_mlme_get_oce_sap_enabled_info(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +QDF_STATUS wlan_mlme_get_ap_protection_mode(struct wlan_objmgr_psoc *psoc, + uint16_t *value) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + mlme_err("Failed to get MLME Obj"); + return QDF_STATUS_E_FAILURE; + } + *value = mlme_obj->cfg.sap_protection_cfg.ap_protection_mode; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS wlan_mlme_is_ap_obss_prot_enabled(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + mlme_err("Failed to get MLME Obj"); + return QDF_STATUS_E_FAILURE; + } + *value = mlme_obj->cfg.sap_protection_cfg.enable_ap_obss_protection; + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS wlan_mlme_get_rts_threshold(struct wlan_objmgr_psoc *psoc, uint32_t *value) { @@ -2921,3 +2965,33 @@ QDF_STATUS mlme_update_nss_vht_cap(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_SUCCESS; } + +QDF_STATUS wlan_mlme_is_sap_uapsd_enabled(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + mlme_err("Get MLME Obj failed"); + return QDF_STATUS_E_FAILURE; + } + *value = mlme_obj->cfg.qos_mlme_params.sap_uapsd_enabled; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS wlan_mlme_set_sap_uapsd_flag(struct wlan_objmgr_psoc *psoc, + bool value) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + mlme_err("Get MLME Obj failed"); + return QDF_STATUS_E_FAILURE; + } + mlme_obj->cfg.qos_mlme_params.sap_uapsd_enabled &= value; + + return QDF_STATUS_SUCCESS; +}