From 6a8f07ff7a39f23e2900d1870ca5178e5a8e4cda Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Wed, 15 Feb 2017 16:59:48 -0800 Subject: [PATCH 001/187] qcacmn: restructure policy manager component Initial changes to move policy manager to host common. Also restructure the functionalities. CRs-Fixed: 2009818 Change-Id: I163fe1f92be07dc4bc6380d889e26ce5d75e5671 --- inc/wlan_policy_mgr_api.h | 1612 ++++++++++++++++++++++++ inc/wlan_policy_mgr_public_struct.h | 930 ++++++++++++++ src/wlan_policy_mgr_action.c | 224 ++++ src/wlan_policy_mgr_core.c | 638 ++++++++++ src/wlan_policy_mgr_get_set_utils.c | 346 +++++ src/wlan_policy_mgr_i.h | 374 ++++++ src/wlan_policy_mgr_init_deinit.c | 314 +++++ src/wlan_policy_mgr_pcl.c | 172 +++ src/wlan_policy_mgr_tables_1x1_dbs_i.h | 1015 +++++++++++++++ src/wlan_policy_mgr_tables_2x2_dbs_i.h | 1392 ++++++++++++++++++++ src/wlan_policy_mgr_tables_no_dbs_i.h | 909 +++++++++++++ 11 files changed, 7926 insertions(+) create mode 100644 inc/wlan_policy_mgr_api.h create mode 100644 inc/wlan_policy_mgr_public_struct.h create mode 100644 src/wlan_policy_mgr_action.c create mode 100644 src/wlan_policy_mgr_core.c create mode 100644 src/wlan_policy_mgr_get_set_utils.c create mode 100644 src/wlan_policy_mgr_i.h create mode 100644 src/wlan_policy_mgr_init_deinit.c create mode 100644 src/wlan_policy_mgr_pcl.c create mode 100644 src/wlan_policy_mgr_tables_1x1_dbs_i.h create mode 100644 src/wlan_policy_mgr_tables_2x2_dbs_i.h create mode 100644 src/wlan_policy_mgr_tables_no_dbs_i.h diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h new file mode 100644 index 000000000000..bb00b936ed38 --- /dev/null +++ b/inc/wlan_policy_mgr_api.h @@ -0,0 +1,1612 @@ +/* + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + +#ifndef __WLAN_POLICY_MGR_API_H +#define __WLAN_POLICY_MGR_API_H + +/** + * DOC: wlan_policy_mgr_api.h + * + * Concurrenct Connection Management entity + */ + +/* Include files */ +#include "qdf_types.h" +#include "qdf_status.h" +#include "wlan_objmgr_psoc_obj.h" +#include "wlan_policy_mgr_public_struct.h" + +typedef const enum policy_mgr_pcl_type + pm_dbs_pcl_second_connection_table_type + [PM_MAX_ONE_CONNECTION_MODE][PM_MAX_NUM_OF_MODE] + [PM_MAX_CONC_PRIORITY_MODE]; + +typedef const enum policy_mgr_pcl_type + pm_dbs_pcl_third_connection_table_type + [PM_MAX_TWO_CONNECTION_MODE][PM_MAX_NUM_OF_MODE] + [PM_MAX_CONC_PRIORITY_MODE]; + +typedef const enum policy_mgr_conc_next_action + policy_mgr_next_action_two_connection_table_type + [PM_MAX_ONE_CONNECTION_MODE][POLICY_MGR_MAX_BAND]; + +typedef const enum policy_mgr_conc_next_action + policy_mgr_next_action_three_connection_table_type + [PM_MAX_TWO_CONNECTION_MODE][POLICY_MGR_MAX_BAND]; + +/** + * policy_mgr_set_concurrency_mode() - To set concurrency mode + * @mode: adapter mode + * + * This routine is called to set the concurrency mode + * + * Return: NONE + */ +void policy_mgr_set_concurrency_mode(enum tQDF_ADAPTER_MODE mode); + +/** + * policy_mgr_clear_concurrency_mode() - To clear concurrency mode + * @mode: adapter mode + * + * This routine is called to clear the concurrency mode + * + * Return: NONE + */ +void policy_mgr_clear_concurrency_mode(enum tQDF_ADAPTER_MODE mode); + +/** + * policy_mgr_get_connection_count() - provides the count of + * current connections + * @psoc: PSOC object information + * + * This function provides the count of current connections + * + * Return: connection count + */ +uint32_t policy_mgr_get_connection_count(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_get_concurrency_mode() - return concurrency mode + * + * This routine is used to retrieve concurrency mode + * + * Return: uint32_t value of concurrency mask + */ +uint32_t policy_mgr_get_concurrency_mode(void); + +/** + * policy_mgr_search_and_check_for_session_conc() - Checks if + * concurrecy is allowed + * @psoc: PSOC object information + * @session_id: Session id + * @roam_profile: Pointer to the roam profile + * + * Searches and gets the channel number from the scan results and checks if + * concurrency is allowed for the given session ID + * + * Non zero channel number if concurrency is allowed, zero otherwise + */ +uint8_t policy_mgr_search_and_check_for_session_conc( + struct wlan_objmgr_psoc *psoc, + uint8_t session_id, void *roam_profile); + +/** + * policy_mgr_check_for_session_conc() - Check if concurrency is + * allowed for a session + * @psoc: PSOC object information + * @session_id: Session ID + * @channel: Channel number + * + * Checks if connection is allowed for a given session_id + * + * True if the concurrency is allowed, false otherwise + */ +bool policy_mgr_check_for_session_conc( + struct wlan_objmgr_psoc *psoc, uint8_t session_id, uint8_t channel); + +/** + * policy_mgr_handle_conc_multiport() - to handle multiport concurrency + * @session_id: Session ID + * @channel: Channel number + * + * This routine will handle STA side concurrency when policy manager + * is enabled. + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_handle_conc_multiport( + struct wlan_objmgr_psoc *psoc, uint8_t session_id, uint8_t channel); + +#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH +/** + * policy_mgr_check_concurrent_intf_and_restart_sap() - Check + * concurrent change intf + * @psoc: PSOC object information + * + * Checks the concurrent change interface and restarts SAP + * Return: None + */ +void policy_mgr_check_concurrent_intf_and_restart_sap( + struct wlan_objmgr_psoc *psoc); +#else +static inline void policy_mgr_check_concurrent_intf_and_restart_sap( + struct wlan_objmgr_psoc *psoc) +{ + +} +#endif /* FEATURE_WLAN_MCC_TO_SCC_SWITCH */ + +/** + * policy_mgr_is_mcc_in_24G() - Function to check for MCC in 2.4GHz + * @psoc: PSOC object information + * + * This function is used to check for MCC operation in 2.4GHz band. + * STA, P2P and SAP adapters are only considered. + * + * Return: Non zero value if MCC is detected in 2.4GHz band + * + */ +uint8_t policy_mgr_is_mcc_in_24G(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_set_mas() - Function to set MAS value to UMAC + * @psoc: PSOC object information + * @mas_value: 0-Disable, 1-Enable MAS + * + * This function passes down the value of MAS to UMAC + * + * Return: Configuration message posting status, SUCCESS or Fail + * + */ +int32_t policy_mgr_set_mas(struct wlan_objmgr_psoc *psoc, uint8_t mas_value); + +/** + * policy_mgr_set_mcc_p2p_quota() - Function to set quota for P2P + * @psoc: PSOC object information + * @set_value: Qouta value for the interface + * + * This function is used to set the quota for P2P cases + * + * Return: Configuration message posting status, SUCCESS or Fail + * + */ +int policy_mgr_set_mcc_p2p_quota(struct wlan_objmgr_psoc *psoc, + uint32_t set_value); + +/** + * policy_mgr_change_mcc_go_beacon_interval() - Change MCC beacon interval + * @psoc: PSOC object information + * + * Updates the beacon parameters of the GO in MCC scenario + * + * Return: Success or Failure depending on the overall function behavior + */ +QDF_STATUS policy_mgr_change_mcc_go_beacon_interval( + struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_go_set_mcc_p2p_quota() - Function to set quota for P2P GO + * @psoc: PSOC object information + * @set_value: Qouta value for the interface + * + * This function is used to set the quota for P2P GO cases + * + * Return: Configuration message posting status, SUCCESS or Fail + * + */ +int policy_mgr_go_set_mcc_p2p_quota(struct wlan_objmgr_psoc *psoc, + uint32_t set_value); + +/** + * policy_mgr_set_mcc_latency() - Set MCC latency + * @psoc: PSOC object information + * @set_value: Latency value + * + * Sets the MCC latency value during STA-P2P concurrency + * + * Return: None + */ +void policy_mgr_set_mcc_latency(struct wlan_objmgr_psoc *psoc, int set_value); +#if defined(FEATURE_WLAN_MCC_TO_SCC_SWITCH) +/** + * policy_mgr_change_sap_channel_with_csa() - Move SAP channel using (E)CSA + * @psoc: PSOC object information + * @hdd_ap_ctx: AP context + * + * Invoke the callback function to change SAP channel using (E)CSA + * + * Return: None + */ +void policy_mgr_change_sap_channel_with_csa(struct wlan_objmgr_psoc *psoc); +#else +static inline void policy_mgr_change_sap_channel_with_csa( + struct wlan_objmgr_psoc *psoc) +{ + +} +#endif + +/** + * policy_mgr_incr_active_session() - increments the number of active sessions + * @psoc: PSOC object information + * @mode: Adapter mode + * @session_id: session ID for the connection session + * + * This function increments the number of active sessions maintained per device + * mode. In the case of STA/P2P CLI/IBSS upon connection indication it is + * incremented; In the case of SAP/P2P GO upon bss start it is incremented + * + * Return: None + */ +void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, + enum tQDF_ADAPTER_MODE mode, uint8_t sessionId); + +/** + * policy_mgr_decr_active_session() - decrements the number of active sessions + * @psoc: PSOC object information + * @mode: Adapter mode + * @session_id: session ID for the connection session + * + * This function decrements the number of active sessions maintained per device + * mode. In the case of STA/P2P CLI/IBSS upon disconnection it is decremented + * In the case of SAP/P2P GO upon bss stop it is decremented + * + * Return: None + */ +void policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, + enum tQDF_ADAPTER_MODE mode, uint8_t sessionId); + +/** + * policy_mgr_decr_session_set_pcl() - Decrement session count and set PCL + * @psoc: PSOC object information + * @mode: Adapter mode + * @session_id: Session id + * + * Decrements the active session count and sets the PCL if a STA connection + * exists + * + * Return: None + */ +void policy_mgr_decr_session_set_pcl(struct wlan_objmgr_psoc *psoc, + enum tQDF_ADAPTER_MODE mode, uint8_t session_id); + +/** + * policy_mgr_get_channel() - provide channel number of given mode and vdevid + * @psoc: PSOC object information + * @mode: given mode + * @vdev_id: pointer to vdev_id + * + * This API will provide channel number of matching mode and vdevid. + * If vdev_id is NULL then it will match only mode + * If vdev_id is not NULL the it will match both mode and vdev_id + * + * Return: channel number + */ +uint8_t policy_mgr_get_channel(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, uint32_t *vdev_id); + +/** + * policy_mgr_get_pcl() - provides the preferred channel list for + * new connection + * @psoc: PSOC object information + * @mode: Device mode + * @pcl_channels: PCL channels + * @len: lenght of the PCL + * @pcl_weight: Weights of the PCL + * @weight_len: Max length of the weights list + * + * This function provides the preferred channel list on which + * policy manager wants the new connection to come up. Various + * connection decision making entities will using this function + * to query the PCL info + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint8_t *pcl_channels, uint32_t *len, + uint8_t *pcl_weight, uint32_t weight_len); + +/** + * policy_mgr_update_with_safe_channel_list() - provides the safe + * channel list + * @pcl_channels: channel list + * @len: length of the list + * @weight_list: Weights of the PCL + * @weight_len: Max length of the weights list + * + * This function provides the safe channel list from the list + * provided after consulting the channel avoidance list + * + * Return: None + */ +void policy_mgr_update_with_safe_channel_list(uint8_t *pcl_channels, + uint32_t *len, uint8_t *weight_list, uint32_t weight_len); + +/** + * policy_mgr_get_nondfs_preferred_channel() - to get non-dfs preferred channel + * for given mode + * @psoc: PSOC object information + * @mode: mode for which preferred non-dfs channel is requested + * @for_existing_conn: flag to indicate if preferred channel is requested + * for existing connection + * + * this routine will return non-dfs channel + * 1) for getting non-dfs preferred channel, first we check if there are any + * other connection exist whose channel is non-dfs. if yes then return that + * channel so that we can accommodate upto 3 mode concurrency. + * 2) if there no any other connection present then query concurrency module + * to give preferred channel list. once we get preferred channel list, loop + * through list to find first non-dfs channel from ascending order. + * + * Return: uint8_t non-dfs channel + */ +uint8_t policy_mgr_get_nondfs_preferred_channel(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, bool for_existing_conn); + +/** + * policy_mgr_is_any_nondfs_chnl_present() - Find any non-dfs + * channel from conc table + * @psoc: PSOC object information + * @channel: pointer to channel which needs to be filled + * + * In-case if any connection is already present whose channel is none dfs then + * return that channel + * + * Return: true up-on finding non-dfs channel else false + */ +bool policy_mgr_is_any_nondfs_chnl_present(struct wlan_objmgr_psoc *psoc, + uint8_t *channel); + +/** + * policy_mgr_is_any_dfs_beaconing_session_present() - to find + * if any DFS session + * @psoc: PSOC object information + * @channel: pointer to channel number that needs to filled + * + * If any beaconing session such as SAP or GO present and it is on DFS channel + * then this function will return true + * + * Return: true if session is on DFS or false if session is on non-dfs channel + */ +bool policy_mgr_is_any_dfs_beaconing_session_present( + struct wlan_objmgr_psoc *psoc, uint8_t *channel); + +/** + * policy_mgr_allow_concurrency() - Check for allowed concurrency + * combination + * @psoc: PSOC object information + * @mode: new connection mode + * @channel: channel on which new connection is coming up + * @bw: Bandwidth requested by the connection (optional) + * + * When a new connection is about to come up check if current + * concurrency combination including the new connection is + * allowed or not based on the HW capability + * + * Return: True/False + */ +bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint8_t channel, enum hw_mode_bandwidth bw); + +/** + * policy_mgr_get_first_connection_pcl_table_index() - provides the + * row index to firstConnectionPclTable to get to the correct + * pcl + * @psoc: PSOC object information + * + * This function provides the row index to + * firstConnectionPclTable. The index is the preference config. + * + * Return: table index + */ +enum policy_mgr_conc_priority_mode + policy_mgr_get_first_connection_pcl_table_index( + struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_get_second_connection_pcl_table_index() - provides the + * row index to secondConnectionPclTable to get to the correct + * pcl + * @psoc: PSOC object information + * + * This function provides the row index to + * secondConnectionPclTable. The index is derived based on + * current connection, band on which it is on & chain mask it is + * using, as obtained from pm_conc_connection_list. + * + * Return: table index + */ +enum policy_mgr_one_connection_mode + policy_mgr_get_second_connection_pcl_table_index( + struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_get_third_connection_pcl_table_index() - provides the + * row index to thirdConnectionPclTable to get to the correct + * pcl + * @psoc: PSOC object information + * + * This function provides the row index to + * thirdConnectionPclTable. The index is derived based on + * current connection, band on which it is on & chain mask it is + * using, as obtained from pm_conc_connection_list. + * + * Return: table index + */ +enum policy_mgr_two_connection_mode + policy_mgr_get_third_connection_pcl_table_index( + struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_incr_connection_count() - adds the new connection to + * the current connections list + * @psoc: PSOC object information + * @vdev_id: vdev id + * + * + * This function adds the new connection to the current + * connections list + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_incr_connection_count(struct wlan_objmgr_psoc *psoc, + uint32_t vdev_id); + +/** + * policy_mgr_update_connection_info() - updates the existing + * connection in the current connections list + * @psoc: PSOC object information + * @vdev_id: vdev id + * + * + * This function adds the new connection to the current + * connections list + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_update_connection_info(struct wlan_objmgr_psoc *psoc, + uint32_t vdev_id); + +/** + * policy_mgr_decr_connection_count() - remove the old connection + * from the current connections list + * @psoc: PSOC object information + * @vdev_id: vdev id of the old connection + * + * + * This function removes the old connection from the current + * connections list + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_decr_connection_count(struct wlan_objmgr_psoc *psoc, + uint32_t vdev_id); + +/** + * policy_mgr_current_connections_update() - initiates actions + * needed on current connections once channel has been decided + * for the new connection + * @psoc: PSOC object information + * @session_id: Session id + * @channel: Channel on which new connection will be + * @reason: Reason for which connection update is required + * + * This function initiates initiates actions + * needed on current connections once channel has been decided + * for the new connection. Notifies UMAC & FW as well + * + * Return: QDF_STATUS enum + */ +QDF_STATUS policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc, + uint32_t session_id, uint8_t channel, + enum policy_mgr_conn_update_reason); + +/** + * policy_mgr_is_ibss_conn_exist() - to check if IBSS connection already present + * @psoc: PSOC object information + * @ibss_channel: pointer to ibss channel which needs to be filled + * + * this routine will check if IBSS connection already exist or no. If it + * exist then this routine will return true and fill the ibss_channel value. + * + * Return: true if ibss connection exist else false + */ +bool policy_mgr_is_ibss_conn_exist(struct wlan_objmgr_psoc *psoc, + uint8_t *ibss_channel); + +/** + * policy_mgr_get_conn_info() - get the current connections list + * @len: lenght of the list + * + * This function returns a pointer to the current connections + * list + * + * Return: pointer to connection list + */ +struct policy_mgr_conc_connection_info *policy_mgr_get_conn_info( + uint32_t *len); +#ifdef MPC_UT_FRAMEWORK +/** + * policy_mgr_incr_connection_count_utfw() - adds the new + * connection to the current connections list + * @psoc: PSOC object information + * @vdev_id: vdev id + * @tx_streams: number of transmit spatial streams + * @rx_streams: number of receive spatial streams + * @chain_mask: chain mask + * @type: connection type + * @sub_type: connection subtype + * @channelid: channel number + * @mac_id: mac id + * + * This function adds the new connection to the current + * connections list + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_incr_connection_count_utfw(struct wlan_objmgr_psoc *psoc, + uint32_t vdev_id, uint32_t tx_streams, uint32_t rx_streams, + uint32_t chain_mask, uint32_t type, uint32_t sub_type, + uint32_t channelid, uint32_t mac_id); + +/** + * policy_mgr_update_connection_info_utfw() - updates the + * existing connection in the current connections list + * @psoc: PSOC object information + * @vdev_id: vdev id + * @tx_streams: number of transmit spatial streams + * @rx_streams: number of receive spatial streams + * @chain_mask: chain mask + * @type: connection type + * @sub_type: connection subtype + * @channelid: channel number + * @mac_id: mac id + * + * This function updates the connection to the current + * connections list + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_update_connection_info_utfw(struct wlan_objmgr_psoc *psoc, + uint32_t vdev_id, uint32_t tx_streams, uint32_t rx_streams, + uint32_t chain_mask, uint32_t type, uint32_t sub_type, + uint32_t channelid, uint32_t mac_id); + +/** + * policy_mgr_decr_connection_count_utfw() - remove the old + * connection from the current connections list + * @psoc: PSOC object information + * @del_all: delete all entries + * @vdev_id: vdev id + * + * This function removes the old connection from the current + * connections list + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_decr_connection_count_utfw(struct wlan_objmgr_psoc *psoc, + uint32_t del_all, uint32_t vdev_id); + +/** + * policy_mgr_get_pcl_from_first_conn_table() - Get PCL for new + * connection from first connection table + * @type: Connection mode of type 'policy_mgr_con_mode' + * @sys_pref: System preference + * + * Get the PCL for a new connection + * + * Return: PCL channels enum + */ +enum policy_mgr_pcl_type policy_mgr_get_pcl_from_first_conn_table( + enum policy_mgr_con_mode type, + enum policy_mgr_conc_priority_mode sys_pref); + +/** + * policy_mgr_get_pcl_from_second_conn_table() - Get PCL for new + * connection from second connection table + * @idx: index into first connection table + * @type: Connection mode of type 'policy_mgr_con_mode' + * @sys_pref: System preference + * @dbs_capable: if HW DBS capable + * + * Get the PCL for a new connection + * + * Return: PCL channels enum + */ +enum policy_mgr_pcl_type policy_mgr_get_pcl_from_second_conn_table( + enum policy_mgr_one_connection_mode idx, enum policy_mgr_con_mode type, + enum policy_mgr_conc_priority_mode sys_pref, uint8_t dbs_capable); + +/** + * policy_mgr_get_pcl_from_third_conn_table() - Get PCL for new + * connection from third connection table + * @idx: index into second connection table + * @type: Connection mode of type 'policy_mgr_con_mode' + * @sys_pref: System preference + * @dbs_capable: if HW DBS capable + * + * Get the PCL for a new connection + * + * Return: PCL channels enum + */ +enum policy_mgr_pcl_type policy_mgr_get_pcl_from_third_conn_table( + enum policy_mgr_two_connection_mode idx, enum policy_mgr_con_mode type, + enum policy_mgr_conc_priority_mode sys_pref, uint8_t dbs_capable); +#else +static inline QDF_STATUS policy_mgr_incr_connection_count_utfw( + struct wlan_objmgr_psoc *psoc, uint32_t vdev_id, + uint32_t tx_streams, uint32_t rx_streams, + uint32_t chain_mask, uint32_t type, uint32_t sub_type, + uint32_t channelid, uint32_t mac_id) +{ + return QDF_STATUS_SUCCESS; +} +static inline QDF_STATUS policy_mgr_update_connection_info_utfw( + struct wlan_objmgr_psoc *psoc, uint32_t vdev_id, + uint32_t tx_streams, uint32_t rx_streams, + uint32_t chain_mask, uint32_t type, uint32_t sub_type, + uint32_t channelid, uint32_t mac_id) +{ + return QDF_STATUS_SUCCESS; +} +static inline QDF_STATUS policy_mgr_decr_connection_count_utfw( + struct wlan_objmgr_psoc *psoc, uint32_t del_all, + uint32_t vdev_id) +{ + return QDF_STATUS_SUCCESS; +} +#endif + +/** + * policy_mgr_convert_device_mode_to_qdf_type() - provides the + * type translation from HDD to policy manager type + * @device_mode: Generic connection mode type + * + * + * This function provides the type translation + * + * Return: policy_mgr_con_mode enum + */ +enum policy_mgr_con_mode policy_mgr_convert_device_mode_to_qdf_type( + enum tQDF_ADAPTER_MODE device_mode); + +/** + * policy_mgr_pdev_set_hw_mode() - Set HW mode command to FW + * @psoc: PSOC object information + * @session_id: Session ID + * @mac0_ss: MAC0 spatial stream configuration + * @mac0_bw: MAC0 bandwidth configuration + * @mac1_ss: MAC1 spatial stream configuration + * @mac1_bw: MAC1 bandwidth configuration + * @dbs: HW DBS capability + * @dfs: HW Agile DFS capability + * @sbs: HW SBS capability + * @reason: Reason for connection update + * + * Sends the set hw mode request to FW + * + * e.g.: To configure 2x2_80 + * mac0_ss = HW_MODE_SS_2x2, mac0_bw = HW_MODE_80_MHZ + * mac1_ss = HW_MODE_SS_0x0, mac1_bw = HW_MODE_BW_NONE + * dbs = HW_MODE_DBS_NONE, dfs = HW_MODE_AGILE_DFS_NONE, + * sbs = HW_MODE_SBS_NONE + * e.g.: To configure 1x1_80_1x1_40 (DBS) + * mac0_ss = HW_MODE_SS_1x1, mac0_bw = HW_MODE_80_MHZ + * mac1_ss = HW_MODE_SS_1x1, mac1_bw = HW_MODE_40_MHZ + * dbs = HW_MODE_DBS, dfs = HW_MODE_AGILE_DFS_NONE, + * sbs = HW_MODE_SBS_NONE + * e.g.: To configure 1x1_80_1x1_40 (Agile DFS) + * mac0_ss = HW_MODE_SS_1x1, mac0_bw = HW_MODE_80_MHZ + * mac1_ss = HW_MODE_SS_1x1, mac1_bw = HW_MODE_40_MHZ + * dbs = HW_MODE_DBS, dfs = HW_MODE_AGILE_DFS, + * sbs = HW_MODE_SBS_NONE + * + * Return: Success if the message made it down to the next layer + */ +QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc, + uint32_t session_id, + enum hw_mode_ss_config mac0_ss, + enum hw_mode_bandwidth mac0_bw, + enum hw_mode_ss_config mac1_ss, + enum hw_mode_bandwidth mac1_bw, + enum hw_mode_dbs_capab dbs, + enum hw_mode_agile_dfs_capab dfs, + enum hw_mode_sbs_capab sbs, + enum policy_mgr_conn_update_reason reason); + +/** + * policy_mgr_nss_update_cback() - callback invoked by other + * component to provide nss update request status + * @psoc: PSOC object information + * @tx_status: tx completion status for updated beacon with new + * nss value + * @vdev_id: vdev id for the specific connection + * @next_action: next action to happen at policy mgr after + * beacon update + * @reason: Reason for nss update + * + * This function is the callback registered with SME at nss + * update request time + * + * Return: None + */ +typedef void (*policy_mgr_nss_update_cback)(struct wlan_objmgr_psoc *psoc, + uint8_t tx_status, + uint8_t vdev_id, + uint8_t next_action, + enum policy_mgr_conn_update_reason reason); + +/** + * struct policy_mgr_sme_cbacks - SME Callbacks to be invoked + * from policy manager + * @sme_get_valid_channels: Get valid channel list + * @sme_get_nss_for_vdev: Get the allowed nss value for the vdev + * @sme_soc_set_dual_mac_config: Set the dual MAC scan & FW + * config + * @sme_pdev_set_hw_mode: Set the new HW mode to FW + * @sme_pdev_set_pcl: Set new PCL to FW + * @sme_nss_update_request: Update NSS value to FW + */ +struct policy_mgr_sme_cbacks { + QDF_STATUS (*sme_get_valid_channels)(uint8_t *chan_list, + uint32_t *list_len); + void (*sme_get_nss_for_vdev)(enum tQDF_ADAPTER_MODE, + uint8_t *nss_2g, uint8_t *nss_5g); + QDF_STATUS (*sme_soc_set_dual_mac_config)( + struct policy_mgr_dual_mac_config msg); + QDF_STATUS (*sme_pdev_set_hw_mode)(struct policy_mgr_hw_mode msg); + QDF_STATUS (*sme_pdev_set_pcl)(struct policy_mgr_pcl_list msg); + QDF_STATUS (*sme_nss_update_request)(uint32_t vdev_id, + uint8_t new_nss, policy_mgr_nss_update_cback cback, + uint8_t next_action, struct wlan_objmgr_psoc *psoc, + enum policy_mgr_conn_update_reason reason); +}; + +/** + * struct policy_mgr_tdls_cbacks - TDLS Callbacks to be invoked + * from policy manager + * @set_tdls_ct_mode: Set the tdls connection tracker mode + * @check_is_tdls_allowed: check if tdls allowed or not + */ +struct policy_mgr_tdls_cbacks { + void (*set_tdls_ct_mode)(struct wlan_objmgr_psoc *psoc); + bool (*check_is_tdls_allowed)(enum tQDF_ADAPTER_MODE device_mode); +}; + +/** + * struct policy_mgr_cdp_cbacks - CDP Callbacks to be invoked + * from policy manager + * @cdp_update_mac_id: update mac_id for vdev + */ +struct policy_mgr_cdp_cbacks { + void (*cdp_update_mac_id)(struct wlan_objmgr_psoc *soc, + uint8_t vdev_id, uint8_t mac_id); +}; + +/** + * struct policy_mgr_wma_cbacks - WMA Callbacks to be invoked + * from policy manager + * @wma_get_connection_info: Get the connection related info + * from wma table + * @wma_is_service_enabled: check if certain service is enabled + * by FW + */ +struct policy_mgr_wma_cbacks { + QDF_STATUS (*wma_get_connection_info)(uint8_t vdev_id, + struct policy_mgr_vdev_entry_info *conn_table_entry); + bool (*wma_is_service_enabled)(WMI_SERVICE service_type); +}; + +/** + * policy_mgr_need_opportunistic_upgrade() - Tells us if we really + * need an upgrade to 2x2 + * @psoc: PSOC object information + * This function returns if updrade to 2x2 is needed + * + * Return: PM_NOP = upgrade is not needed, otherwise upgrade is + * needed + */ +enum policy_mgr_conc_next_action policy_mgr_need_opportunistic_upgrade( + struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_next_actions() - initiates actions needed on current + * connections once channel has been decided for the new + * connection + * @psoc: PSOC object information + * @session_id: Session id + * @action: action to be executed + * @reason: Reason for connection update + * + * This function initiates initiates actions + * needed on current connections once channel has been decided + * for the new connection. Notifies UMAC & FW as well + * + * Return: QDF_STATUS enum + */ +QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, + uint32_t session_id, + enum policy_mgr_conc_next_action action, + enum policy_mgr_conn_update_reason reason); + +/** + * policy_mgr_set_dual_mac_scan_config() - Set the dual MAC scan config + * @psoc: PSOC object information + * @dbs_val: Value of DBS bit + * @dbs_plus_agile_scan_val: Value of DBS plus agile scan bit + * @single_mac_scan_with_dbs_val: Value of Single MAC scan with DBS + * + * Set the values of scan config. For FW mode config, the existing values + * will be retained + * + * Return: None + */ +void policy_mgr_set_dual_mac_scan_config(struct wlan_objmgr_psoc *psoc, + uint8_t dbs_val, + uint8_t dbs_plus_agile_scan_val, + uint8_t single_mac_scan_with_dbs_val); + +/** + * policy_mgr_set_dual_mac_fw_mode_config() - Set the dual mac FW mode config + * @psoc: PSOC object information + * @dbs: DBS bit + * @dfs: Agile DFS bit + * + * Set the values of fw mode config. For scan config, the existing values + * will be retain. + * + * Return: None + */ +void policy_mgr_set_dual_mac_fw_mode_config(struct wlan_objmgr_psoc *psoc, + uint8_t dbs, uint8_t dfs); + +/** + * policy_mgr_soc_set_dual_mac_cfg_cb() - Callback for set dual mac config + * @status: Status of set dual mac config + * @scan_config: Current scan config whose status is the first param + * @fw_mode_config: Current FW mode config whose status is the first param + * + * Callback on setting the dual mac configuration + * + * Return: None + */ +void policy_mgr_soc_set_dual_mac_cfg_cb(enum set_hw_mode_status status, + uint32_t scan_config, uint32_t fw_mode_config); + +/** + * policy_mgr_map_concurrency_mode() - to map concurrency mode + * between sme and hdd + * @old_mode: sme provided adapter mode + * @new_mode: hdd provided concurrency mode + * + * This routine will map concurrency mode between sme and hdd + * + * Return: true or false + */ +bool policy_mgr_map_concurrency_mode(enum tQDF_ADAPTER_MODE *old_mode, + enum policy_mgr_con_mode *new_mode); + +/** + * policy_mgr_get_channel_from_scan_result() - to get channel from scan result + * @psoc: PSOC object information + * @roam_profile: pointer to roam profile + * @channel: channel to be filled + * + * This routine gets channel which most likely a candidate to which STA + * will make connection. + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_get_channel_from_scan_result( + struct wlan_objmgr_psoc *psoc, + void *roam_profile, uint8_t *channel); + +/** + * policy_mgr_concurrent_open_sessions_running() - Checks for + * concurrent open session + * + * Checks if more than one open session is running for all the allowed modes + * in the driver + * + * Return: True if more than one open session exists, False otherwise + */ +bool policy_mgr_concurrent_open_sessions_running(void); + +/** + * policy_mgr_max_concurrent_connections_reached() - Check if + * max conccurrency is reached + * @psoc: PSOC object information + * Checks for presence of concurrency where more than one connection exists + * + * Return: True if the max concurrency is reached, False otherwise + * + * Example: + * STA + STA (wlan0 and wlan1 are connected) - returns true + * STA + STA (wlan0 connected and wlan1 disconnected) - returns false + * DUT with P2P-GO + P2P-CLIENT connection) - returns true + * + */ +bool policy_mgr_max_concurrent_connections_reached( + struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_clear_concurrent_session_count() - Clear active session count + * @psoc: PSOC object information + * Clears the active session count for all modes + * + * Return: None + */ +void policy_mgr_clear_concurrent_session_count(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_is_multiple_active_sta_sessions() - Check for + * multiple STA connections + * + * Checks if multiple active STA connection are in the driver + * + * Return: True if multiple STA sessions are present, False otherwise + * + */ +bool policy_mgr_is_multiple_active_sta_sessions(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_is_sta_active_connection_exists() - Check if a STA + * connection is active + * + * Checks if there is atleast one active STA connection in the driver + * + * Return: True if an active STA session is present, False otherwise + */ +bool policy_mgr_is_sta_active_connection_exists(void); + +/** + * policy_mgr_concurrent_beaconing_sessions_running() - Checks + * for concurrent beaconing entities + * + * Checks if multiple beaconing sessions are running i.e., if SAP or GO or IBSS + * are beaconing together + * + * Return: True if multiple entities are beaconing together, False otherwise + */ +bool policy_mgr_concurrent_beaconing_sessions_running(void); + +/** + * policy_mgr_wait_for_connection_update() - Wait for hw mode + * command to get processed + * @psoc: PSOC object information + * Waits for CONNECTION_UPDATE_TIMEOUT duration until the set hw mode + * response sets the event connection_update_done_evt + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_wait_for_connection_update( + struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_reset_connection_update() - Reset connection + * update event + * @psoc: PSOC object information + * Resets the concurrent connection update event + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_reset_connection_update(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_set_connection_update() - Set connection update + * event + * @psoc: PSOC object information + * Sets the concurrent connection update event + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_set_connection_update(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_restart_opportunistic_timer() - Restarts opportunistic timer + * @psoc: PSOC object information + * @check_state: check timer state if this flag is set, else restart + * irrespective of state + * + * Restarts opportunistic timer for DBS_OPPORTUNISTIC_TIME seconds. + * Check if current state is RUNNING if check_state is set, else + * restart the timer irrespective of state. + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_restart_opportunistic_timer( + struct wlan_objmgr_psoc *psoc, bool check_state); + +/** + * policy_mgr_modify_sap_pcl_based_on_mandatory_channel() - + * Modify SAPs PCL based on mandatory channel list + * @psoc: PSOC object information + * @pcl_list_org: Pointer to the preferred channel list to be trimmed + * @weight_list_org: Pointer to the weights of the preferred channel list + * @pcl_len_org: Pointer to the length of the preferred chanel list + * + * Modifies the preferred channel list of SAP based on the mandatory channel + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_modify_sap_pcl_based_on_mandatory_channel( + struct wlan_objmgr_psoc *psoc, uint8_t *pcl_list_org, + uint8_t *weight_list_org, uint32_t *pcl_len_org); + +/** + * policy_mgr_update_and_wait_for_connection_update() - Update and wait for + * connection update + * @psoc: PSOC object information + * @session_id: Session id + * @channel: Channel number + * @reason: Reason for connection update + * + * Update the connection to either single MAC or dual MAC and wait for the + * update to complete + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_update_and_wait_for_connection_update( + struct wlan_objmgr_psoc *psoc, uint8_t session_id, + uint8_t channel, enum policy_mgr_conn_update_reason reason); + +/** + * policy_mgr_is_sap_mandatory_channel_set() - Checks if SAP + * mandatory channel is set + * @psoc: PSOC object information + * Checks if any mandatory channel is set for SAP operation + * + * Return: True if mandatory channel is set, false otherwise + */ +bool policy_mgr_is_sap_mandatory_channel_set(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_list_has_24GHz_channel() - Check if list contains 2.4GHz channels + * @channel_list: Channel list + * @list_len: Length of the channel list + * + * Checks if the channel list contains atleast one 2.4GHz channel + * + * Return: True if 2.4GHz channel is present, false otherwise + */ +bool policy_mgr_list_has_24GHz_channel(uint8_t *channel_list, + uint32_t list_len); + +/** + * policy_mgr_get_valid_chans() - Get the valid channel list + * @psoc: PSOC object information + * @chan_list: Pointer to the valid channel list + * @list_len: Pointer to the length of the valid channel list + * + * Gets the valid channel list filtered by band + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_get_valid_chans(struct wlan_objmgr_psoc *psoc, + uint8_t *chan_list, uint32_t *list_len); + +/** + * policy_mgr_get_nss_for_vdev() - Get the allowed nss value for the + * vdev + * @psoc: PSOC object information + * @dev_mode: connection type. + * @nss2g: Pointer to the 2G Nss parameter. + * @nss5g: Pointer to the 5G Nss parameter. + * + * Fills the 2G and 5G Nss values based on connection type. + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_get_nss_for_vdev(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint8_t *nss_2g, uint8_t *nss_5g); + +/** + * policy_mgr_get_sap_mandatory_channel() - Get the mandatory channel for SAP + * @psoc: PSOC object information + * @chan: Pointer to the SAP mandatory channel + * + * Gets the mandatory channel for SAP operation + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_get_sap_mandatory_channel(struct wlan_objmgr_psoc *psoc, + uint32_t *chan); + +/** + * policy_mgr_set_sap_mandatory_channels() - Set the mandatory channel for SAP + * @psoc: PSOC object information + * @channels: Channel list to be set + * @len: Length of the channel list + * + * Sets the channels for the mandatory channel list along with the length of + * of the channel list. + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_set_sap_mandatory_channels(struct wlan_objmgr_psoc *psoc, + uint8_t *channels, uint32_t len); +#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH +/** + * policy_mgr_register_sap_restart_channel_switch_cb() - + * Register callback for SAP channel switch without restart + * @psoc: PSOC object information + * @sap_restart_chan_switch_cb: Callback to perform channel switch + * + * Registers callback to perform channel switch without having to actually + * restart the beaconing entity + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_register_sap_restart_channel_switch_cb( + struct wlan_objmgr_psoc *psoc, + void (*sap_restart_chan_switch_cb)(void *, uint32_t, uint32_t)); + +/** + * policy_mgr_deregister_sap_restart_channel_switch_cb() - + * De-Register callback for SAP channel switch without restart + * @psoc: PSOC object information + * De Registers callback to perform channel switch + * + * Return: QDF_STATUS Enumeration + */ +QDF_STATUS policy_mgr_deregister_sap_restart_channel_switch_cb( + struct wlan_objmgr_psoc *psoc); +#endif + +/** + * policy_mgr_is_any_mode_active_on_band_along_with_session() - + * Check if any connection mode is active on a band along with + * the given session + * @psoc: PSOC object information + * @session_id: Session along which active sessions are looked for + * @band: Operating frequency band of the connection + * POLICY_MGR_BAND_24: Looks for active connection on 2.4 GHz only + * POLICY_MGR_BAND_5: Looks for active connection on 5 GHz only + * + * Checks if any of the connection mode is active on a given frequency band + * + * Return: True if any connection is active on a given band, false otherwise + */ +bool policy_mgr_is_any_mode_active_on_band_along_with_session( + struct wlan_objmgr_psoc *psoc, uint8_t session_id, + enum policy_mgr_band band); + +/** + * policy_mgr_get_mac_id_by_session_id() - Get MAC ID for a given session ID + * @psoc: PSOC object information + * @session_id: Session ID + * @mac_id: Pointer to the MAC ID + * + * Gets the MAC ID for a given session ID + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_get_mac_id_by_session_id(struct wlan_objmgr_psoc *psoc, + uint8_t session_id, uint8_t *mac_id); + +/** + * policy_mgr_get_mcc_session_id_on_mac() - Get MCC session's ID + * @psoc: PSOC object information + * @mac_id: MAC ID on which MCC session needs to be found + * @session_id: Session with which MCC combination needs to be found + * @mcc_session_id: Pointer to the MCC session ID + * + * Get the session ID of the MCC interface + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_get_mcc_session_id_on_mac(struct wlan_objmgr_psoc *psoc, + uint8_t mac_id, uint8_t session_id, + uint8_t *mcc_session_id); + +/** + * policy_mgr_get_mcc_operating_channel() - Get the MCC channel + * @psoc: PSOC object information + * @session_id: Session ID with which MCC is being done + * + * Gets the MCC channel for a given session ID. + * + * Return: '0' (INVALID_CHANNEL_ID) or valid channel number + */ +uint8_t policy_mgr_get_mcc_operating_channel(struct wlan_objmgr_psoc *psoc, + uint8_t session_id); + +/** + * policy_mgr_get_pcl_for_existing_conn() - Get PCL for existing connection + * @psoc: PSOC object information + * @mode: Connection mode of type 'policy_mgr_con_mode' + * @pcl_ch: Pointer to the PCL + * @len: Pointer to the length of the PCL + * @pcl_weight: Pointer to the weights of the PCL + * @weight_len: Max length of the weights list + * + * Get the PCL for an existing connection + * + * Return: None + */ +QDF_STATUS policy_mgr_get_pcl_for_existing_conn(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint8_t *pcl_ch, uint32_t *len, + uint8_t *weight_list, uint32_t weight_len); + +/** + * policy_mgr_get_valid_chan_weights() - Get the weightage for + * all valid channels + * @psoc: PSOC object information + * @weight: Pointer to the structure containing pcl, saved channel list and + * weighed channel list + * + * Provides the weightage for all valid channels. This compares the PCL list + * with the valid channel list. The channels present in the PCL get their + * corresponding weightage and the non-PCL channels get the default weightage + * of WEIGHT_OF_NON_PCL_CHANNELS. + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_pcl_chan_weights *weight); + +/** + * policy_mgr_set_hw_mode_on_channel_switch() - Set hw mode + * after channel switch + * @session_id: Session ID + * + * Sets hw mode after doing a channel switch + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_set_hw_mode_on_channel_switch( + struct wlan_objmgr_psoc *psoc, uint8_t session_id); + +/** + * policy_mgr_set_do_hw_mode_change_flag() - Set flag to indicate hw mode change + * @psoc: PSOC object information + * @flag: Indicate if hw mode change is required or not + * + * Set the flag to indicate whether a hw mode change is required after a + * vdev up or not. Flag value of true indicates that a hw mode change is + * required after vdev up. + * + * Return: None + */ +void policy_mgr_set_do_hw_mode_change_flag(struct wlan_objmgr_psoc *psoc, + bool flag); + +/** + * policy_mgr_is_hw_mode_change_after_vdev_up() - Check if hw + * mode change is needed + * @psoc: PSOC object information + * Returns the flag which indicates if a hw mode change is required after + * vdev up. + * + * Return: True if hw mode change is required, false otherwise + */ +bool policy_mgr_is_hw_mode_change_after_vdev_up(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_checkn_update_hw_mode_single_mac_mode() - Set hw_mode to SMM + * if required + * @psoc: PSOC object information + * @channel: channel number for the new STA connection + * + * After the STA disconnection, if the hw_mode is in DBS and the new STA + * connection is coming in the band in which existing connections are + * present, then this function stops the dbs opportunistic timer and sets + * the hw_mode to Single MAC mode (SMM). + * + * Return: None + */ +void policy_mgr_checkn_update_hw_mode_single_mac_mode( + struct wlan_objmgr_psoc *psoc, uint8_t channel); + +/** + * policy_mgr_dump_connection_status_info() - Dump the concurrency information + * @psoc: PSOC object information + * Prints the concurrency information such as tx/rx spatial stream, chainmask, + * etc. + * + * Return: None + */ +void policy_mgr_dump_connection_status_info(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_mode_specific_connection_count() - provides the + * count of connections of specific mode + * @psoc: PSOC object information + * @mode: type of connection + * @list: To provide the indices on pm_conc_connection_list + * (optional) + * + * This function provides the count of current connections + * + * Return: connection count of specific type + */ +uint32_t policy_mgr_mode_specific_connection_count( + struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, + uint32_t *list); + +/** + * policy_mgr_hw_mode_transition_cb() - Callback for HW mode + * transition from FW + * @old_hw_mode_index: Old HW mode index + * @new_hw_mode_index: New HW mode index + * @num_vdev_mac_entries: Number of vdev-mac id mapping that follows + * @vdev_mac_map: vdev-mac id map. This memory will be freed by the caller. + * So, make local copy if needed. + * + * Provides the old and new HW mode index set by the FW + * + * Return: None + */ +void policy_mgr_hw_mode_transition_cb(uint32_t old_hw_mode_index, + uint32_t new_hw_mode_index, + uint32_t num_vdev_mac_entries, + struct policy_mgr_vdev_mac_map *vdev_mac_map, + struct wlan_objmgr_psoc *context); + +/** + * policy_mgr_current_concurrency_is_mcc() - To check the current + * concurrency combination if it is doing MCC + * @psoc: PSOC object information + * This routine is called to check if it is doing MCC + * + * Return: True - MCC, False - Otherwise + */ +bool policy_mgr_current_concurrency_is_mcc(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_register_sme_cb() - register SME callbacks + * @psoc: PSOC object information + * @sme_cbacks: function pointers from SME + * + * API, allows SME to register callbacks to be invoked by policy + * mgr + * + * Return: SUCCESS, + * Failure (if registration fails) + */ +QDF_STATUS policy_mgr_register_sme_cb(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_sme_cbacks *sme_cbacks); + +/** + * policy_mgr_register_tdls_cb() - register TDLS callbacks + * @psoc: PSOC object information + * @tdls_cbacks: function pointers from TDLS + * + * API, allows TDLS to register callbacks to be invoked by + * policy mgr + * + * Return: SUCCESS, + * Failure (if registration fails) + */ +QDF_STATUS policy_mgr_register_tdls_cb(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_tdls_cbacks *tdls_cbacks); + +/** + * policy_mgr_register_cdp_cb() - register CDP callbacks + * @psoc: PSOC object information + * @cdp_cbacks: function pointers from CDP + * + * API, allows CDP to register callbacks to be invoked by + * policy mgr + * + * Return: SUCCESS, + * Failure (if registration fails) + */ +QDF_STATUS policy_mgr_register_cdp_cb(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_cdp_cbacks *cdp_cbacks); + +/** + * policy_mgr_register_wma_cb() - register WMA callbacks + * @psoc: PSOC object information + * @wma_cbacks: function pointers from WMA + * + * API, allows WMA to register callbacks to be invoked by policy + * mgr + * + * Return: SUCCESS, + * Failure (if registration fails) + */ +QDF_STATUS policy_mgr_register_wma_cb(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_wma_cbacks *wma_cbacks); + +/** + * policy_mgr_is_dbs_enable() - Check if master DBS control is enabled + * @psoc: PSOC object information + * Checks if the master DBS control is enabled. This will be used + * to override any other DBS capability + * + * Return: True if master DBS control is enabled + */ +bool policy_mgr_is_dbs_enable(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_is_hw_dbs_capable() - Check if HW is DBS capable + * @psoc: PSOC object information + * Checks if the HW is DBS capable + * + * Return: true if the HW is DBS capable + */ +bool policy_mgr_is_hw_dbs_capable(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_is_hw_sbs_capable() - Check if HW is SBS capable + * @psoc: PSOC object information + * Checks if the HW is SBS capable + * + * Return: true if the HW is SBS capable + */ +bool policy_mgr_is_hw_sbs_capable(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_is_current_hwmode_dbs() - Check if current hw mode is DBS + * @psoc: PSOC object information + * Checks if current hardware mode of the system is DBS or no + * + * Return: true or false + */ +bool policy_mgr_is_current_hwmode_dbs(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_is_hw_dbs_2x2_capable() - if hardware is capable of dbs 2x2 + * @psoc: PSOC object information + * This function checks if hw_modes supported are always capable of + * DBS 2x2. + * true: DBS 2x2 can always be supported + * false: hw_modes support DBS 1x1 as well + * + * Return: true - DBS2x2, false - DBS1x1 + */ +bool policy_mgr_is_hw_dbs_2x2_capable(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_init() - Policy Manager component initialization + * routine + * + * Return - QDF Status + */ +QDF_STATUS policy_mgr_init(void); + +/** + * policy_mgr_deinit() - Policy Manager component + * de-initialization routine + * + * Return - QDF Status + */ +QDF_STATUS policy_mgr_deinit(void); + +/** + * policy_mgr_psoc_enable() - Policy Manager component + * enable routine + * @psoc: PSOC object information + * + * Return - QDF Status + */ +QDF_STATUS policy_mgr_psoc_enable(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_psoc_disable() - Policy Manager component + * disable routine + * @psoc: PSOC object information + * + * Return - QDF Status + */ +QDF_STATUS policy_mgr_psoc_disable(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_psoc_open() - Policy Manager component + * open routine + * @psoc: PSOC object information + * + * Return - QDF Status + */ +QDF_STATUS policy_mgr_psoc_open(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_psoc_close() - Policy Manager component + * close routine + * @psoc: PSOC object information + * + * Return - QDF Status + */ +QDF_STATUS policy_mgr_psoc_close(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_get_num_dbs_hw_modes() - Get number of HW mode + * @psoc: PSOC object information + * Fetches the number of DBS HW modes returned by the FW + * + * Return: Negative value on error or returns the number of DBS HW modes + */ +int8_t policy_mgr_get_num_dbs_hw_modes(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_get_dbs_hw_modes() - Get the DBS HW modes for userspace + * @psoc: PSOC object information + * @one_by_one_dbs: 1x1 DBS capability of HW + * @two_by_two_dbs: 2x2 DBS capability of HW + * + * Provides the DBS HW mode capability such as whether + * 1x1 DBS, 2x2 DBS is supported by the HW or not. + * + * Return: Failure in case of error and 0 on success + * one_by_one_dbs/two_by_two_dbs will be false, + * if they are not supported. + * one_by_one_dbs/two_by_two_dbs will be true, + * if they are supported. + * false values of one_by_one_dbs/two_by_two_dbs, + * indicate DBS is disabled + */ +QDF_STATUS policy_mgr_get_dbs_hw_modes(struct wlan_objmgr_psoc *psoc, + bool *one_by_one_dbs, bool *two_by_two_dbs); + +/** + * policy_mgr_check_sta_ap_concurrent_ch_intf() - Restart SAP in STA-AP case + * @data: Pointer to STA adapter + * + * Restarts the SAP interface in STA-AP concurrency scenario + * + * Restart: None + */ +void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data); + +/** + * policy_mgr_get_current_hw_mode() - Get current HW mode params + * @psoc: PSOC object information + * @hw_mode: HW mode parameters + * + * Provides the current HW mode parameters if the HW mode is initialized + * in the driver + * + * Return: Success if the current HW mode params are successfully populated + */ +QDF_STATUS policy_mgr_get_current_hw_mode(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_hw_mode_params *hw_mode); + +/** + * policy_mgr_get_dbs_plus_agile_scan_config() - Get DBS plus agile scan bit + * @psoc: PSOC object information + * Gets the DBS plus agile scan bit of concurrent_scan_config_bits + * + * Return: 0 or 1 to indicate the DBS plus agile scan bit + */ +bool policy_mgr_get_dbs_plus_agile_scan_config(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_get_single_mac_scan_with_dfs_config() - Get Single + * MAC scan with DFS bit + * @psoc: PSOC object information + * Gets the Single MAC scan with DFS bit of concurrent_scan_config_bits + * + * Return: 0 or 1 to indicate the Single MAC scan with DFS bit + */ +bool policy_mgr_get_single_mac_scan_with_dfs_config( + struct wlan_objmgr_psoc *psoc); +#endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h new file mode 100644 index 000000000000..15abfb4e3e6f --- /dev/null +++ b/inc/wlan_policy_mgr_public_struct.h @@ -0,0 +1,930 @@ +/* + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + +#ifndef __WLAN_POLICY_MGR_PUBLIC_STRUCT_H +#define __WLAN_POLICY_MGR_PUBLIC_STRUCT_H + +/** + * DOC: wlan_policy_mgr_public_struct.h + * + * Concurrenct Connection Management entity + */ + +/* Include files */ +#include "wmi_unified.h" + +#define POLICY_MGR_MAX_CHANNEL_LIST 128 + +/** + * enum hw_mode_ss_config - Possible spatial stream configuration + * @HW_MODE_SS_0x0: Unused Tx and Rx of MAC + * @HW_MODE_SS_1x1: 1 Tx SS and 1 Rx SS + * @HW_MODE_SS_2x2: 2 Tx SS and 2 Rx SS + * @HW_MODE_SS_3x3: 3 Tx SS and 3 Rx SS + * @HW_MODE_SS_4x4: 4 Tx SS and 4 Rx SS + * + * Note: Right now only 1x1 and 2x2 are being supported. Other modes should + * be added when supported. Asymmetric configuration like 1x2, 2x1 are also + * not supported now. But, they are still valid. Right now, Tx/Rx SS support is + * 4 bits long. So, we can go upto 15x15 + */ +enum hw_mode_ss_config { + HW_MODE_SS_0x0, + HW_MODE_SS_1x1, + HW_MODE_SS_2x2, + HW_MODE_SS_3x3, + HW_MODE_SS_4x4, +}; + +/** + * enum hw_mode_dbs_capab - DBS HW mode capability + * @HW_MODE_DBS_NONE: Non DBS capable + * @HW_MODE_DBS: DBS capable + */ +enum hw_mode_dbs_capab { + HW_MODE_DBS_NONE, + HW_MODE_DBS, +}; + +/** + * enum hw_mode_agile_dfs_capab - Agile DFS HW mode capability + * @HW_MODE_AGILE_DFS_NONE: Non Agile DFS capable + * @HW_MODE_AGILE_DFS: Agile DFS capable + */ +enum hw_mode_agile_dfs_capab { + HW_MODE_AGILE_DFS_NONE, + HW_MODE_AGILE_DFS, +}; + +/** + * enum hw_mode_sbs_capab - SBS HW mode capability + * @HW_MODE_SBS_NONE: Non SBS capable + * @HW_MODE_SBS: SBS capable + */ +enum hw_mode_sbs_capab { + HW_MODE_SBS_NONE, + HW_MODE_SBS, +}; + +/** + * enum policy_mgr_pcl_group_id - Identifies the pcl groups to be used + * @POLICY_MGR_PCL_GROUP_ID1_ID2: Use weights of group1 and group2 + * @POLICY_MGR_PCL_GROUP_ID2_ID3: Use weights of group2 and group3 + * @POLICY_MGR_PCL_GROUP_ID3_ID4: Use weights of group3 and group4 + * + * Since maximum of three groups are possible, this will indicate which + * PCL group needs to be used. + */ +enum policy_mgr_pcl_group_id { + POLICY_MGR_PCL_GROUP_ID1_ID2, + POLICY_MGR_PCL_GROUP_ID2_ID3, + POLICY_MGR_PCL_GROUP_ID3_ID4, +}; + +/** + * policy_mgr_pcl_channel_order - Order in which the PCL is requested + * @POLICY_MGR_PCL_ORDER_NONE: no order + * @POLICY_MGR_PCL_ORDER_24G_THEN_5G: 2.4 Ghz channel followed by 5 Ghz channel + * @POLICY_MGR_PCL_ORDER_5G_THEN_2G: 5 Ghz channel followed by 2.4 Ghz channel + * + * Order in which the PCL is requested + */ +enum policy_mgr_pcl_channel_order { + POLICY_MGR_PCL_ORDER_NONE, + POLICY_MGR_PCL_ORDER_24G_THEN_5G, + POLICY_MGR_PCL_ORDER_5G_THEN_2G, +}; + +/** + * enum policy_mgr_max_rx_ss - Maximum number of receive spatial streams + * @POLICY_MGR_RX_NSS_1: Receive Nss = 1 + * @POLICY_MGR_RX_NSS_2: Receive Nss = 2 + * @POLICY_MGR_RX_NSS_3: Receive Nss = 3 + * @POLICY_MGR_RX_NSS_4: Receive Nss = 4 + * @POLICY_MGR_RX_NSS_5: Receive Nss = 5 + * @POLICY_MGR_RX_NSS_6: Receive Nss = 6 + * @POLICY_MGR_RX_NSS_7: Receive Nss = 7 + * @POLICY_MGR_RX_NSS_8: Receive Nss = 8 + * + * Indicates the maximum number of spatial streams that the STA can receive + */ +enum policy_mgr_max_rx_ss { + POLICY_MGR_RX_NSS_1 = 0, + POLICY_MGR_RX_NSS_2 = 1, + POLICY_MGR_RX_NSS_3 = 2, + POLICY_MGR_RX_NSS_4 = 3, + POLICY_MGR_RX_NSS_5 = 4, + POLICY_MGR_RX_NSS_6 = 5, + POLICY_MGR_RX_NSS_7 = 6, + POLICY_MGR_RX_NSS_8 = 7, + POLICY_MGR_RX_NSS_MAX, +}; + +/** + * enum policy_mgr_chain_mode - Chain Mask tx & rx combination. + * + * @POLICY_MGR_ONE_ONE: One for Tx, One for Rx + * @POLICY_MGR_TWO_TWO: Two for Tx, Two for Rx + * @POLICY_MGR_MAX_NO_OF_CHAIN_MODE: Max place holder + * + * These are generic IDs that identify the various roles + * in the software system + */ +enum policy_mgr_chain_mode { + POLICY_MGR_ONE_ONE = 0, + POLICY_MGR_TWO_TWO, + POLICY_MGR_MAX_NO_OF_CHAIN_MODE +}; + +/** + * enum policy_mgr_conc_priority_mode - t/p, powersave, latency. + * + * @PM_THROUGHPUT: t/p is the priority + * @PM_POWERSAVE: powersave is the priority + * @PM_LATENCY: latency is the priority + * @PM_MAX_CONC_PRIORITY_MODE: Max place holder + * + * These are generic IDs that identify the various roles + * in the software system + */ +enum policy_mgr_conc_priority_mode { + PM_THROUGHPUT = 0, + PM_POWERSAVE, + PM_LATENCY, + PM_MAX_CONC_PRIORITY_MODE +}; + +/** + * enum policy_mgr_con_mode - concurrency mode for PCL table + * + * @PM_STA_MODE: station mode + * @PM_SAP_MODE: SAP mode + * @PM_P2P_CLIENT_MODE: P2P client mode + * @PM_P2P_GO_MODE: P2P Go mode + * @PM_IBSS_MODE: IBSS mode + * @PM_MAX_NUM_OF_MODE: max value place holder + */ +enum policy_mgr_con_mode { + PM_STA_MODE = 0, + PM_SAP_MODE, + PM_P2P_CLIENT_MODE, + PM_P2P_GO_MODE, + PM_IBSS_MODE, + PM_MAX_NUM_OF_MODE +}; + +/** + * enum policy_mgr_mac_use - MACs that are used + * @POLICY_MGR_MAC0: Only MAC0 is used + * @POLICY_MGR_MAC1: Only MAC1 is used + * @POLICY_MGR_MAC0_AND_MAC1: Both MAC0 and MAC1 are used + */ +enum policy_mgr_mac_use { + POLICY_MGR_MAC0 = 1, + POLICY_MGR_MAC1 = 2, + POLICY_MGR_MAC0_AND_MAC1 = 3 +}; + +/** + * enum policy_mgr_pcl_type - Various types of Preferred channel list (PCL). + * + * @PM_NONE: No channel preference + * @PM_24G: 2.4 Ghz channels only + * @PM_5G: 5 Ghz channels only + * @PM_SCC_CH: SCC channel only + * @PM_MCC_CH: MCC channels only + * @PM_SBS_CH: SBS channels only + * @PM_SCC_CH_24G: SCC channel & 2.4 Ghz channels + * @PM_SCC_CH_5G: SCC channel & 5 Ghz channels + * @PM_24G_SCC_CH: 2.4 Ghz channels & SCC channel + * @PM_5G_SCC_CH: 5 Ghz channels & SCC channel + * @PM_SCC_ON_5_SCC_ON_24_24G: SCC channel on 5 Ghz, SCC + * channel on 2.4 Ghz & 2.4 Ghz channels + * @PM_SCC_ON_5_SCC_ON_24_5G: SCC channel on 5 Ghz, SCC channel + * on 2.4 Ghz & 5 Ghz channels + * @PM_SCC_ON_24_SCC_ON_5_24G: SCC channel on 2.4 Ghz, SCC + * channel on 5 Ghz & 2.4 Ghz channels + * @PM_SCC_ON_24_SCC_ON_5_5G: SCC channel on 2.4 Ghz, SCC + * channel on 5 Ghz & 5 Ghz channels + * @PM_SCC_ON_5_SCC_ON_24: SCC channel on 5 Ghz, SCC channel on + * 2.4 Ghz + * @PM_SCC_ON_24_SCC_ON_5: SCC channel on 2.4 Ghz, SCC channel + * on 5 Ghz + * @PM_MCC_CH_24G: MCC channels & 2.4 Ghz channels + * @PM_MCC_CH_5G: MCC channels & 5 Ghz channels + * @PM_24G_MCC_CH: 2.4 Ghz channels & MCC channels + * @PM_5G_MCC_CH: 5 Ghz channels & MCC channels + * @PM_SBS_CH_5G: SBS channels & rest of 5 Ghz channels + * @PM_24G_SCC_CH_SBS_CH: 2.4 Ghz channels, SCC channel & SBS channels + * @PM_24G_SCC_CH_SBS_CH_5G: 2.4 Ghz channels, SCC channel, + * SBS channels & rest of the 5G channels + * @PM_24G_SBS_CH_MCC_CH: 2.4 Ghz channels, SBS channels & MCC channels + * @PM_MAX_PCL_TYPE: Max place holder + * + * These are generic IDs that identify the various roles + * in the software system + */ +enum policy_mgr_pcl_type { + PM_NONE = 0, + PM_24G, + PM_5G, + PM_SCC_CH, + PM_MCC_CH, + PM_SBS_CH, + PM_SCC_CH_24G, + PM_SCC_CH_5G, + PM_24G_SCC_CH, + PM_5G_SCC_CH, + PM_SCC_ON_5_SCC_ON_24_24G, + PM_SCC_ON_5_SCC_ON_24_5G, + PM_SCC_ON_24_SCC_ON_5_24G, + PM_SCC_ON_24_SCC_ON_5_5G, + PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_24_SCC_ON_5, + PM_MCC_CH_24G, + PM_MCC_CH_5G, + PM_24G_MCC_CH, + PM_5G_MCC_CH, + PM_SBS_CH_5G, + PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH_5G, + PM_24G_SBS_CH_MCC_CH, + + PM_MAX_PCL_TYPE +}; + +/** + * enum policy_mgr_one_connection_mode - Combination of first connection + * type, band & spatial stream used. + * + * @PM_STA_24_1x1: STA connection using 1x1@2.4 Ghz + * @PM_STA_24_2x2: STA connection using 2x2@2.4 Ghz + * @PM_STA_5_1x1: STA connection using 1x1@5 Ghz + * @PM_STA_5_2x2: STA connection using 2x2@5 Ghz + * @PM_P2P_CLI_24_1x1: P2P Client connection using 1x1@2.4 Ghz + * @PM_P2P_CLI_24_2x2: P2P Client connection using 2x2@2.4 Ghz + * @PM_P2P_CLI_5_1x1: P2P Client connection using 1x1@5 Ghz + * @PM_P2P_CLI_5_2x2: P2P Client connection using 2x2@5 Ghz + * @PM_P2P_GO_24_1x1: P2P GO connection using 1x1@2.4 Ghz + * @PM_P2P_GO_24_2x2: P2P GO connection using 2x2@2.4 Ghz + * @PM_P2P_GO_5_1x1: P2P GO connection using 1x1@5 Ghz + * @PM_P2P_GO_5_2x2: P2P GO connection using 2x2@5 Ghz + * @PM_SAP_24_1x1: SAP connection using 1x1@2.4 Ghz + * @PM_SAP_24_2x2: SAP connection using 2x2@2.4 Ghz + * @PM_SAP_5_1x1: SAP connection using 1x1@5 Ghz + * @PM_SAP_5_1x1: SAP connection using 2x2@5 Ghz + * @PM_IBSS_24_1x1: IBSS connection using 1x1@2.4 Ghz + * @PM_IBSS_24_2x2: IBSS connection using 2x2@2.4 Ghz + * @PM_IBSS_5_1x1: IBSS connection using 1x1@5 Ghz + * @PM_IBSS_5_2x2: IBSS connection using 2x2@5 Ghz + * @PM_MAX_ONE_CONNECTION_MODE: Max place holder + * + * These are generic IDs that identify the various roles + * in the software system + */ +enum policy_mgr_one_connection_mode { + PM_STA_24_1x1 = 0, + PM_STA_24_2x2, + PM_STA_5_1x1, + PM_STA_5_2x2, + PM_P2P_CLI_24_1x1, + PM_P2P_CLI_24_2x2, + PM_P2P_CLI_5_1x1, + PM_P2P_CLI_5_2x2, + PM_P2P_GO_24_1x1, + PM_P2P_GO_24_2x2, + PM_P2P_GO_5_1x1, + PM_P2P_GO_5_2x2, + PM_SAP_24_1x1, + PM_SAP_24_2x2, + PM_SAP_5_1x1, + PM_SAP_5_2x2, + PM_IBSS_24_1x1, + PM_IBSS_24_2x2, + PM_IBSS_5_1x1, + PM_IBSS_5_2x2, + + PM_MAX_ONE_CONNECTION_MODE +}; + +/** + * enum policy_mgr_two_connection_mode - Combination of first two + * connections type, concurrency state, band & spatial stream + * used. + * + * @PM_STA_SAP_SCC_24_1x1: STA & SAP connection on SCC using + * 1x1@2.4 Ghz + * @PM_STA_SAP_SCC_24_2x2: STA & SAP connection on SCC using + * 2x2@2.4 Ghz + * @PM_STA_SAP_MCC_24_1x1: STA & SAP connection on MCC using + * 1x1@2.4 Ghz + * @PM_STA_SAP_MCC_24_2x2: STA & SAP connection on MCC using + * 2x2@2.4 Ghz + * @PM_STA_SAP_SCC_5_1x1: STA & SAP connection on SCC using + * 1x1@5 Ghz + * @PM_STA_SAP_SCC_5_2x2: STA & SAP connection on SCC using + * 2x2@5 Ghz + * @PM_STA_SAP_MCC_5_1x1: STA & SAP connection on MCC using + * 1x1@5 Ghz + * @PM_STA_SAP_MCC_5_2x2: STA & SAP connection on MCC using + * 2x2@5 Ghz + * @PM_STA_SAP_DBS_1x1: STA & SAP connection on DBS using 1x1 + * @PM_STA_SAP_DBS_2x2: STA & SAP connection on DBS using 2x2 + * @PM_STA_SAP_SBS_5_1x1: STA & SAP connection on 5G SBS using 1x1 + * @PM_STA_P2P_GO_SCC_24_1x1: STA & P2P GO connection on SCC + * using 1x1@2.4 Ghz + * @PM_STA_P2P_GO_SCC_24_2x2: STA & P2P GO connection on SCC + * using 2x2@2.4 Ghz + * @PM_STA_P2P_GO_MCC_24_1x1: STA & P2P GO connection on MCC + * using 1x1@2.4 Ghz + * @PM_STA_P2P_GO_MCC_24_2x2: STA & P2P GO connection on MCC + * using 2x2@2.4 Ghz + * @PM_STA_P2P_GO_SCC_5_1x1: STA & P2P GO connection on SCC + * using 1x1@5 Ghz + * @PM_STA_P2P_GO_SCC_5_2x2: STA & P2P GO connection on SCC + * using 2x2@5 Ghz + * @PM_STA_P2P_GO_MCC_5_1x1: STA & P2P GO connection on MCC + * using 1x1@5 Ghz + * @PM_STA_P2P_GO_MCC_5_2x2: STA & P2P GO connection on MCC + * using 2x2@5 Ghz + * @PM_STA_P2P_GO_DBS_1x1: STA & P2P GO connection on DBS using + * 1x1 + * @PM_STA_P2P_GO_DBS_2x2: STA & P2P GO connection on DBS using + * 2x2 + * @PM_STA_P2P_GO_SBS_5_1x1: STA & P2P GO connection on 5G SBS + * using 1x1 + * @PM_STA_P2P_CLI_SCC_24_1x1: STA & P2P CLI connection on SCC + * using 1x1@2.4 Ghz + * @PM_STA_P2P_CLI_SCC_24_2x2: STA & P2P CLI connection on SCC + * using 2x2@2.4 Ghz + * @PM_STA_P2P_CLI_MCC_24_1x1: STA & P2P CLI connection on MCC + * using 1x1@2.4 Ghz + * @PM_STA_P2P_CLI_MCC_24_2x2: STA & P2P CLI connection on MCC + * using 2x2@2.4 Ghz + * @PM_STA_P2P_CLI_SCC_5_1x1: STA & P2P CLI connection on SCC + * using 1x1@5 Ghz + * @PM_STA_P2P_CLI_SCC_5_2x2: STA & P2P CLI connection on SCC + * using 2x2@5 Ghz + * @PM_STA_P2P_CLI_MCC_5_1x1: STA & P2P CLI connection on MCC + * using 1x1@5 Ghz + * @PM_STA_P2P_CLI_MCC_5_2x2: STA & P2P CLI connection on MCC + * using 2x2@5 Ghz + * @PM_STA_P2P_CLI_DBS_1x1: STA & P2P CLI connection on DBS + * using 1x1 + * @PM_STA_P2P_CLI_DBS_2x2: STA & P2P CLI connection on DBS + * using 2x2 + * @PM_STA_P2P_CLI_SBS_5_1x1: STA & P2P CLI connection on 5G + * SBS using 1x1 + * @PM_P2P_GO_P2P_CLI_SCC_24_1x1: P2P GO & CLI connection on + * SCC using 1x1@2.4 Ghz + * @PM_P2P_GO_P2P_CLI_SCC_24_2x2: P2P GO & CLI connection on + * SCC using 2x2@2.4 Ghz + * @PM_P2P_GO_P2P_CLI_MCC_24_1x1: P2P GO & CLI connection on + * MCC using 1x1@2.4 Ghz + * @PM_P2P_GO_P2P_CLI_MCC_24_2x2: P2P GO & CLI connection on + * MCC using 2x2@2.4 Ghz + * @PM_P2P_GO_P2P_CLI_SCC_5_1x1: P2P GO & CLI connection on + * SCC using 1x1@5 Ghz + * @PM_P2P_GO_P2P_CLI_SCC_5_2x2: P2P GO & CLI connection on + * SCC using 2x2@5 Ghz + * @PM_P2P_GO_P2P_CLI_MCC_5_1x1: P2P GO & CLI connection on + * MCC using 1x1@5 Ghz + * @PM_P2P_GO_P2P_CLI_MCC_5_2x2: P2P GO & CLI connection on + * MCC using 2x2@5 Ghz + * @PM_P2P_GO_P2P_CLI_DBS_1x1: P2P GO & CLI connection on DBS + * using 1x1 + * @PM_P2P_GO_P2P_CLI_DBS_2x2: P2P GO & P2P CLI connection + * on DBS using 2x2 + * @PM_P2P_GO_P2P_CLI_SBS_5_1x1: P2P GO & P2P CLI connection + * on 5G SBS using 1x1 + * @PM_P2P_GO_SAP_SCC_24_1x1: P2P GO & SAP connection on + * SCC using 1x1@2.4 Ghz + * @PM_P2P_GO_SAP_SCC_24_2x2: P2P GO & SAP connection on + * SCC using 2x2@2.4 Ghz + * @PM_P2P_GO_SAP_MCC_24_1x1: P2P GO & SAP connection on + * MCC using 1x1@2.4 Ghz + * @PM_P2P_GO_SAP_MCC_24_2x2: P2P GO & SAP connection on + * MCC using 2x2@2.4 Ghz + * @PM_P2P_GO_SAP_SCC_5_1x1: P2P GO & SAP connection on + * SCC using 1x1@5 Ghz + * @PM_P2P_GO_SAP_SCC_5_2x2: P2P GO & SAP connection on + * SCC using 2x2@5 Ghz + * @PM_P2P_GO_SAP_MCC_5_1x1: P2P GO & SAP connection on + * MCC using 1x1@5 Ghz + * @PM_P2P_GO_SAP_MCC_5_2x2: P2P GO & SAP connection on + * MCC using 2x2@5 Ghz + * @PM_P2P_GO_SAP_DBS_1x1: P2P GO & SAP connection on DBS using + * 1x1 + * @PM_P2P_GO_SAP_DBS_2x2: P2P GO & SAP connection on DBS using + * 2x2 + * @PM_P2P_GO_SAP_SBS_5_1x1: P2P GO & SAP connection on 5G SBS + * using 1x1 + * @PM_P2P_CLI_SAP_SCC_24_1x1: CLI & SAP connection on SCC using + * 1x1@2.4 Ghz + * @PM_P2P_CLI_SAP_SCC_24_2x2: CLI & SAP connection on SCC using + * 2x2@2.4 Ghz + * @PM_P2P_CLI_SAP_MCC_24_1x1: CLI & SAP connection on MCC using + * 1x1@2.4 Ghz + * @PM_P2P_CLI_SAP_MCC_24_2x2: CLI & SAP connection on MCC using + * 2x2@2.4 Ghz + * @PM_P2P_CLI_SAP_SCC_5_1x1: CLI & SAP connection on SCC using + * 1x1@5 Ghz + * @PM_P2P_CLI_SAP_SCC_5_2x2: CLI & SAP connection on SCC using + * 2x2@5 Ghz + * @PM_P2P_CLI_SAP_MCC_5_1x1: CLI & SAP connection on MCC using + * 1x1@5 Ghz + * @PM_P2P_CLI_SAP_MCC_5_2x2: CLI & SAP connection on MCC using + * 2x2@5 Ghz + * @POLICY_MGR_P2P_STA_SAP_MCC_24_5_1x1: CLI and SAP connecting on MCC + * in 2.4 and 5GHz 1x1 + * @POLICY_MGR_P2P_STA_SAP_MCC_24_5_2x2: CLI and SAP connecting on MCC + * in 2.4 and 5GHz 2x2 + * @PM_P2P_CLI_SAP_DBS_1x1,: CLI & SAP connection on DBS using 1x1 + * @PM_P2P_CLI_SAP_DBS_2x2: P2P CLI & SAP connection on DBS using + * 2x2 + * @PM_P2P_CLI_SAP_SBS_5_1x1: P2P CLI & SAP connection on 5G SBS + * using 1x1 + * @PM_SAP_SAP_SCC_24_1x1: SAP & SAP connection on + * SCC using 1x1@2.4 Ghz + * @PM_SAP_SAP_SCC_24_2x2: SAP & SAP connection on + * SCC using 2x2@2.4 Ghz + * @PM_SAP_SAP_MCC_24_1x1: SAP & SAP connection on + * MCC using 1x1@2.4 Ghz + * @PM_SAP_SAP_MCC_24_2x2: SAP & SAP connection on + * MCC using 2x2@2.4 Ghz + * @PM_SAP_SAP_SCC_5_1x1: SAP & SAP connection on + * SCC using 1x1@5 Ghz + * @PM_SAP_SAP_SCC_5_2x2: SAP & SAP connection on + * SCC using 2x2@5 Ghz + * @PM_SAP_SAP_MCC_5_1x1: SAP & SAP connection on + * MCC using 1x1@5 Ghz + * @PM_SAP_SAP_MCC_5_2x2: SAP & SAP connection on + * MCC using 2x2@5 Ghz + * @PM_SAP_SAP_MCC_24_5_1x1: SAP & SAP connection on + * MCC in 2.4 and 5GHz 1x1 + * @PM_SAP_SAP_MCC_24_5_2x2: SAP & SAP connection on + * MCC in 2.4 and 5GHz 2x2 + * @PM_SAP_SAP_DBS_1x1: SAP & SAP connection on DBS using + * 1x1 + * @PM_SAP_SAP_DBS_2x2: SAP & SAP connection on DBS using 2x2 + * @PM_SAP_SAP_SBS_5_1x1: SAP & SAP connection on 5G SBS using 1x1 + * @PM_STA_STA_SCC_24_1x1: STA & STA connection on + * SCC using 1x1@2.4 Ghz + * @PM_STA_STA_SCC_24_2x2: STA & STA connection on + * SCC using 2x2@2.4 Ghz + * @PM_STA_STA_MCC_24_1x1: STA & STA connection on + * MCC using 1x1@2.4 Ghz + * @PM_STA_STA_MCC_24_2x2: STA & STA connection on + * MCC using 2x2@2.4 Ghz + * @PM_STA_STA_SCC_5_1x1: STA & STA connection on + * SCC using 1x1@5 Ghz + * @PM_STA_STA_SCC_5_2x2: STA & STA connection on + * SCC using 2x2@5 Ghz + * @PM_STA_STA_MCC_5_1x1: STA & STA connection on + * MCC using 1x1@5 Ghz + * @PM_STA_STA_MCC_5_2x2: STA & STA connection on + * MCC using 2x2@5 Ghz + * @PM_STA_STA_MCC_24_5_1x1: STA & STA connection on + * MCC in 2.4 and 5GHz 1x1 + * @PM_STA_STA_MCC_24_5_2x2: STA & STA connection on + * MCC in 2.4 and 5GHz 2x2 + * @PM_STA_STA_DBS_1x1: STA & STA connection on DBS using + * 1x1 + * @PM_STA_STA_DBS_2x2: STA & STA connection on DBS using 2x2 + * @PM_STA_STA_SBS_5_1x1: STA & STA connection on 5G SBS using 1x1 + * + * These are generic IDs that identify the various roles in the + * software system + */ +enum policy_mgr_two_connection_mode { + PM_STA_SAP_SCC_24_1x1 = 0, + PM_STA_SAP_SCC_24_2x2, + PM_STA_SAP_MCC_24_1x1, + PM_STA_SAP_MCC_24_2x2, + PM_STA_SAP_SCC_5_1x1, + PM_STA_SAP_SCC_5_2x2, + PM_STA_SAP_MCC_5_1x1, + PM_STA_SAP_MCC_5_2x2, + PM_STA_SAP_MCC_24_5_1x1, + PM_STA_SAP_MCC_24_5_2x2, + PM_STA_SAP_DBS_1x1, + PM_STA_SAP_DBS_2x2, + PM_STA_SAP_SBS_5_1x1, + PM_STA_P2P_GO_SCC_24_1x1, + PM_STA_P2P_GO_SCC_24_2x2, + PM_STA_P2P_GO_MCC_24_1x1, + PM_STA_P2P_GO_MCC_24_2x2, + PM_STA_P2P_GO_SCC_5_1x1, + PM_STA_P2P_GO_SCC_5_2x2, + PM_STA_P2P_GO_MCC_5_1x1, + PM_STA_P2P_GO_MCC_5_2x2, + PM_STA_P2P_GO_MCC_24_5_1x1, + PM_STA_P2P_GO_MCC_24_5_2x2, + PM_STA_P2P_GO_DBS_1x1, + PM_STA_P2P_GO_DBS_2x2, + PM_STA_P2P_GO_SBS_5_1x1, + PM_STA_P2P_CLI_SCC_24_1x1, + PM_STA_P2P_CLI_SCC_24_2x2, + PM_STA_P2P_CLI_MCC_24_1x1, + PM_STA_P2P_CLI_MCC_24_2x2, + PM_STA_P2P_CLI_SCC_5_1x1, + PM_STA_P2P_CLI_SCC_5_2x2, + PM_STA_P2P_CLI_MCC_5_1x1, + PM_STA_P2P_CLI_MCC_5_2x2, + PM_STA_P2P_CLI_MCC_24_5_1x1, + PM_STA_P2P_CLI_MCC_24_5_2x2, + PM_STA_P2P_CLI_DBS_1x1, + PM_STA_P2P_CLI_DBS_2x2, + PM_STA_P2P_CLI_SBS_5_1x1, + PM_P2P_GO_P2P_CLI_SCC_24_1x1, + PM_P2P_GO_P2P_CLI_SCC_24_2x2, + PM_P2P_GO_P2P_CLI_MCC_24_1x1, + PM_P2P_GO_P2P_CLI_MCC_24_2x2, + PM_P2P_GO_P2P_CLI_SCC_5_1x1, + PM_P2P_GO_P2P_CLI_SCC_5_2x2, + PM_P2P_GO_P2P_CLI_MCC_5_1x1, + PM_P2P_GO_P2P_CLI_MCC_5_2x2, + PM_P2P_GO_P2P_CLI_MCC_24_5_1x1, + PM_P2P_GO_P2P_CLI_MCC_24_5_2x2, + PM_P2P_GO_P2P_CLI_DBS_1x1, + PM_P2P_GO_P2P_CLI_DBS_2x2, + PM_P2P_GO_P2P_CLI_SBS_5_1x1, + PM_P2P_GO_SAP_SCC_24_1x1, + PM_P2P_GO_SAP_SCC_24_2x2, + PM_P2P_GO_SAP_MCC_24_1x1, + PM_P2P_GO_SAP_MCC_24_2x2, + PM_P2P_GO_SAP_SCC_5_1x1, + PM_P2P_GO_SAP_SCC_5_2x2, + PM_P2P_GO_SAP_MCC_5_1x1, + PM_P2P_GO_SAP_MCC_5_2x2, + PM_P2P_GO_SAP_MCC_24_5_1x1, + PM_P2P_GO_SAP_MCC_24_5_2x2, + PM_P2P_GO_SAP_DBS_1x1, + PM_P2P_GO_SAP_DBS_2x2, + PM_P2P_GO_SAP_SBS_5_1x1, + PM_P2P_CLI_SAP_SCC_24_1x1, + PM_P2P_CLI_SAP_SCC_24_2x2, + PM_P2P_CLI_SAP_MCC_24_1x1, + PM_P2P_CLI_SAP_MCC_24_2x2, + PM_P2P_CLI_SAP_SCC_5_1x1, + PM_P2P_CLI_SAP_SCC_5_2x2, + PM_P2P_CLI_SAP_MCC_5_1x1, + PM_P2P_CLI_SAP_MCC_5_2x2, + PM_P2P_CLI_SAP_MCC_24_5_1x1, + PM_P2P_CLI_SAP_MCC_24_5_2x2, + PM_P2P_CLI_SAP_DBS_1x1, + PM_P2P_CLI_SAP_DBS_2x2, + PM_P2P_CLI_SAP_SBS_5_1x1, + PM_SAP_SAP_SCC_24_1x1, + PM_SAP_SAP_SCC_24_2x2, + PM_SAP_SAP_MCC_24_1x1, + PM_SAP_SAP_MCC_24_2x2, + PM_SAP_SAP_SCC_5_1x1, + PM_SAP_SAP_SCC_5_2x2, + PM_SAP_SAP_MCC_5_1x1, + PM_SAP_SAP_MCC_5_2x2, + PM_SAP_SAP_MCC_24_5_1x1, + PM_SAP_SAP_MCC_24_5_2x2, + PM_SAP_SAP_DBS_1x1, + PM_SAP_SAP_DBS_2x2, + PM_SAP_SAP_SBS_5_1x1, + PM_STA_STA_SCC_24_1x1, + PM_STA_STA_SCC_24_2x2, + PM_STA_STA_MCC_24_1x1, + PM_STA_STA_MCC_24_2x2, + PM_STA_STA_SCC_5_1x1, + PM_STA_STA_SCC_5_2x2, + PM_STA_STA_MCC_5_1x1, + PM_STA_STA_MCC_5_2x2, + PM_STA_STA_MCC_24_5_1x1, + PM_STA_STA_MCC_24_5_2x2, + PM_STA_STA_DBS_1x1, + PM_STA_STA_DBS_2x2, + PM_STA_STA_SBS_5_1x1, + + PM_MAX_TWO_CONNECTION_MODE +}; + +/** + * enum policy_mgr_conc_next_action - actions to be taken on old + * connections. + * + * @PM_NOP: No action + * @PM_DBS: switch to DBS mode + * @PM_DBS_DOWNGRADE: switch to DBS mode & downgrade to 1x1 + * @PM_DBS_UPGRADE: switch to DBS mode & upgrade to 2x2 + * @PM_SINGLE_MAC: switch to MCC/SCC mode + * @PM_SINGLE_MAC_UPGRADE: switch to MCC/SCC mode & upgrade to 2x2 + * @PM_SBS: switch to SBS mode + * @PM_SBS_DOWNGRADE: switch to SBS mode & downgrade to 1x1 + * @PM_MAX_CONC_PRIORITY_MODE: Max place holder + * + * These are generic IDs that identify the various roles + * in the software system + */ +enum policy_mgr_conc_next_action { + PM_NOP = 0, + PM_DBS, + PM_DBS_DOWNGRADE, + PM_DBS_UPGRADE, + PM_SINGLE_MAC, + PM_SINGLE_MAC_UPGRADE, + PM_SBS, + PM_SBS_DOWNGRADE, + + PM_MAX_CONC_NEXT_ACTION +}; + +/** + * enum policy_mgr_band - wifi band. + * + * @POLICY_MGR_BAND_24: 2.4 Ghz band + * @POLICY_MGR_BAND_5: 5 Ghz band + * @POLICY_MGR_MAX_BAND: Max place holder + * + * These are generic IDs that identify the various roles + * in the software system + */ +enum policy_mgr_band { + POLICY_MGR_BAND_24 = 0, + POLICY_MGR_BAND_5, + POLICY_MGR_MAX_BAND +}; + +/** + * enum policy_mgr_conn_update_reason: Reason for conc connection update + * @POLICY_MGR_UPDATE_REASON_SET_OPER_CHAN: Set probable operating channel + * @POLICY_MGR_UPDATE_REASON_JOIN_IBSS: Join IBSS + * @POLICY_MGR_UPDATE_REASON_UT: Unit test related + * @POLICY_MGR_UPDATE_REASON_START_AP: Start AP + * @POLICY_MGR_UPDATE_REASON_NORMAL_STA: Connection to Normal STA + * @POLICY_MGR_UPDATE_REASON_HIDDEN_STA: Connection to Hidden STA + * @POLICY_MGR_UPDATE_REASON_OPPORTUNISTIC: Opportunistic HW mode update + * @POLICY_MGR_UPDATE_REASON_NSS_UPDATE: NSS update + * @POLICY_MGR_UPDATE_REASON_CHANNEL_SWITCH: Channel switch + * @POLICY_MGR_UPDATE_REASON_CHANNEL_SWITCH_STA: Channel switch for STA + */ +enum policy_mgr_conn_update_reason { + POLICY_MGR_UPDATE_REASON_SET_OPER_CHAN, + POLICY_MGR_UPDATE_REASON_JOIN_IBSS, + POLICY_MGR_UPDATE_REASON_UT, + POLICY_MGR_UPDATE_REASON_START_AP, + POLICY_MGR_UPDATE_REASON_NORMAL_STA, + POLICY_MGR_UPDATE_REASON_HIDDEN_STA, + POLICY_MGR_UPDATE_REASON_OPPORTUNISTIC, + POLICY_MGR_UPDATE_REASON_NSS_UPDATE, + POLICY_MGR_UPDATE_REASON_CHANNEL_SWITCH, + POLICY_MGR_UPDATE_REASON_CHANNEL_SWITCH_STA, + POLICY_MGR_UPDATE_REASON_PRE_CAC, +}; + +/** + * enum hw_mode_bandwidth - bandwidth of wifi channel. + * + * @HW_MODE_5_MHZ: 5 Mhz bandwidth + * @HW_MODE_10_MHZ: 10 Mhz bandwidth + * @HW_MODE_20_MHZ: 20 Mhz bandwidth + * @HW_MODE_40_MHZ: 40 Mhz bandwidth + * @HW_MODE_80_MHZ: 80 Mhz bandwidth + * @HW_MODE_80_PLUS_80_MHZ: 80 Mhz plus 80 Mhz bandwidth + * @HW_MODE_160_MHZ: 160 Mhz bandwidth + * @HW_MODE_MAX_BANDWIDTH: Max place holder + * + * These are generic IDs that identify the various roles + * in the software system + */ +enum hw_mode_bandwidth { + HW_MODE_BW_NONE, + HW_MODE_5_MHZ, + HW_MODE_10_MHZ, + HW_MODE_20_MHZ, + HW_MODE_40_MHZ, + HW_MODE_80_MHZ, + HW_MODE_80_PLUS_80_MHZ, + HW_MODE_160_MHZ, + HW_MODE_MAX_BANDWIDTH +}; + +/** + * enum set_hw_mode_status - Status of set HW mode command + * @SET_HW_MODE_STATUS_OK: command successful + * @SET_HW_MODE_STATUS_EINVAL: Requested invalid hw_mode + * @SET_HW_MODE_STATUS_ECANCELED: HW mode change cancelled + * @SET_HW_MODE_STATUS_ENOTSUP: HW mode not supported + * @SET_HW_MODE_STATUS_EHARDWARE: HW mode change prevented by hardware + * @SET_HW_MODE_STATUS_EPENDING: HW mode change is pending + * @SET_HW_MODE_STATUS_ECOEX: HW mode change conflict with Coex + */ +enum set_hw_mode_status { + SET_HW_MODE_STATUS_OK, + SET_HW_MODE_STATUS_EINVAL, + SET_HW_MODE_STATUS_ECANCELED, + SET_HW_MODE_STATUS_ENOTSUP, + SET_HW_MODE_STATUS_EHARDWARE, + SET_HW_MODE_STATUS_EPENDING, + SET_HW_MODE_STATUS_ECOEX, +}; + +/** + * struct policy_mgr_conc_connection_info - information of all existing + * connections in the wlan system + * + * @mode: connection type + * @chan: channel of the connection + * @bw: channel bandwidth used for the connection + * @mac: The HW mac it is running + * @chain_mask: The original capability advertised by HW + * @original_nss: nss negotiated at connection time + * @vdev_id: vdev id of the connection + * @in_use: if the table entry is active + */ +struct policy_mgr_conc_connection_info { + enum policy_mgr_con_mode mode; + uint8_t chan; + enum hw_mode_bandwidth bw; + uint8_t mac; + enum policy_mgr_chain_mode chain_mask; + uint32_t original_nss; + uint32_t vdev_id; + bool in_use; +}; + +/** + * struct policy_mgr_hw_mode_params - HW mode params + * @mac0_tx_ss: MAC0 Tx spatial stream + * @mac0_rx_ss: MAC0 Rx spatial stream + * @mac1_tx_ss: MAC1 Tx spatial stream + * @mac1_rx_ss: MAC1 Rx spatial stream + * @mac0_bw: MAC0 bandwidth + * @mac1_bw: MAC1 bandwidth + * @dbs_cap: DBS capabality + * @agile_dfs_cap: Agile DFS capabality + */ +struct policy_mgr_hw_mode_params { + uint8_t mac0_tx_ss; + uint8_t mac0_rx_ss; + uint8_t mac1_tx_ss; + uint8_t mac1_rx_ss; + uint8_t mac0_bw; + uint8_t mac1_bw; + uint8_t dbs_cap; + uint8_t agile_dfs_cap; + uint8_t sbs_cap; +}; + +/** + * struct policy_mgr_vdev_mac_map - vdev id-mac id map + * @vdev_id: VDEV id + * @mac_id: MAC id + */ +struct policy_mgr_vdev_mac_map { + uint32_t vdev_id; + uint32_t mac_id; +}; + +/** + * struct policy_mgr_dual_mac_config - Dual MAC configuration + * @scan_config: Scan configuration + * @fw_mode_config: FW mode configuration + * @set_dual_mac_cb: Callback function to be executed on response to the command + */ +struct policy_mgr_dual_mac_config { + uint32_t scan_config; + uint32_t fw_mode_config; + void *set_dual_mac_cb; +}; + +/** + * struct policy_mgr_hw_mode - Format of set HW mode + * @hw_mode_index: Index of HW mode to be set + * @set_hw_mode_cb: HDD set HW mode callback + * @reason: Reason for HW mode change + * @session_id: Session id + */ +struct policy_mgr_hw_mode { + uint32_t hw_mode_index; + void *set_hw_mode_cb; + enum policy_mgr_conn_update_reason reason; + uint32_t session_id; +}; + +/** + * struct policy_mgr_pcl_list - Format of PCL + * @pcl_list: List of preferred channels + * @weight_list: Weights of the PCL + * @pcl_len: Number of channels in the PCL + */ +struct policy_mgr_pcl_list { + uint8_t pcl_list[POLICY_MGR_MAX_CHANNEL_LIST]; + uint8_t weight_list[POLICY_MGR_MAX_CHANNEL_LIST]; + uint32_t pcl_len; +}; + +/** + * struct policy_mgr_pcl_chan_weights - Params to get the valid weighed list + * @pcl_list: Preferred channel list already sorted in the order of preference + * @pcl_len: Length of the PCL + * @saved_chan_list: Valid channel list updated as part of + * WMA_UPDATE_CHAN_LIST_REQ + * @saved_num_chan: Length of the valid channel list + * @weighed_valid_list: Weights of the valid channel list. This will have one + * to one mapping with valid_chan_list. FW expects channel order and size to be + * as per the list provided in WMI_SCAN_CHAN_LIST_CMDID. + * @weight_list: Weights assigned by policy manager + */ +struct policy_mgr_pcl_chan_weights { + uint8_t pcl_list[POLICY_MGR_MAX_CHANNEL_LIST]; + uint32_t pcl_len; + uint8_t saved_chan_list[POLICY_MGR_MAX_CHANNEL_LIST]; + uint32_t saved_num_chan; + uint8_t weighed_valid_list[POLICY_MGR_MAX_CHANNEL_LIST]; + uint8_t weight_list[POLICY_MGR_MAX_CHANNEL_LIST]; +}; + +/** + * struct policy_mgr_vdev_entry_info - vdev related param to be + * used by policy manager + * @type: type + * @sub_type: sub type + * @mhz: channel frequency in MHz + * @chan_width: channel bandwidth + * @mac_id: the mac on which vdev is on + */ +struct policy_mgr_vdev_entry_info { + uint32_t type; + uint32_t sub_type; + uint32_t mhz; + uint32_t chan_width; + uint32_t mac_id; +}; + +/** + * struct dbs_hw_mode_info - WLAN_DBS_HW_MODES_TLV Format + * @tlv_header: TLV header, TLV tag and len; tag equals WMITLV_TAG_ARRAY_UINT32 + * @hw_mode_list: WLAN_DBS_HW_MODE_LIST entries + */ +struct dbs_hw_mode_info { + uint32_t tlv_header; + uint32_t *hw_mode_list; +}; + +/** + * struct extended_caps - new extended caps given by firmware + * @num_hw_modes: number of hardware modes for current SOC + * @each_hw_mode_cap: hw mode id to phy id mapping + * @each_phy_cap_per_hwmode: PHY's caps for each hw mode + * @num_phy_for_hal_reg_cap: number of phy for hal reg cap + * @hw_mode_to_mac_cap_map: map between hw_mode to capabilities + */ +struct extended_caps { + WMI_SOC_MAC_PHY_HW_MODE_CAPS num_hw_modes; + WMI_HW_MODE_CAPABILITIES *each_hw_mode_cap; + WMI_MAC_PHY_CAPABILITIES *each_phy_cap_per_hwmode; + WMI_SOC_HAL_REG_CAPABILITIES num_phy_for_hal_reg_cap; + WMI_HAL_REG_CAPABILITIES_EXT *each_phy_hal_reg_cap; + struct hw_mode_idx_to_mac_cap_idx *hw_mode_to_mac_cap_map; +}; + +/** + * struct dual_mac_config - Dual MAC configurations + * @prev_scan_config: Previous scan configuration + * @prev_fw_mode_config: Previous FW mode configuration + * @cur_scan_config: Current scan configuration + * @cur_fw_mode_config: Current FW mode configuration + * @req_scan_config: Requested scan configuration + * @req_fw_mode_config: Requested FW mode configuration + */ +struct dual_mac_config { + uint32_t prev_scan_config; + uint32_t prev_fw_mode_config; + uint32_t cur_scan_config; + uint32_t cur_fw_mode_config; + uint32_t req_scan_config; + uint32_t req_fw_mode_config; +}; + +#endif /* __WLAN_POLICY_MGR_PUBLIC_STRUCT_H */ diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c new file mode 100644 index 000000000000..3673a01b101c --- /dev/null +++ b/src/wlan_policy_mgr_action.c @@ -0,0 +1,224 @@ +/* + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + +/** + * DOC: wlan_policy_mgr_action.c + * + * WLAN Concurrenct Connection Management APIs + * + */ + +/* Include files */ + +#include "wlan_policy_mgr_api.h" +#include "wlan_policy_mgr_tables_no_dbs_i.h" +#include "wlan_policy_mgr_i.h" +#include "qdf_types.h" +#include "qdf_trace.h" +#include "wlan_objmgr_global_obj.h" + +enum policy_mgr_conc_next_action (*policy_mgr_get_current_pref_hw_mode_ptr) + (struct wlan_objmgr_psoc *psoc); + +void policy_mgr_hw_mode_transition_cb(uint32_t old_hw_mode_index, + uint32_t new_hw_mode_index, + uint32_t num_vdev_mac_entries, + struct policy_mgr_vdev_mac_map *vdev_mac_map, + struct wlan_objmgr_psoc *context) +{ +} + +QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc, + uint32_t session_id, + enum hw_mode_ss_config mac0_ss, + enum hw_mode_bandwidth mac0_bw, + enum hw_mode_ss_config mac1_ss, + enum hw_mode_bandwidth mac1_bw, + enum hw_mode_dbs_capab dbs, + enum hw_mode_agile_dfs_capab dfs, + enum hw_mode_sbs_capab sbs, + enum policy_mgr_conn_update_reason reason) +{ + return QDF_STATUS_SUCCESS; +} + +enum policy_mgr_conc_next_action policy_mgr_need_opportunistic_upgrade( + struct wlan_objmgr_psoc *psoc) +{ + return PM_NOP; +} + +QDF_STATUS policy_mgr_update_connection_info(struct wlan_objmgr_psoc *psoc, + uint32_t vdev_id) +{ + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_update_and_wait_for_connection_update( + struct wlan_objmgr_psoc *psoc, + uint8_t session_id, + uint8_t channel, + enum policy_mgr_conn_update_reason reason) +{ + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc, + uint32_t session_id, + uint8_t channel, + enum policy_mgr_conn_update_reason reason) +{ + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, + uint32_t session_id, + enum policy_mgr_conc_next_action action, + enum policy_mgr_conn_update_reason reason) +{ + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_handle_conc_multiport(struct wlan_objmgr_psoc *psoc, + uint8_t session_id, uint8_t channel) +{ + return QDF_STATUS_SUCCESS; +} + +#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH +void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) +{ + return; +} + +void policy_mgr_check_concurrent_intf_and_restart_sap( + struct wlan_objmgr_psoc *psoc) +{ + return; +} +#endif /* FEATURE_WLAN_MCC_TO_SCC_SWITCH */ + +#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH +void policy_mgr_change_sap_channel_with_csa(struct wlan_objmgr_psoc *psoc) +{ + return; +} +#endif + +QDF_STATUS policy_mgr_wait_for_connection_update(struct wlan_objmgr_psoc *psoc) +{ + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_reset_connection_update(struct wlan_objmgr_psoc *psoc) +{ + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_set_connection_update(struct wlan_objmgr_psoc *psoc) +{ + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_restart_opportunistic_timer( + struct wlan_objmgr_psoc *psoc, bool check_state) +{ + return QDF_STATUS_SUCCESS; +} + +#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH +QDF_STATUS policy_mgr_register_sap_restart_channel_switch_cb( + struct wlan_objmgr_psoc *psoc, + void (*sap_restart_chan_switch_cb)(void *, uint32_t, uint32_t)) +{ + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_deregister_sap_restart_channel_switch_cb( + struct wlan_objmgr_psoc *psoc) +{ + return QDF_STATUS_SUCCESS; +} + +#endif + +QDF_STATUS policy_mgr_set_hw_mode_on_channel_switch( + struct wlan_objmgr_psoc *psoc, uint8_t session_id) +{ + return QDF_STATUS_SUCCESS; +} + +void policy_mgr_checkn_update_hw_mode_single_mac_mode( + struct wlan_objmgr_psoc *psoc, uint8_t channel) +{ +} + +#ifdef MPC_UT_FRAMEWORK +QDF_STATUS policy_mgr_update_connection_info_utfw( + struct wlan_objmgr_psoc *psoc, + uint32_t vdev_id, uint32_t tx_streams, uint32_t rx_streams, + uint32_t chain_mask, uint32_t type, uint32_t sub_type, + uint32_t channelid, uint32_t mac_id) +{ + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_incr_connection_count_utfw(struct wlan_objmgr_psoc *psoc, + uint32_t vdev_id, uint32_t tx_streams, uint32_t rx_streams, + uint32_t chain_mask, uint32_t type, uint32_t sub_type, + uint32_t channelid, uint32_t mac_id) +{ + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_decr_connection_count_utfw(struct wlan_objmgr_psoc *psoc, + uint32_t del_all, uint32_t vdev_id) +{ + return QDF_STATUS_SUCCESS; +} + +enum policy_mgr_pcl_type policy_mgr_get_pcl_from_first_conn_table( + enum policy_mgr_con_mode type, + enum policy_mgr_conc_priority_mode sys_pref) +{ + return PM_NONE; +} + +enum policy_mgr_pcl_type policy_mgr_get_pcl_from_second_conn_table( + enum policy_mgr_one_connection_mode idx, enum policy_mgr_con_mode type, + enum policy_mgr_conc_priority_mode sys_pref, uint8_t dbs_capable) +{ + return PM_NONE; +} + +enum policy_mgr_pcl_type policy_mgr_get_pcl_from_third_conn_table( + enum policy_mgr_two_connection_mode idx, enum policy_mgr_con_mode type, + enum policy_mgr_conc_priority_mode sys_pref, uint8_t dbs_capable) +{ + return PM_NONE; +} +#endif diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c new file mode 100644 index 000000000000..379a04bd2349 --- /dev/null +++ b/src/wlan_policy_mgr_core.c @@ -0,0 +1,638 @@ +/* + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + +/** + * DOC: wlan_policy_mgr_core.c + * + * WLAN Concurrenct Connection Management functions + * + */ + +/* Include files */ + +#include "wlan_policy_mgr_i.h" +#include "qdf_types.h" +#include "qdf_trace.h" +#include "wlan_objmgr_global_obj.h" + +#define POLICY_MGR_MAX_CON_STRING_LEN 100 + +struct policy_mgr_conc_connection_info + pm_conc_connection_list[MAX_NUMBER_OF_CONC_CONNECTIONS]; + +struct policy_mgr_psoc_priv_obj *policy_mgr_get_context( + struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + pm_ctx = (struct policy_mgr_psoc_priv_obj *) + wlan_objmgr_psoc_get_comp_private_obj(psoc, + WLAN_UMAC_COMP_POLICY_MGR); + return pm_ctx; +} + +/** + * policy_mgr_get_updated_scan_config() - Get the updated scan configuration + * @scan_config: Pointer containing the updated scan config + * @dbs_scan: 0 or 1 indicating if DBS scan needs to be enabled/disabled + * @dbs_plus_agile_scan: 0 or 1 indicating if DBS plus agile scan needs to be + * enabled/disabled + * @single_mac_scan_with_dfs: 0 or 1 indicating if single MAC scan with DFS + * needs to be enabled/disabled + * + * Takes the current scan configuration and set the necessary scan config + * bits to either 0/1 and provides the updated value to the caller who + * can use this to pass it on to the FW + * + * Return: 0 on success + */ +QDF_STATUS policy_mgr_get_updated_scan_config( + struct wlan_objmgr_psoc *psoc, + uint32_t *scan_config, + bool dbs_scan, + bool dbs_plus_agile_scan, + bool single_mac_scan_with_dfs) +{ + return QDF_STATUS_SUCCESS; +} + +/** + * policy_mgr_get_updated_fw_mode_config() - Get the updated fw mode configuration + * @fw_mode_config: Pointer containing the updated fw mode config + * @dbs: 0 or 1 indicating if DBS needs to be enabled/disabled + * @agile_dfs: 0 or 1 indicating if agile DFS needs to be enabled/disabled + * + * Takes the current fw mode configuration and set the necessary fw mode config + * bits to either 0/1 and provides the updated value to the caller who + * can use this to pass it on to the FW + * + * Return: 0 on success + */ +QDF_STATUS policy_mgr_get_updated_fw_mode_config( + struct wlan_objmgr_psoc *psoc, + uint32_t *fw_mode_config, + bool dbs, + bool agile_dfs) +{ + return QDF_STATUS_SUCCESS; +} + +/** + * policy_mgr_is_dual_mac_disabled_in_ini() - Check if dual mac is disabled in INI + * + * Checks if the dual mac feature is disabled in INI + * + * Return: true if the dual mac feature is disabled from INI + */ +bool policy_mgr_is_dual_mac_disabled_in_ini( + struct wlan_objmgr_psoc *psoc) +{ + return false; +} + +/** + * policy_mgr_get_dbs_config() - Get DBS bit + * + * Gets the DBS bit of fw_mode_config_bits + * + * Return: 0 or 1 to indicate the DBS bit + */ +bool policy_mgr_get_dbs_config(struct wlan_objmgr_psoc *psoc) +{ + return false; +} + +/** + * policy_mgr_get_agile_dfs_config() - Get Agile DFS bit + * + * Gets the Agile DFS bit of fw_mode_config_bits + * + * Return: 0 or 1 to indicate the Agile DFS bit + */ +bool policy_mgr_get_agile_dfs_config(struct wlan_objmgr_psoc *psoc) +{ + return false; +} + +/** + * policy_mgr_get_dbs_scan_config() - Get DBS scan bit + * + * Gets the DBS scan bit of concurrent_scan_config_bits + * + * Return: 0 or 1 to indicate the DBS scan bit + */ +bool policy_mgr_get_dbs_scan_config(struct wlan_objmgr_psoc *psoc) +{ + return false; +} + +/** + * policy_mgr_get_tx_rx_ss_from_config() - Get Tx/Rx spatial stream from HW mode config + * @mac_ss: Config which indicates the HW mode as per 'hw_mode_ss_config' + * @tx_ss: Contains the Tx spatial stream + * @rx_ss: Contains the Rx spatial stream + * + * Returns the number of spatial streams of Tx and Rx + * + * Return: None + */ +void policy_mgr_get_tx_rx_ss_from_config(enum hw_mode_ss_config mac_ss, + uint32_t *tx_ss, uint32_t *rx_ss) +{ + switch (mac_ss) { + case HW_MODE_SS_0x0: + *tx_ss = 0; + *rx_ss = 0; + break; + case HW_MODE_SS_1x1: + *tx_ss = 1; + *rx_ss = 1; + break; + case HW_MODE_SS_2x2: + *tx_ss = 2; + *rx_ss = 2; + break; + case HW_MODE_SS_3x3: + *tx_ss = 3; + *rx_ss = 3; + break; + case HW_MODE_SS_4x4: + *tx_ss = 4; + *rx_ss = 4; + break; + default: + *tx_ss = 0; + *rx_ss = 0; + } +} + +/** + * policy_mgr_get_matching_hw_mode_index() - Get matching HW mode index + * @psoc: psoc handle + * @mac0_tx_ss: Number of tx spatial streams of MAC0 + * @mac0_rx_ss: Number of rx spatial streams of MAC0 + * @mac0_bw: Bandwidth of MAC0 of type 'hw_mode_bandwidth' + * @mac1_tx_ss: Number of tx spatial streams of MAC1 + * @mac1_rx_ss: Number of rx spatial streams of MAC1 + * @mac1_bw: Bandwidth of MAC1 of type 'hw_mode_bandwidth' + * @dbs: DBS capability of type 'hw_mode_dbs_capab' + * @dfs: Agile DFS capability of type 'hw_mode_agile_dfs_capab' + * @sbs: SBS capability of type 'hw_mode_sbs_capab' + * + * Fetches the HW mode index corresponding to the HW mode provided + * + * Return: Positive hw mode index in case a match is found or a negative + * value, otherwise + */ +int8_t policy_mgr_get_matching_hw_mode_index( + struct wlan_objmgr_psoc *psoc, + uint32_t mac0_tx_ss, uint32_t mac0_rx_ss, + enum hw_mode_bandwidth mac0_bw, + uint32_t mac1_tx_ss, uint32_t mac1_rx_ss, + enum hw_mode_bandwidth mac1_bw, + enum hw_mode_dbs_capab dbs, + enum hw_mode_agile_dfs_capab dfs, + enum hw_mode_sbs_capab sbs) +{ + return 0; +} + +/** + * policy_mgr_get_hw_mode_from_dbs_hw_list() - Get hw_mode index + * @mac0_ss: MAC0 spatial stream configuration + * @mac0_bw: MAC0 bandwidth configuration + * @mac1_ss: MAC1 spatial stream configuration + * @mac1_bw: MAC1 bandwidth configuration + * @dbs: HW DBS capability + * @dfs: HW Agile DFS capability + * @sbs: HW SBS capability + * + * Get the HW mode index corresponding to the HW modes spatial stream, + * bandwidth, DBS, Agile DFS and SBS capability + * + * Return: Index number if a match is found or -negative value if not found + */ +int8_t policy_mgr_get_hw_mode_idx_from_dbs_hw_list( + struct wlan_objmgr_psoc *psoc, + enum hw_mode_ss_config mac0_ss, + enum hw_mode_bandwidth mac0_bw, + enum hw_mode_ss_config mac1_ss, + enum hw_mode_bandwidth mac1_bw, + enum hw_mode_dbs_capab dbs, + enum hw_mode_agile_dfs_capab dfs, + enum hw_mode_sbs_capab sbs) +{ + return 0; +} + +/** + * policy_mgr_get_hw_mode_from_idx() - Get HW mode based on index + * @idx: HW mode index + * @hw_mode: HW mode params + * + * Fetches the HW mode parameters + * + * Return: Success if hw mode is obtained and the hw mode params + */ +QDF_STATUS policy_mgr_get_hw_mode_from_idx( + struct wlan_objmgr_psoc *psoc, + uint32_t idx, + struct policy_mgr_hw_mode_params *hw_mode) +{ + return QDF_STATUS_SUCCESS; +} + +/** + * policy_mgr_get_old_and_new_hw_index() - Get the old and new HW index + * @old_hw_mode_index: Value at this pointer contains the old HW mode index + * Default value when not configured is POLICY_MGR_DEFAULT_HW_MODE_INDEX + * @new_hw_mode_index: Value at this pointer contains the new HW mode index + * Default value when not configured is POLICY_MGR_DEFAULT_HW_MODE_INDEX + * + * Get the old and new HW index configured in the driver + * + * Return: Failure in case the HW mode indices cannot be fetched and Success + * otherwise. When no HW mode transition has happened the values of + * old_hw_mode_index and new_hw_mode_index will be the same. + */ +QDF_STATUS policy_mgr_get_old_and_new_hw_index( + struct wlan_objmgr_psoc *psoc, + uint32_t *old_hw_mode_index, + uint32_t *new_hw_mode_index) +{ + return QDF_STATUS_SUCCESS; +} + +/** + * policy_mgr_update_conc_list() - Update the concurrent connection list + * @conn_index: Connection index + * @mode: Mode + * @chan: Channel + * @bw: Bandwidth + * @mac: Mac id + * @chain_mask: Chain mask + * @vdev_id: vdev id + * @in_use: Flag to indicate if the index is in use or not + * + * Updates the index value of the concurrent connection list + * + * Return: None + */ +void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc, + uint32_t conn_index, + enum policy_mgr_con_mode mode, + uint8_t chan, + enum hw_mode_bandwidth bw, + uint8_t mac, + enum policy_mgr_chain_mode chain_mask, + uint32_t original_nss, + uint32_t vdev_id, + bool in_use) +{ +} + +/** + * policy_mgr_store_and_del_conn_info() - Store and del a connection info + * @mode: Mode whose entry has to be deleted + * @info: Struture pointer where the connection info will be saved + * + * Saves the connection info corresponding to the provided mode + * and deleted that corresponding entry based on vdev from the + * connection info structure + * + * Return: None + */ +void policy_mgr_store_and_del_conn_info(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + struct policy_mgr_conc_connection_info *info) +{ +} + +/** + * policy_mgr_restore_deleted_conn_info() - Restore connection info + * @info: Saved connection info that is to be restored + * + * Restores the connection info of STA that was saved before + * updating the PCL to the FW + * + * Return: None + */ +void policy_mgr_restore_deleted_conn_info(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_conc_connection_info *info) +{ +} + +/** + * policy_mgr_update_hw_mode_conn_info() - Update connection info based on HW mode + * @num_vdev_mac_entries: Number of vdev-mac id entries that follow + * @vdev_mac_map: Mapping of vdev-mac id + * @hw_mode: HW mode + * + * Updates the connection info parameters based on the new HW mode + * + * Return: None + */ +void policy_mgr_update_hw_mode_conn_info(struct wlan_objmgr_psoc *psoc, + uint32_t num_vdev_mac_entries, + struct policy_mgr_vdev_mac_map *vdev_mac_map, + struct policy_mgr_hw_mode_params hw_mode) +{ +} + +/** + * policy_mgr_pdev_set_hw_mode_cb() - Callback for set hw mode + * @status: Status + * @cfgd_hw_mode_index: Configured HW mode index + * @num_vdev_mac_entries: Number of vdev-mac id mapping that follows + * @vdev_mac_map: vdev-mac id map. This memory will be freed by the caller. + * So, make local copy if needed. + * + * Provides the status and configured hw mode index set + * by the FW + * + * Return: None + */ +void policy_mgr_pdev_set_hw_mode_cb(uint32_t status, + uint32_t cfgd_hw_mode_index, + uint32_t num_vdev_mac_entries, + struct policy_mgr_vdev_mac_map *vdev_mac_map, + void *context) +{ +} + +/** + * policy_mgr_dump_current_concurrency() - To dump the current + * concurrency combination + * + * This routine is called to dump the concurrency info + * + * Return: None + */ +void policy_mgr_dump_current_concurrency(struct wlan_objmgr_psoc *psoc) +{ +} + +/** + * policy_mgr_pdev_set_pcl() - Sets PCL to FW + * @mode: adapter mode + * + * Fetches the PCL and sends the PCL to SME + * module which in turn will send the WMI + * command WMI_PDEV_SET_PCL_CMDID to the fw + * + * Return: None + */ +void policy_mgr_pdev_set_pcl(struct wlan_objmgr_psoc *psoc, + enum tQDF_ADAPTER_MODE mode) +{ +} + + +/** + * policy_mgr_set_pcl_for_existing_combo() - Set PCL for existing connection + * @mode: Connection mode of type 'policy_mgr_con_mode' + * + * Set the PCL for an existing connection + * + * Return: None + */ +void policy_mgr_set_pcl_for_existing_combo( + struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode) +{ +} + +/** + * pm_dbs_opportunistic_timer_handler() - handler of + * dbs_opportunistic_timer + * @data: context + * + * handler for dbs_opportunistic_timer + * + * Return: None + */ +void pm_dbs_opportunistic_timer_handler(void *data) +{ +} + +/** + * policy_mgr_get_mode() - Get mode from type and subtype + * @type: type + * @subtype: subtype + * + * Get the concurrency mode from the type and subtype + * of the interface + * + * Return: policy_mgr_con_mode + */ +enum policy_mgr_con_mode policy_mgr_get_mode(uint8_t type, + uint8_t subtype) +{ + return PM_MAX_NUM_OF_MODE; +} + +/** + * policy_mgr_get_channel_list() - provides the channel list + * suggestion for new connection + * @pcl: The preferred channel list enum + * @pcl_channels: PCL channels + * @len: length of the PCL + * @mode: concurrency mode for which channel list is requested + * @pcl_weights: Weights of the PCL + * @weight_len: Max length of the weight list + * + * This function provides the actual channel list based on the + * current regulatory domain derived using preferred channel + * list enum obtained from one of the pcl_table + * + * Return: Channel List + */ +QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_pcl_type pcl, + uint8_t *pcl_channels, uint32_t *len, + enum policy_mgr_con_mode mode, + uint8_t *pcl_weights, uint32_t weight_len) +{ + return QDF_STATUS_SUCCESS; +} + +/** + * policy_mgr_disallow_mcc() - Check for mcc + * + * @channel: channel on which new connection is coming up + * + * When a new connection is about to come up check if current + * concurrency combination including the new connection is + * causing MCC + * + * Return: True/False + */ +bool policy_mgr_disallow_mcc(struct wlan_objmgr_psoc *psoc, + uint8_t channel) +{ + return false; +} + +/** + * policy_mgr_allow_new_home_channel() - Check for allowed number of + * home channels + * @channel: channel on which new connection is coming up + * @num_connections: number of current connections + * + * When a new connection is about to come up check if current + * concurrency combination including the new connection is + * allowed or not based on the HW capability + * + * Return: True/False + */ +bool policy_mgr_allow_new_home_channel(struct wlan_objmgr_psoc *psoc, + uint8_t channel, uint32_t num_connections) +{ + return true; +} + +/** + * policy_mgr_vht160_conn_exist() - to check if we have a connection + * already using vht160 or vht80+80 + * + * This routine will check if vht160 connection already exist or + * no. If it exist then this routine will return true. + * + * Return: true if vht160 connection exist else false + */ +bool policy_mgr_vht160_conn_exist(struct wlan_objmgr_psoc *psoc) +{ + return false; +} + +/** + * policy_mgr_is_5g_channel_allowed() - check if 5g channel is allowed + * @channel: channel number which needs to be validated + * @list: list of existing connections. + * @mode: mode against which channel needs to be validated + * + * This API takes the channel as input and compares with existing + * connection channels. If existing connection's channel is DFS channel + * and provided channel is 5G channel then don't allow concurrency to + * happen as MCC with DFS channel is not yet supported + * + * Return: true if 5G channel is allowed, false if not allowed + * + */ +bool policy_mgr_is_5g_channel_allowed(struct wlan_objmgr_psoc *psoc, + uint8_t channel, uint32_t *list, + enum policy_mgr_con_mode mode) +{ + return true; +} + +/** + * policy_mgr_complete_action() - initiates actions needed on + * current connections once channel has been decided for the new + * connection + * @new_nss: the new nss value + * @next_action: next action to happen at policy mgr after + * beacon update + * @reason: Reason for connection update + * @session_id: Session id + * + * This function initiates initiates actions + * needed on current connections once channel has been decided + * for the new connection. Notifies UMAC & FW as well + * + * Return: QDF_STATUS enum + */ +QDF_STATUS policy_mgr_complete_action(struct wlan_objmgr_psoc *psoc, + uint8_t new_nss, uint8_t next_action, + enum policy_mgr_conn_update_reason reason, + uint32_t session_id) +{ + return QDF_STATUS_SUCCESS; +} + +enum policy_mgr_con_mode policy_mgr_get_mode_by_vdev_id( + struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id) +{ + return PM_MAX_NUM_OF_MODE; +} + +/** + * policy_mgr_init_connection_update() - Initialize connection + * update event + * @pm_ctx: policy mgr context + * + * Initializes the concurrent connection update event + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_init_connection_update( + struct policy_mgr_psoc_priv_obj *pm_ctx) +{ + return QDF_STATUS_SUCCESS; +} + +/** + * policy_mgr_get_current_pref_hw_mode_dbs_2x2() - Get the current preferred hw mode + * + * Get the preferred hw mode based on the current connection combinations + * + * Return: No change (PM_NOP), MCC (PM_SINGLE_MAC), + * DBS (PM_DBS), SBS (PM_SBS) + */ +enum policy_mgr_conc_next_action + policy_mgr_get_current_pref_hw_mode_dbs_2x2( + struct wlan_objmgr_psoc *psoc) +{ + return PM_NOP; +} + +/** + * policy_mgr_get_current_pref_hw_mode_dbs_1x1() - Get the current preferred hw mode + * + * Get the preferred hw mode based on the current connection combinations + * + * Return: No change (PM_NOP), MCC (PM_SINGLE_MAC_UPGRADE), + * DBS (PM_DBS_DOWNGRADE) + */ +enum policy_mgr_conc_next_action + policy_mgr_get_current_pref_hw_mode_dbs_1x1( + struct wlan_objmgr_psoc *psoc) +{ + return PM_NOP; +} + +/** + * policy_mgr_reset_sap_mandatory_channels() - Reset the SAP mandatory channels + * + * Resets the SAP mandatory channel list and the length of the list + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_reset_sap_mandatory_channels( + struct policy_mgr_psoc_priv_obj *pm_ctx) +{ + return QDF_STATUS_SUCCESS; +} diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c new file mode 100644 index 000000000000..52a4b0a2ce20 --- /dev/null +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -0,0 +1,346 @@ +/* + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + +/** + * DOC: wlan_policy_mgr_get_set_utils.c + * + * WLAN Concurrenct Connection Management APIs + * + */ + +/* Include files */ + +#include "wlan_policy_mgr_api.h" +#include "wlan_policy_mgr_i.h" +#include "qdf_types.h" +#include "qdf_trace.h" +#include "wlan_objmgr_global_obj.h" + +bool policy_mgr_get_dbs_plus_agile_scan_config(struct wlan_objmgr_psoc *psoc) +{ + return false; +} + +bool policy_mgr_get_single_mac_scan_with_dfs_config( + struct wlan_objmgr_psoc *psoc) +{ + return false; +} + +int8_t policy_mgr_get_num_dbs_hw_modes(struct wlan_objmgr_psoc *psoc) +{ + return 0; +} + +bool policy_mgr_is_hw_dbs_capable(struct wlan_objmgr_psoc *psoc) +{ + return false; +} + +bool policy_mgr_is_hw_sbs_capable(struct wlan_objmgr_psoc *psoc) +{ + return true; +} + +QDF_STATUS policy_mgr_get_dbs_hw_modes(struct wlan_objmgr_psoc *psoc, + bool *one_by_one_dbs, bool *two_by_two_dbs) +{ + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_get_current_hw_mode(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_hw_mode_params *hw_mode) +{ + return QDF_STATUS_SUCCESS; +} + +bool policy_mgr_is_current_hwmode_dbs(struct wlan_objmgr_psoc *psoc) +{ + return false; +} + +bool policy_mgr_is_dbs_enable(struct wlan_objmgr_psoc *psoc) +{ + return false; +} + +bool policy_mgr_is_hw_dbs_2x2_capable(struct wlan_objmgr_psoc *psoc) +{ + return false; +} + +uint32_t policy_mgr_get_connection_count(struct wlan_objmgr_psoc *psoc) +{ + return 0; +} + +uint32_t policy_mgr_mode_specific_connection_count( + struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint32_t *list) +{ + return 0; +} + +void policy_mgr_soc_set_dual_mac_cfg_cb(enum set_hw_mode_status status, + uint32_t scan_config, + uint32_t fw_mode_config) +{ + policy_mgr_notice("Status:%d for scan_config:%x fw_mode_config:%x", + status, scan_config, fw_mode_config); +} + +void policy_mgr_set_dual_mac_scan_config(struct wlan_objmgr_psoc *psoc, + uint8_t dbs_val, + uint8_t dbs_plus_agile_scan_val, + uint8_t single_mac_scan_with_dbs_val) +{ +} + +void policy_mgr_set_dual_mac_fw_mode_config(struct wlan_objmgr_psoc *psoc, + uint8_t dbs, uint8_t dfs) +{ +} + +bool policy_mgr_current_concurrency_is_mcc(struct wlan_objmgr_psoc *psoc) +{ + return true; +} + +void policy_mgr_set_concurrency_mode(enum tQDF_ADAPTER_MODE mode) +{ + return; +} + +void policy_mgr_clear_concurrency_mode(enum tQDF_ADAPTER_MODE mode) +{ + return; +} + +void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, + enum tQDF_ADAPTER_MODE mode, + uint8_t session_id) +{ +} + +void policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, + enum tQDF_ADAPTER_MODE mode, + uint8_t session_id) +{ +} + +QDF_STATUS policy_mgr_incr_connection_count( + struct wlan_objmgr_psoc *psoc, uint32_t vdev_id) +{ + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_decr_connection_count(struct wlan_objmgr_psoc *psoc, + uint32_t vdev_id) +{ + return QDF_STATUS_SUCCESS; +} + +bool policy_mgr_map_concurrency_mode(enum tQDF_ADAPTER_MODE *old_mode, + enum policy_mgr_con_mode *new_mode) +{ + return true; +} + +bool policy_mgr_is_ibss_conn_exist(struct wlan_objmgr_psoc *psoc, + uint8_t *ibss_channel) +{ + return QDF_STATUS_SUCCESS; +} + +bool policy_mgr_max_concurrent_connections_reached( + struct wlan_objmgr_psoc *psoc) +{ + return false; +} + +bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint8_t channel, enum hw_mode_bandwidth bw) +{ + return true; +} + +uint32_t policy_mgr_get_concurrency_mode(void) +{ + return 0; +} + +QDF_STATUS policy_mgr_get_channel_from_scan_result( + struct wlan_objmgr_psoc *psoc, + void *roam_profile, uint8_t *channel) +{ + return QDF_STATUS_SUCCESS; +} + +uint8_t policy_mgr_search_and_check_for_session_conc( + struct wlan_objmgr_psoc *psoc, + uint8_t session_id, + void *roam_profile) +{ + return 0; +} + +bool policy_mgr_check_for_session_conc(struct wlan_objmgr_psoc *psoc, + uint8_t session_id, uint8_t channel) +{ + return true; +} + +uint8_t policy_mgr_is_mcc_in_24G(struct wlan_objmgr_psoc *psoc) +{ + return 0; +} + +int32_t policy_mgr_set_mas(struct wlan_objmgr_psoc *psoc, uint8_t mas_value) +{ + return 0; +} + +int32_t policy_mgr_set_mcc_p2p_quota(struct wlan_objmgr_psoc *psoc, + uint32_t set_value) +{ + return 0; +} + +QDF_STATUS policy_mgr_change_mcc_go_beacon_interval( + struct wlan_objmgr_psoc *psoc) +{ + return QDF_STATUS_SUCCESS; +} + +int32_t policy_mgr_go_set_mcc_p2p_quota(struct wlan_objmgr_psoc *psoc, + uint32_t set_value) +{ + return 0; +} + +void policy_mgr_set_mcc_latency(struct wlan_objmgr_psoc *psoc, int set_value) +{ + return; +} + +struct policy_mgr_conc_connection_info *policy_mgr_get_conn_info(uint32_t *len) +{ + return NULL; +} + +enum policy_mgr_con_mode policy_mgr_convert_device_mode_to_qdf_type( + enum tQDF_ADAPTER_MODE device_mode) +{ + return PM_MAX_NUM_OF_MODE; +} + +bool policy_mgr_concurrent_open_sessions_running(void) +{ + return true; +} + +bool policy_mgr_concurrent_beaconing_sessions_running(void) +{ + return true; +} + + +void policy_mgr_clear_concurrent_session_count(struct wlan_objmgr_psoc *psoc) +{ +} + +bool policy_mgr_is_multiple_active_sta_sessions(struct wlan_objmgr_psoc *psoc) +{ + return false; +} + +bool policy_mgr_is_sta_active_connection_exists(void) +{ + return true; +} + +bool policy_mgr_is_any_nondfs_chnl_present(struct wlan_objmgr_psoc *psoc, + uint8_t *channel) +{ + return true; +} + +bool policy_mgr_is_any_dfs_beaconing_session_present( + struct wlan_objmgr_psoc *psoc, uint8_t *channel) +{ + return true; +} + +QDF_STATUS policy_mgr_get_nss_for_vdev(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint8_t *nss_2g, uint8_t *nss_5g) +{ + return QDF_STATUS_SUCCESS; +} + +void policy_mgr_dump_connection_status_info(struct wlan_objmgr_psoc *psoc) +{ +} + +bool policy_mgr_is_any_mode_active_on_band_along_with_session( + struct wlan_objmgr_psoc *psoc, + uint8_t session_id, + enum policy_mgr_band band) +{ + return true; +} + +QDF_STATUS policy_mgr_get_mac_id_by_session_id(struct wlan_objmgr_psoc *psoc, + uint8_t session_id, uint8_t *mac_id) +{ + return QDF_STATUS_E_FAILURE; +} + +QDF_STATUS policy_mgr_get_mcc_session_id_on_mac(struct wlan_objmgr_psoc *psoc, + uint8_t mac_id, uint8_t session_id, + uint8_t *mcc_session_id) +{ + return QDF_STATUS_E_FAILURE; +} + +uint8_t policy_mgr_get_mcc_operating_channel(struct wlan_objmgr_psoc *psoc, + uint8_t session_id) +{ + return 0; +} + +void policy_mgr_set_do_hw_mode_change_flag(struct wlan_objmgr_psoc *psoc, + bool flag) +{ +} + +bool policy_mgr_is_hw_mode_change_after_vdev_up(struct wlan_objmgr_psoc *psoc) +{ + return false; +} diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h new file mode 100644 index 000000000000..272e8ca67c95 --- /dev/null +++ b/src/wlan_policy_mgr_i.h @@ -0,0 +1,374 @@ +/* + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + +#ifndef WLAN_POLICY_MGR_I_H +#define WLAN_POLICY_MGR_I_H + +#include "wlan_policy_mgr_api.h" +#include "qdf_event.h" +#include "qdf_mc_timer.h" +#include "qdf_lock.h" +#include "qdf_defer.h" + +#define MAX_NUMBER_OF_CONC_CONNECTIONS 3 +#define DBS_OPPORTUNISTIC_TIME 10 +#ifdef QCA_WIFI_3_0_EMU +#define CONNECTION_UPDATE_TIMEOUT 3000 +#else +#define CONNECTION_UPDATE_TIMEOUT 1000 +#endif + +/** + * Some max value greater than the max length of the channel list + */ +#define MAX_WEIGHT_OF_PCL_CHANNELS 255 +/** + * Some fixed weight difference between the groups + */ +#define PCL_GROUPS_WEIGHT_DIFFERENCE 20 + +/** + * Currently max, only 3 groups are possible as per 'enum policy_mgr_pcl_type'. + * i.e., in a PCL only 3 groups of channels can be present + * e.g., SCC channel on 2.4 Ghz, SCC channel on 5 Ghz & 5 Ghz channels. + * Group 1 has highest priority, group 2 has the next higher priority + * and so on. + */ +#define WEIGHT_OF_GROUP1_PCL_CHANNELS MAX_WEIGHT_OF_PCL_CHANNELS +#define WEIGHT_OF_GROUP2_PCL_CHANNELS \ + (WEIGHT_OF_GROUP1_PCL_CHANNELS - PCL_GROUPS_WEIGHT_DIFFERENCE) +#define WEIGHT_OF_GROUP3_PCL_CHANNELS \ + (WEIGHT_OF_GROUP2_PCL_CHANNELS - PCL_GROUPS_WEIGHT_DIFFERENCE) +#define WEIGHT_OF_GROUP4_PCL_CHANNELS \ + (WEIGHT_OF_GROUP3_PCL_CHANNELS - PCL_GROUPS_WEIGHT_DIFFERENCE) + +#define WEIGHT_OF_NON_PCL_CHANNELS 1 +#define WEIGHT_OF_DISALLOWED_CHANNELS 0 + +/** + * Policy Mgr hardware mode list bit-mask definitions. + * Bits 4:0, 31:29 are unused. + * + * The below definitions are added corresponding to WMI DBS HW mode + * list to make it independent of firmware changes for WMI definitions. + * Currently these definitions have dependency with BIT positions of + * the existing WMI macros. Thus, if the BIT positions are changed for + * WMI macros, then these macros' BIT definitions are also need to be + * changed. + */ +#define POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_BITPOS (28) +#define POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_BITPOS (24) +#define POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_BITPOS (20) +#define POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_BITPOS (16) +#define POLICY_MGR_HW_MODE_MAC0_BANDWIDTH_BITPOS (12) +#define POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_BITPOS (8) +#define POLICY_MGR_HW_MODE_DBS_MODE_BITPOS (7) +#define POLICY_MGR_HW_MODE_AGILE_DFS_MODE_BITPOS (6) +#define POLICY_MGR_HW_MODE_SBS_MODE_BITPOS (5) + +#define POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_MASK \ + (0xf << POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_BITPOS) +#define POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_MASK \ + (0xf << POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_BITPOS) +#define POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_MASK \ + (0xf << POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_BITPOS) +#define POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_MASK \ + (0xf << POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_BITPOS) +#define POLICY_MGR_HW_MODE_MAC0_BANDWIDTH_MASK \ + (0xf << POLICY_MGR_HW_MODE_MAC0_BANDWIDTH_BITPOS) +#define POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_MASK \ + (0xf << POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_BITPOS) +#define POLICY_MGR_HW_MODE_DBS_MODE_MASK \ + (0x1 << POLICY_MGR_HW_MODE_DBS_MODE_BITPOS) +#define POLICY_MGR_HW_MODE_AGILE_DFS_MODE_MASK \ + (0x1 << POLICY_MGR_HW_MODE_AGILE_DFS_MODE_BITPOS) +#define POLICY_MGR_HW_MODE_SBS_MODE_MASK \ + (0x1 << POLICY_MGR_HW_MODE_SBS_MODE_BITPOS) + +#define POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_BITPOS,\ + 4, value) +#define POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_BITPOS,\ + 4, value) +#define POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_BITPOS,\ + 4, value) +#define POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_BITPOS,\ + 4, value) +#define POLICY_MGR_HW_MODE_MAC0_BANDWIDTH_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, POLICY_MGR_HW_MODE_MAC0_BANDWIDTH_BITPOS,\ + 4, value) +#define POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_BITPOS,\ + 4, value) +#define POLICY_MGR_HW_MODE_DBS_MODE_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, POLICY_MGR_HW_MODE_DBS_MODE_BITPOS,\ + 1, value) +#define POLICY_MGR_HW_MODE_AGILE_DFS_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, POLICY_MGR_HW_MODE_AGILE_DFS_MODE_BITPOS,\ + 1, value) +#define POLICY_MGR_HW_MODE_SBS_MODE_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, POLICY_MGR_HW_MODE_SBS_MODE_BITPOS,\ + 1, value) + +#define POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_GET(hw_mode) \ + ((hw_mode & POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_MASK) >> \ + POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_BITPOS) +#define POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_GET(hw_mode) \ + ((hw_mode & POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_MASK) >> \ + POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_BITPOS) +#define POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_GET(hw_mode) \ + ((hw_mode & POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_MASK) >> \ + POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_BITPOS) +#define POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_GET(hw_mode) \ + ((hw_mode & POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_MASK) >> \ + POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_BITPOS) +#define POLICY_MGR_HW_MODE_MAC0_BANDWIDTH_GET(hw_mode) \ + ((hw_mode & POLICY_MGR_HW_MODE_MAC0_BANDWIDTH_MASK) >> \ + POLICY_MGR_HW_MODE_MAC0_BANDWIDTH_BITPOS) +#define POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_GET(hw_mode) \ + ((hw_mode & POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_MASK) >> \ + POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_BITPOS) +#define POLICY_MGR_HW_MODE_DBS_MODE_GET(hw_mode) \ + ((hw_mode & POLICY_MGR_HW_MODE_DBS_MODE_MASK) >> \ + POLICY_MGR_HW_MODE_DBS_MODE_BITPOS) +#define POLICY_MGR_HW_MODE_AGILE_DFS_GET(hw_mode) \ + ((hw_mode & POLICY_MGR_HW_MODE_AGILE_DFS_MODE_MASK) >> \ + POLICY_MGR_HW_MODE_AGILE_DFS_MODE_BITPOS) +#define POLICY_MGR_HW_MODE_SBS_MODE_GET(hw_mode) \ + ((hw_mode & POLICY_MGR_HW_MODE_SBS_MODE_MASK) >> \ + POLICY_MGR_HW_MODE_SBS_MODE_BITPOS) + +#define POLICY_MGR_DEFAULT_HW_MODE_INDEX 0xFFFF + +#define policy_mgr_log(level, args...) \ + QDF_TRACE(QDF_MODULE_ID_POLICY_MGR, level, ## args) +#define policy_mgr_logfl(level, format, args...) \ + policy_mgr_log(level, FL(format), ## args) + +#define policy_mgr_alert(format, args...) \ + policy_mgr_logfl(QDF_TRACE_LEVEL_FATAL, format, ## args) +#define policy_mgr_err(format, args...) \ + policy_mgr_logfl(QDF_TRACE_LEVEL_ERROR, format, ## args) +#define policy_mgr_warn(format, args...) \ + policy_mgr_logfl(QDF_TRACE_LEVEL_WARN, format, ## args) +#define policy_mgr_notice(format, args...) \ + policy_mgr_logfl(QDF_TRACE_LEVEL_INFO, format, ## args) +#define policy_mgr_info(format, args...) \ + policy_mgr_logfl(QDF_TRACE_LEVEL_INFO_HIGH, format, ## args) +#define policy_mgr_debug(format, args...) \ + policy_mgr_logfl(QDF_TRACE_LEVEL_DEBUG, format, ## args) + +#define PM_CONC_CONNECTION_LIST_VALID_INDEX(index) \ + ((MAX_NUMBER_OF_CONC_CONNECTIONS > index) && \ + (pm_conc_connection_list[index].in_use)) + +/** + * struct policy_mgr_psoc_priv_obj - Policy manager private data + * @psoc: pointer to PSOC object information + * @connection_update_done_evt: qdf event to synchronize + * connection activities + * @qdf_conc_list_lock: To protect connection table + * @dbs_opportunistic_timer: Timer to drop down to Single Mac + * Mode opportunistically + * @sap_restart_chan_switch_cb: Callback for channel switch + * notification for SAP + * @sme_cbacks: callbacks to be registered by SME for + * interaction with Policy Manager + * @wma_cbacks: callbacks to be registered by SME for + * interaction with Policy Manager + * @tdls_cbacks: callbacks to be registered by SME for + * interaction with Policy Manager + * @cdp_cbacks: callbacks to be registered by SME for + * interaction with Policy Manager + * @sap_mandatory_channels: The user preferred master list on + * which SAP can be brought up. This + * mandatory channel list would be as per + * OEMs preference & conforming to the + * regulatory/other considerations + * @sap_mandatory_channels_len: Length of the SAP mandatory + * channel list + * @do_hw_mode_change: Flag to check if HW mode change is needed + * after vdev is up. Especially used after + * channel switch related vdev restart + * @concurrency_mode: active concurrency combination + * @no_of_open_sessions: Number of active vdevs + * @no_of_active_sessions: Number of active connections + * @sta_ap_intf_check_work: delayed sap restart work + * @num_dbs_hw_modes: Number of different HW modes supported + * @hw_mode: List of HW modes supported + * @old_hw_mode_index: Old HW mode from hw_mode table + * @new_hw_mode_index: New HW mode from hw_mode table + * @phy_caps: PHY capability advertised by FW + * @enable2x2: 2x2 chain mask user config + * @gMaxConcurrentActiveSessions: Max concurrenct active + * connections user config + * @conc_system_pref: System preference of t/p, power or latancy + * for Preferred Channel List table, user + * config + * @dual_mac_cfg: DBS configuration currenctly used by FW for + * scan & connections + */ +struct policy_mgr_psoc_priv_obj { + struct wlan_objmgr_psoc *psoc; + qdf_event_t connection_update_done_evt; + qdf_mutex_t qdf_conc_list_lock; + qdf_mc_timer_t dbs_opportunistic_timer; + void (*sap_restart_chan_switch_cb)(void *, uint32_t, uint32_t); + struct policy_mgr_sme_cbacks sme_cbacks; + struct policy_mgr_wma_cbacks wma_cbacks; + struct policy_mgr_tdls_cbacks tdls_cbacks; + struct policy_mgr_cdp_cbacks cdp_cbacks; + uint8_t sap_mandatory_channels[QDF_MAX_NUM_CHAN]; + uint32_t sap_mandatory_channels_len; + bool do_hw_mode_change; + uint32_t concurrency_mode; + uint8_t no_of_open_sessions[QDF_MAX_NO_OF_MODE]; + uint8_t no_of_active_sessions[QDF_MAX_NO_OF_MODE]; + qdf_work_t sta_ap_intf_check_work; + uint32_t num_dbs_hw_modes; + struct dbs_hw_mode_info hw_mode; + uint32_t old_hw_mode_index; + uint32_t new_hw_mode_index; + struct extended_caps phy_caps; + bool enable2x2; + uint8_t gMaxConcurrentActiveSessions; + uint8_t conc_system_pref; + struct dual_mac_config dual_mac_cfg; +}; + +struct policy_mgr_psoc_priv_obj *policy_mgr_get_context( + struct wlan_objmgr_psoc *psoc); +QDF_STATUS policy_mgr_get_updated_scan_config( + struct wlan_objmgr_psoc *psoc, + uint32_t *scan_config, + bool dbs_scan, + bool dbs_plus_agile_scan, + bool single_mac_scan_with_dfs); +QDF_STATUS policy_mgr_get_updated_fw_mode_config( + struct wlan_objmgr_psoc *psoc, + uint32_t *fw_mode_config, + bool dbs, + bool agile_dfs); +bool policy_mgr_is_dual_mac_disabled_in_ini( + struct wlan_objmgr_psoc *psoc); +bool policy_mgr_get_dbs_config(struct wlan_objmgr_psoc *psoc); +bool policy_mgr_get_agile_dfs_config(struct wlan_objmgr_psoc *psoc); +bool policy_mgr_get_dbs_scan_config(struct wlan_objmgr_psoc *psoc); +void policy_mgr_get_tx_rx_ss_from_config(enum hw_mode_ss_config mac_ss, + uint32_t *tx_ss, uint32_t *rx_ss); +int8_t policy_mgr_get_matching_hw_mode_index( + struct wlan_objmgr_psoc *psoc, + uint32_t mac0_tx_ss, uint32_t mac0_rx_ss, + enum hw_mode_bandwidth mac0_bw, + uint32_t mac1_tx_ss, uint32_t mac1_rx_ss, + enum hw_mode_bandwidth mac1_bw, + enum hw_mode_dbs_capab dbs, + enum hw_mode_agile_dfs_capab dfs, + enum hw_mode_sbs_capab sbs); +int8_t policy_mgr_get_hw_mode_idx_from_dbs_hw_list( + struct wlan_objmgr_psoc *psoc, + enum hw_mode_ss_config mac0_ss, + enum hw_mode_bandwidth mac0_bw, + enum hw_mode_ss_config mac1_ss, + enum hw_mode_bandwidth mac1_bw, + enum hw_mode_dbs_capab dbs, + enum hw_mode_agile_dfs_capab dfs, + enum hw_mode_sbs_capab sbs); +QDF_STATUS policy_mgr_get_hw_mode_from_idx( + struct wlan_objmgr_psoc *psoc, + uint32_t idx, + struct policy_mgr_hw_mode_params *hw_mode); +QDF_STATUS policy_mgr_get_old_and_new_hw_index( + struct wlan_objmgr_psoc *psoc, + uint32_t *old_hw_mode_index, + uint32_t *new_hw_mode_index); +void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc, + uint32_t conn_index, + enum policy_mgr_con_mode mode, + uint8_t chan, + enum hw_mode_bandwidth bw, + uint8_t mac, + enum policy_mgr_chain_mode chain_mask, + uint32_t original_nss, + uint32_t vdev_id, + bool in_use); +void policy_mgr_store_and_del_conn_info(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + struct policy_mgr_conc_connection_info *info); +void policy_mgr_restore_deleted_conn_info(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_conc_connection_info *info); +void policy_mgr_update_hw_mode_conn_info(struct wlan_objmgr_psoc *psoc, + uint32_t num_vdev_mac_entries, + struct policy_mgr_vdev_mac_map *vdev_mac_map, + struct policy_mgr_hw_mode_params hw_mode); +void policy_mgr_pdev_set_hw_mode_cb(uint32_t status, + uint32_t cfgd_hw_mode_index, + uint32_t num_vdev_mac_entries, + struct policy_mgr_vdev_mac_map *vdev_mac_map, + void *context); +void policy_mgr_dump_current_concurrency(struct wlan_objmgr_psoc *psoc); +void policy_mgr_pdev_set_pcl(struct wlan_objmgr_psoc *psoc, + enum tQDF_ADAPTER_MODE mode); +void policy_mgr_set_pcl_for_existing_combo( + struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode); +void pm_dbs_opportunistic_timer_handler(void *data); +enum policy_mgr_con_mode policy_mgr_get_mode(uint8_t type, + uint8_t subtype); +QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_pcl_type pcl, + uint8_t *pcl_channels, uint32_t *len, + enum policy_mgr_con_mode mode, + uint8_t *pcl_weights, uint32_t weight_len); +bool policy_mgr_disallow_mcc(struct wlan_objmgr_psoc *psoc, + uint8_t channel); +bool policy_mgr_allow_new_home_channel(struct wlan_objmgr_psoc *psoc, + uint8_t channel, uint32_t num_connections); +bool policy_mgr_vht160_conn_exist(struct wlan_objmgr_psoc *psoc); +bool policy_mgr_is_5g_channel_allowed(struct wlan_objmgr_psoc *psoc, + uint8_t channel, uint32_t *list, + enum policy_mgr_con_mode mode); +QDF_STATUS policy_mgr_complete_action(struct wlan_objmgr_psoc *psoc, + uint8_t new_nss, uint8_t next_action, + enum policy_mgr_conn_update_reason reason, + uint32_t session_id); +enum policy_mgr_con_mode policy_mgr_get_mode_by_vdev_id( + struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id); +QDF_STATUS policy_mgr_init_connection_update( + struct policy_mgr_psoc_priv_obj *pm_ctx); +enum policy_mgr_conc_next_action + policy_mgr_get_current_pref_hw_mode_dbs_2x2( + struct wlan_objmgr_psoc *psoc); +enum policy_mgr_conc_next_action + policy_mgr_get_current_pref_hw_mode_dbs_1x1( + struct wlan_objmgr_psoc *psoc); +QDF_STATUS policy_mgr_reset_sap_mandatory_channels( + struct policy_mgr_psoc_priv_obj *pm_ctx); +#endif diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c new file mode 100644 index 000000000000..862e12a462f3 --- /dev/null +++ b/src/wlan_policy_mgr_init_deinit.c @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + +/** + * DOC: wlan_policy_mgr_init_deinit.c + * + * WLAN Concurrenct Connection Management APIs + * + */ + +/* Include files */ + +#include "wlan_policy_mgr_api.h" +#include "wlan_policy_mgr_tables_1x1_dbs_i.h" +#include "wlan_policy_mgr_tables_2x2_dbs_i.h" +#include "wlan_policy_mgr_i.h" +#include "qdf_types.h" +#include "qdf_trace.h" +#include "wlan_objmgr_global_obj.h" + +static QDF_STATUS policy_mgr_psoc_obj_create_cb(struct wlan_objmgr_psoc *psoc, + void *data) +{ + return QDF_STATUS_SUCCESS; +} + +static QDF_STATUS policy_mgr_psoc_obj_delete_cb(struct wlan_objmgr_psoc *psoc, + void *data) +{ + return QDF_STATUS_SUCCESS; +} + +static void policy_mgr_psoc_obj_status_cb(struct wlan_objmgr_psoc *psoc, + void *data, QDF_STATUS status) +{ + return; +} + +static QDF_STATUS policy_mgr_vdev_obj_create_cb(struct wlan_objmgr_vdev *vdev, + void *data) +{ + return QDF_STATUS_SUCCESS; +} + +static QDF_STATUS policy_mgr_vdev_obj_delete_cb(struct wlan_objmgr_vdev *vdev, + void *data) +{ + return QDF_STATUS_SUCCESS; +} + +static void policy_mgr_vdev_obj_status_cb(struct wlan_objmgr_vdev *vdev, + void *data, QDF_STATUS status) +{ + return; +} + +QDF_STATUS policy_mgr_init(void) +{ + QDF_STATUS status = QDF_STATUS_SUCCESS; + status = wlan_objmgr_register_psoc_create_handler( + WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_psoc_obj_create_cb, + NULL); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("Failed to register psoc obj create cback"); + goto err_psoc_create; + } + + status = wlan_objmgr_register_psoc_destroy_handler( + WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_psoc_obj_delete_cb, + NULL); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("Failed to register psoc obj delete cback"); + goto err_psoc_delete; + } + + status = wlan_objmgr_register_psoc_status_handler( + WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_psoc_obj_status_cb, + NULL); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("Failed to register psoc obj status cback"); + goto err_psoc_status; + } + + status = wlan_objmgr_register_vdev_create_handler( + WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_vdev_obj_create_cb, + NULL); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("Failed to register vdev obj create cback"); + goto err_vdev_create; + } + + status = wlan_objmgr_register_vdev_destroy_handler( + WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_vdev_obj_delete_cb, + NULL); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("Failed to register vdev obj delete cback"); + goto err_vdev_delete; + } + + status = wlan_objmgr_register_vdev_status_handler( + WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_vdev_obj_status_cb, + NULL); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("Failed to register vdev obj status cback"); + goto err_vdev_status; + } + + policy_mgr_notice("Callbacks registered with obj mgr"); + + return QDF_STATUS_SUCCESS; + +err_vdev_status: + wlan_objmgr_unregister_vdev_destroy_handler(WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_vdev_obj_delete_cb, NULL); +err_vdev_delete: + wlan_objmgr_unregister_vdev_create_handler(WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_vdev_obj_create_cb, NULL); +err_vdev_create: + wlan_objmgr_unregister_psoc_status_handler(WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_psoc_obj_status_cb, NULL); +err_psoc_status: + wlan_objmgr_unregister_psoc_destroy_handler(WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_psoc_obj_delete_cb, NULL); +err_psoc_delete: + wlan_objmgr_unregister_psoc_create_handler(WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_psoc_obj_create_cb, NULL); +err_psoc_create: + return status; +} + +QDF_STATUS policy_mgr_deinit(void) +{ + QDF_STATUS status; + + status = wlan_objmgr_unregister_psoc_create_handler( + WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_psoc_obj_create_cb, + NULL); + if (status != QDF_STATUS_SUCCESS) + policy_mgr_err("Failed to deregister psoc obj create cback"); + + status = wlan_objmgr_unregister_psoc_destroy_handler( + WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_psoc_obj_delete_cb, + NULL); + if (status != QDF_STATUS_SUCCESS) + policy_mgr_err("Failed to deregister psoc obj delete cback"); + + status = wlan_objmgr_unregister_psoc_status_handler( + WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_psoc_obj_status_cb, + NULL); + if (status != QDF_STATUS_SUCCESS) + policy_mgr_err("Failed to deregister psoc obj status cback"); + + status = wlan_objmgr_unregister_vdev_create_handler( + WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_vdev_obj_create_cb, + NULL); + if (status != QDF_STATUS_SUCCESS) + policy_mgr_err("Failed to deregister vdev obj create cback"); + + status = wlan_objmgr_unregister_vdev_destroy_handler( + WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_vdev_obj_delete_cb, + NULL); + if (status != QDF_STATUS_SUCCESS) + policy_mgr_err("Failed to deregister vdev obj delete cback"); + + status = wlan_objmgr_unregister_vdev_status_handler( + WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_vdev_obj_status_cb, + NULL); + if (status != QDF_STATUS_SUCCESS) + policy_mgr_err("Failed to deregister vdev obj status cback"); + + policy_mgr_info("deregistered callbacks with obj mgr successfully"); + + return status; +} + +QDF_STATUS policy_mgr_psoc_open(struct wlan_objmgr_psoc *psoc) +{ + /* placeholder for now */ + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_psoc_close(struct wlan_objmgr_psoc *psoc) +{ + /* placeholder for now */ + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_psoc_enable(struct wlan_objmgr_psoc *psoc) +{ + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_psoc_disable(struct wlan_objmgr_psoc *psoc) +{ + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_register_sme_cb(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_sme_cbacks *sme_cbacks) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + pm_ctx->sme_cbacks.sme_get_nss_for_vdev = + sme_cbacks->sme_get_nss_for_vdev; + pm_ctx->sme_cbacks.sme_get_valid_channels = + sme_cbacks->sme_get_valid_channels; + pm_ctx->sme_cbacks.sme_nss_update_request = + sme_cbacks->sme_nss_update_request; + pm_ctx->sme_cbacks.sme_pdev_set_hw_mode = + sme_cbacks->sme_pdev_set_hw_mode; + pm_ctx->sme_cbacks.sme_pdev_set_pcl = + sme_cbacks->sme_pdev_set_pcl; + pm_ctx->sme_cbacks.sme_soc_set_dual_mac_config = + sme_cbacks->sme_soc_set_dual_mac_config; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_register_wma_cb(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_wma_cbacks *wma_cbacks) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + pm_ctx->wma_cbacks.wma_get_connection_info = + wma_cbacks->wma_get_connection_info; + pm_ctx->wma_cbacks.wma_is_service_enabled = + wma_cbacks->wma_is_service_enabled; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_register_cdp_cb(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_cdp_cbacks *cdp_cbacks) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + pm_ctx->cdp_cbacks.cdp_update_mac_id = + cdp_cbacks->cdp_update_mac_id; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_register_tdls_cb(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_tdls_cbacks *tdls_cbacks) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + pm_ctx->tdls_cbacks.check_is_tdls_allowed = + tdls_cbacks->check_is_tdls_allowed; + pm_ctx->tdls_cbacks.set_tdls_ct_mode = + tdls_cbacks->set_tdls_ct_mode; + + return QDF_STATUS_SUCCESS; +} diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c new file mode 100644 index 000000000000..62cd7b380a28 --- /dev/null +++ b/src/wlan_policy_mgr_pcl.c @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + +/** + * DOC: wlan_policy_mgr_pcl.c + * + * WLAN Concurrenct Connection Management APIs + * + */ + +/* Include files */ + +#include "wlan_policy_mgr_api.h" +#include "wlan_policy_mgr_tables_no_dbs_i.h" +#include "wlan_policy_mgr_i.h" +#include "qdf_types.h" +#include "qdf_trace.h" +#include "wlan_objmgr_global_obj.h" + +/** + * first_connection_pcl_table - table which provides PCL for the + * very first connection in the system + */ +const enum policy_mgr_pcl_type +first_connection_pcl_table[PM_MAX_NUM_OF_MODE] + [PM_MAX_CONC_PRIORITY_MODE] = { + [PM_STA_MODE] = {PM_NONE, PM_NONE, PM_NONE}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G }, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_5G, PM_5G }, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G }, + [PM_IBSS_MODE] = {PM_NONE, PM_NONE, PM_NONE}, +}; + +pm_dbs_pcl_second_connection_table_type + *second_connection_pcl_dbs_table; +pm_dbs_pcl_third_connection_table_type + *third_connection_pcl_dbs_table; +policy_mgr_next_action_two_connection_table_type + *next_action_two_connection_table; +policy_mgr_next_action_three_connection_table_type + *next_action_three_connection_table; + +QDF_STATUS policy_mgr_get_pcl_for_existing_conn(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint8_t *pcl_ch, uint32_t *len, + uint8_t *pcl_weight, uint32_t weight_len) +{ + return QDF_STATUS_SUCCESS; +} + +void policy_mgr_decr_session_set_pcl(struct wlan_objmgr_psoc *psoc, + enum tQDF_ADAPTER_MODE mode, + uint8_t session_id) +{ +} + +void policy_mgr_update_with_safe_channel_list(uint8_t *pcl_channels, + uint32_t *len, uint8_t *weight_list, uint32_t weight_len) +{ + return; +} + +uint8_t policy_mgr_get_channel(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, uint32_t *vdev_id) +{ + return 0; +} + +QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint8_t *pcl_channels, uint32_t *len, + uint8_t *pcl_weight, uint32_t weight_len) +{ + return QDF_STATUS_SUCCESS; +} + +enum policy_mgr_conc_priority_mode + policy_mgr_get_first_connection_pcl_table_index( + struct wlan_objmgr_psoc *psoc) +{ + return PM_MAX_CONC_PRIORITY_MODE; +} + +enum policy_mgr_one_connection_mode + policy_mgr_get_second_connection_pcl_table_index( + struct wlan_objmgr_psoc *psoc) +{ + return PM_MAX_ONE_CONNECTION_MODE; +} + +enum policy_mgr_two_connection_mode + policy_mgr_get_third_connection_pcl_table_index( + struct wlan_objmgr_psoc *psoc) +{ + return PM_MAX_TWO_CONNECTION_MODE; +} + +uint8_t +policy_mgr_get_nondfs_preferred_channel(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + bool for_existing_conn) +{ + return 0; +} + +QDF_STATUS policy_mgr_get_valid_chans(struct wlan_objmgr_psoc *psoc, + uint8_t *chan_list, uint32_t *list_len) +{ + return QDF_STATUS_SUCCESS; +} + +bool policy_mgr_list_has_24GHz_channel(uint8_t *channel_list, + uint32_t list_len) +{ + return false; +} + +QDF_STATUS policy_mgr_set_sap_mandatory_channels(struct wlan_objmgr_psoc *psoc, + uint8_t *channels, uint32_t len) +{ + return QDF_STATUS_SUCCESS; +} + +bool policy_mgr_is_sap_mandatory_channel_set(struct wlan_objmgr_psoc *psoc) +{ + return false; +} + +QDF_STATUS policy_mgr_modify_sap_pcl_based_on_mandatory_channel( + struct wlan_objmgr_psoc *psoc, + uint8_t *pcl_list_org, + uint8_t *weight_list_org, + uint32_t *pcl_len_org) +{ + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_get_sap_mandatory_channel(struct wlan_objmgr_psoc *psoc, + uint32_t *chan) +{ + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_pcl_chan_weights *weight) +{ + return QDF_STATUS_SUCCESS; +} diff --git a/src/wlan_policy_mgr_tables_1x1_dbs_i.h b/src/wlan_policy_mgr_tables_1x1_dbs_i.h new file mode 100644 index 000000000000..caaedaf05431 --- /dev/null +++ b/src/wlan_policy_mgr_tables_1x1_dbs_i.h @@ -0,0 +1,1015 @@ +/* + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + +#ifndef __WLAN_POLICY_MGR_TABLES_1X1_DBS_H +#define __WLAN_POLICY_MGR_TABLES_1X1_DBS_H + +#include "wlan_policy_mgr_api.h" + +/** + * second_connection_pcl_dbs_1x1_table - table which provides PCL + * for the 2nd connection, when we have a connection already in + * the system (with DBS supported by HW) + */ +pm_dbs_pcl_second_connection_table_type +pm_second_connection_pcl_dbs_1x1_table = { + [PM_STA_24_1x1] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = {PM_5G, PM_5G, PM_5G } }, + + [PM_STA_24_2x2] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = {PM_5G, PM_5G, PM_5G } }, + + [PM_STA_5_1x1] = { + [PM_STA_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_SAP_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_GO_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_IBSS_MODE] = {PM_24G, PM_24G, PM_24G } }, + + [PM_STA_5_2x2] = { + [PM_STA_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_SAP_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_GO_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_IBSS_MODE] = {PM_24G, PM_24G, PM_24G } }, + + [PM_P2P_CLI_24_1x1] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_24_2x2] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_5_1x1] = { + [PM_STA_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_SAP_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_GO_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_5_2x2] = { + [PM_STA_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_SAP_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_GO_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_24_1x1] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_24_2x2] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_5_1x1] = { + [PM_STA_MODE] = {PM_SCC_CH_24G, PM_SCC_CH_24G, PM_SCC_CH_24G}, + [PM_SAP_MODE] = {PM_SCC_CH_24G, PM_SCC_CH_24G, PM_SCC_CH_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_GO_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_5_2x2] = { + [PM_STA_MODE] = {PM_SCC_CH_24G, PM_SCC_CH_24G, PM_SCC_CH_24G}, + [PM_SAP_MODE] = {PM_SCC_CH_24G, PM_SCC_CH_24G, PM_SCC_CH_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_GO_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_24_1x1] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_24_2x2] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_5_1x1] = { + [PM_STA_MODE] = {PM_SCC_CH_24G, PM_SCC_CH_24G, PM_SCC_CH_24G}, + [PM_SAP_MODE] = {PM_SCC_CH_24G, PM_SCC_CH_24G, PM_SCC_CH_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_GO_MODE] = {PM_SCC_CH_24G, PM_SCC_CH_24G, PM_SCC_CH_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_5_2x2] = { + [PM_STA_MODE] = {PM_SCC_CH_24G, PM_SCC_CH_24G, PM_SCC_CH_24G}, + [PM_SAP_MODE] = {PM_SCC_CH_24G, PM_SCC_CH_24G, PM_SCC_CH_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_GO_MODE] = {PM_SCC_CH_24G, PM_SCC_CH_24G, PM_SCC_CH_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_IBSS_24_1x1] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_IBSS_24_2x2] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_IBSS_5_1x1] = { + [PM_STA_MODE] = {PM_24G_SCC_CH, PM_24G_SCC_CH, PM_24G_SCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_IBSS_5_2x2] = { + [PM_STA_MODE] = {PM_24G_SCC_CH, PM_24G_SCC_CH, PM_24G_SCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, +}; + +/** + * third_connection_pcl_dbs_table - table which provides PCL for + * the 3rd connection, when we have two connections already in + * the system (with DBS supported by HW) + */ +static pm_dbs_pcl_third_connection_table_type +pm_third_connection_pcl_dbs_1x1_table = { + [PM_STA_SAP_SCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_SCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_MCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_SAP_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_MCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_SAP_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_SCC_5_1x1] = { + [PM_STA_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_SAP_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_SCC_5_2x2] = { + [PM_STA_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_SAP_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_MCC_5_1x1] = { + [PM_STA_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_MCC_5_2x2] = { + [PM_STA_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_MCC_24_5_1x1] = { + [PM_STA_MODE] = {PM_MCC_CH_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_MCC_24_5_2x2] = { + [PM_STA_MODE] = {PM_MCC_CH_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_DBS_1x1] = { + [PM_STA_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, + [PM_SAP_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_SCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_SCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_MCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_MCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_SCC_5_1x1] = { + [PM_STA_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_GO_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_SCC_5_2x2] = { + [PM_STA_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_GO_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_MCC_5_1x1] = { + [PM_STA_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_MCC_5_2x2] = { + [PM_STA_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_MCC_24_5_1x1] = { + [PM_STA_MODE] = {PM_MCC_CH_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_MCC_24_5_2x2] = { + [PM_STA_MODE] = {PM_MCC_CH_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_DBS_1x1] = { + [PM_STA_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_GO_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_SCC_24_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_SCC_24_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_MCC_24_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_MCC_24_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_SCC_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_GO_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_SCC_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_GO_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_MCC_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_MCC_CH_24G}, + [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_MCC_CH_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_MCC_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_MCC_CH_24G}, + [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_MCC_CH_24G}, + [PM_IBSS_MODE] = {PM_NONE, PM_NONE, PM_NONE} }, + + [PM_STA_P2P_CLI_MCC_24_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_MCC_CH_24G}, + [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_MCC_CH_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_MCC_24_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_MCC_CH_24G}, + [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_MCC_CH_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_DBS_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_GO_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_SCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_SCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_MCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_SAP_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_MCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_SAP_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_SCC_5_1x1] = { + [PM_STA_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_SAP_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_GO_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_SCC_5_2x2] = { + [PM_STA_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_SAP_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_P2P_GO_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_MCC_5_1x1] = { + [PM_STA_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_MCC_5_2x2] = { + [PM_STA_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_MCC_24_5_1x1] = { + [PM_STA_MODE] = {PM_MCC_CH_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_MCC_24_5_2x2] = { + [PM_STA_MODE] = {PM_MCC_CH_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_DBS_1x1] = { + [PM_STA_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, + [PM_SAP_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_CLIENT_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_GO_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_SCC_24_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_SCC_24_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_MCC_24_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_MCC_24_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_SCC_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_SCC_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_MCC_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_MCC_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_MCC_24_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_MCC_24_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_DBS_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_SCC_24_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_SCC_24_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_MCC_24_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_MCC_24_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_SCC_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_SCC_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_MCC_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_MCC_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_MCC_24_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_MCC_24_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_DBS_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + +}; + +/** + * next_action_two_connection_table - table which provides next + * action while a new connection is coming up, with one + * connection already in the system + */ +static policy_mgr_next_action_two_connection_table_type + pm_next_action_two_connection_dbs_1x1_table = { + [PM_STA_24_1x1] = {PM_NOP, PM_DBS}, + [PM_STA_24_2x2] = {PM_NOP, PM_DBS_DOWNGRADE}, + [PM_STA_5_1x1] = {PM_DBS, PM_NOP}, + [PM_STA_5_2x2] = {PM_DBS_DOWNGRADE, PM_NOP}, + [PM_P2P_CLI_24_1x1] = {PM_NOP, PM_DBS}, + [PM_P2P_CLI_24_2x2] = {PM_NOP, PM_DBS_DOWNGRADE}, + [PM_P2P_CLI_5_1x1] = {PM_DBS, PM_NOP}, + [PM_P2P_CLI_5_2x2] = {PM_DBS_DOWNGRADE, PM_NOP}, + [PM_P2P_GO_24_1x1] = {PM_NOP, PM_DBS}, + [PM_P2P_GO_24_2x2] = {PM_NOP, PM_DBS_DOWNGRADE}, + [PM_P2P_GO_5_1x1] = {PM_DBS, PM_NOP}, + [PM_P2P_GO_5_2x2] = {PM_DBS_DOWNGRADE, PM_NOP}, + [PM_SAP_24_1x1] = {PM_NOP, PM_DBS}, + [PM_SAP_24_2x2] = {PM_NOP, PM_DBS_DOWNGRADE}, + [PM_SAP_5_1x1] = {PM_DBS, PM_NOP}, + [PM_SAP_5_2x2] = {PM_DBS_DOWNGRADE, PM_NOP}, + [PM_IBSS_24_1x1] = {PM_NOP, PM_DBS}, + [PM_IBSS_24_2x2] = {PM_NOP, PM_DBS_DOWNGRADE}, + [PM_IBSS_5_1x1] = {PM_DBS, PM_NOP}, + [PM_IBSS_5_2x2] = {PM_DBS_DOWNGRADE, PM_NOP}, +}; + +/** + * next_action_three_connection_table - table which provides next + * action while a new connection is coming up, with two + * connections already in the system + */ +static policy_mgr_next_action_three_connection_table_type + pm_next_action_three_connection_dbs_1x1_table = { + [PM_STA_SAP_SCC_24_1x1] = {PM_NOP, PM_DBS}, + [PM_STA_SAP_SCC_24_2x2] = {PM_NOP, PM_DBS_DOWNGRADE}, + [PM_STA_SAP_MCC_24_1x1] = {PM_NOP, PM_DBS}, + [PM_STA_SAP_MCC_24_2x2] = {PM_NOP, PM_DBS_DOWNGRADE}, + [PM_STA_SAP_SCC_5_1x1] = {PM_DBS, PM_NOP}, + [PM_STA_SAP_SCC_5_2x2] = {PM_DBS_DOWNGRADE, PM_NOP}, + [PM_STA_SAP_MCC_5_1x1] = {PM_DBS, PM_NOP}, + [PM_STA_SAP_MCC_5_2x2] = {PM_DBS_DOWNGRADE, PM_NOP}, + [PM_STA_SAP_MCC_24_5_1x1] = {PM_DBS, PM_DBS}, + [PM_STA_SAP_MCC_24_5_2x2] = {PM_DBS_DOWNGRADE, PM_DBS_DOWNGRADE}, + [PM_STA_SAP_DBS_1x1] = {PM_NOP, PM_NOP}, + [PM_STA_P2P_GO_SCC_24_1x1] = {PM_NOP, PM_DBS}, + [PM_STA_P2P_GO_SCC_24_2x2] = {PM_NOP, PM_DBS_DOWNGRADE}, + [PM_STA_P2P_GO_MCC_24_1x1] = {PM_NOP, PM_DBS}, + [PM_STA_P2P_GO_MCC_24_2x2] = {PM_NOP, PM_DBS_DOWNGRADE}, + [PM_STA_P2P_GO_SCC_5_1x1] = {PM_DBS, PM_NOP}, + [PM_STA_P2P_GO_SCC_5_2x2] = {PM_DBS_DOWNGRADE, PM_NOP}, + [PM_STA_P2P_GO_MCC_5_1x1] = {PM_DBS, PM_NOP}, + [PM_STA_P2P_GO_MCC_5_2x2] = {PM_DBS_DOWNGRADE, PM_NOP}, + [PM_STA_P2P_GO_MCC_24_5_1x1] = {PM_DBS, PM_DBS}, + [PM_STA_P2P_GO_MCC_24_5_2x2] = { + PM_DBS_DOWNGRADE, PM_DBS_DOWNGRADE}, + [PM_STA_P2P_GO_DBS_1x1] = {PM_NOP, PM_NOP}, + [PM_STA_P2P_CLI_SCC_24_1x1] = {PM_NOP, PM_DBS}, + [PM_STA_P2P_CLI_SCC_24_2x2] = { + PM_NOP, PM_DBS_DOWNGRADE}, + [PM_STA_P2P_CLI_MCC_24_1x1] = {PM_NOP, PM_DBS}, + [PM_STA_P2P_CLI_MCC_24_2x2] = { + PM_NOP, PM_DBS_DOWNGRADE}, + [PM_STA_P2P_CLI_SCC_5_1x1] = {PM_DBS, PM_NOP}, + [PM_STA_P2P_CLI_SCC_5_2x2] = {PM_DBS_DOWNGRADE, PM_NOP}, + [PM_STA_P2P_CLI_MCC_5_1x1] = {PM_DBS, PM_NOP}, + [PM_STA_P2P_CLI_MCC_5_2x2] = {PM_DBS_DOWNGRADE, PM_NOP}, + [PM_STA_P2P_CLI_MCC_24_5_1x1] = {PM_DBS, PM_DBS}, + [PM_STA_P2P_CLI_MCC_24_5_2x2] = { + PM_DBS_DOWNGRADE, PM_DBS_DOWNGRADE}, + [PM_STA_P2P_CLI_DBS_1x1] = {PM_NOP, PM_NOP}, + [PM_P2P_GO_P2P_CLI_SCC_24_1x1] = {PM_NOP, PM_DBS}, + [PM_P2P_GO_P2P_CLI_SCC_24_2x2] = { + PM_NOP, PM_DBS_DOWNGRADE}, + [PM_P2P_GO_P2P_CLI_MCC_24_1x1] = {PM_NOP, PM_DBS}, + [PM_P2P_GO_P2P_CLI_MCC_24_2x2] = { + PM_NOP, PM_DBS_DOWNGRADE}, + [PM_P2P_GO_P2P_CLI_SCC_5_1x1] = {PM_DBS, PM_NOP}, + [PM_P2P_GO_P2P_CLI_SCC_5_2x2] = {PM_DBS_DOWNGRADE, PM_NOP}, + [PM_P2P_GO_P2P_CLI_MCC_5_1x1] = {PM_DBS, PM_NOP}, + [PM_P2P_GO_P2P_CLI_MCC_5_2x2] = {PM_DBS_DOWNGRADE, PM_NOP}, + [PM_P2P_GO_P2P_CLI_MCC_24_5_1x1] = {PM_DBS, PM_DBS}, + [PM_P2P_GO_P2P_CLI_MCC_24_5_2x2] = { + PM_DBS_DOWNGRADE, PM_DBS_DOWNGRADE}, + [PM_P2P_GO_P2P_CLI_DBS_1x1] = {PM_NOP, PM_NOP}, + [PM_P2P_GO_SAP_SCC_24_1x1] = {PM_NOP, PM_DBS}, + [PM_P2P_GO_SAP_SCC_24_2x2] = {PM_NOP, PM_DBS_DOWNGRADE}, + [PM_P2P_GO_SAP_MCC_24_1x1] = {PM_NOP, PM_DBS}, + [PM_P2P_GO_SAP_MCC_24_2x2] = {PM_NOP, PM_DBS_DOWNGRADE}, + [PM_P2P_GO_SAP_SCC_5_1x1] = {PM_DBS, PM_NOP}, + [PM_P2P_GO_SAP_SCC_5_2x2] = {PM_DBS_DOWNGRADE, PM_NOP}, + [PM_P2P_GO_SAP_MCC_5_1x1] = {PM_DBS, PM_NOP}, + [PM_P2P_GO_SAP_MCC_5_2x2] = {PM_DBS_DOWNGRADE, PM_NOP}, + [PM_P2P_GO_SAP_MCC_24_5_1x1] = {PM_DBS, PM_DBS}, + [PM_P2P_GO_SAP_MCC_24_5_2x2] = { + PM_DBS_DOWNGRADE, PM_DBS_DOWNGRADE}, + [PM_P2P_GO_SAP_DBS_1x1] = {PM_NOP, PM_NOP}, + [PM_P2P_CLI_SAP_SCC_24_1x1] = {PM_NOP, PM_DBS}, + [PM_P2P_CLI_SAP_SCC_24_2x2] = {PM_NOP, PM_DBS_DOWNGRADE}, + [PM_P2P_CLI_SAP_MCC_24_1x1] = {PM_NOP, PM_DBS}, + [PM_P2P_CLI_SAP_MCC_24_2x2] = {PM_NOP, PM_DBS_DOWNGRADE}, + [PM_P2P_CLI_SAP_SCC_5_1x1] = {PM_DBS, PM_NOP}, + [PM_P2P_CLI_SAP_SCC_5_2x2] = {PM_DBS_DOWNGRADE, PM_NOP}, + [PM_P2P_CLI_SAP_MCC_5_1x1] = {PM_DBS, PM_NOP}, + [PM_P2P_CLI_SAP_MCC_5_2x2] = {PM_DBS_DOWNGRADE, PM_NOP}, + [PM_P2P_CLI_SAP_MCC_24_5_1x1] = {PM_DBS, PM_DBS}, + [PM_P2P_CLI_SAP_MCC_24_5_2x2] = {PM_DBS_DOWNGRADE, PM_DBS_DOWNGRADE}, + [PM_P2P_CLI_SAP_DBS_1x1] = {PM_NOP, PM_NOP}, + +}; + +#endif diff --git a/src/wlan_policy_mgr_tables_2x2_dbs_i.h b/src/wlan_policy_mgr_tables_2x2_dbs_i.h new file mode 100644 index 000000000000..3f8b8c4a7329 --- /dev/null +++ b/src/wlan_policy_mgr_tables_2x2_dbs_i.h @@ -0,0 +1,1392 @@ +/* + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + +#ifndef __WLAN_POLICY_MGR_TABLES_2X2_DBS_H +#define __WLAN_POLICY_MGR_TABLESY_2X2_DBS_H + +#include "wlan_policy_mgr_api.h" + +/** + * second_connection_pcl_dbs_2x2_table - table which provides PCL + * for the 2nd connection, when we have a connection already in + * the system (with DBS supported by HW) + * This table consolidates selection for P2PCLI, P2PGO, STA, SAP + * into the single set of STA entries for 2.4G and 5G. + */ +static pm_dbs_pcl_second_connection_table_type +pm_second_connection_pcl_dbs_2x2_table = { + [PM_STA_24_1x1] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = {PM_5G, PM_5G, PM_5G} }, + + [PM_STA_24_2x2] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = {PM_5G, PM_5G, PM_5G} }, + + [PM_STA_5_1x1] = { + [PM_STA_MODE] = {PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_GO_MODE] = {PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_IBSS_MODE] = {PM_24G, PM_24G, PM_24G} }, + + [PM_STA_5_2x2] = { + [PM_STA_MODE] = {PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_GO_MODE] = {PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_IBSS_MODE] = {PM_24G, PM_24G, PM_24G} }, + + [PM_P2P_CLI_24_1x1] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_24_2x2] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_5_1x1] = { + [PM_STA_MODE] = {PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_GO_MODE] = {PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_IBSS_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_5_2x2] = { + [PM_STA_MODE] = {PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_GO_MODE] = {PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_IBSS_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_24_1x1] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_24_2x2] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_5_1x1] = { + [PM_STA_MODE] = {PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_GO_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_5_2x2] = { + [PM_STA_MODE] = {PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_GO_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_SAP_24_1x1] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_SAP_24_2x2] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_SAP_5_1x1] = { + [PM_STA_MODE] = {PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_GO_MODE] = {PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_IBSS_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + [PM_SAP_5_2x2] = { + [PM_STA_MODE] = {PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_GO_MODE] = {PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_IBSS_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE} }, + + + [PM_IBSS_24_1x1] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_IBSS_24_2x2] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_IBSS_5_1x1] = { + [PM_STA_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_IBSS_5_2x2] = { + [PM_STA_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + +}; + +/** + * third_connection_pcl_dbs_table - table which provides PCL for + * the 3rd connection, when we have two connections already in + * the system (with DBS supported by HW) + */ +static pm_dbs_pcl_third_connection_table_type +pm_third_connection_pcl_dbs_2x2_table = { + [PM_STA_SAP_SCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_SCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_MCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_MCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_SCC_5_1x1] = { + [PM_STA_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_CLIENT_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_GO_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_SCC_5_2x2] = { + [PM_STA_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_CLIENT_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_GO_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_MCC_5_1x1] = { + [PM_STA_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_SAP_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_MCC_5_2x2] = { + [PM_STA_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_SAP_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, + PM_24G_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_MCC_24_5_1x1] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_MCC_24_5_2x2] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_DBS_1x1] = { + [PM_STA_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_SAP_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_CLIENT_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, + PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_GO_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_DBS_2x2] = { + [PM_STA_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_SAP_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_CLIENT_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, + PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_GO_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_SBS_5_1x1] = { + [PM_STA_MODE] = { + PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + [PM_SAP_MODE] = { + PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + [PM_P2P_GO_MODE] = { + PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_SCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_SCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_MCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_MCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_SCC_5_1x1] = { + [PM_STA_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_SCC_5_2x2] = { + [PM_STA_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_MCC_5_1x1] = { + [PM_STA_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_SAP_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_MCC_5_2x2] = { + [PM_STA_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_SAP_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_MCC_24_5_1x1] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_MCC_24_5_2x2] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_DBS_1x1] = { + [PM_STA_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_SAP_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_DBS_2x2] = { + [PM_STA_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_SAP_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_SBS_5_1x1] = { + [PM_STA_MODE] = { + PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + [PM_SAP_MODE] = { + PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_SCC_24_1x1] = { + [PM_STA_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, + PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_SCC_24_2x2] = { + [PM_STA_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_MCC_24_1x1] = { + [PM_STA_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_MCC_24_2x2] = { + [PM_STA_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_SCC_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_SCC_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_MCC_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_MCC_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_MCC_24_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_MCC_24_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_DBS_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_DBS_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_SBS_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_SCC_24_1x1] = { + [PM_STA_MODE] = { + PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_SCC_24_2x2] = { + [PM_STA_MODE] = { + PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_MCC_24_1x1] = { + [PM_STA_MODE] = { PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_MCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_SCC_5_1x1] = { + [PM_STA_MODE] = { + PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_SCC_5_2x2] = { + [PM_STA_MODE] = { + PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_MCC_5_1x1] = { + [PM_STA_MODE] = { + PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_MCC_5_2x2] = { + [PM_STA_MODE] = { + PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_MCC_24_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_MCC_24_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_DBS_1x1] = { + [PM_STA_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_DBS_2x2] = { + [PM_STA_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_SBS_5_1x1] = { + [PM_STA_MODE] = { + PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_SCC_24_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_SCC_24_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_MCC_24_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_MCC_24_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_SCC_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_SCC_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_MCC_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_MCC_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, }, + + [PM_STA_P2P_CLI_MCC_24_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_MCC_24_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_DBS_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_DBS_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_SBS_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_SCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_SCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_MCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_MCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_SCC_5_1x1] = { + [PM_STA_MODE] = { + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH_5G, + PM_SCC_CH_24G}, + [PM_SAP_MODE] = { + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH_5G, + PM_SCC_CH_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH_SBS_CH_5G, + PM_24G_SCC_CH_SBS_CH_5G}, + [PM_P2P_GO_MODE] = { + PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH_SBS_CH_5G, + PM_24G_SCC_CH_SBS_CH_5G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_SCC_5_2x2] = { + [PM_STA_MODE] = { + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH_5G, + PM_SCC_CH_24G}, + [PM_SAP_MODE] = { + PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH_5G, + PM_SCC_CH_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH_SBS_CH_5G, + PM_24G_SCC_CH_SBS_CH_5G}, + [PM_P2P_GO_MODE] = { + PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH_SBS_CH_5G, + PM_24G_SCC_CH_SBS_CH_5G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_MCC_5_1x1] = { + [PM_STA_MODE] = {PM_24G_MCC_CH, PM_24G_MCC_CH, PM_24G_MCC_CH}, + [PM_SAP_MODE] = {PM_24G_MCC_CH, PM_24G_MCC_CH, PM_24G_MCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_24G_MCC_CH, PM_24G_MCC_CH, + PM_24G_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_24G_MCC_CH, PM_24G_MCC_CH, PM_24G_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_MCC_5_2x2] = { + [PM_STA_MODE] = {PM_MCC_CH_24G, PM_24G_MCC_CH, PM_24G_MCC_CH}, + [PM_SAP_MODE] = {PM_24G_MCC_CH, PM_24G_MCC_CH, PM_24G_MCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G_MCC_CH, + PM_24G_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G_MCC_CH, PM_24G_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_MCC_24_5_1x1] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_MCC_24_5_2x2] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_DBS_1x1] = { + [PM_STA_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24_5G, + PM_SCC_ON_5_SCC_ON_24}, + [PM_SAP_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24_5G, + PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_CLIENT_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24_5G, + PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_GO_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24_5G, + PM_SCC_ON_5_SCC_ON_24}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_DBS_2x2] = { + [PM_STA_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24_5G, + PM_SCC_ON_5_SCC_ON_24}, + [PM_SAP_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24_5G, + PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_CLIENT_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24_5G, + PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_GO_MODE] = { + PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24_5G, + PM_SCC_ON_5_SCC_ON_24}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_SBS_5_1x1] = { + [PM_STA_MODE] = { + PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + [PM_SAP_MODE] = { + PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + [PM_P2P_GO_MODE] = { + PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_STA_SCC_24_1x1] = { + [PM_STA_MODE] = { + PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = { + PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_STA_SCC_24_2x2] = { + [PM_STA_MODE] = { + PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = { + PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_STA_MCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_STA_MCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_STA_SCC_5_1x1] = { + [PM_STA_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_STA_SCC_5_2x2] = { + [PM_STA_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_STA_MCC_5_1x1] = { + [PM_STA_MODE] = { + PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_SAP_MODE] = { + PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_STA_MCC_5_2x2] = { + [PM_STA_MODE] = { + PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_SAP_MODE] = { + PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, }, + + [PM_STA_STA_MCC_24_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_STA_MCC_24_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_STA_DBS_1x1] = { + [PM_STA_MODE] = {PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_SAP_MODE] = {PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_STA_DBS_2x2] = { + [PM_STA_MODE] = {PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_SAP_MODE] = {PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_STA_SBS_5_1x1] = { + [PM_STA_MODE] = { + PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + [PM_SAP_MODE] = { + PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + +}; + +/** + * next_action_two_connection_table - table which provides next + * action while a new connection is coming up, with one + * connection already in the system + */ +static policy_mgr_next_action_two_connection_table_type + pm_next_action_two_connection_dbs_2x2_table = { + [PM_STA_24_1x1] = {PM_NOP, PM_NOP}, + [PM_STA_24_2x2] = {PM_NOP, PM_NOP}, + [PM_STA_5_1x1] = {PM_DBS, PM_SBS}, + [PM_STA_5_2x2] = {PM_DBS, PM_SBS_DOWNGRADE}, + [PM_P2P_CLI_24_1x1] = {PM_NOP, PM_NOP}, + [PM_P2P_CLI_24_2x2] = {PM_NOP, PM_NOP}, + [PM_P2P_CLI_5_1x1] = {PM_DBS, PM_SBS}, + [PM_P2P_CLI_5_2x2] = {PM_DBS, PM_SBS_DOWNGRADE}, + [PM_P2P_GO_24_1x1] = {PM_NOP, PM_NOP}, + [PM_P2P_GO_24_2x2] = {PM_NOP, PM_NOP}, + [PM_P2P_GO_5_1x1] = {PM_DBS, PM_SBS}, + [PM_P2P_GO_5_2x2] = {PM_DBS, PM_SBS_DOWNGRADE}, + [PM_SAP_24_1x1] = {PM_NOP, PM_DBS}, + [PM_SAP_24_2x2] = {PM_NOP, PM_DBS}, + [PM_SAP_5_1x1] = {PM_DBS, PM_SBS}, + [PM_SAP_5_2x2] = {PM_DBS, PM_SBS_DOWNGRADE}, + [PM_IBSS_24_1x1] = {PM_NOP, PM_NOP}, + [PM_IBSS_24_2x2] = {PM_NOP, PM_NOP}, + [PM_IBSS_5_1x1] = {PM_DBS, PM_NOP}, + [PM_IBSS_5_2x2] = {PM_DBS, PM_NOP}, +}; + +/** + * next_action_three_connection_table - table which provides next + * action while a new connection is coming up, with two + * connections already in the system + */ +static policy_mgr_next_action_three_connection_table_type + pm_next_action_three_connection_dbs_2x2_table = { + [PM_STA_SAP_SCC_24_1x1] = {PM_NOP, PM_NOP}, + [PM_STA_SAP_SCC_24_2x2] = {PM_NOP, PM_NOP}, + [PM_STA_SAP_MCC_24_1x1] = {PM_NOP, PM_NOP}, + [PM_STA_SAP_MCC_24_2x2] = {PM_NOP, PM_NOP}, + [PM_STA_SAP_SCC_5_1x1] = {PM_DBS, PM_SBS}, + [PM_STA_SAP_SCC_5_2x2] = {PM_DBS, PM_SBS_DOWNGRADE}, + [PM_STA_SAP_MCC_5_1x1] = {PM_DBS, PM_SBS}, + [PM_STA_SAP_MCC_5_2x2] = {PM_DBS, PM_SBS_DOWNGRADE}, + [PM_STA_SAP_MCC_24_5_1x1] = {PM_NOP, PM_NOP}, + [PM_STA_SAP_MCC_24_5_2x2] = {PM_NOP, PM_NOP}, + [PM_STA_SAP_DBS_1x1] = {PM_NOP, PM_NOP}, + [PM_STA_SAP_DBS_2x2] = {PM_NOP, PM_NOP}, + [PM_STA_SAP_SBS_5_1x1] = {PM_DBS_UPGRADE, PM_NOP}, + + [PM_STA_P2P_GO_SCC_24_1x1] = {PM_NOP, PM_NOP}, + [PM_STA_P2P_GO_SCC_24_2x2] = {PM_NOP, PM_NOP}, + [PM_STA_P2P_GO_MCC_24_1x1] = {PM_NOP, PM_NOP}, + [PM_STA_P2P_GO_MCC_24_2x2] = {PM_NOP, PM_NOP}, + [PM_STA_P2P_GO_SCC_5_1x1] = {PM_DBS, PM_SBS}, + [PM_STA_P2P_GO_SCC_5_2x2] = {PM_DBS, PM_SBS_DOWNGRADE}, + [PM_STA_P2P_GO_MCC_5_1x1] = {PM_DBS, PM_SBS}, + [PM_STA_P2P_GO_MCC_5_2x2] = {PM_DBS, PM_SBS_DOWNGRADE}, + [PM_STA_P2P_GO_MCC_24_5_1x1] = {PM_NOP, PM_NOP}, + [PM_STA_P2P_GO_MCC_24_5_2x2] = {PM_NOP, PM_NOP}, + [PM_STA_P2P_GO_DBS_1x1] = {PM_NOP, PM_NOP}, + [PM_STA_P2P_GO_DBS_2x2] = {PM_NOP, PM_NOP}, + [PM_STA_P2P_GO_SBS_5_1x1] = {PM_DBS_UPGRADE, PM_NOP}, + + [PM_STA_P2P_CLI_SCC_24_1x1] = {PM_NOP, PM_NOP}, + [PM_STA_P2P_CLI_SCC_24_2x2] = {PM_NOP, PM_NOP}, + [PM_STA_P2P_CLI_MCC_24_1x1] = {PM_NOP, PM_NOP}, + [PM_STA_P2P_CLI_MCC_24_2x2] = {PM_NOP, PM_NOP}, + [PM_STA_P2P_CLI_SCC_5_1x1] = {PM_DBS, PM_SBS}, + [PM_STA_P2P_CLI_SCC_5_2x2] = {PM_DBS, PM_SBS_DOWNGRADE}, + [PM_STA_P2P_CLI_MCC_5_1x1] = {PM_DBS, PM_SBS}, + [PM_STA_P2P_CLI_MCC_5_2x2] = {PM_DBS, PM_SBS_DOWNGRADE}, + [PM_STA_P2P_CLI_MCC_24_5_1x1] = {PM_NOP, PM_NOP}, + [PM_STA_P2P_CLI_MCC_24_5_2x2] = {PM_NOP, PM_NOP}, + [PM_STA_P2P_CLI_DBS_1x1] = {PM_NOP, PM_NOP}, + [PM_STA_P2P_CLI_DBS_2x2] = {PM_NOP, PM_NOP}, + [PM_STA_P2P_CLI_SBS_5_1x1] = {PM_DBS_UPGRADE, PM_NOP}, + + [PM_P2P_GO_P2P_CLI_SCC_24_1x1] = {PM_NOP, PM_NOP}, + [PM_P2P_GO_P2P_CLI_SCC_24_2x2] = {PM_NOP, PM_NOP}, + [PM_P2P_GO_P2P_CLI_MCC_24_1x1] = {PM_NOP, PM_NOP}, + [PM_P2P_GO_P2P_CLI_MCC_24_2x2] = {PM_NOP, PM_NOP}, + [PM_P2P_GO_P2P_CLI_SCC_5_1x1] = {PM_DBS, PM_SBS}, + [PM_P2P_GO_P2P_CLI_SCC_5_2x2] = {PM_DBS, PM_SBS_DOWNGRADE}, + [PM_P2P_GO_P2P_CLI_MCC_5_1x1] = {PM_DBS, PM_SBS}, + [PM_P2P_GO_P2P_CLI_MCC_5_2x2] = {PM_DBS, PM_SBS_DOWNGRADE}, + [PM_P2P_GO_P2P_CLI_MCC_24_5_1x1] = {PM_NOP, PM_NOP}, + [PM_P2P_GO_P2P_CLI_MCC_24_5_2x2] = {PM_NOP, PM_NOP}, + [PM_P2P_GO_P2P_CLI_DBS_1x1] = {PM_NOP, PM_NOP}, + [PM_P2P_GO_P2P_CLI_DBS_2x2] = {PM_NOP, PM_NOP}, + [PM_P2P_GO_P2P_CLI_SBS_5_1x1] = {PM_DBS_UPGRADE, PM_NOP}, + + [PM_STA_STA_SCC_24_1x1] = {PM_NOP, PM_NOP}, + [PM_STA_STA_SCC_24_2x2] = {PM_NOP, PM_NOP}, + [PM_STA_STA_MCC_24_1x1] = {PM_NOP, PM_NOP}, + [PM_STA_STA_MCC_24_2x2] = {PM_NOP, PM_NOP}, + [PM_STA_STA_SCC_5_1x1] = {PM_DBS, PM_SBS}, + [PM_STA_STA_SCC_5_2x2] = {PM_DBS, PM_SBS_DOWNGRADE}, + [PM_STA_STA_MCC_5_1x1] = {PM_DBS, PM_SBS}, + [PM_STA_STA_MCC_5_2x2] = {PM_DBS, PM_SBS_DOWNGRADE}, + [PM_STA_STA_MCC_24_5_1x1] = {PM_NOP, PM_NOP}, + [PM_STA_STA_MCC_24_5_2x2] = {PM_NOP, PM_NOP}, + [PM_STA_STA_DBS_1x1] = {PM_NOP, PM_NOP}, + [PM_STA_STA_DBS_2x2] = {PM_NOP, PM_NOP}, + [PM_STA_STA_SBS_5_1x1] = {PM_DBS_UPGRADE, PM_NOP}, + +}; + +#endif diff --git a/src/wlan_policy_mgr_tables_no_dbs_i.h b/src/wlan_policy_mgr_tables_no_dbs_i.h new file mode 100644 index 000000000000..cddd184cf939 --- /dev/null +++ b/src/wlan_policy_mgr_tables_no_dbs_i.h @@ -0,0 +1,909 @@ +/* + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + +#ifndef __WLAN_POLICY_MGR_TABLES_NO_DBS_H +#define __WLAN_POLICY_MGR_TABLES_NO_DBS_H + +#include "wlan_policy_mgr_api.h" + +/** + * second_connection_pcl_nodbs_table - table which provides PCL + * for the 2nd connection, when we have a connection already in + * the system (with DBS not supported by HW) + */ +static const enum policy_mgr_pcl_type +second_connection_pcl_nodbs_table[PM_MAX_ONE_CONNECTION_MODE] + [PM_MAX_NUM_OF_MODE][PM_MAX_CONC_PRIORITY_MODE] = { + [PM_STA_24_1x1] = { + [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_P2P_GO_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_24_2x2] = { + [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_P2P_GO_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_5_1x1] = { + [PM_STA_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_SAP_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_5_2x2] = { + [PM_STA_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_SAP_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_24_1x1] = { + [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_P2P_GO_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_24_2x2] = { + [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_P2P_GO_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_5_1x1] = { + [PM_STA_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_SAP_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_5_2x2] = { + [PM_STA_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_SAP_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_24_1x1] = { + [PM_STA_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_24_2x2] = { + [PM_STA_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_5_1x1] = { + [PM_STA_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_5_2x2] = { + [PM_STA_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_24_1x1] = { + [PM_STA_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_24_2x2] = { + [PM_STA_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_5_1x1] = { + [PM_STA_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_5_2x2] = { + [PM_STA_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_IBSS_24_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_IBSS_24_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_IBSS_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_IBSS_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, +}; + +/** + * third_connection_pcl_nodbs_table - table which provides PCL + * for the 3rd connection, when we have two connections already + * in the system (with DBS not supported by HW) + */ +static const enum policy_mgr_pcl_type +third_connection_pcl_nodbs_table[PM_MAX_TWO_CONNECTION_MODE] + [PM_MAX_NUM_OF_MODE][PM_MAX_CONC_PRIORITY_MODE] = { + [PM_STA_SAP_SCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_SCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_MCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_SAP_MODE] = {PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_MCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_SAP_MODE] = {PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_SCC_5_1x1] = { + [PM_STA_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_SCC_5_2x2] = { + [PM_STA_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_MCC_5_1x1] = { + [PM_STA_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_SAP_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_MCC_5_2x2] = { + [PM_STA_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_SAP_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_MCC_24_5_1x1] = { + [PM_STA_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_SAP_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_MCC_24_5_2x2] = { + [PM_STA_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_SAP_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_SAP_DBS_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_SCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_SCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_MCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_GO_MODE] = { + PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_MCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_GO_MODE] = { + PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_SCC_5_1x1] = { + [PM_STA_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_SCC_5_2x2] = { + [PM_STA_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_MCC_5_1x1] = { + [PM_STA_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_MCC_5_2x2] = { + [PM_STA_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_MCC_24_5_1x1] = { + [PM_STA_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_MCC_24_5_2x2] = { + [PM_STA_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_GO_DBS_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_SCC_24_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_SCC_24_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_MCC_24_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_MCC_24_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_SCC_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_SCC_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_MCC_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_MCC_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_MCC_24_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_MCC_24_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_STA_P2P_CLI_DBS_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_SCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_SCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_MCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_SAP_MODE] = {PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_GO_MODE] = { + PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_MCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_SAP_MODE] = {PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_GO_MODE] = { + PM_5G_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_SCC_5_1x1] = { + [PM_STA_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_SCC_5_2x2] = { + [PM_STA_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_SAP_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_MCC_5_1x1] = { + [PM_STA_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_SAP_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_MCC_5_2x2] = { + [PM_STA_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_SAP_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_MCC_24_5_1x1] = { + [PM_STA_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_SAP_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_MCC_24_5_2x2] = { + [PM_STA_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_SAP_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_P2P_GO_MODE] = {PM_MCC_CH, PM_MCC_CH, PM_MCC_CH}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_P2P_CLI_DBS_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_SCC_24_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_SCC_24_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_MCC_24_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_MCC_24_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_SCC_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_SCC_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_MCC_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_MCC_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_MCC_24_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_MCC_24_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_GO_SAP_DBS_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + + [PM_P2P_CLI_SAP_SCC_24_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_SCC_24_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_MCC_24_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_MCC_24_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_SCC_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_SCC_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_MCC_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_MCC_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_MCC_24_5_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_MCC_24_5_2x2] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_P2P_CLI_SAP_DBS_1x1] = { + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + +}; + +#endif From 60958fd69a6ae194b7b7940234d1b14d380f5c7a Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Fri, 3 Mar 2017 11:04:29 -0800 Subject: [PATCH 002/187] qcacmn: initialization of policy manager component Initialization related function definitions for policy manager component. Change-Id: I60122bac847c1cfbe8dba6aea8bbeb6391cf500b CRs-Fixed: 2009818 --- src/wlan_policy_mgr_i.h | 18 ++++ src/wlan_policy_mgr_init_deinit.c | 160 ++++++++++++++++++++++++++++-- 2 files changed, 169 insertions(+), 9 deletions(-) diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 272e8ca67c95..2a0252bc05fd 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -189,6 +189,24 @@ ((MAX_NUMBER_OF_CONC_CONNECTIONS > index) && \ (pm_conc_connection_list[index].in_use)) +extern struct policy_mgr_conc_connection_info + pm_conc_connection_list[MAX_NUMBER_OF_CONC_CONNECTIONS]; + +extern const enum policy_mgr_pcl_type + first_connection_pcl_table[PM_MAX_NUM_OF_MODE] + [PM_MAX_CONC_PRIORITY_MODE]; +extern pm_dbs_pcl_second_connection_table_type + *second_connection_pcl_dbs_table; +extern pm_dbs_pcl_third_connection_table_type + *third_connection_pcl_dbs_table; +extern policy_mgr_next_action_two_connection_table_type + *next_action_two_connection_table; +extern policy_mgr_next_action_three_connection_table_type + *next_action_three_connection_table; +extern enum policy_mgr_conc_next_action + (*policy_mgr_get_current_pref_hw_mode_ptr) + (struct wlan_objmgr_psoc *psoc); + /** * struct policy_mgr_psoc_priv_obj - Policy manager private data * @psoc: pointer to PSOC object information diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 862e12a462f3..a7e10cb4aeef 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -45,12 +45,36 @@ static QDF_STATUS policy_mgr_psoc_obj_create_cb(struct wlan_objmgr_psoc *psoc, void *data) { + struct policy_mgr_psoc_priv_obj *policy_mgr_ctx; + + policy_mgr_ctx = qdf_mem_malloc( + sizeof(struct policy_mgr_psoc_priv_obj)); + if (!policy_mgr_ctx) { + policy_mgr_err("memory allocation failed"); + return QDF_STATUS_E_FAILURE; + } + + policy_mgr_ctx->psoc = psoc; + + wlan_objmgr_psoc_component_obj_attach(psoc, + WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_ctx, + QDF_STATUS_SUCCESS); + return QDF_STATUS_SUCCESS; } -static QDF_STATUS policy_mgr_psoc_obj_delete_cb(struct wlan_objmgr_psoc *psoc, +static QDF_STATUS policy_mgr_psoc_obj_destroy_cb(struct wlan_objmgr_psoc *psoc, void *data) { + struct policy_mgr_psoc_priv_obj *policy_mgr_ctx; + + policy_mgr_ctx = policy_mgr_get_context(psoc); + wlan_objmgr_psoc_component_obj_detach(psoc, + WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_ctx); + qdf_mem_free(policy_mgr_ctx); + return QDF_STATUS_SUCCESS; } @@ -66,7 +90,7 @@ static QDF_STATUS policy_mgr_vdev_obj_create_cb(struct wlan_objmgr_vdev *vdev, return QDF_STATUS_SUCCESS; } -static QDF_STATUS policy_mgr_vdev_obj_delete_cb(struct wlan_objmgr_vdev *vdev, +static QDF_STATUS policy_mgr_vdev_obj_destroy_cb(struct wlan_objmgr_vdev *vdev, void *data) { return QDF_STATUS_SUCCESS; @@ -92,7 +116,7 @@ QDF_STATUS policy_mgr_init(void) status = wlan_objmgr_register_psoc_destroy_handler( WLAN_UMAC_COMP_POLICY_MGR, - policy_mgr_psoc_obj_delete_cb, + policy_mgr_psoc_obj_destroy_cb, NULL); if (status != QDF_STATUS_SUCCESS) { policy_mgr_err("Failed to register psoc obj delete cback"); @@ -119,7 +143,7 @@ QDF_STATUS policy_mgr_init(void) status = wlan_objmgr_register_vdev_destroy_handler( WLAN_UMAC_COMP_POLICY_MGR, - policy_mgr_vdev_obj_delete_cb, + policy_mgr_vdev_obj_destroy_cb, NULL); if (status != QDF_STATUS_SUCCESS) { policy_mgr_err("Failed to register vdev obj delete cback"); @@ -141,7 +165,7 @@ QDF_STATUS policy_mgr_init(void) err_vdev_status: wlan_objmgr_unregister_vdev_destroy_handler(WLAN_UMAC_COMP_POLICY_MGR, - policy_mgr_vdev_obj_delete_cb, NULL); + policy_mgr_vdev_obj_destroy_cb, NULL); err_vdev_delete: wlan_objmgr_unregister_vdev_create_handler(WLAN_UMAC_COMP_POLICY_MGR, policy_mgr_vdev_obj_create_cb, NULL); @@ -150,7 +174,7 @@ err_vdev_create: policy_mgr_psoc_obj_status_cb, NULL); err_psoc_status: wlan_objmgr_unregister_psoc_destroy_handler(WLAN_UMAC_COMP_POLICY_MGR, - policy_mgr_psoc_obj_delete_cb, NULL); + policy_mgr_psoc_obj_destroy_cb, NULL); err_psoc_delete: wlan_objmgr_unregister_psoc_create_handler(WLAN_UMAC_COMP_POLICY_MGR, policy_mgr_psoc_obj_create_cb, NULL); @@ -171,7 +195,7 @@ QDF_STATUS policy_mgr_deinit(void) status = wlan_objmgr_unregister_psoc_destroy_handler( WLAN_UMAC_COMP_POLICY_MGR, - policy_mgr_psoc_obj_delete_cb, + policy_mgr_psoc_obj_destroy_cb, NULL); if (status != QDF_STATUS_SUCCESS) policy_mgr_err("Failed to deregister psoc obj delete cback"); @@ -192,7 +216,7 @@ QDF_STATUS policy_mgr_deinit(void) status = wlan_objmgr_unregister_vdev_destroy_handler( WLAN_UMAC_COMP_POLICY_MGR, - policy_mgr_vdev_obj_delete_cb, + policy_mgr_vdev_obj_destroy_cb, NULL); if (status != QDF_STATUS_SUCCESS) policy_mgr_err("Failed to deregister vdev obj delete cback"); @@ -223,12 +247,130 @@ QDF_STATUS policy_mgr_psoc_close(struct wlan_objmgr_psoc *psoc) QDF_STATUS policy_mgr_psoc_enable(struct wlan_objmgr_psoc *psoc) { + QDF_STATUS status; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + policy_mgr_debug("Initializing the policy manager"); + + /* init pm_conc_connection_list */ + qdf_mem_zero(pm_conc_connection_list, sizeof(pm_conc_connection_list)); + + /* init dbs_opportunistic_timer */ + status = qdf_mc_timer_init(&pm_ctx->dbs_opportunistic_timer, + QDF_TIMER_TYPE_SW, + pm_dbs_opportunistic_timer_handler, + (void *)psoc); + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("Failed to init DBS opportunistic timer"); + return status; + } + + /* init connection_update_done_evt */ + status = policy_mgr_init_connection_update(pm_ctx); + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("connection_update_done_evt init failed"); + return status; + } + + pm_ctx->do_hw_mode_change = false; + + /* reset sap mandatory channels */ + status = policy_mgr_reset_sap_mandatory_channels(pm_ctx); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("failed to reset mandatory channels"); + return status; + } + + /* init PCL table & function pointers based on HW capability */ + if (policy_mgr_is_hw_dbs_2x2_capable(psoc)) + policy_mgr_get_current_pref_hw_mode_ptr = + policy_mgr_get_current_pref_hw_mode_dbs_2x2; + else + policy_mgr_get_current_pref_hw_mode_ptr = + policy_mgr_get_current_pref_hw_mode_dbs_1x1; + + if (policy_mgr_is_hw_dbs_2x2_capable(psoc)) + second_connection_pcl_dbs_table = + &pm_second_connection_pcl_dbs_2x2_table; + else + second_connection_pcl_dbs_table = + &pm_second_connection_pcl_dbs_1x1_table; + + if (policy_mgr_is_hw_dbs_2x2_capable(psoc)) + third_connection_pcl_dbs_table = + &pm_third_connection_pcl_dbs_2x2_table; + else + third_connection_pcl_dbs_table = + &pm_third_connection_pcl_dbs_1x1_table; + + if (policy_mgr_is_hw_dbs_2x2_capable(psoc)) + next_action_two_connection_table = + &pm_next_action_two_connection_dbs_2x2_table; + else + next_action_two_connection_table = + &pm_next_action_two_connection_dbs_1x1_table; + + if (policy_mgr_is_hw_dbs_2x2_capable(psoc)) + next_action_three_connection_table = + &pm_next_action_three_connection_dbs_2x2_table; + else + next_action_three_connection_table = + &pm_next_action_three_connection_dbs_1x1_table; + return QDF_STATUS_SUCCESS; } QDF_STATUS policy_mgr_psoc_disable(struct wlan_objmgr_psoc *psoc) { - return QDF_STATUS_SUCCESS; + QDF_STATUS status = QDF_STATUS_SUCCESS; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + /* destroy connection_update_done_evt */ + if (!QDF_IS_STATUS_SUCCESS(qdf_event_destroy + (&pm_ctx->connection_update_done_evt))) { + policy_mgr_err("Failed to destroy connection_update_done_evt"); + status = QDF_STATUS_E_FAILURE; + QDF_ASSERT(0); + } + + /* deallocate dbs_opportunistic_timer */ + if (QDF_TIMER_STATE_RUNNING == + qdf_mc_timer_get_current_state( + &pm_ctx->dbs_opportunistic_timer)) { + qdf_mc_timer_stop(&pm_ctx->dbs_opportunistic_timer); + } + + if (!QDF_IS_STATUS_SUCCESS(qdf_mc_timer_destroy( + &pm_ctx->dbs_opportunistic_timer))) { + policy_mgr_err("Cannot deallocate dbs opportunistic timer"); + status = QDF_STATUS_E_FAILURE; + QDF_ASSERT(0); + } + + /* reset sap mandatory channels */ + if (QDF_IS_STATUS_ERROR( + policy_mgr_reset_sap_mandatory_channels(pm_ctx))) { + policy_mgr_err("failed to reset sap mandatory channels"); + status = QDF_STATUS_E_FAILURE; + QDF_ASSERT(0); + } + + /* deinit pm_conc_connection_list */ + qdf_mem_zero(pm_conc_connection_list, sizeof(pm_conc_connection_list)); + + return status; } QDF_STATUS policy_mgr_register_sme_cb(struct wlan_objmgr_psoc *psoc, From e9c1e42ffa0e5c96451dcd4b4e648848b9e0b2ab Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Mon, 13 Mar 2017 10:27:10 -0700 Subject: [PATCH 003/187] qcacmn: Avoid new connection while HW mode change is issued In the case of concurrency, when the session decrements, the opportunistic timer is started. After a while, when the opportunistic time is expired, and the hw mode change for SMM is issued, and the same time new interface comes up, then the new connection forms MCC with the existing connection instead of forming DBS. The change is to avoid the race condition to form MCC instead of DBS. Change-Id: I33ad8a76bdca2f17b09c0d2f072b46cba8d376f8 CRs-Fixed: 2009818 --- inc/wlan_policy_mgr_api.h | 39 +++++++++++++++++++++++++++++ inc/wlan_policy_mgr_public_struct.h | 18 +++++++++++++ src/wlan_policy_mgr_action.c | 17 +++++++++++++ src/wlan_policy_mgr_i.h | 3 +++ 4 files changed, 77 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index bb00b936ed38..6c252331efbf 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1609,4 +1609,43 @@ bool policy_mgr_get_dbs_plus_agile_scan_config(struct wlan_objmgr_psoc *psoc); */ bool policy_mgr_get_single_mac_scan_with_dfs_config( struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_set_hw_mode_change_in_progress() - Set value + * corresponding to policy_mgr_hw_mode_change that indicate if + * HW mode change is in progress + * @psoc: PSOC object information + * @value: Indicate if hw mode change is in progress + * + * Set the value corresponding to policy_mgr_hw_mode_change that + * indicated if hw mode change is in progress. + * + * Return: None + */ +void policy_mgr_set_hw_mode_change_in_progress( + struct wlan_objmgr_psoc *psoc, enum policy_mgr_hw_mode_change value); + +/** + * policy_mgr_is_hw_mode_change_in_progress() - Check if HW mode + * change is in progress. + * @psoc: PSOC object information + * + * Returns the corresponding policy_mgr_hw_mode_change value. + * + * Return: policy_mgr_hw_mode_change value. + */ +enum policy_mgr_hw_mode_change policy_mgr_is_hw_mode_change_in_progress( + struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_get_hw_mode_change_from_hw_mode_index() - Get + * matching HW mode from index + * @psoc: PSOC object information + * @hw_mode_index: HW mode index + * Returns the corresponding policy_mgr_hw_mode_change HW mode. + * + * Return: policy_mgr_hw_mode_change value. + */ +enum policy_mgr_hw_mode_change policy_mgr_get_hw_mode_change_from_hw_mode_index( + struct wlan_objmgr_psoc *psoc, uint32_t hw_mode_index); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 15abfb4e3e6f..46781b545bd1 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -749,6 +749,24 @@ enum set_hw_mode_status { SET_HW_MODE_STATUS_ECOEX, }; +/** + * enum policy_mgr_hw_mode_change - identify the HW mode switching to. + * + * @POLICY_MGR_HW_MODE_NOT_IN_PROGRESS: HW mode change not in progress + * @POLICY_MGR_SMM_IN_PROGRESS: switching to SMM mode + * @POLICY_MGR_DBS_IN_PROGRESS: switching to DBS mode + * @POLICY_MGR_SBS_IN_PROGRESS: switching to SBS mode + * + * These are generic IDs that identify the various roles + * in the software system + */ +enum policy_mgr_hw_mode_change { + POLICY_MGR_HW_MODE_NOT_IN_PROGRESS = 0, + POLICY_MGR_SMM_IN_PROGRESS, + POLICY_MGR_DBS_IN_PROGRESS, + POLICY_MGR_SBS_IN_PROGRESS +}; + /** * struct policy_mgr_conc_connection_info - information of all existing * connections in the wlan system diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 3673a01b101c..41f994c0d241 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -177,6 +177,23 @@ void policy_mgr_checkn_update_hw_mode_single_mac_mode( { } +void policy_mgr_set_hw_mode_change_in_progress( + struct wlan_objmgr_psoc *psoc, enum policy_mgr_hw_mode_change value) +{ +} + +enum policy_mgr_hw_mode_change policy_mgr_is_hw_mode_change_in_progress( + struct wlan_objmgr_psoc *psoc) +{ + return POLICY_MGR_HW_MODE_NOT_IN_PROGRESS; +} + +enum policy_mgr_hw_mode_change policy_mgr_get_hw_mode_change_from_hw_mode_index( + struct wlan_objmgr_psoc *psoc, uint32_t hw_mode_index) +{ + return POLICY_MGR_HW_MODE_NOT_IN_PROGRESS; +} + #ifdef MPC_UT_FRAMEWORK QDF_STATUS policy_mgr_update_connection_info_utfw( struct wlan_objmgr_psoc *psoc, diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 2a0252bc05fd..333ef1eb6bf6 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -252,6 +252,8 @@ extern enum policy_mgr_conc_next_action * config * @dual_mac_cfg: DBS configuration currenctly used by FW for * scan & connections + * @hw_mode_change_in_progress: This is to track if HW mode + * change is in progress */ struct policy_mgr_psoc_priv_obj { struct wlan_objmgr_psoc *psoc; @@ -279,6 +281,7 @@ struct policy_mgr_psoc_priv_obj { uint8_t gMaxConcurrentActiveSessions; uint8_t conc_system_pref; struct dual_mac_config dual_mac_cfg; + uint32_t hw_mode_change_in_progress; }; struct policy_mgr_psoc_priv_obj *policy_mgr_get_context( From 86af550319c3cb5196c65026393ba73256410abe Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Mon, 13 Mar 2017 14:04:17 -0700 Subject: [PATCH 004/187] qcacmn: Rename utility function in policy manager component Rename utility function is_scan_simultaneous_capable in policy manager component from wma. Change-Id: I8f9ad162c491dca7b32290fd224fce40d192fd23 CRs-Fixed: 2009818 --- inc/wlan_policy_mgr_api.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 6c252331efbf..c3f5dd4d1a21 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1648,4 +1648,22 @@ enum policy_mgr_hw_mode_change policy_mgr_is_hw_mode_change_in_progress( */ enum policy_mgr_hw_mode_change policy_mgr_get_hw_mode_change_from_hw_mode_index( struct wlan_objmgr_psoc *psoc, uint32_t hw_mode_index); + +/** + * policy_mgr_is_scan_simultaneous_capable() - Check if scan + * parallelization is supported or not + * @psoc: PSOC object information + * currently scan parallelization feature support is dependent on DBS but + * it can be independent in future. + * + * Return: True if master DBS control is enabled + */ +static inline bool policy_mgr_is_scan_simultaneous_capable( + struct wlan_objmgr_psoc *psoc) +{ + if (policy_mgr_is_hw_dbs_capable(psoc)) + return true; + + return false; +} #endif /* __WLAN_POLICY_MGR_API_H */ From 3e06abdcab120bd182fbc89b858ea54946d98a5a Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Tue, 14 Mar 2017 10:20:30 -0700 Subject: [PATCH 005/187] qcacmn: Map regulatory macros to legacy regulatory Map regulatory macros used by policy manager to legacy APIs. Change-Id: Ib1ab408094a02648ba9796619ab14d5800db1217 CRs-Fixed: 2009818 --- src/wlan_policy_mgr_i.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 333ef1eb6bf6..d9b3873d9ced 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -33,6 +33,31 @@ #include "qdf_mc_timer.h" #include "qdf_lock.h" #include "qdf_defer.h" +#include + +enum cds_band_type { + CDS_BAND_ALL = 0, + CDS_BAND_2GHZ = 1, + CDS_BAND_5GHZ = 2 +}; +extern uint32_t cds_chan_to_freq(uint8_t chan); +extern uint8_t cds_freq_to_chan(uint32_t freq); +extern enum cds_band_type cds_chan_to_band(uint32_t chan); + +#define WLAN_REG_IS_24GHZ_CH(ch) CDS_IS_CHANNEL_24GHZ(ch) +#define WLAN_REG_IS_5GHZ_CH(ch) CDS_IS_CHANNEL_5GHZ(ch) +#define WLAN_REG_IS_SAME_BAND_CHANNELS(ch1, ch2) \ + CDS_IS_SAME_BAND_CHANNELS(ch1, ch2) +#define WLAN_REG_IS_CHANNEL_VALID_5G_SBS(curchan, newchan) \ + CDS_IS_CHANNEL_VALID_5G_SBS(curchan, newchan) +#define wlan_reg_is_dfs_ch(psoc, ch) CDS_IS_DFS_CH(ch) +#define WLAN_REG_MAX_24GHZ_CH_NUM CDS_MAX_24GHZ_CHANNEL_NUMBER +#define reg_chan_to_freq(chan_num) cds_chan_to_freq(chan_num) +#define reg_freq_to_chan(freq) cds_freq_to_chan(freq) +#define reg_chan_to_band(chan_num) cds_chan_to_band(chan_num) +#define BAND_2G CDS_BAND_2GHZ +#define BAND_5G CDS_BAND_5GHZ +#define BAND_ALL CDS_BAND_ALL #define MAX_NUMBER_OF_CONC_CONNECTIONS 3 #define DBS_OPPORTUNISTIC_TIME 10 From 181378a7509c7ed534c2dcdd17688f3975aa83c8 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Tue, 7 Mar 2017 15:57:59 -0800 Subject: [PATCH 006/187] qcacmn: Preferred Channel List derivation logic Define Preferred Channel List (PCL) derivation functions. Change-Id: Ic3c64043c723c8d309be1a1d0abf7574d60d2184 CRs-Fixed: 2009818 --- src/wlan_policy_mgr_pcl.c | 1210 ++++++++++++++++++++++++++++++++++++- 1 file changed, 1204 insertions(+), 6 deletions(-) diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 62cd7b380a28..f85fc0c618f2 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -41,6 +41,7 @@ #include "qdf_trace.h" #include "wlan_objmgr_global_obj.h" +#define PM_24_GHZ_CHANNEL_6 (6) /** * first_connection_pcl_table - table which provides PCL for the * very first connection in the system @@ -69,13 +70,67 @@ QDF_STATUS policy_mgr_get_pcl_for_existing_conn(struct wlan_objmgr_psoc *psoc, uint8_t *pcl_ch, uint32_t *len, uint8_t *pcl_weight, uint32_t weight_len) { - return QDF_STATUS_SUCCESS; + struct policy_mgr_conc_connection_info info; + + QDF_STATUS status = QDF_STATUS_SUCCESS; + + policy_mgr_notice("get pcl for existing conn:%d", mode); + + if (policy_mgr_mode_specific_connection_count(psoc, mode, NULL) > 0) { + /* Check, store and temp delete the mode's parameter */ + policy_mgr_store_and_del_conn_info(psoc, mode, &info); + /* Get the PCL */ + status = policy_mgr_get_pcl(psoc, mode, pcl_ch, len, + pcl_weight, weight_len); + policy_mgr_notice("Get PCL to FW for mode:%d", mode); + /* Restore the connection info */ + policy_mgr_restore_deleted_conn_info(psoc, &info); + } + + return status; } void policy_mgr_decr_session_set_pcl(struct wlan_objmgr_psoc *psoc, enum tQDF_ADAPTER_MODE mode, uint8_t session_id) { + QDF_STATUS qdf_status; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + policy_mgr_decr_active_session(psoc, mode, session_id); + /* + * After the removal of this connection, we need to check if + * a STA connection still exists. The reason for this is that + * if one or more STA exists, we need to provide the updated + * PCL to the FW for cases like LFR. + * + * Since policy_mgr_get_pcl provides PCL list based on the new + * connection that is going to come up, we will find the + * existing STA entry, save it and delete it temporarily. + * After this we will get PCL as though as new STA connection + * is coming up. This will give the exact PCL that needs to be + * given to the FW. After setting the PCL, we need to restore + * the entry that we have saved before. + */ + policy_mgr_set_pcl_for_existing_combo(psoc, PM_STA_MODE); + /* do we need to change the HW mode */ + if (policy_mgr_need_opportunistic_upgrade(psoc)) { + /* let's start the timer */ + qdf_mc_timer_stop(&pm_ctx->dbs_opportunistic_timer); + qdf_status = qdf_mc_timer_start( + &pm_ctx->dbs_opportunistic_timer, + DBS_OPPORTUNISTIC_TIME * 1000); + if (!QDF_IS_STATUS_SUCCESS(qdf_status)) + policy_mgr_err("Failed to start dbs opportunistic timer"); + } + + return; } void policy_mgr_update_with_safe_channel_list(uint8_t *pcl_channels, @@ -87,6 +142,34 @@ void policy_mgr_update_with_safe_channel_list(uint8_t *pcl_channels, uint8_t policy_mgr_get_channel(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, uint32_t *vdev_id) { + uint32_t idx = 0; + uint8_t chan; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return 0; + } + + if (mode >= PM_MAX_NUM_OF_MODE) { + policy_mgr_err("incorrect mode"); + return 0; + } + + for (idx = 0; idx < MAX_NUMBER_OF_CONC_CONNECTIONS; idx++) { + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + if ((pm_conc_connection_list[idx].mode == mode) && + (!vdev_id || (*vdev_id == + pm_conc_connection_list[idx].vdev_id)) + && pm_conc_connection_list[idx].in_use) { + chan = pm_conc_connection_list[idx].chan; + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + return chan; + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + } + return 0; } @@ -95,6 +178,121 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, uint8_t *pcl_channels, uint32_t *len, uint8_t *pcl_weight, uint32_t weight_len) { + QDF_STATUS status = QDF_STATUS_E_FAILURE; + uint32_t num_connections = 0, i; + enum policy_mgr_conc_priority_mode first_index = 0; + enum policy_mgr_one_connection_mode second_index = 0; + enum policy_mgr_two_connection_mode third_index = 0; + enum policy_mgr_pcl_type pcl = PM_NONE; + enum policy_mgr_conc_priority_mode conc_system_pref = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("context is NULL"); + return status; + } + + /* find the current connection state from pm_conc_connection_list*/ + num_connections = policy_mgr_get_connection_count(psoc); + policy_mgr_debug("connections:%d pref:%d requested mode:%d", + num_connections, pm_ctx->conc_system_pref, mode); + + switch (pm_ctx->conc_system_pref) { + case 0: + conc_system_pref = PM_THROUGHPUT; + break; + case 1: + conc_system_pref = PM_POWERSAVE; + break; + case 2: + conc_system_pref = PM_LATENCY; + break; + default: + policy_mgr_err("unknown conc_system_pref value %d", + pm_ctx->conc_system_pref); + break; + } + + switch (num_connections) { + case 0: + first_index = + policy_mgr_get_first_connection_pcl_table_index(psoc); + pcl = first_connection_pcl_table[mode][first_index]; + break; + case 1: + second_index = + policy_mgr_get_second_connection_pcl_table_index(psoc); + if (PM_MAX_ONE_CONNECTION_MODE == second_index) { + policy_mgr_err("couldn't find index for 2nd connection pcl table"); + return status; + } + if (policy_mgr_is_hw_dbs_capable(psoc) == true) { + pcl = (*second_connection_pcl_dbs_table) + [second_index][mode][conc_system_pref]; + } else { + pcl = second_connection_pcl_nodbs_table + [second_index][mode][conc_system_pref]; + } + + break; + case 2: + third_index = + policy_mgr_get_third_connection_pcl_table_index(psoc); + if (PM_MAX_TWO_CONNECTION_MODE == third_index) { + policy_mgr_err( + "couldn't find index for 3rd connection pcl table"); + return status; + } + if (policy_mgr_is_hw_dbs_capable(psoc) == true) { + pcl = (*third_connection_pcl_dbs_table) + [third_index][mode][conc_system_pref]; + } else { + pcl = third_connection_pcl_nodbs_table + [third_index][mode][conc_system_pref]; + } + break; + default: + policy_mgr_err("unexpected num_connections value %d", + num_connections); + break; + } + + policy_mgr_debug("index1:%d index2:%d index3:%d pcl:%d dbs:%d", + first_index, second_index, third_index, + pcl, policy_mgr_is_hw_dbs_capable(psoc)); + + /* once the PCL enum is obtained find out the exact channel list with + * help from sme_get_cfg_valid_channels + */ + status = policy_mgr_get_channel_list(psoc, pcl, pcl_channels, len, mode, + pcl_weight, weight_len); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("failed to get channel list:%d", status); + return status; + } + + policy_mgr_debug("pcl len:%d", *len); + for (i = 0; i < *len; i++) { + policy_mgr_debug("chan:%d weight:%d", + pcl_channels[i], pcl_weight[i]); + } + + if ((mode == PM_SAP_MODE) && + policy_mgr_is_sap_mandatory_channel_set(psoc)) { + status = policy_mgr_modify_sap_pcl_based_on_mandatory_channel( + psoc, pcl_channels, pcl_weight, len); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("failed to get modified pcl for SAP"); + return status; + } + policy_mgr_debug("modified pcl len:%d", *len); + for (i = 0; i < *len; i++) + policy_mgr_debug("chan:%d weight:%d", + pcl_channels[i], pcl_weight[i]); + + } + return QDF_STATUS_SUCCESS; } @@ -102,21 +300,763 @@ enum policy_mgr_conc_priority_mode policy_mgr_get_first_connection_pcl_table_index( struct wlan_objmgr_psoc *psoc) { - return PM_MAX_CONC_PRIORITY_MODE; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("context is NULL"); + return PM_THROUGHPUT; + } + + if (pm_ctx->conc_system_pref >= PM_MAX_CONC_PRIORITY_MODE) + return PM_THROUGHPUT; + + return pm_ctx->conc_system_pref; } enum policy_mgr_one_connection_mode policy_mgr_get_second_connection_pcl_table_index( struct wlan_objmgr_psoc *psoc) { - return PM_MAX_ONE_CONNECTION_MODE; + enum policy_mgr_one_connection_mode index = PM_MAX_ONE_CONNECTION_MODE; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return index; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + if (PM_STA_MODE == pm_conc_connection_list[0].mode) { + if (WLAN_REG_IS_24GHZ_CH(pm_conc_connection_list[0].chan)) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_24_1x1; + else + index = PM_STA_24_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_5_1x1; + else + index = PM_STA_5_2x2; + } + } else if (PM_SAP_MODE == pm_conc_connection_list[0].mode) { + if (WLAN_REG_IS_24GHZ_CH(pm_conc_connection_list[0].chan)) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_SAP_24_1x1; + else + index = PM_SAP_24_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_SAP_5_1x1; + else + index = PM_SAP_5_2x2; + } + } else if (PM_P2P_CLIENT_MODE == pm_conc_connection_list[0].mode) { + if (WLAN_REG_IS_24GHZ_CH(pm_conc_connection_list[0].chan)) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_CLI_24_1x1; + else + index = PM_P2P_CLI_24_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_CLI_5_1x1; + else + index = PM_P2P_CLI_5_2x2; + } + } else if (PM_P2P_GO_MODE == pm_conc_connection_list[0].mode) { + if (WLAN_REG_IS_24GHZ_CH(pm_conc_connection_list[0].chan)) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_GO_24_1x1; + else + index = PM_P2P_GO_24_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_GO_5_1x1; + else + index = PM_P2P_GO_5_2x2; + } + } else if (PM_IBSS_MODE == pm_conc_connection_list[0].mode) { + if (WLAN_REG_IS_24GHZ_CH(pm_conc_connection_list[0].chan)) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_IBSS_24_1x1; + else + index = PM_IBSS_24_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_IBSS_5_1x1; + else + index = PM_IBSS_5_2x2; + } + } + + policy_mgr_debug("mode:%d chan:%d chain:%d index:%d", + pm_conc_connection_list[0].mode, + pm_conc_connection_list[0].chan, + pm_conc_connection_list[0].chain_mask, index); + + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return index; +} + +static enum policy_mgr_two_connection_mode + policy_mgr_get_third_connection_pcl_table_index_cli_sap(void) +{ + enum policy_mgr_two_connection_mode index = PM_MAX_TWO_CONNECTION_MODE; + /* SCC */ + if (pm_conc_connection_list[0].chan == + pm_conc_connection_list[1].chan) { + if (WLAN_REG_IS_24GHZ_CH( + pm_conc_connection_list[0].chan)) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_CLI_SAP_SCC_24_1x1; + else + index = PM_P2P_CLI_SAP_SCC_24_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_CLI_SAP_SCC_5_1x1; + else + index = PM_P2P_CLI_SAP_SCC_5_2x2; + } + /* MCC */ + } else if (pm_conc_connection_list[0].mac == + pm_conc_connection_list[1].mac) { + if ((WLAN_REG_IS_24GHZ_CH + (pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_24GHZ_CH + (pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_CLI_SAP_MCC_24_1x1; + else + index = PM_P2P_CLI_SAP_MCC_24_2x2; + } else if ((WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_CLI_SAP_MCC_5_1x1; + else + index = PM_P2P_CLI_SAP_MCC_5_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_CLI_SAP_MCC_24_5_1x1; + else + index = PM_P2P_CLI_SAP_MCC_24_5_2x2; + } + /* SBS */ + } else if (pm_conc_connection_list[0].mac != + pm_conc_connection_list[1].mac) { + if ((WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_CLI_SAP_SBS_5_1x1; + } + /* DBS */ + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_CLI_SAP_DBS_1x1; + else + index = PM_P2P_CLI_SAP_DBS_2x2; + } + + return index; +} + +static enum policy_mgr_two_connection_mode + policy_mgr_get_third_connection_pcl_table_index_sta_sap(void) +{ + enum policy_mgr_two_connection_mode index = PM_MAX_TWO_CONNECTION_MODE; + /* SCC */ + if (pm_conc_connection_list[0].chan == + pm_conc_connection_list[1].chan) { + if (WLAN_REG_IS_24GHZ_CH( + pm_conc_connection_list[0].chan)) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_SAP_SCC_24_1x1; + else + index = PM_STA_SAP_SCC_24_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_SAP_SCC_5_1x1; + else + index = PM_STA_SAP_SCC_5_2x2; + } + /* MCC */ + } else if (pm_conc_connection_list[0].mac == + pm_conc_connection_list[1].mac) { + if ((WLAN_REG_IS_24GHZ_CH + (pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_24GHZ_CH + (pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_SAP_MCC_24_1x1; + else + index = PM_STA_SAP_MCC_24_2x2; + } else if ((WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_SAP_MCC_5_1x1; + else + index = PM_STA_SAP_MCC_5_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_SAP_MCC_24_5_1x1; + else + index = PM_STA_SAP_MCC_24_5_2x2; + } + /* SBS */ + } else if (pm_conc_connection_list[0].mac != + pm_conc_connection_list[1].mac) { + if ((WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_SAP_SBS_5_1x1; + } + /* DBS */ + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_SAP_DBS_1x1; + else + index = PM_STA_SAP_DBS_2x2; + } + + return index; +} + +static enum policy_mgr_two_connection_mode + policy_mgr_get_third_connection_pcl_table_index_sap_sap(void) +{ + enum policy_mgr_two_connection_mode index = PM_MAX_TWO_CONNECTION_MODE; + /* SCC */ + if (pm_conc_connection_list[0].chan == + pm_conc_connection_list[1].chan) { + if (WLAN_REG_IS_24GHZ_CH( + pm_conc_connection_list[0].chan)) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_SAP_SAP_SCC_24_1x1; + else + index = PM_SAP_SAP_SCC_24_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_SAP_SAP_SCC_5_1x1; + else + index = PM_SAP_SAP_SCC_5_2x2; + } + /* MCC */ + } else if (pm_conc_connection_list[0].mac == + pm_conc_connection_list[1].mac) { + if ((WLAN_REG_IS_24GHZ_CH + (pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_24GHZ_CH + (pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_SAP_SAP_MCC_24_1x1; + else + index = PM_SAP_SAP_MCC_24_2x2; + } else if ((WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_SAP_SAP_MCC_5_1x1; + else + index = PM_SAP_SAP_MCC_5_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_SAP_SAP_MCC_24_5_1x1; + else + index = PM_SAP_SAP_MCC_24_5_2x2; + } + /* SBS */ + } else if (pm_conc_connection_list[0].mac != + pm_conc_connection_list[1].mac) { + if ((WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_SAP_SAP_SBS_5_1x1; + } + /* DBS */ + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_SAP_SAP_DBS_1x1; + else + index = PM_SAP_SAP_DBS_2x2; + } + + return index; +} + +static enum policy_mgr_two_connection_mode + policy_mgr_get_third_connection_pcl_table_index_sta_go(void) +{ + enum policy_mgr_two_connection_mode index = PM_MAX_TWO_CONNECTION_MODE; + /* SCC */ + if (pm_conc_connection_list[0].chan == + pm_conc_connection_list[1].chan) { + if (WLAN_REG_IS_24GHZ_CH + (pm_conc_connection_list[0].chan)) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_P2P_GO_SCC_24_1x1; + else + index = PM_STA_P2P_GO_SCC_24_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_P2P_GO_SCC_5_1x1; + else + index = PM_STA_P2P_GO_SCC_5_2x2; + } + /* MCC */ + } else if (pm_conc_connection_list[0].mac == + pm_conc_connection_list[1].mac) { + if ((WLAN_REG_IS_24GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_24GHZ_CH + (pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_P2P_GO_MCC_24_1x1; + else + index = PM_STA_P2P_GO_MCC_24_2x2; + } else if ((WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_P2P_GO_MCC_5_1x1; + else + index = PM_STA_P2P_GO_MCC_5_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_P2P_GO_MCC_24_5_1x1; + else + index = PM_STA_P2P_GO_MCC_24_5_2x2; + } + /* SBS */ + } else if (pm_conc_connection_list[0].mac != + pm_conc_connection_list[1].mac) { + if ((WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_P2P_GO_SBS_5_1x1; + } + /* DBS */ + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_P2P_GO_DBS_1x1; + else + index = PM_STA_P2P_GO_DBS_2x2; + } + + return index; +} + +static enum policy_mgr_two_connection_mode + policy_mgr_get_third_connection_pcl_table_index_sta_cli(void) +{ + enum policy_mgr_two_connection_mode index = PM_MAX_TWO_CONNECTION_MODE; + /* SCC */ + if (pm_conc_connection_list[0].chan == + pm_conc_connection_list[1].chan) { + if (WLAN_REG_IS_24GHZ_CH + (pm_conc_connection_list[0].chan)) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_P2P_CLI_SCC_24_1x1; + else + index = PM_STA_P2P_CLI_SCC_24_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_P2P_CLI_SCC_5_1x1; + else + index = PM_STA_P2P_CLI_SCC_5_2x2; + } + /* MCC */ + } else if (pm_conc_connection_list[0].mac == + pm_conc_connection_list[1].mac) { + if ((WLAN_REG_IS_24GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_24GHZ_CH( + pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_P2P_CLI_MCC_24_1x1; + else + index = PM_STA_P2P_CLI_MCC_24_2x2; + } else if ((WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_P2P_CLI_MCC_5_1x1; + else + index = PM_STA_P2P_CLI_MCC_5_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_P2P_CLI_MCC_24_5_1x1; + else + index = PM_STA_P2P_CLI_MCC_24_5_2x2; + } + /* SBS */ + } else if (pm_conc_connection_list[0].mac != + pm_conc_connection_list[1].mac) { + if ((WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_P2P_CLI_SBS_5_1x1; + } + /* DBS */ + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_P2P_CLI_DBS_1x1; + else + index = PM_STA_P2P_CLI_DBS_2x2; + } + + return index; +} + +static enum policy_mgr_two_connection_mode + policy_mgr_get_third_connection_pcl_table_index_go_cli(void) +{ + enum policy_mgr_two_connection_mode index = PM_MAX_TWO_CONNECTION_MODE; + /* SCC */ + if (pm_conc_connection_list[0].chan == + pm_conc_connection_list[1].chan) { + if (WLAN_REG_IS_24GHZ_CH( + pm_conc_connection_list[0].chan)) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_GO_P2P_CLI_SCC_24_1x1; + else + index = PM_P2P_GO_P2P_CLI_SCC_24_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_GO_P2P_CLI_SCC_5_1x1; + else + index = PM_P2P_GO_P2P_CLI_SCC_5_2x2; + } + /* MCC */ + } else if (pm_conc_connection_list[0].mac == + pm_conc_connection_list[1].mac) { + if ((WLAN_REG_IS_24GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_24GHZ_CH( + pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_GO_P2P_CLI_MCC_24_1x1; + else + index = PM_P2P_GO_P2P_CLI_MCC_24_2x2; + } else if ((WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_GO_P2P_CLI_MCC_5_1x1; + else + index = PM_P2P_GO_P2P_CLI_MCC_5_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_GO_P2P_CLI_MCC_24_5_1x1; + else + index = PM_P2P_GO_P2P_CLI_MCC_24_5_2x2; + } + /* SBS */ + } else if (pm_conc_connection_list[0].mac != + pm_conc_connection_list[1].mac) { + if ((WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_GO_P2P_CLI_SBS_5_1x1; + } + /* DBS */ + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_GO_P2P_CLI_DBS_1x1; + else + index = PM_P2P_GO_P2P_CLI_DBS_2x2; + } + + return index; +} + +static enum policy_mgr_two_connection_mode + policy_mgr_get_third_connection_pcl_table_index_go_sap(void) +{ + enum policy_mgr_two_connection_mode index = PM_MAX_TWO_CONNECTION_MODE; + /* SCC */ + if (pm_conc_connection_list[0].chan == + pm_conc_connection_list[1].chan) { + if (WLAN_REG_IS_24GHZ_CH( + pm_conc_connection_list[0].chan)) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_GO_SAP_SCC_24_1x1; + else + index = PM_P2P_GO_SAP_SCC_24_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_GO_SAP_SCC_5_1x1; + else + index = PM_P2P_GO_SAP_SCC_5_2x2; + } + /* MCC */ + } else if (pm_conc_connection_list[0].mac == + pm_conc_connection_list[1].mac) { + if ((WLAN_REG_IS_24GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_24GHZ_CH( + pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_GO_SAP_MCC_24_1x1; + else + index = PM_P2P_GO_SAP_MCC_24_2x2; + } else if ((WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_GO_SAP_MCC_5_1x1; + else + index = PM_P2P_GO_SAP_MCC_5_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_GO_SAP_MCC_24_5_1x1; + else + index = PM_P2P_GO_SAP_MCC_24_5_2x2; + } + /* SBS */ + } else if (pm_conc_connection_list[0].mac != + pm_conc_connection_list[1].mac) { + if ((WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_GO_SAP_SBS_5_1x1; + } + /* DBS */ + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_GO_SAP_DBS_1x1; + else + index = PM_P2P_GO_SAP_DBS_2x2; + } + + return index; +} + +static enum policy_mgr_two_connection_mode + policy_mgr_get_third_connection_pcl_table_index_sta_sta(void) +{ + enum policy_mgr_two_connection_mode index = PM_MAX_TWO_CONNECTION_MODE; + /* SCC */ + if (pm_conc_connection_list[0].chan == + pm_conc_connection_list[1].chan) { + if (WLAN_REG_IS_24GHZ_CH + (pm_conc_connection_list[0].chan)) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_STA_SCC_24_1x1; + else + index = PM_STA_STA_SCC_24_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_STA_SCC_5_1x1; + else + index = PM_STA_STA_SCC_5_2x2; + } + /* MCC */ + } else if (pm_conc_connection_list[0].mac == + pm_conc_connection_list[1].mac) { + if ((WLAN_REG_IS_24GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_24GHZ_CH( + pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_STA_MCC_24_1x1; + else + index = PM_STA_STA_MCC_24_2x2; + } else if ((WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_STA_MCC_5_1x1; + else + index = PM_STA_STA_MCC_5_2x2; + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_STA_MCC_24_5_1x1; + else + index = PM_STA_STA_MCC_24_5_2x2; + } + /* SBS */ + } else if (pm_conc_connection_list[0].mac != + pm_conc_connection_list[1].mac) { + if ((WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[1].chan))) { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_STA_SBS_5_1x1; + } + /* DBS */ + } else { + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_STA_DBS_1x1; + else + index = PM_STA_STA_DBS_2x2; + } + + return index; } enum policy_mgr_two_connection_mode policy_mgr_get_third_connection_pcl_table_index( struct wlan_objmgr_psoc *psoc) { - return PM_MAX_TWO_CONNECTION_MODE; + enum policy_mgr_two_connection_mode index = PM_MAX_TWO_CONNECTION_MODE; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return index; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + if (((PM_P2P_CLIENT_MODE == pm_conc_connection_list[0].mode) && + (PM_SAP_MODE == pm_conc_connection_list[1].mode)) || + ((PM_SAP_MODE == pm_conc_connection_list[0].mode) && + (PM_P2P_CLIENT_MODE == pm_conc_connection_list[1].mode))) + index = + policy_mgr_get_third_connection_pcl_table_index_cli_sap(); + else if (((PM_STA_MODE == pm_conc_connection_list[0].mode) && + (PM_SAP_MODE == pm_conc_connection_list[1].mode)) || + ((PM_SAP_MODE == pm_conc_connection_list[0].mode) && + (PM_STA_MODE == pm_conc_connection_list[1].mode))) + index = + policy_mgr_get_third_connection_pcl_table_index_sta_sap(); + else if ((PM_SAP_MODE == pm_conc_connection_list[0].mode) && + (PM_SAP_MODE == pm_conc_connection_list[1].mode)) + index = + policy_mgr_get_third_connection_pcl_table_index_sap_sap(); + else if (((PM_STA_MODE == pm_conc_connection_list[0].mode) && + (PM_P2P_GO_MODE == pm_conc_connection_list[1].mode)) || + ((PM_P2P_GO_MODE == pm_conc_connection_list[0].mode) && + (PM_STA_MODE == pm_conc_connection_list[1].mode))) + index = + policy_mgr_get_third_connection_pcl_table_index_sta_go(); + else if (((PM_STA_MODE == pm_conc_connection_list[0].mode) && + (PM_P2P_CLIENT_MODE == pm_conc_connection_list[1].mode)) || + ((PM_P2P_CLIENT_MODE == pm_conc_connection_list[0].mode) && + (PM_STA_MODE == pm_conc_connection_list[1].mode))) + index = + policy_mgr_get_third_connection_pcl_table_index_sta_cli(); + else if (((PM_P2P_GO_MODE == pm_conc_connection_list[0].mode) && + (PM_P2P_CLIENT_MODE == pm_conc_connection_list[1].mode)) || + ((PM_P2P_CLIENT_MODE == pm_conc_connection_list[0].mode) && + (PM_P2P_GO_MODE == pm_conc_connection_list[1].mode))) + index = + policy_mgr_get_third_connection_pcl_table_index_go_cli(); + else if (((PM_SAP_MODE == pm_conc_connection_list[0].mode) && + (PM_P2P_GO_MODE == pm_conc_connection_list[1].mode)) || + ((PM_P2P_GO_MODE == pm_conc_connection_list[0].mode) && + (PM_SAP_MODE == pm_conc_connection_list[1].mode))) + index = + policy_mgr_get_third_connection_pcl_table_index_go_sap(); + else if (((PM_STA_MODE == pm_conc_connection_list[0].mode) && + (PM_STA_MODE == pm_conc_connection_list[1].mode)) || + ((PM_STA_MODE == pm_conc_connection_list[0].mode) && + (PM_STA_MODE == pm_conc_connection_list[1].mode))) + index = + policy_mgr_get_third_connection_pcl_table_index_sta_sta(); + + policy_mgr_debug("mode0:%d mode1:%d chan0:%d chan1:%d chain:%d index:%d", + pm_conc_connection_list[0].mode, + pm_conc_connection_list[1].mode, + pm_conc_connection_list[0].chan, + pm_conc_connection_list[1].chan, + pm_conc_connection_list[0].chain_mask, index); + + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return index; } uint8_t @@ -124,30 +1064,144 @@ policy_mgr_get_nondfs_preferred_channel(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, bool for_existing_conn) { - return 0; + uint8_t pcl_channels[QDF_MAX_NUM_CHAN]; + uint8_t pcl_weight[QDF_MAX_NUM_CHAN]; + + /* + * in worst case if we can't find any channel at all + * then return 2.4G channel, so atleast we won't fall + * under 5G MCC scenario + */ + uint8_t channel = PM_24_GHZ_CHANNEL_6; + uint32_t i, pcl_len; + + if (true == for_existing_conn) { + /* + * First try to see if there is any non-dfs channel already + * present in current connection table. If yes then return + * that channel + */ + if (true == policy_mgr_is_any_nondfs_chnl_present( + psoc, &channel)) + return channel; + + if (QDF_STATUS_SUCCESS != policy_mgr_get_pcl_for_existing_conn( + psoc, mode, + &pcl_channels[0], &pcl_len, + pcl_weight, QDF_ARRAY_SIZE(pcl_weight))) + return channel; + } else { + if (QDF_STATUS_SUCCESS != policy_mgr_get_pcl(psoc, mode, + &pcl_channels[0], &pcl_len, + pcl_weight, QDF_ARRAY_SIZE(pcl_weight))) + return channel; + } + + for (i = 0; i < pcl_len; i++) { + if (wlan_reg_is_dfs_ch(psoc, pcl_channels[i])) { + continue; + } else { + channel = pcl_channels[i]; + break; + } + } + + return channel; } QDF_STATUS policy_mgr_get_valid_chans(struct wlan_objmgr_psoc *psoc, uint8_t *chan_list, uint32_t *list_len) { + QDF_STATUS status; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + *list_len = 0; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + if (!pm_ctx->sme_cbacks.sme_get_valid_channels) { + policy_mgr_err("sme_get_valid_chans callback is NULL"); + return QDF_STATUS_E_FAILURE; + } + + *list_len = QDF_MAX_NUM_CHAN; + status = pm_ctx->sme_cbacks.sme_get_valid_channels( + chan_list, list_len); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("Error in getting valid channels"); + *list_len = 0; + return status; + } + return QDF_STATUS_SUCCESS; } bool policy_mgr_list_has_24GHz_channel(uint8_t *channel_list, uint32_t list_len) { + uint32_t i; + + for (i = 0; i < list_len; i++) { + if (WLAN_REG_IS_24GHZ_CH(channel_list[i])) + return true; + } + return false; } QDF_STATUS policy_mgr_set_sap_mandatory_channels(struct wlan_objmgr_psoc *psoc, uint8_t *channels, uint32_t len) { + uint32_t i; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + if (!len) { + policy_mgr_err("No mandatory freq/chan configured"); + return QDF_STATUS_E_FAILURE; + } + + if (!policy_mgr_list_has_24GHz_channel(channels, len)) { + policy_mgr_err("2.4GHz channels missing, this is not expected"); + return QDF_STATUS_E_FAILURE; + } + + policy_mgr_debug("mandatory chan length:%d", + pm_ctx->sap_mandatory_channels_len); + + for (i = 0; i < len; i++) { + pm_ctx->sap_mandatory_channels[i] = channels[i]; + policy_mgr_debug("chan:%d", pm_ctx->sap_mandatory_channels[i]); + } + + pm_ctx->sap_mandatory_channels_len = len; + return QDF_STATUS_SUCCESS; } bool policy_mgr_is_sap_mandatory_channel_set(struct wlan_objmgr_psoc *psoc) { - return false; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return false; + } + + if (pm_ctx->sap_mandatory_channels_len) + return true; + else + return false; } QDF_STATUS policy_mgr_modify_sap_pcl_based_on_mandatory_channel( @@ -156,17 +1210,161 @@ QDF_STATUS policy_mgr_modify_sap_pcl_based_on_mandatory_channel( uint8_t *weight_list_org, uint32_t *pcl_len_org) { + uint32_t i, j, pcl_len = 0; + uint8_t pcl_list[QDF_MAX_NUM_CHAN]; + uint8_t weight_list[QDF_MAX_NUM_CHAN]; + bool found; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + if (!pm_ctx->sap_mandatory_channels_len) + return QDF_STATUS_SUCCESS; + + if (!policy_mgr_list_has_24GHz_channel(pm_ctx->sap_mandatory_channels, + pm_ctx->sap_mandatory_channels_len)) { + policy_mgr_err("fav channel list is missing 2.4GHz channels"); + return QDF_STATUS_E_FAILURE; + } + + for (i = 0; i < pm_ctx->sap_mandatory_channels_len; i++) + policy_mgr_debug("fav chan:%d", + pm_ctx->sap_mandatory_channels[i]); + + for (i = 0; i < *pcl_len_org; i++) { + found = false; + for (j = 0; j < pm_ctx->sap_mandatory_channels_len; j++) { + if (pcl_list_org[i] == + pm_ctx->sap_mandatory_channels[j]) { + found = true; + break; + } + } + if (found) { + pcl_list[pcl_len] = pcl_list_org[i]; + weight_list[pcl_len++] = weight_list_org[i]; + } + } + + qdf_mem_zero(pcl_list_org, QDF_ARRAY_SIZE(pcl_list_org)); + qdf_mem_zero(weight_list_org, QDF_ARRAY_SIZE(weight_list_org)); + qdf_mem_copy(pcl_list_org, pcl_list, pcl_len); + qdf_mem_copy(weight_list_org, weight_list, pcl_len); + *pcl_len_org = pcl_len; + return QDF_STATUS_SUCCESS; } QDF_STATUS policy_mgr_get_sap_mandatory_channel(struct wlan_objmgr_psoc *psoc, uint32_t *chan) { + QDF_STATUS status; + struct policy_mgr_pcl_list pcl; + + qdf_mem_zero(&pcl, sizeof(pcl)); + + status = policy_mgr_get_pcl_for_existing_conn(psoc, PM_SAP_MODE, + pcl.pcl_list, &pcl.pcl_len, + pcl.weight_list, QDF_ARRAY_SIZE(pcl.weight_list)); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("Unable to get PCL for SAP"); + return status; + } + + /* No existing SAP connection and hence a new SAP connection might be + * coming up. + */ + if (!pcl.pcl_len) { + policy_mgr_notice("policy_mgr_get_pcl_for_existing_conn returned no pcl"); + status = policy_mgr_get_pcl(psoc, PM_SAP_MODE, + pcl.pcl_list, &pcl.pcl_len, + pcl.weight_list, + QDF_ARRAY_SIZE(pcl.weight_list)); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("Unable to get PCL for SAP: policy_mgr_get_pcl"); + return status; + } + } + + status = policy_mgr_modify_sap_pcl_based_on_mandatory_channel( + psoc, pcl.pcl_list, + pcl.weight_list, + &pcl.pcl_len); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("Unable to modify SAP PCL"); + return status; + } + + *chan = pcl.pcl_list[0]; + policy_mgr_notice("mandatory channel:%d", *chan); + return QDF_STATUS_SUCCESS; } QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc, struct policy_mgr_pcl_chan_weights *weight) { + uint32_t i, j; + struct policy_mgr_conc_connection_info info; + + if (!weight->pcl_list) { + policy_mgr_err("Invalid pcl"); + return QDF_STATUS_E_FAILURE; + } + + if (!weight->saved_chan_list) { + policy_mgr_err("Invalid valid channel list"); + return QDF_STATUS_E_FAILURE; + } + + if (!weight->weighed_valid_list) { + policy_mgr_err("Invalid weighed valid channel list"); + return QDF_STATUS_E_FAILURE; + } + + qdf_mem_set(weight->weighed_valid_list, QDF_MAX_NUM_CHAN, + WEIGHT_OF_DISALLOWED_CHANNELS); + + if (policy_mgr_mode_specific_connection_count( + psoc, PM_STA_MODE, NULL) > 0) { + /* + * Store the STA mode's parameter and temporarily delete it + * from the concurrency table. This way the allow concurrency + * check can be used as though a new connection is coming up, + * allowing to detect the disallowed channels. + */ + policy_mgr_store_and_del_conn_info(psoc, PM_STA_MODE, &info); + /* + * There is a small window between releasing the above lock + * and acquiring the same in policy_mgr_allow_concurrency, + * below! + */ + for (i = 0; i < weight->saved_num_chan; i++) { + if (policy_mgr_allow_concurrency(psoc, PM_STA_MODE, + weight->saved_chan_list[i], + HW_MODE_20_MHZ)) { + weight->weighed_valid_list[i] = + WEIGHT_OF_NON_PCL_CHANNELS; + } + } + + /* Restore the connection info */ + policy_mgr_restore_deleted_conn_info(psoc, &info); + } + + for (i = 0; i < weight->saved_num_chan; i++) { + for (j = 0; j < weight->pcl_len; j++) { + if (weight->saved_chan_list[i] == weight->pcl_list[j]) { + weight->weighed_valid_list[i] = + weight->weight_list[j]; + break; + } + } + } + return QDF_STATUS_SUCCESS; } From 3ee7f1f818ad4006864e24ebc1ecd0b904eb308b Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Tue, 7 Mar 2017 20:58:50 -0800 Subject: [PATCH 007/187] qcacmn: Define core functions of policy manager component Define core functions for policy manager component. Change-Id: Ifc9bc2165065226757cd4aa379a205870b2a2174 CRs-Fixed: 2009818 --- src/wlan_policy_mgr_core.c | 2036 +++++++++++++++++++++++++++++++++++- src/wlan_policy_mgr_i.h | 1 + 2 files changed, 2016 insertions(+), 21 deletions(-) diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 379a04bd2349..8aed7d8c994f 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -76,11 +76,28 @@ QDF_STATUS policy_mgr_get_updated_scan_config( bool dbs_plus_agile_scan, bool single_mac_scan_with_dfs) { + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + *scan_config = pm_ctx->dual_mac_cfg.cur_scan_config; + + WMI_DBS_CONC_SCAN_CFG_DBS_SCAN_SET(*scan_config, dbs_scan); + WMI_DBS_CONC_SCAN_CFG_AGILE_SCAN_SET(*scan_config, + dbs_plus_agile_scan); + WMI_DBS_CONC_SCAN_CFG_AGILE_DFS_SCAN_SET(*scan_config, + single_mac_scan_with_dfs); + + policy_mgr_debug("scan_config:%x ", *scan_config); return QDF_STATUS_SUCCESS; } /** - * policy_mgr_get_updated_fw_mode_config() - Get the updated fw mode configuration + * policy_mgr_get_updated_fw_mode_config() - Get the updated fw + * mode configuration * @fw_mode_config: Pointer containing the updated fw mode config * @dbs: 0 or 1 indicating if DBS needs to be enabled/disabled * @agile_dfs: 0 or 1 indicating if agile DFS needs to be enabled/disabled @@ -97,11 +114,25 @@ QDF_STATUS policy_mgr_get_updated_fw_mode_config( bool dbs, bool agile_dfs) { + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + *fw_mode_config = pm_ctx->dual_mac_cfg.cur_fw_mode_config; + + WMI_DBS_FW_MODE_CFG_DBS_SET(*fw_mode_config, dbs); + WMI_DBS_FW_MODE_CFG_AGILE_DFS_SET(*fw_mode_config, agile_dfs); + + policy_mgr_debug("fw_mode_config:%x ", *fw_mode_config); return QDF_STATUS_SUCCESS; } /** - * policy_mgr_is_dual_mac_disabled_in_ini() - Check if dual mac is disabled in INI + * policy_mgr_is_dual_mac_disabled_in_ini() - Check if dual mac + * is disabled in INI * * Checks if the dual mac feature is disabled in INI * @@ -110,7 +141,7 @@ QDF_STATUS policy_mgr_get_updated_fw_mode_config( bool policy_mgr_is_dual_mac_disabled_in_ini( struct wlan_objmgr_psoc *psoc) { - return false; + return wlan_objmgr_psoc_get_dual_mac_disable(psoc); } /** @@ -122,7 +153,22 @@ bool policy_mgr_is_dual_mac_disabled_in_ini( */ bool policy_mgr_get_dbs_config(struct wlan_objmgr_psoc *psoc) { - return false; + struct policy_mgr_psoc_priv_obj *pm_ctx; + uint32_t fw_mode_config; + + if (policy_mgr_is_dual_mac_disabled_in_ini(psoc)) + return false; + + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + /* We take that it is disabled and proceed */ + return false; + } + fw_mode_config = pm_ctx->dual_mac_cfg.cur_fw_mode_config; + + return WMI_DBS_FW_MODE_CFG_DBS_GET(fw_mode_config); } /** @@ -134,7 +180,22 @@ bool policy_mgr_get_dbs_config(struct wlan_objmgr_psoc *psoc) */ bool policy_mgr_get_agile_dfs_config(struct wlan_objmgr_psoc *psoc) { - return false; + struct policy_mgr_psoc_priv_obj *pm_ctx; + uint32_t fw_mode_config; + + if (policy_mgr_is_dual_mac_disabled_in_ini(psoc)) + return false; + + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + /* We take that it is disabled and proceed */ + return false; + } + fw_mode_config = pm_ctx->dual_mac_cfg.cur_fw_mode_config; + + return WMI_DBS_FW_MODE_CFG_AGILE_DFS_GET(fw_mode_config); } /** @@ -146,11 +207,27 @@ bool policy_mgr_get_agile_dfs_config(struct wlan_objmgr_psoc *psoc) */ bool policy_mgr_get_dbs_scan_config(struct wlan_objmgr_psoc *psoc) { - return false; + uint32_t scan_config; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + if (policy_mgr_is_dual_mac_disabled_in_ini(psoc)) + return false; + + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + /* We take that it is disabled and proceed */ + return false; + } + scan_config = pm_ctx->dual_mac_cfg.cur_scan_config; + + return WMI_DBS_CONC_SCAN_CFG_DBS_SCAN_GET(scan_config); } /** - * policy_mgr_get_tx_rx_ss_from_config() - Get Tx/Rx spatial stream from HW mode config + * policy_mgr_get_tx_rx_ss_from_config() - Get Tx/Rx spatial + * stream from HW mode config * @mac_ss: Config which indicates the HW mode as per 'hw_mode_ss_config' * @tx_ss: Contains the Tx spatial stream * @rx_ss: Contains the Rx spatial stream @@ -217,7 +294,75 @@ int8_t policy_mgr_get_matching_hw_mode_index( enum hw_mode_agile_dfs_capab dfs, enum hw_mode_sbs_capab sbs) { - return 0; + uint32_t i; + uint32_t t_mac0_tx_ss, t_mac0_rx_ss, t_mac0_bw; + uint32_t t_mac1_tx_ss, t_mac1_rx_ss, t_mac1_bw; + uint32_t dbs_mode, agile_dfs_mode, sbs_mode; + int8_t found = -EINVAL; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return found; + } + + for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { + t_mac0_tx_ss = POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_GET( + pm_ctx->hw_mode.hw_mode_list[i]); + if (t_mac0_tx_ss != mac0_tx_ss) + continue; + + t_mac0_rx_ss = POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_GET( + pm_ctx->hw_mode.hw_mode_list[i]); + if (t_mac0_rx_ss != mac0_rx_ss) + continue; + + t_mac0_bw = POLICY_MGR_HW_MODE_MAC0_BANDWIDTH_GET( + pm_ctx->hw_mode.hw_mode_list[i]); + /* + * Firmware advertises max bw capability as CBW 80+80 + * for single MAC. Thus CBW 20/40/80 should also be + * supported, if CBW 80+80 is supported. + */ + if (t_mac0_bw < mac0_bw) + continue; + + t_mac1_tx_ss = POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_GET( + pm_ctx->hw_mode.hw_mode_list[i]); + if (t_mac1_tx_ss != mac1_tx_ss) + continue; + + t_mac1_rx_ss = POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_GET( + pm_ctx->hw_mode.hw_mode_list[i]); + if (t_mac1_rx_ss != mac1_rx_ss) + continue; + + t_mac1_bw = POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_GET( + pm_ctx->hw_mode.hw_mode_list[i]); + if (t_mac1_bw < mac1_bw) + continue; + + dbs_mode = POLICY_MGR_HW_MODE_DBS_MODE_GET( + pm_ctx->hw_mode.hw_mode_list[i]); + if (dbs_mode != dbs) + continue; + + agile_dfs_mode = POLICY_MGR_HW_MODE_AGILE_DFS_GET( + pm_ctx->hw_mode.hw_mode_list[i]); + if (agile_dfs_mode != dfs) + continue; + + sbs_mode = POLICY_MGR_HW_MODE_SBS_MODE_GET( + pm_ctx->hw_mode.hw_mode_list[i]); + if (sbs_mode != sbs) + continue; + + found = i; + policy_mgr_notice("hw_mode index %d found", i); + break; + } + return found; } /** @@ -245,7 +390,25 @@ int8_t policy_mgr_get_hw_mode_idx_from_dbs_hw_list( enum hw_mode_agile_dfs_capab dfs, enum hw_mode_sbs_capab sbs) { - return 0; + uint32_t mac0_tx_ss, mac0_rx_ss; + uint32_t mac1_tx_ss, mac1_rx_ss; + + policy_mgr_get_tx_rx_ss_from_config(mac0_ss, &mac0_tx_ss, &mac0_rx_ss); + policy_mgr_get_tx_rx_ss_from_config(mac1_ss, &mac1_tx_ss, &mac1_rx_ss); + + policy_mgr_notice("MAC0: TxSS=%d, RxSS=%d, BW=%d", + mac0_tx_ss, mac0_rx_ss, mac0_bw); + policy_mgr_notice("MAC1: TxSS=%d, RxSS=%d, BW=%d", + mac1_tx_ss, mac1_rx_ss, mac1_bw); + policy_mgr_notice("DBS=%d, Agile DFS=%d, SBS=%d", + dbs, dfs, sbs); + + return policy_mgr_get_matching_hw_mode_index(psoc, mac0_tx_ss, + mac0_rx_ss, + mac0_bw, + mac1_tx_ss, mac1_rx_ss, + mac1_bw, + dbs, dfs, sbs); } /** @@ -262,6 +425,37 @@ QDF_STATUS policy_mgr_get_hw_mode_from_idx( uint32_t idx, struct policy_mgr_hw_mode_params *hw_mode) { + uint32_t param; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + if (idx > pm_ctx->num_dbs_hw_modes) { + policy_mgr_err("Invalid index"); + return QDF_STATUS_E_FAILURE; + } + + if (!pm_ctx->num_dbs_hw_modes) { + policy_mgr_err("No dbs hw modes available"); + return QDF_STATUS_E_FAILURE; + } + + param = pm_ctx->hw_mode.hw_mode_list[idx]; + + hw_mode->mac0_tx_ss = POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_GET(param); + hw_mode->mac0_rx_ss = POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_GET(param); + hw_mode->mac0_bw = POLICY_MGR_HW_MODE_MAC0_BANDWIDTH_GET(param); + hw_mode->mac1_tx_ss = POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_GET(param); + hw_mode->mac1_rx_ss = POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_GET(param); + hw_mode->mac1_bw = POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_GET(param); + hw_mode->dbs_cap = POLICY_MGR_HW_MODE_DBS_MODE_GET(param); + hw_mode->agile_dfs_cap = POLICY_MGR_HW_MODE_AGILE_DFS_GET(param); + hw_mode->sbs_cap = POLICY_MGR_HW_MODE_SBS_MODE_GET(param); + return QDF_STATUS_SUCCESS; } @@ -283,6 +477,17 @@ QDF_STATUS policy_mgr_get_old_and_new_hw_index( uint32_t *old_hw_mode_index, uint32_t *new_hw_mode_index) { + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_INVAL; + } + + *old_hw_mode_index = pm_ctx->old_hw_mode_index; + *new_hw_mode_index = pm_ctx->new_hw_mode_index; + return QDF_STATUS_SUCCESS; } @@ -312,6 +517,32 @@ void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc, uint32_t vdev_id, bool in_use) { + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + if (conn_index >= MAX_NUMBER_OF_CONC_CONNECTIONS) { + policy_mgr_err("Number of connections exceeded conn_index: %d", + conn_index); + return; + } + pm_conc_connection_list[conn_index].mode = mode; + pm_conc_connection_list[conn_index].chan = chan; + pm_conc_connection_list[conn_index].bw = bw; + pm_conc_connection_list[conn_index].mac = mac; + pm_conc_connection_list[conn_index].chain_mask = chain_mask; + pm_conc_connection_list[conn_index].original_nss = original_nss; + pm_conc_connection_list[conn_index].vdev_id = vdev_id; + pm_conc_connection_list[conn_index].in_use = in_use; + + policy_mgr_dump_connection_status_info(psoc); + if (pm_ctx->cdp_cbacks.cdp_update_mac_id) + pm_ctx->cdp_cbacks.cdp_update_mac_id(psoc, vdev_id, mac); + } /** @@ -329,6 +560,42 @@ void policy_mgr_store_and_del_conn_info(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, struct policy_mgr_conc_connection_info *info) { + uint32_t conn_index = 0; + bool found = false; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { + if (mode == pm_conc_connection_list[conn_index].mode) { + found = true; + break; + } + conn_index++; + } + + if (!found) { + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + policy_mgr_err("Mode:%d not available in the conn info", mode); + return; + } + + /* Storing the STA entry which will be temporarily deleted */ + *info = pm_conc_connection_list[conn_index]; + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + /* Deleting the STA entry */ + policy_mgr_decr_connection_count(psoc, info->vdev_id); + + policy_mgr_notice("Stored %d (%d), deleted STA entry with vdev id %d, index %d", + info->vdev_id, info->mode, info->vdev_id, conn_index); + + /* Caller should set the PCL and restore the STA entry in conn info */ } /** @@ -343,10 +610,33 @@ void policy_mgr_store_and_del_conn_info(struct wlan_objmgr_psoc *psoc, void policy_mgr_restore_deleted_conn_info(struct wlan_objmgr_psoc *psoc, struct policy_mgr_conc_connection_info *info) { + uint32_t conn_index; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + conn_index = policy_mgr_get_connection_count(psoc); + if (MAX_NUMBER_OF_CONC_CONNECTIONS <= conn_index) { + policy_mgr_err("Failed to restore the deleted information %d/%d", + conn_index, MAX_NUMBER_OF_CONC_CONNECTIONS); + return; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + pm_conc_connection_list[conn_index] = *info; + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + policy_mgr_notice("Restored the deleleted conn info, vdev:%d, index:%d", + info->vdev_id, conn_index); } /** - * policy_mgr_update_hw_mode_conn_info() - Update connection info based on HW mode + * policy_mgr_update_hw_mode_conn_info() - Update connection + * info based on HW mode * @num_vdev_mac_entries: Number of vdev-mac id entries that follow * @vdev_mac_map: Mapping of vdev-mac id * @hw_mode: HW mode @@ -360,6 +650,42 @@ void policy_mgr_update_hw_mode_conn_info(struct wlan_objmgr_psoc *psoc, struct policy_mgr_vdev_mac_map *vdev_mac_map, struct policy_mgr_hw_mode_params hw_mode) { + uint32_t i, conn_index, found; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (i = 0; i < num_vdev_mac_entries; i++) { + conn_index = 0; + found = 0; + while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { + if (vdev_mac_map[i].vdev_id == + pm_conc_connection_list[conn_index].vdev_id) { + found = 1; + break; + } + conn_index++; + } + if (found) { + pm_conc_connection_list[conn_index].mac = + vdev_mac_map[i].mac_id; + policy_mgr_notice("vdev:%d, mac:%d", + pm_conc_connection_list[conn_index].vdev_id, + pm_conc_connection_list[conn_index].mac); + if (pm_ctx->cdp_cbacks.cdp_update_mac_id) + pm_ctx->cdp_cbacks.cdp_update_mac_id( + psoc, + vdev_mac_map[i].vdev_id, + vdev_mac_map[i].mac_id); + } + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + policy_mgr_dump_connection_status_info(psoc); } /** @@ -381,6 +707,278 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status, struct policy_mgr_vdev_mac_map *vdev_mac_map, void *context) { + QDF_STATUS ret; + struct policy_mgr_hw_mode_params hw_mode; + uint32_t i; + + if (status != SET_HW_MODE_STATUS_OK) { + policy_mgr_err("Set HW mode failed with status %d", status); + return; + } + + if (!vdev_mac_map) { + policy_mgr_err("vdev_mac_map is NULL"); + return; + } + + policy_mgr_notice("cfgd_hw_mode_index=%d", cfgd_hw_mode_index); + + for (i = 0; i < num_vdev_mac_entries; i++) + policy_mgr_notice("vdev_id:%d mac_id:%d", + vdev_mac_map[i].vdev_id, + vdev_mac_map[i].mac_id); + + ret = policy_mgr_get_hw_mode_from_idx(context, cfgd_hw_mode_index, + &hw_mode); + if (ret != QDF_STATUS_SUCCESS) { + policy_mgr_err("Get HW mode failed: %d", ret); + return; + } + + policy_mgr_notice("MAC0: TxSS:%d, RxSS:%d, Bw:%d", + hw_mode.mac0_tx_ss, hw_mode.mac0_rx_ss, hw_mode.mac0_bw); + policy_mgr_notice("MAC1: TxSS:%d, RxSS:%d, Bw:%d", + hw_mode.mac1_tx_ss, hw_mode.mac1_rx_ss, hw_mode.mac1_bw); + policy_mgr_notice("DBS:%d, Agile DFS:%d, SBS:%d", + hw_mode.dbs_cap, hw_mode.agile_dfs_cap, hw_mode.sbs_cap); + + /* update pm_conc_connection_list */ + policy_mgr_update_hw_mode_conn_info(context, num_vdev_mac_entries, + vdev_mac_map, + hw_mode); + + ret = policy_mgr_set_connection_update(context); + if (!QDF_IS_STATUS_SUCCESS(ret)) + policy_mgr_err("ERROR: set connection_update_done event failed"); + + return; +} + +/** + * policy_mgr_dump_current_concurrency_one_connection() - To dump the + * current concurrency info with one connection + * @cc_mode: connection string + * @length: Maximum size of the string + * + * This routine is called to dump the concurrency info + * + * Return: length of the string + */ +static uint32_t policy_mgr_dump_current_concurrency_one_connection( + char *cc_mode, uint32_t length) +{ + uint32_t count = 0; + enum policy_mgr_con_mode mode; + + mode = pm_conc_connection_list[0].mode; + + switch (mode) { + case PM_STA_MODE: + count = strlcat(cc_mode, "STA", + length); + break; + case PM_SAP_MODE: + count = strlcat(cc_mode, "SAP", + length); + break; + case PM_P2P_CLIENT_MODE: + count = strlcat(cc_mode, "P2P CLI", + length); + break; + case PM_P2P_GO_MODE: + count = strlcat(cc_mode, "P2P GO", + length); + break; + case PM_IBSS_MODE: + count = strlcat(cc_mode, "IBSS", + length); + break; + default: + policy_mgr_err("unexpected mode %d", mode); + break; + } + + return count; +} + +/** + * policy_mgr_dump_current_concurrency_two_connection() - To dump the + * current concurrency info with two connections + * @cc_mode: connection string + * @length: Maximum size of the string + * + * This routine is called to dump the concurrency info + * + * Return: length of the string + */ +static uint32_t policy_mgr_dump_current_concurrency_two_connection( + char *cc_mode, uint32_t length) +{ + uint32_t count = 0; + enum policy_mgr_con_mode mode; + + mode = pm_conc_connection_list[1].mode; + + switch (mode) { + case PM_STA_MODE: + count = policy_mgr_dump_current_concurrency_one_connection( + cc_mode, length); + count += strlcat(cc_mode, "+STA", + length); + break; + case PM_SAP_MODE: + count = policy_mgr_dump_current_concurrency_one_connection( + cc_mode, length); + count += strlcat(cc_mode, "+SAP", + length); + break; + case PM_P2P_CLIENT_MODE: + count = policy_mgr_dump_current_concurrency_one_connection( + cc_mode, length); + count += strlcat(cc_mode, "+P2P CLI", + length); + break; + case PM_P2P_GO_MODE: + count = policy_mgr_dump_current_concurrency_one_connection( + cc_mode, length); + count += strlcat(cc_mode, "+P2P GO", + length); + break; + case PM_IBSS_MODE: + count = policy_mgr_dump_current_concurrency_one_connection( + cc_mode, length); + count += strlcat(cc_mode, "+IBSS", + length); + break; + default: + policy_mgr_err("unexpected mode %d", mode); + break; + } + + return count; +} + +/** + * policy_mgr_dump_current_concurrency_three_connection() - To dump the + * current concurrency info with three connections + * @cc_mode: connection string + * @length: Maximum size of the string + * + * This routine is called to dump the concurrency info + * + * Return: length of the string + */ +static uint32_t policy_mgr_dump_current_concurrency_three_connection( + char *cc_mode, uint32_t length) +{ + uint32_t count = 0; + enum policy_mgr_con_mode mode; + + mode = pm_conc_connection_list[2].mode; + + switch (mode) { + case PM_STA_MODE: + count = policy_mgr_dump_current_concurrency_two_connection( + cc_mode, length); + count += strlcat(cc_mode, "+STA", + length); + break; + case PM_SAP_MODE: + count = policy_mgr_dump_current_concurrency_two_connection( + cc_mode, length); + count += strlcat(cc_mode, "+SAP", + length); + break; + case PM_P2P_CLIENT_MODE: + count = policy_mgr_dump_current_concurrency_two_connection( + cc_mode, length); + count += strlcat(cc_mode, "+P2P CLI", + length); + break; + case PM_P2P_GO_MODE: + count = policy_mgr_dump_current_concurrency_two_connection( + cc_mode, length); + count += strlcat(cc_mode, "+P2P GO", + length); + break; + case PM_IBSS_MODE: + count = policy_mgr_dump_current_concurrency_two_connection( + cc_mode, length); + count += strlcat(cc_mode, "+IBSS", + length); + break; + default: + policy_mgr_err("unexpected mode %d", mode); + break; + } + + return count; +} + +/** + * policy_mgr_dump_dbs_concurrency() - To dump the dbs concurrency + * combination + * @cc_mode: connection string + * + * This routine is called to dump the concurrency info + * + * Return: None + */ +static void policy_mgr_dump_dbs_concurrency(struct wlan_objmgr_psoc *psoc, + char *cc_mode, uint32_t length) +{ + char buf[4] = {0}; + uint8_t mac = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + strlcat(cc_mode, " DBS", length); + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + if (pm_conc_connection_list[0].mac == + pm_conc_connection_list[1].mac) { + if (pm_conc_connection_list[0].chan == + pm_conc_connection_list[1].chan) + strlcat(cc_mode, + " with SCC for 1st two connections on mac ", + length); + else + strlcat(cc_mode, + " with MCC for 1st two connections on mac ", + length); + mac = pm_conc_connection_list[0].mac; + } + if (pm_conc_connection_list[0].mac == pm_conc_connection_list[2].mac) { + if (pm_conc_connection_list[0].chan == + pm_conc_connection_list[2].chan) + strlcat(cc_mode, + " with SCC for 1st & 3rd connections on mac ", + length); + else + strlcat(cc_mode, + " with MCC for 1st & 3rd connections on mac ", + length); + mac = pm_conc_connection_list[0].mac; + } + if (pm_conc_connection_list[1].mac == pm_conc_connection_list[2].mac) { + if (pm_conc_connection_list[1].chan == + pm_conc_connection_list[2].chan) + strlcat(cc_mode, + " with SCC for 2nd & 3rd connections on mac ", + length); + else + strlcat(cc_mode, + " with MCC for 2nd & 3rd connections on mac ", + length); + mac = pm_conc_connection_list[1].mac; + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + snprintf(buf, sizeof(buf), "%d ", mac); + strlcat(cc_mode, buf, length); } /** @@ -393,6 +991,72 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status, */ void policy_mgr_dump_current_concurrency(struct wlan_objmgr_psoc *psoc) { + uint32_t num_connections = 0; + char cc_mode[POLICY_MGR_MAX_CON_STRING_LEN] = {0}; + uint32_t count = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + num_connections = policy_mgr_get_connection_count(psoc); + + switch (num_connections) { + case 1: + policy_mgr_dump_current_concurrency_one_connection(cc_mode, + sizeof(cc_mode)); + policy_mgr_err("%s Standalone", cc_mode); + break; + case 2: + count = policy_mgr_dump_current_concurrency_two_connection( + cc_mode, sizeof(cc_mode)); + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + if (pm_conc_connection_list[0].chan == + pm_conc_connection_list[1].chan) { + strlcat(cc_mode, " SCC", sizeof(cc_mode)); + } else if (pm_conc_connection_list[0].mac == + pm_conc_connection_list[1].mac) { + strlcat(cc_mode, " MCC", sizeof(cc_mode)); + } else + strlcat(cc_mode, " DBS", sizeof(cc_mode)); + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + policy_mgr_err("%s", cc_mode); + break; + case 3: + count = policy_mgr_dump_current_concurrency_three_connection( + cc_mode, sizeof(cc_mode)); + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + if ((pm_conc_connection_list[0].chan == + pm_conc_connection_list[1].chan) && + (pm_conc_connection_list[0].chan == + pm_conc_connection_list[2].chan)){ + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + strlcat(cc_mode, " SCC", + sizeof(cc_mode)); + } else if ((pm_conc_connection_list[0].mac == + pm_conc_connection_list[1].mac) + && (pm_conc_connection_list[0].mac == + pm_conc_connection_list[2].mac)) { + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + strlcat(cc_mode, " MCC on single MAC", + sizeof(cc_mode)); + } else { + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + policy_mgr_dump_dbs_concurrency(psoc, cc_mode, + sizeof(cc_mode)); + } + policy_mgr_err("%s", cc_mode); + break; + default: + policy_mgr_err("unexpected num_connections value %d", + num_connections); + break; + } + + return; } /** @@ -408,6 +1072,55 @@ void policy_mgr_dump_current_concurrency(struct wlan_objmgr_psoc *psoc) void policy_mgr_pdev_set_pcl(struct wlan_objmgr_psoc *psoc, enum tQDF_ADAPTER_MODE mode) { + QDF_STATUS status; + enum policy_mgr_con_mode con_mode; + struct policy_mgr_pcl_list pcl; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + pcl.pcl_len = 0; + + switch (mode) { + case QDF_STA_MODE: + con_mode = PM_STA_MODE; + break; + case QDF_P2P_CLIENT_MODE: + con_mode = PM_P2P_CLIENT_MODE; + break; + case QDF_P2P_GO_MODE: + con_mode = PM_P2P_GO_MODE; + break; + case QDF_SAP_MODE: + con_mode = PM_SAP_MODE; + break; + case QDF_IBSS_MODE: + con_mode = PM_IBSS_MODE; + break; + default: + policy_mgr_err("Unable to set PCL to FW: %d", mode); + return; + } + + policy_mgr_debug("get pcl to set it to the FW"); + + status = policy_mgr_get_pcl(psoc, con_mode, + pcl.pcl_list, &pcl.pcl_len, + pcl.weight_list, QDF_ARRAY_SIZE(pcl.weight_list)); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("Unable to set PCL to FW, Get PCL failed"); + return; + } + + status = pm_ctx->sme_cbacks.sme_pdev_set_pcl(pcl); + if (status != QDF_STATUS_SUCCESS) + policy_mgr_err("Send soc set PCL to SME failed"); + else + policy_mgr_notice("Set PCL to FW for mode:%d", mode); } @@ -422,6 +1135,39 @@ void policy_mgr_pdev_set_pcl(struct wlan_objmgr_psoc *psoc, void policy_mgr_set_pcl_for_existing_combo( struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode) { + struct policy_mgr_conc_connection_info info; + enum tQDF_ADAPTER_MODE pcl_mode; + + switch (mode) { + case PM_STA_MODE: + pcl_mode = QDF_STA_MODE; + break; + case PM_SAP_MODE: + pcl_mode = QDF_SAP_MODE; + break; + case PM_P2P_CLIENT_MODE: + pcl_mode = QDF_P2P_CLIENT_MODE; + break; + case PM_P2P_GO_MODE: + pcl_mode = QDF_P2P_GO_MODE; + break; + case PM_IBSS_MODE: + pcl_mode = QDF_IBSS_MODE; + break; + default: + policy_mgr_err("Invalid mode to set PCL"); + return; + }; + + if (policy_mgr_mode_specific_connection_count(psoc, mode, NULL) > 0) { + /* Check, store and temp delete the mode's parameter */ + policy_mgr_store_and_del_conn_info(psoc, mode, &info); + /* Set the PCL to the FW since connection got updated */ + policy_mgr_pdev_set_pcl(psoc, pcl_mode); + policy_mgr_notice("Set PCL to FW for mode:%d", mode); + /* Restore the connection info */ + policy_mgr_restore_deleted_conn_info(psoc, &info); + } } /** @@ -435,6 +1181,60 @@ void policy_mgr_set_pcl_for_existing_combo( */ void pm_dbs_opportunistic_timer_handler(void *data) { + enum policy_mgr_conc_next_action action = PM_NOP; + struct wlan_objmgr_psoc *psoc = (struct wlan_objmgr_psoc *)data; + + if (!psoc) { + policy_mgr_err("Invalid Context"); + return; + } + + /* if we still need it */ + action = policy_mgr_need_opportunistic_upgrade(psoc); + policy_mgr_notice("action:%d", action); + if (action) { + /* lets call for action */ + /* session id is being used only + * in hidden ssid case for now. + * So, session id 0 is ok here. + */ + policy_mgr_next_actions(psoc, 0, action, + POLICY_MGR_UPDATE_REASON_OPPORTUNISTIC); + } +} + +/** + * policy_mgr_get_connection_for_vdev_id() - provides the + * perticular connection with the requested vdev id + * @vdev_id: vdev id of the connection + * + * This function provides the specific connection with the + * requested vdev id + * + * Return: index in the connection table + */ +static uint32_t policy_mgr_get_connection_for_vdev_id( + struct wlan_objmgr_psoc *psoc, uint32_t vdev_id) +{ + uint32_t conn_index = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return conn_index; + } + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; + conn_index++) { + if ((pm_conc_connection_list[conn_index].vdev_id == vdev_id) && + pm_conc_connection_list[conn_index].in_use) { + break; + } + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return conn_index; } /** @@ -450,7 +1250,347 @@ void pm_dbs_opportunistic_timer_handler(void *data) enum policy_mgr_con_mode policy_mgr_get_mode(uint8_t type, uint8_t subtype) { - return PM_MAX_NUM_OF_MODE; + enum policy_mgr_con_mode mode = PM_MAX_NUM_OF_MODE; + + if (type == WMI_VDEV_TYPE_AP) { + switch (subtype) { + case 0: + mode = PM_SAP_MODE; + break; + case WMI_UNIFIED_VDEV_SUBTYPE_P2P_GO: + mode = PM_P2P_GO_MODE; + break; + default: + policy_mgr_err("Unknown subtype %d for type %d", + subtype, type); + break; + } + } else if (type == WMI_VDEV_TYPE_STA) { + switch (subtype) { + case 0: + mode = PM_STA_MODE; + break; + case WMI_UNIFIED_VDEV_SUBTYPE_P2P_CLIENT: + mode = PM_P2P_CLIENT_MODE; + break; + default: + policy_mgr_err("Unknown subtype %d for type %d", + subtype, type); + break; + } + } else if (type == WMI_VDEV_TYPE_IBSS) { + mode = PM_IBSS_MODE; + } else { + policy_mgr_err("Unknown type %d", type); + } + + return mode; +} + +/** + * policy_mgr_get_bw() - Get channel bandwidth type used by WMI + * @chan_width: channel bandwidth type defined by host + * + * Get the channel bandwidth type used by WMI + * + * Return: hw_mode_bandwidth + */ +enum hw_mode_bandwidth policy_mgr_get_bw(enum phy_ch_width chan_width) +{ + enum hw_mode_bandwidth bw = HW_MODE_BW_NONE; + + switch (chan_width) { + case CH_WIDTH_20MHZ: + bw = HW_MODE_20_MHZ; + break; + case CH_WIDTH_40MHZ: + bw = HW_MODE_40_MHZ; + break; + case CH_WIDTH_80MHZ: + bw = HW_MODE_80_MHZ; + break; + case CH_WIDTH_160MHZ: + bw = HW_MODE_160_MHZ; + break; + case CH_WIDTH_80P80MHZ: + bw = HW_MODE_80_PLUS_80_MHZ; + break; + case CH_WIDTH_5MHZ: + bw = HW_MODE_5_MHZ; + break; + case CH_WIDTH_10MHZ: + bw = HW_MODE_10_MHZ; + break; + default: + policy_mgr_err("Unknown channel BW type %d", chan_width); + break; + } + + return bw; +} + +/** + * policy_mgr_get_sbs_channels() - provides the sbs channel(s) + * with respect to current connection(s) + * @channels: the channel(s) on which current connection(s) is + * @len: Number of channels + * @pcl_weight: Pointer to the weights of PCL + * @weight_len: Max length of the weight list + * @index: Index from which the weight list needs to be populated + * @group_id: Next available groups for weight assignment + * @available_5g_channels: List of available 5g channels + * @available_5g_channels_len: Length of the 5g channels list + * @add_5g_channels: If this flag is true append 5G channel list as well + * + * This function provides the channel(s) on which current + * connection(s) is/are + * + * Return: QDF_STATUS + */ + +static QDF_STATUS policy_mgr_get_sbs_channels(uint8_t *channels, + uint32_t *len, uint8_t *pcl_weight, uint32_t weight_len, + uint32_t *index, enum policy_mgr_pcl_group_id group_id, + uint8_t *available_5g_channels, + uint32_t available_5g_channels_len, + bool add_5g_channels) +{ + QDF_STATUS status = QDF_STATUS_SUCCESS; + uint32_t conn_index = 0, num_channels = 0; + uint32_t num_5g_channels = 0, cur_5g_channel = 0; + uint8_t remaining_5g_Channels[QDF_MAX_NUM_CHAN] = {}; + uint32_t remaining_channel_index = 0; + uint32_t j = 0, i = 0, weight1, weight2; + + if ((NULL == channels) || (NULL == len)) { + policy_mgr_err("channels or len is NULL"); + status = QDF_STATUS_E_FAILURE; + return status; + } + + if (group_id == POLICY_MGR_PCL_GROUP_ID1_ID2) { + weight1 = WEIGHT_OF_GROUP1_PCL_CHANNELS; + weight2 = WEIGHT_OF_GROUP2_PCL_CHANNELS; + } else if (group_id == POLICY_MGR_PCL_GROUP_ID2_ID3) { + weight1 = WEIGHT_OF_GROUP2_PCL_CHANNELS; + weight2 = WEIGHT_OF_GROUP3_PCL_CHANNELS; + } else { + weight1 = WEIGHT_OF_GROUP3_PCL_CHANNELS; + weight2 = WEIGHT_OF_GROUP4_PCL_CHANNELS; + } + + policy_mgr_debug("weight1=%d weight2=%d index=%d ", + weight1, weight2, *index); + + while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { + if ((WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[conn_index].chan)) + && (pm_conc_connection_list[conn_index].in_use)) { + num_5g_channels++; + cur_5g_channel = + pm_conc_connection_list[conn_index].chan; + } + conn_index++; + } + + conn_index = 0; + if (num_5g_channels > 1) { + /* This case we are already in SBS so return the channels */ + while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { + channels[num_channels++] = + pm_conc_connection_list[conn_index++].chan; + if (*index < weight_len) + pcl_weight[(*index)++] = weight1; + } + *len = num_channels; + /* fix duplicate issue later */ + if (add_5g_channels) + for (j = 0; j < available_5g_channels_len; j++) + remaining_5g_Channels[ + remaining_channel_index++] = + available_5g_channels[j]; + } else { + /* Get list of valid sbs channels for the current + * connected channel + */ + for (j = 0; j < available_5g_channels_len; j++) { + if (WLAN_REG_IS_CHANNEL_VALID_5G_SBS( + cur_5g_channel, available_5g_channels[j])) { + channels[num_channels++] = + available_5g_channels[j]; + } else { + remaining_5g_Channels[ + remaining_channel_index++] = + available_5g_channels[j]; + continue; + } + if (*index < weight_len) + pcl_weight[(*index)++] = weight1; + } + *len = num_channels; + } + + if (add_5g_channels) { + qdf_mem_copy(channels+num_channels, remaining_5g_Channels, + remaining_channel_index); + *len += remaining_channel_index; + for (i = 0; ((i < remaining_channel_index) + && (i < weight_len)); i++) + pcl_weight[i] = weight2; + } + + return status; +} + + +/** + * policy_mgr_get_connection_channels() - provides the channel(s) + * on which current connection(s) is + * @channels: the channel(s) on which current connection(s) is + * @len: Number of channels + * @order: no order OR 2.4 Ghz channel followed by 5 Ghz + * channel OR 5 Ghz channel followed by 2.4 Ghz channel + * @skip_dfs_channel: if this flag is true then skip the dfs channel + * @pcl_weight: Pointer to the weights of PCL + * @weight_len: Max length of the weight list + * @index: Index from which the weight list needs to be populated + * @group_id: Next available groups for weight assignment + * + * + * This function provides the channel(s) on which current + * connection(s) is/are + * + * Return: QDF_STATUS + */ +static +QDF_STATUS policy_mgr_get_connection_channels(struct wlan_objmgr_psoc *psoc, + uint8_t *channels, + uint32_t *len, enum policy_mgr_pcl_channel_order order, + bool skip_dfs_channel, + uint8_t *pcl_weight, uint32_t weight_len, + uint32_t *index, enum policy_mgr_pcl_group_id group_id) +{ + QDF_STATUS status = QDF_STATUS_SUCCESS; + uint32_t conn_index = 0, num_channels = 0; + uint32_t weight1, weight2; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return status; + } + + if ((NULL == channels) || (NULL == len)) { + policy_mgr_err("channels or len is NULL"); + status = QDF_STATUS_E_FAILURE; + return status; + } + + /* POLICY_MGR_PCL_GROUP_ID1_ID2 indicates that all three weights are + * available for assignment. i.e., WEIGHT_OF_GROUP1_PCL_CHANNELS, + * WEIGHT_OF_GROUP2_PCL_CHANNELS and WEIGHT_OF_GROUP3_PCL_CHANNELS + * are all available. Since in this function only two weights are + * assigned at max, only group1 and group2 weights are considered. + * + * The other possible group id POLICY_MGR_PCL_GROUP_ID2_ID3 indicates + * group1 was assigned the weight WEIGHT_OF_GROUP1_PCL_CHANNELS and + * only weights WEIGHT_OF_GROUP2_PCL_CHANNELS and + * WEIGHT_OF_GROUP3_PCL_CHANNELS are available for further weight + * assignments. + * + * e.g., when order is POLICY_MGR_PCL_ORDER_24G_THEN_5G and group id is + * POLICY_MGR_PCL_GROUP_ID2_ID3, WEIGHT_OF_GROUP2_PCL_CHANNELS is + * assigned to 2.4GHz channels and the weight + * WEIGHT_OF_GROUP3_PCL_CHANNELS is assigned to the 5GHz channels. + */ + if (group_id == POLICY_MGR_PCL_GROUP_ID1_ID2) { + weight1 = WEIGHT_OF_GROUP1_PCL_CHANNELS; + weight2 = WEIGHT_OF_GROUP2_PCL_CHANNELS; + } else { + weight1 = WEIGHT_OF_GROUP2_PCL_CHANNELS; + weight2 = WEIGHT_OF_GROUP3_PCL_CHANNELS; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + if (POLICY_MGR_PCL_ORDER_NONE == order) { + while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { + if (skip_dfs_channel && wlan_reg_is_dfs_ch(psoc, + pm_conc_connection_list[conn_index].chan)) { + conn_index++; + } else if (*index < weight_len) { + channels[num_channels++] = + pm_conc_connection_list[conn_index++].chan; + pcl_weight[(*index)++] = weight1; + } else { + conn_index++; + } + } + *len = num_channels; + } else if (POLICY_MGR_PCL_ORDER_24G_THEN_5G == order) { + while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { + if (WLAN_REG_IS_24GHZ_CH( + pm_conc_connection_list[conn_index].chan) + && (*index < weight_len)) { + channels[num_channels++] = + pm_conc_connection_list[conn_index++].chan; + pcl_weight[(*index)++] = weight1; + } else { + conn_index++; + } + } + conn_index = 0; + while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { + if (skip_dfs_channel && wlan_reg_is_dfs_ch(psoc, + pm_conc_connection_list[conn_index].chan)) { + conn_index++; + } else if (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[conn_index].chan) + && (*index < weight_len)) { + channels[num_channels++] = + pm_conc_connection_list[conn_index++].chan; + pcl_weight[(*index)++] = weight2; + } else { + conn_index++; + } + } + *len = num_channels; + } else if (POLICY_MGR_PCL_ORDER_5G_THEN_2G == order) { + while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { + if (skip_dfs_channel && wlan_reg_is_dfs_ch(psoc, + pm_conc_connection_list[conn_index].chan)) { + conn_index++; + } else if (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[conn_index].chan) + && (*index < weight_len)) { + channels[num_channels++] = + pm_conc_connection_list[conn_index++].chan; + pcl_weight[(*index)++] = weight1; + } else { + conn_index++; + } + } + conn_index = 0; + while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { + if (WLAN_REG_IS_24GHZ_CH( + pm_conc_connection_list[conn_index].chan) + && (*index < weight_len)) { + channels[num_channels++] = + pm_conc_connection_list[conn_index++].chan; + pcl_weight[(*index)++] = weight2; + + } else { + conn_index++; + } + } + *len = num_channels; + } else { + policy_mgr_err("unknown order %d", order); + status = QDF_STATUS_E_FAILURE; + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return status; } /** @@ -475,7 +1615,422 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, uint8_t *pcl_weights, uint32_t weight_len) { - return QDF_STATUS_SUCCESS; + QDF_STATUS status = QDF_STATUS_E_FAILURE; + uint32_t num_channels = 0; + uint32_t sbs_num_channels = 0; + uint32_t chan_index = 0, chan_index_24 = 0, chan_index_5 = 0; + uint8_t channel_list[QDF_MAX_NUM_CHAN] = {0}; + uint8_t channel_list_24[QDF_MAX_NUM_CHAN] = {0}; + uint8_t channel_list_5[QDF_MAX_NUM_CHAN] = {0}; + uint8_t sbs_channel_list[QDF_MAX_NUM_CHAN] = {0}; + bool skip_dfs_channel = false; + uint32_t i = 0, j = 0; + + if ((NULL == pcl_channels) || (NULL == len)) { + policy_mgr_err("pcl_channels or len is NULL"); + return status; + } + + if (PM_MAX_PCL_TYPE == pcl) { + /* msg */ + policy_mgr_err("pcl is invalid"); + return status; + } + + if (PM_NONE == pcl) { + /* msg */ + policy_mgr_notice("pcl is 0"); + return QDF_STATUS_SUCCESS; + } + /* get the channel list for current domain */ + status = policy_mgr_get_valid_chans(psoc, channel_list, &num_channels); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("Error in getting valid channels"); + return status; + } + + /* + * if you have atleast one STA connection then don't fill DFS channels + * in the preferred channel list + */ + if (((mode == PM_SAP_MODE) || (mode == PM_P2P_GO_MODE)) && + (policy_mgr_mode_specific_connection_count( + psoc, PM_STA_MODE, NULL) > 0)) { + policy_mgr_notice("STA present, skip DFS channels from pcl for SAP/Go"); + skip_dfs_channel = true; + } + + /* Let's divide the list in 2.4 & 5 Ghz lists */ + while ((chan_index < QDF_MAX_NUM_CHAN) && + (channel_list[chan_index] <= 11) && + (chan_index_24 < QDF_MAX_NUM_CHAN)) + channel_list_24[chan_index_24++] = channel_list[chan_index++]; + if ((chan_index < QDF_MAX_NUM_CHAN) && + (channel_list[chan_index] == 12) && + (chan_index_24 < QDF_MAX_NUM_CHAN)) { + channel_list_24[chan_index_24++] = channel_list[chan_index++]; + if ((chan_index < QDF_MAX_NUM_CHAN) && + (channel_list[chan_index] == 13) && + (chan_index_24 < QDF_MAX_NUM_CHAN)) { + channel_list_24[chan_index_24++] = + channel_list[chan_index++]; + if ((chan_index < QDF_MAX_NUM_CHAN) && + (channel_list[chan_index] == 14) && + (chan_index_24 < QDF_MAX_NUM_CHAN)) + channel_list_24[chan_index_24++] = + channel_list[chan_index++]; + } + } + + while ((chan_index < num_channels) && + (chan_index_5 < QDF_MAX_NUM_CHAN)) { + if ((true == skip_dfs_channel) && + wlan_reg_is_dfs_ch(psoc, channel_list[chan_index])) { + chan_index++; + continue; + } + channel_list_5[chan_index_5++] = channel_list[chan_index++]; + } + + num_channels = 0; + sbs_num_channels = 0; + /* In the below switch case, the channel list is populated based on the + * pcl. e.g., if the pcl is PM_SCC_CH_24G, the SCC channel group is + * populated first followed by the 2.4GHz channel group. Along with + * this, the weights are also populated in the same order for each of + * these groups. There are three weight groups: + * WEIGHT_OF_GROUP1_PCL_CHANNELS, WEIGHT_OF_GROUP2_PCL_CHANNELS and + * WEIGHT_OF_GROUP3_PCL_CHANNELS. + * + * e.g., if pcl is PM_SCC_ON_5_SCC_ON_24_24G: scc on 5GHz (group1) + * channels take the weight WEIGHT_OF_GROUP1_PCL_CHANNELS, scc on 2.4GHz + * (group2) channels take the weight WEIGHT_OF_GROUP2_PCL_CHANNELS and + * 2.4GHz (group3) channels take the weight + * WEIGHT_OF_GROUP3_PCL_CHANNELS. + * + * When the weight to be assigned to the group is known along with the + * number of channels, the weights are directly assigned to the + * pcl_weights list. But, the channel list is populated using + * policy_mgr_get_connection_channels(), the order of weights to be used + * is passed as an argument to the function + * policy_mgr_get_connection_channels() using + * 'enum policy_mgr_pcl_group_id' which indicates the next available + * weights to be used and policy_mgr_get_connection_channels() will take + * care of the weight assignments. + * + * e.g., 'enum policy_mgr_pcl_group_id' value of + * POLICY_MGR_PCL_GROUP_ID2_ID3 indicates that the next available groups + * for weight assignment are WEIGHT_OF_GROUP2_PCL_CHANNELS and + * WEIGHT_OF_GROUP3_PCL_CHANNELS and that the + * weight WEIGHT_OF_GROUP1_PCL_CHANNELS was already allocated. + * So, in the same example, when order is + * POLICY_MGR_PCL_ORDER_24G_THEN_5G, + * policy_mgr_get_connection_channels() will assign the weight + * WEIGHT_OF_GROUP2_PCL_CHANNELS to 2.4GHz channels and assign the + * weight WEIGHT_OF_GROUP3_PCL_CHANNELS to 5GHz channels. + */ + switch (pcl) { + case PM_24G: + chan_index_24 = QDF_MIN(chan_index_24, weight_len); + qdf_mem_copy(pcl_channels, channel_list_24, + chan_index_24); + *len = chan_index_24; + for (i = 0; i < *len; i++) + pcl_weights[i] = WEIGHT_OF_GROUP1_PCL_CHANNELS; + status = QDF_STATUS_SUCCESS; + break; + case PM_5G: + chan_index_5 = QDF_MIN(chan_index_5, weight_len); + qdf_mem_copy(pcl_channels, channel_list_5, + chan_index_5); + *len = chan_index_5; + for (i = 0; i < *len; i++) + pcl_weights[i] = WEIGHT_OF_GROUP1_PCL_CHANNELS; + status = QDF_STATUS_SUCCESS; + break; + case PM_SCC_CH: + case PM_MCC_CH: + policy_mgr_get_connection_channels(psoc, + channel_list, &num_channels, POLICY_MGR_PCL_ORDER_NONE, + skip_dfs_channel, pcl_weights, weight_len, &i, + POLICY_MGR_PCL_GROUP_ID1_ID2); + qdf_mem_copy(pcl_channels, channel_list, num_channels); + *len = num_channels; + status = QDF_STATUS_SUCCESS; + break; + case PM_SCC_CH_24G: + case PM_MCC_CH_24G: + policy_mgr_get_connection_channels(psoc, + channel_list, &num_channels, POLICY_MGR_PCL_ORDER_NONE, + skip_dfs_channel, pcl_weights, weight_len, &i, + POLICY_MGR_PCL_GROUP_ID1_ID2); + qdf_mem_copy(pcl_channels, channel_list, num_channels); + *len = num_channels; + chan_index_24 = QDF_MIN((num_channels + chan_index_24), + weight_len) - num_channels; + qdf_mem_copy(&pcl_channels[num_channels], + channel_list_24, chan_index_24); + *len += chan_index_24; + for (j = 0; j < chan_index_24; i++, j++) + pcl_weights[i] = WEIGHT_OF_GROUP2_PCL_CHANNELS; + + status = QDF_STATUS_SUCCESS; + break; + case PM_SCC_CH_5G: + case PM_MCC_CH_5G: + policy_mgr_get_connection_channels(psoc, + channel_list, &num_channels, POLICY_MGR_PCL_ORDER_NONE, + skip_dfs_channel, pcl_weights, weight_len, &i, + POLICY_MGR_PCL_GROUP_ID1_ID2); + qdf_mem_copy(pcl_channels, channel_list, + num_channels); + *len = num_channels; + chan_index_5 = QDF_MIN((num_channels + chan_index_5), + weight_len) - num_channels; + qdf_mem_copy(&pcl_channels[num_channels], + channel_list_5, chan_index_5); + *len += chan_index_5; + for (j = 0; j < chan_index_5; i++, j++) + pcl_weights[i] = WEIGHT_OF_GROUP2_PCL_CHANNELS; + status = QDF_STATUS_SUCCESS; + break; + case PM_24G_SCC_CH: + case PM_24G_MCC_CH: + chan_index_24 = QDF_MIN(chan_index_24, weight_len); + qdf_mem_copy(pcl_channels, channel_list_24, + chan_index_24); + *len = chan_index_24; + for (i = 0; i < chan_index_24; i++) + pcl_weights[i] = WEIGHT_OF_GROUP1_PCL_CHANNELS; + policy_mgr_get_connection_channels(psoc, + channel_list, &num_channels, POLICY_MGR_PCL_ORDER_NONE, + skip_dfs_channel, pcl_weights, weight_len, &i, + POLICY_MGR_PCL_GROUP_ID2_ID3); + qdf_mem_copy(&pcl_channels[chan_index_24], + channel_list, num_channels); + *len += num_channels; + status = QDF_STATUS_SUCCESS; + break; + case PM_5G_SCC_CH: + case PM_5G_MCC_CH: + chan_index_5 = QDF_MIN(chan_index_5, weight_len); + qdf_mem_copy(pcl_channels, channel_list_5, + chan_index_5); + *len = chan_index_5; + for (i = 0; i < chan_index_5; i++) + pcl_weights[i] = WEIGHT_OF_GROUP1_PCL_CHANNELS; + policy_mgr_get_connection_channels(psoc, + channel_list, &num_channels, POLICY_MGR_PCL_ORDER_NONE, + skip_dfs_channel, pcl_weights, weight_len, &i, + POLICY_MGR_PCL_GROUP_ID2_ID3); + qdf_mem_copy(&pcl_channels[chan_index_5], + channel_list, num_channels); + *len += num_channels; + status = QDF_STATUS_SUCCESS; + break; + case PM_SCC_ON_24_SCC_ON_5: + policy_mgr_get_connection_channels(psoc, + channel_list, &num_channels, + POLICY_MGR_PCL_ORDER_24G_THEN_5G, + skip_dfs_channel, pcl_weights, weight_len, &i, + POLICY_MGR_PCL_GROUP_ID1_ID2); + qdf_mem_copy(pcl_channels, channel_list, + num_channels); + *len = num_channels; + status = QDF_STATUS_SUCCESS; + break; + case PM_SCC_ON_5_SCC_ON_24: + policy_mgr_get_connection_channels(psoc, + channel_list, &num_channels, + POLICY_MGR_PCL_ORDER_5G_THEN_2G, + skip_dfs_channel, pcl_weights, weight_len, &i, + POLICY_MGR_PCL_GROUP_ID1_ID2); + qdf_mem_copy(pcl_channels, channel_list, num_channels); + *len = num_channels; + status = QDF_STATUS_SUCCESS; + break; + case PM_SCC_ON_24_SCC_ON_5_24G: + policy_mgr_get_connection_channels(psoc, + channel_list, &num_channels, + POLICY_MGR_PCL_ORDER_24G_THEN_5G, + skip_dfs_channel, pcl_weights, weight_len, &i, + POLICY_MGR_PCL_GROUP_ID1_ID2); + qdf_mem_copy(pcl_channels, channel_list, num_channels); + *len = num_channels; + chan_index_24 = QDF_MIN((num_channels + chan_index_24), + weight_len) - num_channels; + qdf_mem_copy(&pcl_channels[num_channels], + channel_list_24, chan_index_24); + *len += chan_index_24; + for (j = 0; j < chan_index_24; i++, j++) + pcl_weights[i] = WEIGHT_OF_GROUP3_PCL_CHANNELS; + status = QDF_STATUS_SUCCESS; + break; + case PM_SCC_ON_24_SCC_ON_5_5G: + policy_mgr_get_connection_channels(psoc, + channel_list, &num_channels, + POLICY_MGR_PCL_ORDER_24G_THEN_5G, + skip_dfs_channel, pcl_weights, weight_len, &i, + POLICY_MGR_PCL_GROUP_ID1_ID2); + qdf_mem_copy(pcl_channels, channel_list, num_channels); + *len = num_channels; + chan_index_5 = QDF_MIN((num_channels + chan_index_5), + weight_len) - num_channels; + qdf_mem_copy(&pcl_channels[num_channels], + channel_list_5, chan_index_5); + *len += chan_index_5; + for (j = 0; j < chan_index_5; i++, j++) + pcl_weights[i] = WEIGHT_OF_GROUP3_PCL_CHANNELS; + status = QDF_STATUS_SUCCESS; + break; + case PM_SCC_ON_5_SCC_ON_24_24G: + policy_mgr_get_connection_channels(psoc, + channel_list, &num_channels, + POLICY_MGR_PCL_ORDER_5G_THEN_2G, + skip_dfs_channel, pcl_weights, weight_len, &i, + POLICY_MGR_PCL_GROUP_ID1_ID2); + qdf_mem_copy(pcl_channels, channel_list, num_channels); + *len = num_channels; + chan_index_24 = QDF_MIN((num_channels + chan_index_24), + weight_len) - num_channels; + qdf_mem_copy(&pcl_channels[num_channels], + channel_list_24, chan_index_24); + *len += chan_index_24; + for (j = 0; j < chan_index_24; i++, j++) + pcl_weights[i] = WEIGHT_OF_GROUP3_PCL_CHANNELS; + status = QDF_STATUS_SUCCESS; + break; + case PM_SCC_ON_5_SCC_ON_24_5G: + policy_mgr_get_connection_channels(psoc, + channel_list, &num_channels, + POLICY_MGR_PCL_ORDER_5G_THEN_2G, + skip_dfs_channel, pcl_weights, weight_len, &i, + POLICY_MGR_PCL_GROUP_ID1_ID2); + qdf_mem_copy(pcl_channels, channel_list, num_channels); + *len = num_channels; + chan_index_5 = QDF_MIN((num_channels + chan_index_5), + weight_len) - num_channels; + qdf_mem_copy(&pcl_channels[num_channels], + channel_list_5, chan_index_5); + *len += chan_index_5; + for (j = 0; j < chan_index_5; i++, j++) + pcl_weights[i] = WEIGHT_OF_GROUP3_PCL_CHANNELS; + status = QDF_STATUS_SUCCESS; + break; + case PM_24G_SCC_CH_SBS_CH: + qdf_mem_copy(pcl_channels, channel_list_24, + chan_index_24); + *len = chan_index_24; + for (i = 0; ((i < chan_index_24) && (i < weight_len)); i++) + pcl_weights[i] = WEIGHT_OF_GROUP1_PCL_CHANNELS; + policy_mgr_get_connection_channels(psoc, + channel_list, &num_channels, POLICY_MGR_PCL_ORDER_NONE, + skip_dfs_channel, pcl_weights, weight_len, &i, + POLICY_MGR_PCL_GROUP_ID2_ID3); + qdf_mem_copy(&pcl_channels[chan_index_24], + channel_list, num_channels); + *len += num_channels; + if (policy_mgr_is_hw_sbs_capable(psoc)) { + policy_mgr_get_sbs_channels( + sbs_channel_list, &sbs_num_channels, pcl_weights, + weight_len, &i, POLICY_MGR_PCL_GROUP_ID3_ID4, + channel_list_5, chan_index_5, false); + qdf_mem_copy( + &pcl_channels[chan_index_24 + num_channels], + sbs_channel_list, sbs_num_channels); + *len += sbs_num_channels; + } + status = QDF_STATUS_SUCCESS; + break; + case PM_24G_SCC_CH_SBS_CH_5G: + qdf_mem_copy(pcl_channels, channel_list_24, + chan_index_24); + *len = chan_index_24; + for (i = 0; ((i < chan_index_24) && (i < weight_len)); i++) + pcl_weights[i] = WEIGHT_OF_GROUP1_PCL_CHANNELS; + policy_mgr_get_connection_channels(psoc, + channel_list, &num_channels, POLICY_MGR_PCL_ORDER_NONE, + skip_dfs_channel, pcl_weights, weight_len, &i, + POLICY_MGR_PCL_GROUP_ID2_ID3); + qdf_mem_copy(&pcl_channels[chan_index_24], + channel_list, num_channels); + *len += num_channels; + if (policy_mgr_is_hw_sbs_capable(psoc)) { + policy_mgr_get_sbs_channels( + sbs_channel_list, &sbs_num_channels, pcl_weights, + weight_len, &i, POLICY_MGR_PCL_GROUP_ID3_ID4, + channel_list_5, chan_index_5, true); + qdf_mem_copy( + &pcl_channels[chan_index_24 + num_channels], + sbs_channel_list, sbs_num_channels); + *len += sbs_num_channels; + } else { + qdf_mem_copy( + &pcl_channels[chan_index_24 + num_channels], + channel_list_5, chan_index_5); + *len += chan_index_5; + for (i = chan_index_24 + num_channels; + ((i < *len) && (i < weight_len)); i++) + pcl_weights[i] = WEIGHT_OF_GROUP3_PCL_CHANNELS; + } + status = QDF_STATUS_SUCCESS; + break; + case PM_24G_SBS_CH_MCC_CH: + qdf_mem_copy(pcl_channels, channel_list_24, + chan_index_24); + *len = chan_index_24; + for (i = 0; ((i < chan_index_24) && (i < weight_len)); i++) + pcl_weights[i] = WEIGHT_OF_GROUP1_PCL_CHANNELS; + if (policy_mgr_is_hw_sbs_capable(psoc)) { + policy_mgr_get_sbs_channels( + sbs_channel_list, &sbs_num_channels, pcl_weights, + weight_len, &i, POLICY_MGR_PCL_GROUP_ID2_ID3, + channel_list_5, chan_index_5, false); + qdf_mem_copy(&pcl_channels[num_channels], + sbs_channel_list, sbs_num_channels); + *len += sbs_num_channels; + } + policy_mgr_get_connection_channels(psoc, + channel_list, &num_channels, POLICY_MGR_PCL_ORDER_NONE, + skip_dfs_channel, pcl_weights, weight_len, &i, + POLICY_MGR_PCL_GROUP_ID2_ID3); + qdf_mem_copy(&pcl_channels[chan_index_24], + channel_list, num_channels); + *len += num_channels; + status = QDF_STATUS_SUCCESS; + break; + case PM_SBS_CH_5G: + if (policy_mgr_is_hw_sbs_capable(psoc)) { + policy_mgr_get_sbs_channels( + sbs_channel_list, &sbs_num_channels, pcl_weights, + weight_len, &i, POLICY_MGR_PCL_GROUP_ID1_ID2, + channel_list_5, chan_index_5, true); + qdf_mem_copy(&pcl_channels[num_channels], + sbs_channel_list, sbs_num_channels); + *len += sbs_num_channels; + } else { + qdf_mem_copy(pcl_channels, channel_list_5, + chan_index_5); + *len = chan_index_5; + for (i = 0; ((i < *len) && (i < weight_len)); i++) + pcl_weights[i] = WEIGHT_OF_GROUP1_PCL_CHANNELS; + } + status = QDF_STATUS_SUCCESS; + break; + default: + policy_mgr_err("unknown pcl value %d", pcl); + break; + } + + if ((*len != 0) && (*len != i)) + policy_mgr_notice("pcl len (%d) and weight list len mismatch (%d)", + *len, i); + + /* check the channel avoidance list */ + policy_mgr_update_with_safe_channel_list(pcl_channels, len, + pcl_weights, weight_len); + + return status; } /** @@ -492,7 +2047,35 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, bool policy_mgr_disallow_mcc(struct wlan_objmgr_psoc *psoc, uint8_t channel) { - return false; + uint32_t index = 0; + bool match = false; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return match; + } + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + while (PM_CONC_CONNECTION_LIST_VALID_INDEX(index)) { + if (policy_mgr_is_hw_dbs_capable(psoc) == false) { + if (pm_conc_connection_list[index].chan != + channel) { + match = true; + break; + } + } else if (WLAN_REG_IS_5GHZ_CH + (pm_conc_connection_list[index].chan)) { + if (pm_conc_connection_list[index].chan != channel) { + match = true; + break; + } + } + index++; + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return match; } /** @@ -510,7 +2093,44 @@ bool policy_mgr_disallow_mcc(struct wlan_objmgr_psoc *psoc, bool policy_mgr_allow_new_home_channel(struct wlan_objmgr_psoc *psoc, uint8_t channel, uint32_t num_connections) { - return true; + bool status = true; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return false; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + if ((num_connections == 2) && + (pm_conc_connection_list[0].chan != + pm_conc_connection_list[1].chan) && + (pm_conc_connection_list[0].mac == + pm_conc_connection_list[1].mac)) { + if (policy_mgr_is_hw_dbs_capable(psoc) == false) { + if ((channel != pm_conc_connection_list[0].chan) && + (channel != pm_conc_connection_list[1].chan)) { + policy_mgr_err("don't allow 3rd home channel on same MAC"); + status = false; + } + } else if (((WLAN_REG_IS_24GHZ_CH(channel)) && + (WLAN_REG_IS_24GHZ_CH + (pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_24GHZ_CH + (pm_conc_connection_list[1].chan))) || + ((WLAN_REG_IS_5GHZ_CH(channel)) && + (WLAN_REG_IS_5GHZ_CH + (pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH + (pm_conc_connection_list[1].chan)))) { + policy_mgr_err("don't allow 3rd home channel on same MAC"); + status = false; + } + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return status; } /** @@ -524,7 +2144,31 @@ bool policy_mgr_allow_new_home_channel(struct wlan_objmgr_psoc *psoc, */ bool policy_mgr_vht160_conn_exist(struct wlan_objmgr_psoc *psoc) { - return false; + uint32_t conn_index; + bool status = false; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return status; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; + conn_index++) { + if (pm_conc_connection_list[conn_index].in_use && + ((pm_conc_connection_list[conn_index].bw == + HW_MODE_80_PLUS_80_MHZ) || + (pm_conc_connection_list[conn_index].bw == + HW_MODE_160_MHZ))) { + status = true; + break; + } + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return status; } /** @@ -545,9 +2189,77 @@ bool policy_mgr_is_5g_channel_allowed(struct wlan_objmgr_psoc *psoc, uint8_t channel, uint32_t *list, enum policy_mgr_con_mode mode) { + uint32_t index = 0, count = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return false; + } + + count = policy_mgr_mode_specific_connection_count(psoc, mode, list); + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + while (index < count) { + if (wlan_reg_is_dfs_ch(psoc, + pm_conc_connection_list[list[index]].chan) && + WLAN_REG_IS_5GHZ_CH(channel) && + (channel != + pm_conc_connection_list[list[index]].chan)) { + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + policy_mgr_err("don't allow MCC if SAP/GO on DFS channel"); + return false; + } + index++; + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + return true; } +/** + * policy_mgr_nss_update_cb() - callback from SME confirming nss + * update + * @hdd_ctx: HDD Context + * @tx_status: tx completion status for updated beacon with new + * nss value + * @vdev_id: vdev id for the specific connection + * @next_action: next action to happen at policy mgr after + * beacon update + * @reason: Reason for nss update + * + * This function is the callback registered with SME at nss + * update request time + * + * Return: None + */ +static void policy_mgr_nss_update_cb(struct wlan_objmgr_psoc *psoc, + uint8_t tx_status, + uint8_t vdev_id, + uint8_t next_action, + enum policy_mgr_conn_update_reason reason) +{ + uint32_t conn_index = 0; + + if (QDF_STATUS_SUCCESS != tx_status) + policy_mgr_err("nss update failed(%d) for vdev %d", + tx_status, vdev_id); + + /* + * Check if we are ok to request for HW mode change now + */ + conn_index = policy_mgr_get_connection_for_vdev_id(psoc, vdev_id); + if (MAX_NUMBER_OF_CONC_CONNECTIONS == conn_index) { + policy_mgr_err("connection not found for vdev %d", vdev_id); + return; + } + + policy_mgr_debug("nss update successful for vdev:%d", vdev_id); + policy_mgr_next_actions(psoc, vdev_id, next_action, reason); + + return; +} + /** * policy_mgr_complete_action() - initiates actions needed on * current connections once channel has been decided for the new @@ -569,14 +2281,115 @@ QDF_STATUS policy_mgr_complete_action(struct wlan_objmgr_psoc *psoc, enum policy_mgr_conn_update_reason reason, uint32_t session_id) { - return QDF_STATUS_SUCCESS; + QDF_STATUS status = QDF_STATUS_E_FAILURE; + uint32_t index, count; + uint32_t list[MAX_NUMBER_OF_CONC_CONNECTIONS]; + uint32_t conn_index = 0; + uint32_t vdev_id; + uint32_t original_nss; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return status; + } + + if (policy_mgr_is_hw_dbs_capable(psoc) == false) { + policy_mgr_err("driver isn't dbs capable, no further action needed"); + return QDF_STATUS_E_NOSUPPORT; + } + + /* policy_mgr_complete_action() is called by policy_mgr_next_actions(). + * All other callers of policy_mgr_next_actions() have taken mutex + * protection. So, not taking any lock inside + * policy_mgr_complete_action() during pm_conc_connection_list access. + */ + count = policy_mgr_mode_specific_connection_count(psoc, + PM_P2P_GO_MODE, list); + for (index = 0; index < count; index++) { + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + vdev_id = pm_conc_connection_list[list[index]].vdev_id; + original_nss = + pm_conc_connection_list[list[index]].original_nss; + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + conn_index = policy_mgr_get_connection_for_vdev_id( + psoc, vdev_id); + if (MAX_NUMBER_OF_CONC_CONNECTIONS == conn_index) { + policy_mgr_err("connection not found for vdev %d", + vdev_id); + continue; + } + + if (2 == original_nss) { + status = pm_ctx->sme_cbacks.sme_nss_update_request( + vdev_id, new_nss, + policy_mgr_nss_update_cb, + next_action, psoc, reason); + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("sme_nss_update_request() failed for vdev %d", + vdev_id); + } + } + } + + count = policy_mgr_mode_specific_connection_count(psoc, + PM_SAP_MODE, list); + for (index = 0; index < count; index++) { + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + vdev_id = pm_conc_connection_list[list[index]].vdev_id; + original_nss = + pm_conc_connection_list[list[index]].original_nss; + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + conn_index = policy_mgr_get_connection_for_vdev_id( + psoc, vdev_id); + if (MAX_NUMBER_OF_CONC_CONNECTIONS == conn_index) { + policy_mgr_err("connection not found for vdev %d", + vdev_id); + continue; + } + if (2 == original_nss) { + status = pm_ctx->sme_cbacks.sme_nss_update_request( + vdev_id, new_nss, + policy_mgr_nss_update_cb, + next_action, psoc, reason); + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("sme_nss_update_request() failed for vdev %d", + vdev_id); + } + } + } + if (!QDF_IS_STATUS_SUCCESS(status)) + status = policy_mgr_next_actions(psoc, session_id, + next_action, reason); + + return status; } enum policy_mgr_con_mode policy_mgr_get_mode_by_vdev_id( struct wlan_objmgr_psoc *psoc, uint8_t vdev_id) { - return PM_MAX_NUM_OF_MODE; + enum policy_mgr_con_mode mode = PM_MAX_NUM_OF_MODE; + struct policy_mgr_psoc_priv_obj *pm_ctx; + uint32_t conn_index; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return mode; + } + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; + conn_index++) + if ((pm_conc_connection_list[conn_index].vdev_id == vdev_id) && + pm_conc_connection_list[conn_index].in_use){ + mode = pm_conc_connection_list[conn_index].mode; + break; + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return mode; } /** @@ -591,11 +2404,21 @@ enum policy_mgr_con_mode policy_mgr_get_mode_by_vdev_id( QDF_STATUS policy_mgr_init_connection_update( struct policy_mgr_psoc_priv_obj *pm_ctx) { + QDF_STATUS qdf_status; + + qdf_status = qdf_event_create(&pm_ctx->connection_update_done_evt); + + if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { + policy_mgr_err("init event failed"); + return QDF_STATUS_E_FAILURE; + } + return QDF_STATUS_SUCCESS; } /** - * policy_mgr_get_current_pref_hw_mode_dbs_2x2() - Get the current preferred hw mode + * policy_mgr_get_current_pref_hw_mode_dbs_2x2() - Get the + * current preferred hw mode * * Get the preferred hw mode based on the current connection combinations * @@ -606,11 +2429,106 @@ enum policy_mgr_conc_next_action policy_mgr_get_current_pref_hw_mode_dbs_2x2( struct wlan_objmgr_psoc *psoc) { - return PM_NOP; + uint32_t num_connections; + uint8_t band1, band2, band3; + struct policy_mgr_hw_mode_params hw_mode; + QDF_STATUS status; + + status = policy_mgr_get_current_hw_mode(psoc, &hw_mode); + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("policy_mgr_get_current_hw_mode failed"); + return PM_NOP; + } + + num_connections = policy_mgr_get_connection_count(psoc); + + policy_mgr_debug("chan[0]:%d chan[1]:%d chan[2]:%d num_connections:%d dbs:%d", + pm_conc_connection_list[0].chan, + pm_conc_connection_list[1].chan, + pm_conc_connection_list[2].chan, num_connections, + hw_mode.dbs_cap); + + /* If the band of operation of both the MACs is the same, + * single MAC is preferred, otherwise DBS is preferred. + */ + switch (num_connections) { + case 1: + band1 = reg_chan_to_band(pm_conc_connection_list[0].chan); + if (band1 == BAND_2G) + return PM_DBS; + else + return PM_NOP; + case 2: + band1 = reg_chan_to_band(pm_conc_connection_list[0].chan); + band2 = reg_chan_to_band(pm_conc_connection_list[1].chan); + if ((band1 == BAND_2G) || + (band2 == BAND_2G)) { + if (!hw_mode.dbs_cap) + return PM_DBS; + else + return PM_NOP; + } else if ((band1 == BAND_5G) && + (band2 == BAND_5G)) { + if (WLAN_REG_IS_CHANNEL_VALID_5G_SBS( + pm_conc_connection_list[0].chan, + pm_conc_connection_list[1].chan)) { + if (!hw_mode.sbs_cap) + return PM_SBS; + else + return PM_NOP; + } else { + if (hw_mode.sbs_cap || hw_mode.dbs_cap) + return PM_SINGLE_MAC; + else + return PM_NOP; + } + } else + return PM_NOP; + case 3: + band1 = reg_chan_to_band(pm_conc_connection_list[0].chan); + band2 = reg_chan_to_band(pm_conc_connection_list[1].chan); + band3 = reg_chan_to_band(pm_conc_connection_list[2].chan); + if ((band1 == BAND_2G) || + (band2 == BAND_2G) || + (band3 == BAND_2G)) { + if (!hw_mode.dbs_cap) + return PM_DBS; + else + return PM_NOP; + } else if ((band1 == BAND_5G) && + (band2 == BAND_5G) && + (band3 == BAND_5G)) { + if (WLAN_REG_IS_CHANNEL_VALID_5G_SBS( + pm_conc_connection_list[0].chan, + pm_conc_connection_list[2].chan) && + WLAN_REG_IS_CHANNEL_VALID_5G_SBS( + pm_conc_connection_list[1].chan, + pm_conc_connection_list[2].chan) && + WLAN_REG_IS_CHANNEL_VALID_5G_SBS( + pm_conc_connection_list[0].chan, + pm_conc_connection_list[1].chan)) { + if (!hw_mode.sbs_cap) + return PM_SBS; + else + return PM_NOP; + } else { + if (hw_mode.sbs_cap || hw_mode.dbs_cap) + return PM_SINGLE_MAC; + else + return PM_NOP; + } + } else + return PM_NOP; + default: + policy_mgr_err("unexpected num_connections value %d", + num_connections); + return PM_NOP; + } } /** - * policy_mgr_get_current_pref_hw_mode_dbs_1x1() - Get the current preferred hw mode + * policy_mgr_get_current_pref_hw_mode_dbs_1x1() - Get the + * current preferred hw mode * * Get the preferred hw mode based on the current connection combinations * @@ -621,7 +2539,79 @@ enum policy_mgr_conc_next_action policy_mgr_get_current_pref_hw_mode_dbs_1x1( struct wlan_objmgr_psoc *psoc) { - return PM_NOP; + uint32_t num_connections; + uint8_t band1, band2, band3; + struct policy_mgr_hw_mode_params hw_mode; + QDF_STATUS status; + enum policy_mgr_conc_next_action next_action; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return PM_NOP; + } + + status = policy_mgr_get_current_hw_mode(psoc, &hw_mode); + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("policy_mgr_get_current_hw_mode failed"); + return PM_NOP; + } + + num_connections = policy_mgr_get_connection_count(psoc); + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + policy_mgr_debug("chan[0]:%d chan[1]:%d chan[2]:%d num_connections:%d dbs:%d", + pm_conc_connection_list[0].chan, + pm_conc_connection_list[1].chan, + pm_conc_connection_list[2].chan, num_connections, + hw_mode.dbs_cap); + + /* If the band of operation of both the MACs is the same, + * single MAC is preferred, otherwise DBS is preferred. + */ + switch (num_connections) { + case 1: + /* The driver would already be in the required hw mode */ + next_action = PM_NOP; + break; + case 2: + band1 = reg_chan_to_band(pm_conc_connection_list[0].chan); + band2 = reg_chan_to_band(pm_conc_connection_list[1].chan); + if ((band1 == band2) && (hw_mode.dbs_cap)) + next_action = PM_SINGLE_MAC_UPGRADE; + else if ((band1 != band2) && (!hw_mode.dbs_cap)) + next_action = PM_DBS_DOWNGRADE; + else + next_action = PM_NOP; + + break; + + case 3: + band1 = reg_chan_to_band(pm_conc_connection_list[0].chan); + band2 = reg_chan_to_band(pm_conc_connection_list[1].chan); + band3 = reg_chan_to_band(pm_conc_connection_list[2].chan); + if (((band1 == band2) && (band2 == band3)) && + (hw_mode.dbs_cap)) { + next_action = PM_SINGLE_MAC_UPGRADE; + } else if (((band1 != band2) || (band2 != band3) || + (band1 != band3)) && + (!hw_mode.dbs_cap)) { + next_action = PM_DBS_DOWNGRADE; + } else { + next_action = PM_NOP; + } + break; + default: + policy_mgr_err("unexpected num_connections value %d", + num_connections); + next_action = PM_NOP; + break; + } + + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return next_action; } /** @@ -634,5 +2624,9 @@ enum policy_mgr_conc_next_action QDF_STATUS policy_mgr_reset_sap_mandatory_channels( struct policy_mgr_psoc_priv_obj *pm_ctx) { + pm_ctx->sap_mandatory_channels_len = 0; + qdf_mem_zero(pm_ctx->sap_mandatory_channels, + QDF_ARRAY_SIZE(pm_ctx->sap_mandatory_channels)); + return QDF_STATUS_SUCCESS; } diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index d9b3873d9ced..0787042f2ed3 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -387,6 +387,7 @@ void policy_mgr_set_pcl_for_existing_combo( void pm_dbs_opportunistic_timer_handler(void *data); enum policy_mgr_con_mode policy_mgr_get_mode(uint8_t type, uint8_t subtype); +enum hw_mode_bandwidth policy_mgr_get_bw(enum phy_ch_width chan_width); QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, enum policy_mgr_pcl_type pcl, uint8_t *pcl_channels, uint32_t *len, From 5ae4c436e6e5617c0ecc7a18a6936a380a300115 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Wed, 8 Mar 2017 09:15:15 -0800 Subject: [PATCH 008/187] qcacmn: Define DBS action functions of policy manager component Define DBS & concurrency action functions for policy manager component. Change-Id: I86cfb364e4753825ef650dc00a38d5226aa110ee CRs-Fixed: 2009818 --- src/wlan_policy_mgr_action.c | 723 ++++++++++++++++++++++++++++++++++- 1 file changed, 714 insertions(+), 9 deletions(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 41f994c0d241..3cd97c828bb1 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -50,6 +50,43 @@ void policy_mgr_hw_mode_transition_cb(uint32_t old_hw_mode_index, struct policy_mgr_vdev_mac_map *vdev_mac_map, struct wlan_objmgr_psoc *context) { + QDF_STATUS status; + struct policy_mgr_hw_mode_params hw_mode; + uint32_t i; + + if (!vdev_mac_map) { + policy_mgr_err("vdev_mac_map is NULL"); + return; + } + + policy_mgr_notice("old_hw_mode_index=%d, new_hw_mode_index=%d", + old_hw_mode_index, new_hw_mode_index); + + for (i = 0; i < num_vdev_mac_entries; i++) + policy_mgr_notice("vdev_id:%d mac_id:%d", + vdev_mac_map[i].vdev_id, + vdev_mac_map[i].mac_id); + + status = policy_mgr_get_hw_mode_from_idx(context, + new_hw_mode_index, &hw_mode); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("Get HW mode failed: %d", status); + return; + } + + policy_mgr_notice("MAC0: TxSS:%d, RxSS:%d, Bw:%d", + hw_mode.mac0_tx_ss, hw_mode.mac0_rx_ss, hw_mode.mac0_bw); + policy_mgr_notice("MAC1: TxSS:%d, RxSS:%d, Bw:%d", + hw_mode.mac1_tx_ss, hw_mode.mac1_rx_ss, hw_mode.mac1_bw); + policy_mgr_notice("DBS:%d, Agile DFS:%d, SBS:%d", + hw_mode.dbs_cap, hw_mode.agile_dfs_cap, hw_mode.sbs_cap); + + /* update pm_conc_connection_list */ + policy_mgr_update_hw_mode_conn_info(context, num_vdev_mac_entries, + vdev_mac_map, + hw_mode); + + return; } QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc, @@ -63,18 +100,199 @@ QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc, enum hw_mode_sbs_capab sbs, enum policy_mgr_conn_update_reason reason) { + int8_t hw_mode_index; + struct policy_mgr_hw_mode msg; + QDF_STATUS status; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return QDF_STATUS_E_FAILURE; + } + + /* + * if HW is not capable of doing 2x2 or ini config disabled 2x2, don't + * allow to request FW for 2x2 + */ + if ((HW_MODE_SS_2x2 == mac0_ss) && (!pm_ctx->enable2x2)) { + policy_mgr_notice("2x2 is not allowed downgrading to 1x1 for mac0"); + mac0_ss = HW_MODE_SS_1x1; + } + if ((HW_MODE_SS_2x2 == mac1_ss) && (!pm_ctx->enable2x2)) { + policy_mgr_notice("2x2 is not allowed downgrading to 1x1 for mac1"); + mac1_ss = HW_MODE_SS_1x1; + } + + hw_mode_index = policy_mgr_get_hw_mode_idx_from_dbs_hw_list(psoc, + mac0_ss, mac0_bw, mac1_ss, mac1_bw, dbs, dfs, sbs); + if (hw_mode_index < 0) { + policy_mgr_err("Invalid HW mode index obtained"); + return QDF_STATUS_E_FAILURE; + } + + msg.hw_mode_index = hw_mode_index; + msg.set_hw_mode_cb = (void *)policy_mgr_pdev_set_hw_mode_cb; + msg.reason = reason; + msg.session_id = session_id; + + policy_mgr_notice("set hw mode to sme: hw_mode_index: %d session:%d reason:%d", + msg.hw_mode_index, msg.session_id, msg.reason); + + status = pm_ctx->sme_cbacks.sme_pdev_set_hw_mode(msg); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("Failed to set hw mode to SME"); + return status; + } + return QDF_STATUS_SUCCESS; } enum policy_mgr_conc_next_action policy_mgr_need_opportunistic_upgrade( struct wlan_objmgr_psoc *psoc) { - return PM_NOP; + uint32_t conn_index; + enum policy_mgr_conc_next_action upgrade = PM_NOP; + uint8_t mac = 0; + struct policy_mgr_hw_mode_params hw_mode; + QDF_STATUS status = QDF_STATUS_E_FAILURE; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + goto done; + } + + if (policy_mgr_is_hw_dbs_capable(psoc) == false) { + policy_mgr_err("driver isn't dbs capable, no further action needed"); + goto done; + } + + status = policy_mgr_get_current_hw_mode(psoc, &hw_mode); + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("policy_mgr_get_current_hw_mode failed"); + goto done; + } + if (!hw_mode.dbs_cap) { + policy_mgr_notice("current HW mode is non-DBS capable"); + goto done; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + /* Are both mac's still in use */ + for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; + conn_index++) { + policy_mgr_debug("index:%d mac:%d in_use:%d chan:%d org_nss:%d", + conn_index, + pm_conc_connection_list[conn_index].mac, + pm_conc_connection_list[conn_index].in_use, + pm_conc_connection_list[conn_index].chan, + pm_conc_connection_list[conn_index].original_nss); + if ((pm_conc_connection_list[conn_index].mac == 0) && + pm_conc_connection_list[conn_index].in_use) { + mac |= POLICY_MGR_MAC0; + if (POLICY_MGR_MAC0_AND_MAC1 == mac) { + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + goto done; + } + } else if ((pm_conc_connection_list[conn_index].mac == 1) && + pm_conc_connection_list[conn_index].in_use) { + mac |= POLICY_MGR_MAC1; + if (POLICY_MGR_MAC0_AND_MAC1 == mac) { + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + goto done; + } + } + } + /* Let's request for single MAC mode */ + upgrade = PM_SINGLE_MAC; + /* Is there any connection had an initial connection with 2x2 */ + for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; + conn_index++) { + if ((pm_conc_connection_list[conn_index].original_nss == 2) && + pm_conc_connection_list[conn_index].in_use) { + upgrade = PM_SINGLE_MAC_UPGRADE; + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + goto done; + } + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + +done: + return upgrade; } QDF_STATUS policy_mgr_update_connection_info(struct wlan_objmgr_psoc *psoc, uint32_t vdev_id) { + QDF_STATUS status = QDF_STATUS_E_FAILURE; + uint32_t conn_index = 0; + bool found = false; + struct policy_mgr_vdev_entry_info conn_table_entry; + enum policy_mgr_chain_mode chain_mask = POLICY_MGR_ONE_ONE; + uint8_t nss_2g, nss_5g; + enum policy_mgr_con_mode mode; + uint8_t chan; + uint32_t nss = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return status; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { + if (vdev_id == pm_conc_connection_list[conn_index].vdev_id) { + /* debug msg */ + found = true; + break; + } + conn_index++; + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + if (!found) { + /* err msg */ + policy_mgr_err("can't find vdev_id %d in pm_conc_connection_list", + vdev_id); + return status; + } + + status = pm_ctx->wma_cbacks.wma_get_connection_info( + vdev_id, &conn_table_entry); + if (QDF_STATUS_SUCCESS != status) { + policy_mgr_err("can't find vdev_id %d in connection table", + vdev_id); + return status; + } + mode = policy_mgr_get_mode(conn_table_entry.type, + conn_table_entry.sub_type); + chan = reg_freq_to_chan(conn_table_entry.mhz); + status = policy_mgr_get_nss_for_vdev(psoc, mode, &nss_2g, &nss_5g); + if (QDF_IS_STATUS_SUCCESS(status)) { + if ((WLAN_REG_IS_24GHZ_CH(chan) && (nss_2g > 1)) || + (WLAN_REG_IS_5GHZ_CH(chan) && (nss_5g > 1))) + chain_mask = POLICY_MGR_TWO_TWO; + else + chain_mask = POLICY_MGR_ONE_ONE; + nss = (WLAN_REG_IS_24GHZ_CH(chan)) ? nss_2g : nss_5g; + } else { + policy_mgr_err("Error in getting nss"); + } + + policy_mgr_debug("update PM connection table for vdev:%d", vdev_id); + + /* add the entry */ + policy_mgr_update_conc_list(psoc, conn_index, + mode, + chan, + policy_mgr_get_bw(conn_table_entry.chan_width), + conn_table_entry.mac_id, + chain_mask, + nss, vdev_id, true); + return QDF_STATUS_SUCCESS; } @@ -84,6 +302,31 @@ QDF_STATUS policy_mgr_update_and_wait_for_connection_update( uint8_t channel, enum policy_mgr_conn_update_reason reason) { + QDF_STATUS status; + + policy_mgr_debug("session:%d channel:%d reason:%d", + session_id, channel, reason); + + status = policy_mgr_reset_connection_update(psoc); + if (QDF_IS_STATUS_ERROR(status)) + policy_mgr_err("clearing event failed"); + + status = policy_mgr_current_connections_update(psoc, + session_id, channel, reason); + if (QDF_STATUS_E_FAILURE == status) { + policy_mgr_err("connections update failed"); + return QDF_STATUS_E_FAILURE; + } + + /* Wait only when status is success */ + if (QDF_IS_STATUS_SUCCESS(status)) { + status = policy_mgr_wait_for_connection_update(psoc); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("qdf wait for event failed"); + return QDF_STATUS_E_FAILURE; + } + } + return QDF_STATUS_SUCCESS; } @@ -92,7 +335,78 @@ QDF_STATUS policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc, uint8_t channel, enum policy_mgr_conn_update_reason reason) { - return QDF_STATUS_SUCCESS; + enum policy_mgr_conc_next_action next_action = PM_NOP; + uint32_t num_connections = 0; + enum policy_mgr_one_connection_mode second_index = 0; + enum policy_mgr_two_connection_mode third_index = 0; + enum policy_mgr_band band; + QDF_STATUS status = QDF_STATUS_E_FAILURE; + + if (policy_mgr_is_hw_dbs_capable(psoc) == false) { + policy_mgr_err("driver isn't dbs capable, no further action needed"); + return QDF_STATUS_E_NOSUPPORT; + } + if (WLAN_REG_IS_24GHZ_CH(channel)) + band = POLICY_MGR_BAND_24; + else + band = POLICY_MGR_BAND_5; + + num_connections = policy_mgr_get_connection_count(psoc); + + policy_mgr_debug("num_connections=%d channel=%d", + num_connections, channel); + + switch (num_connections) { + case 0: + if (band == POLICY_MGR_BAND_24) + if (policy_mgr_is_hw_dbs_2x2_capable(psoc)) + next_action = PM_DBS; + else + next_action = PM_NOP; + else + next_action = PM_NOP; + break; + case 1: + second_index = + policy_mgr_get_second_connection_pcl_table_index(psoc); + if (PM_MAX_ONE_CONNECTION_MODE == second_index) { + policy_mgr_err( + "couldn't find index for 2nd connection next action table"); + goto done; + } + next_action = + (*next_action_two_connection_table)[second_index][band]; + break; + case 2: + third_index = + policy_mgr_get_third_connection_pcl_table_index(psoc); + if (PM_MAX_TWO_CONNECTION_MODE == third_index) { + policy_mgr_err( + "couldn't find index for 3rd connection next action table"); + goto done; + } + next_action = (*next_action_three_connection_table) + [third_index][band]; + break; + default: + policy_mgr_err("unexpected num_connections value %d", + num_connections); + break; + } + + if (PM_NOP != next_action) + status = policy_mgr_next_actions(psoc, session_id, + next_action, reason); + else + status = QDF_STATUS_E_NOSUPPORT; + + policy_mgr_debug( + "idx2=%d idx3=%d next_action=%d, band=%d status=%d reason=%d session_id=%d", + second_index, third_index, next_action, band, status, + reason, session_id); + +done: + return status; } QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, @@ -100,13 +414,164 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, enum policy_mgr_conc_next_action action, enum policy_mgr_conn_update_reason reason) { - return QDF_STATUS_SUCCESS; + QDF_STATUS status = QDF_STATUS_E_FAILURE; + struct policy_mgr_hw_mode_params hw_mode; + + if (policy_mgr_is_hw_dbs_capable(psoc) == false) { + policy_mgr_err("driver isn't dbs capable, no further action needed"); + return QDF_STATUS_E_NOSUPPORT; + } + + /* check for the current HW index to see if really need any action */ + status = policy_mgr_get_current_hw_mode(psoc, &hw_mode); + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("policy_mgr_get_current_hw_mode failed"); + return status; + } + /** + * if already in DBS no need to request DBS. Might be needed + * to extend the logic when multiple dbs HW mode is available + */ + if ((((PM_DBS_DOWNGRADE == action) || (PM_DBS == action) || + (PM_DBS_UPGRADE == action)) + && hw_mode.dbs_cap)) { + policy_mgr_err("driver is already in %s mode, no further action needed", + (hw_mode.dbs_cap) ? "dbs" : "non dbs"); + return QDF_STATUS_E_ALREADY; + } + + if ((PM_SBS == action) || (action == PM_SBS_DOWNGRADE)) { + if (!policy_mgr_is_hw_sbs_capable(psoc)) { + /* No action */ + policy_mgr_notice("firmware is not sbs capable"); + return QDF_STATUS_SUCCESS; + } + /* check if current mode is already SBS nothing to be + * done + */ + + } + + switch (action) { + case PM_DBS_DOWNGRADE: + /* + * check if we have a beaconing entity that is using 2x2. If yes, + * update the beacon template & notify FW. Once FW confirms + * beacon updated, send down the HW mode change req + */ + status = policy_mgr_complete_action(psoc, POLICY_MGR_RX_NSS_1, + PM_DBS, reason, session_id); + break; + case PM_DBS: + if (policy_mgr_is_hw_dbs_2x2_capable(psoc)) + status = policy_mgr_pdev_set_hw_mode(psoc, session_id, + HW_MODE_SS_2x2, + HW_MODE_80_MHZ, + HW_MODE_SS_2x2, HW_MODE_40_MHZ, + HW_MODE_DBS, + HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS_NONE, + reason); + else + status = policy_mgr_pdev_set_hw_mode(psoc, session_id, + HW_MODE_SS_1x1, + HW_MODE_80_MHZ, + HW_MODE_SS_1x1, HW_MODE_40_MHZ, + HW_MODE_DBS, + HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS_NONE, + reason); + break; + case PM_SINGLE_MAC_UPGRADE: + /* + * change the HW mode first before the NSS upgrade + */ + status = policy_mgr_pdev_set_hw_mode(psoc, session_id, + HW_MODE_SS_2x2, + HW_MODE_80_MHZ, + HW_MODE_SS_0x0, HW_MODE_BW_NONE, + HW_MODE_DBS_NONE, + HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS_NONE, + reason); + /* + * check if we have a beaconing entity that advertised 2x2 + * intially. If yes, update the beacon template & notify FW. + * Once FW confirms beacon updated, send the HW mode change req + */ + status = policy_mgr_complete_action(psoc, POLICY_MGR_RX_NSS_2, + PM_SINGLE_MAC, reason, session_id); + break; + case PM_SINGLE_MAC: + status = policy_mgr_pdev_set_hw_mode(psoc, session_id, + HW_MODE_SS_2x2, + HW_MODE_80_MHZ, + HW_MODE_SS_0x0, HW_MODE_BW_NONE, + HW_MODE_DBS_NONE, + HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS_NONE, + reason); + break; + case PM_DBS_UPGRADE: + status = policy_mgr_pdev_set_hw_mode(psoc, session_id, + HW_MODE_SS_2x2, + HW_MODE_80_MHZ, + HW_MODE_SS_2x2, HW_MODE_80_MHZ, + HW_MODE_DBS, + HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS_NONE, + reason); + + status = policy_mgr_complete_action(psoc, POLICY_MGR_RX_NSS_2, + PM_DBS, reason, session_id); + break; + case PM_SBS_DOWNGRADE: + status = policy_mgr_complete_action(psoc, POLICY_MGR_RX_NSS_1, + PM_SBS, reason, session_id); + break; + case PM_SBS: + status = policy_mgr_pdev_set_hw_mode(psoc, session_id, + HW_MODE_SS_1x1, + HW_MODE_80_MHZ, + HW_MODE_SS_1x1, HW_MODE_80_MHZ, + HW_MODE_DBS, + HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS, + reason); + break; + default: + policy_mgr_err("unexpected action value %d", action); + status = QDF_STATUS_E_FAILURE; + break; + } + + return status; } QDF_STATUS policy_mgr_handle_conc_multiport(struct wlan_objmgr_psoc *psoc, uint8_t session_id, uint8_t channel) { - return QDF_STATUS_SUCCESS; + QDF_STATUS status; + + if (!policy_mgr_check_for_session_conc(psoc, session_id, channel)) { + policy_mgr_err("Conc not allowed for the session %d", + session_id); + return QDF_STATUS_E_FAILURE; + } + + status = policy_mgr_reset_connection_update(psoc); + if (!QDF_IS_STATUS_SUCCESS(status)) + policy_mgr_err("clearing event failed"); + + status = policy_mgr_current_connections_update(psoc, session_id, + channel, + POLICY_MGR_UPDATE_REASON_NORMAL_STA); + if (QDF_STATUS_E_FAILURE == status) { + policy_mgr_err("connections update failed"); + return status; + } + + return status; } #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH @@ -131,23 +596,99 @@ void policy_mgr_change_sap_channel_with_csa(struct wlan_objmgr_psoc *psoc) QDF_STATUS policy_mgr_wait_for_connection_update(struct wlan_objmgr_psoc *psoc) { + QDF_STATUS status; + struct policy_mgr_psoc_priv_obj *policy_mgr_context; + + policy_mgr_context = policy_mgr_get_context(psoc); + if (!policy_mgr_context) { + policy_mgr_err("Invalid context"); + return QDF_STATUS_E_FAILURE; + } + + status = qdf_wait_single_event( + &policy_mgr_context->connection_update_done_evt, + CONNECTION_UPDATE_TIMEOUT); + + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("wait for event failed"); + return QDF_STATUS_E_FAILURE; + } + return QDF_STATUS_SUCCESS; } QDF_STATUS policy_mgr_reset_connection_update(struct wlan_objmgr_psoc *psoc) { + QDF_STATUS status; + struct policy_mgr_psoc_priv_obj *policy_mgr_context; + + policy_mgr_context = policy_mgr_get_context(psoc); + if (!policy_mgr_context) { + policy_mgr_err("Invalid context"); + return QDF_STATUS_E_FAILURE; + } + + status = qdf_event_reset( + &policy_mgr_context->connection_update_done_evt); + + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("clear event failed"); + return QDF_STATUS_E_FAILURE; + } + return QDF_STATUS_SUCCESS; } QDF_STATUS policy_mgr_set_connection_update(struct wlan_objmgr_psoc *psoc) { + QDF_STATUS status; + struct policy_mgr_psoc_priv_obj *policy_mgr_context; + + policy_mgr_context = policy_mgr_get_context(psoc); + if (!policy_mgr_context) { + policy_mgr_err("Invalid context"); + return QDF_STATUS_E_FAILURE; + } + + status = qdf_event_set(&policy_mgr_context->connection_update_done_evt); + + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("set event failed"); + return QDF_STATUS_E_FAILURE; + } + return QDF_STATUS_SUCCESS; } QDF_STATUS policy_mgr_restart_opportunistic_timer( struct wlan_objmgr_psoc *psoc, bool check_state) { - return QDF_STATUS_SUCCESS; + QDF_STATUS status = QDF_STATUS_E_FAILURE; + struct policy_mgr_psoc_priv_obj *policy_mgr_ctx; + + policy_mgr_ctx = policy_mgr_get_context(psoc); + if (!policy_mgr_ctx) { + policy_mgr_err("Invalid context"); + return status; + } + + if (check_state && + QDF_TIMER_STATE_RUNNING != + policy_mgr_ctx->dbs_opportunistic_timer.state) + return status; + + qdf_mc_timer_stop(&policy_mgr_ctx->dbs_opportunistic_timer); + + status = qdf_mc_timer_start( + &policy_mgr_ctx->dbs_opportunistic_timer, + DBS_OPPORTUNISTIC_TIME * 1000); + + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("failed to start opportunistic timer"); + return status; + } + + return status; } #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH @@ -155,12 +696,32 @@ QDF_STATUS policy_mgr_register_sap_restart_channel_switch_cb( struct wlan_objmgr_psoc *psoc, void (*sap_restart_chan_switch_cb)(void *, uint32_t, uint32_t)) { + struct policy_mgr_psoc_priv_obj *policy_mgr_ctx; + + policy_mgr_ctx = policy_mgr_get_context(psoc); + if (!policy_mgr_ctx) { + policy_mgr_err("Invalid context"); + return QDF_STATUS_E_FAILURE; + } + + policy_mgr_ctx->sap_restart_chan_switch_cb = sap_restart_chan_switch_cb; + return QDF_STATUS_SUCCESS; } QDF_STATUS policy_mgr_deregister_sap_restart_channel_switch_cb( struct wlan_objmgr_psoc *psoc) { + struct policy_mgr_psoc_priv_obj *policy_mgr_ctx; + + policy_mgr_ctx = policy_mgr_get_context(psoc); + if (!policy_mgr_ctx) { + policy_mgr_err("Invalid context"); + return QDF_STATUS_E_FAILURE; + } + + policy_mgr_ctx->sap_restart_chan_switch_cb = NULL; + return QDF_STATUS_SUCCESS; } @@ -169,12 +730,77 @@ QDF_STATUS policy_mgr_deregister_sap_restart_channel_switch_cb( QDF_STATUS policy_mgr_set_hw_mode_on_channel_switch( struct wlan_objmgr_psoc *psoc, uint8_t session_id) { - return QDF_STATUS_SUCCESS; + QDF_STATUS status = QDF_STATUS_E_FAILURE, qdf_status; + enum policy_mgr_conc_next_action action; + + if (!policy_mgr_is_hw_dbs_capable(psoc)) { + policy_mgr_err("PM/DBS is disabled"); + return status; + } + + action = (*policy_mgr_get_current_pref_hw_mode_ptr)(psoc); + if ((action != PM_DBS_DOWNGRADE) && + (action != PM_SINGLE_MAC_UPGRADE)) { + policy_mgr_err("Invalid action: %d", action); + status = QDF_STATUS_SUCCESS; + goto done; + } + + policy_mgr_notice("action:%d session id:%d", action, session_id); + + /* Opportunistic timer is started, PM will check if MCC upgrade can be + * done on timer expiry. This avoids any possible ping pong effect + * as well. + */ + if (action == PM_SINGLE_MAC_UPGRADE) { + qdf_status = policy_mgr_restart_opportunistic_timer( + psoc, false); + if (QDF_IS_STATUS_SUCCESS(qdf_status)) + policy_mgr_notice("opportunistic timer for MCC upgrade"); + goto done; + } + + /* For DBS, we want to move right away to DBS mode */ + status = policy_mgr_next_actions(psoc, session_id, action, + POLICY_MGR_UPDATE_REASON_CHANNEL_SWITCH); + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("no set hw mode command was issued"); + goto done; + } +done: + /* success must be returned only when a set hw mode was done */ + return status; } void policy_mgr_checkn_update_hw_mode_single_mac_mode( struct wlan_objmgr_psoc *psoc, uint8_t channel) { + uint8_t i; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (i = 0; i < MAX_NUMBER_OF_CONC_CONNECTIONS; i++) { + if (pm_conc_connection_list[i].in_use) + if (!WLAN_REG_IS_SAME_BAND_CHANNELS(channel, + pm_conc_connection_list[i].chan)) { + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + policy_mgr_notice("DBS required"); + return; + } + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + if (QDF_TIMER_STATE_RUNNING == + pm_ctx->dbs_opportunistic_timer.state) + qdf_mc_timer_stop(&pm_ctx->dbs_opportunistic_timer); + + pm_dbs_opportunistic_timer_handler((void *)psoc); } void policy_mgr_set_hw_mode_change_in_progress( @@ -201,6 +827,39 @@ QDF_STATUS policy_mgr_update_connection_info_utfw( uint32_t chain_mask, uint32_t type, uint32_t sub_type, uint32_t channelid, uint32_t mac_id) { + QDF_STATUS status = QDF_STATUS_E_FAILURE; + uint32_t conn_index = 0, found = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return status; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { + if (vdev_id == pm_conc_connection_list[conn_index].vdev_id) { + /* debug msg */ + found = 1; + break; + } + conn_index++; + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + if (!found) { + /* err msg */ + policy_mgr_err("can't find vdev_id %d in pm_conc_connection_list", + vdev_id); + return status; + } + policy_mgr_notice("--> updating entry at index[%d]", conn_index); + + policy_mgr_update_conc_list(psoc, conn_index, + policy_mgr_get_mode(type, sub_type), + channelid, HW_MODE_20_MHZ, + mac_id, chain_mask, 0, vdev_id, true); + return QDF_STATUS_SUCCESS; } @@ -209,12 +868,41 @@ QDF_STATUS policy_mgr_incr_connection_count_utfw(struct wlan_objmgr_psoc *psoc, uint32_t chain_mask, uint32_t type, uint32_t sub_type, uint32_t channelid, uint32_t mac_id) { + QDF_STATUS status = QDF_STATUS_E_FAILURE; + uint32_t conn_index = 0; + + conn_index = policy_mgr_get_connection_count(psoc); + if (MAX_NUMBER_OF_CONC_CONNECTIONS <= conn_index) { + /* err msg */ + policy_mgr_err("exceeded max connection limit %d", + MAX_NUMBER_OF_CONC_CONNECTIONS); + return status; + } + policy_mgr_notice("--> filling entry at index[%d]", conn_index); + + policy_mgr_update_conc_list(psoc, conn_index, + policy_mgr_get_mode(type, sub_type), + channelid, HW_MODE_20_MHZ, + mac_id, chain_mask, 0, vdev_id, true); + return QDF_STATUS_SUCCESS; } QDF_STATUS policy_mgr_decr_connection_count_utfw(struct wlan_objmgr_psoc *psoc, uint32_t del_all, uint32_t vdev_id) { + QDF_STATUS status; + + if (del_all) { + status = policy_mgr_psoc_enable(psoc); + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("Policy manager initialization failed"); + return QDF_STATUS_E_FAILURE; + } + } else { + policy_mgr_decr_connection_count(psoc, vdev_id); + } + return QDF_STATUS_SUCCESS; } @@ -222,20 +910,37 @@ enum policy_mgr_pcl_type policy_mgr_get_pcl_from_first_conn_table( enum policy_mgr_con_mode type, enum policy_mgr_conc_priority_mode sys_pref) { - return PM_NONE; + if ((sys_pref >= PM_MAX_CONC_PRIORITY_MODE) || + (type >= PM_MAX_NUM_OF_MODE)) + return PM_MAX_PCL_TYPE; + return first_connection_pcl_table[type][sys_pref]; } enum policy_mgr_pcl_type policy_mgr_get_pcl_from_second_conn_table( enum policy_mgr_one_connection_mode idx, enum policy_mgr_con_mode type, enum policy_mgr_conc_priority_mode sys_pref, uint8_t dbs_capable) { - return PM_NONE; + if ((idx >= PM_MAX_ONE_CONNECTION_MODE) || + (sys_pref >= PM_MAX_CONC_PRIORITY_MODE) || + (type >= PM_MAX_NUM_OF_MODE)) + return PM_MAX_PCL_TYPE; + if (dbs_capable) + return (*second_connection_pcl_dbs_table)[idx][type][sys_pref]; + else + return second_connection_pcl_nodbs_table[idx][type][sys_pref]; } enum policy_mgr_pcl_type policy_mgr_get_pcl_from_third_conn_table( enum policy_mgr_two_connection_mode idx, enum policy_mgr_con_mode type, enum policy_mgr_conc_priority_mode sys_pref, uint8_t dbs_capable) { - return PM_NONE; + if ((idx >= PM_MAX_TWO_CONNECTION_MODE) || + (sys_pref >= PM_MAX_CONC_PRIORITY_MODE) || + (type >= PM_MAX_NUM_OF_MODE)) + return PM_MAX_PCL_TYPE; + if (dbs_capable) + return (*third_connection_pcl_dbs_table)[idx][type][sys_pref]; + else + return third_connection_pcl_nodbs_table[idx][type][sys_pref]; } #endif From 58a0b196321d3e8dd85c77bbb0969036d9bcbf8e Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Wed, 8 Mar 2017 09:56:33 -0800 Subject: [PATCH 009/187] qcacmn: Define utility functions of policy manager component Part 1 Define utility functions for policy manager component. Change-Id: I78d48c6347e7f7d8ebebeaf85c807ba6b1b044e0 CRs-Fixed: 2009818 --- src/wlan_policy_mgr_get_set_utils.c | 412 +++++++++++++++++++++++++++- 1 file changed, 406 insertions(+), 6 deletions(-) diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 52a4b0a2ce20..1309ff00fa41 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -42,60 +42,352 @@ bool policy_mgr_get_dbs_plus_agile_scan_config(struct wlan_objmgr_psoc *psoc) { - return false; + uint32_t scan_config; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + if (policy_mgr_is_dual_mac_disabled_in_ini(psoc)) + return false; + + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + /* We take that it is disabled and proceed */ + return false; + } + scan_config = pm_ctx->dual_mac_cfg.cur_scan_config; + + return WMI_DBS_CONC_SCAN_CFG_AGILE_SCAN_GET(scan_config); } bool policy_mgr_get_single_mac_scan_with_dfs_config( struct wlan_objmgr_psoc *psoc) { - return false; + uint32_t scan_config; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + if (policy_mgr_is_dual_mac_disabled_in_ini(psoc)) + return false; + + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + /* We take that it is disabled and proceed */ + return false; + } + scan_config = pm_ctx->dual_mac_cfg.cur_scan_config; + + return WMI_DBS_CONC_SCAN_CFG_AGILE_DFS_SCAN_GET(scan_config); } int8_t policy_mgr_get_num_dbs_hw_modes(struct wlan_objmgr_psoc *psoc) { - return 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return -EINVAL; + } + return pm_ctx->num_dbs_hw_modes; } bool policy_mgr_is_hw_dbs_capable(struct wlan_objmgr_psoc *psoc) { + uint32_t param, i, found = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return false; + } + + if (!policy_mgr_is_dbs_enable(psoc)) { + policy_mgr_notice("DBS is disabled"); + return false; + } + + policy_mgr_notice("DBS service bit map: %d", + pm_ctx->wma_cbacks.wma_is_service_enabled( + WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT)); + + /* The agreement with FW is that: To know if the target is DBS + * capable, DBS needs to be supported both in the HW mode list + * and in the service ready event + */ + if (!(pm_ctx->wma_cbacks.wma_is_service_enabled( + WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT))) + return false; + + for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { + param = pm_ctx->hw_mode.hw_mode_list[i]; + policy_mgr_notice("HW param: %x", param); + if (POLICY_MGR_HW_MODE_DBS_MODE_GET(param)) { + policy_mgr_notice("HW (%d) is DBS capable", i); + found = 1; + break; + } + } + + if (found) + return true; + return false; } bool policy_mgr_is_hw_sbs_capable(struct wlan_objmgr_psoc *psoc) { + uint32_t param, i, found = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return false; + } + + policy_mgr_notice("SBS service bit map: %d", + pm_ctx->wma_cbacks.wma_is_service_enabled( + WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT)); + + /* The agreement with FW is that: To know if the target is SBS + * capable, SBS needs to be supported both in the HW mode list + * and DBS needs to be supported in the service ready event + */ + if (!(pm_ctx->wma_cbacks.wma_is_service_enabled( + WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT))) + return false; + + for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { + param = pm_ctx->hw_mode.hw_mode_list[i]; + policy_mgr_notice("HW param: %x", param); + if (POLICY_MGR_HW_MODE_SBS_MODE_GET(param)) { + policy_mgr_notice("HW (%d) is SBS capable", i); + found = 1; + break; + } + } + + if (found) + return true; + return true; } QDF_STATUS policy_mgr_get_dbs_hw_modes(struct wlan_objmgr_psoc *psoc, bool *one_by_one_dbs, bool *two_by_two_dbs) { + struct policy_mgr_psoc_priv_obj *pm_ctx; + uint32_t i; + int8_t found_one_by_one = -EINVAL, found_two_by_two = -EINVAL; + uint32_t conf1_tx_ss, conf1_rx_ss; + uint32_t conf2_tx_ss, conf2_rx_ss; + + *one_by_one_dbs = false; + *two_by_two_dbs = false; + + if (policy_mgr_is_hw_dbs_capable(psoc) == false) { + policy_mgr_err("HW is not DBS capable"); + /* Caller will understand that DBS is disabled */ + return QDF_STATUS_SUCCESS; + + } + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + /* To check 1x1 capability */ + policy_mgr_get_tx_rx_ss_from_config(HW_MODE_SS_1x1, + &conf1_tx_ss, &conf1_rx_ss); + /* To check 2x2 capability */ + policy_mgr_get_tx_rx_ss_from_config(HW_MODE_SS_2x2, + &conf2_tx_ss, &conf2_rx_ss); + + for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { + uint32_t t_conf0_tx_ss, t_conf0_rx_ss; + uint32_t t_conf1_tx_ss, t_conf1_rx_ss; + uint32_t dbs_mode; + + t_conf0_tx_ss = POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_GET( + pm_ctx->hw_mode.hw_mode_list[i]); + t_conf0_rx_ss = POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_GET( + pm_ctx->hw_mode.hw_mode_list[i]); + t_conf1_tx_ss = POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_GET( + pm_ctx->hw_mode.hw_mode_list[i]); + t_conf1_rx_ss = POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_GET( + pm_ctx->hw_mode.hw_mode_list[i]); + dbs_mode = POLICY_MGR_HW_MODE_DBS_MODE_GET( + pm_ctx->hw_mode.hw_mode_list[i]); + + if (((((t_conf0_tx_ss == conf1_tx_ss) && + (t_conf0_rx_ss == conf1_rx_ss)) || + ((t_conf1_tx_ss == conf1_tx_ss) && + (t_conf1_rx_ss == conf1_rx_ss))) && + (dbs_mode == HW_MODE_DBS)) && + (found_one_by_one < 0)) { + found_one_by_one = i; + policy_mgr_notice("1x1 hw_mode index %d found", i); + /* Once an entry is found, need not check for 1x1 + * again + */ + continue; + } + + if (((((t_conf0_tx_ss == conf2_tx_ss) && + (t_conf0_rx_ss == conf2_rx_ss)) || + ((t_conf1_tx_ss == conf2_tx_ss) && + (t_conf1_rx_ss == conf2_rx_ss))) && + (dbs_mode == HW_MODE_DBS)) && + (found_two_by_two < 0)) { + found_two_by_two = i; + policy_mgr_notice("2x2 hw_mode index %d found", i); + /* Once an entry is found, need not check for 2x2 + * again + */ + continue; + } + } + + if (found_one_by_one >= 0) + *one_by_one_dbs = true; + if (found_two_by_two >= 0) + *two_by_two_dbs = true; + return QDF_STATUS_SUCCESS; } QDF_STATUS policy_mgr_get_current_hw_mode(struct wlan_objmgr_psoc *psoc, struct policy_mgr_hw_mode_params *hw_mode) { + QDF_STATUS status; + uint32_t old_hw_index = 0, new_hw_index = 0; + + policy_mgr_notice("Get the current hw mode"); + + status = policy_mgr_get_old_and_new_hw_index(psoc, &old_hw_index, + &new_hw_index); + if (QDF_STATUS_SUCCESS != status) { + policy_mgr_err("Failed to get HW mode index"); + return QDF_STATUS_E_FAILURE; + } + + if (new_hw_index == POLICY_MGR_DEFAULT_HW_MODE_INDEX) { + policy_mgr_err("HW mode is not yet initialized"); + return QDF_STATUS_E_FAILURE; + } + + status = policy_mgr_get_hw_mode_from_idx(psoc, new_hw_index, hw_mode); + if (QDF_STATUS_SUCCESS != status) { + policy_mgr_err("Failed to get HW mode index"); + return QDF_STATUS_E_FAILURE; + } return QDF_STATUS_SUCCESS; } bool policy_mgr_is_current_hwmode_dbs(struct wlan_objmgr_psoc *psoc) { + struct policy_mgr_hw_mode_params hw_mode; + + if (!policy_mgr_is_hw_dbs_capable(psoc)) + return false; + if (QDF_STATUS_SUCCESS != + policy_mgr_get_current_hw_mode(psoc, &hw_mode)) + return false; + if (hw_mode.dbs_cap) + return true; return false; } bool policy_mgr_is_dbs_enable(struct wlan_objmgr_psoc *psoc) { + struct policy_mgr_psoc_priv_obj *pm_ctx; + + if (policy_mgr_is_dual_mac_disabled_in_ini(psoc)) + return false; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return false; + } + + policy_mgr_debug("DBS=%d", + WMI_DBS_FW_MODE_CFG_DBS_GET( + pm_ctx->dual_mac_cfg.cur_fw_mode_config)); + + if (WMI_DBS_FW_MODE_CFG_DBS_GET( + pm_ctx->dual_mac_cfg.cur_fw_mode_config)) + return true; + return false; } bool policy_mgr_is_hw_dbs_2x2_capable(struct wlan_objmgr_psoc *psoc) { - return false; + int i, param; + uint32_t dbs, tx_chain0, rx_chain0, tx_chain1, rx_chain1; + uint32_t final_min_rf_chains = 2; + uint32_t min_rf_chains, min_mac0_rf_chains, min_mac1_rf_chains; + bool is_dbs_found = false; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return false; + } + + for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { + param = pm_ctx->hw_mode.hw_mode_list[i]; + tx_chain0 = POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_GET(param); + rx_chain0 = POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_GET(param); + dbs = POLICY_MGR_HW_MODE_DBS_MODE_GET(param); + tx_chain1 = POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_GET(param); + rx_chain1 = POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_GET(param); + + if (dbs) { + min_mac0_rf_chains = QDF_MIN(tx_chain0, rx_chain0); + min_mac1_rf_chains = QDF_MIN(tx_chain1, rx_chain1); + min_rf_chains = QDF_MIN(min_mac0_rf_chains, + min_mac1_rf_chains); + is_dbs_found = true; + } else { + continue; + } + final_min_rf_chains = QDF_MIN(final_min_rf_chains, + min_rf_chains); + } + if (false == is_dbs_found) + final_min_rf_chains = 0; + + return (final_min_rf_chains == 2) ? true : false; } uint32_t policy_mgr_get_connection_count(struct wlan_objmgr_psoc *psoc) { - return 0; + uint32_t conn_index, count = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return count; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; + conn_index++) { + if (pm_conc_connection_list[conn_index].in_use) + count++; + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return count; } uint32_t policy_mgr_mode_specific_connection_count( @@ -103,7 +395,27 @@ uint32_t policy_mgr_mode_specific_connection_count( enum policy_mgr_con_mode mode, uint32_t *list) { - return 0; + uint32_t conn_index = 0, count = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return count; + } + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; + conn_index++) { + if ((pm_conc_connection_list[conn_index].mode == mode) && + pm_conc_connection_list[conn_index].in_use) { + if (list != NULL) + list[count] = conn_index; + count++; + } + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return count; } void policy_mgr_soc_set_dual_mac_cfg_cb(enum set_hw_mode_status status, @@ -119,11 +431,99 @@ void policy_mgr_set_dual_mac_scan_config(struct wlan_objmgr_psoc *psoc, uint8_t dbs_plus_agile_scan_val, uint8_t single_mac_scan_with_dbs_val) { + struct policy_mgr_dual_mac_config cfg; + QDF_STATUS status; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + /* Any non-zero positive value is treated as 1 */ + if (dbs_val != 0) + dbs_val = 1; + if (dbs_plus_agile_scan_val != 0) + dbs_plus_agile_scan_val = 1; + if (single_mac_scan_with_dbs_val != 0) + single_mac_scan_with_dbs_val = 1; + + status = policy_mgr_get_updated_scan_config(psoc, &cfg.scan_config, + dbs_val, + dbs_plus_agile_scan_val, + single_mac_scan_with_dbs_val); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("policy_mgr_get_updated_scan_config failed %d", + status); + return; + } + + status = policy_mgr_get_updated_fw_mode_config(psoc, + &cfg.fw_mode_config, + policy_mgr_get_dbs_config(psoc), + policy_mgr_get_agile_dfs_config(psoc)); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("policy_mgr_get_updated_fw_mode_config failed %d", + status); + return; + } + + cfg.set_dual_mac_cb = (void *)policy_mgr_soc_set_dual_mac_cfg_cb; + + policy_mgr_notice("scan_config:%x fw_mode_config:%x", + cfg.scan_config, cfg.fw_mode_config); + + status = pm_ctx->sme_cbacks.sme_soc_set_dual_mac_config(cfg); + if (status != QDF_STATUS_SUCCESS) + policy_mgr_err("sme_soc_set_dual_mac_config failed %d", status); } void policy_mgr_set_dual_mac_fw_mode_config(struct wlan_objmgr_psoc *psoc, uint8_t dbs, uint8_t dfs) { + struct policy_mgr_dual_mac_config cfg; + QDF_STATUS status; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + /* Any non-zero positive value is treated as 1 */ + if (dbs != 0) + dbs = 1; + if (dfs != 0) + dfs = 1; + + status = policy_mgr_get_updated_scan_config(psoc, &cfg.scan_config, + policy_mgr_get_dbs_scan_config(psoc), + policy_mgr_get_dbs_plus_agile_scan_config(psoc), + policy_mgr_get_single_mac_scan_with_dfs_config(psoc)); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("policy_mgr_get_updated_scan_config failed %d", + status); + return; + } + + status = policy_mgr_get_updated_fw_mode_config(psoc, + &cfg.fw_mode_config, dbs, dfs); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("policy_mgr_get_updated_fw_mode_config failed %d", + status); + return; + } + + cfg.set_dual_mac_cb = (void *)policy_mgr_soc_set_dual_mac_cfg_cb; + + policy_mgr_notice("scan_config:%x fw_mode_config:%x", + cfg.scan_config, cfg.fw_mode_config); + + status = pm_ctx->sme_cbacks.sme_soc_set_dual_mac_config(cfg); + if (status != QDF_STATUS_SUCCESS) + policy_mgr_err("sme_soc_set_dual_mac_config failed %d", status); } bool policy_mgr_current_concurrency_is_mcc(struct wlan_objmgr_psoc *psoc) From 9767070e336903ec0f3fdf5b41902faac168057e Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Wed, 8 Mar 2017 10:06:58 -0800 Subject: [PATCH 010/187] qcacmn: Define utility functions of policy manager component Part 2 Define utility functions for policy manager component. Change-Id: I080a4389504f6c3b0acb93fe9993da3ffd492f22 CRs-Fixed: 2009818 --- src/wlan_policy_mgr_get_set_utils.c | 299 +++++++++++++++++++++++++++- 1 file changed, 296 insertions(+), 3 deletions(-) diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 1309ff00fa41..f9ec5af2681f 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -528,7 +528,39 @@ void policy_mgr_set_dual_mac_fw_mode_config(struct wlan_objmgr_psoc *psoc, bool policy_mgr_current_concurrency_is_mcc(struct wlan_objmgr_psoc *psoc) { - return true; + uint32_t num_connections = 0; + bool is_mcc = false; + + num_connections = policy_mgr_get_connection_count(psoc); + + switch (num_connections) { + case 1: + break; + case 2: + if ((pm_conc_connection_list[0].chan != + pm_conc_connection_list[1].chan) && + (pm_conc_connection_list[0].mac == + pm_conc_connection_list[1].mac)) { + is_mcc = true; + } + break; + case 3: + if ((pm_conc_connection_list[0].chan != + pm_conc_connection_list[1].chan) || + (pm_conc_connection_list[0].chan != + pm_conc_connection_list[2].chan) || + (pm_conc_connection_list[1].chan != + pm_conc_connection_list[2].chan)){ + is_mcc = true; + } + break; + default: + policy_mgr_err("unexpected num_connections value %d", + num_connections); + break; + } + + return is_mcc; } void policy_mgr_set_concurrency_mode(enum tQDF_ADAPTER_MODE mode) @@ -545,41 +577,302 @@ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, enum tQDF_ADAPTER_MODE mode, uint8_t session_id) { + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + /* + * Need to aquire mutex as entire functionality in this function + * is in critical section + */ + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + switch (mode) { + case QDF_STA_MODE: + case QDF_P2P_CLIENT_MODE: + case QDF_P2P_GO_MODE: + case QDF_SAP_MODE: + case QDF_IBSS_MODE: + pm_ctx->no_of_active_sessions[mode]++; + break; + default: + break; + } + + + policy_mgr_notice("No.# of active sessions for mode %d = %d", + mode, pm_ctx->no_of_active_sessions[mode]); + /* + * Get PCL logic makes use of the connection info structure. + * Let us set the PCL to the FW before updating the connection + * info structure about the new connection. + */ + if (mode == QDF_STA_MODE) { + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + /* Set PCL of STA to the FW */ + policy_mgr_pdev_set_pcl(psoc, mode); + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + policy_mgr_notice("Set PCL of STA to FW"); + } + policy_mgr_incr_connection_count(psoc, session_id); + if ((policy_mgr_mode_specific_connection_count( + psoc, PM_STA_MODE, NULL) > 0) && (mode != QDF_STA_MODE)) { + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + policy_mgr_set_pcl_for_existing_combo(psoc, PM_STA_MODE); + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + } + + /* set tdls connection tracker state */ + pm_ctx->tdls_cbacks.set_tdls_ct_mode(psoc); + policy_mgr_dump_current_concurrency(psoc); + + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); } void policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, enum tQDF_ADAPTER_MODE mode, uint8_t session_id) { + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("context is NULL"); + return; + } + + switch (mode) { + case QDF_STA_MODE: + case QDF_P2P_CLIENT_MODE: + case QDF_P2P_GO_MODE: + case QDF_SAP_MODE: + case QDF_IBSS_MODE: + if (pm_ctx->no_of_active_sessions[mode]) + pm_ctx->no_of_active_sessions[mode]--; + break; + default: + break; + } + + policy_mgr_notice("No.# of active sessions for mode %d = %d", + mode, pm_ctx->no_of_active_sessions[mode]); + + policy_mgr_decr_connection_count(psoc, session_id); + + /* set tdls connection tracker state */ + pm_ctx->tdls_cbacks.set_tdls_ct_mode(psoc); + + policy_mgr_dump_current_concurrency(psoc); } QDF_STATUS policy_mgr_incr_connection_count( struct wlan_objmgr_psoc *psoc, uint32_t vdev_id) { + QDF_STATUS status = QDF_STATUS_E_FAILURE; + uint32_t conn_index; + struct policy_mgr_vdev_entry_info conn_table_entry; + enum policy_mgr_chain_mode chain_mask = POLICY_MGR_ONE_ONE; + uint8_t nss_2g = 0, nss_5g = 0; + enum policy_mgr_con_mode mode; + uint8_t chan; + uint32_t nss = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("context is NULL"); + return status; + } + + conn_index = policy_mgr_get_connection_count(psoc); + if (pm_ctx->gMaxConcurrentActiveSessions < conn_index) { + policy_mgr_err("exceeded max connection limit %d", + pm_ctx->gMaxConcurrentActiveSessions); + return status; + } + + status = pm_ctx->wma_cbacks.wma_get_connection_info( + vdev_id, &conn_table_entry); + if (QDF_STATUS_SUCCESS != status) { + policy_mgr_err("can't find vdev_id %d in connection table", + vdev_id); + return status; + } + mode = policy_mgr_get_mode(conn_table_entry.type, + conn_table_entry.sub_type); + chan = reg_freq_to_chan(conn_table_entry.mhz); + status = policy_mgr_get_nss_for_vdev(psoc, mode, &nss_2g, &nss_5g); + if (QDF_IS_STATUS_SUCCESS(status)) { + if ((WLAN_REG_IS_24GHZ_CH(chan) && (nss_2g > 1)) || + (WLAN_REG_IS_5GHZ_CH(chan) && (nss_5g > 1))) + chain_mask = POLICY_MGR_TWO_TWO; + else + chain_mask = POLICY_MGR_ONE_ONE; + nss = (WLAN_REG_IS_24GHZ_CH(chan)) ? nss_2g : nss_5g; + } else { + policy_mgr_err("Error in getting nss"); + } + + + /* add the entry */ + policy_mgr_update_conc_list(psoc, conn_index, + mode, + chan, + policy_mgr_get_bw(conn_table_entry.chan_width), + conn_table_entry.mac_id, + chain_mask, + nss, vdev_id, true); + policy_mgr_notice("Add at idx:%d vdev %d mac=%d", + conn_index, vdev_id, + conn_table_entry.mac_id); + return QDF_STATUS_SUCCESS; } QDF_STATUS policy_mgr_decr_connection_count(struct wlan_objmgr_psoc *psoc, uint32_t vdev_id) { + QDF_STATUS status = QDF_STATUS_E_FAILURE; + uint32_t conn_index = 0, next_conn_index = 0; + bool found = false; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return status; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { + if (vdev_id == pm_conc_connection_list[conn_index].vdev_id) { + /* debug msg */ + found = true; + break; + } + conn_index++; + } + if (!found) { + policy_mgr_err("can't find vdev_id %d in pm_conc_connection_list", + vdev_id); + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + return status; + } + next_conn_index = conn_index + 1; + while (PM_CONC_CONNECTION_LIST_VALID_INDEX(next_conn_index)) { + pm_conc_connection_list[conn_index].vdev_id = + pm_conc_connection_list[next_conn_index].vdev_id; + pm_conc_connection_list[conn_index].mode = + pm_conc_connection_list[next_conn_index].mode; + pm_conc_connection_list[conn_index].mac = + pm_conc_connection_list[next_conn_index].mac; + pm_conc_connection_list[conn_index].chan = + pm_conc_connection_list[next_conn_index].chan; + pm_conc_connection_list[conn_index].bw = + pm_conc_connection_list[next_conn_index].bw; + pm_conc_connection_list[conn_index].chain_mask = + pm_conc_connection_list[next_conn_index].chain_mask; + pm_conc_connection_list[conn_index].original_nss = + pm_conc_connection_list[next_conn_index].original_nss; + pm_conc_connection_list[conn_index].in_use = + pm_conc_connection_list[next_conn_index].in_use; + conn_index++; + next_conn_index++; + } + + /* clean up the entry */ + qdf_mem_zero(&pm_conc_connection_list[next_conn_index - 1], + sizeof(*pm_conc_connection_list)); + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + return QDF_STATUS_SUCCESS; } bool policy_mgr_map_concurrency_mode(enum tQDF_ADAPTER_MODE *old_mode, enum policy_mgr_con_mode *new_mode) { - return true; + bool status = true; + + switch (*old_mode) { + + case QDF_STA_MODE: + *new_mode = PM_STA_MODE; + break; + case QDF_SAP_MODE: + *new_mode = PM_SAP_MODE; + break; + case QDF_P2P_CLIENT_MODE: + *new_mode = PM_P2P_CLIENT_MODE; + break; + case QDF_P2P_GO_MODE: + *new_mode = PM_P2P_GO_MODE; + break; + case QDF_IBSS_MODE: + *new_mode = PM_IBSS_MODE; + break; + default: + *new_mode = PM_MAX_NUM_OF_MODE; + status = false; + break; + } + + return status; } bool policy_mgr_is_ibss_conn_exist(struct wlan_objmgr_psoc *psoc, uint8_t *ibss_channel) { - return QDF_STATUS_SUCCESS; + uint32_t count = 0, index = 0; + uint32_t list[MAX_NUMBER_OF_CONC_CONNECTIONS]; + bool status = false; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return status; + } + if (NULL == ibss_channel) { + policy_mgr_err("Null pointer error"); + return false; + } + count = policy_mgr_mode_specific_connection_count( + psoc, PM_IBSS_MODE, list); + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + if (count == 0) { + /* No IBSS connection */ + status = false; + } else if (count == 1) { + *ibss_channel = pm_conc_connection_list[list[index]].chan; + status = true; + } else { + *ibss_channel = pm_conc_connection_list[list[index]].chan; + policy_mgr_notice("Multiple IBSS connections, picking first one"); + status = true; + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return status; } bool policy_mgr_max_concurrent_connections_reached( struct wlan_objmgr_psoc *psoc) { + uint8_t i = 0, j = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (NULL != pm_ctx) { + for (i = 0; i < QDF_MAX_NO_OF_MODE; i++) + j += pm_ctx->no_of_active_sessions[i]; + return j > + (pm_ctx-> + gMaxConcurrentActiveSessions - 1); + } + return false; } From 482d82bf143f48cb5a7f5b5eb90a75f3573897cb Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Wed, 8 Mar 2017 10:26:14 -0800 Subject: [PATCH 011/187] qcacmn: Define utility functions of policy manager component Part 3 Define utility functions for policy manager component. Change-Id: I2811b682f5b8e73ea6393dbe6db99a8f6ae077a1 CRs-Fixed: 2009818 --- src/wlan_policy_mgr_get_set_utils.c | 597 +++++++++++++++++++++++++++- 1 file changed, 586 insertions(+), 11 deletions(-) diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index f9ec5af2681f..570f1ae5b540 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -40,6 +40,9 @@ #include "qdf_trace.h" #include "wlan_objmgr_global_obj.h" +/* invalid channel id. */ +#define INVALID_CHANNEL_ID 0 + bool policy_mgr_get_dbs_plus_agile_scan_config(struct wlan_objmgr_psoc *psoc) { uint32_t scan_config; @@ -876,11 +879,215 @@ bool policy_mgr_max_concurrent_connections_reached( return false; } +static bool policy_mgr_is_sub_20_mhz_enabled(void) +{ + return false; +} + bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, uint8_t channel, enum hw_mode_bandwidth bw) { - return true; + uint32_t num_connections = 0, count = 0, index = 0; + bool status = false, match = false; + uint32_t list[MAX_NUMBER_OF_CONC_CONNECTIONS]; + struct policy_mgr_psoc_priv_obj *pm_ctx; + QDF_STATUS ret; + struct policy_mgr_pcl_list pcl; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return status; + } + + + qdf_mem_zero(&pcl, sizeof(pcl)); + ret = policy_mgr_get_pcl(psoc, mode, pcl.pcl_list, &pcl.pcl_len, + pcl.weight_list, QDF_ARRAY_SIZE(pcl.weight_list)); + if (QDF_IS_STATUS_ERROR(ret)) { + policy_mgr_err("disallow connection:%d", ret); + goto done; + } + + /* find the current connection state from pm_conc_connection_list*/ + num_connections = policy_mgr_get_connection_count(psoc); + + if (num_connections && policy_mgr_is_sub_20_mhz_enabled()) { + policy_mgr_err("dont allow concurrency if Sub 20 MHz is enabled"); + status = false; + goto done; + } + + if (policy_mgr_max_concurrent_connections_reached(psoc)) { + policy_mgr_err("Reached max concurrent connections: %d", + pm_ctx->gMaxConcurrentActiveSessions); + goto done; + } + + if (channel) { + /* don't allow 3rd home channel on same MAC */ + if (!policy_mgr_allow_new_home_channel(psoc, + channel, num_connections)) + goto done; + + /* + * 1) DFS MCC is not yet supported + * 2) If you already have STA connection on 5G channel then + * don't allow any other persona to make connection on DFS + * channel because STA 5G + DFS MCC is not allowed. + * 3) If STA is on 2G channel and SAP is coming up on + * DFS channel then allow concurrency but make sure it is + * going to DBS and send PCL to firmware indicating that + * don't allow STA to roam to 5G channels. + */ + if (!policy_mgr_is_5g_channel_allowed(psoc, + channel, list, PM_P2P_GO_MODE)) + goto done; + if (!policy_mgr_is_5g_channel_allowed(psoc, + channel, list, PM_SAP_MODE)) + goto done; + + if ((PM_P2P_GO_MODE == mode) || (PM_SAP_MODE == mode)) { + if (wlan_reg_is_dfs_ch(psoc, channel)) + match = policy_mgr_disallow_mcc(psoc, channel); + } + if (true == match) { + policy_mgr_err("No MCC, SAP/GO about to come up on DFS channel"); + goto done; + } + } + + /* + * Check all IBSS+STA concurrencies + * + * don't allow IBSS + STA MCC + * don't allow IBSS + STA SCC if IBSS is on DFS channel + */ + count = policy_mgr_mode_specific_connection_count(psoc, + PM_STA_MODE, list); + if ((PM_IBSS_MODE == mode) && + (policy_mgr_mode_specific_connection_count(psoc, + PM_IBSS_MODE, list)) && count) { + policy_mgr_err("No 2nd IBSS, we already have STA + IBSS"); + goto done; + } + if ((PM_IBSS_MODE == mode) && + (wlan_reg_is_dfs_ch(psoc, channel)) && count) { + policy_mgr_err("No IBSS + STA SCC/MCC, IBSS is on DFS channel"); + goto done; + } + if (PM_IBSS_MODE == mode) { + if (policy_mgr_is_hw_dbs_capable(psoc) == true) { + if (num_connections > 1) { + policy_mgr_err("No IBSS, we have concurrent connections already"); + goto done; + } + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + if (PM_STA_MODE != pm_conc_connection_list[0].mode) { + policy_mgr_err("No IBSS, we've a non-STA connection"); + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + goto done; + } + /* + * This logic protects STA and IBSS to come up on same + * band. If requirement changes then this condition + * needs to be removed + */ + if (channel && + (pm_conc_connection_list[0].chan != channel) && + WLAN_REG_IS_SAME_BAND_CHANNELS( + pm_conc_connection_list[0].chan, channel)) { + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + policy_mgr_err("No IBSS + STA MCC"); + goto done; + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + } else if (num_connections) { + policy_mgr_err("No IBSS, we have one connection already"); + goto done; + } + } + + if ((PM_STA_MODE == mode) && + (policy_mgr_mode_specific_connection_count(psoc, + PM_IBSS_MODE, list)) && count) { + policy_mgr_err("No 2nd STA, we already have STA + IBSS"); + goto done; + } + + if ((PM_STA_MODE == mode) && + (policy_mgr_mode_specific_connection_count(psoc, + PM_IBSS_MODE, list))) { + if (policy_mgr_is_hw_dbs_capable(psoc) == true) { + if (num_connections > 1) { + policy_mgr_err("No 2nd STA, we already have IBSS concurrency"); + goto done; + } + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + if (channel && + (wlan_reg_is_dfs_ch(psoc, + pm_conc_connection_list[0].chan)) + && (WLAN_REG_IS_5GHZ_CH(channel))) { + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + policy_mgr_err("No IBSS + STA SCC/MCC, IBSS is on DFS channel"); + goto done; + } + /* + * This logic protects STA and IBSS to come up on same + * band. If requirement changes then this condition + * needs to be removed + */ + if ((pm_conc_connection_list[0].chan != channel) && + WLAN_REG_IS_SAME_BAND_CHANNELS( + pm_conc_connection_list[0].chan, channel)) { + policy_mgr_err("No IBSS + STA MCC"); + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + goto done; + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + } else { + policy_mgr_err("No STA, we have IBSS connection already"); + goto done; + } + } + + /* don't allow two P2P GO on same band */ + if (channel && (mode == PM_P2P_GO_MODE) && num_connections) { + index = 0; + count = policy_mgr_mode_specific_connection_count(psoc, + PM_P2P_GO_MODE, list); + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + while (index < count) { + if (WLAN_REG_IS_SAME_BAND_CHANNELS(channel, + pm_conc_connection_list[list[index]].chan)) { + policy_mgr_err("Don't allow P2P GO on same band"); + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + goto done; + } + index++; + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + } + + /* don't allow concurrency on vht160 or vht 80+80 */ + if (num_connections && + ((bw == HW_MODE_80_PLUS_80_MHZ) || + (bw == HW_MODE_160_MHZ))) { + policy_mgr_err("No VHT160, we have one connection already"); + goto done; + } + + if (policy_mgr_vht160_conn_exist(psoc)) { + policy_mgr_err("VHT160/80+80 connection exists, no concurrency"); + goto done; + } + + + status = true; + +done: + return status; } uint32_t policy_mgr_get_concurrency_mode(void) @@ -900,18 +1107,105 @@ uint8_t policy_mgr_search_and_check_for_session_conc( uint8_t session_id, void *roam_profile) { - return 0; + uint8_t channel = 0; + QDF_STATUS status; + enum policy_mgr_con_mode mode; + bool ret; + + mode = policy_mgr_get_mode_by_vdev_id(psoc, session_id); + if (PM_MAX_NUM_OF_MODE == mode) { + policy_mgr_err("Invalid mode"); + return channel; + } + + status = policy_mgr_get_channel_from_scan_result(psoc, + roam_profile, &channel); + if ((QDF_STATUS_SUCCESS != status) || (channel == 0)) { + policy_mgr_err("%s error %d %d", + __func__, status, channel); + return 0; + } + + /* Take care of 160MHz and 80+80Mhz later */ + ret = policy_mgr_allow_concurrency(psoc, mode, channel, HW_MODE_20_MHZ); + if (false == ret) { + policy_mgr_err("Connection failed due to conc check fail"); + return 0; + } + + return channel; } bool policy_mgr_check_for_session_conc(struct wlan_objmgr_psoc *psoc, uint8_t session_id, uint8_t channel) { + enum policy_mgr_con_mode mode; + bool ret; + + mode = policy_mgr_get_mode_by_vdev_id(psoc, session_id); + if (PM_MAX_NUM_OF_MODE == mode) { + policy_mgr_err("Invalid mode"); + return false; + } + + if (channel == 0) { + policy_mgr_err("Invalid channel number 0"); + return false; + } + + /* Take care of 160MHz and 80+80Mhz later */ + ret = policy_mgr_allow_concurrency(psoc, mode, channel, HW_MODE_20_MHZ); + if (false == ret) { + policy_mgr_err("Connection failed due to conc check fail"); + return 0; + } + return true; } uint8_t policy_mgr_is_mcc_in_24G(struct wlan_objmgr_psoc *psoc) { - return 0; + uint32_t num_connections = 0; + bool is_24G_mcc = false; + + num_connections = policy_mgr_get_connection_count(psoc); + + switch (num_connections) { + case 1: + break; + case 2: + if ((pm_conc_connection_list[0].chan != + pm_conc_connection_list[1].chan) && + (pm_conc_connection_list[0].mac == + pm_conc_connection_list[1].mac) && + (pm_conc_connection_list[0].chan <= + WLAN_REG_MAX_24GHZ_CH_NUM) && + (pm_conc_connection_list[1].chan <= + WLAN_REG_MAX_24GHZ_CH_NUM)) + is_24G_mcc = true; + break; + case 3: + if (((pm_conc_connection_list[0].chan != + pm_conc_connection_list[1].chan) || + (pm_conc_connection_list[0].chan != + pm_conc_connection_list[2].chan) || + (pm_conc_connection_list[1].chan != + pm_conc_connection_list[2].chan)) && + (pm_conc_connection_list[0].chan <= + WLAN_REG_MAX_24GHZ_CH_NUM) && + (pm_conc_connection_list[1].chan <= + WLAN_REG_MAX_24GHZ_CH_NUM) && + (pm_conc_connection_list[2].chan <= + WLAN_REG_MAX_24GHZ_CH_NUM)) + is_24G_mcc = true; + break; + default: + policy_mgr_err("unexpected num_connections value %d", + num_connections); + break; + } + + return is_24G_mcc; } int32_t policy_mgr_set_mas(struct wlan_objmgr_psoc *psoc, uint8_t mas_value) @@ -944,13 +1238,39 @@ void policy_mgr_set_mcc_latency(struct wlan_objmgr_psoc *psoc, int set_value) struct policy_mgr_conc_connection_info *policy_mgr_get_conn_info(uint32_t *len) { - return NULL; + struct policy_mgr_conc_connection_info *conn_ptr = + &pm_conc_connection_list[0]; + *len = MAX_NUMBER_OF_CONC_CONNECTIONS; + + return conn_ptr; } enum policy_mgr_con_mode policy_mgr_convert_device_mode_to_qdf_type( enum tQDF_ADAPTER_MODE device_mode) { - return PM_MAX_NUM_OF_MODE; + enum policy_mgr_con_mode mode = PM_MAX_NUM_OF_MODE; + switch (device_mode) { + case QDF_STA_MODE: + mode = PM_STA_MODE; + break; + case QDF_P2P_CLIENT_MODE: + mode = PM_P2P_CLIENT_MODE; + break; + case QDF_P2P_GO_MODE: + mode = PM_P2P_GO_MODE; + break; + case QDF_SAP_MODE: + mode = PM_SAP_MODE; + break; + case QDF_IBSS_MODE: + mode = PM_IBSS_MODE; + break; + default: + policy_mgr_err("Unsupported mode (%d)", + device_mode); + } + + return mode; } bool policy_mgr_concurrent_open_sessions_running(void) @@ -966,11 +1286,20 @@ bool policy_mgr_concurrent_beaconing_sessions_running(void) void policy_mgr_clear_concurrent_session_count(struct wlan_objmgr_psoc *psoc) { + uint8_t i = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (NULL != pm_ctx) { + for (i = 0; i < QDF_MAX_NO_OF_MODE; i++) + pm_ctx->no_of_active_sessions[i] = 0; + } } bool policy_mgr_is_multiple_active_sta_sessions(struct wlan_objmgr_psoc *psoc) { - return false; + return policy_mgr_mode_specific_connection_count( + psoc, PM_STA_MODE, NULL) > 1; } bool policy_mgr_is_sta_active_connection_exists(void) @@ -981,24 +1310,129 @@ bool policy_mgr_is_sta_active_connection_exists(void) bool policy_mgr_is_any_nondfs_chnl_present(struct wlan_objmgr_psoc *psoc, uint8_t *channel) { - return true; + bool status = false; + uint32_t conn_index = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return false; + } + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; + conn_index++) { + if (pm_conc_connection_list[conn_index].in_use && + !wlan_reg_is_dfs_ch(psoc, + pm_conc_connection_list[conn_index].chan)) { + *channel = pm_conc_connection_list[conn_index].chan; + status = true; + } + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return status; } bool policy_mgr_is_any_dfs_beaconing_session_present( struct wlan_objmgr_psoc *psoc, uint8_t *channel) { - return true; + struct policy_mgr_conc_connection_info *conn_info; + bool status = false; + uint32_t conn_index = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return false; + } + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; + conn_index++) { + conn_info = &pm_conc_connection_list[conn_index]; + if (conn_info->in_use && + wlan_reg_is_dfs_ch(psoc, conn_info->chan) && + (PM_SAP_MODE == conn_info->mode || + PM_P2P_GO_MODE == conn_info->mode)) { + *channel = pm_conc_connection_list[conn_index].chan; + status = true; + } + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return status; } QDF_STATUS policy_mgr_get_nss_for_vdev(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, uint8_t *nss_2g, uint8_t *nss_5g) { + enum tQDF_ADAPTER_MODE dev_mode; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + switch (mode) { + case PM_STA_MODE: + dev_mode = QDF_STA_MODE; + break; + case PM_SAP_MODE: + dev_mode = QDF_SAP_MODE; + break; + case PM_P2P_CLIENT_MODE: + dev_mode = QDF_P2P_CLIENT_MODE; + break; + case PM_P2P_GO_MODE: + dev_mode = QDF_P2P_GO_MODE; + break; + case PM_IBSS_MODE: + dev_mode = QDF_IBSS_MODE; + break; + default: + policy_mgr_err("Invalid mode to get allowed NSS value"); + return QDF_STATUS_E_FAILURE; + }; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + if (!pm_ctx->sme_cbacks.sme_get_nss_for_vdev) { + policy_mgr_err("sme_get_nss_for_vdev callback is NULL"); + return QDF_STATUS_E_FAILURE; + } + + pm_ctx->sme_cbacks.sme_get_nss_for_vdev( + dev_mode, nss_2g, nss_5g); + return QDF_STATUS_SUCCESS; } void policy_mgr_dump_connection_status_info(struct wlan_objmgr_psoc *psoc) { + uint32_t i; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (i = 0; i < MAX_NUMBER_OF_CONC_CONNECTIONS; i++) { + policy_mgr_debug("%d: use:%d vdev:%d mode:%d mac:%d chan:%d orig chainmask:%d orig nss:%d bw:%d", + i, pm_conc_connection_list[i].in_use, + pm_conc_connection_list[i].vdev_id, + pm_conc_connection_list[i].mode, + pm_conc_connection_list[i].mac, + pm_conc_connection_list[i].chan, + pm_conc_connection_list[i].chain_mask, + pm_conc_connection_list[i].original_nss, + pm_conc_connection_list[i].bw); + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); } bool policy_mgr_is_any_mode_active_on_band_along_with_session( @@ -1006,12 +1440,73 @@ bool policy_mgr_is_any_mode_active_on_band_along_with_session( uint8_t session_id, enum policy_mgr_band band) { - return true; + uint32_t i; + bool status = false; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + status = false; + goto send_status; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (i = 0; i < MAX_NUMBER_OF_CONC_CONNECTIONS; i++) { + switch (band) { + case POLICY_MGR_BAND_24: + if ((pm_conc_connection_list[i].vdev_id != session_id) + && (pm_conc_connection_list[i].in_use) && + (WLAN_REG_IS_24GHZ_CH( + pm_conc_connection_list[i].chan))) { + status = true; + goto release_mutex_and_send_status; + } + break; + case POLICY_MGR_BAND_5: + if ((pm_conc_connection_list[i].vdev_id != session_id) + && (pm_conc_connection_list[i].in_use) && + (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[i].chan))) { + status = true; + goto release_mutex_and_send_status; + } + break; + default: + policy_mgr_err("Invalidband option:%d", band); + status = false; + goto release_mutex_and_send_status; + } + } +release_mutex_and_send_status: + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); +send_status: + return status; } QDF_STATUS policy_mgr_get_mac_id_by_session_id(struct wlan_objmgr_psoc *psoc, uint8_t session_id, uint8_t *mac_id) { + uint32_t i; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (i = 0; i < MAX_NUMBER_OF_CONC_CONNECTIONS; i++) { + if ((pm_conc_connection_list[i].vdev_id == session_id) && + (pm_conc_connection_list[i].in_use)) { + *mac_id = pm_conc_connection_list[i].mac; + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + return QDF_STATUS_SUCCESS; + } + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + return QDF_STATUS_E_FAILURE; } @@ -1019,21 +1514,101 @@ QDF_STATUS policy_mgr_get_mcc_session_id_on_mac(struct wlan_objmgr_psoc *psoc, uint8_t mac_id, uint8_t session_id, uint8_t *mcc_session_id) { + uint32_t i; + uint8_t chan = pm_conc_connection_list[session_id].chan; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (i = 0; i < MAX_NUMBER_OF_CONC_CONNECTIONS; i++) { + if (pm_conc_connection_list[i].mac != mac_id) + continue; + if (pm_conc_connection_list[i].vdev_id == session_id) + continue; + /* Inter band or intra band MCC */ + if ((pm_conc_connection_list[i].chan != chan) && + (pm_conc_connection_list[i].in_use)) { + *mcc_session_id = pm_conc_connection_list[i].vdev_id; + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + return QDF_STATUS_SUCCESS; + } + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + return QDF_STATUS_E_FAILURE; } uint8_t policy_mgr_get_mcc_operating_channel(struct wlan_objmgr_psoc *psoc, uint8_t session_id) { - return 0; + uint8_t mac_id, mcc_session_id; + QDF_STATUS status; + uint8_t chan; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return INVALID_CHANNEL_ID; + } + + status = policy_mgr_get_mac_id_by_session_id(psoc, session_id, &mac_id); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("failed to get MAC ID"); + return INVALID_CHANNEL_ID; + } + + status = policy_mgr_get_mcc_session_id_on_mac(psoc, mac_id, session_id, + &mcc_session_id); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("failed to get MCC session ID"); + return INVALID_CHANNEL_ID; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + chan = pm_conc_connection_list[mcc_session_id].chan; + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return chan; } void policy_mgr_set_do_hw_mode_change_flag(struct wlan_objmgr_psoc *psoc, bool flag) { + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + pm_ctx->do_hw_mode_change = flag; + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + policy_mgr_debug("hw_mode_change_channel:%d", flag); } bool policy_mgr_is_hw_mode_change_after_vdev_up(struct wlan_objmgr_psoc *psoc) { - return false; + bool flag; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return INVALID_CHANNEL_ID; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + flag = pm_ctx->do_hw_mode_change; + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return flag; } From ab488610071a991df7b11c077a3ce93744ed3f04 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Tue, 14 Mar 2017 14:43:24 -0700 Subject: [PATCH 012/187] qcacmn: Move PCL weight macros to api header file Move PCL weight macros to API header file. Change-Id: I3183dd8301cd971475d492791df89cd77af2943f CRs-Fixed: 2009818 --- inc/wlan_policy_mgr_public_struct.h | 27 +++++++++++++++++++++++++++ src/wlan_policy_mgr_i.h | 27 --------------------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 46781b545bd1..9bd892f7d186 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -39,6 +39,33 @@ #define POLICY_MGR_MAX_CHANNEL_LIST 128 +/** + * Some max value greater than the max length of the channel list + */ +#define MAX_WEIGHT_OF_PCL_CHANNELS 255 +/** + * Some fixed weight difference between the groups + */ +#define PCL_GROUPS_WEIGHT_DIFFERENCE 20 + +/** + * Currently max, only 3 groups are possible as per 'enum policy_mgr_pcl_type'. + * i.e., in a PCL only 3 groups of channels can be present + * e.g., SCC channel on 2.4 Ghz, SCC channel on 5 Ghz & 5 Ghz channels. + * Group 1 has highest priority, group 2 has the next higher priority + * and so on. + */ +#define WEIGHT_OF_GROUP1_PCL_CHANNELS MAX_WEIGHT_OF_PCL_CHANNELS +#define WEIGHT_OF_GROUP2_PCL_CHANNELS \ + (WEIGHT_OF_GROUP1_PCL_CHANNELS - PCL_GROUPS_WEIGHT_DIFFERENCE) +#define WEIGHT_OF_GROUP3_PCL_CHANNELS \ + (WEIGHT_OF_GROUP2_PCL_CHANNELS - PCL_GROUPS_WEIGHT_DIFFERENCE) +#define WEIGHT_OF_GROUP4_PCL_CHANNELS \ + (WEIGHT_OF_GROUP3_PCL_CHANNELS - PCL_GROUPS_WEIGHT_DIFFERENCE) + +#define WEIGHT_OF_NON_PCL_CHANNELS 1 +#define WEIGHT_OF_DISALLOWED_CHANNELS 0 + /** * enum hw_mode_ss_config - Possible spatial stream configuration * @HW_MODE_SS_0x0: Unused Tx and Rx of MAC diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 0787042f2ed3..591678859531 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -67,33 +67,6 @@ extern enum cds_band_type cds_chan_to_band(uint32_t chan); #define CONNECTION_UPDATE_TIMEOUT 1000 #endif -/** - * Some max value greater than the max length of the channel list - */ -#define MAX_WEIGHT_OF_PCL_CHANNELS 255 -/** - * Some fixed weight difference between the groups - */ -#define PCL_GROUPS_WEIGHT_DIFFERENCE 20 - -/** - * Currently max, only 3 groups are possible as per 'enum policy_mgr_pcl_type'. - * i.e., in a PCL only 3 groups of channels can be present - * e.g., SCC channel on 2.4 Ghz, SCC channel on 5 Ghz & 5 Ghz channels. - * Group 1 has highest priority, group 2 has the next higher priority - * and so on. - */ -#define WEIGHT_OF_GROUP1_PCL_CHANNELS MAX_WEIGHT_OF_PCL_CHANNELS -#define WEIGHT_OF_GROUP2_PCL_CHANNELS \ - (WEIGHT_OF_GROUP1_PCL_CHANNELS - PCL_GROUPS_WEIGHT_DIFFERENCE) -#define WEIGHT_OF_GROUP3_PCL_CHANNELS \ - (WEIGHT_OF_GROUP2_PCL_CHANNELS - PCL_GROUPS_WEIGHT_DIFFERENCE) -#define WEIGHT_OF_GROUP4_PCL_CHANNELS \ - (WEIGHT_OF_GROUP3_PCL_CHANNELS - PCL_GROUPS_WEIGHT_DIFFERENCE) - -#define WEIGHT_OF_NON_PCL_CHANNELS 1 -#define WEIGHT_OF_DISALLOWED_CHANNELS 0 - /** * Policy Mgr hardware mode list bit-mask definitions. * Bits 4:0, 31:29 are unused. From 7abbf5680c3a9d8061d6f38d0c11b6052271fc34 Mon Sep 17 00:00:00 2001 From: Archana Ramachandran Date: Thu, 2 Mar 2017 13:14:34 -0800 Subject: [PATCH 013/187] qcacmn: Remove legacy dependency from Policy Manager Part 1 Remove legacy dependency from Policy Manager component Part 1 Change-Id: I87a44714c02ed37923ce4a4c4818d2aef8bc6e2f CRs-Fixed: 2019994 --- inc/wlan_policy_mgr_api.h | 39 +++++-- src/wlan_policy_mgr_core.c | 15 +++ src/wlan_policy_mgr_get_set_utils.c | 163 +++++++++++++++++++++++++++- src/wlan_policy_mgr_i.h | 21 ++++ src/wlan_policy_mgr_init_deinit.c | 1 + 5 files changed, 226 insertions(+), 13 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index c3f5dd4d1a21..0c57170a6060 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -60,23 +60,27 @@ typedef const enum policy_mgr_conc_next_action /** * policy_mgr_set_concurrency_mode() - To set concurrency mode - * @mode: adapter mode + * @psoc: PSOC object data + * @mode: device mode * * This routine is called to set the concurrency mode * * Return: NONE */ -void policy_mgr_set_concurrency_mode(enum tQDF_ADAPTER_MODE mode); +void policy_mgr_set_concurrency_mode(struct wlan_objmgr_psoc *psoc, + enum tQDF_ADAPTER_MODE mode); /** * policy_mgr_clear_concurrency_mode() - To clear concurrency mode - * @mode: adapter mode + * @psoc: PSOC object data + * @mode: device mode * * This routine is called to clear the concurrency mode * * Return: NONE */ -void policy_mgr_clear_concurrency_mode(enum tQDF_ADAPTER_MODE mode); +void policy_mgr_clear_concurrency_mode(struct wlan_objmgr_psoc *psoc, + enum tQDF_ADAPTER_MODE mode); /** * policy_mgr_get_connection_count() - provides the count of @@ -174,20 +178,23 @@ uint8_t policy_mgr_is_mcc_in_24G(struct wlan_objmgr_psoc *psoc); /** * policy_mgr_set_mas() - Function to set MAS value to UMAC - * @psoc: PSOC object information - * @mas_value: 0-Disable, 1-Enable MAS + * @psoc: Pointer to psoc + * @mas_value: 0-Disable, 1-Enable MAS + * @dev_mode: device mode * * This function passes down the value of MAS to UMAC * * Return: Configuration message posting status, SUCCESS or Fail * */ -int32_t policy_mgr_set_mas(struct wlan_objmgr_psoc *psoc, uint8_t mas_value); +int32_t policy_mgr_set_mas(struct wlan_objmgr_psoc *psoc, + uint8_t mas_value, + enum tQDF_ADAPTER_MODE dev_mode); /** * policy_mgr_set_mcc_p2p_quota() - Function to set quota for P2P * @psoc: PSOC object information - * @set_value: Qouta value for the interface + * @set_value: Quota value for the interface * * This function is used to set the quota for P2P cases * @@ -772,6 +779,7 @@ typedef void (*policy_mgr_nss_update_cback)(struct wlan_objmgr_psoc *psoc, * @sme_pdev_set_hw_mode: Set the new HW mode to FW * @sme_pdev_set_pcl: Set new PCL to FW * @sme_nss_update_request: Update NSS value to FW + * @sme_set_mas: Set MCC adaptive scheduler value */ struct policy_mgr_sme_cbacks { QDF_STATUS (*sme_get_valid_channels)(uint8_t *chan_list, @@ -786,6 +794,7 @@ struct policy_mgr_sme_cbacks { uint8_t new_nss, policy_mgr_nss_update_cback cback, uint8_t next_action, struct wlan_objmgr_psoc *psoc, enum policy_mgr_conn_update_reason reason); + QDF_STATUS (*sme_set_mas) (uint32_t val); }; /** @@ -1666,4 +1675,18 @@ static inline bool policy_mgr_is_scan_simultaneous_capable( return false; } + +/** + * policy_mgr_is_mcc_adaptive_scheduler_enabled() - Function to + * gets the policy manager mcc adaptive scheduler enabled + * @psoc: PSOC object information + * + * This function gets the value mcc adaptive scheduler + * + * Return: true if MCC adaptive scheduler is set else false + * + */ +bool policy_mgr_is_mcc_adaptive_scheduler_enabled( + struct wlan_objmgr_psoc *psoc); + #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 8aed7d8c994f..21203484c0cd 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -144,6 +144,21 @@ bool policy_mgr_is_dual_mac_disabled_in_ini( return wlan_objmgr_psoc_get_dual_mac_disable(psoc); } +/** + * policy_mgr_is_mas_enabled_in_user_cfg() - Check if MCC + * adaptive scheduler is enabled in INI + * @psoc: PSOC object information + * + * Checks if MCC adaptive scheduler is enabled in INI + * + * Return: true if MCC adaptive scheduler is enabled in INI + */ +bool policy_mgr_is_mas_enabled_in_user_cfg( + struct wlan_objmgr_psoc *psoc) +{ + return false; +} + /** * policy_mgr_get_dbs_config() - Get DBS bit * diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 570f1ae5b540..9653559447ac 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -566,14 +566,82 @@ bool policy_mgr_current_concurrency_is_mcc(struct wlan_objmgr_psoc *psoc) return is_mcc; } -void policy_mgr_set_concurrency_mode(enum tQDF_ADAPTER_MODE mode) +/** + * policy_mgr_set_concurrency_mode() - To set concurrency mode + * @psoc: PSOC object data + * @mode: device mode + * + * This routine is called to set the concurrency mode + * + * Return: NONE + */ +void policy_mgr_set_concurrency_mode(struct wlan_objmgr_psoc *psoc, + enum tQDF_ADAPTER_MODE mode) { - return; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return; + } + + switch (mode) { + case QDF_STA_MODE: + case QDF_P2P_CLIENT_MODE: + case QDF_P2P_GO_MODE: + case QDF_SAP_MODE: + case QDF_IBSS_MODE: + case QDF_MONITOR_MODE: + pm_ctx->concurrency_mode |= (1 << mode); + pm_ctx->no_of_open_sessions[mode]++; + break; + default: + break; + } + + policy_mgr_info("concurrency_mode = 0x%x Number of open sessions for mode %d = %d", + pm_ctx->concurrency_mode, mode, + pm_ctx->no_of_open_sessions[mode]); } -void policy_mgr_clear_concurrency_mode(enum tQDF_ADAPTER_MODE mode) +/** + * policy_mgr_clear_concurrency_mode() - To clear concurrency mode + * @psoc: PSOC object data + * @mode: device mode + * + * This routine is called to clear the concurrency mode + * + * Return: NONE + */ +void policy_mgr_clear_concurrency_mode(struct wlan_objmgr_psoc *psoc, + enum tQDF_ADAPTER_MODE mode) { - return; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return; + } + + switch (mode) { + case QDF_STA_MODE: + case QDF_P2P_CLIENT_MODE: + case QDF_P2P_GO_MODE: + case QDF_SAP_MODE: + case QDF_MONITOR_MODE: + pm_ctx->no_of_open_sessions[mode]--; + if (!(pm_ctx->no_of_open_sessions[mode])) + pm_ctx->concurrency_mode &= (~(1 << mode)); + break; + default: + break; + } + + policy_mgr_info("concurrency_mode = 0x%x Number of open sessions for mode %d = %d", + pm_ctx->concurrency_mode, mode, + pm_ctx->no_of_open_sessions[mode]); } void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, @@ -1208,8 +1276,93 @@ uint8_t policy_mgr_is_mcc_in_24G(struct wlan_objmgr_psoc *psoc) return is_24G_mcc; } -int32_t policy_mgr_set_mas(struct wlan_objmgr_psoc *psoc, uint8_t mas_value) +/** + * policy_mgr_is_mcc_adaptive_scheduler_enabled() - Function to + * gets the policy manager mcc adaptive scheduler enabled + * @psoc: PSOC object information + * + * This function gets the value mcc adaptive scheduler + * + * Return: true if MCC adaptive scheduler is set else false + * + */ +bool policy_mgr_is_mcc_adaptive_scheduler_enabled( + struct wlan_objmgr_psoc *psoc) { + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return false; + } + + return pm_ctx->enable_mcc_adaptive_scheduler ? true : false; +} + +/** + * policy_mgr_set_mas() - Function to set MAS value to UMAC + * @psoc: Pointer to psoc + * @mas_value: 0-Disable, 1-Enable MAS + * @dev_mode: device mode + * + * This function passes down the value of MAS to UMAC + * + * Return: Configuration message posting status, SUCCESS or Fail + * + */ +int32_t policy_mgr_set_mas(struct wlan_objmgr_psoc *psoc, + uint8_t mas_value, + enum tQDF_ADAPTER_MODE dev_mode) { + struct policy_mgr_psoc_priv_obj *pm_ctx; + QDF_STATUS ret_status; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return -EFAULT; + } + + if (mas_value) { + if (policy_mgr_is_mas_enabled_in_user_cfg(psoc)) { + policy_mgr_info("Miracast is ON. Disable MAS and configure P2P quota"); + pm_ctx->enable_mcc_adaptive_scheduler = false; + ret_status = pm_ctx->sme_cbacks.sme_set_mas(false); + if (QDF_STATUS_SUCCESS != ret_status) { + policy_mgr_err("Failed to disable MAS"); + return -EBUSY; + } + } + + /* Config p2p quota */ + if (dev_mode == QDF_STA_MODE) + policy_mgr_set_mcc_p2p_quota(psoc, + 100 - POLICY_MGR_DEFAULT_MCC_P2P_QUOTA); + else if (dev_mode == QDF_P2P_GO_MODE) + policy_mgr_go_set_mcc_p2p_quota(psoc, + POLICY_MGR_DEFAULT_MCC_P2P_QUOTA); + else + policy_mgr_set_mcc_p2p_quota(psoc, + POLICY_MGR_DEFAULT_MCC_P2P_QUOTA); + } else { + policy_mgr_info("Miracast is OFF. Enable MAS and reset P2P quota"); + if (dev_mode == QDF_P2P_GO_MODE) + policy_mgr_go_set_mcc_p2p_quota(psoc, + POLICY_MGR_RESET_MCC_P2P_QUOTA); + else + policy_mgr_set_mcc_p2p_quota(psoc, + POLICY_MGR_RESET_MCC_P2P_QUOTA); + + if (policy_mgr_is_mas_enabled_in_user_cfg(psoc)) { + pm_ctx->enable_mcc_adaptive_scheduler = true; + ret_status = pm_ctx->sme_cbacks.sme_set_mas(true); + if (QDF_STATUS_SUCCESS != ret_status) { + policy_mgr_err("Unable to enable MAS"); + return -EBUSY; + } + } + } + return 0; } diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 591678859531..b280caeac776 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -67,6 +67,12 @@ extern enum cds_band_type cds_chan_to_band(uint32_t chan); #define CONNECTION_UPDATE_TIMEOUT 1000 #endif +/** + * Some P2P quota calues for MCC + */ +#define POLICY_MGR_DEFAULT_MCC_P2P_QUOTA 70 +#define POLICY_MGR_RESET_MCC_P2P_QUOTA 50 + /** * Policy Mgr hardware mode list bit-mask definitions. * Bits 4:0, 31:29 are unused. @@ -252,6 +258,8 @@ extern enum policy_mgr_conc_next_action * scan & connections * @hw_mode_change_in_progress: This is to track if HW mode * change is in progress + * @enable_mcc_adaptive_scheduler: Enable MCC adaptive scheduler + * value from INI */ struct policy_mgr_psoc_priv_obj { struct wlan_objmgr_psoc *psoc; @@ -280,6 +288,7 @@ struct policy_mgr_psoc_priv_obj { uint8_t conc_system_pref; struct dual_mac_config dual_mac_cfg; uint32_t hw_mode_change_in_progress; + uint8_t enable_mcc_adaptive_scheduler; }; struct policy_mgr_psoc_priv_obj *policy_mgr_get_context( @@ -297,6 +306,18 @@ QDF_STATUS policy_mgr_get_updated_fw_mode_config( bool agile_dfs); bool policy_mgr_is_dual_mac_disabled_in_ini( struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_is_mas_enabled_in_user_cfg() - Check if MCC + * adaptive scheduler is enabled in INI + * @psoc: PSOC object information + * + * Checks if MCC adaptive scheduler is enabled in INI + * + * Return: true if MCC adaptive scheduler is enabled in INI + */ +bool policy_mgr_is_mas_enabled_in_user_cfg( + struct wlan_objmgr_psoc *psoc); bool policy_mgr_get_dbs_config(struct wlan_objmgr_psoc *psoc); bool policy_mgr_get_agile_dfs_config(struct wlan_objmgr_psoc *psoc); bool policy_mgr_get_dbs_scan_config(struct wlan_objmgr_psoc *psoc); diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index a7e10cb4aeef..927fc67a0295 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -396,6 +396,7 @@ QDF_STATUS policy_mgr_register_sme_cb(struct wlan_objmgr_psoc *psoc, sme_cbacks->sme_pdev_set_pcl; pm_ctx->sme_cbacks.sme_soc_set_dual_mac_config = sme_cbacks->sme_soc_set_dual_mac_config; + pm_ctx->sme_cbacks.sme_set_mas = sme_cbacks->sme_set_mas; return QDF_STATUS_SUCCESS; } From 8e3ee3676f4ecd0d8308c8fcf57feabd42eae83d Mon Sep 17 00:00:00 2001 From: Archana Ramachandran Date: Fri, 3 Mar 2017 20:02:10 -0800 Subject: [PATCH 014/187] qcacmn: Remove legacy dependency from Policy Manager Part 2 Remove legacy dependency from Policy Manager component Part 2 Change-Id: I26216e9b7fa0f75f144b5d8ef88be31fcb4224b5 CRs-Fixed: 2019994 --- inc/wlan_policy_mgr_api.h | 50 ++-------------- src/wlan_policy_mgr_get_set_utils.c | 89 ++++++++--------------------- src/wlan_policy_mgr_i.h | 6 -- src/wlan_policy_mgr_init_deinit.c | 3 +- 4 files changed, 31 insertions(+), 117 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 0c57170a6060..b9ec65aa8d70 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -176,57 +176,19 @@ static inline void policy_mgr_check_concurrent_intf_and_restart_sap( */ uint8_t policy_mgr_is_mcc_in_24G(struct wlan_objmgr_psoc *psoc); -/** - * policy_mgr_set_mas() - Function to set MAS value to UMAC - * @psoc: Pointer to psoc - * @mas_value: 0-Disable, 1-Enable MAS - * @dev_mode: device mode - * - * This function passes down the value of MAS to UMAC - * - * Return: Configuration message posting status, SUCCESS or Fail - * - */ -int32_t policy_mgr_set_mas(struct wlan_objmgr_psoc *psoc, - uint8_t mas_value, - enum tQDF_ADAPTER_MODE dev_mode); - -/** - * policy_mgr_set_mcc_p2p_quota() - Function to set quota for P2P - * @psoc: PSOC object information - * @set_value: Quota value for the interface - * - * This function is used to set the quota for P2P cases - * - * Return: Configuration message posting status, SUCCESS or Fail - * - */ -int policy_mgr_set_mcc_p2p_quota(struct wlan_objmgr_psoc *psoc, - uint32_t set_value); - /** * policy_mgr_change_mcc_go_beacon_interval() - Change MCC beacon interval * @psoc: PSOC object information + * @vdev_id: vdev id + * @dev_mode: device mode * * Updates the beacon parameters of the GO in MCC scenario * * Return: Success or Failure depending on the overall function behavior */ QDF_STATUS policy_mgr_change_mcc_go_beacon_interval( - struct wlan_objmgr_psoc *psoc); - -/** - * policy_mgr_go_set_mcc_p2p_quota() - Function to set quota for P2P GO - * @psoc: PSOC object information - * @set_value: Qouta value for the interface - * - * This function is used to set the quota for P2P GO cases - * - * Return: Configuration message posting status, SUCCESS or Fail - * - */ -int policy_mgr_go_set_mcc_p2p_quota(struct wlan_objmgr_psoc *psoc, - uint32_t set_value); + struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id, enum tQDF_ADAPTER_MODE dev_mode); /** * policy_mgr_set_mcc_latency() - Set MCC latency @@ -779,7 +741,7 @@ typedef void (*policy_mgr_nss_update_cback)(struct wlan_objmgr_psoc *psoc, * @sme_pdev_set_hw_mode: Set the new HW mode to FW * @sme_pdev_set_pcl: Set new PCL to FW * @sme_nss_update_request: Update NSS value to FW - * @sme_set_mas: Set MCC adaptive scheduler value + * @sme_change_mcc_beacon_interval: Set MCC beacon interval to FW */ struct policy_mgr_sme_cbacks { QDF_STATUS (*sme_get_valid_channels)(uint8_t *chan_list, @@ -794,7 +756,7 @@ struct policy_mgr_sme_cbacks { uint8_t new_nss, policy_mgr_nss_update_cback cback, uint8_t next_action, struct wlan_objmgr_psoc *psoc, enum policy_mgr_conn_update_reason reason); - QDF_STATUS (*sme_set_mas) (uint32_t val); + QDF_STATUS (*sme_change_mcc_beacon_interval) (uint8_t session_id); }; /** diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 9653559447ac..be7a6fb3d3dc 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1300,90 +1300,47 @@ bool policy_mgr_is_mcc_adaptive_scheduler_enabled( } /** - * policy_mgr_set_mas() - Function to set MAS value to UMAC - * @psoc: Pointer to psoc - * @mas_value: 0-Disable, 1-Enable MAS - * @dev_mode: device mode + * policy_mgr_change_mcc_go_beacon_interval() - Change MCC beacon interval + * @psoc: PSOC object information + * @vdev_id: vdev id + * @dev_mode: device mode * - * This function passes down the value of MAS to UMAC - * - * Return: Configuration message posting status, SUCCESS or Fail + * Updates the beacon parameters of the GO in MCC scenario * + * Return: Success or Failure depending on the overall function behavior */ -int32_t policy_mgr_set_mas(struct wlan_objmgr_psoc *psoc, - uint8_t mas_value, - enum tQDF_ADAPTER_MODE dev_mode) +QDF_STATUS policy_mgr_change_mcc_go_beacon_interval( + struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id, enum tQDF_ADAPTER_MODE dev_mode) { + QDF_STATUS status; struct policy_mgr_psoc_priv_obj *pm_ctx; - QDF_STATUS ret_status; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { policy_mgr_err("Invalid context"); - return -EFAULT; + return QDF_STATUS_E_FAILURE; } - if (mas_value) { - if (policy_mgr_is_mas_enabled_in_user_cfg(psoc)) { - policy_mgr_info("Miracast is ON. Disable MAS and configure P2P quota"); - pm_ctx->enable_mcc_adaptive_scheduler = false; - ret_status = pm_ctx->sme_cbacks.sme_set_mas(false); - if (QDF_STATUS_SUCCESS != ret_status) { - policy_mgr_err("Failed to disable MAS"); - return -EBUSY; - } + policy_mgr_info("UPDATE Beacon Params"); + + if (QDF_SAP_MODE == dev_mode) { + if (!pm_ctx-> + sme_cbacks.sme_change_mcc_beacon_interval) { + policy_mgr_err("sme_change_mcc_beacon_interval callback is NULL"); + return QDF_STATUS_E_FAILURE; } - - /* Config p2p quota */ - if (dev_mode == QDF_STA_MODE) - policy_mgr_set_mcc_p2p_quota(psoc, - 100 - POLICY_MGR_DEFAULT_MCC_P2P_QUOTA); - else if (dev_mode == QDF_P2P_GO_MODE) - policy_mgr_go_set_mcc_p2p_quota(psoc, - POLICY_MGR_DEFAULT_MCC_P2P_QUOTA); - else - policy_mgr_set_mcc_p2p_quota(psoc, - POLICY_MGR_DEFAULT_MCC_P2P_QUOTA); - } else { - policy_mgr_info("Miracast is OFF. Enable MAS and reset P2P quota"); - if (dev_mode == QDF_P2P_GO_MODE) - policy_mgr_go_set_mcc_p2p_quota(psoc, - POLICY_MGR_RESET_MCC_P2P_QUOTA); - else - policy_mgr_set_mcc_p2p_quota(psoc, - POLICY_MGR_RESET_MCC_P2P_QUOTA); - - if (policy_mgr_is_mas_enabled_in_user_cfg(psoc)) { - pm_ctx->enable_mcc_adaptive_scheduler = true; - ret_status = pm_ctx->sme_cbacks.sme_set_mas(true); - if (QDF_STATUS_SUCCESS != ret_status) { - policy_mgr_err("Unable to enable MAS"); - return -EBUSY; - } + status = pm_ctx->sme_cbacks. + sme_change_mcc_beacon_interval(vdev_id); + if (status == QDF_STATUS_E_FAILURE) { + policy_mgr_err("Failed to update Beacon Params"); + return QDF_STATUS_E_FAILURE; } } - return 0; -} - -int32_t policy_mgr_set_mcc_p2p_quota(struct wlan_objmgr_psoc *psoc, - uint32_t set_value) -{ - return 0; -} - -QDF_STATUS policy_mgr_change_mcc_go_beacon_interval( - struct wlan_objmgr_psoc *psoc) -{ return QDF_STATUS_SUCCESS; } -int32_t policy_mgr_go_set_mcc_p2p_quota(struct wlan_objmgr_psoc *psoc, - uint32_t set_value) -{ - return 0; -} - void policy_mgr_set_mcc_latency(struct wlan_objmgr_psoc *psoc, int set_value) { return; diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index b280caeac776..aef5d76712f6 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -67,12 +67,6 @@ extern enum cds_band_type cds_chan_to_band(uint32_t chan); #define CONNECTION_UPDATE_TIMEOUT 1000 #endif -/** - * Some P2P quota calues for MCC - */ -#define POLICY_MGR_DEFAULT_MCC_P2P_QUOTA 70 -#define POLICY_MGR_RESET_MCC_P2P_QUOTA 50 - /** * Policy Mgr hardware mode list bit-mask definitions. * Bits 4:0, 31:29 are unused. diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 927fc67a0295..425f5533f91b 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -396,7 +396,8 @@ QDF_STATUS policy_mgr_register_sme_cb(struct wlan_objmgr_psoc *psoc, sme_cbacks->sme_pdev_set_pcl; pm_ctx->sme_cbacks.sme_soc_set_dual_mac_config = sme_cbacks->sme_soc_set_dual_mac_config; - pm_ctx->sme_cbacks.sme_set_mas = sme_cbacks->sme_set_mas; + pm_ctx->sme_cbacks.sme_change_mcc_beacon_interval = + sme_cbacks->sme_change_mcc_beacon_interval; return QDF_STATUS_SUCCESS; } From 0edce259a369c19faf6f26c5fe43fcca1a448c22 Mon Sep 17 00:00:00 2001 From: Archana Ramachandran Date: Mon, 6 Mar 2017 14:36:29 -0800 Subject: [PATCH 015/187] qcacmn: Remove legacy dependency from Policy Manager Part 3 Remove legacy dependency from Policy Manager component Part 3 Change-Id: I63f6330e0b4b172d8f78f3e93131e9fba3121f09 CRs-Fixed: 2019994 --- inc/wlan_policy_mgr_api.h | 39 ++++++++++++-------- src/wlan_policy_mgr_action.c | 31 ++++++++++++++-- src/wlan_policy_mgr_get_set_utils.c | 57 +++++++++++++++++++++++++---- src/wlan_policy_mgr_i.h | 2 +- src/wlan_policy_mgr_init_deinit.c | 4 ++ 5 files changed, 105 insertions(+), 28 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index b9ec65aa8d70..ba31e2674672 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -190,30 +190,27 @@ QDF_STATUS policy_mgr_change_mcc_go_beacon_interval( struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, enum tQDF_ADAPTER_MODE dev_mode); -/** - * policy_mgr_set_mcc_latency() - Set MCC latency - * @psoc: PSOC object information - * @set_value: Latency value - * - * Sets the MCC latency value during STA-P2P concurrency - * - * Return: None - */ -void policy_mgr_set_mcc_latency(struct wlan_objmgr_psoc *psoc, int set_value); #if defined(FEATURE_WLAN_MCC_TO_SCC_SWITCH) /** * policy_mgr_change_sap_channel_with_csa() - Move SAP channel using (E)CSA * @psoc: PSOC object information - * @hdd_ap_ctx: AP context + * @vdev_id: Vdev id + * @channel: Channel to change + * @ch_width: channel width to change * * Invoke the callback function to change SAP channel using (E)CSA * * Return: None */ -void policy_mgr_change_sap_channel_with_csa(struct wlan_objmgr_psoc *psoc); +void policy_mgr_change_sap_channel_with_csa( + struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id, uint32_t channel, + uint32_t ch_width); #else static inline void policy_mgr_change_sap_channel_with_csa( - struct wlan_objmgr_psoc *psoc) + struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id, uint32_t channel, + uint32_t ch_width) { } @@ -757,6 +754,12 @@ struct policy_mgr_sme_cbacks { uint8_t next_action, struct wlan_objmgr_psoc *psoc, enum policy_mgr_conn_update_reason reason); QDF_STATUS (*sme_change_mcc_beacon_interval) (uint8_t session_id); + QDF_STATUS (*sme_get_ap_channel_from_scan_cache) ( + void *roam_profile, + void **scan_cache, + uint8_t *channel); + QDF_STATUS (*sme_scan_result_purge) ( + void *scan_result); }; /** @@ -938,23 +941,27 @@ void policy_mgr_clear_concurrent_session_count(struct wlan_objmgr_psoc *psoc); /** * policy_mgr_is_multiple_active_sta_sessions() - Check for * multiple STA connections + * @psoc: PSOC object information * * Checks if multiple active STA connection are in the driver * * Return: True if multiple STA sessions are present, False otherwise * */ -bool policy_mgr_is_multiple_active_sta_sessions(struct wlan_objmgr_psoc *psoc); +bool policy_mgr_is_multiple_active_sta_sessions( + struct wlan_objmgr_psoc *psoc); /** * policy_mgr_is_sta_active_connection_exists() - Check if a STA * connection is active + * @psoc: PSOC object information * * Checks if there is atleast one active STA connection in the driver * * Return: True if an active STA session is present, False otherwise */ -bool policy_mgr_is_sta_active_connection_exists(void); +bool policy_mgr_is_sta_active_connection_exists( + struct wlan_objmgr_psoc *psoc); /** * policy_mgr_concurrent_beaconing_sessions_running() - Checks @@ -1137,7 +1144,7 @@ QDF_STATUS policy_mgr_set_sap_mandatory_channels(struct wlan_objmgr_psoc *psoc, */ QDF_STATUS policy_mgr_register_sap_restart_channel_switch_cb( struct wlan_objmgr_psoc *psoc, - void (*sap_restart_chan_switch_cb)(void *, uint32_t, uint32_t)); + void (*sap_restart_chan_switch_cb)(uint8_t, uint32_t, uint32_t)); /** * policy_mgr_deregister_sap_restart_channel_switch_cb() - diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 3cd97c828bb1..bdf231553ed5 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -588,9 +588,34 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( #endif /* FEATURE_WLAN_MCC_TO_SCC_SWITCH */ #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH -void policy_mgr_change_sap_channel_with_csa(struct wlan_objmgr_psoc *psoc) +/** + * policy_mgr_change_sap_channel_with_csa() - Move SAP channel using (E)CSA + * @psoc: PSOC object information + * @vdev_id: Vdev id + * @channel: Channel to change + * @ch_width: channel width to change + * + * Invoke the callback function to change SAP channel using (E)CSA + * + * Return: None + */ +void policy_mgr_change_sap_channel_with_csa(struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id, uint32_t channel, + uint32_t ch_width) { - return; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return; + } + + if (pm_ctx->sap_restart_chan_switch_cb) { + policy_mgr_info("SAP change change without restart"); + pm_ctx->sap_restart_chan_switch_cb(vdev_id, + channel, ch_width); + } } #endif @@ -694,7 +719,7 @@ QDF_STATUS policy_mgr_restart_opportunistic_timer( #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH QDF_STATUS policy_mgr_register_sap_restart_channel_switch_cb( struct wlan_objmgr_psoc *psoc, - void (*sap_restart_chan_switch_cb)(void *, uint32_t, uint32_t)) + void (*sap_restart_chan_switch_cb)(uint8_t, uint32_t, uint32_t)) { struct policy_mgr_psoc_priv_obj *policy_mgr_ctx; diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index be7a6fb3d3dc..e0df1842819e 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1163,11 +1163,46 @@ uint32_t policy_mgr_get_concurrency_mode(void) return 0; } +/** + * policy_mgr_get_channel_from_scan_result() - to get channel from scan result + * @psoc: PSOC object information + * @roam_profile: pointer to roam profile + * @channel: channel to be filled + * + * This routine gets channel which most likely a candidate to which STA + * will make connection. + * + * Return: QDF_STATUS + */ QDF_STATUS policy_mgr_get_channel_from_scan_result( struct wlan_objmgr_psoc *psoc, void *roam_profile, uint8_t *channel) { - return QDF_STATUS_SUCCESS; + QDF_STATUS status; + void *scan_cache = NULL; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return QDF_STATUS_E_INVAL; + } + + if (!roam_profile || !channel) { + policy_mgr_err("Invalid input parameters"); + return QDF_STATUS_E_INVAL; + } + + status = pm_ctx->sme_cbacks.sme_get_ap_channel_from_scan_cache + (roam_profile, &scan_cache, channel); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("Get AP channel failed"); + return status; + } + + status = pm_ctx->sme_cbacks.sme_scan_result_purge(scan_cache); + + return status; } uint8_t policy_mgr_search_and_check_for_session_conc( @@ -1341,11 +1376,6 @@ QDF_STATUS policy_mgr_change_mcc_go_beacon_interval( return QDF_STATUS_SUCCESS; } -void policy_mgr_set_mcc_latency(struct wlan_objmgr_psoc *psoc, int set_value) -{ - return; -} - struct policy_mgr_conc_connection_info *policy_mgr_get_conn_info(uint32_t *len) { struct policy_mgr_conc_connection_info *conn_ptr = @@ -1412,9 +1442,20 @@ bool policy_mgr_is_multiple_active_sta_sessions(struct wlan_objmgr_psoc *psoc) psoc, PM_STA_MODE, NULL) > 1; } -bool policy_mgr_is_sta_active_connection_exists(void) +/** + * policy_mgr_is_sta_active_connection_exists() - Check if a STA + * connection is active + * @psoc: PSOC object information + * + * Checks if there is atleast one active STA connection in the driver + * + * Return: True if an active STA session is present, False otherwise + */ +bool policy_mgr_is_sta_active_connection_exists( + struct wlan_objmgr_psoc *psoc) { - return true; + return (!policy_mgr_mode_specific_connection_count( + psoc, QDF_STA_MODE, NULL)) ? false : true; } bool policy_mgr_is_any_nondfs_chnl_present(struct wlan_objmgr_psoc *psoc, diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index aef5d76712f6..bd0add049428 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -260,7 +260,7 @@ struct policy_mgr_psoc_priv_obj { qdf_event_t connection_update_done_evt; qdf_mutex_t qdf_conc_list_lock; qdf_mc_timer_t dbs_opportunistic_timer; - void (*sap_restart_chan_switch_cb)(void *, uint32_t, uint32_t); + void (*sap_restart_chan_switch_cb)(uint8_t, uint32_t, uint32_t); struct policy_mgr_sme_cbacks sme_cbacks; struct policy_mgr_wma_cbacks wma_cbacks; struct policy_mgr_tdls_cbacks tdls_cbacks; diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 425f5533f91b..6b09251bfe77 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -398,6 +398,10 @@ QDF_STATUS policy_mgr_register_sme_cb(struct wlan_objmgr_psoc *psoc, sme_cbacks->sme_soc_set_dual_mac_config; pm_ctx->sme_cbacks.sme_change_mcc_beacon_interval = sme_cbacks->sme_change_mcc_beacon_interval; + pm_ctx->sme_cbacks.sme_get_ap_channel_from_scan_cache = + sme_cbacks->sme_get_ap_channel_from_scan_cache; + pm_ctx->sme_cbacks.sme_scan_result_purge = + sme_cbacks->sme_scan_result_purge; return QDF_STATUS_SUCCESS; } From 107d378bcb7fa1aad40d8111a0b99a27ae4d95d4 Mon Sep 17 00:00:00 2001 From: Archana Ramachandran Date: Mon, 6 Mar 2017 17:07:44 -0800 Subject: [PATCH 016/187] qcacmn: Remove legacy dependency from Policy Manager Part 4 Remove legacy dependency from Policy Manager component Part 4 Change-Id: I9b96a03031c27b87c9e74a3df512f6032051bd85 CRs-Fixed: 2019994 --- inc/wlan_policy_mgr_api.h | 19 +++-- src/wlan_policy_mgr_action.c | 15 +++- src/wlan_policy_mgr_core.c | 6 ++ src/wlan_policy_mgr_get_set_utils.c | 122 ++++++++++++++++------------ src/wlan_policy_mgr_i.h | 11 +++ 5 files changed, 114 insertions(+), 59 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index ba31e2674672..62a140fb6120 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -95,12 +95,13 @@ uint32_t policy_mgr_get_connection_count(struct wlan_objmgr_psoc *psoc); /** * policy_mgr_get_concurrency_mode() - return concurrency mode + * @psoc: PSOC object information * * This routine is used to retrieve concurrency mode * * Return: uint32_t value of concurrency mask */ -uint32_t policy_mgr_get_concurrency_mode(void); +uint32_t policy_mgr_get_concurrency_mode(struct wlan_objmgr_psoc *psoc); /** * policy_mgr_search_and_check_for_session_conc() - Checks if @@ -150,15 +151,19 @@ QDF_STATUS policy_mgr_handle_conc_multiport( * policy_mgr_check_concurrent_intf_and_restart_sap() - Check * concurrent change intf * @psoc: PSOC object information + * @operation_channel: operation channel * * Checks the concurrent change interface and restarts SAP + * * Return: None */ void policy_mgr_check_concurrent_intf_and_restart_sap( - struct wlan_objmgr_psoc *psoc); + struct wlan_objmgr_psoc *psoc, + uint8_t operation_channel); #else static inline void policy_mgr_check_concurrent_intf_and_restart_sap( - struct wlan_objmgr_psoc *psoc) + struct wlan_objmgr_psoc *psoc, + uint8_t operation_channel) { } @@ -904,13 +909,15 @@ QDF_STATUS policy_mgr_get_channel_from_scan_result( /** * policy_mgr_concurrent_open_sessions_running() - Checks for * concurrent open session + * @psoc: PSOC object information * * Checks if more than one open session is running for all the allowed modes * in the driver * * Return: True if more than one open session exists, False otherwise */ -bool policy_mgr_concurrent_open_sessions_running(void); +bool policy_mgr_concurrent_open_sessions_running( + struct wlan_objmgr_psoc *psoc); /** * policy_mgr_max_concurrent_connections_reached() - Check if @@ -966,13 +973,15 @@ bool policy_mgr_is_sta_active_connection_exists( /** * policy_mgr_concurrent_beaconing_sessions_running() - Checks * for concurrent beaconing entities + * @psoc: PSOC object information * * Checks if multiple beaconing sessions are running i.e., if SAP or GO or IBSS * are beaconing together * * Return: True if multiple entities are beaconing together, False otherwise */ -bool policy_mgr_concurrent_beaconing_sessions_running(void); +bool policy_mgr_concurrent_beaconing_sessions_running( + struct wlan_objmgr_psoc *psoc); /** * policy_mgr_wait_for_connection_update() - Wait for hw mode diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index bdf231553ed5..dd6a622e22a0 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -577,13 +577,22 @@ QDF_STATUS policy_mgr_handle_conc_multiport(struct wlan_objmgr_psoc *psoc, #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) { - return; } +/** + * policy_mgr_check_concurrent_intf_and_restart_sap() - Check + * concurrent change intf + * @psoc: PSOC object information + * @operation_channel: operation channel + * + * Checks the concurrent change interface and restarts SAP + * + * Return: None + */ void policy_mgr_check_concurrent_intf_and_restart_sap( - struct wlan_objmgr_psoc *psoc) + struct wlan_objmgr_psoc *psoc, + uint8_t operation_channel) { - return; } #endif /* FEATURE_WLAN_MCC_TO_SCC_SWITCH */ diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 21203484c0cd..1b6c0b9b059e 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -159,6 +159,12 @@ bool policy_mgr_is_mas_enabled_in_user_cfg( return false; } +uint32_t policy_mgr_mcc_to_scc_switch_mode_in_user_cfg( + struct wlan_objmgr_psoc *psoc) +{ + return 0; +} + /** * policy_mgr_get_dbs_config() - Get DBS bit * diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index e0df1842819e..9fd56da450a5 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1158,9 +1158,28 @@ done: return status; } -uint32_t policy_mgr_get_concurrency_mode(void) +/** + * policy_mgr_get_concurrency_mode() - return concurrency mode + * @psoc: PSOC object information + * + * This routine is used to retrieve concurrency mode + * + * Return: uint32_t value of concurrency mask + */ +uint32_t policy_mgr_get_concurrency_mode(struct wlan_objmgr_psoc *psoc) { - return 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return QDF_STA_MASK; + } + + policy_mgr_info("concurrency_mode: 0x%x", + pm_ctx->concurrency_mode); + + return pm_ctx->concurrency_mode; } /** @@ -1239,6 +1258,11 @@ uint8_t policy_mgr_search_and_check_for_session_conc( return channel; } +uint8_t policy_mgr_is_mcc_in_24G(struct wlan_objmgr_psoc *psoc) +{ + return 0; +} + bool policy_mgr_check_for_session_conc(struct wlan_objmgr_psoc *psoc, uint8_t session_id, uint8_t channel) { @@ -1266,51 +1290,6 @@ bool policy_mgr_check_for_session_conc(struct wlan_objmgr_psoc *psoc, return true; } -uint8_t policy_mgr_is_mcc_in_24G(struct wlan_objmgr_psoc *psoc) -{ - uint32_t num_connections = 0; - bool is_24G_mcc = false; - - num_connections = policy_mgr_get_connection_count(psoc); - - switch (num_connections) { - case 1: - break; - case 2: - if ((pm_conc_connection_list[0].chan != - pm_conc_connection_list[1].chan) && - (pm_conc_connection_list[0].mac == - pm_conc_connection_list[1].mac) && - (pm_conc_connection_list[0].chan <= - WLAN_REG_MAX_24GHZ_CH_NUM) && - (pm_conc_connection_list[1].chan <= - WLAN_REG_MAX_24GHZ_CH_NUM)) - is_24G_mcc = true; - break; - case 3: - if (((pm_conc_connection_list[0].chan != - pm_conc_connection_list[1].chan) || - (pm_conc_connection_list[0].chan != - pm_conc_connection_list[2].chan) || - (pm_conc_connection_list[1].chan != - pm_conc_connection_list[2].chan)) && - (pm_conc_connection_list[0].chan <= - WLAN_REG_MAX_24GHZ_CH_NUM) && - (pm_conc_connection_list[1].chan <= - WLAN_REG_MAX_24GHZ_CH_NUM) && - (pm_conc_connection_list[2].chan <= - WLAN_REG_MAX_24GHZ_CH_NUM)) - is_24G_mcc = true; - break; - default: - policy_mgr_err("unexpected num_connections value %d", - num_connections); - break; - } - - return is_24G_mcc; -} - /** * policy_mgr_is_mcc_adaptive_scheduler_enabled() - Function to * gets the policy manager mcc adaptive scheduler enabled @@ -1413,14 +1392,55 @@ enum policy_mgr_con_mode policy_mgr_convert_device_mode_to_qdf_type( return mode; } -bool policy_mgr_concurrent_open_sessions_running(void) +/** + * policy_mgr_concurrent_open_sessions_running() - Checks for + * concurrent open session + * @psoc: PSOC object information + * + * Checks if more than one open session is running for all the allowed modes + * in the driver + * + * Return: True if more than one open session exists, False otherwise + */ +bool policy_mgr_concurrent_open_sessions_running( + struct wlan_objmgr_psoc *psoc) { - return true; + uint8_t i = 0; + uint8_t j = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return false; + } + + for (i = 0; i < QDF_MAX_NO_OF_MODE; i++) + j += pm_ctx->no_of_open_sessions[i]; + + return j > 1; } -bool policy_mgr_concurrent_beaconing_sessions_running(void) +/** + * policy_mgr_concurrent_beaconing_sessions_running() - Checks + * for concurrent beaconing entities + * @psoc: PSOC object information + * + * Checks if multiple beaconing sessions are running i.e., if SAP or GO or IBSS + * are beaconing together + * + * Return: True if multiple entities are beaconing together, False otherwise + */ +bool policy_mgr_concurrent_beaconing_sessions_running( + struct wlan_objmgr_psoc *psoc) { - return true; + return (policy_mgr_mode_specific_connection_count( + psoc, QDF_SAP_MODE, NULL) + + policy_mgr_mode_specific_connection_count( + psoc, QDF_P2P_GO_MODE, NULL) + + policy_mgr_mode_specific_connection_count( + psoc, QDF_IBSS_MODE, NULL) > 1) ? + true : false; } diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index bd0add049428..0169b65fb18a 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -312,6 +312,17 @@ bool policy_mgr_is_dual_mac_disabled_in_ini( */ bool policy_mgr_is_mas_enabled_in_user_cfg( struct wlan_objmgr_psoc *psoc); +/** + * policy_mgr_mcc_to_scc_switch_mode_in_user_cfg() - MCC to SCC + * switch mode value in the user config + * @psoc: PSOC object information + * + * MCC to SCC switch mode value in user config + * + * Return: MCC to SCC switch mode value + */ +uint32_t policy_mgr_mcc_to_scc_switch_mode_in_user_cfg( + struct wlan_objmgr_psoc *psoc); bool policy_mgr_get_dbs_config(struct wlan_objmgr_psoc *psoc); bool policy_mgr_get_agile_dfs_config(struct wlan_objmgr_psoc *psoc); bool policy_mgr_get_dbs_scan_config(struct wlan_objmgr_psoc *psoc); From 266613f3d9bdf8babd502f14ea62da6ed2d5e713 Mon Sep 17 00:00:00 2001 From: Archana Ramachandran Date: Mon, 13 Mar 2017 16:36:55 -0700 Subject: [PATCH 017/187] qcacmn: Remove legacy dependency from Policy Manager Part 5 Remove legacy dependency from Policy Manager component Part 5 Change-Id: I942e376eea4b370af5d0cd882b0beaa58012c48f CRs-Fixed: 2019994 --- inc/wlan_policy_mgr_api.h | 4 +- src/wlan_policy_mgr_action.c | 25 ++++++++ src/wlan_policy_mgr_get_set_utils.c | 90 ++++++++++++++++++++++------- 3 files changed, 95 insertions(+), 24 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 62a140fb6120..e601636c8a00 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -176,10 +176,10 @@ static inline void policy_mgr_check_concurrent_intf_and_restart_sap( * This function is used to check for MCC operation in 2.4GHz band. * STA, P2P and SAP adapters are only considered. * - * Return: Non zero value if MCC is detected in 2.4GHz band + * Return: True if mcc is detected in 2.4 Ghz, false otherwise * */ -uint8_t policy_mgr_is_mcc_in_24G(struct wlan_objmgr_psoc *psoc); +bool policy_mgr_is_mcc_in_24G(struct wlan_objmgr_psoc *psoc); /** * policy_mgr_change_mcc_go_beacon_interval() - Change MCC beacon interval diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index dd6a622e22a0..31dd59904587 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -593,6 +593,31 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( struct wlan_objmgr_psoc *psoc, uint8_t operation_channel) { + struct policy_mgr_psoc_priv_obj *pm_ctx; + uint32_t mcc_to_scc_switch; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return; + } + + mcc_to_scc_switch = + policy_mgr_mcc_to_scc_switch_mode_in_user_cfg(psoc); + policy_mgr_info("MCC to SCC switch: %d chan: %d", + mcc_to_scc_switch, operation_channel); + if ((mcc_to_scc_switch != QDF_MCC_TO_SCC_SWITCH_DISABLE) +#ifdef FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE + && !wlan_reg_is_dfs_ch(psoc, + operationChannel) +#endif + ) { + qdf_create_work(0, &pm_ctx->sta_ap_intf_check_work, + policy_mgr_check_sta_ap_concurrent_ch_intf, + (void *)psoc); + qdf_sched_work(0, &pm_ctx->sta_ap_intf_check_work); + policy_mgr_info("Checking for Concurrent Change interference"); + } } #endif /* FEATURE_WLAN_MCC_TO_SCC_SWITCH */ diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 9fd56da450a5..992728ecb412 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1258,9 +1258,75 @@ uint8_t policy_mgr_search_and_check_for_session_conc( return channel; } -uint8_t policy_mgr_is_mcc_in_24G(struct wlan_objmgr_psoc *psoc) +/** + * policy_mgr_is_two_connection_mcc() - Check if MCC scenario + * when there are two connections + * + * If if MCC scenario when there are two connections + * + * Return: true or false + */ +static bool policy_mgr_is_two_connection_mcc(void) { - return 0; + return ((pm_conc_connection_list[0].chan != + pm_conc_connection_list[1].chan) && + (pm_conc_connection_list[0].mac == + pm_conc_connection_list[1].mac) && + (pm_conc_connection_list[0].chan <= + WLAN_REG_MAX_24GHZ_CH_NUM) && + (pm_conc_connection_list[1].chan <= + WLAN_REG_MAX_24GHZ_CH_NUM)) ? true : false; +} + +/** + * policy_mgr_is_three_connection_mcc() - Check if MCC scenario + * when there are three connections + * + * If if MCC scenario when there are three connections + * + * Return: true or false + */ +static bool policy_mgr_is_three_connection_mcc(void) +{ + return (((pm_conc_connection_list[0].chan != + pm_conc_connection_list[1].chan) || + (pm_conc_connection_list[0].chan != + pm_conc_connection_list[2].chan) || + (pm_conc_connection_list[1].chan != + pm_conc_connection_list[2].chan)) && + (pm_conc_connection_list[0].chan <= + WLAN_REG_MAX_24GHZ_CH_NUM) && + (pm_conc_connection_list[1].chan <= + WLAN_REG_MAX_24GHZ_CH_NUM) && + (pm_conc_connection_list[2].chan <= + WLAN_REG_MAX_24GHZ_CH_NUM)) ? true : false; +} + +bool policy_mgr_is_mcc_in_24G(struct wlan_objmgr_psoc *psoc) +{ + uint32_t num_connections = 0; + bool is_24G_mcc = false; + + num_connections = policy_mgr_get_connection_count(psoc); + + switch (num_connections) { + case 1: + break; + case 2: + if (policy_mgr_is_two_connection_mcc()) + is_24G_mcc = true; + break; + case 3: + if (policy_mgr_is_three_connection_mcc()) + is_24G_mcc = true; + break; + default: + policy_mgr_err("unexpected num_connections value %d", + num_connections); + break; + } + + return is_24G_mcc; } bool policy_mgr_check_for_session_conc(struct wlan_objmgr_psoc *psoc, @@ -1290,16 +1356,6 @@ bool policy_mgr_check_for_session_conc(struct wlan_objmgr_psoc *psoc, return true; } -/** - * policy_mgr_is_mcc_adaptive_scheduler_enabled() - Function to - * gets the policy manager mcc adaptive scheduler enabled - * @psoc: PSOC object information - * - * This function gets the value mcc adaptive scheduler - * - * Return: true if MCC adaptive scheduler is set else false - * - */ bool policy_mgr_is_mcc_adaptive_scheduler_enabled( struct wlan_objmgr_psoc *psoc) { struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -1313,16 +1369,6 @@ bool policy_mgr_is_mcc_adaptive_scheduler_enabled( return pm_ctx->enable_mcc_adaptive_scheduler ? true : false; } -/** - * policy_mgr_change_mcc_go_beacon_interval() - Change MCC beacon interval - * @psoc: PSOC object information - * @vdev_id: vdev id - * @dev_mode: device mode - * - * Updates the beacon parameters of the GO in MCC scenario - * - * Return: Success or Failure depending on the overall function behavior - */ QDF_STATUS policy_mgr_change_mcc_go_beacon_interval( struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, enum tQDF_ADAPTER_MODE dev_mode) From 544ce17b54b13aa84c9ba15e3a10ee1804e6c754 Mon Sep 17 00:00:00 2001 From: Archana Ramachandran Date: Tue, 14 Mar 2017 15:12:09 -0700 Subject: [PATCH 018/187] qcacmn: Remove legacy dependency from Policy Manager Part 6 Remove legacy dependency from Policy Manager component Part 6 Change-Id: I5136d82c2b30ba71df8c48165c4bc4b560aaee39 CRs-Fixed: 2019994 --- inc/wlan_policy_mgr_api.h | 72 ++++++++++++++ src/wlan_policy_mgr_action.c | 157 ++++++++++++++++++++++++++++-- src/wlan_policy_mgr_i.h | 27 +---- src/wlan_policy_mgr_init_deinit.c | 30 ++++++ 4 files changed, 253 insertions(+), 33 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index e601636c8a00..b2aaa3d0ff97 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -39,6 +39,33 @@ #include "qdf_status.h" #include "wlan_objmgr_psoc_obj.h" #include "wlan_policy_mgr_public_struct.h" +#include + +enum cds_band_type { + CDS_BAND_ALL = 0, + CDS_BAND_2GHZ = 1, + CDS_BAND_5GHZ = 2 +}; +extern uint32_t cds_chan_to_freq(uint8_t chan); +extern uint8_t cds_freq_to_chan(uint32_t freq); +extern enum cds_band_type cds_chan_to_band(uint32_t chan); + +#define WLAN_REG_IS_24GHZ_CH(ch) CDS_IS_CHANNEL_24GHZ(ch) +#define WLAN_REG_IS_5GHZ_CH(ch) CDS_IS_CHANNEL_5GHZ(ch) +#define WLAN_REG_IS_SAME_BAND_CHANNELS(ch1, ch2) \ + CDS_IS_SAME_BAND_CHANNELS(ch1, ch2) +#define WLAN_REG_IS_CHANNEL_VALID_5G_SBS(curchan, newchan) \ + CDS_IS_CHANNEL_VALID_5G_SBS(curchan, newchan) +#define wlan_reg_is_dfs_ch(psoc, ch) CDS_IS_DFS_CH(ch) +#define WLAN_REG_MAX_24GHZ_CH_NUM CDS_MAX_24GHZ_CHANNEL_NUMBER +#define reg_chan_to_freq(chan_num) cds_chan_to_freq(chan_num) +#define reg_freq_to_chan(freq) cds_freq_to_chan(freq) +#define reg_chan_to_band(chan_num) cds_chan_to_band(chan_num) +#define BAND_2G CDS_BAND_2GHZ +#define BAND_5G CDS_BAND_5GHZ +#define BAND_ALL CDS_BAND_ALL +#define wlan_reg_set_channel_params(channel, sec_ch, ch_params) \ + cds_set_channel_params(channel, sec_ch, ch_params) typedef const enum policy_mgr_pcl_type pm_dbs_pcl_second_connection_table_type @@ -152,6 +179,7 @@ QDF_STATUS policy_mgr_handle_conc_multiport( * concurrent change intf * @psoc: PSOC object information * @operation_channel: operation channel + * @vdev_id: vdev id of SAP * * Checks the concurrent change interface and restarts SAP * @@ -159,10 +187,12 @@ QDF_STATUS policy_mgr_handle_conc_multiport( */ void policy_mgr_check_concurrent_intf_and_restart_sap( struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id, uint8_t operation_channel); #else static inline void policy_mgr_check_concurrent_intf_and_restart_sap( struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id, uint8_t operation_channel) { @@ -733,6 +763,17 @@ typedef void (*policy_mgr_nss_update_cback)(struct wlan_objmgr_psoc *psoc, uint8_t next_action, enum policy_mgr_conn_update_reason reason); +/** + * struct check_cc_channel_work - Check concurrent interface + * channel to restart SAP work data + * @wlan_objmgr_psoc: PSOC object data + * @vdev_id: vdev id of sap + */ +struct check_cc_channel_work { + struct wlan_objmgr_psoc *psoc; + uint8_t vdev_id; +}; + /** * struct policy_mgr_sme_cbacks - SME Callbacks to be invoked * from policy manager @@ -767,6 +808,23 @@ struct policy_mgr_sme_cbacks { void *scan_result); }; +/** + * struct policy_mgr_hdd_cbacks - HDD Callbacks to be invoked + * from policy manager + * @sap_restart_chan_switch_cb: Restart SAP + * @wlan_hdd_get_channel_for_sap_restart: Get channel to restart + * SAP + */ +struct policy_mgr_hdd_cbacks { + void (*sap_restart_chan_switch_cb)(uint8_t, + uint32_t, uint32_t); + QDF_STATUS (*wlan_hdd_get_channel_for_sap_restart)( + uint8_t vdev_id, uint8_t *channel, + uint8_t *sec_ch, + struct ch_params_s *ch_params); +}; + + /** * struct policy_mgr_tdls_cbacks - TDLS Callbacks to be invoked * from policy manager @@ -1382,6 +1440,20 @@ bool policy_mgr_current_concurrency_is_mcc(struct wlan_objmgr_psoc *psoc); QDF_STATUS policy_mgr_register_sme_cb(struct wlan_objmgr_psoc *psoc, struct policy_mgr_sme_cbacks *sme_cbacks); +/** + * policy_mgr_register_hdd_cb() - register HDD callbacks + * @psoc: PSOC object information + * @hdd_cbacks: function pointers from HDD + * + * API, allows HDD to register callbacks to be invoked by policy + * mgr + * + * Return: SUCCESS, + * Failure (if registration fails) + */ +QDF_STATUS policy_mgr_register_hdd_cb(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_hdd_cbacks *hdd_cbacks); + /** * policy_mgr_register_tdls_cb() - register TDLS callbacks * @psoc: PSOC object information diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 31dd59904587..b57bef7b163f 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -575,8 +575,144 @@ QDF_STATUS policy_mgr_handle_conc_multiport(struct wlan_objmgr_psoc *psoc, } #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH +/** + * policy_mgr_is_restart_sap_allowed() - Check if restart SAP + * allowed during SCC -> MCC switch + * @psoc: PSOC object data + * @mcc_to_scc_switch: MCC to SCC switch enabled user config + * + * Check if restart SAP allowed during SCC->MCC switch + * + * Restart: true or false + */ +static bool policy_mgr_is_restart_sap_allowed( + struct wlan_objmgr_psoc *psoc, + uint32_t mcc_to_scc_switch) +{ + if ((mcc_to_scc_switch == QDF_MCC_TO_SCC_SWITCH_DISABLE) || + !(policy_mgr_concurrent_open_sessions_running(psoc) && + (policy_mgr_get_concurrency_mode(psoc) == + (QDF_STA_MASK | QDF_SAP_MASK)))) { + policy_mgr_err("MCC switch disabled or not concurrent STA/SAP"); + return false; + } + return true; +} + +/** + * policy_mgr_is_sap_channel_change_without_restart() - Check if + * SAP channel change allowed without restart + * @mcc_to_scc_switch: MCC to SCC switch enabled user config + * + * Check if SAP channel change allowed without restart + * + * Restart: true or false + */ +static bool policy_mgr_is_sap_channel_change_without_restart( + uint32_t mcc_to_scc_switch) { + if (mcc_to_scc_switch == + QDF_MCC_TO_SCC_SWITCH_FORCE_WITHOUT_DISCONNECTION || + mcc_to_scc_switch == + QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL) { + policy_mgr_info("SAP chan change without restart allowed"); + return true; + } + return false; +} + +/** + * policy_mgr_check_sta_ap_concurrent_ch_intf() - Restart SAP in STA-AP case + * @data: Pointer check concurrent channel work data + * + * Restarts the SAP interface in STA-AP concurrency scenario + * + * Restart: None + */ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) { + struct check_cc_channel_work *cc_intf_work = + (struct check_cc_channel_work *) data; + struct policy_mgr_psoc_priv_obj *pm_ctx; + uint32_t mcc_to_scc_switch; + struct wlan_objmgr_psoc *psoc; + QDF_STATUS status; + uint8_t channel, sec_ch; + struct ch_params_s ch_params; + + if (!cc_intf_work) { + policy_mgr_err("Invalid check channel interface work"); + goto work_done; + } + psoc = cc_intf_work->psoc; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + goto work_done; + } + mcc_to_scc_switch = + policy_mgr_mcc_to_scc_switch_mode_in_user_cfg(psoc); + + policy_mgr_info("Concurrent open sessions running: %d", + policy_mgr_concurrent_open_sessions_running(psoc)); + + if (!policy_mgr_is_restart_sap_allowed(psoc, mcc_to_scc_switch)) + goto work_done; + + status = pm_ctx->hdd_cbacks. + wlan_hdd_get_channel_for_sap_restart( + cc_intf_work->vdev_id, &channel, + &sec_ch, &ch_params); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("Failed to get channel to restart SAP"); + goto work_done; + } + + if (channel == 0) { + policy_mgr_err("Invalid channel to restart SAP"); + goto work_done; + } + policy_mgr_info("SAP restarts due to MCC->SCC switch, new chan: %d", + channel); + + wlan_reg_set_channel_params(channel, sec_ch, &ch_params); + + if (policy_mgr_is_sap_channel_change_without_restart( + mcc_to_scc_switch) && + pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb) { + pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb( + cc_intf_work->vdev_id, channel, + ch_params.ch_width); + } + +work_done: + qdf_mem_free(cc_intf_work); + +} + +/** + * create_check_cc_channel_work() - Create Check concurrent intf + * channel work + * @psoc: PSOC object information + * + * Create check concurrent interface channel work + * + * Return: check concurrent channel interface work object + */ +static struct check_cc_channel_work *create_check_cc_channel_work( + struct wlan_objmgr_psoc *psoc, uint8_t vdev_id) +{ + struct check_cc_channel_work *cc_intf_work; + + cc_intf_work = qdf_mem_malloc( + sizeof(struct check_cc_channel_work)); + if (NULL == cc_intf_work) { + policy_mgr_err("Falied to allocate check concurrent channel work"); + return NULL; + } + cc_intf_work->psoc = psoc; + cc_intf_work->vdev_id = vdev_id; + return cc_intf_work; } /** @@ -584,6 +720,7 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) * concurrent change intf * @psoc: PSOC object information * @operation_channel: operation channel + * @vdev_id: vdev id of SAP * * Checks the concurrent change interface and restarts SAP * @@ -591,10 +728,12 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) */ void policy_mgr_check_concurrent_intf_and_restart_sap( struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id, uint8_t operation_channel) { struct policy_mgr_psoc_priv_obj *pm_ctx; uint32_t mcc_to_scc_switch; + struct check_cc_channel_work *cc_intf_work; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -612,9 +751,12 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( operationChannel) #endif ) { + cc_intf_work = create_check_cc_channel_work(psoc, vdev_id); + if (!cc_intf_work) + return; qdf_create_work(0, &pm_ctx->sta_ap_intf_check_work, policy_mgr_check_sta_ap_concurrent_ch_intf, - (void *)psoc); + cc_intf_work); qdf_sched_work(0, &pm_ctx->sta_ap_intf_check_work); policy_mgr_info("Checking for Concurrent Change interference"); } @@ -645,9 +787,9 @@ void policy_mgr_change_sap_channel_with_csa(struct wlan_objmgr_psoc *psoc, return; } - if (pm_ctx->sap_restart_chan_switch_cb) { + if (pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb) { policy_mgr_info("SAP change change without restart"); - pm_ctx->sap_restart_chan_switch_cb(vdev_id, + pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb(vdev_id, channel, ch_width); } } @@ -752,8 +894,8 @@ QDF_STATUS policy_mgr_restart_opportunistic_timer( #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH QDF_STATUS policy_mgr_register_sap_restart_channel_switch_cb( - struct wlan_objmgr_psoc *psoc, - void (*sap_restart_chan_switch_cb)(uint8_t, uint32_t, uint32_t)) + struct wlan_objmgr_psoc *psoc, + void (*sap_restart_chan_switch_cb)(uint8_t, uint32_t, uint32_t)) { struct policy_mgr_psoc_priv_obj *policy_mgr_ctx; @@ -763,7 +905,8 @@ QDF_STATUS policy_mgr_register_sap_restart_channel_switch_cb( return QDF_STATUS_E_FAILURE; } - policy_mgr_ctx->sap_restart_chan_switch_cb = sap_restart_chan_switch_cb; + policy_mgr_ctx->hdd_cbacks.sap_restart_chan_switch_cb = + sap_restart_chan_switch_cb; return QDF_STATUS_SUCCESS; } @@ -779,7 +922,7 @@ QDF_STATUS policy_mgr_deregister_sap_restart_channel_switch_cb( return QDF_STATUS_E_FAILURE; } - policy_mgr_ctx->sap_restart_chan_switch_cb = NULL; + policy_mgr_ctx->hdd_cbacks.sap_restart_chan_switch_cb = NULL; return QDF_STATUS_SUCCESS; } diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 0169b65fb18a..5f65da15d984 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -33,31 +33,6 @@ #include "qdf_mc_timer.h" #include "qdf_lock.h" #include "qdf_defer.h" -#include - -enum cds_band_type { - CDS_BAND_ALL = 0, - CDS_BAND_2GHZ = 1, - CDS_BAND_5GHZ = 2 -}; -extern uint32_t cds_chan_to_freq(uint8_t chan); -extern uint8_t cds_freq_to_chan(uint32_t freq); -extern enum cds_band_type cds_chan_to_band(uint32_t chan); - -#define WLAN_REG_IS_24GHZ_CH(ch) CDS_IS_CHANNEL_24GHZ(ch) -#define WLAN_REG_IS_5GHZ_CH(ch) CDS_IS_CHANNEL_5GHZ(ch) -#define WLAN_REG_IS_SAME_BAND_CHANNELS(ch1, ch2) \ - CDS_IS_SAME_BAND_CHANNELS(ch1, ch2) -#define WLAN_REG_IS_CHANNEL_VALID_5G_SBS(curchan, newchan) \ - CDS_IS_CHANNEL_VALID_5G_SBS(curchan, newchan) -#define wlan_reg_is_dfs_ch(psoc, ch) CDS_IS_DFS_CH(ch) -#define WLAN_REG_MAX_24GHZ_CH_NUM CDS_MAX_24GHZ_CHANNEL_NUMBER -#define reg_chan_to_freq(chan_num) cds_chan_to_freq(chan_num) -#define reg_freq_to_chan(freq) cds_freq_to_chan(freq) -#define reg_chan_to_band(chan_num) cds_chan_to_band(chan_num) -#define BAND_2G CDS_BAND_2GHZ -#define BAND_5G CDS_BAND_5GHZ -#define BAND_ALL CDS_BAND_ALL #define MAX_NUMBER_OF_CONC_CONNECTIONS 3 #define DBS_OPPORTUNISTIC_TIME 10 @@ -260,7 +235,7 @@ struct policy_mgr_psoc_priv_obj { qdf_event_t connection_update_done_evt; qdf_mutex_t qdf_conc_list_lock; qdf_mc_timer_t dbs_opportunistic_timer; - void (*sap_restart_chan_switch_cb)(uint8_t, uint32_t, uint32_t); + struct policy_mgr_hdd_cbacks hdd_cbacks; struct policy_mgr_sme_cbacks sme_cbacks; struct policy_mgr_wma_cbacks wma_cbacks; struct policy_mgr_tdls_cbacks tdls_cbacks; diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 6b09251bfe77..ab6dc3a6f408 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -406,6 +406,36 @@ QDF_STATUS policy_mgr_register_sme_cb(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +/** + * policy_mgr_register_hdd_cb() - register HDD callbacks + * @psoc: PSOC object information + * @hdd_cbacks: function pointers from HDD + * + * API, allows HDD to register callbacks to be invoked by policy + * mgr + * + * Return: SUCCESS, + * Failure (if registration fails) + */ +QDF_STATUS policy_mgr_register_hdd_cb(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_hdd_cbacks *hdd_cbacks) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb = + hdd_cbacks->sap_restart_chan_switch_cb; + pm_ctx->hdd_cbacks.wlan_hdd_get_channel_for_sap_restart = + hdd_cbacks->wlan_hdd_get_channel_for_sap_restart; + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS policy_mgr_register_wma_cb(struct wlan_objmgr_psoc *psoc, struct policy_mgr_wma_cbacks *wma_cbacks) { From 3d9b5cf89dd8509f9ca51fc9a8b6baf37ca5e0ab Mon Sep 17 00:00:00 2001 From: Archana Ramachandran Date: Fri, 10 Mar 2017 18:56:44 -0800 Subject: [PATCH 019/187] qcacmn: Save user configurations in policy manager component Update policy manager user configuration with INI parameters. Change-Id: I2e13bec2a1e99c9aee9e66d3e90a1275cf87ccfa CRs-Fixed: 2019994 --- inc/wlan_policy_mgr_api.h | 14 ++++++++++++ inc/wlan_policy_mgr_public_struct.h | 7 ++++++ src/wlan_policy_mgr_core.c | 15 ------------- src/wlan_policy_mgr_get_set_utils.c | 34 ++++++++++++++++++++++++++++- src/wlan_policy_mgr_i.h | 13 +---------- 5 files changed, 55 insertions(+), 28 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index b2aaa3d0ff97..ffb157a595aa 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1739,4 +1739,18 @@ static inline bool policy_mgr_is_scan_simultaneous_capable( bool policy_mgr_is_mcc_adaptive_scheduler_enabled( struct wlan_objmgr_psoc *psoc); +/** + * policy_mgr_set_user_cfg() - Function to set user cfg variables + * required by policy manager component + * @psoc: PSOC object information + * @user_cfg: User config valiables structure pointer + * + * This function sets the user cfg variables required by policy + * manager + * + * Return: SUCCESS or FAILURE + * + */ +QDF_STATUS policy_mgr_set_user_cfg(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_user_cfg *user_cfg); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 9bd892f7d186..78a987d4484e 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -972,4 +972,11 @@ struct dual_mac_config { uint32_t req_fw_mode_config; }; +/** + * struct policy_mgr_user_cfg - Policy manager user config variables + * @enable_mcc_adaptive_scheduler: Enable MCC adaptive scheduler + */ +struct policy_mgr_user_cfg { + uint8_t enable_mcc_adaptive_scheduler; +}; #endif /* __WLAN_POLICY_MGR_PUBLIC_STRUCT_H */ diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 1b6c0b9b059e..cc78c181c4c8 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -144,21 +144,6 @@ bool policy_mgr_is_dual_mac_disabled_in_ini( return wlan_objmgr_psoc_get_dual_mac_disable(psoc); } -/** - * policy_mgr_is_mas_enabled_in_user_cfg() - Check if MCC - * adaptive scheduler is enabled in INI - * @psoc: PSOC object information - * - * Checks if MCC adaptive scheduler is enabled in INI - * - * Return: true if MCC adaptive scheduler is enabled in INI - */ -bool policy_mgr_is_mas_enabled_in_user_cfg( - struct wlan_objmgr_psoc *psoc) -{ - return false; -} - uint32_t policy_mgr_mcc_to_scc_switch_mode_in_user_cfg( struct wlan_objmgr_psoc *psoc) { diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 992728ecb412..9bf37e9daa1f 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1224,6 +1224,27 @@ QDF_STATUS policy_mgr_get_channel_from_scan_result( return status; } +QDF_STATUS policy_mgr_set_user_cfg(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_user_cfg *user_cfg) +{ + + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return QDF_STATUS_E_FAILURE; + } + if (NULL == user_cfg) { + policy_mgr_err("Invalid User Config"); + return QDF_STATUS_E_FAILURE; + } + + pm_ctx->user_cfg = *user_cfg; + + return QDF_STATUS_SUCCESS; +} + uint8_t policy_mgr_search_and_check_for_session_conc( struct wlan_objmgr_psoc *psoc, uint8_t session_id, @@ -1366,9 +1387,20 @@ bool policy_mgr_is_mcc_adaptive_scheduler_enabled( return false; } - return pm_ctx->enable_mcc_adaptive_scheduler ? true : false; + return pm_ctx->user_cfg.enable_mcc_adaptive_scheduler ? + true : false; } +/** + * policy_mgr_change_mcc_go_beacon_interval() - Change MCC beacon interval + * @psoc: PSOC object information + * @vdev_id: vdev id + * @dev_mode: device mode + * + * Updates the beacon parameters of the GO in MCC scenario + * + * Return: Success or Failure depending on the overall function behavior + */ QDF_STATUS policy_mgr_change_mcc_go_beacon_interval( struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, enum tQDF_ADAPTER_MODE dev_mode) diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 5f65da15d984..44f5b21d07cb 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -257,7 +257,7 @@ struct policy_mgr_psoc_priv_obj { uint8_t conc_system_pref; struct dual_mac_config dual_mac_cfg; uint32_t hw_mode_change_in_progress; - uint8_t enable_mcc_adaptive_scheduler; + struct policy_mgr_user_cfg user_cfg; }; struct policy_mgr_psoc_priv_obj *policy_mgr_get_context( @@ -276,17 +276,6 @@ QDF_STATUS policy_mgr_get_updated_fw_mode_config( bool policy_mgr_is_dual_mac_disabled_in_ini( struct wlan_objmgr_psoc *psoc); -/** - * policy_mgr_is_mas_enabled_in_user_cfg() - Check if MCC - * adaptive scheduler is enabled in INI - * @psoc: PSOC object information - * - * Checks if MCC adaptive scheduler is enabled in INI - * - * Return: true if MCC adaptive scheduler is enabled in INI - */ -bool policy_mgr_is_mas_enabled_in_user_cfg( - struct wlan_objmgr_psoc *psoc); /** * policy_mgr_mcc_to_scc_switch_mode_in_user_cfg() - MCC to SCC * switch mode value in the user config From 631fd9f12b35d986dbd207fee900e4951cbade49 Mon Sep 17 00:00:00 2001 From: Archana Ramachandran Date: Sun, 19 Mar 2017 18:51:30 -0700 Subject: [PATCH 020/187] qcacmn: Policy manager component HDD callback changes Policy manager component HDD callback changes Change-Id: Ib2226a88b27abfff12104c8430245fe384978b9f CRs-Fixed: 2019994 --- inc/wlan_policy_mgr_api.h | 17 +++++++++-- src/wlan_policy_mgr_action.c | 50 ++++++------------------------- src/wlan_policy_mgr_init_deinit.c | 16 ++++++++++ 3 files changed, 40 insertions(+), 43 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index ffb157a595aa..0181ca240cc3 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -816,9 +816,11 @@ struct policy_mgr_sme_cbacks { * SAP */ struct policy_mgr_hdd_cbacks { - void (*sap_restart_chan_switch_cb)(uint8_t, - uint32_t, uint32_t); + void (*sap_restart_chan_switch_cb)(struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id, uint32_t channel, + uint32_t channel_bw); QDF_STATUS (*wlan_hdd_get_channel_for_sap_restart)( + struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, uint8_t *channel, uint8_t *sec_ch, struct ch_params_s *ch_params); @@ -1454,6 +1456,17 @@ QDF_STATUS policy_mgr_register_sme_cb(struct wlan_objmgr_psoc *psoc, QDF_STATUS policy_mgr_register_hdd_cb(struct wlan_objmgr_psoc *psoc, struct policy_mgr_hdd_cbacks *hdd_cbacks); +/** + * policy_mgr_deregister_hdd_cb() - Deregister HDD callbacks + * @psoc: PSOC object information + * + * API, allows HDD to deregister callbacks + * + * Return: SUCCESS, + * Failure (if de-registration fails) + */ +QDF_STATUS policy_mgr_deregister_hdd_cb(struct wlan_objmgr_psoc *psoc); + /** * policy_mgr_register_tdls_cb() - register TDLS callbacks * @psoc: PSOC object information diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index b57bef7b163f..f713d36da4c8 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -659,8 +659,13 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) if (!policy_mgr_is_restart_sap_allowed(psoc, mcc_to_scc_switch)) goto work_done; + if (!pm_ctx->hdd_cbacks.wlan_hdd_get_channel_for_sap_restart) { + policy_mgr_err("SAP restart get channel callback in NULL"); + goto work_done; + } + status = pm_ctx->hdd_cbacks. - wlan_hdd_get_channel_for_sap_restart( + wlan_hdd_get_channel_for_sap_restart(psoc, cc_intf_work->vdev_id, &channel, &sec_ch, &ch_params); if (status != QDF_STATUS_SUCCESS) { @@ -680,7 +685,7 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) if (policy_mgr_is_sap_channel_change_without_restart( mcc_to_scc_switch) && pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb) { - pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb( + pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb(psoc, cc_intf_work->vdev_id, channel, ch_params.ch_width); } @@ -789,8 +794,8 @@ void policy_mgr_change_sap_channel_with_csa(struct wlan_objmgr_psoc *psoc, if (pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb) { policy_mgr_info("SAP change change without restart"); - pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb(vdev_id, - channel, ch_width); + pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb(psoc, + vdev_id, channel, ch_width); } } #endif @@ -892,43 +897,6 @@ QDF_STATUS policy_mgr_restart_opportunistic_timer( return status; } -#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH -QDF_STATUS policy_mgr_register_sap_restart_channel_switch_cb( - struct wlan_objmgr_psoc *psoc, - void (*sap_restart_chan_switch_cb)(uint8_t, uint32_t, uint32_t)) -{ - struct policy_mgr_psoc_priv_obj *policy_mgr_ctx; - - policy_mgr_ctx = policy_mgr_get_context(psoc); - if (!policy_mgr_ctx) { - policy_mgr_err("Invalid context"); - return QDF_STATUS_E_FAILURE; - } - - policy_mgr_ctx->hdd_cbacks.sap_restart_chan_switch_cb = - sap_restart_chan_switch_cb; - - return QDF_STATUS_SUCCESS; -} - -QDF_STATUS policy_mgr_deregister_sap_restart_channel_switch_cb( - struct wlan_objmgr_psoc *psoc) -{ - struct policy_mgr_psoc_priv_obj *policy_mgr_ctx; - - policy_mgr_ctx = policy_mgr_get_context(psoc); - if (!policy_mgr_ctx) { - policy_mgr_err("Invalid context"); - return QDF_STATUS_E_FAILURE; - } - - policy_mgr_ctx->hdd_cbacks.sap_restart_chan_switch_cb = NULL; - - return QDF_STATUS_SUCCESS; -} - -#endif - QDF_STATUS policy_mgr_set_hw_mode_on_channel_switch( struct wlan_objmgr_psoc *psoc, uint8_t session_id) { diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index ab6dc3a6f408..e81c003f4361 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -436,6 +436,22 @@ QDF_STATUS policy_mgr_register_hdd_cb(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +QDF_STATUS policy_mgr_deregister_hdd_cb(struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb = NULL; + pm_ctx->hdd_cbacks.wlan_hdd_get_channel_for_sap_restart = NULL; + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS policy_mgr_register_wma_cb(struct wlan_objmgr_psoc *psoc, struct policy_mgr_wma_cbacks *wma_cbacks) { From 6199b64eec2570449f71d694f7dc4e910ccefa3e Mon Sep 17 00:00:00 2001 From: Archana Ramachandran Date: Mon, 20 Mar 2017 13:31:36 -0700 Subject: [PATCH 021/187] qcacmn: Remove legacy dependency from Policy Manager Part 7 Remove legacy dependency from Policy Manager component Part 7 Change-Id: Ied83a92118b8ff2ff1a387a052033aaa97bfbbe0 CRs-Fixed: 2019994 --- inc/wlan_policy_mgr_api.h | 76 +------------------ src/wlan_policy_mgr_action.c | 110 +++++++++------------------- src/wlan_policy_mgr_get_set_utils.c | 46 ++++++++++++ src/wlan_policy_mgr_i.h | 42 +++++++++++ 4 files changed, 127 insertions(+), 147 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 0181ca240cc3..24b7c46c74a0 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -39,33 +39,6 @@ #include "qdf_status.h" #include "wlan_objmgr_psoc_obj.h" #include "wlan_policy_mgr_public_struct.h" -#include - -enum cds_band_type { - CDS_BAND_ALL = 0, - CDS_BAND_2GHZ = 1, - CDS_BAND_5GHZ = 2 -}; -extern uint32_t cds_chan_to_freq(uint8_t chan); -extern uint8_t cds_freq_to_chan(uint32_t freq); -extern enum cds_band_type cds_chan_to_band(uint32_t chan); - -#define WLAN_REG_IS_24GHZ_CH(ch) CDS_IS_CHANNEL_24GHZ(ch) -#define WLAN_REG_IS_5GHZ_CH(ch) CDS_IS_CHANNEL_5GHZ(ch) -#define WLAN_REG_IS_SAME_BAND_CHANNELS(ch1, ch2) \ - CDS_IS_SAME_BAND_CHANNELS(ch1, ch2) -#define WLAN_REG_IS_CHANNEL_VALID_5G_SBS(curchan, newchan) \ - CDS_IS_CHANNEL_VALID_5G_SBS(curchan, newchan) -#define wlan_reg_is_dfs_ch(psoc, ch) CDS_IS_DFS_CH(ch) -#define WLAN_REG_MAX_24GHZ_CH_NUM CDS_MAX_24GHZ_CHANNEL_NUMBER -#define reg_chan_to_freq(chan_num) cds_chan_to_freq(chan_num) -#define reg_freq_to_chan(freq) cds_freq_to_chan(freq) -#define reg_chan_to_band(chan_num) cds_chan_to_band(chan_num) -#define BAND_2G CDS_BAND_2GHZ -#define BAND_5G CDS_BAND_5GHZ -#define BAND_ALL CDS_BAND_ALL -#define wlan_reg_set_channel_params(channel, sec_ch, ch_params) \ - cds_set_channel_params(channel, sec_ch, ch_params) typedef const enum policy_mgr_pcl_type pm_dbs_pcl_second_connection_table_type @@ -186,14 +159,10 @@ QDF_STATUS policy_mgr_handle_conc_multiport( * Return: None */ void policy_mgr_check_concurrent_intf_and_restart_sap( - struct wlan_objmgr_psoc *psoc, - uint8_t vdev_id, - uint8_t operation_channel); + struct wlan_objmgr_psoc *psoc); #else static inline void policy_mgr_check_concurrent_intf_and_restart_sap( - struct wlan_objmgr_psoc *psoc, - uint8_t vdev_id, - uint8_t operation_channel) + struct wlan_objmgr_psoc *psoc) { } @@ -763,17 +732,6 @@ typedef void (*policy_mgr_nss_update_cback)(struct wlan_objmgr_psoc *psoc, uint8_t next_action, enum policy_mgr_conn_update_reason reason); -/** - * struct check_cc_channel_work - Check concurrent interface - * channel to restart SAP work data - * @wlan_objmgr_psoc: PSOC object data - * @vdev_id: vdev id of sap - */ -struct check_cc_channel_work { - struct wlan_objmgr_psoc *psoc; - uint8_t vdev_id; -}; - /** * struct policy_mgr_sme_cbacks - SME Callbacks to be invoked * from policy manager @@ -822,8 +780,7 @@ struct policy_mgr_hdd_cbacks { QDF_STATUS (*wlan_hdd_get_channel_for_sap_restart)( struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, uint8_t *channel, - uint8_t *sec_ch, - struct ch_params_s *ch_params); + uint8_t *sec_ch, bool is_restart_sap); }; @@ -1199,33 +1156,6 @@ QDF_STATUS policy_mgr_get_sap_mandatory_channel(struct wlan_objmgr_psoc *psoc, */ QDF_STATUS policy_mgr_set_sap_mandatory_channels(struct wlan_objmgr_psoc *psoc, uint8_t *channels, uint32_t len); -#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH -/** - * policy_mgr_register_sap_restart_channel_switch_cb() - - * Register callback for SAP channel switch without restart - * @psoc: PSOC object information - * @sap_restart_chan_switch_cb: Callback to perform channel switch - * - * Registers callback to perform channel switch without having to actually - * restart the beaconing entity - * - * Return: QDF_STATUS - */ -QDF_STATUS policy_mgr_register_sap_restart_channel_switch_cb( - struct wlan_objmgr_psoc *psoc, - void (*sap_restart_chan_switch_cb)(uint8_t, uint32_t, uint32_t)); - -/** - * policy_mgr_deregister_sap_restart_channel_switch_cb() - - * De-Register callback for SAP channel switch without restart - * @psoc: PSOC object information - * De Registers callback to perform channel switch - * - * Return: QDF_STATUS Enumeration - */ -QDF_STATUS policy_mgr_deregister_sap_restart_channel_switch_cb( - struct wlan_objmgr_psoc *psoc); -#endif /** * policy_mgr_is_any_mode_active_on_band_along_with_session() - diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index f713d36da4c8..76c28363a566 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -630,25 +630,20 @@ static bool policy_mgr_is_sap_channel_change_without_restart( */ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) { - struct check_cc_channel_work *cc_intf_work = - (struct check_cc_channel_work *) data; + struct wlan_objmgr_psoc *psoc = + (struct wlan_objmgr_psoc *) data; struct policy_mgr_psoc_priv_obj *pm_ctx; uint32_t mcc_to_scc_switch; - struct wlan_objmgr_psoc *psoc; QDF_STATUS status; uint8_t channel, sec_ch; - struct ch_params_s ch_params; + uint8_t operating_channel, vdev_id; + bool restart_sap; - if (!cc_intf_work) { - policy_mgr_err("Invalid check channel interface work"); - goto work_done; - } - psoc = cc_intf_work->psoc; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { policy_mgr_err("Invalid context"); - goto work_done; + return; } mcc_to_scc_switch = policy_mgr_mcc_to_scc_switch_mode_in_user_cfg(psoc); @@ -657,67 +652,32 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) policy_mgr_concurrent_open_sessions_running(psoc)); if (!policy_mgr_is_restart_sap_allowed(psoc, mcc_to_scc_switch)) - goto work_done; + return; + + if (!policy_mgr_get_sap_conn_info(psoc, + &operating_channel, + &vdev_id)) { + policy_mgr_err("Could not retrieve SAP channel & vdev id"); + return; + } + + restart_sap = policy_mgr_is_sap_channel_change_without_restart( + mcc_to_scc_switch) ? false : true; if (!pm_ctx->hdd_cbacks.wlan_hdd_get_channel_for_sap_restart) { policy_mgr_err("SAP restart get channel callback in NULL"); - goto work_done; + return; } - status = pm_ctx->hdd_cbacks. - wlan_hdd_get_channel_for_sap_restart(psoc, - cc_intf_work->vdev_id, &channel, - &sec_ch, &ch_params); + wlan_hdd_get_channel_for_sap_restart(psoc, vdev_id, + &channel, &sec_ch, restart_sap); if (status != QDF_STATUS_SUCCESS) { - policy_mgr_err("Failed to get channel to restart SAP"); - goto work_done; + policy_mgr_err("Failed to switch SAP channel"); + return; } - if (channel == 0) { - policy_mgr_err("Invalid channel to restart SAP"); - goto work_done; - } - policy_mgr_info("SAP restarts due to MCC->SCC switch, new chan: %d", - channel); - - wlan_reg_set_channel_params(channel, sec_ch, &ch_params); - - if (policy_mgr_is_sap_channel_change_without_restart( - mcc_to_scc_switch) && - pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb) { - pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb(psoc, - cc_intf_work->vdev_id, channel, - ch_params.ch_width); - } - -work_done: - qdf_mem_free(cc_intf_work); - -} - -/** - * create_check_cc_channel_work() - Create Check concurrent intf - * channel work - * @psoc: PSOC object information - * - * Create check concurrent interface channel work - * - * Return: check concurrent channel interface work object - */ -static struct check_cc_channel_work *create_check_cc_channel_work( - struct wlan_objmgr_psoc *psoc, uint8_t vdev_id) -{ - struct check_cc_channel_work *cc_intf_work; - - cc_intf_work = qdf_mem_malloc( - sizeof(struct check_cc_channel_work)); - if (NULL == cc_intf_work) { - policy_mgr_err("Falied to allocate check concurrent channel work"); - return NULL; - } - cc_intf_work->psoc = psoc; - cc_intf_work->vdev_id = vdev_id; - return cc_intf_work; + policy_mgr_info("SAP restarts due to MCC->SCC switch, old chan :%d new chan: %d", + operating_channel, channel); } /** @@ -732,13 +692,11 @@ static struct check_cc_channel_work *create_check_cc_channel_work( * Return: None */ void policy_mgr_check_concurrent_intf_and_restart_sap( - struct wlan_objmgr_psoc *psoc, - uint8_t vdev_id, - uint8_t operation_channel) + struct wlan_objmgr_psoc *psoc) { struct policy_mgr_psoc_priv_obj *pm_ctx; uint32_t mcc_to_scc_switch; - struct check_cc_channel_work *cc_intf_work; + uint8_t operating_channel, vdev_id; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -746,22 +704,26 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( return; } + if (!policy_mgr_get_sap_conn_info(psoc, + &operating_channel, + &vdev_id)) { + policy_mgr_err("Could not retrieve SAP channel & vdev id"); + return; + } + mcc_to_scc_switch = policy_mgr_mcc_to_scc_switch_mode_in_user_cfg(psoc); policy_mgr_info("MCC to SCC switch: %d chan: %d", - mcc_to_scc_switch, operation_channel); + mcc_to_scc_switch, operating_channel); if ((mcc_to_scc_switch != QDF_MCC_TO_SCC_SWITCH_DISABLE) #ifdef FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE && !wlan_reg_is_dfs_ch(psoc, - operationChannel) + operating_channel) #endif ) { - cc_intf_work = create_check_cc_channel_work(psoc, vdev_id); - if (!cc_intf_work) - return; qdf_create_work(0, &pm_ctx->sta_ap_intf_check_work, - policy_mgr_check_sta_ap_concurrent_ch_intf, - cc_intf_work); + policy_mgr_check_sta_ap_concurrent_ch_intf, + psoc); qdf_sched_work(0, &pm_ctx->sta_ap_intf_check_work); policy_mgr_info("Checking for Concurrent Change interference"); } diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 9bf37e9daa1f..4bb51fad3f02 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -929,6 +929,52 @@ bool policy_mgr_is_ibss_conn_exist(struct wlan_objmgr_psoc *psoc, return status; } +bool policy_mgr_get_sap_conn_info(struct wlan_objmgr_psoc *psoc, + uint8_t *channel, uint8_t *vdev_id) +{ + uint32_t count, index = 0; + uint32_t list[MAX_NUMBER_OF_CONC_CONNECTIONS]; + bool status = false; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return false; + } + if (NULL == channel || NULL == vdev_id) { + policy_mgr_err("Null pointer error"); + return false; + } + + count = policy_mgr_mode_specific_connection_count( + psoc, PM_SAP_MODE, list); + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + if (count == 0) { + policy_mgr_err("No SAP connection"); + status = false; + } else if (count == 1) { + *channel = pm_conc_connection_list[list[index]].chan; + *vdev_id = + pm_conc_connection_list[list[index]].vdev_id; + status = true; + } else { + /* + * Todo Currently the first SAP connection info is + * returned. Modify this to accommodate SAP+SAP+STA + * and SAP+SAP+P2P + */ + *channel = pm_conc_connection_list[list[index]].chan; + *vdev_id = + pm_conc_connection_list[list[index]].vdev_id; + policy_mgr_notice("Multiple SAP connections, picking first one"); + status = true; + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return status; +} + bool policy_mgr_max_concurrent_connections_reached( struct wlan_objmgr_psoc *psoc) { diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 44f5b21d07cb..6e9d400bbac5 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -34,6 +34,34 @@ #include "qdf_lock.h" #include "qdf_defer.h" +#include + +enum cds_band_type { + CDS_BAND_ALL = 0, + CDS_BAND_2GHZ = 1, + CDS_BAND_5GHZ = 2 +}; + +extern uint32_t cds_chan_to_freq(uint8_t chan); +extern uint8_t cds_freq_to_chan(uint32_t freq); +extern enum cds_band_type cds_chan_to_band(uint32_t chan); + +#define WLAN_REG_IS_24GHZ_CH(ch) CDS_IS_CHANNEL_24GHZ(ch) +#define WLAN_REG_IS_5GHZ_CH(ch) CDS_IS_CHANNEL_5GHZ(ch) +#define WLAN_REG_IS_SAME_BAND_CHANNELS(ch1, ch2) \ + CDS_IS_SAME_BAND_CHANNELS(ch1, ch2) +#define WLAN_REG_IS_CHANNEL_VALID_5G_SBS(curchan, newchan) \ + CDS_IS_CHANNEL_VALID_5G_SBS(curchan, newchan) +#define wlan_reg_is_dfs_ch(psoc, ch) CDS_IS_DFS_CH(ch) +#define WLAN_REG_MAX_24GHZ_CH_NUM CDS_MAX_24GHZ_CHANNEL_NUMBER +#define reg_chan_to_freq(chan_num) cds_chan_to_freq(chan_num) +#define reg_freq_to_chan(freq) cds_freq_to_chan(freq) +#define reg_chan_to_band(chan_num) cds_chan_to_band(chan_num) +#define BAND_2G CDS_BAND_2GHZ +#define BAND_5G CDS_BAND_5GHZ +#define BAND_ALL CDS_BAND_ALL + + #define MAX_NUMBER_OF_CONC_CONNECTIONS 3 #define DBS_OPPORTUNISTIC_TIME 10 #ifdef QCA_WIFI_3_0_EMU @@ -381,4 +409,18 @@ enum policy_mgr_conc_next_action struct wlan_objmgr_psoc *psoc); QDF_STATUS policy_mgr_reset_sap_mandatory_channels( struct policy_mgr_psoc_priv_obj *pm_ctx); + +/** + * policy_mgr_get_sap_conn_info() - Get active SAP channel and + * vdev id + * @psoc: PSOC object information + * @channel: SAP channel + * @vdev_id: SAP vdev id + * + * Get active SAP channel and vdev id + * + * Return: true for success, else false + */ +bool policy_mgr_get_sap_conn_info(struct wlan_objmgr_psoc *psoc, + uint8_t *channel, uint8_t *vdev_id); #endif From 7051ad07688ff7a7168c2e654d75eddc92ac4baa Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Thu, 23 Mar 2017 11:16:40 -0700 Subject: [PATCH 022/187] qcacmn: Fix DBS & HW mode configurations for policy manager Fix DBS configuration & HW mode initialization for policy manager as part of policy manager restructuring. Change-Id: I0c0ef7797b3251454d86f5980c6e243985075216 CRs-Fixed: 2009818 --- inc/wlan_policy_mgr_api.h | 151 ++++++++- inc/wlan_policy_mgr_public_struct.h | 7 + src/wlan_policy_mgr_action.c | 63 +++- src/wlan_policy_mgr_core.c | 3 + src/wlan_policy_mgr_get_set_utils.c | 469 ++++++++++++++++++++++++++-- src/wlan_policy_mgr_i.h | 15 +- src/wlan_policy_mgr_init_deinit.c | 27 +- src/wlan_policy_mgr_pcl.c | 10 +- 8 files changed, 715 insertions(+), 30 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 24b7c46c74a0..3c92c8402f2b 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -771,7 +771,9 @@ struct policy_mgr_sme_cbacks { * from policy manager * @sap_restart_chan_switch_cb: Restart SAP * @wlan_hdd_get_channel_for_sap_restart: Get channel to restart - * SAP + * SAP + * @get_mode_for_non_connected_vdev: Get the mode for a non + * connected vdev */ struct policy_mgr_hdd_cbacks { void (*sap_restart_chan_switch_cb)(struct wlan_objmgr_psoc *psoc, @@ -781,6 +783,9 @@ struct policy_mgr_hdd_cbacks { struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, uint8_t *channel, uint8_t *sec_ch, bool is_restart_sap); + enum policy_mgr_con_mode (*get_mode_for_non_connected_vdev)( + struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id); }; @@ -1696,4 +1701,148 @@ bool policy_mgr_is_mcc_adaptive_scheduler_enabled( */ QDF_STATUS policy_mgr_set_user_cfg(struct wlan_objmgr_psoc *psoc, struct policy_mgr_user_cfg *user_cfg); + +/** + * policy_mgr_init_dbs_config() - Function to initialize DBS + * config in policy manager component + * @psoc: PSOC object information + * @scan_config: DBS scan config + * @fw_config: DBS FW config + * + * This function sets the DBS configurations required by policy + * manager + * + * Return: SUCCESS or FAILURE + * + */ +void policy_mgr_init_dbs_config(struct wlan_objmgr_psoc *psoc, + uint32_t scan_config, uint32_t fw_config); + +/** + * policy_mgr_update_dbs_scan_config() - Function to update + * DBS scan config in policy manager component + * @psoc: PSOC object information + * + * This function updates the DBS scan configurations required by + * policy manager + * + * Return: SUCCESS or FAILURE + * + */ +void policy_mgr_update_dbs_scan_config(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_update_dbs_fw_config() - Function to update DBS FW + * config in policy manager component + * @psoc: PSOC object information + * + * This function updates the DBS FW configurations required by + * policy manager + * + * Return: SUCCESS or FAILURE + * + */ +void policy_mgr_update_dbs_fw_config(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_update_dbs_req_config() - Function to update DBS + * request config in policy manager component + * @psoc: PSOC object information + * @scan_config: DBS scan config + * @fw_config: DBS FW config + * + * This function updates DBS request configurations required by + * policy manager + * + * Return: SUCCESS or FAILURE + * + */ +void policy_mgr_update_dbs_req_config(struct wlan_objmgr_psoc *psoc, + uint32_t scan_config, uint32_t fw_mode_config); + +/** + * policy_mgr_dump_dbs_hw_mode() - Function to dump DBS config + * @psoc: PSOC object information + * + * This function dumps the DBS configurations + * + * Return: SUCCESS or FAILURE + * + */ +void policy_mgr_dump_dbs_hw_mode(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_init_dbs_hw_mode() - Function to initialize DBS HW + * modes in policy manager component + * @psoc: PSOC object information + * @num_dbs_hw_modes: Number of HW modes + * @ev_wlan_dbs_hw_mode_list: HW list + * + * This function to initialize the DBS HW modes in policy + * manager + * + * Return: SUCCESS or FAILURE + * + */ +void policy_mgr_init_dbs_hw_mode(struct wlan_objmgr_psoc *psoc, + uint32_t num_dbs_hw_modes, + uint32_t *ev_wlan_dbs_hw_mode_list); + +/** + * policy_mgr_update_hw_mode_list() - Function to initialize DBS + * HW modes in policy manager component + * @psoc: PSOC object information + * @num_dbs_hw_modes: Number of HW modes + * @ev_wlan_dbs_hw_mode_list: HW list + * + * This function to initialize the DBS HW modes in policy + * manager + * + * Return: SUCCESS or FAILURE + * + */ +QDF_STATUS policy_mgr_update_hw_mode_list(struct wlan_objmgr_psoc *psoc, + struct extended_caps *phy_caps); + +/** + * policy_mgr_update_hw_mode_index() - Function to update + * current HW mode in policy manager component + * @psoc: PSOC object information + * @new_hw_mode_index: index to new HW mode + * + * This function to update the current HW mode in policy manager + * + * Return: SUCCESS or FAILURE + * + */ +void policy_mgr_update_hw_mode_index(struct wlan_objmgr_psoc *psoc, + uint32_t new_hw_mode_index); + +/** + * policy_mgr_update_old_hw_mode_index() - Function to update + * old HW mode in policy manager component + * @psoc: PSOC object information + * @new_hw_mode_index: index to old HW mode + * + * This function to update the old HW mode in policy manager + * + * Return: SUCCESS or FAILURE + * + */ +void policy_mgr_update_old_hw_mode_index(struct wlan_objmgr_psoc *psoc, + uint32_t old_hw_mode_index); + +/** + * policy_mgr_update_new_hw_mode_index() - Function to update + * new HW mode in policy manager component + * @psoc: PSOC object information + * @new_hw_mode_index: index to new HW mode + * + * This function to update the new HW mode in policy manager + * + * Return: SUCCESS or FAILURE + * + */ +void policy_mgr_update_new_hw_mode_index(struct wlan_objmgr_psoc *psoc, + uint32_t new_hw_mode_index); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 78a987d4484e..361683e20f87 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -869,12 +869,14 @@ struct policy_mgr_dual_mac_config { * @set_hw_mode_cb: HDD set HW mode callback * @reason: Reason for HW mode change * @session_id: Session id + * @context: psoc context */ struct policy_mgr_hw_mode { uint32_t hw_mode_index; void *set_hw_mode_cb; enum policy_mgr_conn_update_reason reason; uint32_t session_id; + struct wlan_objmgr_psoc *context; }; /** @@ -975,8 +977,13 @@ struct dual_mac_config { /** * struct policy_mgr_user_cfg - Policy manager user config variables * @enable_mcc_adaptive_scheduler: Enable MCC adaptive scheduler + * @max_concurrent_active_sessions: User allowed maximum active + * connections + * @conc_system_pref: System preference for PCL table */ struct policy_mgr_user_cfg { uint8_t enable_mcc_adaptive_scheduler; + uint8_t max_concurrent_active_sessions; + uint8_t conc_system_pref; }; #endif /* __WLAN_POLICY_MGR_PUBLIC_STRUCT_H */ diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 76c28363a566..23f893a89040 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -135,6 +135,7 @@ QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc, msg.set_hw_mode_cb = (void *)policy_mgr_pdev_set_hw_mode_cb; msg.reason = reason; msg.session_id = session_id; + msg.context = psoc; policy_mgr_notice("set hw mode to sme: hw_mode_index: %d session:%d reason:%d", msg.hw_mode_index, msg.session_id, msg.reason); @@ -938,18 +939,76 @@ void policy_mgr_checkn_update_hw_mode_single_mac_mode( void policy_mgr_set_hw_mode_change_in_progress( struct wlan_objmgr_psoc *psoc, enum policy_mgr_hw_mode_change value) { + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + pm_ctx->hw_mode_change_in_progress = value; + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + policy_mgr_debug("hw_mode_change_in_progress:%d", value); } enum policy_mgr_hw_mode_change policy_mgr_is_hw_mode_change_in_progress( struct wlan_objmgr_psoc *psoc) { - return POLICY_MGR_HW_MODE_NOT_IN_PROGRESS; + enum policy_mgr_hw_mode_change value; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + value = POLICY_MGR_HW_MODE_NOT_IN_PROGRESS; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return value; + } + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + value = pm_ctx->hw_mode_change_in_progress; + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return value; } enum policy_mgr_hw_mode_change policy_mgr_get_hw_mode_change_from_hw_mode_index( struct wlan_objmgr_psoc *psoc, uint32_t hw_mode_index) { - return POLICY_MGR_HW_MODE_NOT_IN_PROGRESS; + struct policy_mgr_psoc_priv_obj *pm_ctx; + uint32_t param = 0; + enum policy_mgr_hw_mode_change value + = POLICY_MGR_HW_MODE_NOT_IN_PROGRESS; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return value; + } + + policy_mgr_info("HW param: %x", param); + param = pm_ctx->hw_mode.hw_mode_list[hw_mode_index]; + if (POLICY_MGR_HW_MODE_DBS_MODE_GET(param)) { + policy_mgr_info("DBS is requested with HW (%d)", + hw_mode_index); + value = POLICY_MGR_DBS_IN_PROGRESS; + goto ret_value; + } + + if (POLICY_MGR_HW_MODE_SBS_MODE_GET(param)) { + policy_mgr_info("SBS is requested with HW (%d)", + hw_mode_index); + value = POLICY_MGR_SBS_IN_PROGRESS; + goto ret_value; + } + + value = POLICY_MGR_SMM_IN_PROGRESS; + policy_mgr_info("SMM is requested with HW (%d)", hw_mode_index); + +ret_value: + return value; } #ifdef MPC_UT_FRAMEWORK diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index cc78c181c4c8..56929c602a09 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -717,6 +717,9 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status, struct policy_mgr_hw_mode_params hw_mode; uint32_t i; + policy_mgr_set_hw_mode_change_in_progress(context, + POLICY_MGR_HW_MODE_NOT_IN_PROGRESS); + if (status != SET_HW_MODE_STATUS_OK) { policy_mgr_err("Set HW mode failed with status %d", status); return; diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 4bb51fad3f02..cd9be988d695 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -43,6 +43,418 @@ /* invalid channel id. */ #define INVALID_CHANNEL_ID 0 +void policy_mgr_update_new_hw_mode_index(struct wlan_objmgr_psoc *psoc, + uint32_t new_hw_mode_index) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + pm_ctx->new_hw_mode_index = new_hw_mode_index; +} + +void policy_mgr_update_old_hw_mode_index(struct wlan_objmgr_psoc *psoc, + uint32_t old_hw_mode_index) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + pm_ctx->old_hw_mode_index = old_hw_mode_index; +} + +void policy_mgr_update_hw_mode_index(struct wlan_objmgr_psoc *psoc, + uint32_t new_hw_mode_index) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + if (POLICY_MGR_DEFAULT_HW_MODE_INDEX == pm_ctx->new_hw_mode_index) { + pm_ctx->new_hw_mode_index = new_hw_mode_index; + } else { + pm_ctx->old_hw_mode_index = pm_ctx->new_hw_mode_index; + pm_ctx->new_hw_mode_index = new_hw_mode_index; + } + policy_mgr_debug("Updated: old_hw_mode_index:%d new_hw_mode_index:%d", + pm_ctx->old_hw_mode_index, pm_ctx->new_hw_mode_index); +} + +/** + * policy_mgr_get_num_of_setbits_from_bitmask() - to get num of + * setbits from bitmask + * @mask: given bitmask + * + * This helper function should return number of setbits from bitmask + * + * Return: number of setbits from bitmask + */ +static uint32_t policy_mgr_get_num_of_setbits_from_bitmask(uint32_t mask) +{ + uint32_t num_of_setbits = 0; + + while (mask) { + mask &= (mask - 1); + num_of_setbits++; + } + return num_of_setbits; +} + +/** + * policy_mgr_map_wmi_channel_width_to_hw_mode_bw() - returns + * bandwidth in terms of hw_mode_bandwidth + * @width: bandwidth in terms of wmi_channel_width + * + * This function returns the bandwidth in terms of hw_mode_bandwidth. + * + * Return: BW in terms of hw_mode_bandwidth. + */ +static enum hw_mode_bandwidth policy_mgr_map_wmi_channel_width_to_hw_mode_bw( + wmi_channel_width width) +{ + switch (width) { + case WMI_CHAN_WIDTH_20: + return HW_MODE_20_MHZ; + case WMI_CHAN_WIDTH_40: + return HW_MODE_40_MHZ; + case WMI_CHAN_WIDTH_80: + return HW_MODE_80_MHZ; + case WMI_CHAN_WIDTH_160: + return HW_MODE_160_MHZ; + case WMI_CHAN_WIDTH_80P80: + return HW_MODE_80_PLUS_80_MHZ; + case WMI_CHAN_WIDTH_5: + return HW_MODE_5_MHZ; + case WMI_CHAN_WIDTH_10: + return HW_MODE_10_MHZ; + default: + return HW_MODE_BW_NONE; + } + + return HW_MODE_BW_NONE; +} + +static void policy_mgr_get_hw_mode_params(WMI_MAC_PHY_CAPABILITIES *caps, + struct policy_mgr_mac_ss_bw_info *info) +{ + if (!caps) { + policy_mgr_err("Invalid capabilities"); + return; + } + + info->mac_tx_stream = policy_mgr_get_num_of_setbits_from_bitmask( + QDF_MAX(caps->tx_chain_mask_2G, + caps->tx_chain_mask_5G)); + info->mac_rx_stream = policy_mgr_get_num_of_setbits_from_bitmask( + QDF_MAX(caps->rx_chain_mask_2G, + caps->rx_chain_mask_5G)); + info->mac_bw = policy_mgr_map_wmi_channel_width_to_hw_mode_bw( + QDF_MAX(caps->max_bw_supported_2G, + caps->max_bw_supported_5G)); +} + +/** + * policy_mgr_set_hw_mode_params() - sets TX-RX stream, + * bandwidth and DBS in hw_mode_list + * @wma_handle: pointer to wma global structure + * @mac0_ss_bw_info: TX-RX streams, BW for MAC0 + * @mac1_ss_bw_info: TX-RX streams, BW for MAC1 + * @pos: refers to hw_mode_index + * @dbs_mode: dbs_mode for the dbs_hw_mode + * @sbs_mode: sbs_mode for the sbs_hw_mode + * + * This function sets TX-RX stream, bandwidth and DBS mode in + * hw_mode_list. + * + * Return: none + */ +static void policy_mgr_set_hw_mode_params(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_mac_ss_bw_info mac0_ss_bw_info, + struct policy_mgr_mac_ss_bw_info mac1_ss_bw_info, + uint32_t pos, uint32_t dbs_mode, + uint32_t sbs_mode) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_SET( + pm_ctx->hw_mode.hw_mode_list[pos], + mac0_ss_bw_info.mac_tx_stream); + POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_SET( + pm_ctx->hw_mode.hw_mode_list[pos], + mac0_ss_bw_info.mac_rx_stream); + POLICY_MGR_HW_MODE_MAC0_BANDWIDTH_SET( + pm_ctx->hw_mode.hw_mode_list[pos], + mac0_ss_bw_info.mac_bw); + POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_SET( + pm_ctx->hw_mode.hw_mode_list[pos], + mac1_ss_bw_info.mac_tx_stream); + POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_SET( + pm_ctx->hw_mode.hw_mode_list[pos], + mac1_ss_bw_info.mac_rx_stream); + POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_SET( + pm_ctx->hw_mode.hw_mode_list[pos], + mac1_ss_bw_info.mac_bw); + POLICY_MGR_HW_MODE_DBS_MODE_SET( + pm_ctx->hw_mode.hw_mode_list[pos], + dbs_mode); + POLICY_MGR_HW_MODE_AGILE_DFS_SET( + pm_ctx->hw_mode.hw_mode_list[pos], + HW_MODE_AGILE_DFS_NONE); + POLICY_MGR_HW_MODE_SBS_MODE_SET( + pm_ctx->hw_mode.hw_mode_list[pos], + sbs_mode); +} + +QDF_STATUS policy_mgr_update_hw_mode_list(struct wlan_objmgr_psoc *psoc, + struct extended_caps *phy_caps) +{ + WMI_MAC_PHY_CAPABILITIES *tmp; + uint32_t i, hw_config_type, j = 0; + uint32_t dbs_mode, sbs_mode; + struct policy_mgr_mac_ss_bw_info mac0_ss_bw_info = {0}; + struct policy_mgr_mac_ss_bw_info mac1_ss_bw_info = {0}; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + if (!phy_caps) { + policy_mgr_err("Invalid phy capabilities"); + return QDF_STATUS_E_FAILURE; + } + + if (!phy_caps->num_hw_modes.num_hw_modes) { + policy_mgr_err("Number of HW modes: %d", + phy_caps->num_hw_modes.num_hw_modes); + return QDF_STATUS_E_FAILURE; + } + + /* + * This list was updated as part of service ready event. Re-populate + * HW mode list from the device capabilities. + */ + if (pm_ctx->hw_mode.hw_mode_list) { + qdf_mem_free(pm_ctx->hw_mode.hw_mode_list); + pm_ctx->hw_mode.hw_mode_list = NULL; + policy_mgr_err("DBS list is freed"); + } + + pm_ctx->num_dbs_hw_modes = phy_caps->num_hw_modes.num_hw_modes; + pm_ctx->hw_mode.hw_mode_list = + qdf_mem_malloc(sizeof(*pm_ctx->hw_mode.hw_mode_list) * + pm_ctx->num_dbs_hw_modes); + if (!pm_ctx->hw_mode.hw_mode_list) { + policy_mgr_err("Memory allocation failed for DBS"); + return QDF_STATUS_E_FAILURE; + } + + policy_mgr_err("Updated HW mode list: Num modes:%d", + pm_ctx->num_dbs_hw_modes); + + for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { + /* Update for MAC0 */ + tmp = &phy_caps->each_phy_cap_per_hwmode[j++]; + policy_mgr_get_hw_mode_params(tmp, &mac0_ss_bw_info); + hw_config_type = + phy_caps->each_hw_mode_cap[i].hw_mode_config_type; + dbs_mode = HW_MODE_DBS_NONE; + sbs_mode = HW_MODE_SBS_NONE; + mac1_ss_bw_info.mac_tx_stream = 0; + mac1_ss_bw_info.mac_rx_stream = 0; + mac1_ss_bw_info.mac_bw = 0; + + /* SBS and DBS have dual MAC. Upto 2 MACs are considered. */ + if ((hw_config_type == WMI_HW_MODE_DBS) || + (hw_config_type == WMI_HW_MODE_SBS_PASSIVE) || + (hw_config_type == WMI_HW_MODE_SBS)) { + /* Update for MAC1 */ + tmp = &phy_caps->each_phy_cap_per_hwmode[j++]; + policy_mgr_get_hw_mode_params(tmp, &mac1_ss_bw_info); + if (hw_config_type == WMI_HW_MODE_DBS) + dbs_mode = HW_MODE_DBS; + if ((hw_config_type == WMI_HW_MODE_SBS_PASSIVE) || + (hw_config_type == WMI_HW_MODE_SBS)) + sbs_mode = HW_MODE_SBS; + } + + /* Updating HW mode list */ + policy_mgr_set_hw_mode_params(psoc, mac0_ss_bw_info, + mac1_ss_bw_info, i, dbs_mode, sbs_mode); + } + return QDF_STATUS_SUCCESS; +} + +void policy_mgr_init_dbs_hw_mode(struct wlan_objmgr_psoc *psoc, + uint32_t num_dbs_hw_modes, + uint32_t *ev_wlan_dbs_hw_mode_list) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + pm_ctx->num_dbs_hw_modes = num_dbs_hw_modes; + pm_ctx->hw_mode.hw_mode_list = + qdf_mem_malloc(sizeof(*pm_ctx->hw_mode.hw_mode_list) * + pm_ctx->num_dbs_hw_modes); + if (!pm_ctx->hw_mode.hw_mode_list) { + policy_mgr_err("Memory allocation failed for DBS"); + return; + } + qdf_mem_copy(pm_ctx->hw_mode.hw_mode_list, + ev_wlan_dbs_hw_mode_list, + (sizeof(*pm_ctx->hw_mode.hw_mode_list) * + pm_ctx->num_dbs_hw_modes)); +} + +void policy_mgr_dump_dbs_hw_mode(struct wlan_objmgr_psoc *psoc) +{ + uint32_t i, param; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { + param = pm_ctx->hw_mode.hw_mode_list[i]; + policy_mgr_err("[%d]-MAC0: tx_ss:%d rx_ss:%d bw_idx:%d", + i, + POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_GET(param), + POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_GET(param), + POLICY_MGR_HW_MODE_MAC0_BANDWIDTH_GET(param)); + policy_mgr_err("[%d]-MAC1: tx_ss:%d rx_ss:%d bw_idx:%d", + i, + POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_GET(param), + POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_GET(param), + POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_GET(param)); + policy_mgr_err("[%d] DBS:%d SBS:%d", i, + POLICY_MGR_HW_MODE_DBS_MODE_GET(param), + POLICY_MGR_HW_MODE_SBS_MODE_GET(param)); + } +} + +void policy_mgr_init_dbs_config(struct wlan_objmgr_psoc *psoc, + uint32_t scan_config, uint32_t fw_config) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + pm_ctx->dual_mac_cfg.cur_scan_config = 0; + pm_ctx->dual_mac_cfg.cur_fw_mode_config = 0; + + /* If dual mac features are disabled in the INI, we + * need not proceed further + */ + if (policy_mgr_is_dual_mac_disabled_in_ini(psoc)) { + policy_mgr_err("Disabling dual mac capabilities"); + /* All capabilites are initialized to 0. We can return */ + goto done; + } + + /* Initialize concurrent_scan_config_bits with default FW value */ + WMI_DBS_CONC_SCAN_CFG_DBS_SCAN_SET( + pm_ctx->dual_mac_cfg.cur_scan_config, + WMI_DBS_CONC_SCAN_CFG_DBS_SCAN_GET(scan_config)); + WMI_DBS_CONC_SCAN_CFG_AGILE_SCAN_SET( + pm_ctx->dual_mac_cfg.cur_scan_config, + WMI_DBS_CONC_SCAN_CFG_AGILE_SCAN_GET(scan_config)); + WMI_DBS_CONC_SCAN_CFG_AGILE_DFS_SCAN_SET( + pm_ctx->dual_mac_cfg.cur_scan_config, + WMI_DBS_CONC_SCAN_CFG_AGILE_DFS_SCAN_GET(scan_config)); + + /* Initialize fw_mode_config_bits with default FW value */ + WMI_DBS_FW_MODE_CFG_DBS_SET( + pm_ctx->dual_mac_cfg.cur_fw_mode_config, + WMI_DBS_FW_MODE_CFG_DBS_GET(fw_config)); + WMI_DBS_FW_MODE_CFG_AGILE_DFS_SET( + pm_ctx->dual_mac_cfg.cur_fw_mode_config, + WMI_DBS_FW_MODE_CFG_AGILE_DFS_GET(fw_config)); +done: + /* Initialize the previous scan/fw mode config */ + pm_ctx->dual_mac_cfg.prev_scan_config = + pm_ctx->dual_mac_cfg.cur_scan_config; + pm_ctx->dual_mac_cfg.prev_fw_mode_config = + pm_ctx->dual_mac_cfg.cur_fw_mode_config; + + policy_mgr_debug("cur_scan_config:%x cur_fw_mode_config:%x", + pm_ctx->dual_mac_cfg.cur_scan_config, + pm_ctx->dual_mac_cfg.cur_fw_mode_config); +} + +void policy_mgr_update_dbs_scan_config(struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + pm_ctx->dual_mac_cfg.prev_scan_config = + pm_ctx->dual_mac_cfg.cur_scan_config; + pm_ctx->dual_mac_cfg.cur_scan_config = + pm_ctx->dual_mac_cfg.req_scan_config; +} + +void policy_mgr_update_dbs_fw_config(struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + pm_ctx->dual_mac_cfg.prev_fw_mode_config = + pm_ctx->dual_mac_cfg.cur_fw_mode_config; + pm_ctx->dual_mac_cfg.cur_fw_mode_config = + pm_ctx->dual_mac_cfg.req_fw_mode_config; +} + +void policy_mgr_update_dbs_req_config(struct wlan_objmgr_psoc *psoc, + uint32_t scan_config, uint32_t fw_mode_config) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + pm_ctx->dual_mac_cfg.req_scan_config = scan_config; + pm_ctx->dual_mac_cfg.req_fw_mode_config = fw_mode_config; +} + bool policy_mgr_get_dbs_plus_agile_scan_config(struct wlan_objmgr_psoc *psoc) { uint32_t scan_config; @@ -310,8 +722,10 @@ bool policy_mgr_is_dbs_enable(struct wlan_objmgr_psoc *psoc) { struct policy_mgr_psoc_priv_obj *pm_ctx; - if (policy_mgr_is_dual_mac_disabled_in_ini(psoc)) + if (policy_mgr_is_dual_mac_disabled_in_ini(psoc)) { + policy_mgr_err("DBS is disabled from ini"); return false; + } pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -697,7 +1111,8 @@ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, } /* set tdls connection tracker state */ - pm_ctx->tdls_cbacks.set_tdls_ct_mode(psoc); + if (pm_ctx->tdls_cbacks.set_tdls_ct_mode) + pm_ctx->tdls_cbacks.set_tdls_ct_mode(psoc); policy_mgr_dump_current_concurrency(psoc); qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); @@ -734,7 +1149,8 @@ void policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, policy_mgr_decr_connection_count(psoc, session_id); /* set tdls connection tracker state */ - pm_ctx->tdls_cbacks.set_tdls_ct_mode(psoc); + if (pm_ctx->tdls_cbacks.set_tdls_ct_mode) + pm_ctx->tdls_cbacks.set_tdls_ct_mode(psoc); policy_mgr_dump_current_concurrency(psoc); } @@ -759,9 +1175,9 @@ QDF_STATUS policy_mgr_incr_connection_count( } conn_index = policy_mgr_get_connection_count(psoc); - if (pm_ctx->gMaxConcurrentActiveSessions < conn_index) { + if (pm_ctx->user_cfg.max_concurrent_active_sessions < conn_index) { policy_mgr_err("exceeded max connection limit %d", - pm_ctx->gMaxConcurrentActiveSessions); + pm_ctx->user_cfg.max_concurrent_active_sessions); return status; } @@ -986,8 +1402,8 @@ bool policy_mgr_max_concurrent_connections_reached( for (i = 0; i < QDF_MAX_NO_OF_MODE; i++) j += pm_ctx->no_of_active_sessions[i]; return j > - (pm_ctx-> - gMaxConcurrentActiveSessions - 1); + (pm_ctx->user_cfg. + max_concurrent_active_sessions - 1); } return false; @@ -1035,7 +1451,7 @@ bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, if (policy_mgr_max_concurrent_connections_reached(psoc)) { policy_mgr_err("Reached max concurrent connections: %d", - pm_ctx->gMaxConcurrentActiveSessions); + pm_ctx->user_cfg.max_concurrent_active_sessions); goto done; } @@ -1258,14 +1674,20 @@ QDF_STATUS policy_mgr_get_channel_from_scan_result( return QDF_STATUS_E_INVAL; } - status = pm_ctx->sme_cbacks.sme_get_ap_channel_from_scan_cache - (roam_profile, &scan_cache, channel); - if (status != QDF_STATUS_SUCCESS) { - policy_mgr_err("Get AP channel failed"); - return status; - } + if (pm_ctx->sme_cbacks.sme_get_ap_channel_from_scan_cache) { + status = pm_ctx->sme_cbacks.sme_get_ap_channel_from_scan_cache + (roam_profile, &scan_cache, channel); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("Get AP channel failed"); + return status; + } + } else + policy_mgr_err("sme_get_ap_channel_from_scan_cache NULL"); - status = pm_ctx->sme_cbacks.sme_scan_result_purge(scan_cache); + if (pm_ctx->sme_cbacks.sme_scan_result_purge) + status = pm_ctx->sme_cbacks.sme_scan_result_purge(scan_cache); + else + policy_mgr_err("sme_scan_result_purge NULL"); return status; } @@ -1401,13 +1823,24 @@ bool policy_mgr_check_for_session_conc(struct wlan_objmgr_psoc *psoc, { enum policy_mgr_con_mode mode; bool ret; + struct policy_mgr_psoc_priv_obj *pm_ctx; - mode = policy_mgr_get_mode_by_vdev_id(psoc, session_id); - if (PM_MAX_NUM_OF_MODE == mode) { - policy_mgr_err("Invalid mode"); + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); return false; } + if (pm_ctx->hdd_cbacks.get_mode_for_non_connected_vdev) { + mode = pm_ctx->hdd_cbacks.get_mode_for_non_connected_vdev( + psoc, session_id); + if (PM_MAX_NUM_OF_MODE == mode) { + policy_mgr_err("Invalid mode"); + return false; + } + } else + return false; + if (channel == 0) { policy_mgr_err("Invalid channel number 0"); return false; diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 6e9d400bbac5..e9c00f4ca524 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -279,15 +279,24 @@ struct policy_mgr_psoc_priv_obj { struct dbs_hw_mode_info hw_mode; uint32_t old_hw_mode_index; uint32_t new_hw_mode_index; - struct extended_caps phy_caps; bool enable2x2; - uint8_t gMaxConcurrentActiveSessions; - uint8_t conc_system_pref; struct dual_mac_config dual_mac_cfg; uint32_t hw_mode_change_in_progress; struct policy_mgr_user_cfg user_cfg; }; +/** + * struct policy_mgr_mac_ss_bw_info - hw_mode_list PHY/MAC params for each MAC + * @mac_tx_stream: Max TX stream + * @mac_rx_stream: Max RX stream + * @mac_bw: Max bandwidth + */ +struct policy_mgr_mac_ss_bw_info { + uint32_t mac_tx_stream; + uint32_t mac_rx_stream; + uint32_t mac_bw; +}; + struct policy_mgr_psoc_priv_obj *policy_mgr_get_context( struct wlan_objmgr_psoc *psoc); QDF_STATUS policy_mgr_get_updated_scan_config( diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index e81c003f4361..146e997f545c 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -55,6 +55,8 @@ static QDF_STATUS policy_mgr_psoc_obj_create_cb(struct wlan_objmgr_psoc *psoc, } policy_mgr_ctx->psoc = psoc; + policy_mgr_ctx->old_hw_mode_index = POLICY_MGR_DEFAULT_HW_MODE_INDEX; + policy_mgr_ctx->new_hw_mode_index = POLICY_MGR_DEFAULT_HW_MODE_INDEX; wlan_objmgr_psoc_component_obj_attach(psoc, WLAN_UMAC_COMP_POLICY_MGR, @@ -278,8 +280,15 @@ QDF_STATUS policy_mgr_psoc_enable(struct wlan_objmgr_psoc *psoc) return status; } - pm_ctx->do_hw_mode_change = false; + if (!QDF_IS_STATUS_SUCCESS(qdf_mutex_create( + &pm_ctx->qdf_conc_list_lock))) { + policy_mgr_err("Failed to init qdf_conc_list_lock"); + QDF_ASSERT(0); + return status; + } + pm_ctx->do_hw_mode_change = false; + pm_ctx->hw_mode_change_in_progress = POLICY_MGR_HW_MODE_NOT_IN_PROGRESS; /* reset sap mandatory channels */ status = policy_mgr_reset_sap_mandatory_channels(pm_ctx); if (QDF_IS_STATUS_ERROR(status)) { @@ -337,6 +346,19 @@ QDF_STATUS policy_mgr_psoc_disable(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_E_FAILURE; } + if (pm_ctx->hw_mode.hw_mode_list) { + qdf_mem_free(pm_ctx->hw_mode.hw_mode_list); + pm_ctx->hw_mode.hw_mode_list = NULL; + policy_mgr_info("HW list is freed"); + } + + if (!QDF_IS_STATUS_SUCCESS(qdf_mutex_destroy( + &pm_ctx->qdf_conc_list_lock))) { + policy_mgr_err("Failed to destroy qdf_conc_list_lock"); + status = QDF_STATUS_E_FAILURE; + QDF_ASSERT(0); + } + /* destroy connection_update_done_evt */ if (!QDF_IS_STATUS_SUCCESS(qdf_event_destroy (&pm_ctx->connection_update_done_evt))) { @@ -432,6 +454,8 @@ QDF_STATUS policy_mgr_register_hdd_cb(struct wlan_objmgr_psoc *psoc, hdd_cbacks->sap_restart_chan_switch_cb; pm_ctx->hdd_cbacks.wlan_hdd_get_channel_for_sap_restart = hdd_cbacks->wlan_hdd_get_channel_for_sap_restart; + pm_ctx->hdd_cbacks.get_mode_for_non_connected_vdev = + hdd_cbacks->get_mode_for_non_connected_vdev; return QDF_STATUS_SUCCESS; } @@ -448,6 +472,7 @@ QDF_STATUS policy_mgr_deregister_hdd_cb(struct wlan_objmgr_psoc *psoc) pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb = NULL; pm_ctx->hdd_cbacks.wlan_hdd_get_channel_for_sap_restart = NULL; + pm_ctx->hdd_cbacks.get_mode_for_non_connected_vdev = NULL; return QDF_STATUS_SUCCESS; } diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index f85fc0c618f2..a55fe2d60e63 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -196,9 +196,9 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, /* find the current connection state from pm_conc_connection_list*/ num_connections = policy_mgr_get_connection_count(psoc); policy_mgr_debug("connections:%d pref:%d requested mode:%d", - num_connections, pm_ctx->conc_system_pref, mode); + num_connections, pm_ctx->user_cfg.conc_system_pref, mode); - switch (pm_ctx->conc_system_pref) { + switch (pm_ctx->user_cfg.conc_system_pref) { case 0: conc_system_pref = PM_THROUGHPUT; break; @@ -210,7 +210,7 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, break; default: policy_mgr_err("unknown conc_system_pref value %d", - pm_ctx->conc_system_pref); + pm_ctx->user_cfg.conc_system_pref); break; } @@ -308,10 +308,10 @@ enum policy_mgr_conc_priority_mode return PM_THROUGHPUT; } - if (pm_ctx->conc_system_pref >= PM_MAX_CONC_PRIORITY_MODE) + if (pm_ctx->user_cfg.conc_system_pref >= PM_MAX_CONC_PRIORITY_MODE) return PM_THROUGHPUT; - return pm_ctx->conc_system_pref; + return pm_ctx->user_cfg.conc_system_pref; } enum policy_mgr_one_connection_mode From 68f709d4a0803d4182320ff3d850f8d5f264069c Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Thu, 23 Mar 2017 18:00:04 -0700 Subject: [PATCH 023/187] qcacmn: Add 2x2 chain configuration in policy manager Add 2x2 chain configuration in policy manager that is coming from user space. Change-Id: I8c9c54a1e63810327dc4252bc5320f34965ea4ca CRs-Fixed: 2009818 --- inc/wlan_policy_mgr_public_struct.h | 2 ++ src/wlan_policy_mgr_action.c | 4 ++-- src/wlan_policy_mgr_i.h | 8 -------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 361683e20f87..4a3bf4b961df 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -980,10 +980,12 @@ struct dual_mac_config { * @max_concurrent_active_sessions: User allowed maximum active * connections * @conc_system_pref: System preference for PCL table + * @enable2x2: 2x2 chain mask user config */ struct policy_mgr_user_cfg { uint8_t enable_mcc_adaptive_scheduler; uint8_t max_concurrent_active_sessions; uint8_t conc_system_pref; + bool enable2x2; }; #endif /* __WLAN_POLICY_MGR_PUBLIC_STRUCT_H */ diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 23f893a89040..e2d7cff6a8d4 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -115,11 +115,11 @@ QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc, * if HW is not capable of doing 2x2 or ini config disabled 2x2, don't * allow to request FW for 2x2 */ - if ((HW_MODE_SS_2x2 == mac0_ss) && (!pm_ctx->enable2x2)) { + if ((HW_MODE_SS_2x2 == mac0_ss) && (!pm_ctx->user_cfg.enable2x2)) { policy_mgr_notice("2x2 is not allowed downgrading to 1x1 for mac0"); mac0_ss = HW_MODE_SS_1x1; } - if ((HW_MODE_SS_2x2 == mac1_ss) && (!pm_ctx->enable2x2)) { + if ((HW_MODE_SS_2x2 == mac1_ss) && (!pm_ctx->user_cfg.enable2x2)) { policy_mgr_notice("2x2 is not allowed downgrading to 1x1 for mac1"); mac1_ss = HW_MODE_SS_1x1; } diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index e9c00f4ca524..7bd3f6dedb0c 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -244,13 +244,6 @@ extern enum policy_mgr_conc_next_action * @hw_mode: List of HW modes supported * @old_hw_mode_index: Old HW mode from hw_mode table * @new_hw_mode_index: New HW mode from hw_mode table - * @phy_caps: PHY capability advertised by FW - * @enable2x2: 2x2 chain mask user config - * @gMaxConcurrentActiveSessions: Max concurrenct active - * connections user config - * @conc_system_pref: System preference of t/p, power or latancy - * for Preferred Channel List table, user - * config * @dual_mac_cfg: DBS configuration currenctly used by FW for * scan & connections * @hw_mode_change_in_progress: This is to track if HW mode @@ -279,7 +272,6 @@ struct policy_mgr_psoc_priv_obj { struct dbs_hw_mode_info hw_mode; uint32_t old_hw_mode_index; uint32_t new_hw_mode_index; - bool enable2x2; struct dual_mac_config dual_mac_cfg; uint32_t hw_mode_change_in_progress; struct policy_mgr_user_cfg user_cfg; From 59cbe5c08ef25738e35759cabf93cd142f2cc20b Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Fri, 24 Mar 2017 14:13:52 -0700 Subject: [PATCH 024/187] qcacmn: Add a legacy callback to get the type of non connected vdev Add a legacy callback to get the type of a non connected vdev needed by policy manager. Change-Id: Id3622d5c808c8e0f3b24b257b5899f925dc36b1f CRs-Fixed: 2009818 --- src/wlan_policy_mgr_get_set_utils.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index cd9be988d695..b048579ee4e5 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1722,13 +1722,24 @@ uint8_t policy_mgr_search_and_check_for_session_conc( QDF_STATUS status; enum policy_mgr_con_mode mode; bool ret; + struct policy_mgr_psoc_priv_obj *pm_ctx; - mode = policy_mgr_get_mode_by_vdev_id(psoc, session_id); - if (PM_MAX_NUM_OF_MODE == mode) { - policy_mgr_err("Invalid mode"); + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); return channel; } + if (pm_ctx->hdd_cbacks.get_mode_for_non_connected_vdev) { + mode = pm_ctx->hdd_cbacks.get_mode_for_non_connected_vdev( + psoc, session_id); + if (PM_MAX_NUM_OF_MODE == mode) { + policy_mgr_err("Invalid mode"); + return channel; + } + } else + return channel; + status = policy_mgr_get_channel_from_scan_result(psoc, roam_profile, &channel); if ((QDF_STATUS_SUCCESS != status) || (channel == 0)) { From 658a48de2dfd90a7a710da827f671256e6d318fd Mon Sep 17 00:00:00 2001 From: Archana Ramachandran Date: Thu, 23 Mar 2017 23:30:23 -0700 Subject: [PATCH 025/187] qcacmn: Fix SME callback for policy manager component Fix SME callback for policy manager component Change-Id: If5c7256fb689e4cdb053aa5012deacac221261f9 CRs-Fixed: 2019994 --- inc/wlan_policy_mgr_api.h | 2 +- src/wlan_policy_mgr_get_set_utils.c | 33 ++++++++++++++++------------- src/wlan_policy_mgr_init_deinit.c | 4 ++-- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 3c92c8402f2b..cc728643c0e5 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -758,7 +758,7 @@ struct policy_mgr_sme_cbacks { uint8_t next_action, struct wlan_objmgr_psoc *psoc, enum policy_mgr_conn_update_reason reason); QDF_STATUS (*sme_change_mcc_beacon_interval) (uint8_t session_id); - QDF_STATUS (*sme_get_ap_channel_from_scan_cache) ( + QDF_STATUS (*sme_get_ap_channel_from_scan) ( void *roam_profile, void **scan_cache, uint8_t *channel); diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index b048579ee4e5..a881839e85b8 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1674,15 +1674,16 @@ QDF_STATUS policy_mgr_get_channel_from_scan_result( return QDF_STATUS_E_INVAL; } - if (pm_ctx->sme_cbacks.sme_get_ap_channel_from_scan_cache) { - status = pm_ctx->sme_cbacks.sme_get_ap_channel_from_scan_cache + if (pm_ctx->sme_cbacks.sme_get_ap_channel_from_scan) { + status = pm_ctx->sme_cbacks.sme_get_ap_channel_from_scan (roam_profile, &scan_cache, channel); if (status != QDF_STATUS_SUCCESS) { policy_mgr_err("Get AP channel failed"); return status; } - } else + } else { policy_mgr_err("sme_get_ap_channel_from_scan_cache NULL"); + } if (pm_ctx->sme_cbacks.sme_scan_result_purge) status = pm_ctx->sme_cbacks.sme_scan_result_purge(scan_cache); @@ -1907,17 +1908,18 @@ QDF_STATUS policy_mgr_change_mcc_go_beacon_interval( policy_mgr_info("UPDATE Beacon Params"); if (QDF_SAP_MODE == dev_mode) { - if (!pm_ctx-> - sme_cbacks.sme_change_mcc_beacon_interval) { + if (pm_ctx->sme_cbacks.sme_change_mcc_beacon_interval + ) { + status = pm_ctx->sme_cbacks. + sme_change_mcc_beacon_interval(vdev_id); + if (status == QDF_STATUS_E_FAILURE) { + policy_mgr_err("Failed to update Beacon Params"); + return QDF_STATUS_E_FAILURE; + } + } else { policy_mgr_err("sme_change_mcc_beacon_interval callback is NULL"); return QDF_STATUS_E_FAILURE; } - status = pm_ctx->sme_cbacks. - sme_change_mcc_beacon_interval(vdev_id); - if (status == QDF_STATUS_E_FAILURE) { - policy_mgr_err("Failed to update Beacon Params"); - return QDF_STATUS_E_FAILURE; - } } return QDF_STATUS_SUCCESS; @@ -2137,14 +2139,15 @@ QDF_STATUS policy_mgr_get_nss_for_vdev(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_FAILURE; } - if (!pm_ctx->sme_cbacks.sme_get_nss_for_vdev) { + if (pm_ctx->sme_cbacks.sme_get_nss_for_vdev) { + pm_ctx->sme_cbacks.sme_get_nss_for_vdev( + dev_mode, nss_2g, nss_5g); + + } else { policy_mgr_err("sme_get_nss_for_vdev callback is NULL"); return QDF_STATUS_E_FAILURE; } - pm_ctx->sme_cbacks.sme_get_nss_for_vdev( - dev_mode, nss_2g, nss_5g); - return QDF_STATUS_SUCCESS; } diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 146e997f545c..63c7b43be190 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -420,8 +420,8 @@ QDF_STATUS policy_mgr_register_sme_cb(struct wlan_objmgr_psoc *psoc, sme_cbacks->sme_soc_set_dual_mac_config; pm_ctx->sme_cbacks.sme_change_mcc_beacon_interval = sme_cbacks->sme_change_mcc_beacon_interval; - pm_ctx->sme_cbacks.sme_get_ap_channel_from_scan_cache = - sme_cbacks->sme_get_ap_channel_from_scan_cache; + pm_ctx->sme_cbacks.sme_get_ap_channel_from_scan = + sme_cbacks->sme_get_ap_channel_from_scan; pm_ctx->sme_cbacks.sme_scan_result_purge = sme_cbacks->sme_scan_result_purge; From 878422fc9da72e3a004d1082ac77c0b01d51a8f0 Mon Sep 17 00:00:00 2001 From: Archana Ramachandran Date: Thu, 23 Mar 2017 11:34:02 -0700 Subject: [PATCH 026/187] qcacmn: Update legacy fixes in new policy manager component Update legacy fixes in new policy manager component: 1. Avoid race condition to get pcl while stopping P2P GO 2. Add 160/80+80 MHz support for STA mode 3. Fix SBS is set to true by policy manager in SCC mode Change-Id: I161ebe382915a6d9eefd6b4e3e2158ff14ad02c1 CRs-Fixed: 2009818 --- src/wlan_policy_mgr_core.c | 43 ++++------------------------- src/wlan_policy_mgr_get_set_utils.c | 24 +++------------- src/wlan_policy_mgr_i.h | 1 - 3 files changed, 9 insertions(+), 59 deletions(-) diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 56929c602a09..526b8093a90c 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -570,6 +570,11 @@ void policy_mgr_store_and_del_conn_info(struct wlan_objmgr_psoc *psoc, bool found = false; struct policy_mgr_psoc_priv_obj *pm_ctx; + if (!info) { + policy_mgr_err("Invalid connection info"); + return; + } + qdf_mem_zero(info, sizeof(*info)); pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { policy_mgr_err("Invalid Context"); @@ -2142,44 +2147,6 @@ bool policy_mgr_allow_new_home_channel(struct wlan_objmgr_psoc *psoc, return status; } -/** - * policy_mgr_vht160_conn_exist() - to check if we have a connection - * already using vht160 or vht80+80 - * - * This routine will check if vht160 connection already exist or - * no. If it exist then this routine will return true. - * - * Return: true if vht160 connection exist else false - */ -bool policy_mgr_vht160_conn_exist(struct wlan_objmgr_psoc *psoc) -{ - uint32_t conn_index; - bool status = false; - struct policy_mgr_psoc_priv_obj *pm_ctx; - - pm_ctx = policy_mgr_get_context(psoc); - if (!pm_ctx) { - policy_mgr_err("Invalid Context"); - return status; - } - - qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); - for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; - conn_index++) { - if (pm_conc_connection_list[conn_index].in_use && - ((pm_conc_connection_list[conn_index].bw == - HW_MODE_80_PLUS_80_MHZ) || - (pm_conc_connection_list[conn_index].bw == - HW_MODE_160_MHZ))) { - status = true; - break; - } - } - qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); - - return status; -} - /** * policy_mgr_is_5g_channel_allowed() - check if 5g channel is allowed * @channel: channel number which needs to be validated diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index a881839e85b8..38d55f000669 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -563,17 +563,15 @@ bool policy_mgr_is_hw_sbs_capable(struct wlan_objmgr_psoc *psoc) return false; } - policy_mgr_notice("SBS service bit map: %d", - pm_ctx->wma_cbacks.wma_is_service_enabled( - WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT)); - /* The agreement with FW is that: To know if the target is SBS * capable, SBS needs to be supported both in the HW mode list * and DBS needs to be supported in the service ready event */ if (!(pm_ctx->wma_cbacks.wma_is_service_enabled( - WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT))) + WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT))) { + policy_mgr_err("SBS cannot be supported since DBS is disabled"); return false; + } for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { param = pm_ctx->hw_mode.hw_mode_list[i]; @@ -588,7 +586,7 @@ bool policy_mgr_is_hw_sbs_capable(struct wlan_objmgr_psoc *psoc) if (found) return true; - return true; + return false; } QDF_STATUS policy_mgr_get_dbs_hw_modes(struct wlan_objmgr_psoc *psoc, @@ -1600,20 +1598,6 @@ bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); } - /* don't allow concurrency on vht160 or vht 80+80 */ - if (num_connections && - ((bw == HW_MODE_80_PLUS_80_MHZ) || - (bw == HW_MODE_160_MHZ))) { - policy_mgr_err("No VHT160, we have one connection already"); - goto done; - } - - if (policy_mgr_vht160_conn_exist(psoc)) { - policy_mgr_err("VHT160/80+80 connection exists, no concurrency"); - goto done; - } - - status = true; done: diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 7bd3f6dedb0c..67e69f072bfe 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -389,7 +389,6 @@ bool policy_mgr_disallow_mcc(struct wlan_objmgr_psoc *psoc, uint8_t channel); bool policy_mgr_allow_new_home_channel(struct wlan_objmgr_psoc *psoc, uint8_t channel, uint32_t num_connections); -bool policy_mgr_vht160_conn_exist(struct wlan_objmgr_psoc *psoc); bool policy_mgr_is_5g_channel_allowed(struct wlan_objmgr_psoc *psoc, uint8_t channel, uint32_t *list, enum policy_mgr_con_mode mode); From 00ccf115f53624db6c79656565b34c24bbdd3cc1 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Tue, 28 Mar 2017 10:45:08 -0700 Subject: [PATCH 027/187] qcacmn: Add null check for legacy callback functions in policy manager Add null check for callback functions registered from legacy modules with policy manager. Change-Id: I8a08870ea904f4e01a17f6a472bdd609df9c3c4c CRs-Fixed: 2009818 --- src/wlan_policy_mgr_action.c | 15 +++++--- src/wlan_policy_mgr_get_set_utils.c | 55 +++++++++++++++++------------ 2 files changed, 43 insertions(+), 27 deletions(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index e2d7cff6a8d4..4011622d1ce7 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -260,14 +260,19 @@ QDF_STATUS policy_mgr_update_connection_info(struct wlan_objmgr_psoc *psoc, vdev_id); return status; } - - status = pm_ctx->wma_cbacks.wma_get_connection_info( + if (pm_ctx->wma_cbacks.wma_get_connection_info) { + status = pm_ctx->wma_cbacks.wma_get_connection_info( vdev_id, &conn_table_entry); - if (QDF_STATUS_SUCCESS != status) { - policy_mgr_err("can't find vdev_id %d in connection table", + if (QDF_STATUS_SUCCESS != status) { + policy_mgr_err("can't find vdev_id %d in connection table", vdev_id); - return status; + return status; + } + } else { + policy_mgr_err("wma_get_connection_info is NULL"); + return QDF_STATUS_E_FAILURE; } + mode = policy_mgr_get_mode(conn_table_entry.type, conn_table_entry.sub_type); chan = reg_freq_to_chan(conn_table_entry.mhz); diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 38d55f000669..dad0bf96ba42 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -523,17 +523,19 @@ bool policy_mgr_is_hw_dbs_capable(struct wlan_objmgr_psoc *psoc) policy_mgr_notice("DBS is disabled"); return false; } + if (pm_ctx->wma_cbacks.wma_is_service_enabled) { + policy_mgr_notice("DBS service bit map: %d", + pm_ctx->wma_cbacks.wma_is_service_enabled( + WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT)); - policy_mgr_notice("DBS service bit map: %d", - pm_ctx->wma_cbacks.wma_is_service_enabled( - WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT)); - - /* The agreement with FW is that: To know if the target is DBS - * capable, DBS needs to be supported both in the HW mode list - * and in the service ready event - */ - if (!(pm_ctx->wma_cbacks.wma_is_service_enabled( + /* The agreement with FW is that: To know if the target is DBS + * capable, DBS needs to be supported both in the HW mode list + * and in the service ready event + */ + if (!(pm_ctx->wma_cbacks.wma_is_service_enabled( WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT))) + return false; + } else return false; for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { @@ -562,16 +564,20 @@ bool policy_mgr_is_hw_sbs_capable(struct wlan_objmgr_psoc *psoc) policy_mgr_err("Invalid Context"); return false; } + if (pm_ctx->wma_cbacks.wma_is_service_enabled) { + policy_mgr_notice("DBS service bit map: %d", + pm_ctx->wma_cbacks.wma_is_service_enabled( + WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT)); - /* The agreement with FW is that: To know if the target is SBS - * capable, SBS needs to be supported both in the HW mode list - * and DBS needs to be supported in the service ready event - */ - if (!(pm_ctx->wma_cbacks.wma_is_service_enabled( - WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT))) { - policy_mgr_err("SBS cannot be supported since DBS is disabled"); + /* The agreement with FW is that: To know if the target is SBS + * capable, SBS needs to be supported both in the HW mode list + * and DBS needs to be supported in the service ready event + */ + if (!(pm_ctx->wma_cbacks.wma_is_service_enabled( + WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT))) + return false; + } else return false; - } for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { param = pm_ctx->hw_mode.hw_mode_list[i]; @@ -1178,14 +1184,19 @@ QDF_STATUS policy_mgr_incr_connection_count( pm_ctx->user_cfg.max_concurrent_active_sessions); return status; } - - status = pm_ctx->wma_cbacks.wma_get_connection_info( + if (pm_ctx->wma_cbacks.wma_get_connection_info) { + status = pm_ctx->wma_cbacks.wma_get_connection_info( vdev_id, &conn_table_entry); - if (QDF_STATUS_SUCCESS != status) { - policy_mgr_err("can't find vdev_id %d in connection table", + if (QDF_STATUS_SUCCESS != status) { + policy_mgr_err("can't find vdev_id %d in connection table", vdev_id); - return status; + return status; + } + } else { + policy_mgr_err("wma_get_connection_info is NULL"); + return QDF_STATUS_E_FAILURE; } + mode = policy_mgr_get_mode(conn_table_entry.type, conn_table_entry.sub_type); chan = reg_freq_to_chan(conn_table_entry.mhz); From d187078c6501bb94c33d264f6782d847a2c48704 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Tue, 4 Apr 2017 12:03:25 -0700 Subject: [PATCH 028/187] qcacmn: Fix checkpatch warning in policy manager component Fix checkpatch warning in policy manager component. Change-Id: Ibef1681f3dc8e17b0d1d7bcde0d7dbea5526eedf CRs-Fixed: 2009818 --- inc/wlan_policy_mgr_api.h | 6 +++--- src/wlan_policy_mgr_i.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index cc728643c0e5..3eb4a5815880 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -757,12 +757,12 @@ struct policy_mgr_sme_cbacks { uint8_t new_nss, policy_mgr_nss_update_cback cback, uint8_t next_action, struct wlan_objmgr_psoc *psoc, enum policy_mgr_conn_update_reason reason); - QDF_STATUS (*sme_change_mcc_beacon_interval) (uint8_t session_id); - QDF_STATUS (*sme_get_ap_channel_from_scan) ( + QDF_STATUS (*sme_change_mcc_beacon_interval)(uint8_t session_id); + QDF_STATUS (*sme_get_ap_channel_from_scan)( void *roam_profile, void **scan_cache, uint8_t *channel); - QDF_STATUS (*sme_scan_result_purge) ( + QDF_STATUS (*sme_scan_result_purge)( void *scan_result); }; diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 67e69f072bfe..75a2c3d3f164 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -249,7 +249,7 @@ extern enum policy_mgr_conc_next_action * @hw_mode_change_in_progress: This is to track if HW mode * change is in progress * @enable_mcc_adaptive_scheduler: Enable MCC adaptive scheduler - * value from INI + * value from INI */ struct policy_mgr_psoc_priv_obj { struct wlan_objmgr_psoc *psoc; From 9807d0cd8dda3d2153e6d283ce74bc46b7e580c6 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Tue, 4 Apr 2017 17:23:26 -0700 Subject: [PATCH 029/187] qcacmn: Prune PCL to active channels only for P2P GO Prune the PCL to have only active channels for P2P GO mode. Change-Id: Ifade00b3ccfcecff16a49e9e9aa5e077d5f9629b CRs-Fixed: 2029007 --- src/wlan_policy_mgr_i.h | 2 ++ src/wlan_policy_mgr_pcl.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 75a2c3d3f164..a1a91be7ecd2 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -53,6 +53,8 @@ extern enum cds_band_type cds_chan_to_band(uint32_t chan); #define WLAN_REG_IS_CHANNEL_VALID_5G_SBS(curchan, newchan) \ CDS_IS_CHANNEL_VALID_5G_SBS(curchan, newchan) #define wlan_reg_is_dfs_ch(psoc, ch) CDS_IS_DFS_CH(ch) +#define wlan_reg_is_passive_or_disable_ch(ch) \ + CDS_IS_PASSIVE_OR_DISABLE_CH(ch) #define WLAN_REG_MAX_24GHZ_CH_NUM CDS_MAX_24GHZ_CHANNEL_NUMBER #define reg_chan_to_freq(chan_num) cds_chan_to_freq(chan_num) #define reg_freq_to_chan(freq) cds_freq_to_chan(freq) diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index a55fe2d60e63..edc96138353e 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -139,6 +139,31 @@ void policy_mgr_update_with_safe_channel_list(uint8_t *pcl_channels, return; } +static QDF_STATUS policy_mgr_modify_pcl_based_on_enabled_channels( + uint8_t *pcl_list_org, + uint8_t *weight_list_org, + uint32_t *pcl_len_org) +{ + uint32_t i, pcl_len = 0; + uint8_t pcl_list[QDF_MAX_NUM_CHAN]; + uint8_t weight_list[QDF_MAX_NUM_CHAN]; + + for (i = 0; i < *pcl_len_org; i++) { + if (!wlan_reg_is_passive_or_disable_ch(pcl_list_org[i])) { + pcl_list[pcl_len] = pcl_list_org[i]; + weight_list[pcl_len++] = weight_list_org[i]; + } + } + + qdf_mem_zero(pcl_list_org, QDF_ARRAY_SIZE(pcl_list_org)); + qdf_mem_zero(weight_list_org, QDF_ARRAY_SIZE(weight_list_org)); + qdf_mem_copy(pcl_list_org, pcl_list, pcl_len); + qdf_mem_copy(weight_list_org, weight_list, pcl_len); + *pcl_len_org = pcl_len; + + return QDF_STATUS_SUCCESS; +} + uint8_t policy_mgr_get_channel(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, uint32_t *vdev_id) { @@ -293,6 +318,19 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, } + if (mode == PM_P2P_GO_MODE) { + status = policy_mgr_modify_pcl_based_on_enabled_channels( + pcl_channels, pcl_weight, len); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("failed to get modified pcl for GO"); + return status; + } + policy_mgr_debug("modified pcl len:%d", *len); + for (i = 0; i < *len; i++) + policy_mgr_debug("chan:%d weight:%d", + pcl_channels[i], pcl_weight[i]); + } + return QDF_STATUS_SUCCESS; } From ce237d682b05310abd329f303753f0776373fd18 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Wed, 5 Apr 2017 12:52:36 -0700 Subject: [PATCH 030/187] qcacmn: Replace legacy regulatory APIs with new ones from host cmn Get rid of legacy regulatory API references from policy manager as the new ones are available now. Change-Id: I48d41599d7faeb760b51ca5f0d7672e8484e7f91 CRs-Fixed: 2009818 --- src/wlan_policy_mgr_action.c | 4 +- src/wlan_policy_mgr_core.c | 24 ++++-- src/wlan_policy_mgr_get_set_utils.c | 12 +-- src/wlan_policy_mgr_i.h | 33 +------- src/wlan_policy_mgr_init_deinit.c | 115 ++++++++++++++++++++++++---- src/wlan_policy_mgr_pcl.c | 21 +++-- 6 files changed, 140 insertions(+), 69 deletions(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 4011622d1ce7..84d4c67d1410 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -275,7 +275,7 @@ QDF_STATUS policy_mgr_update_connection_info(struct wlan_objmgr_psoc *psoc, mode = policy_mgr_get_mode(conn_table_entry.type, conn_table_entry.sub_type); - chan = reg_freq_to_chan(conn_table_entry.mhz); + chan = wlan_reg_freq_to_chan(pm_ctx->pdev, conn_table_entry.mhz); status = policy_mgr_get_nss_for_vdev(psoc, mode, &nss_2g, &nss_5g); if (QDF_IS_STATUS_SUCCESS(status)) { if ((WLAN_REG_IS_24GHZ_CH(chan) && (nss_2g > 1)) || @@ -723,7 +723,7 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( mcc_to_scc_switch, operating_channel); if ((mcc_to_scc_switch != QDF_MCC_TO_SCC_SWITCH_DISABLE) #ifdef FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE - && !wlan_reg_is_dfs_ch(psoc, + && !wlan_reg_is_dfs_ch(pm_ctx->pdev, operating_channel) #endif ) { diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 526b8093a90c..546bfdd4a16f 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -1529,7 +1529,7 @@ QDF_STATUS policy_mgr_get_connection_channels(struct wlan_objmgr_psoc *psoc, qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); if (POLICY_MGR_PCL_ORDER_NONE == order) { while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { - if (skip_dfs_channel && wlan_reg_is_dfs_ch(psoc, + if (skip_dfs_channel && wlan_reg_is_dfs_ch(pm_ctx->pdev, pm_conc_connection_list[conn_index].chan)) { conn_index++; } else if (*index < weight_len) { @@ -1555,7 +1555,7 @@ QDF_STATUS policy_mgr_get_connection_channels(struct wlan_objmgr_psoc *psoc, } conn_index = 0; while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { - if (skip_dfs_channel && wlan_reg_is_dfs_ch(psoc, + if (skip_dfs_channel && wlan_reg_is_dfs_ch(pm_ctx->pdev, pm_conc_connection_list[conn_index].chan)) { conn_index++; } else if (WLAN_REG_IS_5GHZ_CH( @@ -1571,7 +1571,7 @@ QDF_STATUS policy_mgr_get_connection_channels(struct wlan_objmgr_psoc *psoc, *len = num_channels; } else if (POLICY_MGR_PCL_ORDER_5G_THEN_2G == order) { while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { - if (skip_dfs_channel && wlan_reg_is_dfs_ch(psoc, + if (skip_dfs_channel && wlan_reg_is_dfs_ch(pm_ctx->pdev, pm_conc_connection_list[conn_index].chan)) { conn_index++; } else if (WLAN_REG_IS_5GHZ_CH( @@ -1639,6 +1639,13 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, uint8_t sbs_channel_list[QDF_MAX_NUM_CHAN] = {0}; bool skip_dfs_channel = false; uint32_t i = 0, j = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return status; + } if ((NULL == pcl_channels) || (NULL == len)) { policy_mgr_err("pcl_channels or len is NULL"); @@ -1699,7 +1706,8 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, while ((chan_index < num_channels) && (chan_index_5 < QDF_MAX_NUM_CHAN)) { if ((true == skip_dfs_channel) && - wlan_reg_is_dfs_ch(psoc, channel_list[chan_index])) { + wlan_reg_is_dfs_ch(pm_ctx->pdev, + channel_list[chan_index])) { chan_index++; continue; } @@ -2177,11 +2185,11 @@ bool policy_mgr_is_5g_channel_allowed(struct wlan_objmgr_psoc *psoc, count = policy_mgr_mode_specific_connection_count(psoc, mode, list); qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); while (index < count) { - if (wlan_reg_is_dfs_ch(psoc, + if (wlan_reg_is_dfs_ch( + pm_ctx->pdev, pm_conc_connection_list[list[index]].chan) && - WLAN_REG_IS_5GHZ_CH(channel) && - (channel != - pm_conc_connection_list[list[index]].chan)) { + WLAN_REG_IS_5GHZ_CH(channel) && + (channel != pm_conc_connection_list[list[index]].chan)) { qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); policy_mgr_err("don't allow MCC if SAP/GO on DFS channel"); return false; diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index dad0bf96ba42..771f7e37442c 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1199,7 +1199,7 @@ QDF_STATUS policy_mgr_incr_connection_count( mode = policy_mgr_get_mode(conn_table_entry.type, conn_table_entry.sub_type); - chan = reg_freq_to_chan(conn_table_entry.mhz); + chan = wlan_reg_freq_to_chan(pm_ctx->pdev, conn_table_entry.mhz); status = policy_mgr_get_nss_for_vdev(psoc, mode, &nss_2g, &nss_5g); if (QDF_IS_STATUS_SUCCESS(status)) { if ((WLAN_REG_IS_24GHZ_CH(chan) && (nss_2g > 1)) || @@ -1488,7 +1488,7 @@ bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, goto done; if ((PM_P2P_GO_MODE == mode) || (PM_SAP_MODE == mode)) { - if (wlan_reg_is_dfs_ch(psoc, channel)) + if (wlan_reg_is_dfs_ch(pm_ctx->pdev, channel)) match = policy_mgr_disallow_mcc(psoc, channel); } if (true == match) { @@ -1512,7 +1512,7 @@ bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, goto done; } if ((PM_IBSS_MODE == mode) && - (wlan_reg_is_dfs_ch(psoc, channel)) && count) { + (wlan_reg_is_dfs_ch(pm_ctx->pdev, channel)) && count) { policy_mgr_err("No IBSS + STA SCC/MCC, IBSS is on DFS channel"); goto done; } @@ -1565,7 +1565,7 @@ bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, } qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); if (channel && - (wlan_reg_is_dfs_ch(psoc, + (wlan_reg_is_dfs_ch(pm_ctx->pdev, pm_conc_connection_list[0].chan)) && (WLAN_REG_IS_5GHZ_CH(channel))) { qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); @@ -2059,7 +2059,7 @@ bool policy_mgr_is_any_nondfs_chnl_present(struct wlan_objmgr_psoc *psoc, for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; conn_index++) { if (pm_conc_connection_list[conn_index].in_use && - !wlan_reg_is_dfs_ch(psoc, + !wlan_reg_is_dfs_ch(pm_ctx->pdev, pm_conc_connection_list[conn_index].chan)) { *channel = pm_conc_connection_list[conn_index].chan; status = true; @@ -2088,7 +2088,7 @@ bool policy_mgr_is_any_dfs_beaconing_session_present( conn_index++) { conn_info = &pm_conc_connection_list[conn_index]; if (conn_info->in_use && - wlan_reg_is_dfs_ch(psoc, conn_info->chan) && + wlan_reg_is_dfs_ch(pm_ctx->pdev, conn_info->chan) && (PM_SAP_MODE == conn_info->mode || PM_P2P_GO_MODE == conn_info->mode)) { *channel = pm_conc_connection_list[conn_index].chan; diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index a1a91be7ecd2..8dd4e4ddb457 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -33,36 +33,7 @@ #include "qdf_mc_timer.h" #include "qdf_lock.h" #include "qdf_defer.h" - -#include - -enum cds_band_type { - CDS_BAND_ALL = 0, - CDS_BAND_2GHZ = 1, - CDS_BAND_5GHZ = 2 -}; - -extern uint32_t cds_chan_to_freq(uint8_t chan); -extern uint8_t cds_freq_to_chan(uint32_t freq); -extern enum cds_band_type cds_chan_to_band(uint32_t chan); - -#define WLAN_REG_IS_24GHZ_CH(ch) CDS_IS_CHANNEL_24GHZ(ch) -#define WLAN_REG_IS_5GHZ_CH(ch) CDS_IS_CHANNEL_5GHZ(ch) -#define WLAN_REG_IS_SAME_BAND_CHANNELS(ch1, ch2) \ - CDS_IS_SAME_BAND_CHANNELS(ch1, ch2) -#define WLAN_REG_IS_CHANNEL_VALID_5G_SBS(curchan, newchan) \ - CDS_IS_CHANNEL_VALID_5G_SBS(curchan, newchan) -#define wlan_reg_is_dfs_ch(psoc, ch) CDS_IS_DFS_CH(ch) -#define wlan_reg_is_passive_or_disable_ch(ch) \ - CDS_IS_PASSIVE_OR_DISABLE_CH(ch) -#define WLAN_REG_MAX_24GHZ_CH_NUM CDS_MAX_24GHZ_CHANNEL_NUMBER -#define reg_chan_to_freq(chan_num) cds_chan_to_freq(chan_num) -#define reg_freq_to_chan(freq) cds_freq_to_chan(freq) -#define reg_chan_to_band(chan_num) cds_chan_to_band(chan_num) -#define BAND_2G CDS_BAND_2GHZ -#define BAND_5G CDS_BAND_5GHZ -#define BAND_ALL CDS_BAND_ALL - +#include "wlan_reg_services_api.h" #define MAX_NUMBER_OF_CONC_CONNECTIONS 3 #define DBS_OPPORTUNISTIC_TIME 10 @@ -213,6 +184,7 @@ extern enum policy_mgr_conc_next_action /** * struct policy_mgr_psoc_priv_obj - Policy manager private data * @psoc: pointer to PSOC object information + * @pdev: pointer to PDEV object information * @connection_update_done_evt: qdf event to synchronize * connection activities * @qdf_conc_list_lock: To protect connection table @@ -255,6 +227,7 @@ extern enum policy_mgr_conc_next_action */ struct policy_mgr_psoc_priv_obj { struct wlan_objmgr_psoc *psoc; + struct wlan_objmgr_pdev *pdev; qdf_event_t connection_update_done_evt; qdf_mutex_t qdf_conc_list_lock; qdf_mc_timer_t dbs_opportunistic_timer; diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 63c7b43be190..9c2fde0ae2d3 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -86,6 +86,42 @@ static void policy_mgr_psoc_obj_status_cb(struct wlan_objmgr_psoc *psoc, return; } +static QDF_STATUS policy_mgr_pdev_obj_create_cb(struct wlan_objmgr_pdev *pdev, + void *data) +{ + struct policy_mgr_psoc_priv_obj *policy_mgr_ctx; + struct wlan_objmgr_psoc *psoc; + + psoc = wlan_pdev_get_psoc(pdev); + policy_mgr_ctx = policy_mgr_get_context(psoc); + if (!policy_mgr_ctx) { + policy_mgr_err("invalid context"); + return QDF_STATUS_E_FAILURE; + } + + policy_mgr_ctx->pdev = pdev; + + return QDF_STATUS_SUCCESS; +} + +static QDF_STATUS policy_mgr_pdev_obj_destroy_cb(struct wlan_objmgr_pdev *pdev, + void *data) +{ + struct policy_mgr_psoc_priv_obj *policy_mgr_ctx; + struct wlan_objmgr_psoc *psoc; + + psoc = wlan_pdev_get_psoc(pdev); + policy_mgr_ctx = policy_mgr_get_context(psoc); + if (!policy_mgr_ctx) { + policy_mgr_err("invalid context"); + return QDF_STATUS_E_FAILURE; + } + + policy_mgr_ctx->pdev = NULL; + + return QDF_STATUS_SUCCESS; +} + static QDF_STATUS policy_mgr_vdev_obj_create_cb(struct wlan_objmgr_vdev *vdev, void *data) { @@ -134,6 +170,24 @@ QDF_STATUS policy_mgr_init(void) goto err_psoc_status; } + status = wlan_objmgr_register_pdev_create_handler( + WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_pdev_obj_create_cb, + NULL); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("Failed to register pdev obj create cback"); + goto err_pdev_create; + } + + status = wlan_objmgr_register_pdev_destroy_handler( + WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_pdev_obj_destroy_cb, + NULL); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("Failed to register pdev obj delete cback"); + goto err_pdev_delete; + } + status = wlan_objmgr_register_vdev_create_handler( WLAN_UMAC_COMP_POLICY_MGR, policy_mgr_vdev_obj_create_cb, @@ -167,19 +221,32 @@ QDF_STATUS policy_mgr_init(void) err_vdev_status: wlan_objmgr_unregister_vdev_destroy_handler(WLAN_UMAC_COMP_POLICY_MGR, - policy_mgr_vdev_obj_destroy_cb, NULL); + policy_mgr_vdev_obj_destroy_cb, + NULL); err_vdev_delete: wlan_objmgr_unregister_vdev_create_handler(WLAN_UMAC_COMP_POLICY_MGR, - policy_mgr_vdev_obj_create_cb, NULL); + policy_mgr_vdev_obj_create_cb, + NULL); err_vdev_create: + wlan_objmgr_unregister_pdev_destroy_handler(WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_pdev_obj_destroy_cb, + NULL); +err_pdev_delete: + wlan_objmgr_unregister_pdev_create_handler(WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_pdev_obj_create_cb, + NULL); +err_pdev_create: wlan_objmgr_unregister_psoc_status_handler(WLAN_UMAC_COMP_POLICY_MGR, - policy_mgr_psoc_obj_status_cb, NULL); + policy_mgr_psoc_obj_status_cb, + NULL); err_psoc_status: wlan_objmgr_unregister_psoc_destroy_handler(WLAN_UMAC_COMP_POLICY_MGR, - policy_mgr_psoc_obj_destroy_cb, NULL); + policy_mgr_psoc_obj_destroy_cb, + NULL); err_psoc_delete: wlan_objmgr_unregister_psoc_create_handler(WLAN_UMAC_COMP_POLICY_MGR, - policy_mgr_psoc_obj_create_cb, NULL); + policy_mgr_psoc_obj_create_cb, + NULL); err_psoc_create: return status; } @@ -188,12 +255,12 @@ QDF_STATUS policy_mgr_deinit(void) { QDF_STATUS status; - status = wlan_objmgr_unregister_psoc_create_handler( + status = wlan_objmgr_unregister_psoc_status_handler( WLAN_UMAC_COMP_POLICY_MGR, - policy_mgr_psoc_obj_create_cb, + policy_mgr_psoc_obj_status_cb, NULL); if (status != QDF_STATUS_SUCCESS) - policy_mgr_err("Failed to deregister psoc obj create cback"); + policy_mgr_err("Failed to deregister psoc obj status cback"); status = wlan_objmgr_unregister_psoc_destroy_handler( WLAN_UMAC_COMP_POLICY_MGR, @@ -202,19 +269,33 @@ QDF_STATUS policy_mgr_deinit(void) if (status != QDF_STATUS_SUCCESS) policy_mgr_err("Failed to deregister psoc obj delete cback"); - status = wlan_objmgr_unregister_psoc_status_handler( + status = wlan_objmgr_unregister_psoc_create_handler( WLAN_UMAC_COMP_POLICY_MGR, - policy_mgr_psoc_obj_status_cb, + policy_mgr_psoc_obj_create_cb, NULL); if (status != QDF_STATUS_SUCCESS) - policy_mgr_err("Failed to deregister psoc obj status cback"); + policy_mgr_err("Failed to deregister psoc obj create cback"); - status = wlan_objmgr_unregister_vdev_create_handler( + status = wlan_objmgr_unregister_pdev_destroy_handler( WLAN_UMAC_COMP_POLICY_MGR, - policy_mgr_vdev_obj_create_cb, + policy_mgr_pdev_obj_destroy_cb, NULL); if (status != QDF_STATUS_SUCCESS) - policy_mgr_err("Failed to deregister vdev obj create cback"); + policy_mgr_err("Failed to deregister pdev obj delete cback"); + + status = wlan_objmgr_unregister_pdev_create_handler( + WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_pdev_obj_create_cb, + NULL); + if (status != QDF_STATUS_SUCCESS) + policy_mgr_err("Failed to deregister pdev obj create cback"); + + status = wlan_objmgr_unregister_vdev_status_handler( + WLAN_UMAC_COMP_POLICY_MGR, + policy_mgr_vdev_obj_status_cb, + NULL); + if (status != QDF_STATUS_SUCCESS) + policy_mgr_err("Failed to deregister vdev obj status cback"); status = wlan_objmgr_unregister_vdev_destroy_handler( WLAN_UMAC_COMP_POLICY_MGR, @@ -223,12 +304,12 @@ QDF_STATUS policy_mgr_deinit(void) if (status != QDF_STATUS_SUCCESS) policy_mgr_err("Failed to deregister vdev obj delete cback"); - status = wlan_objmgr_unregister_vdev_status_handler( + status = wlan_objmgr_unregister_vdev_create_handler( WLAN_UMAC_COMP_POLICY_MGR, - policy_mgr_vdev_obj_status_cb, + policy_mgr_vdev_obj_create_cb, NULL); if (status != QDF_STATUS_SUCCESS) - policy_mgr_err("Failed to deregister vdev obj status cback"); + policy_mgr_err("Failed to deregister vdev obj create cback"); policy_mgr_info("deregistered callbacks with obj mgr successfully"); diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index edc96138353e..364bced7357d 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -140,16 +140,18 @@ void policy_mgr_update_with_safe_channel_list(uint8_t *pcl_channels, } static QDF_STATUS policy_mgr_modify_pcl_based_on_enabled_channels( - uint8_t *pcl_list_org, - uint8_t *weight_list_org, - uint32_t *pcl_len_org) + struct policy_mgr_psoc_priv_obj *pm_ctx, + uint8_t *pcl_list_org, + uint8_t *weight_list_org, + uint32_t *pcl_len_org) { uint32_t i, pcl_len = 0; uint8_t pcl_list[QDF_MAX_NUM_CHAN]; uint8_t weight_list[QDF_MAX_NUM_CHAN]; for (i = 0; i < *pcl_len_org; i++) { - if (!wlan_reg_is_passive_or_disable_ch(pcl_list_org[i])) { + if (!wlan_reg_is_passive_or_disable_ch( + pm_ctx->pdev, pcl_list_org[i])) { pcl_list[pcl_len] = pcl_list_org[i]; weight_list[pcl_len++] = weight_list_org[i]; } @@ -320,7 +322,7 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, if (mode == PM_P2P_GO_MODE) { status = policy_mgr_modify_pcl_based_on_enabled_channels( - pcl_channels, pcl_weight, len); + pm_ctx, pcl_channels, pcl_weight, len); if (QDF_IS_STATUS_ERROR(status)) { policy_mgr_err("failed to get modified pcl for GO"); return status; @@ -1104,6 +1106,7 @@ policy_mgr_get_nondfs_preferred_channel(struct wlan_objmgr_psoc *psoc, { uint8_t pcl_channels[QDF_MAX_NUM_CHAN]; uint8_t pcl_weight[QDF_MAX_NUM_CHAN]; + struct policy_mgr_psoc_priv_obj *pm_ctx; /* * in worst case if we can't find any channel at all @@ -1113,6 +1116,12 @@ policy_mgr_get_nondfs_preferred_channel(struct wlan_objmgr_psoc *psoc, uint8_t channel = PM_24_GHZ_CHANNEL_6; uint32_t i, pcl_len; + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return channel; + } + if (true == for_existing_conn) { /* * First try to see if there is any non-dfs channel already @@ -1136,7 +1145,7 @@ policy_mgr_get_nondfs_preferred_channel(struct wlan_objmgr_psoc *psoc, } for (i = 0; i < pcl_len; i++) { - if (wlan_reg_is_dfs_ch(psoc, pcl_channels[i])) { + if (wlan_reg_is_dfs_ch(pm_ctx->pdev, pcl_channels[i])) { continue; } else { channel = pcl_channels[i]; From c81d3750b006dfcffc04ade4e6a8ae97d2ddeb24 Mon Sep 17 00:00:00 2001 From: Kabilan Kannan Date: Tue, 28 Feb 2017 20:28:54 -0800 Subject: [PATCH 031/187] qcacmn: Add sta connect/disconnect in TDLS UMAC component Add sta connection and disconnection event related methods into TDLS component Change-Id: I1309792cf68df87b1ecf5a7686ac645ac21d1c7c CRs-Fixed: 2034220 --- inc/wlan_policy_mgr_api.h | 4 ++-- src/wlan_policy_mgr_get_set_utils.c | 13 +++++++------ src/wlan_policy_mgr_init_deinit.c | 8 ++++---- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 3eb4a5815880..fd618266564f 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -796,8 +796,8 @@ struct policy_mgr_hdd_cbacks { * @check_is_tdls_allowed: check if tdls allowed or not */ struct policy_mgr_tdls_cbacks { - void (*set_tdls_ct_mode)(struct wlan_objmgr_psoc *psoc); - bool (*check_is_tdls_allowed)(enum tQDF_ADAPTER_MODE device_mode); + void (*tdls_notify_increment_session)(struct wlan_objmgr_psoc *psoc); + void (*tdls_notify_decrement_session)(struct wlan_objmgr_psoc *psoc); }; /** diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 771f7e37442c..46cb04661818 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1114,9 +1114,10 @@ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); } - /* set tdls connection tracker state */ - if (pm_ctx->tdls_cbacks.set_tdls_ct_mode) - pm_ctx->tdls_cbacks.set_tdls_ct_mode(psoc); + /* Notify tdls */ + if (pm_ctx->tdls_cbacks.tdls_notify_increment_session) + pm_ctx->tdls_cbacks.tdls_notify_increment_session(psoc); + policy_mgr_dump_current_concurrency(psoc); qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); @@ -1152,9 +1153,9 @@ void policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, policy_mgr_decr_connection_count(psoc, session_id); - /* set tdls connection tracker state */ - if (pm_ctx->tdls_cbacks.set_tdls_ct_mode) - pm_ctx->tdls_cbacks.set_tdls_ct_mode(psoc); + /* Notify tdls */ + if (pm_ctx->tdls_cbacks.tdls_notify_decrement_session) + pm_ctx->tdls_cbacks.tdls_notify_decrement_session(psoc); policy_mgr_dump_current_concurrency(psoc); } diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 9c2fde0ae2d3..dcf5d882f3b4 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -605,10 +605,10 @@ QDF_STATUS policy_mgr_register_tdls_cb(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_FAILURE; } - pm_ctx->tdls_cbacks.check_is_tdls_allowed = - tdls_cbacks->check_is_tdls_allowed; - pm_ctx->tdls_cbacks.set_tdls_ct_mode = - tdls_cbacks->set_tdls_ct_mode; + pm_ctx->tdls_cbacks.tdls_notify_increment_session = + tdls_cbacks->tdls_notify_increment_session; + pm_ctx->tdls_cbacks.tdls_notify_decrement_session = + tdls_cbacks->tdls_notify_decrement_session; return QDF_STATUS_SUCCESS; } From fe5117036d3b07e16918169b73f2991f6603fedf Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Mon, 24 Apr 2017 15:21:59 -0700 Subject: [PATCH 032/187] qcacmn: Fix next action status in policy manager for SBS The next action function to reflect the SBS capability in its status correctly. If SBS is not supported the second connection should proceed, without waiting for a HW mode change to SBS. Change-Id: I99eee6c854c6a1605f1c5b7655773818811f19ea CRs-Fixed: 2021512 --- src/wlan_policy_mgr_action.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 84d4c67d1410..0e5f64b55b00 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -450,7 +450,7 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, if (!policy_mgr_is_hw_sbs_capable(psoc)) { /* No action */ policy_mgr_notice("firmware is not sbs capable"); - return QDF_STATUS_SUCCESS; + return QDF_STATUS_E_NOSUPPORT; } /* check if current mode is already SBS nothing to be * done From 590c40f63be0270a9ed5ad159cf6d33ba7cc829d Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Thu, 27 Apr 2017 11:49:06 -0700 Subject: [PATCH 033/187] qcacmn: Fix memory leak at policy manager initialization Fix memory leak in policy manager init/deinit sequence. Change-Id: I3c1728f2becb16b415f532acf657c7c29dc76122 CRs-Fixed: 2009818 --- src/wlan_policy_mgr_init_deinit.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index dcf5d882f3b4..55957cf61333 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -324,7 +324,20 @@ QDF_STATUS policy_mgr_psoc_open(struct wlan_objmgr_psoc *psoc) QDF_STATUS policy_mgr_psoc_close(struct wlan_objmgr_psoc *psoc) { - /* placeholder for now */ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + if (pm_ctx->hw_mode.hw_mode_list) { + qdf_mem_free(pm_ctx->hw_mode.hw_mode_list); + pm_ctx->hw_mode.hw_mode_list = NULL; + policy_mgr_info("HW list is freed"); + } + return QDF_STATUS_SUCCESS; } @@ -427,12 +440,6 @@ QDF_STATUS policy_mgr_psoc_disable(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_E_FAILURE; } - if (pm_ctx->hw_mode.hw_mode_list) { - qdf_mem_free(pm_ctx->hw_mode.hw_mode_list); - pm_ctx->hw_mode.hw_mode_list = NULL; - policy_mgr_info("HW list is freed"); - } - if (!QDF_IS_STATUS_SUCCESS(qdf_mutex_destroy( &pm_ctx->qdf_conc_list_lock))) { policy_mgr_err("Failed to destroy qdf_conc_list_lock"); From d7655cae83ac3cf9d91fb85d9bc9342fc12adadb Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Wed, 26 Apr 2017 12:58:42 -0700 Subject: [PATCH 034/187] qcacmn: Add missing ini configurations to policy manager Add missing ini configurations to be used in policy manager. Change-Id: Id94c017f3c96ef0376028d124b11fd48ee24fe7e CRs-Fixed: 2009818 --- inc/wlan_policy_mgr_public_struct.h | 4 ++++ src/wlan_policy_mgr_core.c | 10 +++++++++- src/wlan_policy_mgr_get_set_utils.c | 14 +++++++++++--- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 4a3bf4b961df..dde1b65ddd0b 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -981,11 +981,15 @@ struct dual_mac_config { * connections * @conc_system_pref: System preference for PCL table * @enable2x2: 2x2 chain mask user config + * @mcc_to_scc_switch_mode: Control SAP channel in concurrency + * @sub_20_mhz_enabled: Is 5 or 10 Mhz enabled */ struct policy_mgr_user_cfg { uint8_t enable_mcc_adaptive_scheduler; uint8_t max_concurrent_active_sessions; uint8_t conc_system_pref; bool enable2x2; + uint32_t mcc_to_scc_switch_mode; + bool sub_20_mhz_enabled; }; #endif /* __WLAN_POLICY_MGR_PUBLIC_STRUCT_H */ diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 546bfdd4a16f..03fc3396196d 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -147,7 +147,15 @@ bool policy_mgr_is_dual_mac_disabled_in_ini( uint32_t policy_mgr_mcc_to_scc_switch_mode_in_user_cfg( struct wlan_objmgr_psoc *psoc) { - return 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return 0; + } + + return pm_ctx->user_cfg.mcc_to_scc_switch_mode; } /** diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 46cb04661818..380dae5a07d7 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1419,9 +1419,17 @@ bool policy_mgr_max_concurrent_connections_reached( return false; } -static bool policy_mgr_is_sub_20_mhz_enabled(void) +static bool policy_mgr_is_sub_20_mhz_enabled(struct wlan_objmgr_psoc *psoc) { - return false; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return false; + } + + return pm_ctx->user_cfg.sub_20_mhz_enabled; } bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, @@ -1453,7 +1461,7 @@ bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, /* find the current connection state from pm_conc_connection_list*/ num_connections = policy_mgr_get_connection_count(psoc); - if (num_connections && policy_mgr_is_sub_20_mhz_enabled()) { + if (num_connections && policy_mgr_is_sub_20_mhz_enabled(psoc)) { policy_mgr_err("dont allow concurrency if Sub 20 MHz is enabled"); status = false; goto done; From c65575e5437b002564ee2acc0ec9a4fb061aa222 Mon Sep 17 00:00:00 2001 From: Ajit Pal Singh Date: Mon, 17 Apr 2017 16:49:01 +0530 Subject: [PATCH 035/187] qcacmn: Add API to check Do Not Break Stream eligibility 1) Adds new policy mgr API 'policy_mgr_is_chan_ok_for_dnbs' to check if a channel is OK for "Do Not Break Stream". It means that if Do_Not_Switch_Channel is set for AP/GO vdev, the channel passed should be either the AP/GO channel or a channel from the other band. 2) Adds a new function policy_mgr_get_mode_specific_conn_info() to get the mode specific connection count. Change-Id: I4da6f7d56d01b01761a5f3557b8acbb84226a6fd CRs-Fixed: 2037302 --- inc/wlan_policy_mgr_api.h | 14 +++++ src/wlan_policy_mgr_get_set_utils.c | 87 +++++++++++++++++++++++++++-- src/wlan_policy_mgr_i.h | 28 ++++++++++ src/wlan_policy_mgr_pcl.c | 42 ++++++++++++++ 4 files changed, 166 insertions(+), 5 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index fd618266564f..783bf78d165d 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1845,4 +1845,18 @@ void policy_mgr_update_old_hw_mode_index(struct wlan_objmgr_psoc *psoc, */ void policy_mgr_update_new_hw_mode_index(struct wlan_objmgr_psoc *psoc, uint32_t new_hw_mode_index); + +/** + * policy_mgr_is_chan_ok_for_dnbs() - Function to check if a channel + * is OK for "Do Not Break Stream" + * @psoc: PSOC object information + * @channel: Channel to check. + * @ok: Pointer to flag in which status will be stored + * This function checks if a channel is OK for + * "Do Not Break Stream" + * Return: SUCCESS or FAILURE + */ +QDF_STATUS policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc, + uint8_t channel, bool *ok); + #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 380dae5a07d7..9c2f9054e491 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -39,6 +39,8 @@ #include "qdf_types.h" #include "qdf_trace.h" #include "wlan_objmgr_global_obj.h" +#include "wlan_objmgr_pdev_obj.h" +#include "wlan_objmgr_vdev_obj.h" /* invalid channel id. */ #define INVALID_CHANNEL_ID 0 @@ -1355,9 +1357,11 @@ bool policy_mgr_is_ibss_conn_exist(struct wlan_objmgr_psoc *psoc, return status; } -bool policy_mgr_get_sap_conn_info(struct wlan_objmgr_psoc *psoc, - uint8_t *channel, uint8_t *vdev_id) +bool policy_mgr_get_mode_specific_conn_info(struct wlan_objmgr_psoc *psoc, + uint8_t *channel, uint8_t *vdev_id, + enum policy_mgr_con_mode mode) { + uint32_t count, index = 0; uint32_t list[MAX_NUMBER_OF_CONC_CONNECTIONS]; bool status = false; @@ -1374,10 +1378,10 @@ bool policy_mgr_get_sap_conn_info(struct wlan_objmgr_psoc *psoc, } count = policy_mgr_mode_specific_connection_count( - psoc, PM_SAP_MODE, list); + psoc, mode, list); qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); if (count == 0) { - policy_mgr_err("No SAP connection"); + policy_mgr_err("No mode:[%d] connection", mode); status = false; } else if (count == 1) { *channel = pm_conc_connection_list[list[index]].chan; @@ -1393,7 +1397,8 @@ bool policy_mgr_get_sap_conn_info(struct wlan_objmgr_psoc *psoc, *channel = pm_conc_connection_list[list[index]].chan; *vdev_id = pm_conc_connection_list[list[index]].vdev_id; - policy_mgr_notice("Multiple SAP connections, picking first one"); + policy_mgr_notice("Multiple mode:[%d] connections, picking first one", + mode); status = true; } qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); @@ -1401,6 +1406,15 @@ bool policy_mgr_get_sap_conn_info(struct wlan_objmgr_psoc *psoc, return status; } +bool policy_mgr_get_sap_conn_info(struct wlan_objmgr_psoc *psoc, + uint8_t *channel, uint8_t *vdev_id) +{ + return policy_mgr_get_mode_specific_conn_info(psoc, + channel, + vdev_id, + PM_SAP_MODE); +} + bool policy_mgr_max_concurrent_connections_reached( struct wlan_objmgr_psoc *psoc) { @@ -2358,3 +2372,66 @@ bool policy_mgr_is_hw_mode_change_after_vdev_up(struct wlan_objmgr_psoc *psoc) return flag; } + +bool policy_mgr_vdev_mlme_is_dnsc_set(struct wlan_objmgr_vdev *vdev) +{ + /* TODO : Check Dont_Switch_Channel status from vdev mlme caps*/ + return false; +} + +QDF_STATUS policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc, + uint8_t channel, bool *ok) +{ + uint8_t operating_channel = 0, vdev_id = 0; + struct wlan_objmgr_vdev *vdev; + + if (!channel || !ok) { + policy_mgr_err("Invalid parameter"); + return QDF_STATUS_E_INVAL; + } + + if (policy_mgr_get_mode_specific_conn_info(psoc, + &operating_channel, + &vdev_id, + PM_SAP_MODE)) + policy_mgr_debug("SAP mode active"); + else if (policy_mgr_get_mode_specific_conn_info(psoc, + &operating_channel, + &vdev_id, + PM_P2P_GO_MODE)) + policy_mgr_debug("P2P_GO_MODE mode active"); + else { + *ok = true; + return QDF_STATUS_SUCCESS; + } + + vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id, + WLAN_POLICY_MGR_ID); + if (!vdev) { + policy_mgr_err("vdev is NULL"); + return QDF_STATUS_E_INVAL; + } + + /** + * If channel passed is same as AP/GO operating channel, then + * return true. + * If channel is different from operating channel but in same band. + * return false. + * If operating channel in different band. + * return true. + */ + /* TODO: To be enhanced for SBS */ + if (policy_mgr_vdev_mlme_is_dnsc_set(vdev)) { + if (operating_channel == channel) + *ok = true; + else if (WLAN_REG_IS_SAME_BAND_CHANNELS(operating_channel, + channel)) + *ok = false; + else + *ok = true; + } else { + *ok = true; + } + wlan_objmgr_vdev_release_ref(vdev, WLAN_POLICY_MGR_ID); + return QDF_STATUS_SUCCESS; +} diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 8dd4e4ddb457..9a48a16fc32e 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -398,4 +398,32 @@ QDF_STATUS policy_mgr_reset_sap_mandatory_channels( */ bool policy_mgr_get_sap_conn_info(struct wlan_objmgr_psoc *psoc, uint8_t *channel, uint8_t *vdev_id); + +/** + * policy_mgr_get_mode_specific_conn_info() - Get active mode specific + * channel and vdev id + * @psoc: PSOC object information + * @channel: Mode specific channel + * @vdev_id: Mode specific vdev id + * @mode: Connection Mode + * + * Get active mode specific channel and vdev id + * + * Return: true for success, else false + */ +bool policy_mgr_get_mode_specific_conn_info(struct wlan_objmgr_psoc *psoc, + uint8_t *channel, uint8_t *vdev_id, + enum policy_mgr_con_mode mode); + +/** + * policy_mgr_vdev_mlme_is_dnsc_set - Check if user has set + * "Do_Not_Switch_Channel" for this vdev + * @vdev: vdev pointer + * + * Get "Do_Not_Switch_Channel" setting for this vdev + * + * Return: true for success, else false + */ +bool policy_mgr_vdev_mlme_is_dnsc_set(struct wlan_objmgr_vdev *vdev); + #endif diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 364bced7357d..88f35b2ad34e 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -166,6 +166,41 @@ static QDF_STATUS policy_mgr_modify_pcl_based_on_enabled_channels( return QDF_STATUS_SUCCESS; } +static QDF_STATUS policy_mgr_modify_pcl_based_on_dnbs( + struct wlan_objmgr_psoc *psoc, + uint8_t *pcl_list_org, + uint8_t *weight_list_org, + uint32_t *pcl_len_org) +{ + uint32_t i, pcl_len = 0; + uint8_t pcl_list[QDF_MAX_NUM_CHAN]; + uint8_t weight_list[QDF_MAX_NUM_CHAN]; + bool ok; + int ret; + + for (i = 0; i < *pcl_len_org; i++) { + ret = policy_mgr_is_chan_ok_for_dnbs(psoc, pcl_list_org[i], + &ok); + + if (QDF_IS_STATUS_ERROR(ret)) { + policy_mgr_err("Not able to check DNBS eligibility"); + return ret; + } + if (ok) { + pcl_list[pcl_len] = pcl_list_org[i]; + weight_list[pcl_len++] = weight_list_org[i]; + } + } + + qdf_mem_zero(pcl_list_org, QDF_ARRAY_SIZE(pcl_list_org)); + qdf_mem_zero(weight_list_org, QDF_ARRAY_SIZE(weight_list_org)); + qdf_mem_copy(pcl_list_org, pcl_list, pcl_len); + qdf_mem_copy(weight_list_org, weight_list, pcl_len); + *pcl_len_org = pcl_len; + + return QDF_STATUS_SUCCESS; +} + uint8_t policy_mgr_get_channel(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, uint32_t *vdev_id) { @@ -333,6 +368,13 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, pcl_channels[i], pcl_weight[i]); } + status = policy_mgr_modify_pcl_based_on_dnbs(psoc, pcl_channels, + pcl_weight, len); + + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("failed to get modified pcl based on DNBS"); + return status; + } return QDF_STATUS_SUCCESS; } From 31eb12c1b285b010952939801ae46bd711890b3f Mon Sep 17 00:00:00 2001 From: Vikrampal Date: Fri, 28 Apr 2017 17:44:30 +0530 Subject: [PATCH 036/187] qcacmn: Modify H/w DBS cap check and fetch NSS Modify API policy_mgr_is_hw_dbs_2x2_capable() to check H/w DBS capability and check if downgrading needed while entering DBS. Define a new API policy_mgr_get_hw_dbs_nss() to get NSS information of both MAC0 and MAC1. Change-Id: If24817017f675e45197d060cd75317aa381256de CRs-Fixed: 2037487 --- inc/wlan_policy_mgr_api.h | 14 ++++- inc/wlan_policy_mgr_public_struct.h | 10 ++++ src/wlan_policy_mgr_action.c | 30 ++++------ src/wlan_policy_mgr_get_set_utils.c | 91 ++++++++++++++++++----------- 4 files changed, 92 insertions(+), 53 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 783bf78d165d..803f0df633e9 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1485,7 +1485,7 @@ bool policy_mgr_is_current_hwmode_dbs(struct wlan_objmgr_psoc *psoc); * policy_mgr_is_hw_dbs_2x2_capable() - if hardware is capable of dbs 2x2 * @psoc: PSOC object information * This function checks if hw_modes supported are always capable of - * DBS 2x2. + * DBS and there is no need for downgrading while entering DBS. * true: DBS 2x2 can always be supported * false: hw_modes support DBS 1x1 as well * @@ -1859,4 +1859,16 @@ void policy_mgr_update_new_hw_mode_index(struct wlan_objmgr_psoc *psoc, QDF_STATUS policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc, uint8_t channel, bool *ok); +/** + * policy_mgr_get_hw_dbs_nss() - Computes DBS NSS + * @psoc: PSOC object information + * @nss_dbs: NSS info of both MAC0 and MAC1 + * This function computes NSS info of both MAC0 and MAC1 + * True: DBS capable + * False: not DBS capable + * + * Return: True or False + */ +bool policy_mgr_get_hw_dbs_nss(struct wlan_objmgr_psoc *psoc, + struct dbs_nss *nss_dbs); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index dde1b65ddd0b..156e4c6ef677 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -992,4 +992,14 @@ struct policy_mgr_user_cfg { uint32_t mcc_to_scc_switch_mode; bool sub_20_mhz_enabled; }; + +/** + * struct dbs_nss - Number of spatial streams in DBS mode + * @mac0_ss: Number of spatial streams on MAC0 + * @mac1_ss: Number of spatial streams on MAC1 + */ +struct dbs_nss { + enum hw_mode_ss_config mac0_ss; + enum hw_mode_ss_config mac1_ss; +}; #endif /* __WLAN_POLICY_MGR_PUBLIC_STRUCT_H */ diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 0e5f64b55b00..a8d34b62bbd4 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -422,6 +422,7 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, { QDF_STATUS status = QDF_STATUS_E_FAILURE; struct policy_mgr_hw_mode_params hw_mode; + struct dbs_nss nss_dbs; if (policy_mgr_is_hw_dbs_capable(psoc) == false) { policy_mgr_err("driver isn't dbs capable, no further action needed"); @@ -469,24 +470,17 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, PM_DBS, reason, session_id); break; case PM_DBS: - if (policy_mgr_is_hw_dbs_2x2_capable(psoc)) - status = policy_mgr_pdev_set_hw_mode(psoc, session_id, - HW_MODE_SS_2x2, - HW_MODE_80_MHZ, - HW_MODE_SS_2x2, HW_MODE_40_MHZ, - HW_MODE_DBS, - HW_MODE_AGILE_DFS_NONE, - HW_MODE_SBS_NONE, - reason); - else - status = policy_mgr_pdev_set_hw_mode(psoc, session_id, - HW_MODE_SS_1x1, - HW_MODE_80_MHZ, - HW_MODE_SS_1x1, HW_MODE_40_MHZ, - HW_MODE_DBS, - HW_MODE_AGILE_DFS_NONE, - HW_MODE_SBS_NONE, - reason); + (void)policy_mgr_get_hw_dbs_nss(psoc, &nss_dbs); + + status = policy_mgr_pdev_set_hw_mode(psoc, session_id, + nss_dbs.mac0_ss, + HW_MODE_80_MHZ, + nss_dbs.mac1_ss, + HW_MODE_40_MHZ, + HW_MODE_DBS, + HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS_NONE, + reason); break; case PM_SINGLE_MAC_UPGRADE: /* diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 9c2f9054e491..9af7f9cda062 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -752,43 +752,18 @@ bool policy_mgr_is_dbs_enable(struct wlan_objmgr_psoc *psoc) bool policy_mgr_is_hw_dbs_2x2_capable(struct wlan_objmgr_psoc *psoc) { - int i, param; - uint32_t dbs, tx_chain0, rx_chain0, tx_chain1, rx_chain1; - uint32_t final_min_rf_chains = 2; - uint32_t min_rf_chains, min_mac0_rf_chains, min_mac1_rf_chains; - bool is_dbs_found = false; - struct policy_mgr_psoc_priv_obj *pm_ctx; + uint32_t max_rf_chains, final_min_rf_chains = HW_MODE_SS_2x2; + struct dbs_nss nss_dbs; - pm_ctx = policy_mgr_get_context(psoc); - if (!pm_ctx) { - policy_mgr_err("Invalid Context"); - return false; + if (policy_mgr_get_hw_dbs_nss(psoc, &nss_dbs)) { + max_rf_chains = QDF_MAX(nss_dbs.mac0_ss, nss_dbs.mac1_ss); + final_min_rf_chains + = QDF_MIN(final_min_rf_chains, max_rf_chains); + } else { + final_min_rf_chains = HW_MODE_SS_0x0; } - for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { - param = pm_ctx->hw_mode.hw_mode_list[i]; - tx_chain0 = POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_GET(param); - rx_chain0 = POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_GET(param); - dbs = POLICY_MGR_HW_MODE_DBS_MODE_GET(param); - tx_chain1 = POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_GET(param); - rx_chain1 = POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_GET(param); - - if (dbs) { - min_mac0_rf_chains = QDF_MIN(tx_chain0, rx_chain0); - min_mac1_rf_chains = QDF_MIN(tx_chain1, rx_chain1); - min_rf_chains = QDF_MIN(min_mac0_rf_chains, - min_mac1_rf_chains); - is_dbs_found = true; - } else { - continue; - } - final_min_rf_chains = QDF_MIN(final_min_rf_chains, - min_rf_chains); - } - if (false == is_dbs_found) - final_min_rf_chains = 0; - - return (final_min_rf_chains == 2) ? true : false; + return (final_min_rf_chains == HW_MODE_SS_2x2) ? true : false; } uint32_t policy_mgr_get_connection_count(struct wlan_objmgr_psoc *psoc) @@ -2435,3 +2410,51 @@ QDF_STATUS policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc, wlan_objmgr_vdev_release_ref(vdev, WLAN_POLICY_MGR_ID); return QDF_STATUS_SUCCESS; } + +bool policy_mgr_get_hw_dbs_nss(struct wlan_objmgr_psoc *psoc, + struct dbs_nss *nss_dbs) +{ + int i, param; + uint32_t dbs, tx_chain0, rx_chain0, tx_chain1, rx_chain1; + uint32_t min_mac0_rf_chains, min_mac1_rf_chains; + bool is_dbs_found = false; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) + policy_mgr_err("Invalid Context"); + + for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { + param = pm_ctx->hw_mode.hw_mode_list[i]; + dbs = POLICY_MGR_HW_MODE_DBS_MODE_GET(param); + + if (dbs) { + tx_chain0 + = POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_GET(param); + rx_chain0 + = POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_GET(param); + + tx_chain1 + = POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_GET(param); + rx_chain1 + = POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_GET(param); + + min_mac0_rf_chains = QDF_MIN(tx_chain0, rx_chain0); + min_mac1_rf_chains = QDF_MIN(tx_chain1, rx_chain1); + + nss_dbs->mac0_ss + = (min_mac0_rf_chains == 2) + ? HW_MODE_SS_2x2 : HW_MODE_SS_1x1; + + nss_dbs->mac1_ss + = (min_mac1_rf_chains == 2) + ? HW_MODE_SS_2x2 : HW_MODE_SS_1x1; + + is_dbs_found = true; + } else { + continue; + } + } + + return is_dbs_found; +} From 9647e35f73c0fdf251937161fc3f503a02a8332e Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Tue, 25 Apr 2017 13:37:25 -0700 Subject: [PATCH 037/187] qcacmn: Filter PCL with NOL Filter the PCL with NOL before providing to the requester to avoid including radar channels in PCL. Change-Id: I915572f6653a6c9c98cb525c03570543cfc86e12 CRs-Fixed: 2009818 --- src/wlan_policy_mgr_pcl.c | 150 +++++++++++++++++++++++++++++++------- 1 file changed, 125 insertions(+), 25 deletions(-) diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 88f35b2ad34e..ad0b2c9d0684 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -235,6 +235,127 @@ uint8_t policy_mgr_get_channel(struct wlan_objmgr_psoc *psoc, return 0; } +static QDF_STATUS policy_mgr_modify_sap_pcl_based_on_nol( + struct wlan_objmgr_psoc *psoc, + uint8_t *pcl_list_org, + uint8_t *weight_list_org, + uint32_t *pcl_len_org) +{ + uint32_t i, pcl_len = 0; + uint8_t pcl_list[QDF_MAX_NUM_CHAN]; + uint8_t weight_list[QDF_MAX_NUM_CHAN]; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + for (i = 0; i < *pcl_len_org; i++) { + if (!wlan_reg_is_disable_ch(pm_ctx->pdev, pcl_list_org[i])) { + pcl_list[pcl_len] = pcl_list_org[i]; + weight_list[pcl_len++] = weight_list_org[i]; + } + } + + qdf_mem_zero(pcl_list_org, QDF_ARRAY_SIZE(pcl_list_org)); + qdf_mem_zero(weight_list_org, QDF_ARRAY_SIZE(weight_list_org)); + qdf_mem_copy(pcl_list_org, pcl_list, pcl_len); + qdf_mem_copy(weight_list_org, weight_list, pcl_len); + *pcl_len_org = pcl_len; + + return QDF_STATUS_SUCCESS; +} + +static QDF_STATUS policy_mgr_pcl_modification_for_sap( + struct wlan_objmgr_psoc *psoc, + uint8_t *pcl_channels, uint8_t *pcl_weight, + uint32_t *len) +{ + QDF_STATUS status = QDF_STATUS_E_FAILURE; + uint32_t i; + + if (policy_mgr_is_sap_mandatory_channel_set(psoc)) { + status = policy_mgr_modify_sap_pcl_based_on_mandatory_channel( + psoc, pcl_channels, pcl_weight, len); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("failed to get modified pcl for SAP"); + return status; + } + policy_mgr_debug("modified pcl len:%d", *len); + for (i = 0; i < *len; i++) + policy_mgr_debug("chan:%d weight:%d", + pcl_channels[i], pcl_weight[i]); + } + + status = policy_mgr_modify_sap_pcl_based_on_nol( + psoc, pcl_channels, pcl_weight, len); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("failed to get modified pcl for SAP"); + return status; + } + policy_mgr_debug("modified pcl len:%d", *len); + for (i = 0; i < *len; i++) + policy_mgr_debug("chan:%d weight:%d", + pcl_channels[i], pcl_weight[i]); + + return QDF_STATUS_SUCCESS; +} + +static QDF_STATUS policy_mgr_pcl_modification_for_p2p_go( + struct wlan_objmgr_psoc *psoc, + uint8_t *pcl_channels, uint8_t *pcl_weight, + uint32_t *len) +{ + QDF_STATUS status = QDF_STATUS_E_FAILURE; + struct policy_mgr_psoc_priv_obj *pm_ctx; + uint32_t i; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("context is NULL"); + return status; + } + + status = policy_mgr_modify_pcl_based_on_enabled_channels( + pm_ctx, pcl_channels, pcl_weight, len); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("failed to get modified pcl for GO"); + return status; + } + policy_mgr_debug("modified pcl len:%d", *len); + for (i = 0; i < *len; i++) + policy_mgr_debug("chan:%d weight:%d", + pcl_channels[i], pcl_weight[i]); + + return QDF_STATUS_SUCCESS; +} + +static QDF_STATUS policy_mgr_mode_specific_modification_on_pcl( + struct wlan_objmgr_psoc *psoc, + uint8_t *pcl_channels, uint8_t *pcl_weight, + uint32_t *len, enum policy_mgr_con_mode mode) +{ + QDF_STATUS status = QDF_STATUS_E_FAILURE; + + switch (mode) { + case PM_SAP_MODE: + status = policy_mgr_pcl_modification_for_sap( + psoc, pcl_channels, pcl_weight, len); + break; + case PM_P2P_GO_MODE: + status = policy_mgr_pcl_modification_for_p2p_go( + psoc, pcl_channels, pcl_weight, len); + break; + default: + policy_mgr_err("unexpected mode %d", mode); + break; + } + + return status; +} + QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, uint8_t *pcl_channels, uint32_t *len, @@ -340,33 +461,12 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, pcl_channels[i], pcl_weight[i]); } - if ((mode == PM_SAP_MODE) && - policy_mgr_is_sap_mandatory_channel_set(psoc)) { - status = policy_mgr_modify_sap_pcl_based_on_mandatory_channel( - psoc, pcl_channels, pcl_weight, len); - if (QDF_IS_STATUS_ERROR(status)) { - policy_mgr_err("failed to get modified pcl for SAP"); - return status; - } - policy_mgr_debug("modified pcl len:%d", *len); - for (i = 0; i < *len; i++) - policy_mgr_debug("chan:%d weight:%d", - pcl_channels[i], pcl_weight[i]); + policy_mgr_mode_specific_modification_on_pcl( + psoc, pcl_channels, pcl_weight, len, PM_SAP_MODE); - } + policy_mgr_mode_specific_modification_on_pcl( + psoc, pcl_channels, pcl_weight, len, PM_P2P_GO_MODE); - if (mode == PM_P2P_GO_MODE) { - status = policy_mgr_modify_pcl_based_on_enabled_channels( - pm_ctx, pcl_channels, pcl_weight, len); - if (QDF_IS_STATUS_ERROR(status)) { - policy_mgr_err("failed to get modified pcl for GO"); - return status; - } - policy_mgr_debug("modified pcl len:%d", *len); - for (i = 0; i < *len; i++) - policy_mgr_debug("chan:%d weight:%d", - pcl_channels[i], pcl_weight[i]); - } status = policy_mgr_modify_pcl_based_on_dnbs(psoc, pcl_channels, pcl_weight, len); From 3ab43844f0afae0b8400eecced7cb15ccd4051fb Mon Sep 17 00:00:00 2001 From: Nitesh Shah Date: Wed, 26 Apr 2017 20:02:34 +0530 Subject: [PATCH 038/187] qcacmn: Get channel properly from conc_connection_list table The channel information is obtained from the conc_connetion_list table using the index equal to the session_id. But the session in conc_connection_list table is not kept in the increasing order of session_id. Thus, the wrong channel information can be obtained. Thus, the fix is to obtain the channel information from the conc_connection_list table corresponding to the index whose vdev_id matches the session_id. Change-Id: If289ea7c0567b892dba495b878540f9cb5df5668 CRs-Fixed: 2039474 --- inc/wlan_policy_mgr_api.h | 13 ++++++++ src/wlan_policy_mgr_get_set_utils.c | 46 ++++++++++++++++++++++++++--- 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 803f0df633e9..53cf435021fb 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1180,6 +1180,19 @@ bool policy_mgr_is_any_mode_active_on_band_along_with_session( struct wlan_objmgr_psoc *psoc, uint8_t session_id, enum policy_mgr_band band); +/** + * policy_mgr_get_chan_by_session_id() - Get channel for a given session ID + * @psoc: PSOC object information + * @session_id: Session ID + * @chan: Pointer to the channel + * + * Gets the channel for a given session ID + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_get_chan_by_session_id(struct wlan_objmgr_psoc *psoc, + uint8_t session_id, uint8_t *chan); + /** * policy_mgr_get_mac_id_by_session_id() - Get MAC ID for a given session ID * @psoc: PSOC object information diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 9af7f9cda062..a9885f68a7cc 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2219,6 +2219,32 @@ send_status: return status; } +QDF_STATUS policy_mgr_get_chan_by_session_id(struct wlan_objmgr_psoc *psoc, + uint8_t session_id, uint8_t *chan) +{ + uint32_t i; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (i = 0; i < MAX_NUMBER_OF_CONC_CONNECTIONS; i++) { + if ((pm_conc_connection_list[i].vdev_id == session_id) && + (pm_conc_connection_list[i].in_use)) { + *chan = pm_conc_connection_list[i].chan; + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + return QDF_STATUS_SUCCESS; + } + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return QDF_STATUS_E_FAILURE; +} + QDF_STATUS policy_mgr_get_mac_id_by_session_id(struct wlan_objmgr_psoc *psoc, uint8_t session_id, uint8_t *mac_id) { @@ -2250,7 +2276,8 @@ QDF_STATUS policy_mgr_get_mcc_session_id_on_mac(struct wlan_objmgr_psoc *psoc, uint8_t *mcc_session_id) { uint32_t i; - uint8_t chan = pm_conc_connection_list[session_id].chan; + QDF_STATUS status; + uint8_t chan; struct policy_mgr_psoc_priv_obj *pm_ctx; pm_ctx = policy_mgr_get_context(psoc); @@ -2259,6 +2286,13 @@ QDF_STATUS policy_mgr_get_mcc_session_id_on_mac(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_FAILURE; } + status = policy_mgr_get_chan_by_session_id(psoc, session_id, &chan); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("Failed to get channel for session id:%d", + session_id); + return QDF_STATUS_E_FAILURE; + } + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); for (i = 0; i < MAX_NUMBER_OF_CONC_CONNECTIONS; i++) { if (pm_conc_connection_list[i].mac != mac_id) @@ -2305,9 +2339,13 @@ uint8_t policy_mgr_get_mcc_operating_channel(struct wlan_objmgr_psoc *psoc, return INVALID_CHANNEL_ID; } - qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); - chan = pm_conc_connection_list[mcc_session_id].chan; - qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + status = policy_mgr_get_chan_by_session_id(psoc, mcc_session_id, + &chan); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("Failed to get channel for MCC session ID:%d", + mcc_session_id); + return INVALID_CHANNEL_ID; + } return chan; } From 6fb01f70f4e91b3efeb9cfc57d1e9f5bb4ed75da Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Fri, 5 May 2017 13:01:51 -0700 Subject: [PATCH 039/187] qcacmn: Move the lock initialization to module open for policy manager Move the lock initialization to module open from module enable for policy manager. Change-Id: I44716537dcb3f559c1c27401bb579239c98a9f02 CRs-Fixed: 2009818 --- inc/wlan_policy_mgr_public_struct.h | 2 +- src/wlan_policy_mgr_init_deinit.c | 37 +++++++++++++++++------------ 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 156e4c6ef677..f0c73e983817 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -35,7 +35,7 @@ */ /* Include files */ -#include "wmi_unified.h" +#include #define POLICY_MGR_MAX_CHANNEL_LIST 128 diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 55957cf61333..43f325412fdd 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -318,7 +318,21 @@ QDF_STATUS policy_mgr_deinit(void) QDF_STATUS policy_mgr_psoc_open(struct wlan_objmgr_psoc *psoc) { - /* placeholder for now */ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + if (!QDF_IS_STATUS_SUCCESS(qdf_mutex_create( + &pm_ctx->qdf_conc_list_lock))) { + policy_mgr_err("Failed to init qdf_conc_list_lock"); + QDF_ASSERT(0); + return QDF_STATUS_E_FAILURE; + } + return QDF_STATUS_SUCCESS; } @@ -332,6 +346,13 @@ QDF_STATUS policy_mgr_psoc_close(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_E_FAILURE; } + if (!QDF_IS_STATUS_SUCCESS(qdf_mutex_destroy( + &pm_ctx->qdf_conc_list_lock))) { + policy_mgr_err("Failed to destroy qdf_conc_list_lock"); + QDF_ASSERT(0); + return QDF_STATUS_E_FAILURE; + } + if (pm_ctx->hw_mode.hw_mode_list) { qdf_mem_free(pm_ctx->hw_mode.hw_mode_list); pm_ctx->hw_mode.hw_mode_list = NULL; @@ -374,13 +395,6 @@ QDF_STATUS policy_mgr_psoc_enable(struct wlan_objmgr_psoc *psoc) return status; } - if (!QDF_IS_STATUS_SUCCESS(qdf_mutex_create( - &pm_ctx->qdf_conc_list_lock))) { - policy_mgr_err("Failed to init qdf_conc_list_lock"); - QDF_ASSERT(0); - return status; - } - pm_ctx->do_hw_mode_change = false; pm_ctx->hw_mode_change_in_progress = POLICY_MGR_HW_MODE_NOT_IN_PROGRESS; /* reset sap mandatory channels */ @@ -440,13 +454,6 @@ QDF_STATUS policy_mgr_psoc_disable(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_E_FAILURE; } - if (!QDF_IS_STATUS_SUCCESS(qdf_mutex_destroy( - &pm_ctx->qdf_conc_list_lock))) { - policy_mgr_err("Failed to destroy qdf_conc_list_lock"); - status = QDF_STATUS_E_FAILURE; - QDF_ASSERT(0); - } - /* destroy connection_update_done_evt */ if (!QDF_IS_STATUS_SUCCESS(qdf_event_destroy (&pm_ctx->connection_update_done_evt))) { From 5125d0f5184878402422e4e03dddd72992e9946b Mon Sep 17 00:00:00 2001 From: Kabilan Kannan Date: Mon, 15 May 2017 20:28:05 -0700 Subject: [PATCH 040/187] qcacmn: Fix TDLS set state cmd sequence for roaming Firmware expects TDLS set state cmd before vdev stop, but the cmd is going out of sequence during roaming and induce crash in the system. Send the TDLS set state cmd with correct sequence. Change-Id: Ie106b8a8cebaa7f107c9eff67dda924b231162da CRs-Fixed: 2048036 --- inc/wlan_policy_mgr_api.h | 13 +++++++++++++ src/wlan_policy_mgr_get_set_utils.c | 30 +++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 53cf435021fb..9853383b3f54 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1331,6 +1331,19 @@ void policy_mgr_checkn_update_hw_mode_single_mac_mode( */ void policy_mgr_dump_connection_status_info(struct wlan_objmgr_psoc *psoc); +/** + * policy_mgr_mode_specific_vdev_id() - provides the + * vdev id of the pecific mode + * @psoc: PSOC object information + * @mode: type of connection + * + * This function provides vdev id for the given mode + * + * Return: vdev id + */ +uint32_t policy_mgr_mode_specific_vdev_id(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode); + /** * policy_mgr_mode_specific_connection_count() - provides the * count of connections of specific mode diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index a9885f68a7cc..873e1d2eb8b1 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -788,6 +788,36 @@ uint32_t policy_mgr_get_connection_count(struct wlan_objmgr_psoc *psoc) return count; } +uint32_t policy_mgr_mode_specific_vdev_id(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode) +{ + uint32_t conn_index = 0; + uint32_t vdev_id = WLAN_INVALID_VDEV_ID; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return vdev_id; + } + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + /* + * Note: This gives you the first vdev id of the mode type in a + * sta+sta or sap+sap or p2p + p2p case + */ + for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; + conn_index++) { + if ((pm_conc_connection_list[conn_index].mode == mode) && + pm_conc_connection_list[conn_index].in_use) { + vdev_id = pm_conc_connection_list[conn_index].vdev_id; + break; + } + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return vdev_id; +} + uint32_t policy_mgr_mode_specific_connection_count( struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, From 7e4d4c2699aec786c1bb1b301405adab5da3922c Mon Sep 17 00:00:00 2001 From: Vikrampal Date: Wed, 17 May 2017 09:36:46 +0530 Subject: [PATCH 041/187] qcacmn: Handle multiple H/w DBS modes Host handling enhanced in case of F/w advertising multiple DBS H/w modes Change-Id: I90dfd9360df60be126dbfa8add30d38aeb6f7bf1 CRs-Fixed: 2048301 --- inc/wlan_policy_mgr_api.h | 8 +++--- src/wlan_policy_mgr_get_set_utils.c | 41 ++++++++++++++--------------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 9853383b3f54..c96d0e9abfcd 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1890,11 +1890,9 @@ QDF_STATUS policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc, * @psoc: PSOC object information * @nss_dbs: NSS info of both MAC0 and MAC1 * This function computes NSS info of both MAC0 and MAC1 - * True: DBS capable - * False: not DBS capable * - * Return: True or False + * Return: uint32_t value signifies supported RF chains */ -bool policy_mgr_get_hw_dbs_nss(struct wlan_objmgr_psoc *psoc, - struct dbs_nss *nss_dbs); +uint32_t policy_mgr_get_hw_dbs_nss(struct wlan_objmgr_psoc *psoc, + struct dbs_nss *nss_dbs); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 873e1d2eb8b1..4420e63a5350 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -752,18 +752,10 @@ bool policy_mgr_is_dbs_enable(struct wlan_objmgr_psoc *psoc) bool policy_mgr_is_hw_dbs_2x2_capable(struct wlan_objmgr_psoc *psoc) { - uint32_t max_rf_chains, final_min_rf_chains = HW_MODE_SS_2x2; struct dbs_nss nss_dbs; - if (policy_mgr_get_hw_dbs_nss(psoc, &nss_dbs)) { - max_rf_chains = QDF_MAX(nss_dbs.mac0_ss, nss_dbs.mac1_ss); - final_min_rf_chains - = QDF_MIN(final_min_rf_chains, max_rf_chains); - } else { - final_min_rf_chains = HW_MODE_SS_0x0; - } - - return (final_min_rf_chains == HW_MODE_SS_2x2) ? true : false; + return ((policy_mgr_get_hw_dbs_nss(psoc, &nss_dbs)) >= HW_MODE_SS_2x2) + ? true : false; } uint32_t policy_mgr_get_connection_count(struct wlan_objmgr_psoc *psoc) @@ -2479,13 +2471,13 @@ QDF_STATUS policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } -bool policy_mgr_get_hw_dbs_nss(struct wlan_objmgr_psoc *psoc, - struct dbs_nss *nss_dbs) +uint32_t policy_mgr_get_hw_dbs_nss(struct wlan_objmgr_psoc *psoc, + struct dbs_nss *nss_dbs) { int i, param; uint32_t dbs, tx_chain0, rx_chain0, tx_chain1, rx_chain1; uint32_t min_mac0_rf_chains, min_mac1_rf_chains; - bool is_dbs_found = false; + uint32_t max_rf_chains, final_max_rf_chains = HW_MODE_SS_0x0; struct policy_mgr_psoc_priv_obj *pm_ctx; pm_ctx = policy_mgr_get_context(psoc); @@ -2510,19 +2502,26 @@ bool policy_mgr_get_hw_dbs_nss(struct wlan_objmgr_psoc *psoc, min_mac0_rf_chains = QDF_MIN(tx_chain0, rx_chain0); min_mac1_rf_chains = QDF_MIN(tx_chain1, rx_chain1); - nss_dbs->mac0_ss - = (min_mac0_rf_chains == 2) - ? HW_MODE_SS_2x2 : HW_MODE_SS_1x1; + max_rf_chains + = QDF_MAX(min_mac0_rf_chains, min_mac1_rf_chains); - nss_dbs->mac1_ss - = (min_mac1_rf_chains == 2) - ? HW_MODE_SS_2x2 : HW_MODE_SS_1x1; + if (final_max_rf_chains < max_rf_chains) { + final_max_rf_chains + = (max_rf_chains == 2) + ? HW_MODE_SS_2x2 : HW_MODE_SS_1x1; - is_dbs_found = true; + nss_dbs->mac0_ss + = (min_mac0_rf_chains == 2) + ? HW_MODE_SS_2x2 : HW_MODE_SS_1x1; + + nss_dbs->mac1_ss + = (min_mac1_rf_chains == 2) + ? HW_MODE_SS_2x2 : HW_MODE_SS_1x1; + } } else { continue; } } - return is_dbs_found; + return final_max_rf_chains; } From 6bc3f9898359ca7a2337fda7499d02e1a911e0f6 Mon Sep 17 00:00:00 2001 From: Nitesh Shah Date: Tue, 16 May 2017 12:55:48 +0530 Subject: [PATCH 042/187] qcacmn: Avoid race condition while modifying connection list In case of STA-AP case, new thread is created to call the func policy_mgr_check_sta_ap_concurrent_ch_intf() that calls policy_mgr_get_pcl_for_existing_conn() that modifies pm_conc_connection_list table. The mc_thread calls policy_mgr_get_valid_chan_weights() that also modifies pm_conc_connection_list table. But the race condition is created that mess up the pm_conc_connection_list table. This race condition also leads to the scenario where the STA connection to the AP is not updated properly . This shall lead to the improper PCL update for a STA+SAP concurrency and thus the channel switch fails. The fix is to protect the whole sequence of the function policy_mgr_check_sta_ap_concurrent_ch_intf() with mutex to avoid race condition. Change-Id: Ibb6d804afa70ef45d99e7ec9fc7fecc4993c7621 CRs-Fixed: 2047765 --- src/wlan_policy_mgr_action.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index a8d34b62bbd4..1695fc4bff80 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -668,9 +668,11 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) policy_mgr_err("SAP restart get channel callback in NULL"); return; } + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); status = pm_ctx->hdd_cbacks. wlan_hdd_get_channel_for_sap_restart(psoc, vdev_id, &channel, &sec_ch, restart_sap); + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); if (status != QDF_STATUS_SUCCESS) { policy_mgr_err("Failed to switch SAP channel"); return; From c0af3e87c68ad46df62a6d0c66f6d2ea3dbd2379 Mon Sep 17 00:00:00 2001 From: Ajit Pal Singh Date: Wed, 24 May 2017 11:58:09 +0530 Subject: [PATCH 043/187] qcacmn: Add vdev-mlme caps MASK for restrict_offchannel Adds new vdev-mlme caps mask WLAN_VDEV_C_RESTRICT_OFFCHAN for tracking restrict offchannel setting. When this bit is set any operations which can cause the AP/GO to leave the operating channel are avoided. Also reads vdev-mlme caps:WLAN_VDEV_C_RESTRICT_OFFCHAN in function policy_mgr_is_dnsc_set() to determine if Do_Not_Switch_Channel is enabled. Moves declaration of policy_mgr_is_dnsc_set() to wlan_policy_mgr_api.h so that it can be used outside of policy manager. Change-Id: I53013af5f4c72917f862630e63333951ec75ce8c CRs-Fixed: 2050999 --- inc/wlan_policy_mgr_api.h | 11 +++++++++++ src/wlan_policy_mgr_get_set_utils.c | 21 +++++++++++++++++---- src/wlan_policy_mgr_i.h | 12 ------------ 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index c96d0e9abfcd..40cce054c0e1 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1895,4 +1895,15 @@ QDF_STATUS policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc, */ uint32_t policy_mgr_get_hw_dbs_nss(struct wlan_objmgr_psoc *psoc, struct dbs_nss *nss_dbs); + +/** + * policy_mgr_is_dnsc_set - Check if user has set + * "Do_Not_Switch_Channel" for the vdev passed + * @vdev: vdev pointer + * + * Get "Do_Not_Switch_Channel" setting for the vdev passed. + * + * Return: true for success, else false + */ +bool policy_mgr_is_dnsc_set(struct wlan_objmgr_vdev *vdev); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 4420e63a5350..9d16bdd63c25 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2408,10 +2408,23 @@ bool policy_mgr_is_hw_mode_change_after_vdev_up(struct wlan_objmgr_psoc *psoc) return flag; } -bool policy_mgr_vdev_mlme_is_dnsc_set(struct wlan_objmgr_vdev *vdev) +bool policy_mgr_is_dnsc_set(struct wlan_objmgr_vdev *vdev) { - /* TODO : Check Dont_Switch_Channel status from vdev mlme caps*/ - return false; + bool roffchan; + + if (!vdev) { + policy_mgr_err("Invalid parameter"); + return false; + } + + wlan_vdev_obj_lock(vdev); + roffchan = wlan_vdev_mlme_cap_get(vdev, WLAN_VDEV_C_RESTRICT_OFFCHAN); + wlan_vdev_obj_unlock(vdev); + + policy_mgr_debug("Restrict offchannel:%s", + roffchan ? "set" : "clear"); + + return roffchan; } QDF_STATUS policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc, @@ -2456,7 +2469,7 @@ QDF_STATUS policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc, * return true. */ /* TODO: To be enhanced for SBS */ - if (policy_mgr_vdev_mlme_is_dnsc_set(vdev)) { + if (policy_mgr_is_dnsc_set(vdev)) { if (operating_channel == channel) *ok = true; else if (WLAN_REG_IS_SAME_BAND_CHANNELS(operating_channel, diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 9a48a16fc32e..5100017bda57 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -414,16 +414,4 @@ bool policy_mgr_get_sap_conn_info(struct wlan_objmgr_psoc *psoc, bool policy_mgr_get_mode_specific_conn_info(struct wlan_objmgr_psoc *psoc, uint8_t *channel, uint8_t *vdev_id, enum policy_mgr_con_mode mode); - -/** - * policy_mgr_vdev_mlme_is_dnsc_set - Check if user has set - * "Do_Not_Switch_Channel" for this vdev - * @vdev: vdev pointer - * - * Get "Do_Not_Switch_Channel" setting for this vdev - * - * Return: true for success, else false - */ -bool policy_mgr_vdev_mlme_is_dnsc_set(struct wlan_objmgr_vdev *vdev); - #endif From df19983a642d9e25dccf1ebf1a9ad2885c3080c6 Mon Sep 17 00:00:00 2001 From: Nitesh Shah Date: Fri, 12 May 2017 16:54:33 +0530 Subject: [PATCH 044/187] qcacmn: Provide Rx LDPC support for 2G STA Currently Rx LDPC is disabled for STA(2G) connection due to PHY-B hardware limitation. PHY-A can still support RxLDPC, so make changes such a way that when ever STA is on 2G band and current hardware mode is non-dbs then enable the Rx LDPC and if STA is on 2G band and current hardware mode is dbs then disable the RX LDPC. Change-Id: Ib0183fea06619056c61e297d3fcfd82d91775dcd CRs-Fixed: 2046542 --- inc/wlan_policy_mgr_api.h | 22 ++++++++++++++++ src/wlan_policy_mgr_action.c | 32 ++++++++++++++++++++++ src/wlan_policy_mgr_core.c | 44 +++++++++++++++++++++++++++++++ src/wlan_policy_mgr_init_deinit.c | 6 +++++ 4 files changed, 104 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 40cce054c0e1..1b0d80f75900 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -735,6 +735,9 @@ typedef void (*policy_mgr_nss_update_cback)(struct wlan_objmgr_psoc *psoc, /** * struct policy_mgr_sme_cbacks - SME Callbacks to be invoked * from policy manager + * @sme_check_enable_rx_ldpc_sta_ini_item: Get rx ldpc sta ini value + * @sme_set_vdev_ies_per_band: Set vdev IEs per band + * @sme_issue_same_ap_reassoc_cmd: Issue AP reassoc * @sme_get_valid_channels: Get valid channel list * @sme_get_nss_for_vdev: Get the allowed nss value for the vdev * @sme_soc_set_dual_mac_config: Set the dual MAC scan & FW @@ -745,6 +748,10 @@ typedef void (*policy_mgr_nss_update_cback)(struct wlan_objmgr_psoc *psoc, * @sme_change_mcc_beacon_interval: Set MCC beacon interval to FW */ struct policy_mgr_sme_cbacks { + bool (*sme_check_enable_rx_ldpc_sta_ini_item)(void); + void (*sme_set_vdev_ies_per_band)(uint8_t vdev_id, + uint8_t is_hw_mode_dbs); + QDF_STATUS (*sme_issue_same_ap_reassoc_cmd)(uint8_t session_id); QDF_STATUS (*sme_get_valid_channels)(uint8_t *chan_list, uint32_t *list_len); void (*sme_get_nss_for_vdev)(enum tQDF_ADAPTER_MODE, @@ -1906,4 +1913,19 @@ uint32_t policy_mgr_get_hw_dbs_nss(struct wlan_objmgr_psoc *psoc, * Return: true for success, else false */ bool policy_mgr_is_dnsc_set(struct wlan_objmgr_vdev *vdev); + +/** + * policy_mgr_find_sta_and_update_caps_with_reassociation() - find sta and + * update HT/VHT caps and do reassociation with same ap + * @psoc: PSOC object information + * @is_hw_mode_dbs: DBS or NON-DBS hardware mode to use + * + * This API will find the 2G STA currently active from policy manager table + * and update their HT/VHT caps to firmware and trigger self reassociation + * with same AP through LFR3 roaming module. + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_find_sta_and_update_caps_with_reassociation( + struct wlan_objmgr_psoc *psoc, uint8_t is_hw_mode_dbs); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 1695fc4bff80..231ea42ec002 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -423,6 +423,7 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, QDF_STATUS status = QDF_STATUS_E_FAILURE; struct policy_mgr_hw_mode_params hw_mode; struct dbs_nss nss_dbs; + struct policy_mgr_psoc_priv_obj *pm_ctx; if (policy_mgr_is_hw_dbs_capable(psoc) == false) { policy_mgr_err("driver isn't dbs capable, no further action needed"); @@ -447,6 +448,12 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_ALREADY; } + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return QDF_STATUS_E_FAILURE; + } + if ((PM_SBS == action) || (action == PM_SBS_DOWNGRADE)) { if (!policy_mgr_is_hw_sbs_capable(psoc)) { /* No action */ @@ -459,6 +466,31 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, } + /* + * just check PM_DBS action only, no need to check for + * PM_DBS_DOWNGRADE as it will eventually call PM_DBS. if you check + * for PM_DBS_DOWNGRADE then IE update and self reassoc will happen + * two times back to back as this functon is nested which + * will not make sense. Same things apply for PM_SINGLE_MAC_UPGRADE + * and PM_SINGLE_MAC operations. + */ + if ((PM_DBS == action) && !hw_mode.dbs_cap && + pm_ctx->sme_cbacks.sme_check_enable_rx_ldpc_sta_ini_item()) { + policy_mgr_notice("Going for DBS, disable rx-ldpc for all 2G STAs"); + policy_mgr_find_sta_and_update_caps_with_reassociation(psoc, + true); + } else if ((PM_SINGLE_MAC == action) && hw_mode.dbs_cap + && + pm_ctx->sme_cbacks.sme_check_enable_rx_ldpc_sta_ini_item()) { + /* + * don't use default RX LDPC which isenabled for 5g and + * disable for 2g + */ + policy_mgr_notice("Going for SMM, enable rx-ldpc for all 2G STAs"); + policy_mgr_find_sta_and_update_caps_with_reassociation(psoc, + false); + } + switch (action) { case PM_DBS_DOWNGRADE: /* diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 03fc3396196d..86fad4330025 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -2252,6 +2252,50 @@ static void policy_mgr_nss_update_cb(struct wlan_objmgr_psoc *psoc, return; } +QDF_STATUS policy_mgr_find_sta_and_update_caps_with_reassociation( + struct wlan_objmgr_psoc *psoc, uint8_t is_hw_mode_dbs) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + QDF_STATUS status = QDF_STATUS_SUCCESS; + uint32_t index, count; + uint32_t list[MAX_NUMBER_OF_CONC_CONNECTIONS]; + uint32_t conn_index = 0; + uint32_t vdev_id, channel; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + count = policy_mgr_mode_specific_connection_count(psoc, PM_STA_MODE, + list); + for (index = 0; index < count; index++) { + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + vdev_id = pm_conc_connection_list[list[index]].vdev_id; + channel = pm_conc_connection_list[list[index]].chan; + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + conn_index = policy_mgr_get_connection_for_vdev_id(psoc, + vdev_id); + if (MAX_NUMBER_OF_CONC_CONNECTIONS == conn_index) { + policy_mgr_err("connection not found for vdev %d", + vdev_id); + continue; + } + /* do it only for 2.4GHz channels */ + if (!WLAN_REG_IS_24GHZ_CH(channel)) + continue; + pm_ctx->sme_cbacks.sme_set_vdev_ies_per_band(vdev_id, + is_hw_mode_dbs); + status = pm_ctx->sme_cbacks.sme_issue_same_ap_reassoc_cmd( + vdev_id); + if (QDF_STATUS_E_FAILURE == status) + policy_mgr_err("Self reassoc failed %d", status); + } + + return status; +} + /** * policy_mgr_complete_action() - initiates actions needed on * current connections once channel has been decided for the new diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 43f325412fdd..5fed2e24f1c7 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -501,6 +501,12 @@ QDF_STATUS policy_mgr_register_sme_cb(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_FAILURE; } + pm_ctx->sme_cbacks.sme_check_enable_rx_ldpc_sta_ini_item = + sme_cbacks->sme_check_enable_rx_ldpc_sta_ini_item; + pm_ctx->sme_cbacks.sme_set_vdev_ies_per_band = + sme_cbacks->sme_set_vdev_ies_per_band; + pm_ctx->sme_cbacks.sme_issue_same_ap_reassoc_cmd = + sme_cbacks->sme_issue_same_ap_reassoc_cmd; pm_ctx->sme_cbacks.sme_get_nss_for_vdev = sme_cbacks->sme_get_nss_for_vdev; pm_ctx->sme_cbacks.sme_get_valid_channels = From 2ff84bd4de5d7e0cf3203bf8340e3176a7b44624 Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Fri, 9 Jun 2017 16:39:12 -0700 Subject: [PATCH 045/187] Revert "qcacmn: Provide Rx LDPC support for 2G STA" This reverts change-id: Ib0183fea06619056c61e297d3fcfd82d91775dcd. CRs-Fixed: 2046542 Change-Id: I558d2d78683133fbd8ab97260aa484a997bd3e7e --- inc/wlan_policy_mgr_api.h | 22 ---------------- src/wlan_policy_mgr_action.c | 32 ---------------------- src/wlan_policy_mgr_core.c | 44 ------------------------------- src/wlan_policy_mgr_init_deinit.c | 6 ----- 4 files changed, 104 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 1b0d80f75900..40cce054c0e1 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -735,9 +735,6 @@ typedef void (*policy_mgr_nss_update_cback)(struct wlan_objmgr_psoc *psoc, /** * struct policy_mgr_sme_cbacks - SME Callbacks to be invoked * from policy manager - * @sme_check_enable_rx_ldpc_sta_ini_item: Get rx ldpc sta ini value - * @sme_set_vdev_ies_per_band: Set vdev IEs per band - * @sme_issue_same_ap_reassoc_cmd: Issue AP reassoc * @sme_get_valid_channels: Get valid channel list * @sme_get_nss_for_vdev: Get the allowed nss value for the vdev * @sme_soc_set_dual_mac_config: Set the dual MAC scan & FW @@ -748,10 +745,6 @@ typedef void (*policy_mgr_nss_update_cback)(struct wlan_objmgr_psoc *psoc, * @sme_change_mcc_beacon_interval: Set MCC beacon interval to FW */ struct policy_mgr_sme_cbacks { - bool (*sme_check_enable_rx_ldpc_sta_ini_item)(void); - void (*sme_set_vdev_ies_per_band)(uint8_t vdev_id, - uint8_t is_hw_mode_dbs); - QDF_STATUS (*sme_issue_same_ap_reassoc_cmd)(uint8_t session_id); QDF_STATUS (*sme_get_valid_channels)(uint8_t *chan_list, uint32_t *list_len); void (*sme_get_nss_for_vdev)(enum tQDF_ADAPTER_MODE, @@ -1913,19 +1906,4 @@ uint32_t policy_mgr_get_hw_dbs_nss(struct wlan_objmgr_psoc *psoc, * Return: true for success, else false */ bool policy_mgr_is_dnsc_set(struct wlan_objmgr_vdev *vdev); - -/** - * policy_mgr_find_sta_and_update_caps_with_reassociation() - find sta and - * update HT/VHT caps and do reassociation with same ap - * @psoc: PSOC object information - * @is_hw_mode_dbs: DBS or NON-DBS hardware mode to use - * - * This API will find the 2G STA currently active from policy manager table - * and update their HT/VHT caps to firmware and trigger self reassociation - * with same AP through LFR3 roaming module. - * - * Return: QDF_STATUS - */ -QDF_STATUS policy_mgr_find_sta_and_update_caps_with_reassociation( - struct wlan_objmgr_psoc *psoc, uint8_t is_hw_mode_dbs); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 231ea42ec002..1695fc4bff80 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -423,7 +423,6 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, QDF_STATUS status = QDF_STATUS_E_FAILURE; struct policy_mgr_hw_mode_params hw_mode; struct dbs_nss nss_dbs; - struct policy_mgr_psoc_priv_obj *pm_ctx; if (policy_mgr_is_hw_dbs_capable(psoc) == false) { policy_mgr_err("driver isn't dbs capable, no further action needed"); @@ -448,12 +447,6 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_ALREADY; } - pm_ctx = policy_mgr_get_context(psoc); - if (!pm_ctx) { - policy_mgr_err("Invalid context"); - return QDF_STATUS_E_FAILURE; - } - if ((PM_SBS == action) || (action == PM_SBS_DOWNGRADE)) { if (!policy_mgr_is_hw_sbs_capable(psoc)) { /* No action */ @@ -466,31 +459,6 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, } - /* - * just check PM_DBS action only, no need to check for - * PM_DBS_DOWNGRADE as it will eventually call PM_DBS. if you check - * for PM_DBS_DOWNGRADE then IE update and self reassoc will happen - * two times back to back as this functon is nested which - * will not make sense. Same things apply for PM_SINGLE_MAC_UPGRADE - * and PM_SINGLE_MAC operations. - */ - if ((PM_DBS == action) && !hw_mode.dbs_cap && - pm_ctx->sme_cbacks.sme_check_enable_rx_ldpc_sta_ini_item()) { - policy_mgr_notice("Going for DBS, disable rx-ldpc for all 2G STAs"); - policy_mgr_find_sta_and_update_caps_with_reassociation(psoc, - true); - } else if ((PM_SINGLE_MAC == action) && hw_mode.dbs_cap - && - pm_ctx->sme_cbacks.sme_check_enable_rx_ldpc_sta_ini_item()) { - /* - * don't use default RX LDPC which isenabled for 5g and - * disable for 2g - */ - policy_mgr_notice("Going for SMM, enable rx-ldpc for all 2G STAs"); - policy_mgr_find_sta_and_update_caps_with_reassociation(psoc, - false); - } - switch (action) { case PM_DBS_DOWNGRADE: /* diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 86fad4330025..03fc3396196d 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -2252,50 +2252,6 @@ static void policy_mgr_nss_update_cb(struct wlan_objmgr_psoc *psoc, return; } -QDF_STATUS policy_mgr_find_sta_and_update_caps_with_reassociation( - struct wlan_objmgr_psoc *psoc, uint8_t is_hw_mode_dbs) -{ - struct policy_mgr_psoc_priv_obj *pm_ctx; - QDF_STATUS status = QDF_STATUS_SUCCESS; - uint32_t index, count; - uint32_t list[MAX_NUMBER_OF_CONC_CONNECTIONS]; - uint32_t conn_index = 0; - uint32_t vdev_id, channel; - - pm_ctx = policy_mgr_get_context(psoc); - if (!pm_ctx) { - policy_mgr_err("Invalid Context"); - return QDF_STATUS_E_FAILURE; - } - - count = policy_mgr_mode_specific_connection_count(psoc, PM_STA_MODE, - list); - for (index = 0; index < count; index++) { - qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); - vdev_id = pm_conc_connection_list[list[index]].vdev_id; - channel = pm_conc_connection_list[list[index]].chan; - qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); - conn_index = policy_mgr_get_connection_for_vdev_id(psoc, - vdev_id); - if (MAX_NUMBER_OF_CONC_CONNECTIONS == conn_index) { - policy_mgr_err("connection not found for vdev %d", - vdev_id); - continue; - } - /* do it only for 2.4GHz channels */ - if (!WLAN_REG_IS_24GHZ_CH(channel)) - continue; - pm_ctx->sme_cbacks.sme_set_vdev_ies_per_band(vdev_id, - is_hw_mode_dbs); - status = pm_ctx->sme_cbacks.sme_issue_same_ap_reassoc_cmd( - vdev_id); - if (QDF_STATUS_E_FAILURE == status) - policy_mgr_err("Self reassoc failed %d", status); - } - - return status; -} - /** * policy_mgr_complete_action() - initiates actions needed on * current connections once channel has been decided for the new diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 5fed2e24f1c7..43f325412fdd 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -501,12 +501,6 @@ QDF_STATUS policy_mgr_register_sme_cb(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_FAILURE; } - pm_ctx->sme_cbacks.sme_check_enable_rx_ldpc_sta_ini_item = - sme_cbacks->sme_check_enable_rx_ldpc_sta_ini_item; - pm_ctx->sme_cbacks.sme_set_vdev_ies_per_band = - sme_cbacks->sme_set_vdev_ies_per_band; - pm_ctx->sme_cbacks.sme_issue_same_ap_reassoc_cmd = - sme_cbacks->sme_issue_same_ap_reassoc_cmd; pm_ctx->sme_cbacks.sme_get_nss_for_vdev = sme_cbacks->sme_get_nss_for_vdev; pm_ctx->sme_cbacks.sme_get_valid_channels = From ee5e70ec8519e75729e63b5f6d0ef9c185ff2502 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Thu, 8 Jun 2017 13:59:02 -0700 Subject: [PATCH 046/187] qcacmn: Restart SAP with CSA/ECSA when gWlanMccToSccSwitchMod=3 Restart SAP with CSA/ECSA when ini variable gWlanMccToSccSwitchMod=3. Currently ini variable setting gWlanMccToSccSwitchMod=2 was causing SAP to restart with CSA. Change-Id: I9a4b68cd154fa63325d146510832c2410f2dc244 CRs-Fixed: 2058567 --- inc/wlan_policy_mgr_api.h | 2 +- src/wlan_policy_mgr_action.c | 28 +--------------------------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 40cce054c0e1..728d32eb7f7b 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -782,7 +782,7 @@ struct policy_mgr_hdd_cbacks { QDF_STATUS (*wlan_hdd_get_channel_for_sap_restart)( struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, uint8_t *channel, - uint8_t *sec_ch, bool is_restart_sap); + uint8_t *sec_ch); enum policy_mgr_con_mode (*get_mode_for_non_connected_vdev)( struct wlan_objmgr_psoc *psoc, uint8_t vdev_id); diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 1695fc4bff80..8990550e66b2 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -599,27 +599,6 @@ static bool policy_mgr_is_restart_sap_allowed( return true; } -/** - * policy_mgr_is_sap_channel_change_without_restart() - Check if - * SAP channel change allowed without restart - * @mcc_to_scc_switch: MCC to SCC switch enabled user config - * - * Check if SAP channel change allowed without restart - * - * Restart: true or false - */ -static bool policy_mgr_is_sap_channel_change_without_restart( - uint32_t mcc_to_scc_switch) { - if (mcc_to_scc_switch == - QDF_MCC_TO_SCC_SWITCH_FORCE_WITHOUT_DISCONNECTION || - mcc_to_scc_switch == - QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL) { - policy_mgr_info("SAP chan change without restart allowed"); - return true; - } - return false; -} - /** * policy_mgr_check_sta_ap_concurrent_ch_intf() - Restart SAP in STA-AP case * @data: Pointer check concurrent channel work data @@ -637,8 +616,6 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) QDF_STATUS status; uint8_t channel, sec_ch; uint8_t operating_channel, vdev_id; - bool restart_sap; - pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -661,9 +638,6 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) return; } - restart_sap = policy_mgr_is_sap_channel_change_without_restart( - mcc_to_scc_switch) ? false : true; - if (!pm_ctx->hdd_cbacks.wlan_hdd_get_channel_for_sap_restart) { policy_mgr_err("SAP restart get channel callback in NULL"); return; @@ -671,7 +645,7 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); status = pm_ctx->hdd_cbacks. wlan_hdd_get_channel_for_sap_restart(psoc, vdev_id, - &channel, &sec_ch, restart_sap); + &channel, &sec_ch); qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); if (status != QDF_STATUS_SUCCESS) { policy_mgr_err("Failed to switch SAP channel"); From c26d3bdbb3677eb2b4461efdf689da8005a2a0c3 Mon Sep 17 00:00:00 2001 From: Nitesh Shah Date: Wed, 7 Jun 2017 15:25:07 +0530 Subject: [PATCH 047/187] qcacmn: Validate mode and vdev while decrementing session The function policy_mgr_decr_active_session() decrements mode and then remove the session from the pm_conn_connection_info table after validating vdev. This change adds a check to validate if the session is present with specific mode and vdev_id, and then decrement the session. If not present, then return without doing any change. Change-Id: If53d7fc9356b2c3bb72b22b228103389396910ce CRs-Fixed: 2057599 --- inc/wlan_policy_mgr_api.h | 20 +++++++++++-- src/wlan_policy_mgr_get_set_utils.c | 44 +++++++++++++++++++++++++++-- src/wlan_policy_mgr_pcl.c | 7 ++++- 3 files changed, 66 insertions(+), 5 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 728d32eb7f7b..6c18c484edf9 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -245,9 +245,9 @@ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, * mode. In the case of STA/P2P CLI/IBSS upon disconnection it is decremented * In the case of SAP/P2P GO upon bss stop it is decremented * - * Return: None + * Return: QDF_STATUS */ -void policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, +QDF_STATUS policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, enum tQDF_ADAPTER_MODE mode, uint8_t sessionId); /** @@ -1360,6 +1360,22 @@ uint32_t policy_mgr_mode_specific_connection_count( struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, uint32_t *list); +/** + * policy_mgr_check_conn_with_mode_and_vdev_id() - checks if any active + * session with specific mode and vdev_id + * @psoc: PSOC object information + * @mode: type of connection + * @vdev_id: vdev_id of the connection + * + * This function checks if any active session with specific mode and vdev_id + * is present + * + * Return: QDF STATUS with success if active session is found, else failure + */ +QDF_STATUS policy_mgr_check_conn_with_mode_and_vdev_id( + struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, + uint32_t vdev_id); + /** * policy_mgr_hw_mode_transition_cb() - Callback for HW mode * transition from FW diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 9d16bdd63c25..2bdebb638c54 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -838,6 +838,33 @@ uint32_t policy_mgr_mode_specific_connection_count( return count; } +QDF_STATUS policy_mgr_check_conn_with_mode_and_vdev_id( + struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, + uint32_t vdev_id) +{ + QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE; + uint32_t conn_index = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return qdf_status; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { + if ((pm_conc_connection_list[conn_index].mode == mode) && + (pm_conc_connection_list[conn_index].vdev_id == vdev_id)) { + qdf_status = QDF_STATUS_SUCCESS; + break; + } + conn_index++; + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + return qdf_status; +} + void policy_mgr_soc_set_dual_mac_cfg_cb(enum set_hw_mode_status status, uint32_t scan_config, uint32_t fw_mode_config) @@ -1122,16 +1149,27 @@ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); } -void policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, +QDF_STATUS policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, enum tQDF_ADAPTER_MODE mode, uint8_t session_id) { struct policy_mgr_psoc_priv_obj *pm_ctx; + QDF_STATUS qdf_status; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { policy_mgr_err("context is NULL"); - return; + return QDF_STATUS_E_EMPTY; + } + + qdf_status = policy_mgr_check_conn_with_mode_and_vdev_id(psoc, + policy_mgr_convert_device_mode_to_qdf_type(mode), + session_id); + if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { + policy_mgr_err("No connection with mode:%d vdev_id:%d", + policy_mgr_convert_device_mode_to_qdf_type(mode), + session_id); + return qdf_status; } switch (mode) { @@ -1157,6 +1195,8 @@ void policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, pm_ctx->tdls_cbacks.tdls_notify_decrement_session(psoc); policy_mgr_dump_current_concurrency(psoc); + + return qdf_status; } QDF_STATUS policy_mgr_incr_connection_count( diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index ad0b2c9d0684..6c2a6971125c 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -103,7 +103,12 @@ void policy_mgr_decr_session_set_pcl(struct wlan_objmgr_psoc *psoc, return; } - policy_mgr_decr_active_session(psoc, mode, session_id); + qdf_status = policy_mgr_decr_active_session(psoc, mode, session_id); + if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { + policy_mgr_err("Invalid active session"); + return; + } + /* * After the removal of this connection, we need to check if * a STA connection still exists. The reason for this is that From c1246b19b98103fe430d12d565b85dc71f7d3644 Mon Sep 17 00:00:00 2001 From: Ajit Pal Singh Date: Fri, 16 Jun 2017 11:36:12 +0530 Subject: [PATCH 048/187] qcacmn: Move GO to STA channel to achieve SCC Enable movement of GO to STA channel to achieve SCC. This movement is controlled by the ini variable "gWlanMccToSccSwitchMode" just as its done for SAP. Change-Id: I50f9487aa26dfc359211699f3d46e7869cedca4b CRs-Fixed: 2062450 --- src/wlan_policy_mgr_action.c | 42 ++++++++++++++++++++++------- src/wlan_policy_mgr_get_set_utils.c | 9 ------- src/wlan_policy_mgr_i.h | 14 ---------- 3 files changed, 32 insertions(+), 33 deletions(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 8990550e66b2..1d093b43823a 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -591,9 +591,11 @@ static bool policy_mgr_is_restart_sap_allowed( { if ((mcc_to_scc_switch == QDF_MCC_TO_SCC_SWITCH_DISABLE) || !(policy_mgr_concurrent_open_sessions_running(psoc) && + ((policy_mgr_get_concurrency_mode(psoc) == + (QDF_STA_MASK | QDF_SAP_MASK)) || (policy_mgr_get_concurrency_mode(psoc) == - (QDF_STA_MASK | QDF_SAP_MASK)))) { - policy_mgr_err("MCC switch disabled or not concurrent STA/SAP"); + (QDF_STA_MASK | QDF_P2P_GO_MASK))))) { + policy_mgr_err("MCC switch disabled or not concurrent STA/SAP, STA/GO"); return false; } return true; @@ -631,10 +633,20 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) if (!policy_mgr_is_restart_sap_allowed(psoc, mcc_to_scc_switch)) return; - if (!policy_mgr_get_sap_conn_info(psoc, - &operating_channel, - &vdev_id)) { - policy_mgr_err("Could not retrieve SAP channel & vdev id"); + if (policy_mgr_get_mode_specific_conn_info(psoc, + &operating_channel, + &vdev_id, + PM_SAP_MODE)) { + policy_mgr_debug("SAP operating at channel:%d", + operating_channel); + } else if (policy_mgr_get_mode_specific_conn_info(psoc, + &operating_channel, + &vdev_id, + PM_P2P_GO_MODE)) { + policy_mgr_debug("GO operating at channel:%d", + operating_channel); + } else { + policy_mgr_err("Could not retrieve SAP/GO operating channel&vdevid"); return; } @@ -680,10 +692,20 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( return; } - if (!policy_mgr_get_sap_conn_info(psoc, - &operating_channel, - &vdev_id)) { - policy_mgr_err("Could not retrieve SAP channel & vdev id"); + if (policy_mgr_get_mode_specific_conn_info(psoc, + &operating_channel, + &vdev_id, + PM_SAP_MODE)) { + policy_mgr_debug("SAP operating at channel:%d", + operating_channel); + } else if (policy_mgr_get_mode_specific_conn_info(psoc, + &operating_channel, + &vdev_id, + PM_P2P_GO_MODE)) { + policy_mgr_debug("GO operating at channel:%d", + operating_channel); + } else { + policy_mgr_err("Could not get SAP/GO operating channel&vdevid"); return; } diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 2bdebb638c54..f614a1c4e0b4 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1443,15 +1443,6 @@ bool policy_mgr_get_mode_specific_conn_info(struct wlan_objmgr_psoc *psoc, return status; } -bool policy_mgr_get_sap_conn_info(struct wlan_objmgr_psoc *psoc, - uint8_t *channel, uint8_t *vdev_id) -{ - return policy_mgr_get_mode_specific_conn_info(psoc, - channel, - vdev_id, - PM_SAP_MODE); -} - bool policy_mgr_max_concurrent_connections_reached( struct wlan_objmgr_psoc *psoc) { diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 5100017bda57..7d3f4e4a03e6 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -385,20 +385,6 @@ enum policy_mgr_conc_next_action QDF_STATUS policy_mgr_reset_sap_mandatory_channels( struct policy_mgr_psoc_priv_obj *pm_ctx); -/** - * policy_mgr_get_sap_conn_info() - Get active SAP channel and - * vdev id - * @psoc: PSOC object information - * @channel: SAP channel - * @vdev_id: SAP vdev id - * - * Get active SAP channel and vdev id - * - * Return: true for success, else false - */ -bool policy_mgr_get_sap_conn_info(struct wlan_objmgr_psoc *psoc, - uint8_t *channel, uint8_t *vdev_id); - /** * policy_mgr_get_mode_specific_conn_info() - Get active mode specific * channel and vdev id From 92e301c41466b0589853b6ded85304529205a23e Mon Sep 17 00:00:00 2001 From: Vivek Date: Wed, 21 Jun 2017 08:21:58 +0530 Subject: [PATCH 049/187] qcacmn: Remove vdev/peer locks for trivial APIs Remove vdev/peer locks from trivial API's. This follows the changes from which the lock requirement from few simple APIs are removed. Change-Id: I9972d51dfd1a42bdedbfd0fd4e67af03d030a1f5 CRs-Fixed: 2060880 --- src/wlan_policy_mgr_get_set_utils.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index f614a1c4e0b4..1b64f22c45e5 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2448,9 +2448,7 @@ bool policy_mgr_is_dnsc_set(struct wlan_objmgr_vdev *vdev) return false; } - wlan_vdev_obj_lock(vdev); roffchan = wlan_vdev_mlme_cap_get(vdev, WLAN_VDEV_C_RESTRICT_OFFCHAN); - wlan_vdev_obj_unlock(vdev); policy_mgr_debug("Restrict offchannel:%s", roffchan ? "set" : "clear"); From 944f1fda18553979926be6bb673779279a5fd3c0 Mon Sep 17 00:00:00 2001 From: Archana Ramachandran Date: Fri, 2 Jun 2017 16:48:17 -0700 Subject: [PATCH 050/187] qcacmn: Disallow moving to single MAC mode when a 2.4GHz connection exist After the P2P GO is up on 2.4 GHZ, the opportunistic upgrade timer handler is sending request to move to single MAC mode. Since 2.4 GHZ connection is always on MAC1 in DBS 2X2 capable HW, this is causing P2P connection failure. Add fix to not downgrade to single MAC mode when there exist a 2.4 GHZ connection. Change-Id: I90e2b5b43a6bc8a5b5b44ea96905410092f2866e CRs-Fixed: 2055867 --- src/wlan_policy_mgr_action.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 1d093b43823a..8c6b08c563f0 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -200,6 +200,14 @@ enum policy_mgr_conc_next_action policy_mgr_need_opportunistic_upgrade( } else if ((pm_conc_connection_list[conn_index].mac == 1) && pm_conc_connection_list[conn_index].in_use) { mac |= POLICY_MGR_MAC1; + if (policy_mgr_is_hw_dbs_2x2_capable(psoc) && + WLAN_REG_IS_24GHZ_CH( + pm_conc_connection_list[conn_index].chan) + ) { + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + policy_mgr_debug("2X2 DBS capable with 2.4 GHZ connection"); + goto done; + } if (POLICY_MGR_MAC0_AND_MAC1 == mac) { qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); goto done; From da68b5a736f8ad4616699dfc4badbbf4efe9aedf Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Thu, 20 Jul 2017 12:40:12 -0700 Subject: [PATCH 051/187] qcacmn: policy_mgr_mode_specific_modification_on_pcl to be called per mode policy_mgr_mode_specific_modification_on_pcl to be called for the connection type for which get_pcl is called. Change-Id: I78010ebf877130eca9eaa0074a833fb5b7faa4a1 CRs-Fixed: 2079986 --- src/wlan_policy_mgr_pcl.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 6c2a6971125c..b12d66b2164c 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -353,6 +353,11 @@ static QDF_STATUS policy_mgr_mode_specific_modification_on_pcl( status = policy_mgr_pcl_modification_for_p2p_go( psoc, pcl_channels, pcl_weight, len); break; + case PM_STA_MODE: + case PM_P2P_CLIENT_MODE: + case PM_IBSS_MODE: + status = QDF_STATUS_SUCCESS; + break; default: policy_mgr_err("unexpected mode %d", mode); break; @@ -467,11 +472,7 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, } policy_mgr_mode_specific_modification_on_pcl( - psoc, pcl_channels, pcl_weight, len, PM_SAP_MODE); - - policy_mgr_mode_specific_modification_on_pcl( - psoc, pcl_channels, pcl_weight, len, PM_P2P_GO_MODE); - + psoc, pcl_channels, pcl_weight, len, mode); status = policy_mgr_modify_pcl_based_on_dnbs(psoc, pcl_channels, pcl_weight, len); From ffe5ca51ed8b91f69ee71fed2bd348669e65e585 Mon Sep 17 00:00:00 2001 From: bings Date: Tue, 18 Jul 2017 17:40:51 +0800 Subject: [PATCH 052/187] qcacmn: Fix connection information deleting and restoring Currently only one connection information corresponding to the provided mode is deleted and restored, which causes channel selecting failure in DFS testing with AP+AP concurrency mode. When radar is found in AP+AP concurrency mode, a new valid channel should be selected. Before selecting the channel, all existing connection information of SAP mode should be deleted, otherwise no valid channel can be selected. All the connection information corresponding to the provided mode should be deleted and restored. Change-Id: Id363dbb2c31485fefcd6915696060923063079bb CRs-Fixed: 2079597 --- inc/wlan_policy_mgr_api.h | 4 +- src/wlan_policy_mgr_core.c | 87 +++++++++++++++++++++++++------------- src/wlan_policy_mgr_i.h | 7 ++- src/wlan_policy_mgr_pcl.c | 27 ++++++++---- 4 files changed, 84 insertions(+), 41 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 6c18c484edf9..06f377f5a853 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1241,6 +1241,7 @@ uint8_t policy_mgr_get_mcc_operating_channel(struct wlan_objmgr_psoc *psoc, * @len: Pointer to the length of the PCL * @pcl_weight: Pointer to the weights of the PCL * @weight_len: Max length of the weights list + * @all_matching_cxn_to_del: Need remove all entries before getting pcl * * Get the PCL for an existing connection * @@ -1249,7 +1250,8 @@ uint8_t policy_mgr_get_mcc_operating_channel(struct wlan_objmgr_psoc *psoc, QDF_STATUS policy_mgr_get_pcl_for_existing_conn(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, uint8_t *pcl_ch, uint32_t *len, - uint8_t *weight_list, uint32_t weight_len); + uint8_t *weight_list, uint32_t weight_len, + bool all_matching_cxn_to_del); /** * policy_mgr_get_valid_chan_weights() - Get the weightage for diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 03fc3396196d..68d6c235ad3c 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -562,7 +562,9 @@ void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc, /** * policy_mgr_store_and_del_conn_info() - Store and del a connection info * @mode: Mode whose entry has to be deleted - * @info: Struture pointer where the connection info will be saved + * @all_matching_cxn_to_del: All the specified mode entries should be deleted + * @info: Struture array pointer where the connection info will be saved + * @num_cxn_del: Number of connection which are going to be deleted * * Saves the connection info corresponding to the provided mode * and deleted that corresponding entry based on vdev from the @@ -571,18 +573,22 @@ void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc, * Return: None */ void policy_mgr_store_and_del_conn_info(struct wlan_objmgr_psoc *psoc, - enum policy_mgr_con_mode mode, - struct policy_mgr_conc_connection_info *info) + enum policy_mgr_con_mode mode, bool all_matching_cxn_to_del, + struct policy_mgr_conc_connection_info *info, uint8_t *num_cxn_del) { - uint32_t conn_index = 0; - bool found = false; + int32_t conn_index = 0; + uint32_t found_index = 0; struct policy_mgr_psoc_priv_obj *pm_ctx; + if (!num_cxn_del) { + policy_mgr_err("num_cxn_del is NULL"); + return; + } + *num_cxn_del = 0; if (!info) { policy_mgr_err("Invalid connection info"); return; } - qdf_mem_zero(info, sizeof(*info)); pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { policy_mgr_err("Invalid Context"); @@ -592,34 +598,47 @@ void policy_mgr_store_and_del_conn_info(struct wlan_objmgr_psoc *psoc, qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { if (mode == pm_conc_connection_list[conn_index].mode) { - found = true; - break; + /* + * Storing the connection entry which will be + * temporarily deleted. + */ + info[found_index] = pm_conc_connection_list[conn_index]; + /* Deleting the connection entry */ + policy_mgr_decr_connection_count(psoc, + info[found_index].vdev_id); + policy_mgr_notice("Stored %d (%d), deleted STA entry with vdev id %d, index %d", + info[found_index].vdev_id, + info[found_index].mode, + info[found_index].vdev_id, conn_index); + found_index++; + if (all_matching_cxn_to_del) + continue; + else + break; } conn_index++; } - - if (!found) { - qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); - policy_mgr_err("Mode:%d not available in the conn info", mode); - return; - } - - /* Storing the STA entry which will be temporarily deleted */ - *info = pm_conc_connection_list[conn_index]; qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); - /* Deleting the STA entry */ - policy_mgr_decr_connection_count(psoc, info->vdev_id); + if (!found_index) { + *num_cxn_del = 0; + policy_mgr_err("Mode:%d not available in the conn info", mode); + } else { + *num_cxn_del = found_index; + policy_mgr_err("Mode:%d number of conn %d temp del", + mode, *num_cxn_del); + } - policy_mgr_notice("Stored %d (%d), deleted STA entry with vdev id %d, index %d", - info->vdev_id, info->mode, info->vdev_id, conn_index); - - /* Caller should set the PCL and restore the STA entry in conn info */ + /* + * Caller should set the PCL and restore the connection entry + * in conn info. + */ } /** * policy_mgr_restore_deleted_conn_info() - Restore connection info - * @info: Saved connection info that is to be restored + * @info: An array saving connection info that is to be restored + * @num_cxn_del: Number of connection temporary deleted * * Restores the connection info of STA that was saved before * updating the PCL to the FW @@ -627,11 +646,17 @@ void policy_mgr_store_and_del_conn_info(struct wlan_objmgr_psoc *psoc, * Return: None */ void policy_mgr_restore_deleted_conn_info(struct wlan_objmgr_psoc *psoc, - struct policy_mgr_conc_connection_info *info) + struct policy_mgr_conc_connection_info *info, + uint8_t num_cxn_del) { uint32_t conn_index; struct policy_mgr_psoc_priv_obj *pm_ctx; + if (MAX_NUMBER_OF_CONC_CONNECTIONS <= num_cxn_del || 0 == num_cxn_del) { + policy_mgr_err("Failed to restore %d/%d deleted information", + num_cxn_del, MAX_NUMBER_OF_CONC_CONNECTIONS); + return; + } pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { policy_mgr_err("Invalid Context"); @@ -646,7 +671,8 @@ void policy_mgr_restore_deleted_conn_info(struct wlan_objmgr_psoc *psoc, } qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); - pm_conc_connection_list[conn_index] = *info; + qdf_mem_copy(&pm_conc_connection_list[conn_index], info, + num_cxn_del * sizeof(*info)); qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); policy_mgr_notice("Restored the deleleted conn info, vdev:%d, index:%d", @@ -1157,8 +1183,10 @@ void policy_mgr_pdev_set_pcl(struct wlan_objmgr_psoc *psoc, void policy_mgr_set_pcl_for_existing_combo( struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode) { - struct policy_mgr_conc_connection_info info; + struct policy_mgr_conc_connection_info + info[MAX_NUMBER_OF_CONC_CONNECTIONS] = { {0} }; enum tQDF_ADAPTER_MODE pcl_mode; + uint8_t num_cxn_del = 0; switch (mode) { case PM_STA_MODE: @@ -1183,12 +1211,13 @@ void policy_mgr_set_pcl_for_existing_combo( if (policy_mgr_mode_specific_connection_count(psoc, mode, NULL) > 0) { /* Check, store and temp delete the mode's parameter */ - policy_mgr_store_and_del_conn_info(psoc, mode, &info); + policy_mgr_store_and_del_conn_info(psoc, mode, false, + info, &num_cxn_del); /* Set the PCL to the FW since connection got updated */ policy_mgr_pdev_set_pcl(psoc, pcl_mode); policy_mgr_notice("Set PCL to FW for mode:%d", mode); /* Restore the connection info */ - policy_mgr_restore_deleted_conn_info(psoc, &info); + policy_mgr_restore_deleted_conn_info(psoc, info, num_cxn_del); } } diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 7d3f4e4a03e6..662dfed033b5 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -334,9 +334,12 @@ void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc, bool in_use); void policy_mgr_store_and_del_conn_info(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, - struct policy_mgr_conc_connection_info *info); + bool all_matching_cxn_to_del, + struct policy_mgr_conc_connection_info *info, + uint8_t *num_cxn_del); void policy_mgr_restore_deleted_conn_info(struct wlan_objmgr_psoc *psoc, - struct policy_mgr_conc_connection_info *info); + struct policy_mgr_conc_connection_info *info, + uint8_t num_cxn_del); void policy_mgr_update_hw_mode_conn_info(struct wlan_objmgr_psoc *psoc, uint32_t num_vdev_mac_entries, struct policy_mgr_vdev_mac_map *vdev_mac_map, diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index b12d66b2164c..f328dd1a7617 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -68,9 +68,12 @@ policy_mgr_next_action_three_connection_table_type QDF_STATUS policy_mgr_get_pcl_for_existing_conn(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, uint8_t *pcl_ch, uint32_t *len, - uint8_t *pcl_weight, uint32_t weight_len) + uint8_t *pcl_weight, uint32_t weight_len, + bool all_matching_cxn_to_del) { - struct policy_mgr_conc_connection_info info; + struct policy_mgr_conc_connection_info + info[MAX_NUMBER_OF_CONC_CONNECTIONS] = { {0} }; + uint8_t num_cxn_del = 0; QDF_STATUS status = QDF_STATUS_SUCCESS; @@ -78,13 +81,14 @@ QDF_STATUS policy_mgr_get_pcl_for_existing_conn(struct wlan_objmgr_psoc *psoc, if (policy_mgr_mode_specific_connection_count(psoc, mode, NULL) > 0) { /* Check, store and temp delete the mode's parameter */ - policy_mgr_store_and_del_conn_info(psoc, mode, &info); + policy_mgr_store_and_del_conn_info(psoc, mode, + all_matching_cxn_to_del, info, &num_cxn_del); /* Get the PCL */ status = policy_mgr_get_pcl(psoc, mode, pcl_ch, len, pcl_weight, weight_len); policy_mgr_notice("Get PCL to FW for mode:%d", mode); /* Restore the connection info */ - policy_mgr_restore_deleted_conn_info(psoc, &info); + policy_mgr_restore_deleted_conn_info(psoc, info, num_cxn_del); } return status; @@ -1283,7 +1287,8 @@ policy_mgr_get_nondfs_preferred_channel(struct wlan_objmgr_psoc *psoc, if (QDF_STATUS_SUCCESS != policy_mgr_get_pcl_for_existing_conn( psoc, mode, &pcl_channels[0], &pcl_len, - pcl_weight, QDF_ARRAY_SIZE(pcl_weight))) + pcl_weight, QDF_ARRAY_SIZE(pcl_weight), + false)) return channel; } else { if (QDF_STATUS_SUCCESS != policy_mgr_get_pcl(psoc, mode, @@ -1464,7 +1469,8 @@ QDF_STATUS policy_mgr_get_sap_mandatory_channel(struct wlan_objmgr_psoc *psoc, status = policy_mgr_get_pcl_for_existing_conn(psoc, PM_SAP_MODE, pcl.pcl_list, &pcl.pcl_len, - pcl.weight_list, QDF_ARRAY_SIZE(pcl.weight_list)); + pcl.weight_list, QDF_ARRAY_SIZE(pcl.weight_list), + false); if (QDF_IS_STATUS_ERROR(status)) { policy_mgr_err("Unable to get PCL for SAP"); return status; @@ -1504,7 +1510,9 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc, struct policy_mgr_pcl_chan_weights *weight) { uint32_t i, j; - struct policy_mgr_conc_connection_info info; + struct policy_mgr_conc_connection_info + info[MAX_NUMBER_OF_CONC_CONNECTIONS] = { {0} }; + uint8_t num_cxn_del = 0; if (!weight->pcl_list) { policy_mgr_err("Invalid pcl"); @@ -1532,7 +1540,8 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc, * check can be used as though a new connection is coming up, * allowing to detect the disallowed channels. */ - policy_mgr_store_and_del_conn_info(psoc, PM_STA_MODE, &info); + policy_mgr_store_and_del_conn_info(psoc, PM_STA_MODE, false, + info, &num_cxn_del); /* * There is a small window between releasing the above lock * and acquiring the same in policy_mgr_allow_concurrency, @@ -1548,7 +1557,7 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc, } /* Restore the connection info */ - policy_mgr_restore_deleted_conn_info(psoc, &info); + policy_mgr_restore_deleted_conn_info(psoc, info, num_cxn_del); } for (i = 0; i < weight->saved_num_chan; i++) { From c989ebe26ede8df389b7e7f848d10d10acdca5e2 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Wed, 9 Aug 2017 15:51:21 -0700 Subject: [PATCH 053/187] qcacmn: Relax the check on nss field during HW mode table lookup Relax the check on nss field during FW advertised HW mode table lookup. Instead of looking for exact match look for less than or equal to the FW advertised nss value. Change-Id: I360d14282f03aad25f4338546cbcbfb3cbd3a76b CRs-Fixed: 2090863 --- src/wlan_policy_mgr_core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 68d6c235ad3c..924997fcf726 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -324,12 +324,12 @@ int8_t policy_mgr_get_matching_hw_mode_index( for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { t_mac0_tx_ss = POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_GET( pm_ctx->hw_mode.hw_mode_list[i]); - if (t_mac0_tx_ss != mac0_tx_ss) + if (t_mac0_tx_ss < mac0_tx_ss) continue; t_mac0_rx_ss = POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_GET( pm_ctx->hw_mode.hw_mode_list[i]); - if (t_mac0_rx_ss != mac0_rx_ss) + if (t_mac0_rx_ss < mac0_rx_ss) continue; t_mac0_bw = POLICY_MGR_HW_MODE_MAC0_BANDWIDTH_GET( @@ -344,12 +344,12 @@ int8_t policy_mgr_get_matching_hw_mode_index( t_mac1_tx_ss = POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_GET( pm_ctx->hw_mode.hw_mode_list[i]); - if (t_mac1_tx_ss != mac1_tx_ss) + if (t_mac1_tx_ss < mac1_tx_ss) continue; t_mac1_rx_ss = POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_GET( pm_ctx->hw_mode.hw_mode_list[i]); - if (t_mac1_rx_ss != mac1_rx_ss) + if (t_mac1_rx_ss < mac1_rx_ss) continue; t_mac1_bw = POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_GET( From 42b8067e18861c19107903dfd3b2349a0be6f9c3 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Mon, 21 Aug 2017 13:01:21 -0700 Subject: [PATCH 054/187] qcacmn: Fix the use of uninitialized variable in policy manager Initialize the uninitialized variable in policy_mgr_get_channel_from_scan_result(). Change-Id: I435e6021b989562b69b3bccaa9a90d9cfd3ae560 CRs-Fixed: 2091884 --- src/wlan_policy_mgr_get_set_utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 1b64f22c45e5..a93c6c31db21 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1705,7 +1705,7 @@ QDF_STATUS policy_mgr_get_channel_from_scan_result( struct wlan_objmgr_psoc *psoc, void *roam_profile, uint8_t *channel) { - QDF_STATUS status; + QDF_STATUS status = QDF_STATUS_E_FAILURE; void *scan_cache = NULL; struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -1729,6 +1729,7 @@ QDF_STATUS policy_mgr_get_channel_from_scan_result( } } else { policy_mgr_err("sme_get_ap_channel_from_scan_cache NULL"); + return QDF_STATUS_E_FAILURE; } if (pm_ctx->sme_cbacks.sme_scan_result_purge) From ecc6e108b13f530230f32aa65b1e68d605f7c347 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Fri, 26 May 2017 18:25:56 -0700 Subject: [PATCH 055/187] qcacmn: Expand the use of gDualMacFeatureDisable INI Few OEMs want DBS to be disabled for connections while keeping DBS scan enabled. Few OEMs want advance DBS scan features to be disabled. Provide different value to gDualMacFeatureDisable INI item to achive the goal. Change-Id: Iddf5df23575a2f907bb8dbd0c37e03ff4ebbdea8 CRs-Fixed: 2068779 --- inc/wlan_policy_mgr_api.h | 24 ++++++++---- inc/wlan_policy_mgr_public_struct.h | 20 ++++++++++ src/wlan_policy_mgr_core.c | 24 +++++++++++- src/wlan_policy_mgr_get_set_utils.c | 61 ++++++++++++++++++++++++++++- 4 files changed, 118 insertions(+), 11 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 06f377f5a853..bbcb7e4c295f 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1709,14 +1709,7 @@ enum policy_mgr_hw_mode_change policy_mgr_get_hw_mode_change_from_hw_mode_index( * * Return: True if master DBS control is enabled */ -static inline bool policy_mgr_is_scan_simultaneous_capable( - struct wlan_objmgr_psoc *psoc) -{ - if (policy_mgr_is_hw_dbs_capable(psoc)) - return true; - - return false; -} +bool policy_mgr_is_scan_simultaneous_capable(struct wlan_objmgr_psoc *psoc); /** * policy_mgr_is_mcc_adaptive_scheduler_enabled() - Function to @@ -1924,4 +1917,19 @@ uint32_t policy_mgr_get_hw_dbs_nss(struct wlan_objmgr_psoc *psoc, * Return: true for success, else false */ bool policy_mgr_is_dnsc_set(struct wlan_objmgr_vdev *vdev); + +/** + * policy_mgr_get_updated_scan_and_fw_mode_config() - Function + * to get latest scan & fw config for DBS + * @psoc: PSOC object information + * @scan_config: DBS related scan config + * @fw_mode_config: DBS related FW config + * @dual_mac_disable_ini: DBS related ini config + * This function returns the latest DBS configuration for + * connection & scan, sent to FW + * Return: SUCCESS or FAILURE + */ +QDF_STATUS policy_mgr_get_updated_scan_and_fw_mode_config( + struct wlan_objmgr_psoc *psoc, uint32_t *scan_config, + uint32_t *fw_mode_config, uint32_t dual_mac_disable_ini); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index f0c73e983817..b10adbaff31a 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -794,6 +794,26 @@ enum policy_mgr_hw_mode_change { POLICY_MGR_SBS_IN_PROGRESS }; +/** + * enum dbs_support - structure to define INI values and their meaning + * + * @ENABLE_DBS_CXN_AND_SCAN: Enable DBS support for connection and scan + * @DISABLE_DBS_CXN_AND_SCAN: Disable DBS support for connection and scan + * @DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN: disable dbs support for + * connection but keep dbs support for scan + * @DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN_WITH_ASYNC_SCAN_OFF: disable dbs support + * for connection but keep dbs for scan but switch off the async scan + * @ENABLE_DBS_CXN_AND_ENABLE_SCAN_WITH_ASYNC_SCAN_OFF: enable dbs support for + * connection and scan but switch off the async scan + */ +enum dbs_support { + ENABLE_DBS_CXN_AND_SCAN, + DISABLE_DBS_CXN_AND_SCAN, + DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN, + DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN_WITH_ASYNC_SCAN_OFF, + ENABLE_DBS_CXN_AND_ENABLE_SCAN_WITH_ASYNC_SCAN_OFF, +}; + /** * struct policy_mgr_conc_connection_info - information of all existing * connections in the wlan system diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 924997fcf726..c284a9647f85 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -136,12 +136,32 @@ QDF_STATUS policy_mgr_get_updated_fw_mode_config( * * Checks if the dual mac feature is disabled in INI * - * Return: true if the dual mac feature is disabled from INI + * Return: true if the dual mac connection is disabled from INI */ bool policy_mgr_is_dual_mac_disabled_in_ini( struct wlan_objmgr_psoc *psoc) { - return wlan_objmgr_psoc_get_dual_mac_disable(psoc); + bool is_disabled = false; + enum dbs_support dbs_type = wlan_objmgr_psoc_get_dual_mac_disable(psoc); + + /* + * If DBS support for connection is disabled through INI then assume + * that DBS is not supported, so that policy manager takes + * the decision considering non-dbs cases only. + * + * For DBS scan check the INI value explicitly + */ + switch (dbs_type) { + case DISABLE_DBS_CXN_AND_SCAN: + case DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN: + case DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN_WITH_ASYNC_SCAN_OFF: + is_disabled = true; + break; + default: + break; + } + + return is_disabled; } uint32_t policy_mgr_mcc_to_scc_switch_mode_in_user_cfg( diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 1b64f22c45e5..a2561f5b038e 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -375,13 +375,20 @@ void policy_mgr_init_dbs_config(struct wlan_objmgr_psoc *psoc, /* If dual mac features are disabled in the INI, we * need not proceed further */ - if (policy_mgr_is_dual_mac_disabled_in_ini(psoc)) { + if (DISABLE_DBS_CXN_AND_SCAN == + wlan_objmgr_psoc_get_dual_mac_disable(psoc)) { policy_mgr_err("Disabling dual mac capabilities"); /* All capabilites are initialized to 0. We can return */ goto done; } /* Initialize concurrent_scan_config_bits with default FW value */ + WMI_DBS_CONC_SCAN_CFG_ASYNC_DBS_SCAN_SET( + pm_ctx->dual_mac_cfg.cur_scan_config, + WMI_DBS_CONC_SCAN_CFG_ASYNC_DBS_SCAN_GET(scan_config)); + WMI_DBS_CONC_SCAN_CFG_SYNC_DBS_SCAN_SET( + pm_ctx->dual_mac_cfg.cur_scan_config, + WMI_DBS_CONC_SCAN_CFG_SYNC_DBS_SCAN_GET(scan_config)); WMI_DBS_CONC_SCAN_CFG_DBS_SCAN_SET( pm_ctx->dual_mac_cfg.cur_scan_config, WMI_DBS_CONC_SCAN_CFG_DBS_SCAN_GET(scan_config)); @@ -399,6 +406,9 @@ void policy_mgr_init_dbs_config(struct wlan_objmgr_psoc *psoc, WMI_DBS_FW_MODE_CFG_AGILE_DFS_SET( pm_ctx->dual_mac_cfg.cur_fw_mode_config, WMI_DBS_FW_MODE_CFG_AGILE_DFS_GET(fw_config)); + WMI_DBS_FW_MODE_CFG_DBS_FOR_CXN_SET( + pm_ctx->dual_mac_cfg.cur_fw_mode_config, + WMI_DBS_FW_MODE_CFG_DBS_FOR_CXN_GET(fw_config)); done: /* Initialize the previous scan/fw mode config */ pm_ctx->dual_mac_cfg.prev_scan_config = @@ -2567,3 +2577,52 @@ uint32_t policy_mgr_get_hw_dbs_nss(struct wlan_objmgr_psoc *psoc, return final_max_rf_chains; } + +bool policy_mgr_is_scan_simultaneous_capable(struct wlan_objmgr_psoc *psoc) +{ + if (DISABLE_DBS_CXN_AND_SCAN != + wlan_objmgr_psoc_get_dual_mac_disable(psoc)) + return true; + + return false; +} + +QDF_STATUS policy_mgr_get_updated_scan_and_fw_mode_config( + struct wlan_objmgr_psoc *psoc, uint32_t *scan_config, + uint32_t *fw_mode_config, uint32_t dual_mac_disable_ini) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + *scan_config = pm_ctx->dual_mac_cfg.cur_scan_config; + *fw_mode_config = pm_ctx->dual_mac_cfg.cur_fw_mode_config; + switch (dual_mac_disable_ini) { + case DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN_WITH_ASYNC_SCAN_OFF: + policy_mgr_debug("dual_mac_disable_ini:%d async/dbs off", + dual_mac_disable_ini); + WMI_DBS_CONC_SCAN_CFG_ASYNC_DBS_SCAN_SET(*scan_config, 0); + WMI_DBS_FW_MODE_CFG_DBS_FOR_CXN_SET(*fw_mode_config, 0); + break; + case DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN: + policy_mgr_debug("dual_mac_disable_ini:%d dbs_cxn off", + dual_mac_disable_ini); + WMI_DBS_FW_MODE_CFG_DBS_FOR_CXN_SET(*fw_mode_config, 0); + break; + case ENABLE_DBS_CXN_AND_ENABLE_SCAN_WITH_ASYNC_SCAN_OFF: + policy_mgr_debug("dual_mac_disable_ini:%d async off", + dual_mac_disable_ini); + WMI_DBS_CONC_SCAN_CFG_ASYNC_DBS_SCAN_SET(*scan_config, 0); + break; + default: + break; + } + policy_mgr_debug("*scan_config:%x ", *scan_config); + policy_mgr_debug("*fw_mode_config:%x ", *fw_mode_config); + + return QDF_STATUS_SUCCESS; +} From 8b60ebb5c6182322fa4a842fd3e667e7bcc0c2f6 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Thu, 17 Aug 2017 14:53:07 -0700 Subject: [PATCH 056/187] qcacmn: Reduce log spam from policy manager Reduce log spam from policy manager by converting non essential & periodic logs to debug level. Change-Id: I3cb01b47dd56edcf141479b14ea1e51e89b0473a CRs-Fixed: 2094743 --- src/wlan_policy_mgr_action.c | 26 +++++++-------- src/wlan_policy_mgr_core.c | 34 ++++++++++---------- src/wlan_policy_mgr_get_set_utils.c | 50 ++++++++++++++--------------- src/wlan_policy_mgr_pcl.c | 8 ++--- 4 files changed, 59 insertions(+), 59 deletions(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 8c6b08c563f0..358c25428ee0 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -59,11 +59,11 @@ void policy_mgr_hw_mode_transition_cb(uint32_t old_hw_mode_index, return; } - policy_mgr_notice("old_hw_mode_index=%d, new_hw_mode_index=%d", + policy_mgr_debug("old_hw_mode_index=%d, new_hw_mode_index=%d", old_hw_mode_index, new_hw_mode_index); for (i = 0; i < num_vdev_mac_entries; i++) - policy_mgr_notice("vdev_id:%d mac_id:%d", + policy_mgr_debug("vdev_id:%d mac_id:%d", vdev_mac_map[i].vdev_id, vdev_mac_map[i].mac_id); @@ -74,11 +74,11 @@ void policy_mgr_hw_mode_transition_cb(uint32_t old_hw_mode_index, return; } - policy_mgr_notice("MAC0: TxSS:%d, RxSS:%d, Bw:%d", + policy_mgr_debug("MAC0: TxSS:%d, RxSS:%d, Bw:%d", hw_mode.mac0_tx_ss, hw_mode.mac0_rx_ss, hw_mode.mac0_bw); - policy_mgr_notice("MAC1: TxSS:%d, RxSS:%d, Bw:%d", + policy_mgr_debug("MAC1: TxSS:%d, RxSS:%d, Bw:%d", hw_mode.mac1_tx_ss, hw_mode.mac1_rx_ss, hw_mode.mac1_bw); - policy_mgr_notice("DBS:%d, Agile DFS:%d, SBS:%d", + policy_mgr_debug("DBS:%d, Agile DFS:%d, SBS:%d", hw_mode.dbs_cap, hw_mode.agile_dfs_cap, hw_mode.sbs_cap); /* update pm_conc_connection_list */ @@ -116,11 +116,11 @@ QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc, * allow to request FW for 2x2 */ if ((HW_MODE_SS_2x2 == mac0_ss) && (!pm_ctx->user_cfg.enable2x2)) { - policy_mgr_notice("2x2 is not allowed downgrading to 1x1 for mac0"); + policy_mgr_debug("2x2 is not allowed downgrading to 1x1 for mac0"); mac0_ss = HW_MODE_SS_1x1; } if ((HW_MODE_SS_2x2 == mac1_ss) && (!pm_ctx->user_cfg.enable2x2)) { - policy_mgr_notice("2x2 is not allowed downgrading to 1x1 for mac1"); + policy_mgr_debug("2x2 is not allowed downgrading to 1x1 for mac1"); mac1_ss = HW_MODE_SS_1x1; } @@ -137,7 +137,7 @@ QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc, msg.session_id = session_id; msg.context = psoc; - policy_mgr_notice("set hw mode to sme: hw_mode_index: %d session:%d reason:%d", + policy_mgr_debug("set hw mode to sme: hw_mode_index: %d session:%d reason:%d", msg.hw_mode_index, msg.session_id, msg.reason); status = pm_ctx->sme_cbacks.sme_pdev_set_hw_mode(msg); @@ -884,7 +884,7 @@ QDF_STATUS policy_mgr_set_hw_mode_on_channel_switch( goto done; } - policy_mgr_notice("action:%d session id:%d", action, session_id); + policy_mgr_debug("action:%d session id:%d", action, session_id); /* Opportunistic timer is started, PM will check if MCC upgrade can be * done on timer expiry. This avoids any possible ping pong effect @@ -894,7 +894,7 @@ QDF_STATUS policy_mgr_set_hw_mode_on_channel_switch( qdf_status = policy_mgr_restart_opportunistic_timer( psoc, false); if (QDF_IS_STATUS_SUCCESS(qdf_status)) - policy_mgr_notice("opportunistic timer for MCC upgrade"); + policy_mgr_debug("opportunistic timer for MCC upgrade"); goto done; } @@ -928,7 +928,7 @@ void policy_mgr_checkn_update_hw_mode_single_mac_mode( if (!WLAN_REG_IS_SAME_BAND_CHANNELS(channel, pm_conc_connection_list[i].chan)) { qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); - policy_mgr_notice("DBS required"); + policy_mgr_debug("DBS required"); return; } } @@ -1049,7 +1049,7 @@ QDF_STATUS policy_mgr_update_connection_info_utfw( vdev_id); return status; } - policy_mgr_notice("--> updating entry at index[%d]", conn_index); + policy_mgr_debug("--> updating entry at index[%d]", conn_index); policy_mgr_update_conc_list(psoc, conn_index, policy_mgr_get_mode(type, sub_type), @@ -1074,7 +1074,7 @@ QDF_STATUS policy_mgr_incr_connection_count_utfw(struct wlan_objmgr_psoc *psoc, MAX_NUMBER_OF_CONC_CONNECTIONS); return status; } - policy_mgr_notice("--> filling entry at index[%d]", conn_index); + policy_mgr_debug("--> filling entry at index[%d]", conn_index); policy_mgr_update_conc_list(psoc, conn_index, policy_mgr_get_mode(type, sub_type), diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 924997fcf726..0cc4d412292e 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -373,7 +373,7 @@ int8_t policy_mgr_get_matching_hw_mode_index( continue; found = i; - policy_mgr_notice("hw_mode index %d found", i); + policy_mgr_debug("hw_mode index %d found", i); break; } return found; @@ -410,11 +410,11 @@ int8_t policy_mgr_get_hw_mode_idx_from_dbs_hw_list( policy_mgr_get_tx_rx_ss_from_config(mac0_ss, &mac0_tx_ss, &mac0_rx_ss); policy_mgr_get_tx_rx_ss_from_config(mac1_ss, &mac1_tx_ss, &mac1_rx_ss); - policy_mgr_notice("MAC0: TxSS=%d, RxSS=%d, BW=%d", + policy_mgr_debug("MAC0: TxSS=%d, RxSS=%d, BW=%d", mac0_tx_ss, mac0_rx_ss, mac0_bw); - policy_mgr_notice("MAC1: TxSS=%d, RxSS=%d, BW=%d", + policy_mgr_debug("MAC1: TxSS=%d, RxSS=%d, BW=%d", mac1_tx_ss, mac1_rx_ss, mac1_bw); - policy_mgr_notice("DBS=%d, Agile DFS=%d, SBS=%d", + policy_mgr_debug("DBS=%d, Agile DFS=%d, SBS=%d", dbs, dfs, sbs); return policy_mgr_get_matching_hw_mode_index(psoc, mac0_tx_ss, @@ -675,7 +675,7 @@ void policy_mgr_restore_deleted_conn_info(struct wlan_objmgr_psoc *psoc, num_cxn_del * sizeof(*info)); qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); - policy_mgr_notice("Restored the deleleted conn info, vdev:%d, index:%d", + policy_mgr_debug("Restored the deleleted conn info, vdev:%d, index:%d", info->vdev_id, conn_index); } @@ -719,7 +719,7 @@ void policy_mgr_update_hw_mode_conn_info(struct wlan_objmgr_psoc *psoc, if (found) { pm_conc_connection_list[conn_index].mac = vdev_mac_map[i].mac_id; - policy_mgr_notice("vdev:%d, mac:%d", + policy_mgr_debug("vdev:%d, mac:%d", pm_conc_connection_list[conn_index].vdev_id, pm_conc_connection_list[conn_index].mac); if (pm_ctx->cdp_cbacks.cdp_update_mac_id) @@ -769,10 +769,10 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status, return; } - policy_mgr_notice("cfgd_hw_mode_index=%d", cfgd_hw_mode_index); + policy_mgr_debug("cfgd_hw_mode_index=%d", cfgd_hw_mode_index); for (i = 0; i < num_vdev_mac_entries; i++) - policy_mgr_notice("vdev_id:%d mac_id:%d", + policy_mgr_debug("vdev_id:%d mac_id:%d", vdev_mac_map[i].vdev_id, vdev_mac_map[i].mac_id); @@ -783,11 +783,11 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status, return; } - policy_mgr_notice("MAC0: TxSS:%d, RxSS:%d, Bw:%d", + policy_mgr_debug("MAC0: TxSS:%d, RxSS:%d, Bw:%d", hw_mode.mac0_tx_ss, hw_mode.mac0_rx_ss, hw_mode.mac0_bw); - policy_mgr_notice("MAC1: TxSS:%d, RxSS:%d, Bw:%d", + policy_mgr_debug("MAC1: TxSS:%d, RxSS:%d, Bw:%d", hw_mode.mac1_tx_ss, hw_mode.mac1_rx_ss, hw_mode.mac1_bw); - policy_mgr_notice("DBS:%d, Agile DFS:%d, SBS:%d", + policy_mgr_debug("DBS:%d, Agile DFS:%d, SBS:%d", hw_mode.dbs_cap, hw_mode.agile_dfs_cap, hw_mode.sbs_cap); /* update pm_conc_connection_list */ @@ -1168,7 +1168,7 @@ void policy_mgr_pdev_set_pcl(struct wlan_objmgr_psoc *psoc, if (status != QDF_STATUS_SUCCESS) policy_mgr_err("Send soc set PCL to SME failed"); else - policy_mgr_notice("Set PCL to FW for mode:%d", mode); + policy_mgr_debug("Set PCL to FW for mode:%d", mode); } @@ -1215,7 +1215,7 @@ void policy_mgr_set_pcl_for_existing_combo( info, &num_cxn_del); /* Set the PCL to the FW since connection got updated */ policy_mgr_pdev_set_pcl(psoc, pcl_mode); - policy_mgr_notice("Set PCL to FW for mode:%d", mode); + policy_mgr_debug("Set PCL to FW for mode:%d", mode); /* Restore the connection info */ policy_mgr_restore_deleted_conn_info(psoc, info, num_cxn_del); } @@ -1242,7 +1242,7 @@ void pm_dbs_opportunistic_timer_handler(void *data) /* if we still need it */ action = policy_mgr_need_opportunistic_upgrade(psoc); - policy_mgr_notice("action:%d", action); + policy_mgr_debug("action:%d", action); if (action) { /* lets call for action */ /* session id is being used only @@ -1697,7 +1697,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, if (PM_NONE == pcl) { /* msg */ - policy_mgr_notice("pcl is 0"); + policy_mgr_debug("pcl is 0"); return QDF_STATUS_SUCCESS; } /* get the channel list for current domain */ @@ -1714,7 +1714,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, if (((mode == PM_SAP_MODE) || (mode == PM_P2P_GO_MODE)) && (policy_mgr_mode_specific_connection_count( psoc, PM_STA_MODE, NULL) > 0)) { - policy_mgr_notice("STA present, skip DFS channels from pcl for SAP/Go"); + policy_mgr_debug("STA present, skip DFS channels from pcl for SAP/Go"); skip_dfs_channel = true; } @@ -2082,7 +2082,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, } if ((*len != 0) && (*len != i)) - policy_mgr_notice("pcl len (%d) and weight list len mismatch (%d)", + policy_mgr_debug("pcl len (%d) and weight list len mismatch (%d)", *len, i); /* check the channel avoidance list */ diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 1b64f22c45e5..e558971f1694 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -256,7 +256,7 @@ QDF_STATUS policy_mgr_update_hw_mode_list(struct wlan_objmgr_psoc *psoc, if (pm_ctx->hw_mode.hw_mode_list) { qdf_mem_free(pm_ctx->hw_mode.hw_mode_list); pm_ctx->hw_mode.hw_mode_list = NULL; - policy_mgr_err("DBS list is freed"); + policy_mgr_debug("DBS list is freed"); } pm_ctx->num_dbs_hw_modes = phy_caps->num_hw_modes.num_hw_modes; @@ -268,7 +268,7 @@ QDF_STATUS policy_mgr_update_hw_mode_list(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_FAILURE; } - policy_mgr_err("Updated HW mode list: Num modes:%d", + policy_mgr_debug("Updated HW mode list: Num modes:%d", pm_ctx->num_dbs_hw_modes); for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { @@ -343,17 +343,17 @@ void policy_mgr_dump_dbs_hw_mode(struct wlan_objmgr_psoc *psoc) for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { param = pm_ctx->hw_mode.hw_mode_list[i]; - policy_mgr_err("[%d]-MAC0: tx_ss:%d rx_ss:%d bw_idx:%d", + policy_mgr_debug("[%d]-MAC0: tx_ss:%d rx_ss:%d bw_idx:%d", i, POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_GET(param), POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_GET(param), POLICY_MGR_HW_MODE_MAC0_BANDWIDTH_GET(param)); - policy_mgr_err("[%d]-MAC1: tx_ss:%d rx_ss:%d bw_idx:%d", + policy_mgr_debug("[%d]-MAC1: tx_ss:%d rx_ss:%d bw_idx:%d", i, POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_GET(param), POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_GET(param), POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_GET(param)); - policy_mgr_err("[%d] DBS:%d SBS:%d", i, + policy_mgr_debug("[%d] DBS:%d SBS:%d", i, POLICY_MGR_HW_MODE_DBS_MODE_GET(param), POLICY_MGR_HW_MODE_SBS_MODE_GET(param)); } @@ -522,11 +522,11 @@ bool policy_mgr_is_hw_dbs_capable(struct wlan_objmgr_psoc *psoc) } if (!policy_mgr_is_dbs_enable(psoc)) { - policy_mgr_notice("DBS is disabled"); + policy_mgr_debug("DBS is disabled"); return false; } if (pm_ctx->wma_cbacks.wma_is_service_enabled) { - policy_mgr_notice("DBS service bit map: %d", + policy_mgr_debug("DBS service bit map: %d", pm_ctx->wma_cbacks.wma_is_service_enabled( WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT)); @@ -542,9 +542,9 @@ bool policy_mgr_is_hw_dbs_capable(struct wlan_objmgr_psoc *psoc) for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { param = pm_ctx->hw_mode.hw_mode_list[i]; - policy_mgr_notice("HW param: %x", param); + policy_mgr_debug("HW param: %x", param); if (POLICY_MGR_HW_MODE_DBS_MODE_GET(param)) { - policy_mgr_notice("HW (%d) is DBS capable", i); + policy_mgr_debug("HW (%d) is DBS capable", i); found = 1; break; } @@ -567,7 +567,7 @@ bool policy_mgr_is_hw_sbs_capable(struct wlan_objmgr_psoc *psoc) return false; } if (pm_ctx->wma_cbacks.wma_is_service_enabled) { - policy_mgr_notice("DBS service bit map: %d", + policy_mgr_debug("DBS service bit map: %d", pm_ctx->wma_cbacks.wma_is_service_enabled( WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT)); @@ -583,9 +583,9 @@ bool policy_mgr_is_hw_sbs_capable(struct wlan_objmgr_psoc *psoc) for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { param = pm_ctx->hw_mode.hw_mode_list[i]; - policy_mgr_notice("HW param: %x", param); + policy_mgr_debug("HW param: %x", param); if (POLICY_MGR_HW_MODE_SBS_MODE_GET(param)) { - policy_mgr_notice("HW (%d) is SBS capable", i); + policy_mgr_debug("HW (%d) is SBS capable", i); found = 1; break; } @@ -652,7 +652,7 @@ QDF_STATUS policy_mgr_get_dbs_hw_modes(struct wlan_objmgr_psoc *psoc, (dbs_mode == HW_MODE_DBS)) && (found_one_by_one < 0)) { found_one_by_one = i; - policy_mgr_notice("1x1 hw_mode index %d found", i); + policy_mgr_debug("1x1 hw_mode index %d found", i); /* Once an entry is found, need not check for 1x1 * again */ @@ -666,7 +666,7 @@ QDF_STATUS policy_mgr_get_dbs_hw_modes(struct wlan_objmgr_psoc *psoc, (dbs_mode == HW_MODE_DBS)) && (found_two_by_two < 0)) { found_two_by_two = i; - policy_mgr_notice("2x2 hw_mode index %d found", i); + policy_mgr_debug("2x2 hw_mode index %d found", i); /* Once an entry is found, need not check for 2x2 * again */ @@ -688,7 +688,7 @@ QDF_STATUS policy_mgr_get_current_hw_mode(struct wlan_objmgr_psoc *psoc, QDF_STATUS status; uint32_t old_hw_index = 0, new_hw_index = 0; - policy_mgr_notice("Get the current hw mode"); + policy_mgr_debug("Get the current hw mode"); status = policy_mgr_get_old_and_new_hw_index(psoc, &old_hw_index, &new_hw_index); @@ -869,7 +869,7 @@ void policy_mgr_soc_set_dual_mac_cfg_cb(enum set_hw_mode_status status, uint32_t scan_config, uint32_t fw_mode_config) { - policy_mgr_notice("Status:%d for scan_config:%x fw_mode_config:%x", + policy_mgr_debug("Status:%d for scan_config:%x fw_mode_config:%x", status, scan_config, fw_mode_config); } @@ -918,7 +918,7 @@ void policy_mgr_set_dual_mac_scan_config(struct wlan_objmgr_psoc *psoc, cfg.set_dual_mac_cb = (void *)policy_mgr_soc_set_dual_mac_cfg_cb; - policy_mgr_notice("scan_config:%x fw_mode_config:%x", + policy_mgr_debug("scan_config:%x fw_mode_config:%x", cfg.scan_config, cfg.fw_mode_config); status = pm_ctx->sme_cbacks.sme_soc_set_dual_mac_config(cfg); @@ -965,7 +965,7 @@ void policy_mgr_set_dual_mac_fw_mode_config(struct wlan_objmgr_psoc *psoc, cfg.set_dual_mac_cb = (void *)policy_mgr_soc_set_dual_mac_cfg_cb; - policy_mgr_notice("scan_config:%x fw_mode_config:%x", + policy_mgr_debug("scan_config:%x fw_mode_config:%x", cfg.scan_config, cfg.fw_mode_config); status = pm_ctx->sme_cbacks.sme_soc_set_dual_mac_config(cfg); @@ -1118,7 +1118,7 @@ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, } - policy_mgr_notice("No.# of active sessions for mode %d = %d", + policy_mgr_debug("No.# of active sessions for mode %d = %d", mode, pm_ctx->no_of_active_sessions[mode]); /* * Get PCL logic makes use of the connection info structure. @@ -1130,7 +1130,7 @@ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, /* Set PCL of STA to the FW */ policy_mgr_pdev_set_pcl(psoc, mode); qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); - policy_mgr_notice("Set PCL of STA to FW"); + policy_mgr_debug("Set PCL of STA to FW"); } policy_mgr_incr_connection_count(psoc, session_id); if ((policy_mgr_mode_specific_connection_count( @@ -1185,7 +1185,7 @@ QDF_STATUS policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, break; } - policy_mgr_notice("No.# of active sessions for mode %d = %d", + policy_mgr_debug("No.# of active sessions for mode %d = %d", mode, pm_ctx->no_of_active_sessions[mode]); policy_mgr_decr_connection_count(psoc, session_id); @@ -1261,7 +1261,7 @@ QDF_STATUS policy_mgr_incr_connection_count( conn_table_entry.mac_id, chain_mask, nss, vdev_id, true); - policy_mgr_notice("Add at idx:%d vdev %d mac=%d", + policy_mgr_debug("Add at idx:%d vdev %d mac=%d", conn_index, vdev_id, conn_table_entry.mac_id); @@ -1386,7 +1386,7 @@ bool policy_mgr_is_ibss_conn_exist(struct wlan_objmgr_psoc *psoc, status = true; } else { *ibss_channel = pm_conc_connection_list[list[index]].chan; - policy_mgr_notice("Multiple IBSS connections, picking first one"); + policy_mgr_debug("Multiple IBSS connections, picking first one"); status = true; } qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); @@ -1418,7 +1418,7 @@ bool policy_mgr_get_mode_specific_conn_info(struct wlan_objmgr_psoc *psoc, psoc, mode, list); qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); if (count == 0) { - policy_mgr_err("No mode:[%d] connection", mode); + policy_mgr_debug("No mode:[%d] connection", mode); status = false; } else if (count == 1) { *channel = pm_conc_connection_list[list[index]].chan; @@ -1434,7 +1434,7 @@ bool policy_mgr_get_mode_specific_conn_info(struct wlan_objmgr_psoc *psoc, *channel = pm_conc_connection_list[list[index]].chan; *vdev_id = pm_conc_connection_list[list[index]].vdev_id; - policy_mgr_notice("Multiple mode:[%d] connections, picking first one", + policy_mgr_debug("Multiple mode:[%d] connections, picking first one", mode); status = true; } diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index f328dd1a7617..9ac167e088d6 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -77,7 +77,7 @@ QDF_STATUS policy_mgr_get_pcl_for_existing_conn(struct wlan_objmgr_psoc *psoc, QDF_STATUS status = QDF_STATUS_SUCCESS; - policy_mgr_notice("get pcl for existing conn:%d", mode); + policy_mgr_debug("get pcl for existing conn:%d", mode); if (policy_mgr_mode_specific_connection_count(psoc, mode, NULL) > 0) { /* Check, store and temp delete the mode's parameter */ @@ -86,7 +86,7 @@ QDF_STATUS policy_mgr_get_pcl_for_existing_conn(struct wlan_objmgr_psoc *psoc, /* Get the PCL */ status = policy_mgr_get_pcl(psoc, mode, pcl_ch, len, pcl_weight, weight_len); - policy_mgr_notice("Get PCL to FW for mode:%d", mode); + policy_mgr_debug("Get PCL to FW for mode:%d", mode); /* Restore the connection info */ policy_mgr_restore_deleted_conn_info(psoc, info, num_cxn_del); } @@ -1480,7 +1480,7 @@ QDF_STATUS policy_mgr_get_sap_mandatory_channel(struct wlan_objmgr_psoc *psoc, * coming up. */ if (!pcl.pcl_len) { - policy_mgr_notice("policy_mgr_get_pcl_for_existing_conn returned no pcl"); + policy_mgr_debug("policy_mgr_get_pcl_for_existing_conn returned no pcl"); status = policy_mgr_get_pcl(psoc, PM_SAP_MODE, pcl.pcl_list, &pcl.pcl_len, pcl.weight_list, @@ -1501,7 +1501,7 @@ QDF_STATUS policy_mgr_get_sap_mandatory_channel(struct wlan_objmgr_psoc *psoc, } *chan = pcl.pcl_list[0]; - policy_mgr_notice("mandatory channel:%d", *chan); + policy_mgr_debug("mandatory channel:%d", *chan); return QDF_STATUS_SUCCESS; } From 05328bb022b1a797092386854ec991f781d228bc Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Thu, 27 Apr 2017 12:31:41 -0700 Subject: [PATCH 057/187] qcacmn: Save the unsafe channels in policy manager Save the list of unsafe channels in policy manager to be used on PCL. Change-Id: Ibb705830e878d1cc03dfbc76e49c169d2febd75d CRs-Fixed: 2095290 --- inc/wlan_policy_mgr_api.h | 6 ++- src/wlan_policy_mgr_core.c | 2 +- src/wlan_policy_mgr_i.h | 23 ++++++++ src/wlan_policy_mgr_init_deinit.c | 5 ++ src/wlan_policy_mgr_pcl.c | 90 ++++++++++++++++++++++++++++++- 5 files changed, 121 insertions(+), 5 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index bbcb7e4c295f..6bd3f0bf1910 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -304,6 +304,7 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, /** * policy_mgr_update_with_safe_channel_list() - provides the safe * channel list + * @psoc: PSOC object information * @pcl_channels: channel list * @len: length of the list * @weight_list: Weights of the PCL @@ -314,8 +315,9 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, * * Return: None */ -void policy_mgr_update_with_safe_channel_list(uint8_t *pcl_channels, - uint32_t *len, uint8_t *weight_list, uint32_t weight_len); +void policy_mgr_update_with_safe_channel_list(struct wlan_objmgr_psoc *psoc, + uint8_t *pcl_channels, uint32_t *len, + uint8_t *weight_list, uint32_t weight_len); /** * policy_mgr_get_nondfs_preferred_channel() - to get non-dfs preferred channel diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 4cc43d08d608..be108750f5c4 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -2106,7 +2106,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, *len, i); /* check the channel avoidance list */ - policy_mgr_update_with_safe_channel_list(pcl_channels, len, + policy_mgr_update_with_safe_channel_list(psoc, pcl_channels, len, pcl_weights, weight_len); return status; diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 662dfed033b5..d27b3e71add1 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -224,6 +224,8 @@ extern enum policy_mgr_conc_next_action * change is in progress * @enable_mcc_adaptive_scheduler: Enable MCC adaptive scheduler * value from INI + * @unsafe_channel_list: LTE coex channel avoidance list + * @unsafe_channel_count: LTE coex channel avoidance list count */ struct policy_mgr_psoc_priv_obj { struct wlan_objmgr_psoc *psoc; @@ -250,6 +252,8 @@ struct policy_mgr_psoc_priv_obj { struct dual_mac_config dual_mac_cfg; uint32_t hw_mode_change_in_progress; struct policy_mgr_user_cfg user_cfg; + uint16_t unsafe_channel_list[QDF_MAX_NUM_CHAN]; + uint16_t unsafe_channel_count; }; /** @@ -403,4 +407,23 @@ QDF_STATUS policy_mgr_reset_sap_mandatory_channels( bool policy_mgr_get_mode_specific_conn_info(struct wlan_objmgr_psoc *psoc, uint8_t *channel, uint8_t *vdev_id, enum policy_mgr_con_mode mode); + +/** + * policy_mgr_reg_chan_change_callback() - Callback to be + * invoked by regulatory module when valid channel list changes + * @psoc: PSOC object information + * @pdev: PDEV object information + * @chan_list: New channel list + * @avoid_freq_ind: LTE coex avoid channel list + * @arg: Information passed at registration + * + * Get updated channel list from regulatory module + * + * Return: None + */ +void policy_mgr_reg_chan_change_callback(struct wlan_objmgr_psoc *psoc, + struct wlan_objmgr_pdev *pdev, + struct regulatory_channel *chan_list, + struct avoid_freq_ind_data *avoid_freq_ind, + void *arg); #endif diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 43f325412fdd..fd91357a3ecc 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -101,6 +101,9 @@ static QDF_STATUS policy_mgr_pdev_obj_create_cb(struct wlan_objmgr_pdev *pdev, policy_mgr_ctx->pdev = pdev; + wlan_reg_register_chan_change_callback(psoc, + policy_mgr_reg_chan_change_callback, NULL); + return QDF_STATUS_SUCCESS; } @@ -118,6 +121,8 @@ static QDF_STATUS policy_mgr_pdev_obj_destroy_cb(struct wlan_objmgr_pdev *pdev, } policy_mgr_ctx->pdev = NULL; + wlan_reg_unregister_chan_change_callback(psoc, + policy_mgr_reg_chan_change_callback); return QDF_STATUS_SUCCESS; } diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 9ac167e088d6..9b88c76d384b 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -142,9 +142,95 @@ void policy_mgr_decr_session_set_pcl(struct wlan_objmgr_psoc *psoc, return; } -void policy_mgr_update_with_safe_channel_list(uint8_t *pcl_channels, - uint32_t *len, uint8_t *weight_list, uint32_t weight_len) +void policy_mgr_reg_chan_change_callback(struct wlan_objmgr_psoc *psoc, + struct wlan_objmgr_pdev *pdev, + struct regulatory_channel *chan_list, + struct avoid_freq_ind_data *avoid_freq_ind, + void *arg) { + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + if (!avoid_freq_ind) { + policy_mgr_debug("avoid_freq_ind NULL"); + return; + } + + pm_ctx->unsafe_channel_count = avoid_freq_ind->chan_list.ch_cnt >= + QDF_MAX_NUM_CHAN ? + QDF_MAX_NUM_CHAN : avoid_freq_ind->chan_list.ch_cnt; + if (pm_ctx->unsafe_channel_count) + qdf_mem_copy(pm_ctx->unsafe_channel_list, + avoid_freq_ind->chan_list.ch_list, + pm_ctx->unsafe_channel_count); + policy_mgr_debug("Channel list update, recieved %d avoided channels", + pm_ctx->unsafe_channel_count); +} + +void policy_mgr_update_with_safe_channel_list(struct wlan_objmgr_psoc *psoc, + uint8_t *pcl_channels, uint32_t *len, + uint8_t *weight_list, uint32_t weight_len) +{ + uint8_t current_channel_list[QDF_MAX_NUM_CHAN]; + uint8_t org_weight_list[QDF_MAX_NUM_CHAN]; + uint8_t is_unsafe = 1; + uint8_t i, j; + uint32_t safe_channel_count = 0, current_channel_count = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + if (len) { + current_channel_count = QDF_MIN(*len, QDF_MAX_NUM_CHAN); + } else { + policy_mgr_err("invalid number of channel length"); + return; + } + + if (pm_ctx->unsafe_channel_count == 0) { + policy_mgr_debug("There are no unsafe channels"); + return; + } + + qdf_mem_copy(current_channel_list, pcl_channels, + current_channel_count); + qdf_mem_zero(pcl_channels, current_channel_count); + + qdf_mem_copy(org_weight_list, weight_list, QDF_MAX_NUM_CHAN); + qdf_mem_zero(weight_list, weight_len); + + for (i = 0; i < current_channel_count; i++) { + is_unsafe = 0; + for (j = 0; j < pm_ctx->unsafe_channel_count; j++) { + if (current_channel_list[i] == + pm_ctx->unsafe_channel_list[j]) { + /* Found unsafe channel, update it */ + is_unsafe = 1; + policy_mgr_warn("CH %d is not safe", + current_channel_list[i]); + break; + } + } + if (!is_unsafe) { + pcl_channels[safe_channel_count] = + current_channel_list[i]; + if (safe_channel_count < weight_len) + weight_list[safe_channel_count] = + org_weight_list[i]; + safe_channel_count++; + } + } + *len = safe_channel_count; + return; } From 0027e3f02b6f71896ee40316a0d895c1529d825d Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Fri, 5 May 2017 05:29:07 -0400 Subject: [PATCH 058/187] qcacmn: Fix hotspot starting failure When softap is stopping, there are two threads accessing the "conc_connection_list". hostapd thread (__wlan_hdd_cfg80211_stop_ap) read and modify it by cds_decr_session_set_pcl. cds_mc_thread thread (cds_get_valid_chan_weights) read and modify it by cds_store_and_del_conn_info and cds_restore_deleted_conn_info. They are not protected,which causes two same station connection info saved to the "conc_connection_list". This fix is to acquire lock before read/modify the list. Change-Id: I5f1becef711363f659044c46e69fab1cd6d07d81 CRs-Fixed: 2038000 --- src/wlan_policy_mgr_core.c | 12 +++++++++++- src/wlan_policy_mgr_pcl.c | 23 +++++++++++++++++++++-- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index be108750f5c4..a8a92b446df3 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -1207,6 +1207,13 @@ void policy_mgr_set_pcl_for_existing_combo( info[MAX_NUMBER_OF_CONC_CONNECTIONS] = { {0} }; enum tQDF_ADAPTER_MODE pcl_mode; uint8_t num_cxn_del = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } switch (mode) { case PM_STA_MODE: @@ -1228,17 +1235,20 @@ void policy_mgr_set_pcl_for_existing_combo( policy_mgr_err("Invalid mode to set PCL"); return; }; - + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); if (policy_mgr_mode_specific_connection_count(psoc, mode, NULL) > 0) { /* Check, store and temp delete the mode's parameter */ policy_mgr_store_and_del_conn_info(psoc, mode, false, info, &num_cxn_del); + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); /* Set the PCL to the FW since connection got updated */ policy_mgr_pdev_set_pcl(psoc, pcl_mode); policy_mgr_debug("Set PCL to FW for mode:%d", mode); + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); /* Restore the connection info */ policy_mgr_restore_deleted_conn_info(psoc, info, num_cxn_del); } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); } /** diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 9b88c76d384b..09b4009d70f4 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -76,20 +76,30 @@ QDF_STATUS policy_mgr_get_pcl_for_existing_conn(struct wlan_objmgr_psoc *psoc, uint8_t num_cxn_del = 0; QDF_STATUS status = QDF_STATUS_SUCCESS; + struct policy_mgr_psoc_priv_obj *pm_ctx; policy_mgr_debug("get pcl for existing conn:%d", mode); + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); if (policy_mgr_mode_specific_connection_count(psoc, mode, NULL) > 0) { /* Check, store and temp delete the mode's parameter */ policy_mgr_store_and_del_conn_info(psoc, mode, all_matching_cxn_to_del, info, &num_cxn_del); + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); /* Get the PCL */ status = policy_mgr_get_pcl(psoc, mode, pcl_ch, len, pcl_weight, weight_len); policy_mgr_debug("Get PCL to FW for mode:%d", mode); + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); /* Restore the connection info */ policy_mgr_restore_deleted_conn_info(psoc, info, num_cxn_del); } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); return status; } @@ -1599,6 +1609,13 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc, struct policy_mgr_conc_connection_info info[MAX_NUMBER_OF_CONC_CONNECTIONS] = { {0} }; uint8_t num_cxn_del = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } if (!weight->pcl_list) { policy_mgr_err("Invalid pcl"); @@ -1617,7 +1634,7 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc, qdf_mem_set(weight->weighed_valid_list, QDF_MAX_NUM_CHAN, WEIGHT_OF_DISALLOWED_CHANNELS); - + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); if (policy_mgr_mode_specific_connection_count( psoc, PM_STA_MODE, NULL) > 0) { /* @@ -1628,6 +1645,7 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc, */ policy_mgr_store_and_del_conn_info(psoc, PM_STA_MODE, false, info, &num_cxn_del); + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); /* * There is a small window between releasing the above lock * and acquiring the same in policy_mgr_allow_concurrency, @@ -1641,10 +1659,11 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc, WEIGHT_OF_NON_PCL_CHANNELS; } } - + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); /* Restore the connection info */ policy_mgr_restore_deleted_conn_info(psoc, info, num_cxn_del); } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); for (i = 0; i < weight->saved_num_chan; i++) { for (j = 0; j < weight->pcl_len; j++) { From 08a833946d522c17b96413063d272ac5065ef1e9 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Wed, 28 Jun 2017 13:28:49 -0700 Subject: [PATCH 059/187] qcacmn: Add logic to force SCC in SAP+STA concurrency If SAP is up & STA comes up or moves to a DFS or passive or LTE unsafe channel that causes MCC, move SAP to the other band if DBS is supported. This logic is enabled only if gWlanMccToSccSwitchMode is non zero. Change-Id: I56f78dfaedec31c4c41aea6ac8c66261c9ad4c91 CRs-Fixed: 2063060 --- inc/wlan_policy_mgr_api.h | 13 ++++++++ src/wlan_policy_mgr_action.c | 58 +++++++++++++++++++++++++++++++++--- 2 files changed, 67 insertions(+), 4 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 6bd3f0bf1910..b5fbfb5ecd64 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1934,4 +1934,17 @@ bool policy_mgr_is_dnsc_set(struct wlan_objmgr_vdev *vdev); QDF_STATUS policy_mgr_get_updated_scan_and_fw_mode_config( struct wlan_objmgr_psoc *psoc, uint32_t *scan_config, uint32_t *fw_mode_config, uint32_t dual_mac_disable_ini); + +/** + * policy_mgr_is_safe_channel - Check if the channel is in LTE + * coex channel avoidance list + * @psoc: PSOC object information + * @channel: channel to be checked + * + * Check if the channel is in LTE coex channel avoidance list. + * + * Return: true for success, else false + */ +bool policy_mgr_is_safe_channel(struct wlan_objmgr_psoc *psoc, + uint8_t channel); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 358c25428ee0..b0d3a368609a 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -609,6 +609,36 @@ static bool policy_mgr_is_restart_sap_allowed( return true; } +bool policy_mgr_is_safe_channel(struct wlan_objmgr_psoc *psoc, + uint8_t channel) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + bool is_safe = true; + uint8_t j; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return is_safe; + } + + + if (pm_ctx->unsafe_channel_count == 0) { + policy_mgr_debug("There are no unsafe channels"); + return is_safe; + } + + for (j = 0; j < pm_ctx->unsafe_channel_count; j++) { + if (channel == pm_ctx->unsafe_channel_list[j]) { + is_safe = false; + policy_mgr_warn("CH %d is not safe", channel); + break; + } + } + + return is_safe; +} + /** * policy_mgr_check_sta_ap_concurrent_ch_intf() - Restart SAP in STA-AP case * @data: Pointer check concurrent channel work data @@ -676,6 +706,28 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) operating_channel, channel); } +static bool policy_mgr_valid_sta_channel_check(struct wlan_objmgr_psoc *psoc, + uint8_t sta_channel) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return false; + } + + if (wlan_reg_is_dfs_ch(pm_ctx->pdev, sta_channel) || + wlan_reg_is_passive_or_disable_ch(pm_ctx->pdev, sta_channel) || + !policy_mgr_is_safe_channel(psoc, sta_channel)) + if (policy_mgr_is_hw_dbs_capable(psoc)) + return true; + else + return false; + else + return true; +} + /** * policy_mgr_check_concurrent_intf_and_restart_sap() - Check * concurrent change intf @@ -721,11 +773,9 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( policy_mgr_mcc_to_scc_switch_mode_in_user_cfg(psoc); policy_mgr_info("MCC to SCC switch: %d chan: %d", mcc_to_scc_switch, operating_channel); - if ((mcc_to_scc_switch != QDF_MCC_TO_SCC_SWITCH_DISABLE) -#ifdef FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE - && !wlan_reg_is_dfs_ch(pm_ctx->pdev, + if ((mcc_to_scc_switch != QDF_MCC_TO_SCC_SWITCH_DISABLE) && + policy_mgr_valid_sta_channel_check(psoc, operating_channel) -#endif ) { qdf_create_work(0, &pm_ctx->sta_ap_intf_check_work, policy_mgr_check_sta_ap_concurrent_ch_intf, From a2c3b62a866b43b8acadf6e95a7967ce0621e0a9 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Thu, 3 Aug 2017 16:58:38 -0700 Subject: [PATCH 060/187] qcacmn: Add logic to force SCC in SAP+STA concurrency - Part 2 If STA is up on a a DFS or passive or LTE unsafe channel & SAP is comings up that causes MCC, move SAP to the other band if DBS is supported. This logic is enabled only if gWlanMccToSccSwitchMode is set to QDF_MCC_TO_SCC_SWITCH_FORCE_WITHOUT_DISCONNECTION. Change-Id: I5d393a21301f3fa838f7cf38620fb1d57ae1d57a CRs-Fixed: 2063060 --- inc/wlan_policy_mgr_api.h | 36 ++++++++++++++ src/wlan_policy_mgr_action.c | 73 +++++++++++++++++++++++++++++ src/wlan_policy_mgr_get_set_utils.c | 16 +++++++ src/wlan_policy_mgr_i.h | 16 +++++++ src/wlan_policy_mgr_pcl.c | 50 ++++++++++++++++++-- 5 files changed, 188 insertions(+), 3 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index b5fbfb5ecd64..a5a0ef670efd 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1947,4 +1947,40 @@ QDF_STATUS policy_mgr_get_updated_scan_and_fw_mode_config( */ bool policy_mgr_is_safe_channel(struct wlan_objmgr_psoc *psoc, uint8_t channel); + +/** + * policy_mgr_is_force_scc() - checks if SCC needs to be + * mandated + * @psoc: PSOC object information + * + * This function checks if SCC needs to be mandated or not + * + * Return: True if SCC to be mandated, false otherwise + */ +bool policy_mgr_is_force_scc(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_valid_sap_conc_channel_check() - checks & updates + * the channel SAP to come up on in case of STA+SAP concurrency + * @psoc: PSOC object information + * @con_ch: pointer to the channel on which sap will come up + * @sap_ch: initial channel for SAP + * + * This function checks & updates the channel SAP to come up on in + * case of STA+SAP concurrency + * Return: Success if SAP can come up on a channel + */ +QDF_STATUS policy_mgr_valid_sap_conc_channel_check( + struct wlan_objmgr_psoc *psoc, uint8_t *con_ch, uint8_t sap_ch); + +/** + * policy_mgr_get_alternate_channel_for_sap() - Get an alternate + * channel to move the SAP to + * @psoc: PSOC object information + * + * This function returns an alternate channel for SAP to move to + * Return: The new channel for SAP + */ +uint8_t policy_mgr_get_alternate_channel_for_sap( + struct wlan_objmgr_psoc *psoc); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index b0d3a368609a..6ed459865219 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -728,6 +728,79 @@ static bool policy_mgr_valid_sta_channel_check(struct wlan_objmgr_psoc *psoc, return true; } +QDF_STATUS policy_mgr_valid_sap_conc_channel_check( + struct wlan_objmgr_psoc *psoc, uint8_t *con_ch, uint8_t sap_ch) +{ + uint8_t channel = *con_ch; + uint8_t temp_channel = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return QDF_STATUS_E_FAILURE; + } + + /* + * if force SCC is set, Check if conc channel is DFS + * or passive or part of LTE avoided channel list. + * In that case move SAP to other band if DBS is supported, + * return otherwise + */ + if (!policy_mgr_is_force_scc(psoc)) + return QDF_STATUS_SUCCESS; + + /* + * if interference is 0, check if it is DBS case. If DBS case + * return from here. If SCC, check further if SAP can move to + * STA's channel. + */ + if (!channel && + (sap_ch != policy_mgr_mode_specific_get_channel( + psoc, PM_STA_MODE))) + return QDF_STATUS_SUCCESS; + else if (!channel) + channel = sap_ch; + + if (policy_mgr_valid_sta_channel_check(psoc, channel)) { + if (wlan_reg_is_dfs_ch(pm_ctx->pdev, channel) || + wlan_reg_is_passive_or_disable_ch( + pm_ctx->pdev, channel) || + !policy_mgr_is_safe_channel(psoc, channel)) { + if (policy_mgr_is_hw_dbs_capable(psoc)) { + temp_channel = + policy_mgr_get_alternate_channel_for_sap(psoc); + policy_mgr_debug("temp_channel is %d", + temp_channel); + if (temp_channel) { + channel = temp_channel; + } else { + if (WLAN_REG_IS_5GHZ_CH(channel)) + channel = PM_24_GHZ_CHANNEL_6; + else + channel = PM_5_GHZ_CHANNEL_36; + } + if (!policy_mgr_is_safe_channel( + psoc, channel)) { + policy_mgr_warn( + "Can't have concurrency on %d as it is not safe", + channel); + return QDF_STATUS_E_FAILURE; + } + } else { + policy_mgr_warn("Can't have concurrency on %d", + channel); + return QDF_STATUS_E_FAILURE; + } + } + } + + if (channel != sap_ch) + *con_ch = channel; + + return QDF_STATUS_SUCCESS; +} + /** * policy_mgr_check_concurrent_intf_and_restart_sap() - Check * concurrent change intf diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 0909847e1afc..ba337ab71ae1 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2627,3 +2627,19 @@ QDF_STATUS policy_mgr_get_updated_scan_and_fw_mode_config( return QDF_STATUS_SUCCESS; } + +bool policy_mgr_is_force_scc(struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return 0; + } + + return ((pm_ctx->user_cfg.mcc_to_scc_switch_mode == + QDF_MCC_TO_SCC_SWITCH_FORCE_WITHOUT_DISCONNECTION) || + (pm_ctx->user_cfg.mcc_to_scc_switch_mode == + QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL)); +} diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index d27b3e71add1..f285bfce9ed0 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -43,6 +43,9 @@ #define CONNECTION_UPDATE_TIMEOUT 1000 #endif +#define PM_24_GHZ_CHANNEL_6 (6) +#define PM_5_GHZ_CHANNEL_36 (36) + /** * Policy Mgr hardware mode list bit-mask definitions. * Bits 4:0, 31:29 are unused. @@ -426,4 +429,17 @@ void policy_mgr_reg_chan_change_callback(struct wlan_objmgr_psoc *psoc, struct regulatory_channel *chan_list, struct avoid_freq_ind_data *avoid_freq_ind, void *arg); + +/** + * policy_mgr_mode_specific_get_channel() - Get channel for a + * connection type + * @psoc: PSOC object information + * @chan_list: Connection type + * + * Get channel for a connection type + * + * Return: channel number + */ +uint8_t policy_mgr_mode_specific_get_channel( + struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode); #endif diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 09b4009d70f4..84b0197084e0 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -41,7 +41,6 @@ #include "qdf_trace.h" #include "wlan_objmgr_global_obj.h" -#define PM_24_GHZ_CHANNEL_6 (6) /** * first_connection_pcl_table - table which provides PCL for the * very first connection in the system @@ -1653,8 +1652,9 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc, */ for (i = 0; i < weight->saved_num_chan; i++) { if (policy_mgr_allow_concurrency(psoc, PM_STA_MODE, - weight->saved_chan_list[i], - HW_MODE_20_MHZ)) { + weight->saved_chan_list[i], + HW_MODE_20_MHZ) && + !policy_mgr_is_force_scc(psoc)) { weight->weighed_valid_list[i] = WEIGHT_OF_NON_PCL_CHANNELS; } @@ -1677,3 +1677,47 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } + +uint8_t policy_mgr_mode_specific_get_channel( + struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode) +{ + uint32_t conn_index; + uint8_t channel = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return channel; + } + /* provides the channel for the first matching mode type */ + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; + conn_index++) { + if ((pm_conc_connection_list[conn_index].mode == mode) && + pm_conc_connection_list[conn_index].in_use) { + channel = pm_conc_connection_list[conn_index].chan; + break; + } + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return channel; +} + +uint8_t policy_mgr_get_alternate_channel_for_sap( + struct wlan_objmgr_psoc *psoc) +{ + uint8_t pcl_channels[QDF_MAX_NUM_CHAN]; + uint8_t pcl_weight[QDF_MAX_NUM_CHAN]; + uint8_t channel = 0; + uint32_t pcl_len; + + if (QDF_STATUS_SUCCESS == policy_mgr_get_pcl(psoc, PM_SAP_MODE, + &pcl_channels[0], &pcl_len, + pcl_weight, QDF_ARRAY_SIZE(pcl_weight))) { + channel = pcl_channels[0]; + } + + return channel; +} From 5e026735cb2996b63b59a914519b6ac689b1294f Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Fri, 4 Aug 2017 12:39:20 -0700 Subject: [PATCH 061/187] qcacmn: Add logic to force SCC in SAP+STA concurrency with ACS If STA is up & SAP is comings up on a ACS derived channel causing MCC, move SAP to the other band if DBS is supported. This logic is enabled only if gWlanMccToSccSwitchMode is set to QDF_MCC_TO_SCC_SWITCH_FORCE_WITHOUT_DISCONNECTION. Change-Id: I48d809f83921292f51ca1735bff4c4d6dd339975 CRs-Fixed: 2063060 --- inc/wlan_policy_mgr_api.h | 15 +++++++++++++++ src/wlan_policy_mgr_i.h | 2 -- src/wlan_policy_mgr_pcl.c | 3 +-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index a5a0ef670efd..a96747f6fae8 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1983,4 +1983,19 @@ QDF_STATUS policy_mgr_valid_sap_conc_channel_check( */ uint8_t policy_mgr_get_alternate_channel_for_sap( struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_disallow_mcc() - Check for mcc + * + * @psoc: PSOC object information + * @channel: channel on which new connection is coming up + * + * When a new connection is about to come up check if current + * concurrency combination including the new connection is + * causing MCC + * + * Return: True if it is causing MCC + */ +bool policy_mgr_disallow_mcc(struct wlan_objmgr_psoc *psoc, + uint8_t channel); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index f285bfce9ed0..2dcc30497b98 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -370,8 +370,6 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, uint8_t *pcl_channels, uint32_t *len, enum policy_mgr_con_mode mode, uint8_t *pcl_weights, uint32_t weight_len); -bool policy_mgr_disallow_mcc(struct wlan_objmgr_psoc *psoc, - uint8_t channel); bool policy_mgr_allow_new_home_channel(struct wlan_objmgr_psoc *psoc, uint8_t channel, uint32_t num_connections); bool policy_mgr_is_5g_channel_allowed(struct wlan_objmgr_psoc *psoc, diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 84b0197084e0..22e8a0b955d7 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -1653,8 +1653,7 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc, for (i = 0; i < weight->saved_num_chan; i++) { if (policy_mgr_allow_concurrency(psoc, PM_STA_MODE, weight->saved_chan_list[i], - HW_MODE_20_MHZ) && - !policy_mgr_is_force_scc(psoc)) { + HW_MODE_20_MHZ)) { weight->weighed_valid_list[i] = WEIGHT_OF_NON_PCL_CHANNELS; } From 8d185ebf41632c9da9b209865da14206a6998575 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Fri, 30 Jun 2017 17:40:49 -0700 Subject: [PATCH 062/187] qcacmn: Dynamically allocate memory for work sta_ap_intf_check_work To handle back to back scheduling of sta_ap_intf_check_work, allocate the memory used by the work dynamically. Change-Id: Ibbcfafb2fadd2de1cca44086f9335dca86641f50 CRs-Fixed: 2070220 --- src/wlan_policy_mgr_action.c | 70 +++++++++++++++++++++++-------- src/wlan_policy_mgr_i.h | 63 ++++++++++++++++------------ src/wlan_policy_mgr_init_deinit.c | 6 +++ 3 files changed, 95 insertions(+), 44 deletions(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 6ed459865219..c828a3ae1491 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -598,14 +598,15 @@ static bool policy_mgr_is_restart_sap_allowed( uint32_t mcc_to_scc_switch) { if ((mcc_to_scc_switch == QDF_MCC_TO_SCC_SWITCH_DISABLE) || - !(policy_mgr_concurrent_open_sessions_running(psoc) && - ((policy_mgr_get_concurrency_mode(psoc) == - (QDF_STA_MASK | QDF_SAP_MASK)) || - (policy_mgr_get_concurrency_mode(psoc) == - (QDF_STA_MASK | QDF_P2P_GO_MASK))))) { + !policy_mgr_concurrent_open_sessions_running(psoc) || + !((policy_mgr_get_concurrency_mode(psoc) == + (QDF_STA_MASK | QDF_SAP_MASK)) || + (policy_mgr_get_concurrency_mode(psoc) == + (QDF_STA_MASK | QDF_P2P_GO_MASK)))) { policy_mgr_err("MCC switch disabled or not concurrent STA/SAP, STA/GO"); return false; } + return true; } @@ -649,18 +650,30 @@ bool policy_mgr_is_safe_channel(struct wlan_objmgr_psoc *psoc, */ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) { - struct wlan_objmgr_psoc *psoc = - (struct wlan_objmgr_psoc *) data; - struct policy_mgr_psoc_priv_obj *pm_ctx; + struct wlan_objmgr_psoc *psoc; + struct policy_mgr_psoc_priv_obj *pm_ctx = NULL; + struct sta_ap_intf_check_work_ctx *work_info = NULL; uint32_t mcc_to_scc_switch; QDF_STATUS status; uint8_t channel, sec_ch; uint8_t operating_channel, vdev_id; + work_info = (struct sta_ap_intf_check_work_ctx *) data; + if (!work_info) { + policy_mgr_err("Invalid work_info"); + goto end; + } + + psoc = work_info->psoc; + if (!psoc) { + policy_mgr_err("Invalid psoc"); + goto end; + } + pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { policy_mgr_err("Invalid context"); - return; + goto end; } mcc_to_scc_switch = policy_mgr_mcc_to_scc_switch_mode_in_user_cfg(psoc); @@ -669,7 +682,7 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) policy_mgr_concurrent_open_sessions_running(psoc)); if (!policy_mgr_is_restart_sap_allowed(psoc, mcc_to_scc_switch)) - return; + goto end; if (policy_mgr_get_mode_specific_conn_info(psoc, &operating_channel, @@ -685,12 +698,12 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) operating_channel); } else { policy_mgr_err("Could not retrieve SAP/GO operating channel&vdevid"); - return; + goto end; } if (!pm_ctx->hdd_cbacks.wlan_hdd_get_channel_for_sap_restart) { policy_mgr_err("SAP restart get channel callback in NULL"); - return; + goto end; } qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); status = pm_ctx->hdd_cbacks. @@ -699,11 +712,17 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); if (status != QDF_STATUS_SUCCESS) { policy_mgr_err("Failed to switch SAP channel"); - return; + goto end; } policy_mgr_info("SAP restarts due to MCC->SCC switch, old chan :%d new chan: %d", operating_channel, channel); +end: + if (work_info) { + qdf_mem_free(work_info); + if (pm_ctx) + pm_ctx->sta_ap_intf_check_work_info = NULL; + } } static bool policy_mgr_valid_sta_channel_check(struct wlan_objmgr_psoc *psoc, @@ -846,15 +865,30 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( policy_mgr_mcc_to_scc_switch_mode_in_user_cfg(psoc); policy_mgr_info("MCC to SCC switch: %d chan: %d", mcc_to_scc_switch, operating_channel); + + if (!policy_mgr_is_restart_sap_allowed(psoc, mcc_to_scc_switch)) { + policy_mgr_debug( + "No action taken at check_concurrent_intf_and_restart_sap"); + return; + } + if ((mcc_to_scc_switch != QDF_MCC_TO_SCC_SWITCH_DISABLE) && policy_mgr_valid_sta_channel_check(psoc, operating_channel) - ) { - qdf_create_work(0, &pm_ctx->sta_ap_intf_check_work, + && !pm_ctx->sta_ap_intf_check_work_info) { + struct sta_ap_intf_check_work_ctx *work_info; + work_info = qdf_mem_malloc( + sizeof(struct sta_ap_intf_check_work_ctx)); + pm_ctx->sta_ap_intf_check_work_info = work_info; + if (work_info) { + work_info->psoc = psoc; + qdf_create_work(0, &pm_ctx->sta_ap_intf_check_work, policy_mgr_check_sta_ap_concurrent_ch_intf, - psoc); - qdf_sched_work(0, &pm_ctx->sta_ap_intf_check_work); - policy_mgr_info("Checking for Concurrent Change interference"); + work_info); + qdf_sched_work(0, &pm_ctx->sta_ap_intf_check_work); + policy_mgr_info( + "Checking for Concurrent Change interference"); + } } } #endif /* FEATURE_WLAN_MCC_TO_SCC_SWITCH */ diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 2dcc30497b98..df104a7f7af9 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -184,6 +184,15 @@ extern enum policy_mgr_conc_next_action (*policy_mgr_get_current_pref_hw_mode_ptr) (struct wlan_objmgr_psoc *psoc); +/** + * struct sta_ap_intf_check_work_ctx - sta_ap_intf_check_work + * related info + * @psoc: pointer to PSOC object information + */ +struct sta_ap_intf_check_work_ctx { + struct wlan_objmgr_psoc *psoc; +}; + /** * struct policy_mgr_psoc_priv_obj - Policy manager private data * @psoc: pointer to PSOC object information @@ -229,34 +238,36 @@ extern enum policy_mgr_conc_next_action * value from INI * @unsafe_channel_list: LTE coex channel avoidance list * @unsafe_channel_count: LTE coex channel avoidance list count + * @sta_ap_intf_check_work_info: Info related to sta_ap_intf_check_work */ struct policy_mgr_psoc_priv_obj { - struct wlan_objmgr_psoc *psoc; - struct wlan_objmgr_pdev *pdev; - qdf_event_t connection_update_done_evt; - qdf_mutex_t qdf_conc_list_lock; - qdf_mc_timer_t dbs_opportunistic_timer; - struct policy_mgr_hdd_cbacks hdd_cbacks; - struct policy_mgr_sme_cbacks sme_cbacks; - struct policy_mgr_wma_cbacks wma_cbacks; - struct policy_mgr_tdls_cbacks tdls_cbacks; - struct policy_mgr_cdp_cbacks cdp_cbacks; - uint8_t sap_mandatory_channels[QDF_MAX_NUM_CHAN]; - uint32_t sap_mandatory_channels_len; - bool do_hw_mode_change; - uint32_t concurrency_mode; - uint8_t no_of_open_sessions[QDF_MAX_NO_OF_MODE]; - uint8_t no_of_active_sessions[QDF_MAX_NO_OF_MODE]; - qdf_work_t sta_ap_intf_check_work; - uint32_t num_dbs_hw_modes; - struct dbs_hw_mode_info hw_mode; - uint32_t old_hw_mode_index; - uint32_t new_hw_mode_index; - struct dual_mac_config dual_mac_cfg; - uint32_t hw_mode_change_in_progress; - struct policy_mgr_user_cfg user_cfg; - uint16_t unsafe_channel_list[QDF_MAX_NUM_CHAN]; - uint16_t unsafe_channel_count; + struct wlan_objmgr_psoc *psoc; + struct wlan_objmgr_pdev *pdev; + qdf_event_t connection_update_done_evt; + qdf_mutex_t qdf_conc_list_lock; + qdf_mc_timer_t dbs_opportunistic_timer; + struct policy_mgr_hdd_cbacks hdd_cbacks; + struct policy_mgr_sme_cbacks sme_cbacks; + struct policy_mgr_wma_cbacks wma_cbacks; + struct policy_mgr_tdls_cbacks tdls_cbacks; + struct policy_mgr_cdp_cbacks cdp_cbacks; + uint8_t sap_mandatory_channels[QDF_MAX_NUM_CHAN]; + uint32_t sap_mandatory_channels_len; + bool do_hw_mode_change; + uint32_t concurrency_mode; + uint8_t no_of_open_sessions[QDF_MAX_NO_OF_MODE]; + uint8_t no_of_active_sessions[QDF_MAX_NO_OF_MODE]; + qdf_work_t sta_ap_intf_check_work; + uint32_t num_dbs_hw_modes; + struct dbs_hw_mode_info hw_mode; + uint32_t old_hw_mode_index; + uint32_t new_hw_mode_index; + struct dual_mac_config dual_mac_cfg; + uint32_t hw_mode_change_in_progress; + struct policy_mgr_user_cfg user_cfg; + uint16_t unsafe_channel_list[QDF_MAX_NUM_CHAN]; + uint16_t unsafe_channel_count; + struct sta_ap_intf_check_work_ctx *sta_ap_intf_check_work_info; }; /** diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index fd91357a3ecc..c20c548a7290 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -364,6 +364,12 @@ QDF_STATUS policy_mgr_psoc_close(struct wlan_objmgr_psoc *psoc) policy_mgr_info("HW list is freed"); } + if (pm_ctx->sta_ap_intf_check_work_info) { + qdf_cancel_work(0, &pm_ctx->sta_ap_intf_check_work); + qdf_mem_free(pm_ctx->sta_ap_intf_check_work_info); + pm_ctx->sta_ap_intf_check_work_info = NULL; + } + return QDF_STATUS_SUCCESS; } From c5348955ecb733448a6fc2a8ebbd34434ba74fab Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Fri, 4 Aug 2017 15:10:03 -0700 Subject: [PATCH 063/187] qcacmn: Fix logic to force SCC in SAP+STA concurrency If SAP is up & STA is coming up next(or vice versa) on a different channel causing MCC, move SAP to cause SCC or DBS. This logic is enabled only if gWlanMccToSccSwitchMode is set to QDF_MCC_TO_SCC_SWITCH_FORCE_WITHOUT_DISCONNECTION or QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL. Change-Id: I16615d828a285762133ee3533339320ef119b3d3 CRs-Fixed: 2063060 --- inc/wlan_policy_mgr_api.h | 13 +++++++++++++ src/wlan_policy_mgr_i.h | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index a96747f6fae8..ffe2fe12c80c 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1998,4 +1998,17 @@ uint8_t policy_mgr_get_alternate_channel_for_sap( */ bool policy_mgr_disallow_mcc(struct wlan_objmgr_psoc *psoc, uint8_t channel); + +/** + * policy_mgr_mode_specific_get_channel() - Get channel for a + * connection type + * @psoc: PSOC object information + * @chan_list: Connection type + * + * Get channel for a connection type + * + * Return: channel number + */ +uint8_t policy_mgr_mode_specific_get_channel( + struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index df104a7f7af9..2b2fcd88292a 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -438,17 +438,4 @@ void policy_mgr_reg_chan_change_callback(struct wlan_objmgr_psoc *psoc, struct regulatory_channel *chan_list, struct avoid_freq_ind_data *avoid_freq_ind, void *arg); - -/** - * policy_mgr_mode_specific_get_channel() - Get channel for a - * connection type - * @psoc: PSOC object information - * @chan_list: Connection type - * - * Get channel for a connection type - * - * Return: channel number - */ -uint8_t policy_mgr_mode_specific_get_channel( - struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode); #endif From 126d7e12813f1e4236607975ef77af18d2211a21 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Thu, 13 Jul 2017 10:51:53 -0700 Subject: [PATCH 064/187] qcacmn: Handle no common channel between PCL and the favorite channel list Handle the scenario where no common channel between PCL & the favorite channel list is found. Change-Id: I560d7ef861d89f3f4a0c63afacd0ffbf6aaa976e CRs-Fixed: 2063060 --- src/wlan_policy_mgr_pcl.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 22e8a0b955d7..429873676b74 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -1571,10 +1571,13 @@ QDF_STATUS policy_mgr_get_sap_mandatory_channel(struct wlan_objmgr_psoc *psoc, return status; } - /* No existing SAP connection and hence a new SAP connection might be - * coming up. + /* + * Get inside below loop if no existing SAP connection and hence a new + * SAP connection might be coming up. pcl.pcl_len can be 0 if no common + * channel between PCL & mandatory channel list as well */ - if (!pcl.pcl_len) { + if (!pcl.pcl_len && !policy_mgr_mode_specific_connection_count(psoc, + PM_SAP_MODE, NULL)) { policy_mgr_debug("policy_mgr_get_pcl_for_existing_conn returned no pcl"); status = policy_mgr_get_pcl(psoc, PM_SAP_MODE, pcl.pcl_list, &pcl.pcl_len, @@ -1595,6 +1598,11 @@ QDF_STATUS policy_mgr_get_sap_mandatory_channel(struct wlan_objmgr_psoc *psoc, return status; } + if (!pcl.pcl_len) { + policy_mgr_err("No common channel between mandatory list & PCL"); + return QDF_STATUS_E_FAILURE; + } + *chan = pcl.pcl_list[0]; policy_mgr_debug("mandatory channel:%d", *chan); From b641b5e094fe08f8e7d43dd1b3eaec997983401b Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Wed, 26 Jul 2017 12:10:43 -0700 Subject: [PATCH 065/187] qcacmn: Avoid deadlock while protecting connection list Avoid deadlock while protecting connection list during SAP channel switch. Change-Id: Ib4f8bd3e185b3dd6bd746e49645b6456dca50e96 CRs-Fixed: 2088106 --- src/wlan_policy_mgr_action.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index c828a3ae1491..bc208a838c2a 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -705,11 +705,9 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) policy_mgr_err("SAP restart get channel callback in NULL"); goto end; } - qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); status = pm_ctx->hdd_cbacks. wlan_hdd_get_channel_for_sap_restart(psoc, vdev_id, &channel, &sec_ch); - qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); if (status != QDF_STATUS_SUCCESS) { policy_mgr_err("Failed to switch SAP channel"); goto end; From 15c3144230cd14705438621f8b84dbc5c6ed2470 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Sat, 5 Aug 2017 08:47:21 -0700 Subject: [PATCH 066/187] qcacmn: Strip out the DSRC channels while getting valid channel list Strip out the DSRC channels while getting valid channel list from sme. Change-Id: I540869a01dbc045033ba1e3623c3d237b1e5a54c CRs-Fixed: 2063060 --- src/wlan_policy_mgr_pcl.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 429873676b74..79a437ac0342 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -40,6 +40,7 @@ #include "qdf_types.h" #include "qdf_trace.h" #include "wlan_objmgr_global_obj.h" +#include "wlan_utility.h" /** * first_connection_pcl_table - table which provides PCL for the @@ -1404,6 +1405,22 @@ policy_mgr_get_nondfs_preferred_channel(struct wlan_objmgr_psoc *psoc, return channel; } +static void policy_mgr_remove_dsrc_channels(uint8_t *chan_list, + uint32_t *num_channels) +{ + uint32_t num_chan_temp = 0; + int i; + + for (i = 0; i < *num_channels; i++) { + if (!wlan_is_dsrc_channel(wlan_chan_to_freq(chan_list[i]))) { + chan_list[num_chan_temp] = chan_list[i]; + num_chan_temp++; + } + } + + *num_channels = num_chan_temp; +} + QDF_STATUS policy_mgr_get_valid_chans(struct wlan_objmgr_psoc *psoc, uint8_t *chan_list, uint32_t *list_len) { @@ -1432,6 +1449,8 @@ QDF_STATUS policy_mgr_get_valid_chans(struct wlan_objmgr_psoc *psoc, return status; } + policy_mgr_remove_dsrc_channels(chan_list, list_len); + return QDF_STATUS_SUCCESS; } From 5d284f7b1ae21fd4c173dd3cfac133943551d4ca Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Mon, 10 Jul 2017 16:27:19 -0700 Subject: [PATCH 067/187] qcacmn: Update PCL table for non DBS to give SCC preference Update the non DBS PCL table to give preference to SCC. Change-Id: I9d2d982f367bf6fb8d18e4d448fa0c45e95cbbf4 CRs-Fixed: 2063060 --- src/wlan_policy_mgr_tables_no_dbs_i.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/wlan_policy_mgr_tables_no_dbs_i.h b/src/wlan_policy_mgr_tables_no_dbs_i.h index cddd184cf939..1e831f3bc478 100644 --- a/src/wlan_policy_mgr_tables_no_dbs_i.h +++ b/src/wlan_policy_mgr_tables_no_dbs_i.h @@ -40,7 +40,7 @@ second_connection_pcl_nodbs_table[PM_MAX_ONE_CONNECTION_MODE] [PM_MAX_NUM_OF_MODE][PM_MAX_CONC_PRIORITY_MODE] = { [PM_STA_24_1x1] = { [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, - [PM_SAP_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_SAP_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH_5G}, [PM_P2P_CLIENT_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, [PM_P2P_GO_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, [PM_IBSS_MODE] = { @@ -48,7 +48,7 @@ second_connection_pcl_nodbs_table[PM_MAX_ONE_CONNECTION_MODE] [PM_STA_24_2x2] = { [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, - [PM_SAP_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_SAP_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH_5G}, [PM_P2P_CLIENT_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, [PM_P2P_GO_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, [PM_IBSS_MODE] = { @@ -72,7 +72,7 @@ second_connection_pcl_nodbs_table[PM_MAX_ONE_CONNECTION_MODE] [PM_P2P_CLI_24_1x1] = { [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, - [PM_SAP_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_SAP_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH_5G}, [PM_P2P_CLIENT_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, [PM_P2P_GO_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, [PM_IBSS_MODE] = { @@ -80,7 +80,7 @@ second_connection_pcl_nodbs_table[PM_MAX_ONE_CONNECTION_MODE] [PM_P2P_CLI_24_2x2] = { [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, - [PM_SAP_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_SAP_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH_5G}, [PM_P2P_CLIENT_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, [PM_P2P_GO_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, [PM_IBSS_MODE] = { @@ -224,7 +224,7 @@ static const enum policy_mgr_pcl_type third_connection_pcl_nodbs_table[PM_MAX_TWO_CONNECTION_MODE] [PM_MAX_NUM_OF_MODE][PM_MAX_CONC_PRIORITY_MODE] = { [PM_STA_SAP_SCC_24_1x1] = { - [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_STA_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, [PM_SAP_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, @@ -234,7 +234,7 @@ third_connection_pcl_nodbs_table[PM_MAX_TWO_CONNECTION_MODE] PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_SAP_SCC_24_2x2] = { - [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_STA_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, [PM_SAP_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, @@ -345,10 +345,10 @@ third_connection_pcl_nodbs_table[PM_MAX_TWO_CONNECTION_MODE] PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_P2P_GO_SCC_24_2x2] = { - [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, [PM_SAP_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_CLIENT_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_SCC_CH, PM_SCC_CH}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, @@ -554,17 +554,17 @@ third_connection_pcl_nodbs_table[PM_MAX_TWO_CONNECTION_MODE] PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_SCC_24_1x1] = { - [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, [PM_SAP_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, - [PM_P2P_CLIENT_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_SCC_CH, PM_SCC_CH}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_SCC_24_2x2] = { - [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, [PM_SAP_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, - [PM_P2P_CLIENT_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_SCC_CH, PM_SCC_CH}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, From 6c0554aac7f04f0640a8547b262033c985011404 Mon Sep 17 00:00:00 2001 From: Ganesh Kondabattini Date: Tue, 8 Aug 2017 12:19:00 +0530 Subject: [PATCH 068/187] qcacmn: Initialize SAP mandatory chan list Initialize SAP mandatory chan list. Change-Id: I126d67da1bfe8426cd3a7b031e97aba907e6155a CRs-Fixed: 2089122 --- inc/wlan_policy_mgr_api.h | 74 ++++++++++++++++++++++ src/wlan_policy_mgr_core.c | 126 +++++++++++++++++++++++++++++++++++++ src/wlan_policy_mgr_i.h | 1 + 3 files changed, 201 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index ffe2fe12c80c..94668d76e366 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -2011,4 +2011,78 @@ bool policy_mgr_disallow_mcc(struct wlan_objmgr_psoc *psoc, */ uint8_t policy_mgr_mode_specific_get_channel( struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode); + +/** + * policy_mgr_enable_disable_sap_mandatory_chan_list() - Update the value of + * enable_sap_mandatory_chan_list + * @psoc: Pointer to soc + * @val: value of enable_sap_mandatory_chan_list + * + * Update the value of enable_sap_mandatory_chan_list + * + * Return: void + */ +void policy_mgr_enable_disable_sap_mandatory_chan_list( + struct wlan_objmgr_psoc *psoc, bool val); + +/** + * policy_mgr_add_sap_mandatory_chan() - Add chan to SAP mandatory channel + * list + * @psoc: Pointer to soc + * @chan: Channel to be added + * + * Add chan to SAP mandatory channel list + * + * Return: None + */ +void policy_mgr_add_sap_mandatory_chan(struct wlan_objmgr_psoc *psoc, + uint8_t chan); + +/** + * policy_mgr_is_sap_mandatory_chan_list_enabled() - Return the SAP mandatory + * channel list enabled status + * @psoc: Pointer to soc + * + * Get the SAP mandatory channel list enabled status + * + * Return: Enable or Disable + */ +bool policy_mgr_is_sap_mandatory_chan_list_enabled( + struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_get_sap_mandatory_chan_list_len() - Return the SAP mandatory + * channel list len + * @psoc: Pointer to soc + * + * Get the SAP mandatory channel list len + * + * Return: Channel list length + */ +uint32_t policy_mgr_get_sap_mandatory_chan_list_len( + struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_init_sap_mandatory_2g_chan() - Init 2.4G SAP mandatory channel + * list + * @psoc: Pointer to soc + * + * Initialize the 2.4G SAP mandatory channels + * + * Return: None + */ +void policy_mgr_init_sap_mandatory_2g_chan(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_remove_sap_mandatory_chan() - Remove channel from SAP mandatory + * channel list + * @psoc: Pointer to soc + * @chan: channel to be removed from mandatory channel list + * + * Remove channel from SAP mandatory channel list + * + * Return: None + */ +void policy_mgr_remove_sap_mandatory_chan(struct wlan_objmgr_psoc *psoc, + uint8_t chan); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index a8a92b446df3..04535e2775db 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -2681,3 +2681,129 @@ QDF_STATUS policy_mgr_reset_sap_mandatory_channels( return QDF_STATUS_SUCCESS; } + +void policy_mgr_enable_disable_sap_mandatory_chan_list( + struct wlan_objmgr_psoc *psoc, bool val) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + pm_ctx->enable_sap_mandatory_chan_list = val; +} + +void policy_mgr_add_sap_mandatory_chan(struct wlan_objmgr_psoc *psoc, + uint8_t chan) +{ + int i; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + for (i = 0; i < pm_ctx->sap_mandatory_channels_len; i++) { + if (chan == pm_ctx->sap_mandatory_channels[i]) + return; + } + + policy_mgr_debug("chan %hu", chan); + pm_ctx->sap_mandatory_channels[pm_ctx->sap_mandatory_channels_len++] + = chan; +} + +bool policy_mgr_is_sap_mandatory_chan_list_enabled( + struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return false; + } + + return pm_ctx->enable_sap_mandatory_chan_list; +} + +uint32_t policy_mgr_get_sap_mandatory_chan_list_len( + struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return 0; + } + + return pm_ctx->sap_mandatory_channels_len; +} + +void policy_mgr_init_sap_mandatory_2g_chan(struct wlan_objmgr_psoc *psoc) +{ + uint8_t chan_list[QDF_MAX_NUM_CHAN] = {0}; + uint32_t len = 0; + int i; + QDF_STATUS status; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + status = policy_mgr_get_valid_chans(psoc, chan_list, &len); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("Error in getting valid channels"); + return; + } + for (i = 0; i < len; i++) { + if (WLAN_REG_IS_24GHZ_CH(chan_list[i])) { + policy_mgr_debug("Add chan %hu to mandatory list", + chan_list[i]); + pm_ctx->sap_mandatory_channels[ + pm_ctx->sap_mandatory_channels_len++] = + chan_list[i]; + } + } +} + +void policy_mgr_remove_sap_mandatory_chan(struct wlan_objmgr_psoc *psoc, + uint8_t chan) +{ + uint8_t chan_list[QDF_MAX_NUM_CHAN] = {0}; + uint32_t num_chan = 0; + int i; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + if (pm_ctx->sap_mandatory_channels_len >= QDF_MAX_NUM_CHAN) { + policy_mgr_err("Invalid channel len %d ", + pm_ctx->sap_mandatory_channels_len); + return; + } + + for (i = 0; i < pm_ctx->sap_mandatory_channels_len; i++) { + if (chan == pm_ctx->sap_mandatory_channels[i]) + continue; + chan_list[num_chan++] = pm_ctx->sap_mandatory_channels[i]; + } + + qdf_mem_zero(pm_ctx->sap_mandatory_channels, + pm_ctx->sap_mandatory_channels_len); + qdf_mem_copy(pm_ctx->sap_mandatory_channels, chan_list, num_chan); + pm_ctx->sap_mandatory_channels_len = num_chan; +} diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 2b2fcd88292a..fd5ab69f5846 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -251,6 +251,7 @@ struct policy_mgr_psoc_priv_obj { struct policy_mgr_wma_cbacks wma_cbacks; struct policy_mgr_tdls_cbacks tdls_cbacks; struct policy_mgr_cdp_cbacks cdp_cbacks; + bool enable_sap_mandatory_chan_list; uint8_t sap_mandatory_channels[QDF_MAX_NUM_CHAN]; uint32_t sap_mandatory_channels_len; bool do_hw_mode_change; From 2a8c7b0c6d4f6afb32c63da271a37abde47a5c27 Mon Sep 17 00:00:00 2001 From: Ganesh Kondabattini Date: Mon, 10 Jul 2017 17:34:36 +0530 Subject: [PATCH 069/187] qcacmn: Refactor the code to update the conc_system_pref Refactor the code to dynamically change the conc_system_pref. Whenever user changes conc_system_pref from application, driver is overwriting the conc_system_pref which is getting populated from ini file. Once it is overwritten there is no way to get the configured value for this setting. So add a new variable to hold the value of conc_system_pref without disturbing default value read from ini file. CRs-Fixed: 2082073 Change-Id: Icfb245c7a8872885332ec222780c911d08521d46 --- inc/wlan_policy_mgr_api.h | 20 ++++++++++++++++++ src/wlan_policy_mgr_get_set_utils.c | 32 +++++++++++++++++++++++++++++ src/wlan_policy_mgr_i.h | 1 + src/wlan_policy_mgr_pcl.c | 12 +++++------ 4 files changed, 59 insertions(+), 6 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 94668d76e366..3865a8674f4c 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -2085,4 +2085,24 @@ void policy_mgr_init_sap_mandatory_2g_chan(struct wlan_objmgr_psoc *psoc); */ void policy_mgr_remove_sap_mandatory_chan(struct wlan_objmgr_psoc *psoc, uint8_t chan); +/* + * policy_set_cur_conc_system_pref - set current conc_system_pref + * @psoc: soc pointer + * + * Set the current concurrency system preference. + * + * Return: None + */ +void policy_mgr_set_cur_conc_system_pref(struct wlan_objmgr_psoc *psoc, + uint8_t conc_system_pref); +/** + * policy_mgr_get_cur_conc_system_pref - Get current conc_system_pref + * @psoc: soc pointer + * + * Get the current concurrent system preference. + * + * Return: conc_system_pref + */ +uint8_t policy_mgr_get_cur_conc_system_pref(struct wlan_objmgr_psoc *psoc); + #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index ba337ab71ae1..c156881c7028 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1768,6 +1768,8 @@ QDF_STATUS policy_mgr_set_user_cfg(struct wlan_objmgr_psoc *psoc, pm_ctx->user_cfg = *user_cfg; + pm_ctx->cur_conc_system_pref = pm_ctx->user_cfg.conc_system_pref; + return QDF_STATUS_SUCCESS; } @@ -2588,6 +2590,36 @@ bool policy_mgr_is_scan_simultaneous_capable(struct wlan_objmgr_psoc *psoc) return false; } +void policy_mgr_set_cur_conc_system_pref(struct wlan_objmgr_psoc *psoc, + uint8_t conc_system_pref) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + policy_mgr_debug("conc_system_pref %hu", conc_system_pref); + pm_ctx->cur_conc_system_pref = conc_system_pref; +} + +uint8_t policy_mgr_get_cur_conc_system_pref(struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return PM_THROUGHPUT; + } + + policy_mgr_debug("conc_system_pref %hu", pm_ctx->cur_conc_system_pref); + return pm_ctx->cur_conc_system_pref; +} + QDF_STATUS policy_mgr_get_updated_scan_and_fw_mode_config( struct wlan_objmgr_psoc *psoc, uint32_t *scan_config, uint32_t *fw_mode_config, uint32_t dual_mac_disable_ini) diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index fd5ab69f5846..5610f49f8c09 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -269,6 +269,7 @@ struct policy_mgr_psoc_priv_obj { uint16_t unsafe_channel_list[QDF_MAX_NUM_CHAN]; uint16_t unsafe_channel_count; struct sta_ap_intf_check_work_ctx *sta_ap_intf_check_work_info; + uint8_t cur_conc_system_pref; }; /** diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 79a437ac0342..01f2cc91c000 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -489,9 +489,9 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, /* find the current connection state from pm_conc_connection_list*/ num_connections = policy_mgr_get_connection_count(psoc); policy_mgr_debug("connections:%d pref:%d requested mode:%d", - num_connections, pm_ctx->user_cfg.conc_system_pref, mode); + num_connections, pm_ctx->cur_conc_system_pref, mode); - switch (pm_ctx->user_cfg.conc_system_pref) { + switch (pm_ctx->cur_conc_system_pref) { case 0: conc_system_pref = PM_THROUGHPUT; break; @@ -502,8 +502,8 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, conc_system_pref = PM_LATENCY; break; default: - policy_mgr_err("unknown conc_system_pref value %d", - pm_ctx->user_cfg.conc_system_pref); + policy_mgr_err("unknown cur_conc_system_pref value %d", + pm_ctx->cur_conc_system_pref); break; } @@ -596,10 +596,10 @@ enum policy_mgr_conc_priority_mode return PM_THROUGHPUT; } - if (pm_ctx->user_cfg.conc_system_pref >= PM_MAX_CONC_PRIORITY_MODE) + if (pm_ctx->cur_conc_system_pref >= PM_MAX_CONC_PRIORITY_MODE) return PM_THROUGHPUT; - return pm_ctx->user_cfg.conc_system_pref; + return pm_ctx->cur_conc_system_pref; } enum policy_mgr_one_connection_mode From e677364a0f5fbb2075ec4c72d0262bc98a179bd3 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Thu, 28 Sep 2017 15:02:22 -0700 Subject: [PATCH 070/187] qcacmn: Update PCL table for non DBS to give preference to SCC Update PCL table for non DBS to give preference to SCC in STA+P2P cases. Change-Id: I0dfa1f2f37960b90a32e325e1397e301f6ce313d CRs-Fixed: 2118720 --- src/wlan_policy_mgr_tables_no_dbs_i.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/wlan_policy_mgr_tables_no_dbs_i.h b/src/wlan_policy_mgr_tables_no_dbs_i.h index 1e831f3bc478..b0119950f73c 100644 --- a/src/wlan_policy_mgr_tables_no_dbs_i.h +++ b/src/wlan_policy_mgr_tables_no_dbs_i.h @@ -41,32 +41,32 @@ second_connection_pcl_nodbs_table[PM_MAX_ONE_CONNECTION_MODE] [PM_STA_24_1x1] = { [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, [PM_SAP_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH_5G}, - [PM_P2P_CLIENT_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, - [PM_P2P_GO_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_P2P_GO_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH_5G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_24_2x2] = { [PM_STA_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH}, [PM_SAP_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH_5G}, - [PM_P2P_CLIENT_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, - [PM_P2P_GO_MODE] = {PM_5G, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH_5G}, + [PM_P2P_GO_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH_5G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_5_1x1] = { [PM_STA_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH_5G}, [PM_SAP_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, - [PM_P2P_CLIENT_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, - [PM_P2P_GO_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_5_2x2] = { [PM_STA_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH_5G}, [PM_SAP_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, - [PM_P2P_CLIENT_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, - [PM_P2P_GO_MODE] = {PM_SCC_CH_5G, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_CLIENT_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, + [PM_P2P_GO_MODE] = {PM_SCC_CH, PM_SCC_CH, PM_SCC_CH}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, From 3c49b2e6f95f6aac026669efcd4acb16ef7dc06d Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Tue, 19 Sep 2017 11:29:41 -0700 Subject: [PATCH 071/187] qcacmn: Remove qdf_handle_t from unused qdf_defer APIs There are many QDF APIs require a qdf_handle_t parameter. None of these APIs actually use the qdf_handle_t parameter, meaning it can be completely removed. As a step toward globally removing this unused type, remove qdf_handle_t parameters from unsed qdf_defer APIs. Change-Id: I0568aa7cbd430abc0d046143482a067d96bf6313 CRs-Fixed: 2112646 --- src/wlan_policy_mgr_init_deinit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index c20c548a7290..c946988f8789 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -365,7 +365,7 @@ QDF_STATUS policy_mgr_psoc_close(struct wlan_objmgr_psoc *psoc) } if (pm_ctx->sta_ap_intf_check_work_info) { - qdf_cancel_work(0, &pm_ctx->sta_ap_intf_check_work); + qdf_cancel_work(&pm_ctx->sta_ap_intf_check_work); qdf_mem_free(pm_ctx->sta_ap_intf_check_work_info); pm_ctx->sta_ap_intf_check_work_info = NULL; } From 76b846451293eac10f640401a92e235c8dd1cce1 Mon Sep 17 00:00:00 2001 From: Rachit Kankane Date: Fri, 15 Sep 2017 13:39:04 +0530 Subject: [PATCH 072/187] qcacmn: PCL update for 3-port combinations Updated PCL table to support 3-port concurrent scenarios AP+AP+STA, AP+GO+STA and AP+AP+AP. The PCL entries are updated to have below behavior: 1. AP+GO or AP+AP will be supported either in DBS or in SCC mode 2. The Precedence order will be DBS, SCC. Also disabling 3-port combinations with P2P-CLI. Change-Id: I678e2b5a49577e173c0e34f83a7ccc528313aadd CRs-Fixed: 2127091 --- src/wlan_policy_mgr_tables_1x1_dbs_i.h | 480 +++++++++++++++++-------- src/wlan_policy_mgr_tables_2x2_dbs_i.h | 308 ++++++++-------- 2 files changed, 479 insertions(+), 309 deletions(-) diff --git a/src/wlan_policy_mgr_tables_1x1_dbs_i.h b/src/wlan_policy_mgr_tables_1x1_dbs_i.h index caaedaf05431..c12ab33993f4 100644 --- a/src/wlan_policy_mgr_tables_1x1_dbs_i.h +++ b/src/wlan_policy_mgr_tables_1x1_dbs_i.h @@ -222,61 +222,55 @@ static pm_dbs_pcl_third_connection_table_type pm_third_connection_pcl_dbs_1x1_table = { [PM_STA_SAP_SCC_24_1x1] = { [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_SAP_SCC_24_2x2] = { [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_SAP_MCC_24_1x1] = { [PM_STA_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, - [PM_SAP_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_SAP_MCC_24_2x2] = { [PM_STA_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, - [PM_SAP_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_SAP_SCC_5_1x1] = { [PM_STA_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, - [PM_SAP_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_SAP_SCC_5_2x2] = { [PM_STA_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, - [PM_SAP_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, @@ -285,8 +279,7 @@ pm_third_connection_pcl_dbs_1x1_table = { [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, @@ -295,8 +288,7 @@ pm_third_connection_pcl_dbs_1x1_table = { [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, @@ -323,8 +315,36 @@ pm_third_connection_pcl_dbs_1x1_table = { [PM_STA_SAP_DBS_1x1] = { [PM_STA_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, - [PM_SAP_MODE] = { - PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, + [PM_SAP_MODE] = {PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_SCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_SCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_MCC_24_1x1] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -332,10 +352,91 @@ pm_third_connection_pcl_dbs_1x1_table = { [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + [PM_SAP_SAP_MCC_24_2x2] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_SCC_5_1x1] = { + [PM_STA_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_SCC_5_2x2] = { + [PM_STA_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, + PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_MCC_5_1x1] = { + [PM_STA_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_SAP_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_MCC_5_2x2] = { + [PM_STA_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_SAP_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_MCC_24_5_1x1] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_MCC_24_5_2x2] = { + [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + + [PM_SAP_SAP_DBS_1x1] = { + [PM_STA_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_SAP_MODE] = { PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, + [PM_STA_P2P_GO_SCC_24_1x1] = { [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_SAP_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, [PM_IBSS_MODE] = { @@ -343,65 +444,63 @@ pm_third_connection_pcl_dbs_1x1_table = { [PM_STA_P2P_GO_SCC_24_2x2] = { [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_SAP_MODE] = { + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_P2P_GO_MCC_24_1x1] = { [PM_STA_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, - [PM_SAP_MODE] = { + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_CLIENT_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, [PM_P2P_GO_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_P2P_GO_MCC_24_2x2] = { [PM_STA_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, - [PM_SAP_MODE] = { + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_CLIENT_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, [PM_P2P_GO_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_P2P_GO_SCC_5_1x1] = { [PM_STA_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, - [PM_SAP_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_P2P_CLIENT_MODE] = { - PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_P2P_GO_SCC_5_2x2] = { [PM_STA_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, - [PM_SAP_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_P2P_CLIENT_MODE] = { - PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_P2P_GO_MCC_5_1x1] = { [PM_STA_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, - [PM_SAP_MODE] = { + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_P2P_GO_MCC_5_2x2] = { [PM_STA_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, - [PM_SAP_MODE] = { + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, @@ -410,7 +509,8 @@ pm_third_connection_pcl_dbs_1x1_table = { [PM_STA_MODE] = {PM_MCC_CH_5G, PM_5G, PM_5G}, [PM_SAP_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, @@ -419,7 +519,8 @@ pm_third_connection_pcl_dbs_1x1_table = { [PM_STA_MODE] = {PM_MCC_CH_5G, PM_5G, PM_5G}, [PM_SAP_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, @@ -427,10 +528,10 @@ pm_third_connection_pcl_dbs_1x1_table = { [PM_STA_P2P_GO_DBS_1x1] = { [PM_STA_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, - [PM_SAP_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, [PM_P2P_CLIENT_MODE] = { - PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, [PM_IBSS_MODE] = { @@ -438,216 +539,272 @@ pm_third_connection_pcl_dbs_1x1_table = { [PM_STA_P2P_CLI_SCC_24_1x1] = { [PM_STA_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_P2P_CLI_SCC_24_2x2] = { [PM_STA_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_P2P_CLI_MCC_24_1x1] = { [PM_STA_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_CLIENT_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, - [PM_P2P_GO_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_P2P_CLI_MCC_24_2x2] = { [PM_STA_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_CLIENT_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, - [PM_P2P_GO_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_P2P_CLI_SCC_5_1x1] = { [PM_STA_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, - [PM_P2P_GO_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_P2P_CLI_SCC_5_2x2] = { [PM_STA_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, - [PM_P2P_GO_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_P2P_CLI_MCC_5_1x1] = { [PM_STA_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_MCC_CH_24G}, - [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_MCC_CH_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_P2P_CLI_MCC_5_2x2] = { [PM_STA_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_MCC_CH_24G}, - [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_MCC_CH_24G}, - [PM_IBSS_MODE] = {PM_NONE, PM_NONE, PM_NONE} }, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_IBSS_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_P2P_CLI_MCC_24_5_1x1] = { [PM_STA_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_MCC_CH_24G}, - [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_MCC_CH_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_P2P_CLI_MCC_24_5_2x2] = { [PM_STA_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_MCC_CH_24G}, - [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_MCC_CH_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_P2P_CLI_DBS_1x1] = { [PM_STA_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { - PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_SCC_24_1x1] = { - [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_SCC_24_2x2] = { - [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_MCC_24_1x1] = { - [PM_STA_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, - [PM_SAP_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, - [PM_P2P_CLIENT_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, - [PM_P2P_GO_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_MCC_24_2x2] = { - [PM_STA_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, - [PM_SAP_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, - [PM_P2P_CLIENT_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, - [PM_P2P_GO_MODE] = {PM_5G_MCC_CH, PM_5G, PM_5G_MCC_CH}, + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_SCC_5_1x1] = { - [PM_STA_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, - [PM_SAP_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, - [PM_P2P_GO_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_SCC_5_2x2] = { - [PM_STA_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, - [PM_SAP_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, - [PM_P2P_GO_MODE] = {PM_SCC_CH_24G, PM_24G_SCC_CH, PM_SCC_CH_24G}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_MCC_5_1x1] = { - [PM_STA_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, - [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, - [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, - [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_MCC_5_2x2] = { - [PM_STA_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, - [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, - [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, - [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_MCC_24_5_1x1] = { - [PM_STA_MODE] = {PM_MCC_CH_5G, PM_5G, PM_5G}, - [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, - [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, - [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_MCC_24_5_2x2] = { - [PM_STA_MODE] = {PM_MCC_CH_5G, PM_5G, PM_5G}, - [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, - [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, - [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G, PM_24G}, + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_DBS_1x1] = { [PM_STA_MODE] = { - PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { - PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { - PM_SCC_ON_5_SCC_ON_24_5G, PM_NONE, PM_SCC_ON_5_SCC_ON_24}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_SAP_SCC_24_1x1] = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_SAP_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -658,8 +815,7 @@ pm_third_connection_pcl_dbs_1x1_table = { [PM_P2P_GO_SAP_SCC_24_2x2] = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_SAP_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -694,8 +850,7 @@ pm_third_connection_pcl_dbs_1x1_table = { [PM_P2P_GO_SAP_SCC_5_1x1] = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_SAP_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -706,8 +861,7 @@ pm_third_connection_pcl_dbs_1x1_table = { [PM_P2P_GO_SAP_SCC_5_2x2] = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_SAP_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -766,8 +920,8 @@ pm_third_connection_pcl_dbs_1x1_table = { [PM_P2P_GO_SAP_DBS_1x1] = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_SAP_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -778,31 +932,34 @@ pm_third_connection_pcl_dbs_1x1_table = { [PM_P2P_CLI_SAP_SCC_24_1x1] = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_CLI_SAP_SCC_24_2x2] = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_CLI_SAP_MCC_24_1x1] = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { @@ -811,9 +968,10 @@ pm_third_connection_pcl_dbs_1x1_table = { [PM_P2P_CLI_SAP_MCC_24_2x2] = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { @@ -822,9 +980,10 @@ pm_third_connection_pcl_dbs_1x1_table = { [PM_P2P_CLI_SAP_SCC_5_1x1] = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { @@ -833,9 +992,10 @@ pm_third_connection_pcl_dbs_1x1_table = { [PM_P2P_CLI_SAP_SCC_5_2x2] = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { @@ -844,9 +1004,10 @@ pm_third_connection_pcl_dbs_1x1_table = { [PM_P2P_CLI_SAP_MCC_5_1x1] = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { @@ -855,20 +1016,22 @@ pm_third_connection_pcl_dbs_1x1_table = { [PM_P2P_CLI_SAP_MCC_5_2x2] = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_CLI_SAP_MCC_24_5_1x1] = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { @@ -877,9 +1040,10 @@ pm_third_connection_pcl_dbs_1x1_table = { [PM_P2P_CLI_SAP_MCC_24_5_2x2] = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_SAP_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { diff --git a/src/wlan_policy_mgr_tables_2x2_dbs_i.h b/src/wlan_policy_mgr_tables_2x2_dbs_i.h index 3f8b8c4a7329..c13944dfd06d 100644 --- a/src/wlan_policy_mgr_tables_2x2_dbs_i.h +++ b/src/wlan_policy_mgr_tables_2x2_dbs_i.h @@ -252,24 +252,27 @@ static pm_dbs_pcl_third_connection_table_type pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_SAP_SCC_24_1x1] = { [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_SAP_SCC_24_2x2] = { [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_SAP_MCC_24_1x1] = { [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, - [PM_P2P_CLIENT_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, @@ -277,7 +280,8 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_SAP_MCC_24_2x2] = { [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, - [PM_P2P_CLIENT_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, @@ -285,42 +289,38 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_SAP_SCC_5_1x1] = { [PM_STA_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, PM_24G_SCC_CH_SBS_CH}, - [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, - PM_24G_SCC_CH_SBS_CH}, - [PM_P2P_CLIENT_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, - PM_24G_SCC_CH_SBS_CH}, - [PM_P2P_GO_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, - PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_SAP_SCC_5_2x2] = { [PM_STA_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, PM_24G_SCC_CH_SBS_CH}, - [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, - PM_24G_SCC_CH_SBS_CH}, - [PM_P2P_CLIENT_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, - PM_24G_SCC_CH_SBS_CH}, - [PM_P2P_GO_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, - PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_SAP_MCC_5_1x1] = { [PM_STA_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, - [PM_SAP_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_P2P_CLIENT_MODE] = { - PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, - [PM_P2P_GO_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_STA_SAP_MCC_5_2x2] = { [PM_STA_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, - [PM_SAP_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, - [PM_P2P_CLIENT_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, - PM_24G_MCC_CH}, - [PM_P2P_GO_MODE] = {PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, @@ -347,11 +347,11 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_SAP_DBS_1x1] = { [PM_STA_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, - [PM_SAP_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + [PM_SAP_MODE] = { PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, - [PM_P2P_CLIENT_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, - PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, - [PM_P2P_GO_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, @@ -359,11 +359,11 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_SAP_DBS_2x2] = { [PM_STA_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, - [PM_SAP_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + [PM_SAP_MODE] = { PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, - [PM_P2P_CLIENT_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, - PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, - [PM_P2P_GO_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, @@ -374,7 +374,7 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_SAP_MODE] = { PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, [PM_P2P_CLIENT_MODE] = { - PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, [PM_IBSS_MODE] = { @@ -382,21 +382,19 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_SAP_SAP_SCC_24_1x1] = { [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_SAP_SAP_SCC_24_2x2] = { [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, @@ -423,24 +421,20 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_SAP_SAP_SCC_5_1x1] = { [PM_STA_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, PM_24G_SCC_CH_SBS_CH}, - [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, - PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_SAP_SAP_SCC_5_2x2] = { [PM_STA_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, PM_24G_SCC_CH_SBS_CH}, - [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, - PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_24G, PM_24G, PM_24G}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, @@ -487,24 +481,24 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_SAP_SAP_DBS_1x1] = { [PM_STA_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, - [PM_SAP_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + [PM_SAP_MODE] = { PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_SAP_SAP_DBS_2x2] = { [PM_STA_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, - [PM_SAP_MODE] = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, + [PM_SAP_MODE] = { PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_P2P_GO_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = {PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, @@ -674,8 +668,7 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_P2P_GO_SAP_SCC_24_1x1] = { [PM_STA_MODE] = { PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_SAP_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -686,8 +679,7 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_P2P_GO_SAP_SCC_24_2x2] = { [PM_STA_MODE] = { PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_SAP_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -721,8 +713,7 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_MODE] = { PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, PM_24G_SCC_CH_SBS_CH}, - [PM_SAP_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -734,8 +725,7 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_MODE] = { PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, PM_24G_SCC_CH_SBS_CH}, - [PM_SAP_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -796,7 +786,8 @@ pm_third_connection_pcl_dbs_2x2_table = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, [PM_SAP_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -809,7 +800,8 @@ pm_third_connection_pcl_dbs_2x2_table = { PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24}, [PM_SAP_MODE] = { - PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + PM_SCC_ON_5_SCC_ON_24, PM_SCC_ON_5_SCC_ON_24, + PM_SCC_ON_5_SCC_ON_24}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -833,7 +825,7 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { - PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -845,7 +837,7 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { - PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -856,7 +848,8 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_P2P_CLI_MCC_24_1x1] = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -867,7 +860,8 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_P2P_CLI_MCC_24_2x2] = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -878,8 +872,8 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_P2P_CLI_SCC_5_1x1] = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, - PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -890,8 +884,8 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_P2P_CLI_SCC_5_2x2] = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, - [PM_SAP_MODE] = {PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH, - PM_24G_SCC_CH_SBS_CH}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -903,7 +897,7 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { - PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -915,7 +909,7 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { - PM_24G_SBS_CH_MCC_CH, PM_24G, PM_24G_MCC_CH}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -951,8 +945,7 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { - PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, - PM_SCC_ON_5_SCC_ON_24}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -964,8 +957,7 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { - PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24, - PM_SCC_ON_5_SCC_ON_24}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -977,7 +969,7 @@ pm_third_connection_pcl_dbs_2x2_table = { [PM_STA_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { - PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { @@ -986,144 +978,158 @@ pm_third_connection_pcl_dbs_2x2_table = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_SCC_24_1x1] = { - [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_SCC_24_2x2] = { - [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_P2P_CLIENT_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, - [PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_MCC_24_1x1] = { - [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, - [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, - [PM_P2P_CLIENT_MODE] = {PM_5G, PM_5G, PM_5G}, - [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_MCC_24_2x2] = { - [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, - [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, - [PM_P2P_CLIENT_MODE] = {PM_5G, PM_5G, PM_5G}, - [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_SCC_5_1x1] = { [PM_STA_MODE] = { - PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH_5G, - PM_SCC_CH_24G}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { - PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH_5G, - PM_SCC_CH_24G}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH_SBS_CH_5G, - PM_24G_SCC_CH_SBS_CH_5G}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { - PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH_SBS_CH_5G, - PM_24G_SCC_CH_SBS_CH_5G}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_SCC_5_2x2] = { [PM_STA_MODE] = { - PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH_5G, - PM_SCC_CH_24G}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { - PM_24G_SCC_CH_SBS_CH, PM_24G_SCC_CH_SBS_CH_5G, - PM_SCC_CH_24G}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH_SBS_CH_5G, - PM_24G_SCC_CH_SBS_CH_5G}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { - PM_24G_SCC_CH_SBS_CH_5G, PM_24G_SCC_CH_SBS_CH_5G, - PM_24G_SCC_CH_SBS_CH_5G}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_MCC_5_1x1] = { - [PM_STA_MODE] = {PM_24G_MCC_CH, PM_24G_MCC_CH, PM_24G_MCC_CH}, - [PM_SAP_MODE] = {PM_24G_MCC_CH, PM_24G_MCC_CH, PM_24G_MCC_CH}, - [PM_P2P_CLIENT_MODE] = {PM_24G_MCC_CH, PM_24G_MCC_CH, - PM_24G_MCC_CH}, - [PM_P2P_GO_MODE] = {PM_24G_MCC_CH, PM_24G_MCC_CH, PM_24G_MCC_CH}, + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_MCC_5_2x2] = { - [PM_STA_MODE] = {PM_MCC_CH_24G, PM_24G_MCC_CH, PM_24G_MCC_CH}, - [PM_SAP_MODE] = {PM_24G_MCC_CH, PM_24G_MCC_CH, PM_24G_MCC_CH}, - [PM_P2P_CLIENT_MODE] = {PM_MCC_CH_24G, PM_24G_MCC_CH, - PM_24G_MCC_CH}, - [PM_P2P_GO_MODE] = {PM_MCC_CH_24G, PM_24G_MCC_CH, PM_24G_MCC_CH}, + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_MCC_24_5_1x1] = { - [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, - [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, - [PM_P2P_CLIENT_MODE] = {PM_5G, PM_5G, PM_5G}, - [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_MCC_24_5_2x2] = { - [PM_STA_MODE] = {PM_5G, PM_5G, PM_5G}, - [PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G}, - [PM_P2P_CLIENT_MODE] = {PM_5G, PM_5G, PM_5G}, - [PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G}, + [PM_STA_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_SAP_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_CLIENT_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, + [PM_P2P_GO_MODE] = { + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_DBS_1x1] = { [PM_STA_MODE] = { - PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24_5G, - PM_SCC_ON_5_SCC_ON_24}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { - PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24_5G, - PM_SCC_ON_5_SCC_ON_24}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24_5G, - PM_SCC_ON_5_SCC_ON_24}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { - PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24_5G, - PM_SCC_ON_5_SCC_ON_24}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_DBS_2x2] = { [PM_STA_MODE] = { - PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24_5G, - PM_SCC_ON_5_SCC_ON_24}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { - PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24_5G, - PM_SCC_ON_5_SCC_ON_24}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24_5G, - PM_SCC_ON_5_SCC_ON_24}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { - PM_SCC_ON_5_SCC_ON_24_5G, PM_SCC_ON_5_SCC_ON_24_5G, - PM_SCC_ON_5_SCC_ON_24}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, [PM_P2P_GO_P2P_CLI_SBS_5_1x1] = { [PM_STA_MODE] = { - PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_SAP_MODE] = { - PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_CLIENT_MODE] = { - PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_P2P_GO_MODE] = { - PM_SBS_CH_5G, PM_SBS_CH, PM_SBS_CH}, + PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE}, [PM_IBSS_MODE] = { PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} }, From c4e7ce7142c0d3c3a2f7ed5f6f2c072aa6b5477e Mon Sep 17 00:00:00 2001 From: Rachit Kankane Date: Fri, 15 Sep 2017 16:17:13 +0530 Subject: [PATCH 073/187] qcacmn: Correction in PCL index fetching routine In case of SBS or DBS, both the MACs are used for operations. We have issue in PCL index fatching routines for 3-port concurrent combinations when first two ports are configured in DBS mode. Change-Id: I36ca9979ef4222428e383d89b52ff1388c79ac22 CRs-Fixed: 2127091 --- src/wlan_policy_mgr_pcl.c | 208 ++++++++++++++++++-------------------- 1 file changed, 96 insertions(+), 112 deletions(-) diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 01f2cc91c000..9a2092a0b8a6 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -747,26 +747,24 @@ static enum policy_mgr_two_connection_mode else index = PM_P2P_CLI_SAP_MCC_24_5_2x2; } - /* SBS */ + /* SBS or DBS */ } else if (pm_conc_connection_list[0].mac != - pm_conc_connection_list[1].mac) { - if ((WLAN_REG_IS_5GHZ_CH( - pm_conc_connection_list[0].chan)) && - (WLAN_REG_IS_5GHZ_CH( - pm_conc_connection_list[1].chan))) { + pm_conc_connection_list[1].mac) { + /* SBS */ + if ((WLAN_REG_IS_5GHZ_CH(pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH(pm_conc_connection_list[1].chan))) { if (POLICY_MGR_ONE_ONE == pm_conc_connection_list[0].chain_mask) index = PM_P2P_CLI_SAP_SBS_5_1x1; + } else { + /* DBS */ + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_CLI_SAP_DBS_1x1; + else + index = PM_P2P_CLI_SAP_DBS_2x2; } - /* DBS */ - } else { - if (POLICY_MGR_ONE_ONE == - pm_conc_connection_list[0].chain_mask) - index = PM_P2P_CLI_SAP_DBS_1x1; - else - index = PM_P2P_CLI_SAP_DBS_2x2; } - return index; } @@ -819,26 +817,24 @@ static enum policy_mgr_two_connection_mode else index = PM_STA_SAP_MCC_24_5_2x2; } - /* SBS */ + /* SBS or DBS */ } else if (pm_conc_connection_list[0].mac != - pm_conc_connection_list[1].mac) { - if ((WLAN_REG_IS_5GHZ_CH( - pm_conc_connection_list[0].chan)) && - (WLAN_REG_IS_5GHZ_CH( - pm_conc_connection_list[1].chan))) { + pm_conc_connection_list[1].mac) { + /* SBS */ + if ((WLAN_REG_IS_5GHZ_CH(pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH(pm_conc_connection_list[1].chan))) { if (POLICY_MGR_ONE_ONE == pm_conc_connection_list[0].chain_mask) index = PM_STA_SAP_SBS_5_1x1; + } else { + /* DBS */ + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_SAP_DBS_1x1; + else + index = PM_STA_SAP_DBS_2x2; } - /* DBS */ - } else { - if (POLICY_MGR_ONE_ONE == - pm_conc_connection_list[0].chain_mask) - index = PM_STA_SAP_DBS_1x1; - else - index = PM_STA_SAP_DBS_2x2; } - return index; } @@ -891,26 +887,24 @@ static enum policy_mgr_two_connection_mode else index = PM_SAP_SAP_MCC_24_5_2x2; } - /* SBS */ + /* SBS or DBS */ } else if (pm_conc_connection_list[0].mac != - pm_conc_connection_list[1].mac) { - if ((WLAN_REG_IS_5GHZ_CH( - pm_conc_connection_list[0].chan)) && - (WLAN_REG_IS_5GHZ_CH( - pm_conc_connection_list[1].chan))) { + pm_conc_connection_list[1].mac) { + /* SBS */ + if ((WLAN_REG_IS_5GHZ_CH(pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH(pm_conc_connection_list[1].chan))) { if (POLICY_MGR_ONE_ONE == pm_conc_connection_list[0].chain_mask) index = PM_SAP_SAP_SBS_5_1x1; + } else { + /* DBS */ + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_SAP_SAP_DBS_1x1; + else + index = PM_SAP_SAP_DBS_2x2; } - /* DBS */ - } else { - if (POLICY_MGR_ONE_ONE == - pm_conc_connection_list[0].chain_mask) - index = PM_SAP_SAP_DBS_1x1; - else - index = PM_SAP_SAP_DBS_2x2; } - return index; } @@ -963,26 +957,24 @@ static enum policy_mgr_two_connection_mode else index = PM_STA_P2P_GO_MCC_24_5_2x2; } - /* SBS */ + /* SBS or DBS */ } else if (pm_conc_connection_list[0].mac != - pm_conc_connection_list[1].mac) { - if ((WLAN_REG_IS_5GHZ_CH( - pm_conc_connection_list[0].chan)) && - (WLAN_REG_IS_5GHZ_CH( - pm_conc_connection_list[1].chan))) { + pm_conc_connection_list[1].mac) { + /* SBS */ + if ((WLAN_REG_IS_5GHZ_CH(pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH(pm_conc_connection_list[1].chan))) { if (POLICY_MGR_ONE_ONE == pm_conc_connection_list[0].chain_mask) index = PM_STA_P2P_GO_SBS_5_1x1; + } else { + /* DBS */ + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_P2P_GO_DBS_1x1; + else + index = PM_STA_P2P_GO_DBS_2x2; } - /* DBS */ - } else { - if (POLICY_MGR_ONE_ONE == - pm_conc_connection_list[0].chain_mask) - index = PM_STA_P2P_GO_DBS_1x1; - else - index = PM_STA_P2P_GO_DBS_2x2; } - return index; } @@ -1035,26 +1027,24 @@ static enum policy_mgr_two_connection_mode else index = PM_STA_P2P_CLI_MCC_24_5_2x2; } - /* SBS */ + /* SBS or DBS */ } else if (pm_conc_connection_list[0].mac != - pm_conc_connection_list[1].mac) { - if ((WLAN_REG_IS_5GHZ_CH( - pm_conc_connection_list[0].chan)) && - (WLAN_REG_IS_5GHZ_CH( - pm_conc_connection_list[1].chan))) { + pm_conc_connection_list[1].mac) { + /* SBS */ + if ((WLAN_REG_IS_5GHZ_CH(pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH(pm_conc_connection_list[1].chan))) { if (POLICY_MGR_ONE_ONE == pm_conc_connection_list[0].chain_mask) index = PM_STA_P2P_CLI_SBS_5_1x1; + } else { + /* DBS */ + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_P2P_CLI_DBS_1x1; + else + index = PM_STA_P2P_CLI_DBS_2x2; } - /* DBS */ - } else { - if (POLICY_MGR_ONE_ONE == - pm_conc_connection_list[0].chain_mask) - index = PM_STA_P2P_CLI_DBS_1x1; - else - index = PM_STA_P2P_CLI_DBS_2x2; } - return index; } @@ -1107,26 +1097,24 @@ static enum policy_mgr_two_connection_mode else index = PM_P2P_GO_P2P_CLI_MCC_24_5_2x2; } - /* SBS */ + /* SBS or DBS */ } else if (pm_conc_connection_list[0].mac != - pm_conc_connection_list[1].mac) { - if ((WLAN_REG_IS_5GHZ_CH( - pm_conc_connection_list[0].chan)) && - (WLAN_REG_IS_5GHZ_CH( - pm_conc_connection_list[1].chan))) { + pm_conc_connection_list[1].mac) { + /* SBS */ + if ((WLAN_REG_IS_5GHZ_CH(pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH(pm_conc_connection_list[1].chan))) { if (POLICY_MGR_ONE_ONE == pm_conc_connection_list[0].chain_mask) index = PM_P2P_GO_P2P_CLI_SBS_5_1x1; + } else { + /* DBS */ + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_GO_P2P_CLI_DBS_1x1; + else + index = PM_P2P_GO_P2P_CLI_DBS_2x2; } - /* DBS */ - } else { - if (POLICY_MGR_ONE_ONE == - pm_conc_connection_list[0].chain_mask) - index = PM_P2P_GO_P2P_CLI_DBS_1x1; - else - index = PM_P2P_GO_P2P_CLI_DBS_2x2; } - return index; } @@ -1179,26 +1167,24 @@ static enum policy_mgr_two_connection_mode else index = PM_P2P_GO_SAP_MCC_24_5_2x2; } - /* SBS */ + /* SBS or DBS */ } else if (pm_conc_connection_list[0].mac != - pm_conc_connection_list[1].mac) { - if ((WLAN_REG_IS_5GHZ_CH( - pm_conc_connection_list[0].chan)) && - (WLAN_REG_IS_5GHZ_CH( - pm_conc_connection_list[1].chan))) { + pm_conc_connection_list[1].mac) { + /* SBS */ + if ((WLAN_REG_IS_5GHZ_CH(pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH(pm_conc_connection_list[1].chan))) { if (POLICY_MGR_ONE_ONE == pm_conc_connection_list[0].chain_mask) index = PM_P2P_GO_SAP_SBS_5_1x1; + } else { + /* DBS */ + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_P2P_GO_SAP_DBS_1x1; + else + index = PM_P2P_GO_SAP_DBS_2x2; } - /* DBS */ - } else { - if (POLICY_MGR_ONE_ONE == - pm_conc_connection_list[0].chain_mask) - index = PM_P2P_GO_SAP_DBS_1x1; - else - index = PM_P2P_GO_SAP_DBS_2x2; } - return index; } @@ -1251,26 +1237,24 @@ static enum policy_mgr_two_connection_mode else index = PM_STA_STA_MCC_24_5_2x2; } - /* SBS */ + /* SBS or DBS */ } else if (pm_conc_connection_list[0].mac != - pm_conc_connection_list[1].mac) { - if ((WLAN_REG_IS_5GHZ_CH( - pm_conc_connection_list[0].chan)) && - (WLAN_REG_IS_5GHZ_CH( - pm_conc_connection_list[1].chan))) { + pm_conc_connection_list[1].mac) { + /* SBS */ + if ((WLAN_REG_IS_5GHZ_CH(pm_conc_connection_list[0].chan)) && + (WLAN_REG_IS_5GHZ_CH(pm_conc_connection_list[1].chan))) { if (POLICY_MGR_ONE_ONE == pm_conc_connection_list[0].chain_mask) index = PM_STA_STA_SBS_5_1x1; + } else { + /* DBS */ + if (POLICY_MGR_ONE_ONE == + pm_conc_connection_list[0].chain_mask) + index = PM_STA_STA_DBS_1x1; + else + index = PM_STA_STA_DBS_2x2; } - /* DBS */ - } else { - if (POLICY_MGR_ONE_ONE == - pm_conc_connection_list[0].chain_mask) - index = PM_STA_STA_DBS_1x1; - else - index = PM_STA_STA_DBS_2x2; } - return index; } From 758528a6e5b117ba498cad84bb6b4277a962d1d3 Mon Sep 17 00:00:00 2001 From: Rachit Kankane Date: Fri, 15 Sep 2017 16:36:33 +0530 Subject: [PATCH 074/187] qcacmn: New value for ini gWlanMccToSccSwitchMode Currently ini variable gWlanMccToSccSwitchMode has 4 values. Value 3 enforces SCC in anycase, if SCC is not possible then switchoff the AP. Added new value 5 for auto specific scenarios where, if SCC is not possible the allow MCC. Change-Id: I584958c6c61f7d1f5e077871e3891bba79f726a3 CRs-Fixed: 2127091 --- src/wlan_policy_mgr_get_set_utils.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index c156881c7028..5f75ab4e6dc0 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2672,6 +2672,8 @@ bool policy_mgr_is_force_scc(struct wlan_objmgr_psoc *psoc) return ((pm_ctx->user_cfg.mcc_to_scc_switch_mode == QDF_MCC_TO_SCC_SWITCH_FORCE_WITHOUT_DISCONNECTION) || - (pm_ctx->user_cfg.mcc_to_scc_switch_mode == - QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL)); + (pm_ctx->user_cfg.mcc_to_scc_switch_mode == + QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL) || + (pm_ctx->user_cfg.mcc_to_scc_switch_mode == + QDF_MCC_TO_SCC_SWITCH_FORCE_PREFERRED_WITHOUT_DISCONNECTION)); } From 1303fcd9b1550b74e4e4d53493b948fb30778709 Mon Sep 17 00:00:00 2001 From: Rachit Kankane Date: Fri, 15 Sep 2017 17:42:35 +0530 Subject: [PATCH 075/187] qcacmn: policy_mgr update for new connection Policy Manager updated when new connection request is under process. The update is resctricting below behavior: 1. Maximum 2 vdevs are only supported per mac. 2. Intraband MCC among beaconing entities shall not be supported. 3. Intraband MCC shall be allowed when STA is operating on DFS/Passive/LTE avoidance channel. 4. No DFC SCC shall be allowed both in 2-port and 3-port for Auto. Change-Id: If4e78791832207838c38ab7525f8081093cc73ed CRs-Fixed: 2127091 --- src/wlan_policy_mgr_core.c | 57 ++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 04535e2775db..353fa57130ae 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -2184,26 +2184,45 @@ bool policy_mgr_allow_new_home_channel(struct wlan_objmgr_psoc *psoc, { bool status = true; struct policy_mgr_psoc_priv_obj *pm_ctx; + uint32_t mcc_to_scc_switch; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { policy_mgr_err("Invalid Context"); return false; } + mcc_to_scc_switch = + policy_mgr_mcc_to_scc_switch_mode_in_user_cfg(psoc); qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); - if ((num_connections == 2) && - (pm_conc_connection_list[0].chan != - pm_conc_connection_list[1].chan) && - (pm_conc_connection_list[0].mac == - pm_conc_connection_list[1].mac)) { - if (policy_mgr_is_hw_dbs_capable(psoc) == false) { - if ((channel != pm_conc_connection_list[0].chan) && - (channel != pm_conc_connection_list[1].chan)) { - policy_mgr_err("don't allow 3rd home channel on same MAC"); - status = false; - } - } else if (((WLAN_REG_IS_24GHZ_CH(channel)) && + if (num_connections == 2) { + /* No SCC or MCC combination is allowed with / on DFS channel */ + if ((mcc_to_scc_switch == + QDF_MCC_TO_SCC_SWITCH_FORCE_PREFERRED_WITHOUT_DISCONNECTION) + && wlan_reg_is_dfs_ch(pm_ctx->pdev, channel) && + (wlan_reg_is_dfs_ch(pm_ctx->pdev, + pm_conc_connection_list[0].chan) || + wlan_reg_is_dfs_ch(pm_ctx->pdev, + pm_conc_connection_list[1].chan))) { + + policy_mgr_err("Existing DFS connection, new 3-port DFS connection is not allowed"); + status = false; + + } else if (((pm_conc_connection_list[0].chan != + pm_conc_connection_list[1].chan) + || (mcc_to_scc_switch == + QDF_MCC_TO_SCC_SWITCH_FORCE_PREFERRED_WITHOUT_DISCONNECTION) + ) && (pm_conc_connection_list[0].mac == + pm_conc_connection_list[1].mac)) { + if (policy_mgr_is_hw_dbs_capable(psoc) == false) { + if ((channel != + pm_conc_connection_list[0].chan) && + (channel != + pm_conc_connection_list[1].chan)) { + policy_mgr_err("don't allow 3rd home channel on same MAC"); + status = false; + } + } else if (((WLAN_REG_IS_24GHZ_CH(channel)) && (WLAN_REG_IS_24GHZ_CH (pm_conc_connection_list[0].chan)) && (WLAN_REG_IS_24GHZ_CH @@ -2213,9 +2232,19 @@ bool policy_mgr_allow_new_home_channel(struct wlan_objmgr_psoc *psoc, (pm_conc_connection_list[0].chan)) && (WLAN_REG_IS_5GHZ_CH (pm_conc_connection_list[1].chan)))) { - policy_mgr_err("don't allow 3rd home channel on same MAC"); - status = false; + policy_mgr_err("don't allow 3rd home channel on same MAC"); + status = false; + } } + } else if ((num_connections == 1) + && (mcc_to_scc_switch == + QDF_MCC_TO_SCC_SWITCH_FORCE_PREFERRED_WITHOUT_DISCONNECTION) + && wlan_reg_is_dfs_ch(pm_ctx->pdev, channel) + && wlan_reg_is_dfs_ch(pm_ctx->pdev, + pm_conc_connection_list[0].chan)) { + + policy_mgr_err("Existing DFS connection, new 2-port DFS connection is not allowed"); + status = false; } qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); From a07e4b97d47aa034543dbd2afde6e367f7f71a46 Mon Sep 17 00:00:00 2001 From: Rachit Kankane Date: Fri, 15 Sep 2017 19:38:49 +0530 Subject: [PATCH 076/187] qcacmn: Enforce MCC to SCC for 3-port combinations This update is for moving of AP/GO to enforce SCC for 3-port combinations AP+AP+STA and AP+GO+STA. Change-Id: I878b56cd8215f0d0f846af62fa2033b268e96317 CRs-Fixed: 2127091 --- src/wlan_policy_mgr_action.c | 82 ++++++++++++------------ src/wlan_policy_mgr_get_set_utils.c | 96 +++++++++++++++-------------- src/wlan_policy_mgr_i.h | 8 +-- 3 files changed, 94 insertions(+), 92 deletions(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index bc208a838c2a..2b53cc4697a2 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -597,12 +597,15 @@ static bool policy_mgr_is_restart_sap_allowed( struct wlan_objmgr_psoc *psoc, uint32_t mcc_to_scc_switch) { + uint32_t sta_ap_bit_mask = QDF_STA_MASK | QDF_SAP_MASK; + uint32_t sta_go_bit_mask = QDF_STA_MASK | QDF_P2P_GO_MASK; + if ((mcc_to_scc_switch == QDF_MCC_TO_SCC_SWITCH_DISABLE) || !policy_mgr_concurrent_open_sessions_running(psoc) || - !((policy_mgr_get_concurrency_mode(psoc) == - (QDF_STA_MASK | QDF_SAP_MASK)) || - (policy_mgr_get_concurrency_mode(psoc) == - (QDF_STA_MASK | QDF_P2P_GO_MASK)))) { + !(((policy_mgr_get_concurrency_mode(psoc) & sta_ap_bit_mask) + == sta_ap_bit_mask) || + ((policy_mgr_get_concurrency_mode(psoc) & sta_go_bit_mask) + == sta_go_bit_mask))) { policy_mgr_err("MCC switch disabled or not concurrent STA/SAP, STA/GO"); return false; } @@ -653,10 +656,11 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) struct wlan_objmgr_psoc *psoc; struct policy_mgr_psoc_priv_obj *pm_ctx = NULL; struct sta_ap_intf_check_work_ctx *work_info = NULL; - uint32_t mcc_to_scc_switch; + uint32_t mcc_to_scc_switch, cc_count = 0, i; QDF_STATUS status; uint8_t channel, sec_ch; - uint8_t operating_channel, vdev_id; + uint8_t operating_channel[MAX_NUMBER_OF_CONC_CONNECTIONS]; + uint8_t vdev_id[MAX_NUMBER_OF_CONC_CONNECTIONS]; work_info = (struct sta_ap_intf_check_work_ctx *) data; if (!work_info) { @@ -684,19 +688,18 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) if (!policy_mgr_is_restart_sap_allowed(psoc, mcc_to_scc_switch)) goto end; - if (policy_mgr_get_mode_specific_conn_info(psoc, - &operating_channel, - &vdev_id, - PM_SAP_MODE)) { - policy_mgr_debug("SAP operating at channel:%d", - operating_channel); - } else if (policy_mgr_get_mode_specific_conn_info(psoc, - &operating_channel, - &vdev_id, - PM_P2P_GO_MODE)) { - policy_mgr_debug("GO operating at channel:%d", - operating_channel); - } else { + cc_count = policy_mgr_get_mode_specific_conn_info(psoc, + &operating_channel[cc_count], + &vdev_id[cc_count], + PM_SAP_MODE); + policy_mgr_debug("Number of concurrent SAP: %d", cc_count); + cc_count = cc_count + policy_mgr_get_mode_specific_conn_info(psoc, + &operating_channel[cc_count], + &vdev_id[cc_count], + PM_P2P_GO_MODE); + policy_mgr_debug("Number of beaconing entities (SAP + GO):%d", + cc_count); + if (!cc_count) { policy_mgr_err("Could not retrieve SAP/GO operating channel&vdevid"); goto end; } @@ -705,16 +708,18 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) policy_mgr_err("SAP restart get channel callback in NULL"); goto end; } - status = pm_ctx->hdd_cbacks. - wlan_hdd_get_channel_for_sap_restart(psoc, vdev_id, - &channel, &sec_ch); - if (status != QDF_STATUS_SUCCESS) { - policy_mgr_err("Failed to switch SAP channel"); - goto end; + for (i = 0; i < cc_count; i++) { + status = pm_ctx->hdd_cbacks. + wlan_hdd_get_channel_for_sap_restart(psoc, + vdev_id[i], &channel, &sec_ch); + if (status == QDF_STATUS_SUCCESS) { + policy_mgr_info("SAP restarts due to MCC->SCC switch, old chan :%d new chan: %d" + , operating_channel[i], channel); + break; + } } - - policy_mgr_info("SAP restarts due to MCC->SCC switch, old chan :%d new chan: %d", - operating_channel, channel); + if (status != QDF_STATUS_SUCCESS) + policy_mgr_err("Failed to switch SAP channel"); end: if (work_info) { qdf_mem_free(work_info); @@ -842,20 +847,12 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( return; } - if (policy_mgr_get_mode_specific_conn_info(psoc, - &operating_channel, - &vdev_id, - PM_SAP_MODE)) { - policy_mgr_debug("SAP operating at channel:%d", - operating_channel); - } else if (policy_mgr_get_mode_specific_conn_info(psoc, - &operating_channel, - &vdev_id, - PM_P2P_GO_MODE)) { - policy_mgr_debug("GO operating at channel:%d", - operating_channel); + if (policy_mgr_get_mode_specific_conn_info(psoc, &operating_channel, + &vdev_id, PM_STA_MODE)) { + policy_mgr_debug("STA operating Channel: %u", + operating_channel); } else { - policy_mgr_err("Could not get SAP/GO operating channel&vdevid"); + policy_mgr_err("Could not get STA operating channel&vdevid"); return; } @@ -871,8 +868,7 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( } if ((mcc_to_scc_switch != QDF_MCC_TO_SCC_SWITCH_DISABLE) && - policy_mgr_valid_sta_channel_check(psoc, - operating_channel) + policy_mgr_valid_sta_channel_check(psoc, operating_channel) && !pm_ctx->sta_ap_intf_check_work_info) { struct sta_ap_intf_check_work_ctx *work_info; work_info = qdf_mem_malloc( diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 5f75ab4e6dc0..5a6a48d238fa 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1404,24 +1404,23 @@ bool policy_mgr_is_ibss_conn_exist(struct wlan_objmgr_psoc *psoc, return status; } -bool policy_mgr_get_mode_specific_conn_info(struct wlan_objmgr_psoc *psoc, +uint32_t policy_mgr_get_mode_specific_conn_info(struct wlan_objmgr_psoc *psoc, uint8_t *channel, uint8_t *vdev_id, enum policy_mgr_con_mode mode) { - uint32_t count, index = 0; + uint32_t count = 0, index = 0; uint32_t list[MAX_NUMBER_OF_CONC_CONNECTIONS]; - bool status = false; struct policy_mgr_psoc_priv_obj *pm_ctx; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { policy_mgr_err("Invalid Context"); - return false; + return count; } if (NULL == channel || NULL == vdev_id) { policy_mgr_err("Null pointer error"); - return false; + return count; } count = policy_mgr_mode_specific_connection_count( @@ -1429,28 +1428,23 @@ bool policy_mgr_get_mode_specific_conn_info(struct wlan_objmgr_psoc *psoc, qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); if (count == 0) { policy_mgr_debug("No mode:[%d] connection", mode); - status = false; } else if (count == 1) { *channel = pm_conc_connection_list[list[index]].chan; *vdev_id = pm_conc_connection_list[list[index]].vdev_id; - status = true; } else { - /* - * Todo Currently the first SAP connection info is - * returned. Modify this to accommodate SAP+SAP+STA - * and SAP+SAP+P2P - */ - *channel = pm_conc_connection_list[list[index]].chan; - *vdev_id = + for (index = 0; index < count; index++) { + channel[index] = + pm_conc_connection_list[list[index]].chan; + + vdev_id[index] = pm_conc_connection_list[list[index]].vdev_id; - policy_mgr_debug("Multiple mode:[%d] connections, picking first one", - mode); - status = true; + } + policy_mgr_debug("Multiple mode:[%d] connections", mode); } qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); - return status; + return count; } bool policy_mgr_max_concurrent_connections_reached( @@ -2472,7 +2466,9 @@ bool policy_mgr_is_dnsc_set(struct wlan_objmgr_vdev *vdev) QDF_STATUS policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc, uint8_t channel, bool *ok) { - uint8_t operating_channel = 0, vdev_id = 0; + uint32_t cc_count = 0, i; + uint8_t operating_channel[MAX_NUMBER_OF_CONC_CONNECTIONS]; + uint8_t vdev_id[MAX_NUMBER_OF_CONC_CONNECTIONS]; struct wlan_objmgr_vdev *vdev; if (!channel || !ok) { @@ -2480,27 +2476,31 @@ QDF_STATUS policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_INVAL; } - if (policy_mgr_get_mode_specific_conn_info(psoc, - &operating_channel, - &vdev_id, - PM_SAP_MODE)) - policy_mgr_debug("SAP mode active"); - else if (policy_mgr_get_mode_specific_conn_info(psoc, - &operating_channel, - &vdev_id, - PM_P2P_GO_MODE)) - policy_mgr_debug("P2P_GO_MODE mode active"); - else { + cc_count = policy_mgr_get_mode_specific_conn_info(psoc, + &operating_channel[cc_count], + &vdev_id[cc_count], + PM_SAP_MODE); + policy_mgr_debug("Number of SAP modes: %d", cc_count); + cc_count = cc_count + policy_mgr_get_mode_specific_conn_info(psoc, + &operating_channel[cc_count], + &vdev_id[cc_count], + PM_P2P_GO_MODE); + policy_mgr_debug("Number of beaconing entities (SAP + GO):%d", + cc_count); + if (!cc_count) { *ok = true; return QDF_STATUS_SUCCESS; } - vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id, + for (i = 0; i < cc_count; i++) { + vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, + vdev_id[i], WLAN_POLICY_MGR_ID); - if (!vdev) { - policy_mgr_err("vdev is NULL"); - return QDF_STATUS_E_INVAL; - } + if (!vdev) { + policy_mgr_err("vdev for vdev_id:%d is NULL", + vdev_id[i]); + return QDF_STATUS_E_INVAL; + } /** * If channel passed is same as AP/GO operating channel, then @@ -2511,18 +2511,24 @@ QDF_STATUS policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc, * return true. */ /* TODO: To be enhanced for SBS */ - if (policy_mgr_is_dnsc_set(vdev)) { - if (operating_channel == channel) + if (policy_mgr_is_dnsc_set(vdev)) { + if (operating_channel[i] == channel) { + *ok = true; + wlan_objmgr_vdev_release_ref(vdev, + WLAN_POLICY_MGR_ID); + break; + } else if (WLAN_REG_IS_SAME_BAND_CHANNELS( + operating_channel[i], channel)) { + *ok = false; + wlan_objmgr_vdev_release_ref(vdev, + WLAN_POLICY_MGR_ID); + break; + } + } else { *ok = true; - else if (WLAN_REG_IS_SAME_BAND_CHANNELS(operating_channel, - channel)) - *ok = false; - else - *ok = true; - } else { - *ok = true; + } + wlan_objmgr_vdev_release_ref(vdev, WLAN_POLICY_MGR_ID); } - wlan_objmgr_vdev_release_ref(vdev, WLAN_POLICY_MGR_ID); return QDF_STATUS_SUCCESS; } diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 5610f49f8c09..85cacb8c254e 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -410,15 +410,15 @@ QDF_STATUS policy_mgr_reset_sap_mandatory_channels( * policy_mgr_get_mode_specific_conn_info() - Get active mode specific * channel and vdev id * @psoc: PSOC object information - * @channel: Mode specific channel - * @vdev_id: Mode specific vdev id + * @channel: Mode specific channel (list) + * @vdev_id: Mode specific vdev id (list) * @mode: Connection Mode * * Get active mode specific channel and vdev id * - * Return: true for success, else false + * Return: number of connection found as per given mode */ -bool policy_mgr_get_mode_specific_conn_info(struct wlan_objmgr_psoc *psoc, +uint32_t policy_mgr_get_mode_specific_conn_info(struct wlan_objmgr_psoc *psoc, uint8_t *channel, uint8_t *vdev_id, enum policy_mgr_con_mode mode); From fb82833f38e8cb74b4c498d6918b300d60380892 Mon Sep 17 00:00:00 2001 From: Manjunathappa Prakash Date: Wed, 5 Apr 2017 15:59:49 -0700 Subject: [PATCH 077/187] qcacmn: Disable LRO capability during concurrency LRO rx jumbo packets cannot be forwarded to other vdev and kernel drops them with warning message: "skbuff: wlan0: received packets cannot be forwarded while LRO is enabled" So disable LRO capability during concurrency. Change-Id: Ib35e1ee5f9c18a846e21ce1eb293e12e17761fa8 CRs-Fixed: 1092193 --- inc/wlan_policy_mgr_api.h | 23 +++++++++++++++++++++++ src/wlan_policy_mgr_get_set_utils.c | 24 ++++++++++++++++++++++++ src/wlan_policy_mgr_i.h | 1 + src/wlan_policy_mgr_init_deinit.c | 17 +++++++++++++++++ 4 files changed, 65 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 3865a8674f4c..7f8fcfd34b80 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -812,6 +812,15 @@ struct policy_mgr_cdp_cbacks { uint8_t vdev_id, uint8_t mac_id); }; +/** + * struct policy_mgr_dp_cbacks - CDP Callbacks to be invoked + * from policy manager + * @hdd_disable_lro_in_concurrency: Callback to disable LRO + */ +struct policy_mgr_dp_cbacks { + void (*hdd_disable_lro_in_concurrency)(bool); +}; + /** * struct policy_mgr_wma_cbacks - WMA Callbacks to be invoked * from policy manager @@ -1476,6 +1485,20 @@ QDF_STATUS policy_mgr_register_tdls_cb(struct wlan_objmgr_psoc *psoc, QDF_STATUS policy_mgr_register_cdp_cb(struct wlan_objmgr_psoc *psoc, struct policy_mgr_cdp_cbacks *cdp_cbacks); +/** + * policy_mgr_register_dp_cb() - register CDP callbacks + * @psoc: PSOC object information + * @cdp_cbacks: function pointers from CDP + * + * API, allows CDP to register callbacks to be invoked by + * policy mgr + * + * Return: SUCCESS, + * Failure (if registration fails) + */ +QDF_STATUS policy_mgr_register_dp_cb(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_dp_cbacks *dp_cbacks); + /** * policy_mgr_register_wma_cb() - register WMA callbacks * @psoc: PSOC object information diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 5a6a48d238fa..4d970b5b7703 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1154,6 +1154,20 @@ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, if (pm_ctx->tdls_cbacks.tdls_notify_increment_session) pm_ctx->tdls_cbacks.tdls_notify_increment_session(psoc); + /* + * Disable LRO if P2P or IBSS or SAP connection has come up or + * there are more than one STA connections + */ + if ((policy_mgr_mode_specific_connection_count(psoc, PM_STA_MODE, NULL) > 1) || + (policy_mgr_mode_specific_connection_count(psoc, PM_SAP_MODE, NULL) > 0) || + (policy_mgr_mode_specific_connection_count(psoc, PM_P2P_CLIENT_MODE, NULL) > + 0) || + (policy_mgr_mode_specific_connection_count(psoc, PM_P2P_GO_MODE, NULL) > 0) || + (policy_mgr_mode_specific_connection_count(psoc, PM_IBSS_MODE, NULL) > 0)) { + if (pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency != NULL) + pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency(true); + }; + policy_mgr_dump_current_concurrency(psoc); qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); @@ -1203,6 +1217,16 @@ QDF_STATUS policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, /* Notify tdls */ if (pm_ctx->tdls_cbacks.tdls_notify_decrement_session) pm_ctx->tdls_cbacks.tdls_notify_decrement_session(psoc); + /* Enable LRO if there no concurrency */ + if ((policy_mgr_mode_specific_connection_count(psoc, PM_STA_MODE, NULL) == 1) && + (policy_mgr_mode_specific_connection_count(psoc, PM_SAP_MODE, NULL) == 0) && + (policy_mgr_mode_specific_connection_count(psoc, PM_P2P_CLIENT_MODE, NULL) == + 0) && + (policy_mgr_mode_specific_connection_count(psoc, PM_P2P_GO_MODE, NULL) == 0) && + (policy_mgr_mode_specific_connection_count(psoc, PM_IBSS_MODE, NULL) == 0)) { + if (pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency != NULL) + pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency(false); + }; policy_mgr_dump_current_concurrency(psoc); diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 85cacb8c254e..0b058781d92b 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -251,6 +251,7 @@ struct policy_mgr_psoc_priv_obj { struct policy_mgr_wma_cbacks wma_cbacks; struct policy_mgr_tdls_cbacks tdls_cbacks; struct policy_mgr_cdp_cbacks cdp_cbacks; + struct policy_mgr_dp_cbacks dp_cbacks; bool enable_sap_mandatory_chan_list; uint8_t sap_mandatory_channels[QDF_MAX_NUM_CHAN]; uint32_t sap_mandatory_channels_len; diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index c946988f8789..d556c3ed9aeb 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -619,6 +619,23 @@ QDF_STATUS policy_mgr_register_cdp_cb(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +QDF_STATUS policy_mgr_register_dp_cb(struct wlan_objmgr_psoc *psoc, + struct policy_mgr_dp_cbacks *dp_cbacks) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency = + dp_cbacks->hdd_disable_lro_in_concurrency; + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS policy_mgr_register_tdls_cb(struct wlan_objmgr_psoc *psoc, struct policy_mgr_tdls_cbacks *tdls_cbacks) { From ab131773f7d44b7dcaa1d52f8a1bb265ffa61a26 Mon Sep 17 00:00:00 2001 From: Yun Park Date: Tue, 26 Sep 2017 16:39:17 -0700 Subject: [PATCH 078/187] qcacmn: Enable RPS dynamically for SAP mode SAP Rx TPUT is bounded by host network stack, which is running in the context of IPA work-queue, when IPA offload data path enabled. However RPS shouldn't enabled for legacy Rx data path, where NAPI is enabled. So, we dynamically enable RPS for SAP interface when the vdev comes up and IPA was enabled only. Send RPS enable indication to CNSS daemon to enable RPS only when SAP interface comes up and disable RPS when SAP interface is closed. Change-Id: Ia669b2c3ae814d0577f5226d8acbf026740ad760 CRs-Fixed: 2129520 --- inc/wlan_policy_mgr_api.h | 2 ++ src/wlan_policy_mgr_get_set_utils.c | 14 ++++++++++++++ src/wlan_policy_mgr_init_deinit.c | 2 ++ 3 files changed, 18 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 7f8fcfd34b80..580c94fff49c 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -816,9 +816,11 @@ struct policy_mgr_cdp_cbacks { * struct policy_mgr_dp_cbacks - CDP Callbacks to be invoked * from policy manager * @hdd_disable_lro_in_concurrency: Callback to disable LRO + * @hdd_set_rx_mode_rps_cb: Callback to set RPS */ struct policy_mgr_dp_cbacks { void (*hdd_disable_lro_in_concurrency)(bool); + void (*hdd_set_rx_mode_rps_cb)(bool); }; /** diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 4d970b5b7703..42195ab01b87 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1168,6 +1168,13 @@ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency(true); }; + /* Enable RPS if SAP interface has come up */ + if (policy_mgr_mode_specific_connection_count(psoc, PM_SAP_MODE, NULL) + == 1) { + if (pm_ctx->dp_cbacks.hdd_set_rx_mode_rps_cb != NULL) + pm_ctx->dp_cbacks.hdd_set_rx_mode_rps_cb(true); + } + policy_mgr_dump_current_concurrency(psoc); qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); @@ -1228,6 +1235,13 @@ QDF_STATUS policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency(false); }; + /* Disable RPS if SAP interface has come up */ + if (policy_mgr_mode_specific_connection_count(psoc, PM_SAP_MODE, NULL) + == 0) { + if (pm_ctx->dp_cbacks.hdd_set_rx_mode_rps_cb != NULL) + pm_ctx->dp_cbacks.hdd_set_rx_mode_rps_cb(false); + } + policy_mgr_dump_current_concurrency(psoc); return qdf_status; diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index d556c3ed9aeb..08513de35abd 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -632,6 +632,8 @@ QDF_STATUS policy_mgr_register_dp_cb(struct wlan_objmgr_psoc *psoc, pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency = dp_cbacks->hdd_disable_lro_in_concurrency; + pm_ctx->dp_cbacks.hdd_set_rx_mode_rps_cb = + dp_cbacks->hdd_set_rx_mode_rps_cb; return QDF_STATUS_SUCCESS; } From a598b91ee0f7824fdbf6325e208806408e199bcb Mon Sep 17 00:00:00 2001 From: Ganesh Kondabattini Date: Tue, 31 Oct 2017 22:40:18 +0530 Subject: [PATCH 079/187] qcacmn: Set weight of DFS/passive channels in pcl to 0 If force SCC is set and SAP is active then all DFS/disabled channels in PCL should have 0 weight to avoid the STA roaming to these channels. Change-Id: I4519c29477c5108f5131b7caa806505b69efea8b CRs-Fixed: 2135750 --- inc/wlan_policy_mgr_api.h | 15 +++++++++ src/wlan_policy_mgr_core.c | 64 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 580c94fff49c..040f930ef5fd 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -2130,4 +2130,19 @@ void policy_mgr_set_cur_conc_system_pref(struct wlan_objmgr_psoc *psoc, */ uint8_t policy_mgr_get_cur_conc_system_pref(struct wlan_objmgr_psoc *psoc); +/** + * policy_mgr_set_weight_of_dfs_passive_channels_to_zero() - set weight of dfs + * and passive channels to 0 + * @psoc: pointer to soc + * @pcl_channels: preferred channel list + * @len: length of preferred channel list + * @weight_list: preferred channel weight list + * @weight_len: length of weight list + * This function set the weight of dfs and passive channels to 0 + * + * Return: None + */ +void policy_mgr_set_weight_of_dfs_passive_channels_to_zero( + struct wlan_objmgr_psoc *psoc, uint8_t *pcl_channels, + uint32_t *len, uint8_t *weight_list, uint32_t weight_len); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 353fa57130ae..29f6069fad80 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -1674,6 +1674,68 @@ QDF_STATUS policy_mgr_get_connection_channels(struct wlan_objmgr_psoc *psoc, return status; } +/** + * policy_mgr_set_weight_of_dfs_passive_channels_to_zero() - set weight of dfs + * and passive channels to 0 + * @psoc: pointer to soc + * @pcl_channels: preferred channel list + * @len: length of preferred channel list + * @weight_list: preferred channel weight list + * @weight_len: length of weight list + * This function set the weight of dfs and passive channels to 0 + * + * Return: None + */ +void policy_mgr_set_weight_of_dfs_passive_channels_to_zero( + struct wlan_objmgr_psoc *psoc, uint8_t *pcl_channels, + uint32_t *len, uint8_t *weight_list, uint32_t weight_len) +{ + uint8_t i; + uint32_t orig_channel_count = 0; + bool mcc_to_scc_mode; + uint32_t sap_count; + enum channel_state channel_state; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + mcc_to_scc_mode = policy_mgr_is_force_scc(psoc); + sap_count = policy_mgr_mode_specific_connection_count(psoc, + PM_SAP_MODE, NULL); + policy_mgr_debug("mcc_to_scc_mode %u, sap_count %u", mcc_to_scc_mode, + sap_count); + + if (!mcc_to_scc_mode || !sap_count) + return; + + if (len) + orig_channel_count = QDF_MIN(*len, QDF_MAX_NUM_CHAN); + else { + policy_mgr_err("invalid number of channel length"); + return; + } + + policy_mgr_debug("Set weight of DFS/passive channels to 0"); + + for (i = 0; i < orig_channel_count; i++) { + channel_state = reg_get_channel_state(pm_ctx->pdev, + pcl_channels[i]); + if ((channel_state == CHANNEL_STATE_DISABLE) || + (channel_state == CHANNEL_STATE_INVALID)) + /* Set weight of inactive channels to 0 */ + weight_list[i] = 0; + + policy_mgr_debug("chan[%d] - %d, weight[%d] - %d", + i, pcl_channels[i], i, weight_list[i]); + } + + return; +} + /** * policy_mgr_get_channel_list() - provides the channel list * suggestion for new connection @@ -2119,6 +2181,8 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, policy_mgr_update_with_safe_channel_list(psoc, pcl_channels, len, pcl_weights, weight_len); + policy_mgr_set_weight_of_dfs_passive_channels_to_zero(psoc, + pcl_channels, len, pcl_weights, weight_len); return status; } From bdda5823be71cb654788b536666a09d4a1e79906 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Wed, 25 Oct 2017 16:33:06 -0700 Subject: [PATCH 080/187] qcacmn: Stop the opportunistic timer when hdd stop happens Stop the opportunistic timer & take action if needed when hdd stop happens. Also, take action when set_hw_mode request to FW times out. Change-Id: I32f1e38e93a5805e0d85b800cc4e070cd6f79669 CRs-Fixed: 2133388 --- inc/wlan_policy_mgr_api.h | 13 +++++++++++++ inc/wlan_policy_mgr_public_struct.h | 1 + src/wlan_policy_mgr_action.c | 17 +++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 040f930ef5fd..4dd3629ad843 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -2129,6 +2129,19 @@ void policy_mgr_set_cur_conc_system_pref(struct wlan_objmgr_psoc *psoc, * Return: conc_system_pref */ uint8_t policy_mgr_get_cur_conc_system_pref(struct wlan_objmgr_psoc *psoc); +/** + * policy_mgr_check_and_stop_opportunistic_timer - Get current + * state of opportunistic timer, if running, stop it and take + * action + * @psoc: soc pointer + * + * Get the current state of opportunistic timer, if it is + * running, stop it and take action. + * + * Return: None + */ +void policy_mgr_check_and_stop_opportunistic_timer( + struct wlan_objmgr_psoc *psoc); /** * policy_mgr_set_weight_of_dfs_passive_channels_to_zero() - set weight of dfs diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index b10adbaff31a..4d4f9ad53f86 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -896,6 +896,7 @@ struct policy_mgr_hw_mode { void *set_hw_mode_cb; enum policy_mgr_conn_update_reason reason; uint32_t session_id; + struct wlan_objmgr_vdev *vdev; struct wlan_objmgr_psoc *context; }; diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 2b53cc4697a2..48ab89322b0f 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -1092,6 +1092,23 @@ void policy_mgr_checkn_update_hw_mode_single_mac_mode( pm_dbs_opportunistic_timer_handler((void *)psoc); } +void policy_mgr_check_and_stop_opportunistic_timer( + struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + if (QDF_TIMER_STATE_RUNNING == + pm_ctx->dbs_opportunistic_timer.state) { + qdf_mc_timer_stop(&pm_ctx->dbs_opportunistic_timer); + pm_dbs_opportunistic_timer_handler((void *)psoc); + } +} + void policy_mgr_set_hw_mode_change_in_progress( struct wlan_objmgr_psoc *psoc, enum policy_mgr_hw_mode_change value) { From 275208bd392b2d2ee90c4d7ae78c334969b2c214 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Thu, 9 Nov 2017 09:54:12 -0800 Subject: [PATCH 081/187] qcacmn: Use enum QDF_OPMODE Change "qcacmn: Rename enum tQDF_ADAPTER_MODE" (qca-wifi-host-cmn Change-Id I20f1b6d1a0ab4b8fe6a85cefdff96a49e2f4652c) renamed enum tQDF_ADAPTER_MODE to QDF_OPMODE. Update all references to use the new name. Change-Id: Ic6f663dac11a100f168b2626c7c0fbcaccbfca4f CRs-Fixed: 2141061 --- inc/wlan_policy_mgr_api.h | 24 ++++++++++++------------ src/wlan_policy_mgr_core.c | 4 ++-- src/wlan_policy_mgr_get_set_utils.c | 18 +++++++++--------- src/wlan_policy_mgr_i.h | 2 +- src/wlan_policy_mgr_pcl.c | 2 +- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 4dd3629ad843..301cd0c7c1c4 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -68,7 +68,7 @@ typedef const enum policy_mgr_conc_next_action * Return: NONE */ void policy_mgr_set_concurrency_mode(struct wlan_objmgr_psoc *psoc, - enum tQDF_ADAPTER_MODE mode); + enum QDF_OPMODE mode); /** * policy_mgr_clear_concurrency_mode() - To clear concurrency mode @@ -80,7 +80,7 @@ void policy_mgr_set_concurrency_mode(struct wlan_objmgr_psoc *psoc, * Return: NONE */ void policy_mgr_clear_concurrency_mode(struct wlan_objmgr_psoc *psoc, - enum tQDF_ADAPTER_MODE mode); + enum QDF_OPMODE mode); /** * policy_mgr_get_connection_count() - provides the count of @@ -192,7 +192,7 @@ bool policy_mgr_is_mcc_in_24G(struct wlan_objmgr_psoc *psoc); */ QDF_STATUS policy_mgr_change_mcc_go_beacon_interval( struct wlan_objmgr_psoc *psoc, - uint8_t vdev_id, enum tQDF_ADAPTER_MODE dev_mode); + uint8_t vdev_id, enum QDF_OPMODE dev_mode); #if defined(FEATURE_WLAN_MCC_TO_SCC_SWITCH) /** @@ -233,7 +233,7 @@ static inline void policy_mgr_change_sap_channel_with_csa( * Return: None */ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, - enum tQDF_ADAPTER_MODE mode, uint8_t sessionId); + enum QDF_OPMODE mode, uint8_t session_id); /** * policy_mgr_decr_active_session() - decrements the number of active sessions @@ -248,7 +248,7 @@ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, * Return: QDF_STATUS */ QDF_STATUS policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, - enum tQDF_ADAPTER_MODE mode, uint8_t sessionId); + enum QDF_OPMODE mode, uint8_t session_id); /** * policy_mgr_decr_session_set_pcl() - Decrement session count and set PCL @@ -262,7 +262,7 @@ QDF_STATUS policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, * Return: None */ void policy_mgr_decr_session_set_pcl(struct wlan_objmgr_psoc *psoc, - enum tQDF_ADAPTER_MODE mode, uint8_t session_id); + enum QDF_OPMODE mode, uint8_t session_id); /** * policy_mgr_get_channel() - provide channel number of given mode and vdevid @@ -666,7 +666,7 @@ static inline QDF_STATUS policy_mgr_decr_connection_count_utfw( * Return: policy_mgr_con_mode enum */ enum policy_mgr_con_mode policy_mgr_convert_device_mode_to_qdf_type( - enum tQDF_ADAPTER_MODE device_mode); + enum QDF_OPMODE device_mode); /** * policy_mgr_pdev_set_hw_mode() - Set HW mode command to FW @@ -748,9 +748,9 @@ typedef void (*policy_mgr_nss_update_cback)(struct wlan_objmgr_psoc *psoc, */ struct policy_mgr_sme_cbacks { QDF_STATUS (*sme_get_valid_channels)(uint8_t *chan_list, - uint32_t *list_len); - void (*sme_get_nss_for_vdev)(enum tQDF_ADAPTER_MODE, - uint8_t *nss_2g, uint8_t *nss_5g); + uint32_t *list_len); + void (*sme_get_nss_for_vdev)(enum QDF_OPMODE, + uint8_t *nss_2g, uint8_t *nss_5g); QDF_STATUS (*sme_soc_set_dual_mac_config)( struct policy_mgr_dual_mac_config msg); QDF_STATUS (*sme_pdev_set_hw_mode)(struct policy_mgr_hw_mode msg); @@ -923,8 +923,8 @@ void policy_mgr_soc_set_dual_mac_cfg_cb(enum set_hw_mode_status status, * * Return: true or false */ -bool policy_mgr_map_concurrency_mode(enum tQDF_ADAPTER_MODE *old_mode, - enum policy_mgr_con_mode *new_mode); +bool policy_mgr_map_concurrency_mode(enum QDF_OPMODE *old_mode, + enum policy_mgr_con_mode *new_mode); /** * policy_mgr_get_channel_from_scan_result() - to get channel from scan result diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 29f6069fad80..037ad11aa81b 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -1138,7 +1138,7 @@ void policy_mgr_dump_current_concurrency(struct wlan_objmgr_psoc *psoc) * Return: None */ void policy_mgr_pdev_set_pcl(struct wlan_objmgr_psoc *psoc, - enum tQDF_ADAPTER_MODE mode) + enum QDF_OPMODE mode) { QDF_STATUS status; enum policy_mgr_con_mode con_mode; @@ -1205,7 +1205,7 @@ void policy_mgr_set_pcl_for_existing_combo( { struct policy_mgr_conc_connection_info info[MAX_NUMBER_OF_CONC_CONNECTIONS] = { {0} }; - enum tQDF_ADAPTER_MODE pcl_mode; + enum QDF_OPMODE pcl_mode; uint8_t num_cxn_del = 0; struct policy_mgr_psoc_priv_obj *pm_ctx; diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 42195ab01b87..3d11ab25cf00 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1030,7 +1030,7 @@ bool policy_mgr_current_concurrency_is_mcc(struct wlan_objmgr_psoc *psoc) * Return: NONE */ void policy_mgr_set_concurrency_mode(struct wlan_objmgr_psoc *psoc, - enum tQDF_ADAPTER_MODE mode) + enum QDF_OPMODE mode) { struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -1069,7 +1069,7 @@ void policy_mgr_set_concurrency_mode(struct wlan_objmgr_psoc *psoc, * Return: NONE */ void policy_mgr_clear_concurrency_mode(struct wlan_objmgr_psoc *psoc, - enum tQDF_ADAPTER_MODE mode) + enum QDF_OPMODE mode) { struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -1099,7 +1099,7 @@ void policy_mgr_clear_concurrency_mode(struct wlan_objmgr_psoc *psoc, } void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, - enum tQDF_ADAPTER_MODE mode, + enum QDF_OPMODE mode, uint8_t session_id) { struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -1181,7 +1181,7 @@ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, } QDF_STATUS policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, - enum tQDF_ADAPTER_MODE mode, + enum QDF_OPMODE mode, uint8_t session_id) { struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -1375,8 +1375,8 @@ QDF_STATUS policy_mgr_decr_connection_count(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } -bool policy_mgr_map_concurrency_mode(enum tQDF_ADAPTER_MODE *old_mode, - enum policy_mgr_con_mode *new_mode) +bool policy_mgr_map_concurrency_mode(enum QDF_OPMODE *old_mode, + enum policy_mgr_con_mode *new_mode) { bool status = true; @@ -1985,7 +1985,7 @@ bool policy_mgr_is_mcc_adaptive_scheduler_enabled( */ QDF_STATUS policy_mgr_change_mcc_go_beacon_interval( struct wlan_objmgr_psoc *psoc, - uint8_t vdev_id, enum tQDF_ADAPTER_MODE dev_mode) + uint8_t vdev_id, enum QDF_OPMODE dev_mode) { QDF_STATUS status; struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -2026,7 +2026,7 @@ struct policy_mgr_conc_connection_info *policy_mgr_get_conn_info(uint32_t *len) } enum policy_mgr_con_mode policy_mgr_convert_device_mode_to_qdf_type( - enum tQDF_ADAPTER_MODE device_mode) + enum QDF_OPMODE device_mode) { enum policy_mgr_con_mode mode = PM_MAX_NUM_OF_MODE; switch (device_mode) { @@ -2200,7 +2200,7 @@ QDF_STATUS policy_mgr_get_nss_for_vdev(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, uint8_t *nss_2g, uint8_t *nss_5g) { - enum tQDF_ADAPTER_MODE dev_mode; + enum QDF_OPMODE dev_mode; struct policy_mgr_psoc_priv_obj *pm_ctx; switch (mode) { diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 0b058781d92b..17c83b42101d 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -372,7 +372,7 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status, void *context); void policy_mgr_dump_current_concurrency(struct wlan_objmgr_psoc *psoc); void policy_mgr_pdev_set_pcl(struct wlan_objmgr_psoc *psoc, - enum tQDF_ADAPTER_MODE mode); + enum QDF_OPMODE mode); void policy_mgr_set_pcl_for_existing_combo( struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode); void pm_dbs_opportunistic_timer_handler(void *data); diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 9a2092a0b8a6..3728d2a3adcb 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -105,7 +105,7 @@ QDF_STATUS policy_mgr_get_pcl_for_existing_conn(struct wlan_objmgr_psoc *psoc, } void policy_mgr_decr_session_set_pcl(struct wlan_objmgr_psoc *psoc, - enum tQDF_ADAPTER_MODE mode, + enum QDF_OPMODE mode, uint8_t session_id) { QDF_STATUS qdf_status; From 9420656c9be77c89b16200b828ecfd30d64f5444 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Wed, 15 Nov 2017 15:30:07 -0800 Subject: [PATCH 082/187] qcacmn: Make the set HW mode & NSS update actions independent of each other Typically set hw mode & Nss update happens at the same time. Since the order of these 2 actions may not be same always, make them independent of each other. Change-Id: I652ad08e16680991535e0f064c7b5996f4f58792 CRs-Fixed: 2144977 --- inc/wlan_policy_mgr_api.h | 31 +++++++++- inc/wlan_policy_mgr_public_struct.h | 7 ++- src/wlan_policy_mgr_action.c | 40 +++++++----- src/wlan_policy_mgr_core.c | 94 +++++++++++++++-------------- src/wlan_policy_mgr_i.h | 8 ++- 5 files changed, 117 insertions(+), 63 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 301cd0c7c1c4..7e514d265f3b 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -680,6 +680,8 @@ enum policy_mgr_con_mode policy_mgr_convert_device_mode_to_qdf_type( * @dfs: HW Agile DFS capability * @sbs: HW SBS capability * @reason: Reason for connection update + * @next_action: next action to happen at policy mgr after + * HW mode change * * Sends the set hw mode request to FW * @@ -710,7 +712,34 @@ QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc, enum hw_mode_dbs_capab dbs, enum hw_mode_agile_dfs_capab dfs, enum hw_mode_sbs_capab sbs, - enum policy_mgr_conn_update_reason reason); + enum policy_mgr_conn_update_reason reason, + uint8_t next_action); + +/** + * policy_mgr_pdev_set_hw_mode_cback() - callback invoked by + * other component to provide set HW mode request status + * @status: status of the request + * @cfgd_hw_mode_index: new HW mode index + * @num_vdev_mac_entries: Number of mac entries + * @vdev_mac_map: The table of vdev to mac mapping + * @next_action: next action to happen at policy mgr after + * beacon update + * @reason: Reason for set HW mode + * @session_id: vdev id on which the request was made + * @context: PSOC object information + * + * This function is the callback registered with SME at set HW + * mode request time + * + * Return: None + */ +typedef void (*policy_mgr_pdev_set_hw_mode_cback)(uint32_t status, + uint32_t cfgd_hw_mode_index, + uint32_t num_vdev_mac_entries, + struct policy_mgr_vdev_mac_map *vdev_mac_map, + uint8_t next_action, + enum policy_mgr_conn_update_reason reason, + uint32_t session_id, void *context); /** * policy_mgr_nss_update_cback() - callback invoked by other diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 4d4f9ad53f86..18d16254efa4 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -668,6 +668,8 @@ enum policy_mgr_two_connection_mode { * @PM_SINGLE_MAC_UPGRADE: switch to MCC/SCC mode & upgrade to 2x2 * @PM_SBS: switch to SBS mode * @PM_SBS_DOWNGRADE: switch to SBS mode & downgrade to 1x1 + * @PM_DOWNGRADE: downgrade to 1x1 + * @PM_UPGRADE: upgrade to 2x2 * @PM_MAX_CONC_PRIORITY_MODE: Max place holder * * These are generic IDs that identify the various roles @@ -682,6 +684,8 @@ enum policy_mgr_conc_next_action { PM_SINGLE_MAC_UPGRADE, PM_SBS, PM_SBS_DOWNGRADE, + PM_DOWNGRADE, + PM_UPGRADE, PM_MAX_CONC_NEXT_ACTION }; @@ -889,6 +893,7 @@ struct policy_mgr_dual_mac_config { * @set_hw_mode_cb: HDD set HW mode callback * @reason: Reason for HW mode change * @session_id: Session id + * @next_action: next action to happen at policy mgr * @context: psoc context */ struct policy_mgr_hw_mode { @@ -896,7 +901,7 @@ struct policy_mgr_hw_mode { void *set_hw_mode_cb; enum policy_mgr_conn_update_reason reason; uint32_t session_id; - struct wlan_objmgr_vdev *vdev; + uint8_t next_action; struct wlan_objmgr_psoc *context; }; diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 48ab89322b0f..a4e0886a1ba1 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -98,7 +98,8 @@ QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc, enum hw_mode_dbs_capab dbs, enum hw_mode_agile_dfs_capab dfs, enum hw_mode_sbs_capab sbs, - enum policy_mgr_conn_update_reason reason) + enum policy_mgr_conn_update_reason reason, + uint8_t next_action) { int8_t hw_mode_index; struct policy_mgr_hw_mode msg; @@ -135,6 +136,7 @@ QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc, msg.set_hw_mode_cb = (void *)policy_mgr_pdev_set_hw_mode_cb; msg.reason = reason; msg.session_id = session_id; + msg.next_action = next_action; msg.context = psoc; policy_mgr_debug("set hw mode to sme: hw_mode_index: %d session:%d reason:%d", @@ -488,7 +490,7 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, HW_MODE_DBS, HW_MODE_AGILE_DFS_NONE, HW_MODE_SBS_NONE, - reason); + reason, PM_NOP); break; case PM_SINGLE_MAC_UPGRADE: /* @@ -501,14 +503,7 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, HW_MODE_DBS_NONE, HW_MODE_AGILE_DFS_NONE, HW_MODE_SBS_NONE, - reason); - /* - * check if we have a beaconing entity that advertised 2x2 - * intially. If yes, update the beacon template & notify FW. - * Once FW confirms beacon updated, send the HW mode change req - */ - status = policy_mgr_complete_action(psoc, POLICY_MGR_RX_NSS_2, - PM_SINGLE_MAC, reason, session_id); + reason, PM_UPGRADE); break; case PM_SINGLE_MAC: status = policy_mgr_pdev_set_hw_mode(psoc, session_id, @@ -518,7 +513,7 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, HW_MODE_DBS_NONE, HW_MODE_AGILE_DFS_NONE, HW_MODE_SBS_NONE, - reason); + reason, PM_NOP); break; case PM_DBS_UPGRADE: status = policy_mgr_pdev_set_hw_mode(psoc, session_id, @@ -528,10 +523,7 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, HW_MODE_DBS, HW_MODE_AGILE_DFS_NONE, HW_MODE_SBS_NONE, - reason); - - status = policy_mgr_complete_action(psoc, POLICY_MGR_RX_NSS_2, - PM_DBS, reason, session_id); + reason, PM_UPGRADE); break; case PM_SBS_DOWNGRADE: status = policy_mgr_complete_action(psoc, POLICY_MGR_RX_NSS_1, @@ -545,7 +537,23 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, HW_MODE_DBS, HW_MODE_AGILE_DFS_NONE, HW_MODE_SBS, - reason); + reason, PM_NOP); + break; + case PM_DOWNGRADE: + /* + * check if we have a beaconing entity that advertised 2x2 + * intially. If yes, update the beacon template & notify FW. + */ + status = policy_mgr_nss_update(psoc, POLICY_MGR_RX_NSS_1, + PM_NOP, reason); + break; + case PM_UPGRADE: + /* + * check if we have a beaconing entity that advertised 2x2 + * intially. If yes, update the beacon template & notify FW. + */ + status = policy_mgr_nss_update(psoc, POLICY_MGR_RX_NSS_2, + PM_NOP, reason); break; default: policy_mgr_err("unexpected action value %d", action); diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 037ad11aa81b..c707cdac8a04 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -753,24 +753,13 @@ void policy_mgr_update_hw_mode_conn_info(struct wlan_objmgr_psoc *psoc, policy_mgr_dump_connection_status_info(psoc); } -/** - * policy_mgr_pdev_set_hw_mode_cb() - Callback for set hw mode - * @status: Status - * @cfgd_hw_mode_index: Configured HW mode index - * @num_vdev_mac_entries: Number of vdev-mac id mapping that follows - * @vdev_mac_map: vdev-mac id map. This memory will be freed by the caller. - * So, make local copy if needed. - * - * Provides the status and configured hw mode index set - * by the FW - * - * Return: None - */ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status, uint32_t cfgd_hw_mode_index, uint32_t num_vdev_mac_entries, struct policy_mgr_vdev_mac_map *vdev_mac_map, - void *context) + uint8_t next_action, + enum policy_mgr_conn_update_reason reason, + uint32_t session_id, void *context) { QDF_STATUS ret; struct policy_mgr_hw_mode_params hw_mode; @@ -819,6 +808,12 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status, if (!QDF_IS_STATUS_SUCCESS(ret)) policy_mgr_err("ERROR: set connection_update_done event failed"); + if (PM_NOP != next_action) + policy_mgr_next_actions(context, session_id, + next_action, reason); + else + policy_mgr_debug("No action needed right now"); + return; } @@ -2404,26 +2399,9 @@ static void policy_mgr_nss_update_cb(struct wlan_objmgr_psoc *psoc, return; } -/** - * policy_mgr_complete_action() - initiates actions needed on - * current connections once channel has been decided for the new - * connection - * @new_nss: the new nss value - * @next_action: next action to happen at policy mgr after - * beacon update - * @reason: Reason for connection update - * @session_id: Session id - * - * This function initiates initiates actions - * needed on current connections once channel has been decided - * for the new connection. Notifies UMAC & FW as well - * - * Return: QDF_STATUS enum - */ -QDF_STATUS policy_mgr_complete_action(struct wlan_objmgr_psoc *psoc, - uint8_t new_nss, uint8_t next_action, - enum policy_mgr_conn_update_reason reason, - uint32_t session_id) +QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc, + uint8_t new_nss, uint8_t next_action, + enum policy_mgr_conn_update_reason reason) { QDF_STATUS status = QDF_STATUS_E_FAILURE; uint32_t index, count; @@ -2439,16 +2417,6 @@ QDF_STATUS policy_mgr_complete_action(struct wlan_objmgr_psoc *psoc, return status; } - if (policy_mgr_is_hw_dbs_capable(psoc) == false) { - policy_mgr_err("driver isn't dbs capable, no further action needed"); - return QDF_STATUS_E_NOSUPPORT; - } - - /* policy_mgr_complete_action() is called by policy_mgr_next_actions(). - * All other callers of policy_mgr_next_actions() have taken mutex - * protection. So, not taking any lock inside - * policy_mgr_complete_action() during pm_conc_connection_list access. - */ count = policy_mgr_mode_specific_connection_count(psoc, PM_P2P_GO_MODE, list); for (index = 0; index < count; index++) { @@ -2503,6 +2471,44 @@ QDF_STATUS policy_mgr_complete_action(struct wlan_objmgr_psoc *psoc, } } } + + return status; +} + +/** + * policy_mgr_complete_action() - initiates actions needed on + * current connections once channel has been decided for the new + * connection + * @new_nss: the new nss value + * @next_action: next action to happen at policy mgr after + * beacon update + * @reason: Reason for connection update + * @session_id: Session id + * + * This function initiates initiates actions + * needed on current connections once channel has been decided + * for the new connection. Notifies UMAC & FW as well + * + * Return: QDF_STATUS enum + */ +QDF_STATUS policy_mgr_complete_action(struct wlan_objmgr_psoc *psoc, + uint8_t new_nss, uint8_t next_action, + enum policy_mgr_conn_update_reason reason, + uint32_t session_id) +{ + QDF_STATUS status = QDF_STATUS_E_FAILURE; + + if (policy_mgr_is_hw_dbs_capable(psoc) == false) { + policy_mgr_err("driver isn't dbs capable, no further action needed"); + return QDF_STATUS_E_NOSUPPORT; + } + + /* policy_mgr_complete_action() is called by policy_mgr_next_actions(). + * All other callers of policy_mgr_next_actions() have taken mutex + * protection. So, not taking any lock inside + * policy_mgr_complete_action() during pm_conc_connection_list access. + */ + status = policy_mgr_nss_update(psoc, new_nss, next_action, reason); if (!QDF_IS_STATUS_SUCCESS(status)) status = policy_mgr_next_actions(psoc, session_id, next_action, reason); diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 17c83b42101d..c05716131bc5 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -369,7 +369,9 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status, uint32_t cfgd_hw_mode_index, uint32_t num_vdev_mac_entries, struct policy_mgr_vdev_mac_map *vdev_mac_map, - void *context); + uint8_t next_action, + enum policy_mgr_conn_update_reason reason, + uint32_t session_id, void *context); void policy_mgr_dump_current_concurrency(struct wlan_objmgr_psoc *psoc); void policy_mgr_pdev_set_pcl(struct wlan_objmgr_psoc *psoc, enum QDF_OPMODE mode); @@ -441,4 +443,8 @@ void policy_mgr_reg_chan_change_callback(struct wlan_objmgr_psoc *psoc, struct regulatory_channel *chan_list, struct avoid_freq_ind_data *avoid_freq_ind, void *arg); + +QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc, + uint8_t new_nss, uint8_t next_action, + enum policy_mgr_conn_update_reason reason); #endif From 8a611c641c52a7a6cbe9b2b2c6f16580031ca945 Mon Sep 17 00:00:00 2001 From: Ganesh Kondabattini Date: Tue, 21 Nov 2017 15:01:31 +0530 Subject: [PATCH 083/187] qcacmn: Allow SAP to come up on DFS channel in SCC mode Allow SAP to come up on DFS channel in STA+SAP concurrency mode only when g_sta_sap_scc_on_dfs_chan enabled in ini file and also disable chan_switch_hostapd_rate_enabled when force SCC is enabled. CRs-Fixed: 2147032 Change-Id: Id1333a49d0538eb4ccfaf3c8498e9ca06671de02 --- inc/wlan_policy_mgr_api.h | 11 +++++++++++ inc/wlan_policy_mgr_public_struct.h | 1 + src/wlan_policy_mgr_action.c | 6 ++++-- src/wlan_policy_mgr_get_set_utils.c | 19 +++++++++++++++++++ src/wlan_policy_mgr_i.h | 1 + 5 files changed, 36 insertions(+), 2 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 7e514d265f3b..7347880dce2a 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -2187,4 +2187,15 @@ void policy_mgr_check_and_stop_opportunistic_timer( void policy_mgr_set_weight_of_dfs_passive_channels_to_zero( struct wlan_objmgr_psoc *psoc, uint8_t *pcl_channels, uint32_t *len, uint8_t *weight_list, uint32_t weight_len); + +/** + * policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan() - check if sta+sap scc + * allowed on dfs chan + * @psoc: pointer to soc + * This function is used to check if sta+sap scc allowed on dfs channel + * + * Return: true if sta+sap scc is allowed on dfs channel, otherwise false + */ +bool policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan( + struct wlan_objmgr_psoc *psoc); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 18d16254efa4..3ace5acb8d2a 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -1017,6 +1017,7 @@ struct policy_mgr_user_cfg { bool enable2x2; uint32_t mcc_to_scc_switch_mode; bool sub_20_mhz_enabled; + bool is_sta_sap_scc_allowed_on_dfs_chan; }; /** diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index a4e0886a1ba1..607d1b0ef977 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -747,13 +747,15 @@ static bool policy_mgr_valid_sta_channel_check(struct wlan_objmgr_psoc *psoc, return false; } - if (wlan_reg_is_dfs_ch(pm_ctx->pdev, sta_channel) || + if ((wlan_reg_is_dfs_ch(pm_ctx->pdev, sta_channel) && + (!policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan(psoc))) || wlan_reg_is_passive_or_disable_ch(pm_ctx->pdev, sta_channel) || - !policy_mgr_is_safe_channel(psoc, sta_channel)) + !policy_mgr_is_safe_channel(psoc, sta_channel)) { if (policy_mgr_is_hw_dbs_capable(psoc)) return true; else return false; + } else return true; } diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 3d11ab25cf00..50d8a3f6a4b9 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2721,3 +2721,22 @@ bool policy_mgr_is_force_scc(struct wlan_objmgr_psoc *psoc) (pm_ctx->user_cfg.mcc_to_scc_switch_mode == QDF_MCC_TO_SCC_SWITCH_FORCE_PREFERRED_WITHOUT_DISCONNECTION)); } + +bool policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan( + struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + bool status = false; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return status; + } + + if (policy_mgr_is_force_scc(psoc) && + pm_ctx->user_cfg.is_sta_sap_scc_allowed_on_dfs_chan) + status = true; + + return status; +} diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index c05716131bc5..16d38fabddfe 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -271,6 +271,7 @@ struct policy_mgr_psoc_priv_obj { uint16_t unsafe_channel_count; struct sta_ap_intf_check_work_ctx *sta_ap_intf_check_work_info; uint8_t cur_conc_system_pref; + uint8_t sta_sap_scc_on_dfs_chan_allowed; }; /** From efbeeab4fc24a4c3ab5a552b5f9e99925bdf49ed Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Tue, 28 Nov 2017 18:12:22 -0800 Subject: [PATCH 084/187] qcacmn: clang: Remove unnecessary NULL check for address of array Clang generated the following warning in various places: warning: address of array 'weight->pcl_list' will always evaluate to 'true' [-Wpointer-bool-conversion] if (weight->pcl_list) { ~~ ~~~^~~ Remove the unnecessary NULL check for address of array. Change-Id: Ibc82b4d7135a0425748c0fb7f065435ccd28ad6f CRs-Fixed: 2150493 --- src/wlan_policy_mgr_pcl.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 3728d2a3adcb..11a4b32598e5 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -1627,21 +1627,6 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_FAILURE; } - if (!weight->pcl_list) { - policy_mgr_err("Invalid pcl"); - return QDF_STATUS_E_FAILURE; - } - - if (!weight->saved_chan_list) { - policy_mgr_err("Invalid valid channel list"); - return QDF_STATUS_E_FAILURE; - } - - if (!weight->weighed_valid_list) { - policy_mgr_err("Invalid weighed valid channel list"); - return QDF_STATUS_E_FAILURE; - } - qdf_mem_set(weight->weighed_valid_list, QDF_MAX_NUM_CHAN, WEIGHT_OF_DISALLOWED_CHANNELS); qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); From 067cd3e3ebb554f4e5957f38bcf5af060f6b00d0 Mon Sep 17 00:00:00 2001 From: Yeshwanth Sriram Guntuka Date: Thu, 14 Dec 2017 17:56:04 +0530 Subject: [PATCH 085/187] qcacmn: Set passive dwell time Set passive dwell time to 28msecs for active scan when bt a2dp is enabled and hw is not dbs capable and when sta is connected on 2G band. Change-Id: I44f2e3d98f2d7ddc52e4902ba989131c256da4ef CRs-Fixed: 2160963 --- inc/wlan_policy_mgr_api.h | 7 +++++++ src/wlan_policy_mgr_get_set_utils.c | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 7347880dce2a..f9160f93003a 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -2198,4 +2198,11 @@ void policy_mgr_set_weight_of_dfs_passive_channels_to_zero( */ bool policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan( struct wlan_objmgr_psoc *psoc); +/** + * policy_mgr_is_sta_connected_2g() - check if sta connected in 2g + * @psoc: pointer to soc + * + * Return: true if sta is connected in 2g else false + */ +bool policy_mgr_is_sta_connected_2g(struct wlan_objmgr_psoc *psoc); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 50d8a3f6a4b9..e5ac3c384e39 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2740,3 +2740,27 @@ bool policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan( return status; } + +bool policy_mgr_is_sta_connected_2g(struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + uint32_t conn_index; + bool ret = false; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return ret; + } + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; + conn_index++) { + if (pm_conc_connection_list[conn_index].mode == PM_STA_MODE && + pm_conc_connection_list[conn_index].chan <= 14 && + pm_conc_connection_list[conn_index].in_use) + ret = true; + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return ret; +} From 17623642ea50ef76c55af78424c4a20f85ed561f Mon Sep 17 00:00:00 2001 From: Bala Venkatesh Date: Thu, 28 Dec 2017 11:31:57 +0530 Subject: [PATCH 086/187] qcacmn: Initialize pcl length to 0 in cds_get_alternate_channel_for_sap When number of connections is more than 2 then the pcl length will be garbage value. Initialize the pcl length with 0 to avoid wrong channel list initialization. Change-Id: If08dc2670ff5ff296220d6ad68766becb252fab7 CRs-Fixed: 2164773 --- src/wlan_policy_mgr_pcl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 11a4b32598e5..a8118a10a151 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -1706,7 +1706,7 @@ uint8_t policy_mgr_get_alternate_channel_for_sap( uint8_t pcl_channels[QDF_MAX_NUM_CHAN]; uint8_t pcl_weight[QDF_MAX_NUM_CHAN]; uint8_t channel = 0; - uint32_t pcl_len; + uint32_t pcl_len = 0; if (QDF_STATUS_SUCCESS == policy_mgr_get_pcl(psoc, PM_SAP_MODE, &pcl_channels[0], &pcl_len, From 3b9ff3715afd9d2bed0c0eaa6f019a5760eb168d Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Wed, 27 Dec 2017 13:57:24 -0800 Subject: [PATCH 087/187] qcacmn: Keep HW mode in sync with FW when hdd stop happens Stop the opportunistic timer & take action to keep HW mode in sync when hdd stop happens. Change-Id: Id34adb579987605831d2c7c4e22c2d76fe7d25dd CRs-Fixed: 2165109 --- inc/wlan_policy_mgr_api.h | 13 ++++++++- src/wlan_policy_mgr_action.c | 44 +++++++++++++++++++++++++++++-- src/wlan_policy_mgr_core.c | 16 +++++++++-- src/wlan_policy_mgr_i.h | 3 +++ src/wlan_policy_mgr_init_deinit.c | 14 ++++++++++ 5 files changed, 85 insertions(+), 5 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index f9160f93003a..4b77fca93dcd 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1079,6 +1079,16 @@ QDF_STATUS policy_mgr_reset_connection_update(struct wlan_objmgr_psoc *psoc); */ QDF_STATUS policy_mgr_set_connection_update(struct wlan_objmgr_psoc *psoc); +/** + * policy_mgr_set_opportunistic_update() - Set opportunistic + * update event + * @psoc: PSOC object information + * Sets the opportunistic update event + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_set_opportunistic_update(struct wlan_objmgr_psoc *psoc); + /** * policy_mgr_restart_opportunistic_timer() - Restarts opportunistic timer * @psoc: PSOC object information @@ -2163,6 +2173,7 @@ uint8_t policy_mgr_get_cur_conc_system_pref(struct wlan_objmgr_psoc *psoc); * state of opportunistic timer, if running, stop it and take * action * @psoc: soc pointer + * @id: Session/vdev id * * Get the current state of opportunistic timer, if it is * running, stop it and take action. @@ -2170,7 +2181,7 @@ uint8_t policy_mgr_get_cur_conc_system_pref(struct wlan_objmgr_psoc *psoc); * Return: None */ void policy_mgr_check_and_stop_opportunistic_timer( - struct wlan_objmgr_psoc *psoc); + struct wlan_objmgr_psoc *psoc, uint8_t id); /** * policy_mgr_set_weight_of_dfs_passive_channels_to_zero() - set weight of dfs diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 607d1b0ef977..7e57b359ef08 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -995,6 +995,28 @@ QDF_STATUS policy_mgr_set_connection_update(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_SUCCESS; } +QDF_STATUS policy_mgr_set_opportunistic_update(struct wlan_objmgr_psoc *psoc) +{ + QDF_STATUS status; + struct policy_mgr_psoc_priv_obj *policy_mgr_context; + + policy_mgr_context = policy_mgr_get_context(psoc); + if (!policy_mgr_context) { + policy_mgr_err("Invalid context"); + return QDF_STATUS_E_FAILURE; + } + + status = qdf_event_set( + &policy_mgr_context->opportunistic_update_done_evt); + + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("set event failed"); + return QDF_STATUS_E_FAILURE; + } + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS policy_mgr_restart_opportunistic_timer( struct wlan_objmgr_psoc *psoc, bool check_state) { @@ -1103,9 +1125,11 @@ void policy_mgr_checkn_update_hw_mode_single_mac_mode( } void policy_mgr_check_and_stop_opportunistic_timer( - struct wlan_objmgr_psoc *psoc) + struct wlan_objmgr_psoc *psoc, uint8_t id) { struct policy_mgr_psoc_priv_obj *pm_ctx; + enum policy_mgr_conc_next_action action = PM_NOP; + QDF_STATUS status = QDF_STATUS_E_FAILURE; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -1115,7 +1139,23 @@ void policy_mgr_check_and_stop_opportunistic_timer( if (QDF_TIMER_STATE_RUNNING == pm_ctx->dbs_opportunistic_timer.state) { qdf_mc_timer_stop(&pm_ctx->dbs_opportunistic_timer); - pm_dbs_opportunistic_timer_handler((void *)psoc); + action = policy_mgr_need_opportunistic_upgrade(psoc); + if (action) { + status = policy_mgr_next_actions(psoc, id, action, + POLICY_MGR_UPDATE_REASON_OPPORTUNISTIC); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("Failed in policy_mgr_next_actions"); + return; + } + status = qdf_wait_single_event( + &pm_ctx->opportunistic_update_done_evt, + CONNECTION_UPDATE_TIMEOUT); + + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("wait for event failed"); + return; + } + } } } diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index c707cdac8a04..9ff2bb4db803 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -811,8 +811,12 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status, if (PM_NOP != next_action) policy_mgr_next_actions(context, session_id, next_action, reason); - else + else { policy_mgr_debug("No action needed right now"); + ret = policy_mgr_set_opportunistic_update(context); + if (!QDF_IS_STATUS_SUCCESS(ret)) + policy_mgr_err("ERROR: set opportunistic_update event failed"); + } return; } @@ -2379,6 +2383,7 @@ static void policy_mgr_nss_update_cb(struct wlan_objmgr_psoc *psoc, enum policy_mgr_conn_update_reason reason) { uint32_t conn_index = 0; + QDF_STATUS ret; if (QDF_STATUS_SUCCESS != tx_status) policy_mgr_err("nss update failed(%d) for vdev %d", @@ -2394,7 +2399,14 @@ static void policy_mgr_nss_update_cb(struct wlan_objmgr_psoc *psoc, } policy_mgr_debug("nss update successful for vdev:%d", vdev_id); - policy_mgr_next_actions(psoc, vdev_id, next_action, reason); + if (PM_NOP != next_action) + policy_mgr_next_actions(psoc, vdev_id, next_action, reason); + else { + policy_mgr_debug("No action needed right now"); + ret = policy_mgr_set_opportunistic_update(psoc); + if (!QDF_IS_STATUS_SUCCESS(ret)) + policy_mgr_err("ERROR: set opportunistic_update event failed"); + } return; } diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 16d38fabddfe..e8b21092a4c2 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -239,6 +239,8 @@ struct sta_ap_intf_check_work_ctx { * @unsafe_channel_list: LTE coex channel avoidance list * @unsafe_channel_count: LTE coex channel avoidance list count * @sta_ap_intf_check_work_info: Info related to sta_ap_intf_check_work + * @opportunistic_update_done_evt: qdf event to synchronize host + * & FW HW mode */ struct policy_mgr_psoc_priv_obj { struct wlan_objmgr_psoc *psoc; @@ -272,6 +274,7 @@ struct policy_mgr_psoc_priv_obj { struct sta_ap_intf_check_work_ctx *sta_ap_intf_check_work_info; uint8_t cur_conc_system_pref; uint8_t sta_sap_scc_on_dfs_chan_allowed; + qdf_event_t opportunistic_update_done_evt; }; /** diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 08513de35abd..74f9e54892a5 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -406,6 +406,12 @@ QDF_STATUS policy_mgr_psoc_enable(struct wlan_objmgr_psoc *psoc) return status; } + status = qdf_event_create(&pm_ctx->opportunistic_update_done_evt); + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("opportunistic_update_done_evt init failed"); + return status; + } + pm_ctx->do_hw_mode_change = false; pm_ctx->hw_mode_change_in_progress = POLICY_MGR_HW_MODE_NOT_IN_PROGRESS; /* reset sap mandatory channels */ @@ -473,6 +479,14 @@ QDF_STATUS policy_mgr_psoc_disable(struct wlan_objmgr_psoc *psoc) QDF_ASSERT(0); } + /* destroy opportunistic_update_done_evt */ + if (!QDF_IS_STATUS_SUCCESS(qdf_event_destroy + (&pm_ctx->opportunistic_update_done_evt))) { + policy_mgr_err("Failed to destroy opportunistic_update_done_evt"); + status = QDF_STATUS_E_FAILURE; + QDF_ASSERT(0); + } + /* deallocate dbs_opportunistic_timer */ if (QDF_TIMER_STATE_RUNNING == qdf_mc_timer_get_current_state( From e23b6bc5fcf51d176d1dd868630ac244dcc19491 Mon Sep 17 00:00:00 2001 From: Varun Reddy Yeturu Date: Mon, 8 Jan 2018 13:18:41 -0800 Subject: [PATCH 088/187] qcacmn: Fix static analysis issues in policy manager 1) Check for policy manager context to be non NULL before dereferncing and return if it is NULL. 2) Use QDF_MAX_NUM_CHAN consistently to represent the maximum number of channels supported. Change-Id: I3393bc801dd780d881423c8be346e74ac6d3ac6c CRs-Fixed: 2160770 --- src/wlan_policy_mgr_action.c | 4 ++-- src/wlan_policy_mgr_get_set_utils.c | 6 ++++-- src/wlan_policy_mgr_pcl.c | 11 ++++++++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 7e57b359ef08..5e8031115551 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -432,7 +432,7 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, { QDF_STATUS status = QDF_STATUS_E_FAILURE; struct policy_mgr_hw_mode_params hw_mode; - struct dbs_nss nss_dbs; + struct dbs_nss nss_dbs = {0}; if (policy_mgr_is_hw_dbs_capable(psoc) == false) { policy_mgr_err("driver isn't dbs capable, no further action needed"); diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index e5ac3c384e39..d477600da5df 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -2580,8 +2580,10 @@ uint32_t policy_mgr_get_hw_dbs_nss(struct wlan_objmgr_psoc *psoc, struct policy_mgr_psoc_priv_obj *pm_ctx; pm_ctx = policy_mgr_get_context(psoc); - if (!pm_ctx) + if (!pm_ctx) { policy_mgr_err("Invalid Context"); + return final_max_rf_chains; + } for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { param = pm_ctx->hw_mode.hw_mode_list[i]; diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index a8118a10a151..ce627c690a70 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -171,9 +171,14 @@ void policy_mgr_reg_chan_change_callback(struct wlan_objmgr_psoc *psoc, return; } + /* + * The ch_list buffer can accomadate a maximum of + * NUM_CHANNELS and hence the ch_cnt should also not + * exceed NUM_CHANNELS. + */ pm_ctx->unsafe_channel_count = avoid_freq_ind->chan_list.ch_cnt >= - QDF_MAX_NUM_CHAN ? - QDF_MAX_NUM_CHAN : avoid_freq_ind->chan_list.ch_cnt; + NUM_CHANNELS ? + NUM_CHANNELS : avoid_freq_ind->chan_list.ch_cnt; if (pm_ctx->unsafe_channel_count) qdf_mem_copy(pm_ctx->unsafe_channel_list, avoid_freq_ind->chan_list.ch_list, From 0c738b7b020f435cdf5d16aa03d37bafdb926465 Mon Sep 17 00:00:00 2001 From: Himanshu Agarwal Date: Wed, 10 Jan 2018 14:21:53 +0530 Subject: [PATCH 089/187] qcacmn: Green AP UMAC componentization Add APIs, structures for Green AP component. Change-Id: I4a39470104c89c20eec5440b7ae251a764151fd5 CRs-Fixed: 2166428 --- inc/wlan_policy_mgr_api.h | 15 ++++++++++++++- src/wlan_policy_mgr_get_set_utils.c | 16 ++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 4b77fca93dcd..493b6fef2bea 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -970,6 +970,19 @@ QDF_STATUS policy_mgr_get_channel_from_scan_result( struct wlan_objmgr_psoc *psoc, void *roam_profile, uint8_t *channel); +/** + * policy_mgr_mode_specific_num_open_sessions() - to get number of open sessions + * for a specific mode + * @psoc: PSOC object information + * @mode: device mode + * @num_sessions: to store num open sessions + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_mode_specific_num_open_sessions( + struct wlan_objmgr_psoc *psoc, enum QDF_OPMODE mode, + uint8_t *num_sessions); + /** * policy_mgr_concurrent_open_sessions_running() - Checks for * concurrent open session diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index d477600da5df..33483e045839 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2053,6 +2053,22 @@ enum policy_mgr_con_mode policy_mgr_convert_device_mode_to_qdf_type( return mode; } +QDF_STATUS policy_mgr_mode_specific_num_open_sessions( + struct wlan_objmgr_psoc *psoc, enum QDF_OPMODE mode, + uint8_t *num_sessions) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return QDF_STATUS_E_FAILURE; + } + + *num_sessions = pm_ctx->no_of_open_sessions[mode]; + return QDF_STATUS_SUCCESS; +} + /** * policy_mgr_concurrent_open_sessions_running() - Checks for * concurrent open session From 4943b90122827fd9034fe982c104d618360f310d Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Fri, 5 Jan 2018 17:36:40 -0800 Subject: [PATCH 090/187] qcacmn: Choose opportunistic timer's session id dynamically Current opportunistic timer chooses session id as 0 up on expiry which creates the issue when session id 0 doesn't exist. Fix the situation by dynamically choosing existing session id to complete the action. CRs-Fixed: 2166667 Change-Id: I2e1da2ba0078381a5e91decd32d32b8ad77cec19 --- src/wlan_policy_mgr_action.c | 1 + src/wlan_policy_mgr_core.c | 44 ++++++++++++++++++++++++++++-------- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 5e8031115551..13c4d6c817e3 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -1141,6 +1141,7 @@ void policy_mgr_check_and_stop_opportunistic_timer( qdf_mc_timer_stop(&pm_ctx->dbs_opportunistic_timer); action = policy_mgr_need_opportunistic_upgrade(psoc); if (action) { + qdf_event_reset(&pm_ctx->opportunistic_update_done_evt); status = policy_mgr_next_actions(psoc, id, action, POLICY_MGR_UPDATE_REASON_OPPORTUNISTIC); if (status != QDF_STATUS_SUCCESS) { diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 9ff2bb4db803..085d379863ff 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -1250,6 +1250,35 @@ void policy_mgr_set_pcl_for_existing_combo( qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); } +static uint32_t pm_get_vdev_id_of_first_conn_idx(struct wlan_objmgr_psoc *psoc) +{ + uint32_t conn_index = 0, vdev_id = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return conn_index; + } + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; + conn_index++) { + if (pm_conc_connection_list[conn_index].in_use) { + vdev_id = pm_conc_connection_list[conn_index].vdev_id; + break; + } + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + if (conn_index == MAX_NUMBER_OF_CONC_CONNECTIONS) + policy_mgr_debug("Use default vdev_id:%d for opportunistic upgrade", + vdev_id); + else + policy_mgr_debug("Use vdev_id:%d for opportunistic upgrade", + vdev_id); + + return vdev_id; +} + /** * pm_dbs_opportunistic_timer_handler() - handler of * dbs_opportunistic_timer @@ -1262,6 +1291,7 @@ void policy_mgr_set_pcl_for_existing_combo( void pm_dbs_opportunistic_timer_handler(void *data) { enum policy_mgr_conc_next_action action = PM_NOP; + uint32_t session_id; struct wlan_objmgr_psoc *psoc = (struct wlan_objmgr_psoc *)data; if (!psoc) { @@ -1272,15 +1302,11 @@ void pm_dbs_opportunistic_timer_handler(void *data) /* if we still need it */ action = policy_mgr_need_opportunistic_upgrade(psoc); policy_mgr_debug("action:%d", action); - if (action) { - /* lets call for action */ - /* session id is being used only - * in hidden ssid case for now. - * So, session id 0 is ok here. - */ - policy_mgr_next_actions(psoc, 0, action, + if (!action) + return; + session_id = pm_get_vdev_id_of_first_conn_idx(psoc); + policy_mgr_next_actions(psoc, session_id, action, POLICY_MGR_UPDATE_REASON_OPPORTUNISTIC); - } } /** From 7728e21cf93579c57e9bc9b9b225844b2ed6327e Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Tue, 9 Jan 2018 11:00:28 -0800 Subject: [PATCH 091/187] qcacmn: Check pcl array size against QDF_MAX_NUM_CHAN While populating preferred channel list array, length has not been checked against QDF_MAX_NUM_CHAN which is size of PCL. Fix it by checking indices and length against QDF_MAX_NUM_CHAN CRs-Fixed: 2169424 Change-Id: I8c4d050bfc7040fba052eb42b32a91302a0a0ecb --- src/wlan_policy_mgr_pcl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index ce627c690a70..74f86baa2dd0 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -1540,6 +1540,10 @@ QDF_STATUS policy_mgr_modify_sap_pcl_based_on_mandatory_channel( for (i = 0; i < *pcl_len_org; i++) { found = false; + if (i >= QDF_MAX_NUM_CHAN) { + policy_mgr_debug("index is exceeding QDF_MAX_NUM_CHAN"); + break; + } for (j = 0; j < pm_ctx->sap_mandatory_channels_len; j++) { if (pcl_list_org[i] == pm_ctx->sap_mandatory_channels[j]) { @@ -1547,7 +1551,7 @@ QDF_STATUS policy_mgr_modify_sap_pcl_based_on_mandatory_channel( break; } } - if (found) { + if (found && (pcl_len < QDF_MAX_NUM_CHAN)) { pcl_list[pcl_len] = pcl_list_org[i]; weight_list[pcl_len++] = weight_list_org[i]; } From e93f5d1b348c6994acd2c87a7ea6be0db122183f Mon Sep 17 00:00:00 2001 From: Will Huang Date: Mon, 8 Jan 2018 18:23:56 +0800 Subject: [PATCH 092/187] qcacmn: Fix copy length error of unsafe_channel_list unsafe_channel_list is defined as uint16, but copy with length of byte. Change-Id: I35cd1d006f561c6bb1e64fd56e9822fefd991848 CRs-Fixed: 2170439 --- src/wlan_policy_mgr_pcl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 74f86baa2dd0..481107a1e91b 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -182,7 +182,8 @@ void policy_mgr_reg_chan_change_callback(struct wlan_objmgr_psoc *psoc, if (pm_ctx->unsafe_channel_count) qdf_mem_copy(pm_ctx->unsafe_channel_list, avoid_freq_ind->chan_list.ch_list, - pm_ctx->unsafe_channel_count); + pm_ctx->unsafe_channel_count * + sizeof(pm_ctx->unsafe_channel_list[0])); policy_mgr_debug("Channel list update, recieved %d avoided channels", pm_ctx->unsafe_channel_count); } From 76659b0055a48ea1ef3ff4212ac4a8fd10115056 Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Thu, 28 Dec 2017 00:34:42 -0500 Subject: [PATCH 093/187] qcacmn: Disallow Dualband MCC For non DBS capable chip, to disallow dualband MCC in case dnbs vdev exist. Change-Id: Iee96e12dbb09e2d4633ca2fb73b5fb8bf155bd66 CRs-Fixed: 2164835 --- src/wlan_policy_mgr_get_set_utils.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 33483e045839..41a9a8025028 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2561,8 +2561,10 @@ QDF_STATUS policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc, * return true. * If channel is different from operating channel but in same band. * return false. - * If operating channel in different band. + * If operating channel in different band (DBS capable). * return true. + * If operating channel in different band (not DBS capable). + * return false. */ /* TODO: To be enhanced for SBS */ if (policy_mgr_is_dnsc_set(vdev)) { @@ -2577,12 +2579,24 @@ QDF_STATUS policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc, wlan_objmgr_vdev_release_ref(vdev, WLAN_POLICY_MGR_ID); break; + } else if (policy_mgr_is_hw_dbs_capable(psoc)) { + *ok = true; + wlan_objmgr_vdev_release_ref(vdev, + WLAN_POLICY_MGR_ID); + break; + } else { + *ok = false; + wlan_objmgr_vdev_release_ref(vdev, + WLAN_POLICY_MGR_ID); + break; } } else { *ok = true; } wlan_objmgr_vdev_release_ref(vdev, WLAN_POLICY_MGR_ID); } + policy_mgr_debug("chan: %d ok %d", channel, *ok); + return QDF_STATUS_SUCCESS; } From 0c1a7f6c69dee3b189327b702ce3f087fbb59ed7 Mon Sep 17 00:00:00 2001 From: Sourav Mohapatra Date: Sun, 3 Dec 2017 11:44:44 +0530 Subject: [PATCH 094/187] qcacmn: Converge on wmi service/ext service is enable Converge on wmi service/ext service is enable Change-Id: Ib246befa72cce927bee157394cd22c7d1562d341 CRs-Fixed: 2152751 --- inc/wlan_policy_mgr_api.h | 3 -- src/wlan_policy_mgr_get_set_utils.c | 57 ++++++++++++++++------------- src/wlan_policy_mgr_init_deinit.c | 4 +- 3 files changed, 33 insertions(+), 31 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 493b6fef2bea..7e3c9dc532f9 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -857,13 +857,10 @@ struct policy_mgr_dp_cbacks { * from policy manager * @wma_get_connection_info: Get the connection related info * from wma table - * @wma_is_service_enabled: check if certain service is enabled - * by FW */ struct policy_mgr_wma_cbacks { QDF_STATUS (*wma_get_connection_info)(uint8_t vdev_id, struct policy_mgr_vdev_entry_info *conn_table_entry); - bool (*wma_is_service_enabled)(WMI_SERVICE service_type); }; /** diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 41a9a8025028..dc2588ed8ca9 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -33,7 +33,7 @@ */ /* Include files */ - +#include "target_if.h" #include "wlan_policy_mgr_api.h" #include "wlan_policy_mgr_i.h" #include "qdf_types.h" @@ -524,8 +524,10 @@ bool policy_mgr_is_hw_dbs_capable(struct wlan_objmgr_psoc *psoc) { uint32_t param, i, found = 0; struct policy_mgr_psoc_priv_obj *pm_ctx; + void *wmi_handle; pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { policy_mgr_err("Invalid Context"); return false; @@ -535,19 +537,23 @@ bool policy_mgr_is_hw_dbs_capable(struct wlan_objmgr_psoc *psoc) policy_mgr_debug("DBS is disabled"); return false; } - if (pm_ctx->wma_cbacks.wma_is_service_enabled) { - policy_mgr_debug("DBS service bit map: %d", - pm_ctx->wma_cbacks.wma_is_service_enabled( - WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT)); - /* The agreement with FW is that: To know if the target is DBS - * capable, DBS needs to be supported both in the HW mode list - * and in the service ready event - */ - if (!(pm_ctx->wma_cbacks.wma_is_service_enabled( - WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT))) - return false; - } else + wmi_handle = GET_WMI_HDL_FROM_PSOC(psoc); + if (!wmi_handle) { + policy_mgr_debug("Invalid WMA context"); + return false; + } + + policy_mgr_debug("DBS service bit map: %d", + wmi_service_enabled(wmi_handle, + wmi_service_dual_band_simultaneous_support)); + + /* The agreement with FW is that: To know if the target is DBS + * capable, DBS needs to be supported both in the HW mode list + * and in the service ready event + */ + if (!(wmi_service_enabled(wmi_handle, + wmi_service_dual_band_simultaneous_support))) return false; for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { @@ -570,25 +576,26 @@ bool policy_mgr_is_hw_sbs_capable(struct wlan_objmgr_psoc *psoc) { uint32_t param, i, found = 0; struct policy_mgr_psoc_priv_obj *pm_ctx; + void *wmi_handle; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { policy_mgr_err("Invalid Context"); return false; } - if (pm_ctx->wma_cbacks.wma_is_service_enabled) { - policy_mgr_debug("DBS service bit map: %d", - pm_ctx->wma_cbacks.wma_is_service_enabled( - WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT)); - /* The agreement with FW is that: To know if the target is SBS - * capable, SBS needs to be supported both in the HW mode list - * and DBS needs to be supported in the service ready event - */ - if (!(pm_ctx->wma_cbacks.wma_is_service_enabled( - WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT))) - return false; - } else + wmi_handle = GET_WMI_HDL_FROM_PSOC(psoc); + + policy_mgr_debug("DBS service bit map: %d", + wmi_service_enabled(wmi_handle, + wmi_service_dual_band_simultaneous_support)); + + /* The agreement with FW is that: To know if the target is SBS + * capable, SBS needs to be supported both in the HW mode list + * and DBS needs to be supported in the service ready event + */ + if (!(wmi_service_enabled(wmi_handle, + wmi_service_dual_band_simultaneous_support))) return false; for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 74f9e54892a5..44bde60ec7f5 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -610,8 +610,6 @@ QDF_STATUS policy_mgr_register_wma_cb(struct wlan_objmgr_psoc *psoc, pm_ctx->wma_cbacks.wma_get_connection_info = wma_cbacks->wma_get_connection_info; - pm_ctx->wma_cbacks.wma_is_service_enabled = - wma_cbacks->wma_is_service_enabled; return QDF_STATUS_SUCCESS; } From c5b104351d46abec33595752726199744efdbee9 Mon Sep 17 00:00:00 2001 From: Min Liu Date: Fri, 19 Jan 2018 18:01:44 +0800 Subject: [PATCH 095/187] qcacmn: Fix safe channel switch failure For the AP+AP SCC LTE-Coex case, when channel avoidance event is reported, the channel switch request for SAP will be blocked by policy manager if the target channel is different with the operating channel of the existing SAP due to the SCC policy. Need to update the logic to give higher priority to the channel avoidance request. Change-Id: Ie42bab50c1fa92e4e8df9f1b0ce8b8f4f09551b5 CRs-Fixed: 2176250 --- inc/wlan_policy_mgr_api.h | 10 +++++++--- src/wlan_policy_mgr_action.c | 6 ++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 7e3c9dc532f9..1a9c8744e6e5 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -201,6 +201,7 @@ QDF_STATUS policy_mgr_change_mcc_go_beacon_interval( * @vdev_id: Vdev id * @channel: Channel to change * @ch_width: channel width to change + * @forced: Force to switch channel, ignore SCC/MCC check * * Invoke the callback function to change SAP channel using (E)CSA * @@ -209,12 +210,14 @@ QDF_STATUS policy_mgr_change_mcc_go_beacon_interval( void policy_mgr_change_sap_channel_with_csa( struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, uint32_t channel, - uint32_t ch_width); + uint32_t ch_width, + bool forced); #else static inline void policy_mgr_change_sap_channel_with_csa( struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, uint32_t channel, - uint32_t ch_width) + uint32_t ch_width, + bool forced) { } @@ -809,7 +812,8 @@ struct policy_mgr_sme_cbacks { struct policy_mgr_hdd_cbacks { void (*sap_restart_chan_switch_cb)(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, uint32_t channel, - uint32_t channel_bw); + uint32_t channel_bw, + bool forced); QDF_STATUS (*wlan_hdd_get_channel_for_sap_restart)( struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, uint8_t *channel, diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 13c4d6c817e3..897571ecd5d7 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -904,6 +904,7 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( * @vdev_id: Vdev id * @channel: Channel to change * @ch_width: channel width to change + * @forced: Force to switch channel, ignore SCC/MCC check * * Invoke the callback function to change SAP channel using (E)CSA * @@ -911,7 +912,8 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( */ void policy_mgr_change_sap_channel_with_csa(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, uint32_t channel, - uint32_t ch_width) + uint32_t ch_width, + bool forced) { struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -924,7 +926,7 @@ void policy_mgr_change_sap_channel_with_csa(struct wlan_objmgr_psoc *psoc, if (pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb) { policy_mgr_info("SAP change change without restart"); pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb(psoc, - vdev_id, channel, ch_width); + vdev_id, channel, ch_width, forced); } } #endif From eb32063dcc3b3dc6121dc93f98ae14b271e0b3b4 Mon Sep 17 00:00:00 2001 From: hqu Date: Wed, 17 Jan 2018 17:25:25 +0800 Subject: [PATCH 096/187] qcacmn: Use no_of_open_sessions to check multiple beaconing sessions When start sap+sap with acs concurrently, the first sap usually choose dfs channel, the second sap will be failed to start. when check multiple beaconing sessions it only checks in_use sap for pm_conc_connection_lis which means bss started sap while it has no started sap at that time, so the second sap can't follow the first sap's dfs channel and start failed according to current code flow. Fix is to use no_of_open_sessions to check multiple beaconing sessions. CRs-Fixed: 2170567 Change-Id: Iada737dffcd826aaff3873b81355018d53485948 --- src/wlan_policy_mgr_get_set_utils.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index dc2588ed8ca9..916d6291e4d6 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2118,13 +2118,17 @@ bool policy_mgr_concurrent_open_sessions_running( bool policy_mgr_concurrent_beaconing_sessions_running( struct wlan_objmgr_psoc *psoc) { - return (policy_mgr_mode_specific_connection_count( - psoc, QDF_SAP_MODE, NULL) + - policy_mgr_mode_specific_connection_count( - psoc, QDF_P2P_GO_MODE, NULL) + - policy_mgr_mode_specific_connection_count( - psoc, QDF_IBSS_MODE, NULL) > 1) ? - true : false; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return false; + } + + return (pm_ctx->no_of_open_sessions[QDF_SAP_MODE] + + pm_ctx->no_of_open_sessions[QDF_P2P_GO_MODE] + + pm_ctx->no_of_open_sessions[QDF_IBSS_MODE] > 1) ? true : false; } From 533baa3076b589e5c15e155c8cebdfd72bdb135d Mon Sep 17 00:00:00 2001 From: Himanshu Agarwal Date: Thu, 25 Jan 2018 16:20:33 +0530 Subject: [PATCH 097/187] qcacmn: Add policy mgr API to get no. of active sessions Add policy mgr API to get no. of active sessions for a specific mode. Change-Id: If91685ae7b72c6be52426648e9d01cba92eee85e CRs-Fixed: 2178921 --- inc/wlan_policy_mgr_api.h | 13 +++++++++++++ src/wlan_policy_mgr_get_set_utils.c | 16 ++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 1a9c8744e6e5..fe0dbe89591b 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -984,6 +984,19 @@ QDF_STATUS policy_mgr_mode_specific_num_open_sessions( struct wlan_objmgr_psoc *psoc, enum QDF_OPMODE mode, uint8_t *num_sessions); +/** + * policy_mgr_mode_specific_num_active_sessions() - to get number of active + * sessions for a specific mode + * @psoc: PSOC object information + * @mode: device mode + * @num_sessions: to store num active sessions + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_mode_specific_num_active_sessions( + struct wlan_objmgr_psoc *psoc, enum QDF_OPMODE mode, + uint8_t *num_sessions); + /** * policy_mgr_concurrent_open_sessions_running() - Checks for * concurrent open session diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 916d6291e4d6..0d1a40453298 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2076,6 +2076,22 @@ QDF_STATUS policy_mgr_mode_specific_num_open_sessions( return QDF_STATUS_SUCCESS; } +QDF_STATUS policy_mgr_mode_specific_num_active_sessions( + struct wlan_objmgr_psoc *psoc, enum QDF_OPMODE mode, + uint8_t *num_sessions) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return QDF_STATUS_E_FAILURE; + } + + *num_sessions = pm_ctx->no_of_active_sessions[mode]; + return QDF_STATUS_SUCCESS; +} + /** * policy_mgr_concurrent_open_sessions_running() - Checks for * concurrent open session From 24167fc8f35820f62dbea96bea735ac197b209ba Mon Sep 17 00:00:00 2001 From: Arunk Khandavalli Date: Mon, 5 Feb 2018 15:42:31 +0530 Subject: [PATCH 098/187] qcacmn: update the pcl info from the converged structures Update the pcl information from the converged strutures. CRs-Fixed: 2179012 Change-Id: Id9269e85728409645266e1edc17d03237144a9cc --- inc/wlan_policy_mgr_api.h | 7 ++++--- src/wlan_policy_mgr_get_set_utils.c | 27 ++++++++++++--------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index fe0dbe89591b..06d3925616c7 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -40,6 +40,8 @@ #include "wlan_objmgr_psoc_obj.h" #include "wlan_policy_mgr_public_struct.h" +struct target_psoc_info; + typedef const enum policy_mgr_pcl_type pm_dbs_pcl_second_connection_table_type [PM_MAX_ONE_CONNECTION_MODE][PM_MAX_NUM_OF_MODE] @@ -1922,8 +1924,7 @@ void policy_mgr_init_dbs_hw_mode(struct wlan_objmgr_psoc *psoc, * policy_mgr_update_hw_mode_list() - Function to initialize DBS * HW modes in policy manager component * @psoc: PSOC object information - * @num_dbs_hw_modes: Number of HW modes - * @ev_wlan_dbs_hw_mode_list: HW list + * @tgt_hdl: Target psoc information * * This function to initialize the DBS HW modes in policy * manager @@ -1932,7 +1933,7 @@ void policy_mgr_init_dbs_hw_mode(struct wlan_objmgr_psoc *psoc, * */ QDF_STATUS policy_mgr_update_hw_mode_list(struct wlan_objmgr_psoc *psoc, - struct extended_caps *phy_caps); + struct target_psoc_info *tgt_hdl); /** * policy_mgr_update_hw_mode_index() - Function to update diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 0d1a40453298..3565eb110a7e 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -145,7 +145,8 @@ static enum hw_mode_bandwidth policy_mgr_map_wmi_channel_width_to_hw_mode_bw( return HW_MODE_BW_NONE; } -static void policy_mgr_get_hw_mode_params(WMI_MAC_PHY_CAPABILITIES *caps, +static void policy_mgr_get_hw_mode_params( + struct wlan_psoc_host_mac_phy_caps *caps, struct policy_mgr_mac_ss_bw_info *info) { if (!caps) { @@ -223,14 +224,15 @@ static void policy_mgr_set_hw_mode_params(struct wlan_objmgr_psoc *psoc, } QDF_STATUS policy_mgr_update_hw_mode_list(struct wlan_objmgr_psoc *psoc, - struct extended_caps *phy_caps) + struct target_psoc_info *tgt_hdl) { - WMI_MAC_PHY_CAPABILITIES *tmp; + struct wlan_psoc_host_mac_phy_caps *tmp; uint32_t i, hw_config_type, j = 0; uint32_t dbs_mode, sbs_mode; struct policy_mgr_mac_ss_bw_info mac0_ss_bw_info = {0}; struct policy_mgr_mac_ss_bw_info mac1_ss_bw_info = {0}; struct policy_mgr_psoc_priv_obj *pm_ctx; + struct tgt_info *info; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -238,14 +240,10 @@ QDF_STATUS policy_mgr_update_hw_mode_list(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_FAILURE; } - if (!phy_caps) { - policy_mgr_err("Invalid phy capabilities"); - return QDF_STATUS_E_FAILURE; - } - - if (!phy_caps->num_hw_modes.num_hw_modes) { + info = &tgt_hdl->info; + if (!info->service_ext_param.num_hw_modes) { policy_mgr_err("Number of HW modes: %d", - phy_caps->num_hw_modes.num_hw_modes); + info->service_ext_param.num_hw_modes); return QDF_STATUS_E_FAILURE; } @@ -259,7 +257,7 @@ QDF_STATUS policy_mgr_update_hw_mode_list(struct wlan_objmgr_psoc *psoc, policy_mgr_debug("DBS list is freed"); } - pm_ctx->num_dbs_hw_modes = phy_caps->num_hw_modes.num_hw_modes; + pm_ctx->num_dbs_hw_modes = info->service_ext_param.num_hw_modes; pm_ctx->hw_mode.hw_mode_list = qdf_mem_malloc(sizeof(*pm_ctx->hw_mode.hw_mode_list) * pm_ctx->num_dbs_hw_modes); @@ -273,10 +271,9 @@ QDF_STATUS policy_mgr_update_hw_mode_list(struct wlan_objmgr_psoc *psoc, for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { /* Update for MAC0 */ - tmp = &phy_caps->each_phy_cap_per_hwmode[j++]; + tmp = &info->mac_phy_cap[j++]; policy_mgr_get_hw_mode_params(tmp, &mac0_ss_bw_info); - hw_config_type = - phy_caps->each_hw_mode_cap[i].hw_mode_config_type; + hw_config_type = tmp->hw_mode_config_type; dbs_mode = HW_MODE_DBS_NONE; sbs_mode = HW_MODE_SBS_NONE; mac1_ss_bw_info.mac_tx_stream = 0; @@ -288,7 +285,7 @@ QDF_STATUS policy_mgr_update_hw_mode_list(struct wlan_objmgr_psoc *psoc, (hw_config_type == WMI_HW_MODE_SBS_PASSIVE) || (hw_config_type == WMI_HW_MODE_SBS)) { /* Update for MAC1 */ - tmp = &phy_caps->each_phy_cap_per_hwmode[j++]; + tmp = &info->mac_phy_cap[j++]; policy_mgr_get_hw_mode_params(tmp, &mac1_ss_bw_info); if (hw_config_type == WMI_HW_MODE_DBS) dbs_mode = HW_MODE_DBS; From c7b9769831e17bf2d1f9a544d253e1950e054557 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Wed, 21 Feb 2018 13:37:00 -0800 Subject: [PATCH 099/187] qcacmn: Trim ACS channel list based on the concurrent connections If force SCC is enabled and there is a STA connection, trim the ACS channel list on the band on which STA connection is present. Change-Id: Ibd580a7afdcdfc5fb4398ada547565e229d59c70 CRs-Fixed: 2193720 --- inc/wlan_policy_mgr_api.h | 11 ++++ src/wlan_policy_mgr_get_set_utils.c | 83 +++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 06d3925616c7..a9886edbc3ed 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -2244,4 +2244,15 @@ bool policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan( * Return: true if sta is connected in 2g else false */ bool policy_mgr_is_sta_connected_2g(struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_trim_acs_channel_list() - Trim the ACS channel list based + * on the number of active station connections + * @org_ch_list: ACS channel list from user space + * @org_ch_list_count: ACS channel count from user space + * + * Return: None + */ +void policy_mgr_trim_acs_channel_list(struct wlan_objmgr_psoc *psoc, + uint8_t *org_ch_list, uint8_t *org_ch_list_count); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 3565eb110a7e..653bed941113 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2820,3 +2820,86 @@ bool policy_mgr_is_sta_connected_2g(struct wlan_objmgr_psoc *psoc) return ret; } + +void policy_mgr_trim_acs_channel_list(struct wlan_objmgr_psoc *psoc, + uint8_t *org_ch_list, uint8_t *org_ch_list_count) +{ + uint32_t list[MAX_NUMBER_OF_CONC_CONNECTIONS]; + uint32_t index, count, i, ch_list_count; + uint8_t band_mask = 0, ch_5g = 0, ch_24g = 0; + uint8_t ch_list[QDF_MAX_NUM_CHAN]; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + + if (*org_ch_list_count >= QDF_MAX_NUM_CHAN) { + policy_mgr_err("org_ch_list_count too big %d", + *org_ch_list_count); + return; + } + /* + * if force SCC is enabled and there is a STA connection, trim the + * ACS channel list on the band on which STA connection is present + */ + count = policy_mgr_mode_specific_connection_count( + psoc, PM_STA_MODE, list); + if (policy_mgr_is_force_scc(psoc) && count) { + index = 0; + while (index < count) { + if (WLAN_REG_IS_24GHZ_CH( + pm_conc_connection_list[list[index]].chan) && + policy_mgr_is_safe_channel(psoc, + pm_conc_connection_list[list[index]].chan)) { + band_mask |= 1; + ch_24g = pm_conc_connection_list[list[index]].chan; + } + if (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[list[index]].chan) && + policy_mgr_is_safe_channel(psoc, + pm_conc_connection_list[list[index]].chan) && + !wlan_reg_is_dfs_ch(pm_ctx->pdev, + pm_conc_connection_list[list[index]].chan) && + !wlan_reg_is_passive_or_disable_ch(pm_ctx->pdev, + pm_conc_connection_list[list[index]].chan)) { + band_mask |= 2; + ch_5g = pm_conc_connection_list[list[index]].chan; + } + index++; + } + ch_list_count = 0; + if (band_mask == 1) { + ch_list[ch_list_count++] = ch_24g; + for (i = 0; i < *org_ch_list_count; i++) { + if (WLAN_REG_IS_24GHZ_CH( + org_ch_list[i])) + continue; + ch_list[ch_list_count++] = + org_ch_list[i]; + } + } else if (band_mask == 2) { + ch_list[ch_list_count++] = ch_5g; + for (i = 0; i < *org_ch_list_count; i++) { + if (WLAN_REG_IS_5GHZ_CH( + org_ch_list[i])) + continue; + ch_list[ch_list_count++] = + org_ch_list[i]; + } + } else if (band_mask == 3) { + ch_list[ch_list_count++] = ch_24g; + ch_list[ch_list_count++] = ch_5g; + } else { + policy_mgr_debug("unexpected band_mask value %d", + band_mask); + return; + } + + *org_ch_list_count = ch_list_count; + for (i = 0; i < *org_ch_list_count; i++) + org_ch_list[i] = ch_list[i]; + } +} From 257a5d7edec245a4e99985b4ad6007f976077996 Mon Sep 17 00:00:00 2001 From: Yeshwanth Sriram Guntuka Date: Mon, 12 Feb 2018 12:24:06 +0530 Subject: [PATCH 100/187] qcacmn: Add ini support for channel selection logic Add ini to select DBS or inter-band MCC channel selection logic for STA+STA and STA+P2P connections. Change-Id: I7cfde9592ec210b0a8c812171d2bc6f005e17fb2 CRs-Fixed: 2189845 --- inc/wlan_policy_mgr_api.h | 16 +++++++++++++++- src/wlan_policy_mgr_get_set_utils.c | 9 ++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index a9886edbc3ed..9399e1416990 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -60,6 +60,19 @@ typedef const enum policy_mgr_conc_next_action policy_mgr_next_action_three_connection_table_type [PM_MAX_TWO_CONNECTION_MODE][POLICY_MGR_MAX_BAND]; +#define PM_FW_MODE_STA_STA_BIT_POS 0 +#define PM_FW_MODE_STA_P2P_BIT_POS 1 + +#define PM_FW_MODE_STA_STA_BIT_MASK (0x1 << PM_FW_MODE_STA_STA_BIT_POS) +#define PM_FW_MODE_STA_P2P_BIT_MASK (0x1 << PM_FW_MODE_STA_P2P_BIT_POS) + +#define PM_CHANNEL_SELECT_LOGIC_STA_STA_GET(channel_select_logic_conc) \ + ((channel_select_logic_conc & PM_FW_MODE_STA_STA_BIT_MASK) >> \ + PM_FW_MODE_STA_STA_BIT_POS) +#define PM_CHANNEL_SELECT_LOGIC_STA_P2P_GET(channel_select_logic_conc) \ + ((channel_select_logic_conc & PM_FW_MODE_STA_P2P_BIT_MASK) >> \ + PM_FW_MODE_STA_P2P_BIT_POS) + /** * policy_mgr_set_concurrency_mode() - To set concurrency mode * @psoc: PSOC object data @@ -2025,7 +2038,8 @@ bool policy_mgr_is_dnsc_set(struct wlan_objmgr_vdev *vdev); */ QDF_STATUS policy_mgr_get_updated_scan_and_fw_mode_config( struct wlan_objmgr_psoc *psoc, uint32_t *scan_config, - uint32_t *fw_mode_config, uint32_t dual_mac_disable_ini); + uint32_t *fw_mode_config, uint32_t dual_mac_disable_ini, + uint32_t channel_select_logic_conc); /** * policy_mgr_is_safe_channel - Check if the channel is in LTE diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 653bed941113..f164df3724a9 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2722,7 +2722,8 @@ uint8_t policy_mgr_get_cur_conc_system_pref(struct wlan_objmgr_psoc *psoc) QDF_STATUS policy_mgr_get_updated_scan_and_fw_mode_config( struct wlan_objmgr_psoc *psoc, uint32_t *scan_config, - uint32_t *fw_mode_config, uint32_t dual_mac_disable_ini) + uint32_t *fw_mode_config, uint32_t dual_mac_disable_ini, + uint32_t channel_select_logic_conc) { struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -2754,6 +2755,12 @@ QDF_STATUS policy_mgr_get_updated_scan_and_fw_mode_config( default: break; } + + WMI_DBS_FW_MODE_CFG_DBS_FOR_STA_PLUS_STA_SET(*fw_mode_config, + PM_CHANNEL_SELECT_LOGIC_STA_STA_GET(channel_select_logic_conc)); + WMI_DBS_FW_MODE_CFG_DBS_FOR_STA_PLUS_P2P_SET(*fw_mode_config, + PM_CHANNEL_SELECT_LOGIC_STA_P2P_GET(channel_select_logic_conc)); + policy_mgr_debug("*scan_config:%x ", *scan_config); policy_mgr_debug("*fw_mode_config:%x ", *fw_mode_config); From 71e5ae6889af2f3b97bc95d010b3190d6991413b Mon Sep 17 00:00:00 2001 From: Yeshwanth Sriram Guntuka Date: Mon, 12 Feb 2018 13:30:23 +0530 Subject: [PATCH 101/187] qcacmn: Set hw mode based on channel_select_logic_conc ini Set hw mode to DBS or single MAC for STA+STA and STA+P2P concurrencies based on channel_select_logic_conc ini. Change-Id: I46ba4d5cd8f5cda71d0c00be2b612bc851eb5ba4 CRs-Fixed: 2189848 --- inc/wlan_policy_mgr_api.h | 1 + inc/wlan_policy_mgr_public_struct.h | 3 +- src/wlan_policy_mgr_action.c | 88 +++++++++++++++++++++++++++++ src/wlan_policy_mgr_init_deinit.c | 3 + 4 files changed, 94 insertions(+), 1 deletion(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 9399e1416990..ad47414676be 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -836,6 +836,7 @@ struct policy_mgr_hdd_cbacks { enum policy_mgr_con_mode (*get_mode_for_non_connected_vdev)( struct wlan_objmgr_psoc *psoc, uint8_t vdev_id); + enum tQDF_ADAPTER_MODE (*hdd_get_device_mode)(uint32_t session_id); }; diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 3ace5acb8d2a..651c3ad41886 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -1018,6 +1018,7 @@ struct policy_mgr_user_cfg { uint32_t mcc_to_scc_switch_mode; bool sub_20_mhz_enabled; bool is_sta_sap_scc_allowed_on_dfs_chan; + uint32_t channel_select_logic_conc; }; /** diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 897571ecd5d7..f77f2fe9c873 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -346,6 +346,78 @@ QDF_STATUS policy_mgr_update_and_wait_for_connection_update( return QDF_STATUS_SUCCESS; } +/** + * policy_mgr_is_dbs_allowed_for_concurrency() - If dbs is allowed for current + * concurreny + * @new_conn_mode: new connection mode + * + * When a new connection is about to come up, check if dbs is allowed for + * STA+STA or STA+P2P + * + * Return: true if dbs is allowed for STA+STA or STA+P2P else false + */ +static bool policy_mgr_is_dbs_allowed_for_concurrency( + struct wlan_objmgr_psoc *psoc, uint32_t session_id) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + uint32_t count, dbs_for_sta_sta, dbs_for_sta_p2p; + enum tQDF_ADAPTER_MODE new_conn_mode = QDF_MAX_NO_OF_MODE; + bool ret = true; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return ret; + } + + count = policy_mgr_get_connection_count(psoc); + if (pm_ctx->hdd_cbacks.hdd_get_device_mode) + new_conn_mode = pm_ctx->hdd_cbacks. + hdd_get_device_mode(session_id); + + if (count != 1 || new_conn_mode == QDF_MAX_NO_OF_MODE) + return ret; + + dbs_for_sta_sta = PM_CHANNEL_SELECT_LOGIC_STA_STA_GET(pm_ctx->user_cfg. + channel_select_logic_conc); + dbs_for_sta_p2p = PM_CHANNEL_SELECT_LOGIC_STA_P2P_GET(pm_ctx->user_cfg. + channel_select_logic_conc); + + switch (pm_conc_connection_list[0].mode) { + case PM_STA_MODE: + switch (new_conn_mode) { + case QDF_STA_MODE: + if (!dbs_for_sta_sta) + return false; + break; + case QDF_P2P_DEVICE_MODE: + case QDF_P2P_CLIENT_MODE: + case QDF_P2P_GO_MODE: + if (!dbs_for_sta_p2p) + return false; + break; + default: + break; + } + break; + case PM_P2P_CLIENT_MODE: + case PM_P2P_GO_MODE: + switch (new_conn_mode) { + case QDF_STA_MODE: + if (!dbs_for_sta_p2p) + return false; + break; + default: + break; + } + break; + default: + break; + } + + return ret; +} + QDF_STATUS policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc, uint32_t session_id, uint8_t channel, @@ -410,6 +482,22 @@ QDF_STATUS policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc, break; } + /* + * Based on channel_select_logic_conc ini, hw mode is set + * when second connection is about to come up that results + * in STA+STA and STA+P2P concurrency. + * 1) If MCC is set and if current hw mode is dbs, hw mode + * should be set to single mac for above concurrency. + * 2) If MCC is set and if current hw mode is not dbs, hw + * mode change is not required. + */ + if (policy_mgr_is_current_hwmode_dbs(psoc) && + !policy_mgr_is_dbs_allowed_for_concurrency(psoc, session_id)) + next_action = PM_SINGLE_MAC; + else if (!policy_mgr_is_current_hwmode_dbs(psoc) && + !policy_mgr_is_dbs_allowed_for_concurrency(psoc, session_id)) + next_action = PM_NOP; + if (PM_NOP != next_action) status = policy_mgr_next_actions(psoc, session_id, next_action, reason); diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 44bde60ec7f5..ef55b1e4102b 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -576,6 +576,8 @@ QDF_STATUS policy_mgr_register_hdd_cb(struct wlan_objmgr_psoc *psoc, hdd_cbacks->wlan_hdd_get_channel_for_sap_restart; pm_ctx->hdd_cbacks.get_mode_for_non_connected_vdev = hdd_cbacks->get_mode_for_non_connected_vdev; + pm_ctx->hdd_cbacks.hdd_get_device_mode = + hdd_cbacks->hdd_get_device_mode; return QDF_STATUS_SUCCESS; } @@ -593,6 +595,7 @@ QDF_STATUS policy_mgr_deregister_hdd_cb(struct wlan_objmgr_psoc *psoc) pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb = NULL; pm_ctx->hdd_cbacks.wlan_hdd_get_channel_for_sap_restart = NULL; pm_ctx->hdd_cbacks.get_mode_for_non_connected_vdev = NULL; + pm_ctx->hdd_cbacks.hdd_get_device_mode = NULL; return QDF_STATUS_SUCCESS; } From 6a3be16847d7c162f4e7e2d466858469eead0b26 Mon Sep 17 00:00:00 2001 From: Yeshwanth Sriram Guntuka Date: Fri, 23 Feb 2018 12:14:46 +0530 Subject: [PATCH 102/187] qcacmn: Add support for HW mode info vendor command Add support for HW mode info vendor command which sends mac id, band, interface id and frequency information for each MAC provided by driver to userspace. Change-Id: If1112d29b8781cf5ba0480c84feeb772142f2c0e CRs-Fixed: 2185559 --- inc/wlan_policy_mgr_api.h | 26 ++++++++++++++++++++++++ inc/wlan_policy_mgr_public_struct.h | 18 +++++++++++++++++ src/wlan_policy_mgr_action.c | 10 ++++++++++ src/wlan_policy_mgr_core.c | 12 +++++++++++ src/wlan_policy_mgr_get_set_utils.c | 28 ++++++++++++++++++++++++++ src/wlan_policy_mgr_i.h | 4 ++-- src/wlan_policy_mgr_init_deinit.c | 31 +++++++++++++++++++++++++++++ 7 files changed, 127 insertions(+), 2 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index ad47414676be..a54e46cf2799 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -2270,4 +2270,30 @@ bool policy_mgr_is_sta_connected_2g(struct wlan_objmgr_psoc *psoc); */ void policy_mgr_trim_acs_channel_list(struct wlan_objmgr_psoc *psoc, uint8_t *org_ch_list, uint8_t *org_ch_list_count); +/* + * policy_mgr_get_connection_info() - Get info of all active connections + * @info: Pointer to connection info + * + * Return: Connection count + */ +uint32_t policy_mgr_get_connection_info(struct wlan_objmgr_psoc *psoc, + struct connection_info *info); +/** + * policy_mgr_register_mode_change_cb() - Register mode change callback with + * policy manager + * @callback: HDD callback to be registered + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_register_mode_change_cb(struct wlan_objmgr_psoc *psoc, + send_mode_change_event_cb mode_change_cb); +/** + * policy_mgr_deregister_mode_change_cb() - Deregister mode change callback with + * policy manager + * @callback: HDD callback to be registered + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_deregister_mode_change_cb(struct wlan_objmgr_psoc *psoc); + #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 651c3ad41886..d0793d372b5b 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -66,6 +66,12 @@ #define WEIGHT_OF_NON_PCL_CHANNELS 1 #define WEIGHT_OF_DISALLOWED_CHANNELS 0 +#define MAX_MAC 2 + +#define MAX_NUMBER_OF_CONC_CONNECTIONS 3 + +typedef int (*send_mode_change_event_cb)(void); + /** * enum hw_mode_ss_config - Possible spatial stream configuration * @HW_MODE_SS_0x0: Unused Tx and Rx of MAC @@ -1030,4 +1036,16 @@ struct dbs_nss { enum hw_mode_ss_config mac0_ss; enum hw_mode_ss_config mac1_ss; }; + +/** + * struct connection_info - connection information + * @mac_id: The HW mac it is running + * @vdev_id: vdev id + * @channel: channel of the connection + */ +struct connection_info { + uint8_t mac_id; + uint8_t vdev_id; + uint8_t channel; +}; #endif /* __WLAN_POLICY_MGR_PUBLIC_STRUCT_H */ diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index f77f2fe9c873..db6e957ad659 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -53,6 +53,13 @@ void policy_mgr_hw_mode_transition_cb(uint32_t old_hw_mode_index, QDF_STATUS status; struct policy_mgr_hw_mode_params hw_mode; uint32_t i; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(context); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return; + } if (!vdev_mac_map) { policy_mgr_err("vdev_mac_map is NULL"); @@ -86,6 +93,9 @@ void policy_mgr_hw_mode_transition_cb(uint32_t old_hw_mode_index, vdev_mac_map, hw_mode); + if (pm_ctx->mode_change_cb) + pm_ctx->mode_change_cb(); + return; } diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 085d379863ff..161fa92ae91f 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -573,6 +573,9 @@ void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc, pm_conc_connection_list[conn_index].vdev_id = vdev_id; pm_conc_connection_list[conn_index].in_use = in_use; + if (pm_ctx->mode_change_cb) + pm_ctx->mode_change_cb(); + policy_mgr_dump_connection_status_info(psoc); if (pm_ctx->cdp_cbacks.cdp_update_mac_id) pm_ctx->cdp_cbacks.cdp_update_mac_id(psoc, vdev_id, mac); @@ -764,6 +767,13 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status, QDF_STATUS ret; struct policy_mgr_hw_mode_params hw_mode; uint32_t i; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(context); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } policy_mgr_set_hw_mode_change_in_progress(context, POLICY_MGR_HW_MODE_NOT_IN_PROGRESS); @@ -803,6 +813,8 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status, policy_mgr_update_hw_mode_conn_info(context, num_vdev_mac_entries, vdev_mac_map, hw_mode); + if (pm_ctx->mode_change_cb) + pm_ctx->mode_change_cb(); ret = policy_mgr_set_connection_update(context); if (!QDF_IS_STATUS_SUCCESS(ret)) diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index f164df3724a9..31c67cf2a150 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2910,3 +2910,31 @@ void policy_mgr_trim_acs_channel_list(struct wlan_objmgr_psoc *psoc, org_ch_list[i] = ch_list[i]; } } + +uint32_t policy_mgr_get_connection_info(struct wlan_objmgr_psoc *psoc, + struct connection_info *info) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + uint32_t conn_index, count = 0; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return count; + } + + for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; + conn_index++) { + if (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) { + info[count].vdev_id = + pm_conc_connection_list[conn_index].vdev_id; + info[count].mac_id = + pm_conc_connection_list[conn_index].mac; + info[count].channel = + pm_conc_connection_list[conn_index].chan; + count++; + } + } + + return count; +} diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index e8b21092a4c2..6f8b1fe36992 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -35,7 +35,6 @@ #include "qdf_defer.h" #include "wlan_reg_services_api.h" -#define MAX_NUMBER_OF_CONC_CONNECTIONS 3 #define DBS_OPPORTUNISTIC_TIME 10 #ifdef QCA_WIFI_3_0_EMU #define CONNECTION_UPDATE_TIMEOUT 3000 @@ -275,6 +274,7 @@ struct policy_mgr_psoc_priv_obj { uint8_t cur_conc_system_pref; uint8_t sta_sap_scc_on_dfs_chan_allowed; qdf_event_t opportunistic_update_done_evt; + send_mode_change_event_cb mode_change_cb; }; /** diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index ef55b1e4102b..eb9eab9e2219 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -671,3 +671,34 @@ QDF_STATUS policy_mgr_register_tdls_cb(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } + +QDF_STATUS policy_mgr_register_mode_change_cb(struct wlan_objmgr_psoc *psoc, + send_mode_change_event_cb mode_change_cb) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + pm_ctx->mode_change_cb = mode_change_cb; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_deregister_mode_change_cb(struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + pm_ctx->mode_change_cb = NULL; + + return QDF_STATUS_SUCCESS; +} From 23a5404b7673b9cd10ecd6f2190bf7be688f431b Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Fri, 2 Mar 2018 14:09:16 -0800 Subject: [PATCH 103/187] qcacmn: Remove redundant DBS HW mode request Remove redundant DBS HW mode request from pm_next_action_two_connection_dbs_2x2_table. For 2x2 DBS HW even for first connection if it is on 2.4G, DBS will get requested. Hence no need to request again for second connection on the other band. Change-Id: I17db8de5ed7a60f556cc8eeed59bbbfe0d63e795 CRs-Fixed: 2199420 --- src/wlan_policy_mgr_tables_2x2_dbs_i.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wlan_policy_mgr_tables_2x2_dbs_i.h b/src/wlan_policy_mgr_tables_2x2_dbs_i.h index c13944dfd06d..cbef81312141 100644 --- a/src/wlan_policy_mgr_tables_2x2_dbs_i.h +++ b/src/wlan_policy_mgr_tables_2x2_dbs_i.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -1306,8 +1306,8 @@ static policy_mgr_next_action_two_connection_table_type [PM_P2P_GO_24_2x2] = {PM_NOP, PM_NOP}, [PM_P2P_GO_5_1x1] = {PM_DBS, PM_SBS}, [PM_P2P_GO_5_2x2] = {PM_DBS, PM_SBS_DOWNGRADE}, - [PM_SAP_24_1x1] = {PM_NOP, PM_DBS}, - [PM_SAP_24_2x2] = {PM_NOP, PM_DBS}, + [PM_SAP_24_1x1] = {PM_NOP, PM_NOP}, + [PM_SAP_24_2x2] = {PM_NOP, PM_NOP}, [PM_SAP_5_1x1] = {PM_DBS, PM_SBS}, [PM_SAP_5_2x2] = {PM_DBS, PM_SBS_DOWNGRADE}, [PM_IBSS_24_1x1] = {PM_NOP, PM_NOP}, From 119ed6b1e1417aecccdb327ad058d170ac2fe22c Mon Sep 17 00:00:00 2001 From: Bala Venkatesh Date: Sat, 17 Mar 2018 18:48:31 +0530 Subject: [PATCH 104/187] qcacmn: Add ENABLE_DBS_CXN_AND_DISABLE_DBS_SCAN Add ENABLE_DBS_CXN_AND_DISABLE_DBS_SCAN option for the ini gDualMacFeatureDisable. To enable DBS support for the connection and disable DBS support for the scan. Change-Id: I05c613467195fffac98e79b7e4a2991471ac1d80 CRs-Fixed: 2207820 --- inc/wlan_policy_mgr_public_struct.h | 3 +++ src/wlan_policy_mgr_get_set_utils.c | 15 +++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index d0793d372b5b..67c4af2c730a 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -815,6 +815,8 @@ enum policy_mgr_hw_mode_change { * for connection but keep dbs for scan but switch off the async scan * @ENABLE_DBS_CXN_AND_ENABLE_SCAN_WITH_ASYNC_SCAN_OFF: enable dbs support for * connection and scan but switch off the async scan + * @ENABLE_DBS_CXN_AND_DISABLE_DBS_SCAN: Enable DBS support for connection and + * disable DBS support for scan */ enum dbs_support { ENABLE_DBS_CXN_AND_SCAN, @@ -822,6 +824,7 @@ enum dbs_support { DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN, DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN_WITH_ASYNC_SCAN_OFF, ENABLE_DBS_CXN_AND_ENABLE_SCAN_WITH_ASYNC_SCAN_OFF, + ENABLE_DBS_CXN_AND_DISABLE_DBS_SCAN }; /** diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 31c67cf2a150..6cc6e2f1077b 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2683,11 +2683,13 @@ uint32_t policy_mgr_get_hw_dbs_nss(struct wlan_objmgr_psoc *psoc, bool policy_mgr_is_scan_simultaneous_capable(struct wlan_objmgr_psoc *psoc) { - if (DISABLE_DBS_CXN_AND_SCAN != - wlan_objmgr_psoc_get_dual_mac_disable(psoc)) - return true; + if ((DISABLE_DBS_CXN_AND_SCAN == + wlan_objmgr_psoc_get_dual_mac_disable(psoc)) || + (ENABLE_DBS_CXN_AND_DISABLE_DBS_SCAN == + wlan_objmgr_psoc_get_dual_mac_disable(psoc))) + return false; - return false; + return true; } void policy_mgr_set_cur_conc_system_pref(struct wlan_objmgr_psoc *psoc, @@ -2752,6 +2754,11 @@ QDF_STATUS policy_mgr_get_updated_scan_and_fw_mode_config( dual_mac_disable_ini); WMI_DBS_CONC_SCAN_CFG_ASYNC_DBS_SCAN_SET(*scan_config, 0); break; + case ENABLE_DBS_CXN_AND_DISABLE_DBS_SCAN: + policy_mgr_debug("%s: dual_mac_disable_ini:%d ", __func__, + dual_mac_disable_ini); + WMI_DBS_CONC_SCAN_CFG_DBS_SCAN_SET(*scan_config, 0); + break; default: break; } From a7bff60cf063857ea080803240efe6018bb230c2 Mon Sep 17 00:00:00 2001 From: wadesong Date: Wed, 28 Mar 2018 14:48:51 +0800 Subject: [PATCH 105/187] qcacmn: Suppress the verbose log from policy mgr When DBS is disabled in WLAN INI file(e.g. on some platforms where RM chipset is attached), the policy manager will keep posting a verbose message saying 'DBS is disabled from ini'. This isn't exhibiting much useful information, and may cause watchdog bark when SnS stress is running. Suppress the verbose log by lowering it's debug level. Change-Id: Ie8d5a1784940f483cc671da43f734851c0b5adb6 CRs-Fixed: 2214201 --- src/wlan_policy_mgr_get_set_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 6cc6e2f1077b..8b5fa354576b 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -743,7 +743,7 @@ bool policy_mgr_is_dbs_enable(struct wlan_objmgr_psoc *psoc) struct policy_mgr_psoc_priv_obj *pm_ctx; if (policy_mgr_is_dual_mac_disabled_in_ini(psoc)) { - policy_mgr_err("DBS is disabled from ini"); + policy_mgr_debug("DBS is disabled from ini"); return false; } From b4f30633136af6d4330978363a16c49331baf060 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Wed, 28 Mar 2018 17:23:55 -0700 Subject: [PATCH 106/187] qcacmn: Use enum type policy_mgr_con_mode instead of enum QDF_OPMODE Use enum type policy_mgr_con_mode instead of enum QDF_OPMODE. Change-Id: Ia7a6bb5e05c6dac650dc6386734462547365a4eb CRs-Fixed: 2214003 --- inc/wlan_policy_mgr_public_struct.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 67c4af2c730a..c45f3e63f08d 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -219,6 +219,7 @@ enum policy_mgr_conc_priority_mode { * @PM_P2P_CLIENT_MODE: P2P client mode * @PM_P2P_GO_MODE: P2P Go mode * @PM_IBSS_MODE: IBSS mode + * @PM_NDI_MODE: NDI mode * @PM_MAX_NUM_OF_MODE: max value place holder */ enum policy_mgr_con_mode { @@ -227,6 +228,7 @@ enum policy_mgr_con_mode { PM_P2P_CLIENT_MODE, PM_P2P_GO_MODE, PM_IBSS_MODE, + PM_NDI_MODE, PM_MAX_NUM_OF_MODE }; From 0d506a4d64bb4a8a2d274a76bc4e02a040c541c0 Mon Sep 17 00:00:00 2001 From: Yuanyuan Liu Date: Wed, 28 Mar 2018 18:05:30 -0700 Subject: [PATCH 107/187] qcacmn: Fix LLVM compiling issues Remove typedef redefinition, use correct enum type, remove extra parentheses and correct header guard. CRs-Fixed: 2214003 Change-Id: I0a75c70cd530590a16f6bfa884955ebc26906de0 --- src/wlan_policy_mgr_get_set_utils.c | 2 +- src/wlan_policy_mgr_tables_2x2_dbs_i.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 8b5fa354576b..2e027d67b2ae 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2176,7 +2176,7 @@ bool policy_mgr_is_sta_active_connection_exists( struct wlan_objmgr_psoc *psoc) { return (!policy_mgr_mode_specific_connection_count( - psoc, QDF_STA_MODE, NULL)) ? false : true; + psoc, PM_STA_MODE, NULL)) ? false : true; } bool policy_mgr_is_any_nondfs_chnl_present(struct wlan_objmgr_psoc *psoc, diff --git a/src/wlan_policy_mgr_tables_2x2_dbs_i.h b/src/wlan_policy_mgr_tables_2x2_dbs_i.h index cbef81312141..815bdd5d10a6 100644 --- a/src/wlan_policy_mgr_tables_2x2_dbs_i.h +++ b/src/wlan_policy_mgr_tables_2x2_dbs_i.h @@ -26,7 +26,7 @@ */ #ifndef __WLAN_POLICY_MGR_TABLES_2X2_DBS_H -#define __WLAN_POLICY_MGR_TABLESY_2X2_DBS_H +#define __WLAN_POLICY_MGR_TABLES_2X2_DBS_H #include "wlan_policy_mgr_api.h" From c8754ac4bdc0dfd884c7676894fc652c610debb2 Mon Sep 17 00:00:00 2001 From: jiad Date: Fri, 30 Mar 2018 16:33:59 +0800 Subject: [PATCH 108/187] qcacmn: fix ipa mcc scc event notification Issue is under AP-AP MCC config, mcc event is not sent from wlan to IPA driver. mcc mode is decided with the help of connection table. But for AP mode, mcc mode is checked and updated before connection table is updated by adding the SAP vdev entry. Fix is to make ipa mcc mode check and notification when connection table is updated. Change-Id: I1ba3fcb874b014f05cebd8af90530b9aa54980a2 CRs-Fixed: 2214351 --- inc/wlan_policy_mgr_api.h | 2 ++ src/wlan_policy_mgr_core.c | 13 +++++++++++++ src/wlan_policy_mgr_get_set_utils.c | 14 ++++++++++++++ src/wlan_policy_mgr_init_deinit.c | 2 ++ 4 files changed, 31 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index a54e46cf2799..461064e440f8 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -866,10 +866,12 @@ struct policy_mgr_cdp_cbacks { * from policy manager * @hdd_disable_lro_in_concurrency: Callback to disable LRO * @hdd_set_rx_mode_rps_cb: Callback to set RPS + * @hdd_ipa_set_mcc_mode_cb: Callback to set mcc mode for ipa module */ struct policy_mgr_dp_cbacks { void (*hdd_disable_lro_in_concurrency)(bool); void (*hdd_set_rx_mode_rps_cb)(bool); + void (*hdd_ipa_set_mcc_mode_cb)(bool); }; /** diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 161fa92ae91f..b6569e589173 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -552,6 +552,7 @@ void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc, bool in_use) { struct policy_mgr_psoc_priv_obj *pm_ctx; + bool mcc_mode; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -564,6 +565,8 @@ void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc, conn_index); return; } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); pm_conc_connection_list[conn_index].mode = mode; pm_conc_connection_list[conn_index].chan = chan; pm_conc_connection_list[conn_index].bw = bw; @@ -572,6 +575,7 @@ void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc, pm_conc_connection_list[conn_index].original_nss = original_nss; pm_conc_connection_list[conn_index].vdev_id = vdev_id; pm_conc_connection_list[conn_index].in_use = in_use; + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); if (pm_ctx->mode_change_cb) pm_ctx->mode_change_cb(); @@ -580,6 +584,15 @@ void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc, if (pm_ctx->cdp_cbacks.cdp_update_mac_id) pm_ctx->cdp_cbacks.cdp_update_mac_id(psoc, vdev_id, mac); + /* IPA only cares about STA or SAP mode */ + if (mode == PM_STA_MODE || mode == PM_SAP_MODE) { + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + mcc_mode = policy_mgr_current_concurrency_is_mcc(psoc); + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + if (pm_ctx->dp_cbacks.hdd_ipa_set_mcc_mode_cb) + pm_ctx->dp_cbacks.hdd_ipa_set_mcc_mode_cb(mcc_mode); + } } /** diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 2e027d67b2ae..fe2551209555 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1190,6 +1190,7 @@ QDF_STATUS policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, { struct policy_mgr_psoc_priv_obj *pm_ctx; QDF_STATUS qdf_status; + bool mcc_mode; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -1248,6 +1249,19 @@ QDF_STATUS policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, policy_mgr_dump_current_concurrency(psoc); + /* + * Check mode of entry being removed. Update mcc_mode only when STA + * or SAP since IPA only cares about these two + */ + if (mode == QDF_STA_MODE || mode == QDF_SAP_MODE) { + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + mcc_mode = policy_mgr_current_concurrency_is_mcc(psoc); + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + if (pm_ctx->dp_cbacks.hdd_ipa_set_mcc_mode_cb) + pm_ctx->dp_cbacks.hdd_ipa_set_mcc_mode_cb(mcc_mode); + } + return qdf_status; } diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index eb9eab9e2219..992e0ff2aeac 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -649,6 +649,8 @@ QDF_STATUS policy_mgr_register_dp_cb(struct wlan_objmgr_psoc *psoc, dp_cbacks->hdd_disable_lro_in_concurrency; pm_ctx->dp_cbacks.hdd_set_rx_mode_rps_cb = dp_cbacks->hdd_set_rx_mode_rps_cb; + pm_ctx->dp_cbacks.hdd_ipa_set_mcc_mode_cb = + dp_cbacks->hdd_ipa_set_mcc_mode_cb; return QDF_STATUS_SUCCESS; } From e51aba73e79e36e689088322459ae7450bba9f4f Mon Sep 17 00:00:00 2001 From: Manjunathappa Prakash Date: Sun, 15 Apr 2018 00:42:41 -0700 Subject: [PATCH 109/187] qcacmn: add API to get NAPI instance corresponding to NAPI ID Add API to get NAPI instance from NAPI ID. Handle to NAPI is required for Rx processing via GRO. Change-Id: I15535827a03953231670d4138235c4876b16e045 CRs-Fixed: 2062180 --- inc/wlan_policy_mgr_api.h | 4 ++-- src/wlan_policy_mgr_get_set_utils.c | 12 ++++++------ src/wlan_policy_mgr_init_deinit.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 461064e440f8..3db7f62741be 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -864,12 +864,12 @@ struct policy_mgr_cdp_cbacks { /** * struct policy_mgr_dp_cbacks - CDP Callbacks to be invoked * from policy manager - * @hdd_disable_lro_in_concurrency: Callback to disable LRO + * @hdd_disable_rx_ol_in_concurrency: Callback to disable LRO/GRO offloads * @hdd_set_rx_mode_rps_cb: Callback to set RPS * @hdd_ipa_set_mcc_mode_cb: Callback to set mcc mode for ipa module */ struct policy_mgr_dp_cbacks { - void (*hdd_disable_lro_in_concurrency)(bool); + void (*hdd_disable_rx_ol_in_concurrency)(bool); void (*hdd_set_rx_mode_rps_cb)(bool); void (*hdd_ipa_set_mcc_mode_cb)(bool); }; diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index fe2551209555..9b86fdc7c343 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1159,7 +1159,7 @@ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, pm_ctx->tdls_cbacks.tdls_notify_increment_session(psoc); /* - * Disable LRO if P2P or IBSS or SAP connection has come up or + * Disable LRO/GRO if P2P or IBSS or SAP connection has come up or * there are more than one STA connections */ if ((policy_mgr_mode_specific_connection_count(psoc, PM_STA_MODE, NULL) > 1) || @@ -1168,8 +1168,8 @@ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, 0) || (policy_mgr_mode_specific_connection_count(psoc, PM_P2P_GO_MODE, NULL) > 0) || (policy_mgr_mode_specific_connection_count(psoc, PM_IBSS_MODE, NULL) > 0)) { - if (pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency != NULL) - pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency(true); + if (pm_ctx->dp_cbacks.hdd_disable_rx_ol_in_concurrency != NULL) + pm_ctx->dp_cbacks.hdd_disable_rx_ol_in_concurrency(true); }; /* Enable RPS if SAP interface has come up */ @@ -1229,15 +1229,15 @@ QDF_STATUS policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, /* Notify tdls */ if (pm_ctx->tdls_cbacks.tdls_notify_decrement_session) pm_ctx->tdls_cbacks.tdls_notify_decrement_session(psoc); - /* Enable LRO if there no concurrency */ + /* Enable LRO/GRO if there no concurrency */ if ((policy_mgr_mode_specific_connection_count(psoc, PM_STA_MODE, NULL) == 1) && (policy_mgr_mode_specific_connection_count(psoc, PM_SAP_MODE, NULL) == 0) && (policy_mgr_mode_specific_connection_count(psoc, PM_P2P_CLIENT_MODE, NULL) == 0) && (policy_mgr_mode_specific_connection_count(psoc, PM_P2P_GO_MODE, NULL) == 0) && (policy_mgr_mode_specific_connection_count(psoc, PM_IBSS_MODE, NULL) == 0)) { - if (pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency != NULL) - pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency(false); + if (pm_ctx->dp_cbacks.hdd_disable_rx_ol_in_concurrency != NULL) + pm_ctx->dp_cbacks.hdd_disable_rx_ol_in_concurrency(false); }; /* Disable RPS if SAP interface has come up */ diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 992e0ff2aeac..4e97913bf306 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -645,8 +645,8 @@ QDF_STATUS policy_mgr_register_dp_cb(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_FAILURE; } - pm_ctx->dp_cbacks.hdd_disable_lro_in_concurrency = - dp_cbacks->hdd_disable_lro_in_concurrency; + pm_ctx->dp_cbacks.hdd_disable_rx_ol_in_concurrency = + dp_cbacks->hdd_disable_rx_ol_in_concurrency; pm_ctx->dp_cbacks.hdd_set_rx_mode_rps_cb = dp_cbacks->hdd_set_rx_mode_rps_cb; pm_ctx->dp_cbacks.hdd_ipa_set_mcc_mode_cb = From 2923e70b09c45541a694fb1d67ebc7297fd05f5d Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Tue, 1 May 2018 15:18:09 -0700 Subject: [PATCH 110/187] qcacmn: Add range check for mode param in cds_get_pcl Add range check for mode parameter in cds_get_pcl. Change-Id: I049bebc5ec62f925e164517d59f94d122dbc5dc2 CRs-Fixed: 2234351 --- src/wlan_policy_mgr_pcl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 481107a1e91b..7851c6070ba3 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -492,6 +492,11 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, return status; } + if (mode >= PM_MAX_NUM_OF_MODE) { + policy_mgr_err("requested mode:%d is not supported", mode); + return status; + } + /* find the current connection state from pm_conc_connection_list*/ num_connections = policy_mgr_get_connection_count(psoc); policy_mgr_debug("connections:%d pref:%d requested mode:%d", From af29fe97359c6f98aafe07db8bc0747aecb2881d Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Fri, 27 Apr 2018 16:46:08 -0700 Subject: [PATCH 111/187] qcacmn: Fix uninitialize variables in few policy manager APIs Few variables are left uninitialized and they are being used with some random value. Fix by initializing to default value. CRs-Fixed: 2232791 Change-Id: I3351cae52c58e963601d53376f42ca8ebf0d3b9a --- src/wlan_policy_mgr_pcl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 7851c6070ba3..2179993f73c2 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -1357,7 +1357,7 @@ policy_mgr_get_nondfs_preferred_channel(struct wlan_objmgr_psoc *psoc, * under 5G MCC scenario */ uint8_t channel = PM_24_GHZ_CHANNEL_6; - uint32_t i, pcl_len; + uint32_t i, pcl_len = 0; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { From 70a52d9a29f20777fa3559a512ab81191975090f Mon Sep 17 00:00:00 2001 From: Himanshu Agarwal Date: Fri, 4 May 2018 14:37:48 +0530 Subject: [PATCH 112/187] qcacmn: Add API to stop DBS opportunistic timer Add API to stop DBS opportunistic timer in policy mgr. Change-Id: I11a2b2976c59d7cd09695f90c2d2bdd7338dde54 CRs-Fixed: 2236333 --- inc/wlan_policy_mgr_api.h | 8 ++++++++ src/wlan_policy_mgr_action.c | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 3db7f62741be..9eeb9e08e845 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1134,6 +1134,14 @@ QDF_STATUS policy_mgr_set_connection_update(struct wlan_objmgr_psoc *psoc); */ QDF_STATUS policy_mgr_set_opportunistic_update(struct wlan_objmgr_psoc *psoc); +/** + * policy_mgr_stop_opportunistic_timer() - Stops opportunistic timer + * @psoc: PSOC object information + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_stop_opportunistic_timer(struct wlan_objmgr_psoc *psoc); + /** * policy_mgr_restart_opportunistic_timer() - Restarts opportunistic timer * @psoc: PSOC object information diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index db6e957ad659..9cfa97d85816 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -1117,6 +1117,24 @@ QDF_STATUS policy_mgr_set_opportunistic_update(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_SUCCESS; } +QDF_STATUS policy_mgr_stop_opportunistic_timer(struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *policy_mgr_ctx; + + policy_mgr_ctx = policy_mgr_get_context(psoc); + if (!policy_mgr_ctx) { + policy_mgr_err("Invalid context"); + return QDF_STATUS_E_FAILURE; + } + + if (policy_mgr_ctx->dbs_opportunistic_timer.state != + QDF_TIMER_STATE_RUNNING) + return QDF_STATUS_SUCCESS; + + qdf_mc_timer_stop(&policy_mgr_ctx->dbs_opportunistic_timer); + return QDF_STATUS_SUCCESS; +} + QDF_STATUS policy_mgr_restart_opportunistic_timer( struct wlan_objmgr_psoc *psoc, bool check_state) { From b031fa6e0e6f42f7594bfa85fbae16a7287110aa Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Thu, 15 Feb 2018 14:30:05 -0800 Subject: [PATCH 113/187] qcacmn: Consistently use policy_mgr_dual_mac_config Remove duplicate structs wmi_dual_mac_config and sir_dual_mac_config and use policy_mgr_dual_mac_config. Change-Id: I6da6539f519ec46ee274ba3f3ae042e5fd9c25d2 CRs-Fixed: 2191031 --- inc/wlan_policy_mgr_public_struct.h | 5 ++++- src/wlan_policy_mgr_get_set_utils.c | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index c45f3e63f08d..19ac08d1ebd4 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -788,6 +788,9 @@ enum set_hw_mode_status { SET_HW_MODE_STATUS_ECOEX, }; +typedef void (*dual_mac_cb)(enum set_hw_mode_status status, + uint32_t scan_config, + uint32_t fw_mode_config); /** * enum policy_mgr_hw_mode_change - identify the HW mode switching to. * @@ -895,7 +898,7 @@ struct policy_mgr_vdev_mac_map { struct policy_mgr_dual_mac_config { uint32_t scan_config; uint32_t fw_mode_config; - void *set_dual_mac_cb; + dual_mac_cb set_dual_mac_cb; }; /** diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 9b86fdc7c343..2a7430127d1b 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -884,7 +884,7 @@ void policy_mgr_soc_set_dual_mac_cfg_cb(enum set_hw_mode_status status, uint32_t fw_mode_config) { policy_mgr_debug("Status:%d for scan_config:%x fw_mode_config:%x", - status, scan_config, fw_mode_config); + status, scan_config, fw_mode_config); } void policy_mgr_set_dual_mac_scan_config(struct wlan_objmgr_psoc *psoc, @@ -930,7 +930,7 @@ void policy_mgr_set_dual_mac_scan_config(struct wlan_objmgr_psoc *psoc, return; } - cfg.set_dual_mac_cb = (void *)policy_mgr_soc_set_dual_mac_cfg_cb; + cfg.set_dual_mac_cb = policy_mgr_soc_set_dual_mac_cfg_cb; policy_mgr_debug("scan_config:%x fw_mode_config:%x", cfg.scan_config, cfg.fw_mode_config); @@ -977,7 +977,7 @@ void policy_mgr_set_dual_mac_fw_mode_config(struct wlan_objmgr_psoc *psoc, return; } - cfg.set_dual_mac_cb = (void *)policy_mgr_soc_set_dual_mac_cfg_cb; + cfg.set_dual_mac_cb = policy_mgr_soc_set_dual_mac_cfg_cb; policy_mgr_debug("scan_config:%x fw_mode_config:%x", cfg.scan_config, cfg.fw_mode_config); From f8417d1117822bc05ad9f74a621799c6ba78a504 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Tue, 8 May 2018 15:31:21 -0700 Subject: [PATCH 114/187] qcacmn: Use channel and vdev_id array for get_mode_specific_conn_info Use channel and vdev_id array while calling policy_mgr_get_mode_specific_conn_info. Change-Id: I64579e2b1af0eca47af5292d456367d059a461f5 CRs-Fixed: 2238386 --- src/wlan_policy_mgr_action.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 9cfa97d85816..884c09f53084 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -947,7 +947,9 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( { struct policy_mgr_psoc_priv_obj *pm_ctx; uint32_t mcc_to_scc_switch; - uint8_t operating_channel, vdev_id; + uint8_t operating_channel[MAX_NUMBER_OF_CONC_CONNECTIONS] = {0}; + uint8_t vdev_id[MAX_NUMBER_OF_CONC_CONNECTIONS] = {0}; + uint32_t cc_count = 0; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -955,11 +957,13 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( return; } - if (policy_mgr_get_mode_specific_conn_info(psoc, &operating_channel, - &vdev_id, PM_STA_MODE)) { - policy_mgr_debug("STA operating Channel: %u", - operating_channel); - } else { + /* + * force SCC with STA+STA+SAP will need some additional logic + */ + cc_count = policy_mgr_get_mode_specific_conn_info(psoc, + &operating_channel[cc_count], + &vdev_id[cc_count], PM_STA_MODE); + if (!cc_count) { policy_mgr_err("Could not get STA operating channel&vdevid"); return; } @@ -967,7 +971,7 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( mcc_to_scc_switch = policy_mgr_mcc_to_scc_switch_mode_in_user_cfg(psoc); policy_mgr_info("MCC to SCC switch: %d chan: %d", - mcc_to_scc_switch, operating_channel); + mcc_to_scc_switch, operating_channel[0]); if (!policy_mgr_is_restart_sap_allowed(psoc, mcc_to_scc_switch)) { policy_mgr_debug( @@ -976,7 +980,7 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( } if ((mcc_to_scc_switch != QDF_MCC_TO_SCC_SWITCH_DISABLE) && - policy_mgr_valid_sta_channel_check(psoc, operating_channel) + policy_mgr_valid_sta_channel_check(psoc, operating_channel[0]) && !pm_ctx->sta_ap_intf_check_work_info) { struct sta_ap_intf_check_work_ctx *work_info; work_info = qdf_mem_malloc( From 656fa9a38f626a4e6a5f6addd91ca5cd17693a48 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Sun, 6 May 2018 00:15:04 -0700 Subject: [PATCH 115/187] qcacmn: Fix typo "capabilites" Replace typo "capabilites" with correct spelling "capabilities" Change-Id: I8efa1d974ecabb1466bdf27ec305fd9960da0616 CRs-Fixed: 2238309 --- src/wlan_policy_mgr_get_set_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 2a7430127d1b..6f71a5ffa1a0 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -375,7 +375,7 @@ void policy_mgr_init_dbs_config(struct wlan_objmgr_psoc *psoc, if (DISABLE_DBS_CXN_AND_SCAN == wlan_objmgr_psoc_get_dual_mac_disable(psoc)) { policy_mgr_err("Disabling dual mac capabilities"); - /* All capabilites are initialized to 0. We can return */ + /* All capabilities are initialized to 0. We can return */ goto done; } From 114fe088c9e43b346d093a63c0f5dd0f8556d209 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Sun, 6 May 2018 15:40:42 -0700 Subject: [PATCH 116/187] qcacmn: Fix typo "lenght" Replace typo "lenght" with correct spelling "length". Change-Id: Ieea0c547c61248e510835d16a9fa55ace486df23 CRs-Fixed: 2238309 --- inc/wlan_policy_mgr_api.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 9eeb9e08e845..1efd27777acf 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -303,7 +303,7 @@ uint8_t policy_mgr_get_channel(struct wlan_objmgr_psoc *psoc, * @psoc: PSOC object information * @mode: Device mode * @pcl_channels: PCL channels - * @len: lenght of the PCL + * @len: length of the PCL * @pcl_weight: Weights of the PCL * @weight_len: Max length of the weights list * @@ -532,7 +532,7 @@ bool policy_mgr_is_ibss_conn_exist(struct wlan_objmgr_psoc *psoc, /** * policy_mgr_get_conn_info() - get the current connections list - * @len: lenght of the list + * @len: length of the list * * This function returns a pointer to the current connections * list From a4d1ee9066984f85be25437759f21f6a2ca8acf6 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Sun, 6 May 2018 16:25:49 -0700 Subject: [PATCH 117/187] qcacmn: Fix typo "recieve" Replace typo "recieve" with correct spelling "receive". Change-Id: I7d88e57b97fa6d217630d4a5d5c365b56e714428 CRs-Fixed: 2238309 --- src/wlan_policy_mgr_pcl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 2179993f73c2..465f9f57ac00 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -184,7 +184,7 @@ void policy_mgr_reg_chan_change_callback(struct wlan_objmgr_psoc *psoc, avoid_freq_ind->chan_list.ch_list, pm_ctx->unsafe_channel_count * sizeof(pm_ctx->unsafe_channel_list[0])); - policy_mgr_debug("Channel list update, recieved %d avoided channels", + policy_mgr_debug("Channel list update, received %d avoided channels", pm_ctx->unsafe_channel_count); } From c65c98fb3ee3438c3fd1740bf2f209dc64ec6f5e Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Tue, 24 Apr 2018 20:29:43 -0700 Subject: [PATCH 118/187] qcacmn: umac: Remove legacy markings Per current guidance remove legacy markings. Change-Id: I34c7acfad802a3878ffa373489b7f6a4194abb62 CRs-Fixed: 2230684 --- inc/wlan_policy_mgr_api.h | 9 --------- inc/wlan_policy_mgr_public_struct.h | 9 --------- src/wlan_policy_mgr_action.c | 9 --------- src/wlan_policy_mgr_core.c | 9 --------- src/wlan_policy_mgr_get_set_utils.c | 9 --------- src/wlan_policy_mgr_i.h | 9 --------- src/wlan_policy_mgr_init_deinit.c | 9 --------- src/wlan_policy_mgr_pcl.c | 9 --------- src/wlan_policy_mgr_tables_1x1_dbs_i.h | 9 --------- src/wlan_policy_mgr_tables_2x2_dbs_i.h | 9 --------- src/wlan_policy_mgr_tables_no_dbs_i.h | 9 --------- 11 files changed, 99 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 1efd27777acf..32b30d2f9e7f 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __WLAN_POLICY_MGR_API_H #define __WLAN_POLICY_MGR_API_H diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 19ac08d1ebd4..7bf2f876ec83 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __WLAN_POLICY_MGR_PUBLIC_STRUCT_H #define __WLAN_POLICY_MGR_PUBLIC_STRUCT_H diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 884c09f53084..e8fefe16ae1c 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_policy_mgr_action.c * diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index b6569e589173..46415feef511 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_policy_mgr_core.c * diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 6f71a5ffa1a0..a8df535e0761 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_policy_mgr_get_set_utils.c * diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 6f8b1fe36992..6e305fac1088 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef WLAN_POLICY_MGR_I_H #define WLAN_POLICY_MGR_I_H diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 4e97913bf306..14f82aae1418 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_policy_mgr_init_deinit.c * diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 465f9f57ac00..8c413e4fd0df 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_policy_mgr_pcl.c * diff --git a/src/wlan_policy_mgr_tables_1x1_dbs_i.h b/src/wlan_policy_mgr_tables_1x1_dbs_i.h index c12ab33993f4..92501e8872ce 100644 --- a/src/wlan_policy_mgr_tables_1x1_dbs_i.h +++ b/src/wlan_policy_mgr_tables_1x1_dbs_i.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __WLAN_POLICY_MGR_TABLES_1X1_DBS_H #define __WLAN_POLICY_MGR_TABLES_1X1_DBS_H diff --git a/src/wlan_policy_mgr_tables_2x2_dbs_i.h b/src/wlan_policy_mgr_tables_2x2_dbs_i.h index 815bdd5d10a6..dd11a9faea0a 100644 --- a/src/wlan_policy_mgr_tables_2x2_dbs_i.h +++ b/src/wlan_policy_mgr_tables_2x2_dbs_i.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __WLAN_POLICY_MGR_TABLES_2X2_DBS_H #define __WLAN_POLICY_MGR_TABLES_2X2_DBS_H diff --git a/src/wlan_policy_mgr_tables_no_dbs_i.h b/src/wlan_policy_mgr_tables_no_dbs_i.h index b0119950f73c..204185247d07 100644 --- a/src/wlan_policy_mgr_tables_no_dbs_i.h +++ b/src/wlan_policy_mgr_tables_no_dbs_i.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __WLAN_POLICY_MGR_TABLES_NO_DBS_H #define __WLAN_POLICY_MGR_TABLES_NO_DBS_H From ee56b4491c3f449d40fbb6ce4f51e39edeec8c1d Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Sun, 20 May 2018 11:29:42 -0700 Subject: [PATCH 119/187] qcacmn: Replace new instances of tQDF_ADAPTER_MODE Previously change "qcacmn: Use enum QDF_OPMODE", Change-Id Ic6f663dac11a100f168b2626c7c0fbcaccbfca4f, replaced all instances of tQDF_ADAPTER_MODE to QDF_OPMODE in the qca-wifi-host-cmn project. However since tQDF_ADAPTER_MODE was originally defined in a common project, and not all references to it could be immediately removed, a legacy definition was left with the expectation that it would be removed when all references to it had been updated. Unfortunately new instances of using tQDF_ADAPTER_MODE have been subsequently added to the project, so replace them with QDF_OPMODE. Change-Id: I71cead84151cc0411f7cc5cc13a87a281e7502c0 CRs-Fixed: 2245249 --- inc/wlan_policy_mgr_api.h | 2 +- src/wlan_policy_mgr_action.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 32b30d2f9e7f..044708767b71 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -827,7 +827,7 @@ struct policy_mgr_hdd_cbacks { enum policy_mgr_con_mode (*get_mode_for_non_connected_vdev)( struct wlan_objmgr_psoc *psoc, uint8_t vdev_id); - enum tQDF_ADAPTER_MODE (*hdd_get_device_mode)(uint32_t session_id); + enum QDF_OPMODE (*hdd_get_device_mode)(uint32_t session_id); }; diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index e8fefe16ae1c..b50712b35d4d 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -362,7 +362,7 @@ static bool policy_mgr_is_dbs_allowed_for_concurrency( { struct policy_mgr_psoc_priv_obj *pm_ctx; uint32_t count, dbs_for_sta_sta, dbs_for_sta_p2p; - enum tQDF_ADAPTER_MODE new_conn_mode = QDF_MAX_NO_OF_MODE; + enum QDF_OPMODE new_conn_mode = QDF_MAX_NO_OF_MODE; bool ret = true; pm_ctx = policy_mgr_get_context(psoc); From 3688381753552302230d5b49a795832b3351ab9b Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Thu, 3 May 2018 15:06:44 -0700 Subject: [PATCH 120/187] qcacmn: Pass the arg by reference while calling sme_pdev_set_pcl() While calling sme_pdev_set_pcl() API, driver is passing the argument by value. The size of the argument is 280 bytes which is not good design. Pass the argument by reference instead of passing it by value to make design simple. CRs-Fixed: 2238293 Change-Id: I92849fb125fe864c1c7c7977bce392a7bcfe4121 --- inc/wlan_policy_mgr_api.h | 2 +- src/wlan_policy_mgr_core.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 044708767b71..38c84cb7cff2 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -792,7 +792,7 @@ struct policy_mgr_sme_cbacks { QDF_STATUS (*sme_soc_set_dual_mac_config)( struct policy_mgr_dual_mac_config msg); QDF_STATUS (*sme_pdev_set_hw_mode)(struct policy_mgr_hw_mode msg); - QDF_STATUS (*sme_pdev_set_pcl)(struct policy_mgr_pcl_list msg); + QDF_STATUS (*sme_pdev_set_pcl)(struct policy_mgr_pcl_list *msg); QDF_STATUS (*sme_nss_update_request)(uint32_t vdev_id, uint8_t new_nss, policy_mgr_nss_update_cback cback, uint8_t next_action, struct wlan_objmgr_psoc *psoc, diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 46415feef511..30c604cb5285 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -1199,7 +1199,7 @@ void policy_mgr_pdev_set_pcl(struct wlan_objmgr_psoc *psoc, return; } - status = pm_ctx->sme_cbacks.sme_pdev_set_pcl(pcl); + status = pm_ctx->sme_cbacks.sme_pdev_set_pcl(&pcl); if (status != QDF_STATUS_SUCCESS) policy_mgr_err("Send soc set PCL to SME failed"); else From 7f8d1df7e9fdca66bb5a5e61d038d991f67735d5 Mon Sep 17 00:00:00 2001 From: Zhu Jianmin Date: Thu, 19 Apr 2018 17:55:30 +0800 Subject: [PATCH 121/187] qcacmn: Check chip capability when enable AP+AP Check capability of dbs, mcc and scc on single band when enable AP+AP, then same driver code can support different chip and firmware. Add wmi_service_dual_beacon_on_single_mac_(mcc/scc)_support Change-Id: I505747122504b2a89813e7bdfcd27dc07539f39e CRs-Fixed: 2214237 --- inc/wlan_policy_mgr_api.h | 35 ++++++++ src/wlan_policy_mgr_get_set_utils.c | 119 ++++++++++++++++++++++++++++ 2 files changed, 154 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 38c84cb7cff2..22e1f7b38ee8 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -2297,4 +2297,39 @@ QDF_STATUS policy_mgr_register_mode_change_cb(struct wlan_objmgr_psoc *psoc, */ QDF_STATUS policy_mgr_deregister_mode_change_cb(struct wlan_objmgr_psoc *psoc); +/** + * policy_mgr_allow_sap_go_concurrency() - check whether multiple SAP/GO + * interfaces are allowed + * @psoc: pointer to soc + * @policy_mgr_con_mode: operating mode of the new interface + * @channel: operating channel of the new interface + * This function checks whether second SAP/GO interface is allowed on the same + * MAC. + * + * Return: true or false + */ +bool policy_mgr_allow_sap_go_concurrency(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint8_t channel); + +/** + * policy_mgr_dual_beacon_on_single_mac_scc_capable() - get capability that + * whether support dual beacon on same channel on single MAC + * @psoc: pointer to soc + * + * Return: bool: capable + */ +bool policy_mgr_dual_beacon_on_single_mac_scc_capable( + struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_dual_beacon_on_single_mac_mcc_capable() - get capability that + * whether support dual beacon on different channel on single MAC + * @psoc: pointer to soc + * + * Return: bool: capable + */ +bool policy_mgr_dual_beacon_on_single_mac_mcc_capable( + struct wlan_objmgr_psoc *psoc); + #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index a8df535e0761..68f87c0a6dce 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1693,6 +1693,11 @@ bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, } } + if (!policy_mgr_allow_sap_go_concurrency(psoc, mode, channel)) { + policy_mgr_err("This concurrency combination is not allowed"); + goto done; + } + /* don't allow two P2P GO on same band */ if (channel && (mode == PM_P2P_GO_MODE) && num_connections) { index = 0; @@ -2950,3 +2955,117 @@ uint32_t policy_mgr_get_connection_info(struct wlan_objmgr_psoc *psoc, return count; } + +bool policy_mgr_allow_sap_go_concurrency(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint8_t channel) +{ + uint32_t sap_cnt; + uint32_t go_cnt; + enum policy_mgr_con_mode con_mode; + uint8_t con_chan; + int id; + + sap_cnt = policy_mgr_mode_specific_connection_count(psoc, + PM_SAP_MODE, + NULL); + go_cnt = policy_mgr_mode_specific_connection_count(psoc, + PM_P2P_GO_MODE, + NULL); + + if ((mode == PM_SAP_MODE || mode == PM_P2P_GO_MODE) && + (sap_cnt || go_cnt)) { + if (policy_mgr_dual_beacon_on_single_mac_mcc_capable(psoc)) + return true; + if (policy_mgr_dual_beacon_on_single_mac_scc_capable(psoc)) { + for (id = 0; id < MAX_NUMBER_OF_CONC_CONNECTIONS; + id++) { + if (pm_conc_connection_list[id].in_use) { + con_mode = + pm_conc_connection_list[id].mode; + con_chan = + pm_conc_connection_list[id].chan; + if (((con_mode == PM_SAP_MODE) || + (con_mode == PM_P2P_GO_MODE)) && + (channel != con_chan)) { + policy_mgr_debug("Scc is supported, but first SAP and second SAP are not in same channel, So don't allow second SAP interface"); + return false; + } + } + } + return true; + } + if (!policy_mgr_is_hw_dbs_capable(psoc)) { + policy_mgr_debug("DBS is not supported, mcc and scc are not supported too, don't allow second SAP interface"); + return false; + } + /* If DBS is supported then allow second SAP/GO session only if + * the freq band of the second SAP/GO interface is different + * than the first SAP/GO interface. + */ + for (id = 0; id < MAX_NUMBER_OF_CONC_CONNECTIONS; id++) { + if (pm_conc_connection_list[id].in_use) { + con_mode = pm_conc_connection_list[id].mode; + con_chan = pm_conc_connection_list[id].chan; + if (((con_mode == PM_SAP_MODE) || + (con_mode == PM_P2P_GO_MODE)) && + (WLAN_REG_IS_SAME_BAND_CHANNELS(channel, + con_chan))) { + policy_mgr_debug("DBS is supported, but first SAP and second SAP are on same band, So don't allow second SAP interface"); + return false; + } + } + } + } + + /* Don't block the second interface */ + return true; +} + +bool policy_mgr_dual_beacon_on_single_mac_scc_capable( + struct wlan_objmgr_psoc *psoc) +{ + void *wmi_handle = NULL; + + wmi_handle = GET_WMI_HDL_FROM_PSOC(psoc); + if (!wmi_handle) { + policy_mgr_debug("Invalid WMI handle"); + return false; + } + + if (wmi_service_enabled( + wmi_handle, + wmi_service_dual_beacon_on_single_mac_scc_support)) { + policy_mgr_debug("Support dual beacon on same channel on single MAC"); + return true; + } + if (wmi_service_enabled( + wmi_handle, + wmi_service_dual_beacon_on_single_mac_mcc_support)) { + policy_mgr_debug("Support dual beacon on both different and same channel on single MAC"); + return true; + } + policy_mgr_debug("Not support dual beacon on same channel on single MAC"); + return false; +} + +bool policy_mgr_dual_beacon_on_single_mac_mcc_capable( + struct wlan_objmgr_psoc *psoc) +{ + void *wmi_handle = NULL; + + wmi_handle = GET_WMI_HDL_FROM_PSOC(psoc); + if (!wmi_handle) { + policy_mgr_debug("Invalid WMI handle"); + return false; + } + + if (wmi_service_enabled( + wmi_handle, + wmi_service_dual_beacon_on_single_mac_mcc_support)) { + policy_mgr_debug("Support dual beacon on different channel on single MAC"); + return true; + } + policy_mgr_debug("Not support dual beacon on different channel on single MAC"); + return false; +} From cdf1813b35a57f6fd2a4bc86c61d322f1e49fe02 Mon Sep 17 00:00:00 2001 From: Manjunathappa Prakash Date: Tue, 8 May 2018 19:55:25 -0700 Subject: [PATCH 122/187] qcacmn: Add DP callbacks for flow_pool create and delete Current lithim_dp flow pool created in wma_vdev_start, wma_vdev_start is called for same vdev multiple times for vdev. This leads to creation of multiple flow pools for each vdev. Instead create from policy_manager when session become active. Register flow pool create/delete callbacks with policy manager. So that lithium_dp vdev flow pools are created/deleted when vdev become active/not-active. Change-Id: Iaf6aaece47c79c7e6f7745feaee35a6bc5cd1297 CRs-Fixed: 2231601 --- inc/wlan_policy_mgr_api.h | 4 ++++ src/wlan_policy_mgr_get_set_utils.c | 5 +++++ src/wlan_policy_mgr_init_deinit.c | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 22e1f7b38ee8..3ba1cce50467 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -858,11 +858,15 @@ struct policy_mgr_cdp_cbacks { * @hdd_disable_rx_ol_in_concurrency: Callback to disable LRO/GRO offloads * @hdd_set_rx_mode_rps_cb: Callback to set RPS * @hdd_ipa_set_mcc_mode_cb: Callback to set mcc mode for ipa module + * @hdd_v2_flow_pool_map: Callback to create vdev flow pool + * @hdd_v2_flow_pool_unmap: Callback to delete vdev flow pool */ struct policy_mgr_dp_cbacks { void (*hdd_disable_rx_ol_in_concurrency)(bool); void (*hdd_set_rx_mode_rps_cb)(bool); void (*hdd_ipa_set_mcc_mode_cb)(bool); + void (*hdd_v2_flow_pool_map)(int); + void (*hdd_v2_flow_pool_unmap)(int); }; /** diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 68f87c0a6dce..e76057c32e63 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1122,6 +1122,8 @@ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, break; } + if (pm_ctx->dp_cbacks.hdd_v2_flow_pool_map) + pm_ctx->dp_cbacks.hdd_v2_flow_pool_map(session_id); policy_mgr_debug("No.# of active sessions for mode %d = %d", mode, pm_ctx->no_of_active_sessions[mode]); @@ -1212,6 +1214,9 @@ QDF_STATUS policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, break; } + if (pm_ctx->dp_cbacks.hdd_v2_flow_pool_unmap) + pm_ctx->dp_cbacks.hdd_v2_flow_pool_unmap(session_id); + policy_mgr_debug("No.# of active sessions for mode %d = %d", mode, pm_ctx->no_of_active_sessions[mode]); diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 14f82aae1418..d6a198932aa2 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -642,6 +642,10 @@ QDF_STATUS policy_mgr_register_dp_cb(struct wlan_objmgr_psoc *psoc, dp_cbacks->hdd_set_rx_mode_rps_cb; pm_ctx->dp_cbacks.hdd_ipa_set_mcc_mode_cb = dp_cbacks->hdd_ipa_set_mcc_mode_cb; + pm_ctx->dp_cbacks.hdd_v2_flow_pool_map = + dp_cbacks->hdd_v2_flow_pool_map; + pm_ctx->dp_cbacks.hdd_v2_flow_pool_unmap = + dp_cbacks->hdd_v2_flow_pool_unmap; return QDF_STATUS_SUCCESS; } From b7f839694abe65c11553f3f2f489166d3891ab7e Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Thu, 14 Jun 2018 17:56:38 -0700 Subject: [PATCH 123/187] qcacmn: Restrict the force SCC logic for STA+SAP only Restrict the force SCC logic for STA+SAP only unless ini is set for QDF_MCC_TO_SCC_SWITCH_FORCE_PREFERRED_WITHOUT_DISCONNECTION. Change-Id: If2c4c285b92ea5eba69679561c32875cff5f7b08 CRs-Fixed: 2261717 --- src/wlan_policy_mgr_action.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index b50712b35d4d..553356679170 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -701,8 +701,10 @@ static bool policy_mgr_is_restart_sap_allowed( !policy_mgr_concurrent_open_sessions_running(psoc) || !(((policy_mgr_get_concurrency_mode(psoc) & sta_ap_bit_mask) == sta_ap_bit_mask) || + ((mcc_to_scc_switch == + QDF_MCC_TO_SCC_SWITCH_FORCE_PREFERRED_WITHOUT_DISCONNECTION) && ((policy_mgr_get_concurrency_mode(psoc) & sta_go_bit_mask) - == sta_go_bit_mask))) { + == sta_go_bit_mask)))) { policy_mgr_err("MCC switch disabled or not concurrent STA/SAP, STA/GO"); return false; } From 5ac66ef3f786b75105620d80e7dc8d89a6f5861a Mon Sep 17 00:00:00 2001 From: Zhu Jianmin Date: Mon, 11 Jun 2018 19:03:39 +0800 Subject: [PATCH 124/187] qcacmn: ini parameter to allow STA+SAP SCC on LTE coex channel When Force SCC and STA+SAP SCC on LTE coex channel are enabled: 1. When STA on LTE coex channel, start SAP, select STA channel. 2. When SAP on, connect STA on LTE coex channel, then switch SAP channel to STA channel. Change-Id: I7864e0ab2655c3bee95154ea4dedfb60fe8689e4 CRs-Fixed: 2261226 --- inc/wlan_policy_mgr_api.h | 10 ++++++++++ inc/wlan_policy_mgr_public_struct.h | 1 + src/wlan_policy_mgr_action.c | 5 +++-- src/wlan_policy_mgr_get_set_utils.c | 13 +++++++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 3ba1cce50467..7ddc73f0f8f6 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -2336,4 +2336,14 @@ bool policy_mgr_dual_beacon_on_single_mac_scc_capable( bool policy_mgr_dual_beacon_on_single_mac_mcc_capable( struct wlan_objmgr_psoc *psoc); +/** + * policy_mgr_sta_sap_scc_on_lte_coex_chan() - get capability that + * whether support sta sap scc on lte coex chan + * @psoc: pointer to soc + * + * Return: bool: capable + */ +bool policy_mgr_sta_sap_scc_on_lte_coex_chan( + struct wlan_objmgr_psoc *psoc); + #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 7bf2f876ec83..2d7f61042574 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -1024,6 +1024,7 @@ struct policy_mgr_user_cfg { bool sub_20_mhz_enabled; bool is_sta_sap_scc_allowed_on_dfs_chan; uint32_t channel_select_logic_conc; + uint32_t sta_sap_scc_on_lte_coex_chan; }; /** diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 553356679170..c000c8a93657 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -887,9 +887,10 @@ QDF_STATUS policy_mgr_valid_sap_conc_channel_check( if (policy_mgr_valid_sta_channel_check(psoc, channel)) { if (wlan_reg_is_dfs_ch(pm_ctx->pdev, channel) || - wlan_reg_is_passive_or_disable_ch( + wlan_reg_is_passive_or_disable_ch( pm_ctx->pdev, channel) || - !policy_mgr_is_safe_channel(psoc, channel)) { + !(policy_mgr_sta_sap_scc_on_lte_coex_chan(psoc) || + policy_mgr_is_safe_channel(psoc, channel))) { if (policy_mgr_is_hw_dbs_capable(psoc)) { temp_channel = policy_mgr_get_alternate_channel_for_sap(psoc); diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index e76057c32e63..b733b71abfa5 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -3074,3 +3074,16 @@ bool policy_mgr_dual_beacon_on_single_mac_mcc_capable( policy_mgr_debug("Not support dual beacon on different channel on single MAC"); return false; } + +bool policy_mgr_sta_sap_scc_on_lte_coex_chan( + struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return false; + } + return pm_ctx->user_cfg.sta_sap_scc_on_lte_coex_chan; +} From 06a4e7c57e54b6bbdb137a6f552d69d665513c31 Mon Sep 17 00:00:00 2001 From: Bala Venkatesh Date: Sat, 9 Jun 2018 20:19:18 +0530 Subject: [PATCH 125/187] qcacmn: Skip CAC and ignore radar indication for SAP If STA is already connected on DFS channel and SAP is going to start on the same channel then skip the CAC for SAP. If STA and SAP sessions are already operating on same DFS channel, then ignore radar indication received on SAP interface. CRs-Fixed: 2262494 Change-Id: Ife0ab6979a07c8773001a43f5a30c9a555dab37a --- src/wlan_policy_mgr_core.c | 20 +++++++++++++------- src/wlan_policy_mgr_get_set_utils.c | 9 ++++++++- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 30c604cb5285..1c0739a21e6e 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -1733,7 +1733,7 @@ void policy_mgr_set_weight_of_dfs_passive_channels_to_zero( { uint8_t i; uint32_t orig_channel_count = 0; - bool mcc_to_scc_mode; + bool sta_sap_scc_on_dfs_chan; uint32_t sap_count; enum channel_state channel_state; struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -1744,13 +1744,14 @@ void policy_mgr_set_weight_of_dfs_passive_channels_to_zero( return; } - mcc_to_scc_mode = policy_mgr_is_force_scc(psoc); + sta_sap_scc_on_dfs_chan = + policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan(psoc); sap_count = policy_mgr_mode_specific_connection_count(psoc, PM_SAP_MODE, NULL); - policy_mgr_debug("mcc_to_scc_mode %u, sap_count %u", mcc_to_scc_mode, - sap_count); + policy_mgr_debug("sta_sap_scc_on_dfs_chan %u, sap_count %u", + sta_sap_scc_on_dfs_chan, sap_count); - if (!mcc_to_scc_mode || !sap_count) + if (!sta_sap_scc_on_dfs_chan || !sap_count) return; if (len) @@ -1810,6 +1811,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, bool skip_dfs_channel = false; uint32_t i = 0, j = 0; struct policy_mgr_psoc_priv_obj *pm_ctx; + bool sta_sap_scc_on_dfs_chan; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -1844,9 +1846,13 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, * if you have atleast one STA connection then don't fill DFS channels * in the preferred channel list */ - if (((mode == PM_SAP_MODE) || (mode == PM_P2P_GO_MODE)) && + sta_sap_scc_on_dfs_chan = + policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan(psoc); + policy_mgr_debug("sta_sap_scc_on_dfs_chan %u", sta_sap_scc_on_dfs_chan); + if ((((mode == PM_SAP_MODE) || (mode == PM_P2P_GO_MODE)) && (policy_mgr_mode_specific_connection_count( - psoc, PM_STA_MODE, NULL) > 0)) { + psoc, PM_STA_MODE, NULL) > 0)) || + !sta_sap_scc_on_dfs_chan) { policy_mgr_debug("STA present, skip DFS channels from pcl for SAP/Go"); skip_dfs_channel = true; } diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index b733b71abfa5..fc5a0564e1b4 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1540,6 +1540,7 @@ bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, struct policy_mgr_psoc_priv_obj *pm_ctx; QDF_STATUS ret; struct policy_mgr_pcl_list pcl; + bool sta_sap_scc_on_dfs_chan; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -1594,7 +1595,13 @@ bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, channel, list, PM_SAP_MODE)) goto done; - if ((PM_P2P_GO_MODE == mode) || (PM_SAP_MODE == mode)) { + sta_sap_scc_on_dfs_chan = + policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan(psoc); + policy_mgr_debug("sta_sap_scc_on_dfs_chan %u", + sta_sap_scc_on_dfs_chan); + + if (!sta_sap_scc_on_dfs_chan && ((mode == PM_P2P_GO_MODE) || + (mode == PM_SAP_MODE))) { if (wlan_reg_is_dfs_ch(pm_ctx->pdev, channel)) match = policy_mgr_disallow_mcc(psoc, channel); } From 28477d3975991b18b9e509c263f0cca13f6c0096 Mon Sep 17 00:00:00 2001 From: Bala Venkatesh Date: Mon, 7 May 2018 21:35:55 +0530 Subject: [PATCH 126/187] qcacmn: Populate PCL list correctly using channel select logic ini Currently, PCL list is populated without checking channel select logic ini. Check for channel select logic ini before selecting the second connection pcl table. Change-Id: I5a64d4ff43a7dcc2c70eac75b51d5f87de2903bb CRs-FIxed: 2237403 --- inc/wlan_policy_mgr_api.h | 27 +++++++++++++++ src/wlan_policy_mgr_action.c | 24 ++++++++----- src/wlan_policy_mgr_core.c | 22 ++---------- src/wlan_policy_mgr_get_set_utils.c | 52 +++++++++++++++++------------ src/wlan_policy_mgr_pcl.c | 10 ++++-- 5 files changed, 84 insertions(+), 51 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 7ddc73f0f8f6..0244b1498aa9 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -508,6 +508,19 @@ QDF_STATUS policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc, uint32_t session_id, uint8_t channel, enum policy_mgr_conn_update_reason); +/** + * policy_mgr_is_dbs_allowed_for_concurrency() - If dbs is allowed for current + * concurreny + * @new_conn_mode: new connection mode + * + * When a new connection is about to come up, check if dbs is allowed for + * STA+STA or STA+P2P + * + * Return: true if dbs is allowed for STA+STA or STA+P2P else false + */ +bool policy_mgr_is_dbs_allowed_for_concurrency( + struct wlan_objmgr_psoc *psoc, enum QDF_OPMODE new_conn_mode); + /** * policy_mgr_is_ibss_conn_exist() - to check if IBSS connection already present * @psoc: PSOC object information @@ -677,6 +690,20 @@ static inline QDF_STATUS policy_mgr_decr_connection_count_utfw( enum policy_mgr_con_mode policy_mgr_convert_device_mode_to_qdf_type( enum QDF_OPMODE device_mode); +/** + * policy_mgr_get_qdf_mode_from_pm - provides the + * type translation from policy manager type + * to generic connection mode type + * @device_mode: policy manager mode type + * + * + * This function provides the type translation + * + * Return: QDF_OPMODE enum + */ +enum QDF_OPMODE policy_mgr_get_qdf_mode_from_pm( + enum policy_mgr_con_mode device_mode); + /** * policy_mgr_pdev_set_hw_mode() - Set HW mode command to FW * @psoc: PSOC object information diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index c000c8a93657..4cbffd08431c 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -357,12 +357,11 @@ QDF_STATUS policy_mgr_update_and_wait_for_connection_update( * * Return: true if dbs is allowed for STA+STA or STA+P2P else false */ -static bool policy_mgr_is_dbs_allowed_for_concurrency( - struct wlan_objmgr_psoc *psoc, uint32_t session_id) +bool policy_mgr_is_dbs_allowed_for_concurrency( + struct wlan_objmgr_psoc *psoc, enum QDF_OPMODE new_conn_mode) { struct policy_mgr_psoc_priv_obj *pm_ctx; uint32_t count, dbs_for_sta_sta, dbs_for_sta_p2p; - enum QDF_OPMODE new_conn_mode = QDF_MAX_NO_OF_MODE; bool ret = true; pm_ctx = policy_mgr_get_context(psoc); @@ -372,9 +371,6 @@ static bool policy_mgr_is_dbs_allowed_for_concurrency( } count = policy_mgr_get_connection_count(psoc); - if (pm_ctx->hdd_cbacks.hdd_get_device_mode) - new_conn_mode = pm_ctx->hdd_cbacks. - hdd_get_device_mode(session_id); if (count != 1 || new_conn_mode == QDF_MAX_NO_OF_MODE) return ret; @@ -430,6 +426,8 @@ QDF_STATUS policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc, enum policy_mgr_two_connection_mode third_index = 0; enum policy_mgr_band band; QDF_STATUS status = QDF_STATUS_E_FAILURE; + struct policy_mgr_psoc_priv_obj *pm_ctx; + enum QDF_OPMODE new_conn_mode = QDF_MAX_NO_OF_MODE; if (policy_mgr_is_hw_dbs_capable(psoc) == false) { policy_mgr_err("driver isn't dbs capable, no further action needed"); @@ -483,6 +481,16 @@ QDF_STATUS policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc, break; } + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + goto done; + } + + if (pm_ctx->hdd_cbacks.hdd_get_device_mode) + new_conn_mode = pm_ctx->hdd_cbacks. + hdd_get_device_mode(session_id); + /* * Based on channel_select_logic_conc ini, hw mode is set * when second connection is about to come up that results @@ -493,10 +501,10 @@ QDF_STATUS policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc, * mode change is not required. */ if (policy_mgr_is_current_hwmode_dbs(psoc) && - !policy_mgr_is_dbs_allowed_for_concurrency(psoc, session_id)) + !policy_mgr_is_dbs_allowed_for_concurrency(psoc, new_conn_mode)) next_action = PM_SINGLE_MAC; else if (!policy_mgr_is_current_hwmode_dbs(psoc) && - !policy_mgr_is_dbs_allowed_for_concurrency(psoc, session_id)) + !policy_mgr_is_dbs_allowed_for_concurrency(psoc, new_conn_mode)) next_action = PM_NOP; if (PM_NOP != next_action) diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 1c0739a21e6e..a0b1643d6c81 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -1206,7 +1206,6 @@ void policy_mgr_pdev_set_pcl(struct wlan_objmgr_psoc *psoc, policy_mgr_debug("Set PCL to FW for mode:%d", mode); } - /** * policy_mgr_set_pcl_for_existing_combo() - Set PCL for existing connection * @mode: Connection mode of type 'policy_mgr_con_mode' @@ -1230,26 +1229,9 @@ void policy_mgr_set_pcl_for_existing_combo( return; } - switch (mode) { - case PM_STA_MODE: - pcl_mode = QDF_STA_MODE; - break; - case PM_SAP_MODE: - pcl_mode = QDF_SAP_MODE; - break; - case PM_P2P_CLIENT_MODE: - pcl_mode = QDF_P2P_CLIENT_MODE; - break; - case PM_P2P_GO_MODE: - pcl_mode = QDF_P2P_GO_MODE; - break; - case PM_IBSS_MODE: - pcl_mode = QDF_IBSS_MODE; - break; - default: - policy_mgr_err("Invalid mode to set PCL"); + pcl_mode = policy_mgr_get_qdf_mode_from_pm(mode); + if (pcl_mode == QDF_MAX_NO_OF_MODE) return; - }; qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); if (policy_mgr_mode_specific_connection_count(psoc, mode, NULL) > 0) { /* Check, store and temp delete the mode's parameter */ diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index fc5a0564e1b4..c43a06f0d489 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2079,6 +2079,34 @@ enum policy_mgr_con_mode policy_mgr_convert_device_mode_to_qdf_type( return mode; } +enum QDF_OPMODE policy_mgr_get_qdf_mode_from_pm( + enum policy_mgr_con_mode device_mode) +{ + enum QDF_OPMODE mode = QDF_MAX_NO_OF_MODE; + + switch (device_mode) { + case PM_STA_MODE: + mode = QDF_STA_MODE; + break; + case PM_SAP_MODE: + mode = QDF_SAP_MODE; + break; + case PM_P2P_CLIENT_MODE: + mode = QDF_P2P_CLIENT_MODE; + break; + case PM_P2P_GO_MODE: + mode = QDF_P2P_GO_MODE; + break; + case PM_IBSS_MODE: + mode = QDF_IBSS_MODE; + break; + default: + policy_mgr_err("Unsupported policy mgr mode (%d)", + device_mode); + } + return mode; +} + QDF_STATUS policy_mgr_mode_specific_num_open_sessions( struct wlan_objmgr_psoc *psoc, enum QDF_OPMODE mode, uint8_t *num_sessions) @@ -2265,27 +2293,9 @@ QDF_STATUS policy_mgr_get_nss_for_vdev(struct wlan_objmgr_psoc *psoc, enum QDF_OPMODE dev_mode; struct policy_mgr_psoc_priv_obj *pm_ctx; - switch (mode) { - case PM_STA_MODE: - dev_mode = QDF_STA_MODE; - break; - case PM_SAP_MODE: - dev_mode = QDF_SAP_MODE; - break; - case PM_P2P_CLIENT_MODE: - dev_mode = QDF_P2P_CLIENT_MODE; - break; - case PM_P2P_GO_MODE: - dev_mode = QDF_P2P_GO_MODE; - break; - case PM_IBSS_MODE: - dev_mode = QDF_IBSS_MODE; - break; - default: - policy_mgr_err("Invalid mode to get allowed NSS value"); - return QDF_STATUS_E_FAILURE; - }; - + dev_mode = policy_mgr_get_qdf_mode_from_pm(mode); + if (dev_mode == QDF_MAX_NO_OF_MODE) + return QDF_STATUS_E_FAILURE; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { policy_mgr_err("Invalid Context"); diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 8c413e4fd0df..0dab0d739a6d 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -476,7 +476,7 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, enum policy_mgr_pcl_type pcl = PM_NONE; enum policy_mgr_conc_priority_mode conc_system_pref = 0; struct policy_mgr_psoc_priv_obj *pm_ctx; - + enum QDF_OPMODE qdf_mode; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { policy_mgr_err("context is NULL"); @@ -522,7 +522,13 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, policy_mgr_err("couldn't find index for 2nd connection pcl table"); return status; } - if (policy_mgr_is_hw_dbs_capable(psoc) == true) { + qdf_mode = policy_mgr_get_qdf_mode_from_pm(mode); + if (qdf_mode == QDF_MAX_NO_OF_MODE) + return status; + + if (policy_mgr_is_hw_dbs_capable(psoc) == true && + policy_mgr_is_dbs_allowed_for_concurrency( + psoc, qdf_mode)) { pcl = (*second_connection_pcl_dbs_table) [second_index][mode][conc_system_pref]; } else { From a02444a20634c89c972a92bb56bbeea1e3a5c442 Mon Sep 17 00:00:00 2001 From: Dundi Raviteja Date: Mon, 18 Jun 2018 11:57:37 +0530 Subject: [PATCH 127/187] qcacmn: Incorrect usage of QDF_ARRAY_SIZE macro In some use cases of QDF_ARRAY_SIZE macro, the argument passing to it is a pointer instead of array which leads to getting incorrect array size. Current implementation of updating main arrays pcl_list_org and weight_list_org is inefficient. So, update the main arrays directly, instead of copying the data to local arrays and again updating the main arrays. Change-Id: I9a4a7fa813412fd000ce55d2a958e49ab1b02ed5 CRs-Fixed: 2262231 --- src/wlan_policy_mgr_pcl.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 0dab0d739a6d..b122d2130cbb 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -248,21 +248,14 @@ static QDF_STATUS policy_mgr_modify_pcl_based_on_enabled_channels( uint32_t *pcl_len_org) { uint32_t i, pcl_len = 0; - uint8_t pcl_list[QDF_MAX_NUM_CHAN]; - uint8_t weight_list[QDF_MAX_NUM_CHAN]; for (i = 0; i < *pcl_len_org; i++) { if (!wlan_reg_is_passive_or_disable_ch( pm_ctx->pdev, pcl_list_org[i])) { - pcl_list[pcl_len] = pcl_list_org[i]; - weight_list[pcl_len++] = weight_list_org[i]; + pcl_list_org[pcl_len] = pcl_list_org[i]; + weight_list_org[pcl_len++] = weight_list_org[i]; } } - - qdf_mem_zero(pcl_list_org, QDF_ARRAY_SIZE(pcl_list_org)); - qdf_mem_zero(weight_list_org, QDF_ARRAY_SIZE(weight_list_org)); - qdf_mem_copy(pcl_list_org, pcl_list, pcl_len); - qdf_mem_copy(weight_list_org, weight_list, pcl_len); *pcl_len_org = pcl_len; return QDF_STATUS_SUCCESS; @@ -1517,8 +1510,6 @@ QDF_STATUS policy_mgr_modify_sap_pcl_based_on_mandatory_channel( uint32_t *pcl_len_org) { uint32_t i, j, pcl_len = 0; - uint8_t pcl_list[QDF_MAX_NUM_CHAN]; - uint8_t weight_list[QDF_MAX_NUM_CHAN]; bool found; struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -1555,15 +1546,10 @@ QDF_STATUS policy_mgr_modify_sap_pcl_based_on_mandatory_channel( } } if (found && (pcl_len < QDF_MAX_NUM_CHAN)) { - pcl_list[pcl_len] = pcl_list_org[i]; - weight_list[pcl_len++] = weight_list_org[i]; + pcl_list_org[pcl_len] = pcl_list_org[i]; + weight_list_org[pcl_len++] = weight_list_org[i]; } } - - qdf_mem_zero(pcl_list_org, QDF_ARRAY_SIZE(pcl_list_org)); - qdf_mem_zero(weight_list_org, QDF_ARRAY_SIZE(weight_list_org)); - qdf_mem_copy(pcl_list_org, pcl_list, pcl_len); - qdf_mem_copy(weight_list_org, weight_list, pcl_len); *pcl_len_org = pcl_len; return QDF_STATUS_SUCCESS; From 7c96e54a19e7711c0aeec1cf3abd8879c02d5c13 Mon Sep 17 00:00:00 2001 From: Bala Venkatesh Date: Thu, 7 Jun 2018 19:32:27 +0530 Subject: [PATCH 128/187] qcacmn: Allow SAP to move from one DFS chan to another DFS chan Allow the SAP to move from DFS channel to another DFS channel in STA+SAP SCC concurrency scenario. CRs-Fixed: 2263031 Change-Id: I3d1f5e57415ed39a30125d4565bb768926dff4c9 --- src/wlan_policy_mgr_action.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 4cbffd08431c..765778787d48 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -865,6 +865,7 @@ QDF_STATUS policy_mgr_valid_sap_conc_channel_check( uint8_t channel = *con_ch; uint8_t temp_channel = 0; struct policy_mgr_psoc_priv_obj *pm_ctx; + bool sta_sap_scc_on_dfs_chan; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -893,6 +894,9 @@ QDF_STATUS policy_mgr_valid_sap_conc_channel_check( else if (!channel) channel = sap_ch; + sta_sap_scc_on_dfs_chan = + policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan(psoc); + if (policy_mgr_valid_sta_channel_check(psoc, channel)) { if (wlan_reg_is_dfs_ch(pm_ctx->pdev, channel) || wlan_reg_is_passive_or_disable_ch( @@ -920,6 +924,11 @@ QDF_STATUS policy_mgr_valid_sap_conc_channel_check( return QDF_STATUS_E_FAILURE; } } else { + if (wlan_reg_is_dfs_ch(pm_ctx->pdev, channel) && + sta_sap_scc_on_dfs_chan) { + policy_mgr_debug("STA SAP SCC is allowed on DFS channel"); + goto update_chan; + } policy_mgr_warn("Can't have concurrency on %d", channel); return QDF_STATUS_E_FAILURE; @@ -927,6 +936,7 @@ QDF_STATUS policy_mgr_valid_sap_conc_channel_check( } } +update_chan: if (channel != sap_ch) *con_ch = channel; From 637eba547a6f83d4ae601b3d47d1640f8a66bc3e Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Thu, 14 Jun 2018 17:55:15 -0700 Subject: [PATCH 129/187] qcacmn: Check HW mode before sending join request to lower layers When STA's join req times out on current BSS, SME issues next BSS internally without checking HW mode for new channel For example, STA tries to connect SSID="abc", BSSID="a1:a2:a3:a4:a5:a6", channel=36 and lets say it fails. It should try few more times to same BSSID and after that it will try next bss. Lets say next BSS it found has, SSID="abc", BSSID="b1:b2:b3:b4:b5:b6", channel=1 then it needs to check whether hardware mode change is required for channel=1. If driver fails in checking hardware mode then following check will prevent the bad situation. CRs-Fixed: 2261129 Change-Id: Ie31ac5b8b90c6e63122148647ad333fccfbf9dbf --- inc/wlan_policy_mgr_api.h | 18 ++++++++++ src/wlan_policy_mgr_action.c | 70 ++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 0244b1498aa9..c58f81812595 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -2302,6 +2302,24 @@ bool policy_mgr_is_sta_connected_2g(struct wlan_objmgr_psoc *psoc); */ void policy_mgr_trim_acs_channel_list(struct wlan_objmgr_psoc *psoc, uint8_t *org_ch_list, uint8_t *org_ch_list_count); + +/** + * policy_mgr_is_hwmode_set_for_given_chnl() - to check for given channel + * if the hw mode is properly set. + * @psoc: pointer to psoc + * @channel: given channel + * + * If HW mode is properly set for given channel then it returns true else + * it returns false. + * For example, when 2x2 DBS is supported and if the first connection is + * coming up on 2G band then driver expects DBS HW mode to be set first + * before the connection can be established. Driver can call this API to + * find-out if HW mode is set properly. + * + * Return: true if HW mode is set properly else false + */ +bool policy_mgr_is_hwmode_set_for_given_chnl(struct wlan_objmgr_psoc *psoc, + uint8_t channel); /* * policy_mgr_get_connection_info() - Get info of all active connections * @info: Pointer to connection info diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 765778787d48..3f22044699d8 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -415,6 +415,76 @@ bool policy_mgr_is_dbs_allowed_for_concurrency( return ret; } +static bool policy_mgr_is_chnl_in_diff_band(struct wlan_objmgr_psoc *psoc, + uint8_t channel) +{ + uint8_t i, pm_chnl; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return false; + } + + /* + * check given channel against already existing connections' + * channels. if they differ then channels are in different bands + */ + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (i = 0; i < MAX_NUMBER_OF_CONC_CONNECTIONS; i++) { + pm_chnl = pm_conc_connection_list[i].chan; + if (pm_conc_connection_list[i].in_use) + if (!WLAN_REG_IS_SAME_BAND_CHANNELS(channel, pm_chnl)) { + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + policy_mgr_debug("channel is in diff band"); + return true; + } + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return false; +} + +bool policy_mgr_is_hwmode_set_for_given_chnl(struct wlan_objmgr_psoc *psoc, + uint8_t channel) +{ + enum policy_mgr_band band; + bool is_hwmode_dbs, is_2x2_dbs; + + if (policy_mgr_is_hw_dbs_capable(psoc) == false) + return true; + + if (WLAN_REG_IS_24GHZ_CH(channel)) + band = POLICY_MGR_BAND_24; + else + band = POLICY_MGR_BAND_5; + + is_hwmode_dbs = policy_mgr_is_current_hwmode_dbs(psoc); + is_2x2_dbs = policy_mgr_is_hw_dbs_2x2_capable(psoc); + /* + * If HW supports 2x2 chains in DBS HW mode and if DBS HW mode is not + * yet set then this is the right time to block the connection. + */ + if ((band == POLICY_MGR_BAND_24) && is_2x2_dbs && !is_hwmode_dbs) { + policy_mgr_err("HW mode is not yet in DBS!!!!!"); + return false; + } + + /* + * If HW supports 1x1 chains DBS HW mode and if first connection is + * 2G or 5G band and if second connection is coming up in diffrent + * band than the first connection and if current HW mode is not yet + * set in DBS then this is the right time to block the connection. + */ + if (policy_mgr_is_chnl_in_diff_band(psoc, channel) && !is_hwmode_dbs) { + policy_mgr_err("Given channel & existing conn is diff band & HW mode is not yet in DBS !!!!"); + return false; + } + + return true; +} + QDF_STATUS policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc, uint32_t session_id, uint8_t channel, From 85b42f4930d95189ca1cc70d25dae93efe220b0b Mon Sep 17 00:00:00 2001 From: Bala Venkatesh Date: Fri, 8 Jun 2018 12:38:35 +0530 Subject: [PATCH 130/187] qcacmn: Ignore CSA if the channel is DFS or disabled If MCC to SCC switch is enabled, SAP is active and CSA received for STA interface, then ignore the CSA if channel is DFS/disabled. CRs-Fixed: 2263037 Change-Id: I98b8d957766358ea86cc9f50339725cf4bf0038b --- inc/wlan_policy_mgr_api.h | 13 +++++++++++ src/wlan_policy_mgr_get_set_utils.c | 34 +++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index c58f81812595..9b866395dabf 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -2391,4 +2391,17 @@ bool policy_mgr_dual_beacon_on_single_mac_mcc_capable( bool policy_mgr_sta_sap_scc_on_lte_coex_chan( struct wlan_objmgr_psoc *psoc); +/** + * policy_mgr_valid_channel_for_channel_switch() - check for valid channel for + * channel switch. + * @psoc: poniter to psoc + * @channel: channel to be validated. + * This function validates whether the given channel is valid for channel + * switch. + * + * Return: true or false + */ +bool policy_mgr_is_valid_for_channel_switch(struct wlan_objmgr_psoc *psoc, + uint8_t channel); + #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index c43a06f0d489..fcc811dbf5c1 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -3104,3 +3104,37 @@ bool policy_mgr_sta_sap_scc_on_lte_coex_chan( } return pm_ctx->user_cfg.sta_sap_scc_on_lte_coex_chan; } + +bool policy_mgr_is_valid_for_channel_switch(struct wlan_objmgr_psoc *psoc, + uint8_t channel) +{ + uint32_t sta_sap_scc_on_dfs_chan; + uint32_t sap_count; + enum channel_state state; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return false; + } + + sta_sap_scc_on_dfs_chan = + policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan(psoc); + sap_count = policy_mgr_mode_specific_connection_count(psoc, + PM_SAP_MODE, + NULL); + state = reg_get_channel_state(pm_ctx->pdev, channel); + + policy_mgr_debug("sta_sap_scc_on_dfs_chan %u, sap_count %u, channel %u, state %u", + sta_sap_scc_on_dfs_chan, sap_count, channel, state); + + if ((state == CHANNEL_STATE_ENABLE) || (sap_count == 0) || + ((state == CHANNEL_STATE_DFS) && sta_sap_scc_on_dfs_chan)) { + policy_mgr_debug("Valid channel for channel switch"); + return true; + } + + policy_mgr_debug("Invalid channel for channel switch"); + return false; +} From 378064b5e091768758e0b5102941a785f45dba35 Mon Sep 17 00:00:00 2001 From: Bala Venkatesh Date: Mon, 11 Jun 2018 15:06:53 +0530 Subject: [PATCH 131/187] qcacmn: Defer the channel switch if it is already in progress When sta+sap scc enabled on dfs channel then SAP cannot operate on DFS channel in standalone mode. If STA+SAP are operating in SCC mode on a DFS channel and STA gets disconnected from reference AP then driver schedules a workqueue to move the SAP from DFS channel to user configured channel. At this time if STA again connects to reference AP within few ms then driver again schedules one more workqueue to move the SAP to STA's channel. Sometimes the second workqueue may fail to switch the channel if first one is not yet completed. So added event variable to schedule second workqueue only when first one is complete. CRs-Fixed: 2267005 Change-Id: Ia6ce4b6264c35f6d2c809e2a3f65f535e930874e --- inc/wlan_policy_mgr_api.h | 22 +++++++++++++ src/wlan_policy_mgr_action.c | 54 +++++++++++++++++++++++++++++++ src/wlan_policy_mgr_i.h | 2 ++ src/wlan_policy_mgr_init_deinit.c | 12 +++++++ 4 files changed, 90 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 9b866395dabf..af7e88831592 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1146,6 +1146,28 @@ QDF_STATUS policy_mgr_reset_connection_update(struct wlan_objmgr_psoc *psoc); */ QDF_STATUS policy_mgr_set_connection_update(struct wlan_objmgr_psoc *psoc); +/** + * policy_mgr_set_chan_switch_complete_evt() - set channel + * switch completion event + * @psoc: PSOC object information + * Sets the channel switch completion event. + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_set_chan_switch_complete_evt( + struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_reset_chan_switch_complete_evt() - reset channel + * switch completion event + * @psoc: PSOC object information + * Resets the channel switch completion event. + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_reset_chan_switch_complete_evt( + struct wlan_objmgr_psoc *psoc); + /** * policy_mgr_set_opportunistic_update() - Set opportunistic * update event diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 3f22044699d8..7cb62158e3ee 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -881,6 +881,14 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) goto end; } + policy_mgr_debug("wait if channel switch is already in progress"); + status = qdf_wait_single_event( + &pm_ctx->channel_switch_complete_evt, + CHANNEL_SWITCH_COMPLETE_TIMEOUT); + + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("wait for event failed, still continue with channel switch"); + } if (!pm_ctx->hdd_cbacks.wlan_hdd_get_channel_for_sap_restart) { policy_mgr_err("SAP restart get channel callback in NULL"); goto end; @@ -1181,6 +1189,52 @@ QDF_STATUS policy_mgr_set_connection_update(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_SUCCESS; } +QDF_STATUS policy_mgr_set_chan_switch_complete_evt( + struct wlan_objmgr_psoc *psoc) +{ + QDF_STATUS status; + struct policy_mgr_psoc_priv_obj *policy_mgr_context; + + policy_mgr_context = policy_mgr_get_context(psoc); + + if (!policy_mgr_context) { + policy_mgr_err("Invalid context"); + return QDF_STATUS_E_FAILURE; + } + status = qdf_event_set( + &policy_mgr_context->channel_switch_complete_evt); + + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("set event failed"); + return QDF_STATUS_E_FAILURE; + } + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_reset_chan_switch_complete_evt( + struct wlan_objmgr_psoc *psoc) +{ + QDF_STATUS status; + struct policy_mgr_psoc_priv_obj *policy_mgr_context; + + policy_mgr_context = policy_mgr_get_context(psoc); + + if (!policy_mgr_context) { + policy_mgr_err("Invalid context"); + return QDF_STATUS_E_FAILURE; + } + status = qdf_event_reset( + &policy_mgr_context->channel_switch_complete_evt); + + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("reset event failed"); + return QDF_STATUS_E_FAILURE; + } + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS policy_mgr_set_opportunistic_update(struct wlan_objmgr_psoc *psoc) { QDF_STATUS status; diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 6e305fac1088..208f9ceb5f2c 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -35,6 +35,7 @@ #define PM_24_GHZ_CHANNEL_6 (6) #define PM_5_GHZ_CHANNEL_36 (36) +#define CHANNEL_SWITCH_COMPLETE_TIMEOUT (2000) /** * Policy Mgr hardware mode list bit-mask definitions. @@ -265,6 +266,7 @@ struct policy_mgr_psoc_priv_obj { uint8_t cur_conc_system_pref; uint8_t sta_sap_scc_on_dfs_chan_allowed; qdf_event_t opportunistic_update_done_evt; + qdf_event_t channel_switch_complete_evt; send_mode_change_event_cb mode_change_cb; }; diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index d6a198932aa2..83528a963e27 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -403,6 +403,11 @@ QDF_STATUS policy_mgr_psoc_enable(struct wlan_objmgr_psoc *psoc) return status; } + status = qdf_event_create(&pm_ctx->channel_switch_complete_evt); + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("channel_switch_complete_evt init failed"); + return status; + } pm_ctx->do_hw_mode_change = false; pm_ctx->hw_mode_change_in_progress = POLICY_MGR_HW_MODE_NOT_IN_PROGRESS; /* reset sap mandatory channels */ @@ -477,6 +482,13 @@ QDF_STATUS policy_mgr_psoc_disable(struct wlan_objmgr_psoc *psoc) status = QDF_STATUS_E_FAILURE; QDF_ASSERT(0); } + /* destroy channel_switch_complete_evt */ + if (!QDF_IS_STATUS_SUCCESS(qdf_event_destroy + (&pm_ctx->channel_switch_complete_evt))) { + policy_mgr_err("Failed to destroy channel_switch_complete evt"); + status = QDF_STATUS_E_FAILURE; + QDF_ASSERT(0); + } /* deallocate dbs_opportunistic_timer */ if (QDF_TIMER_STATE_RUNNING == From 2854295433be6cb8a044703f21234e3aab44b9c0 Mon Sep 17 00:00:00 2001 From: Yeshwanth Sriram Guntuka Date: Wed, 13 Jun 2018 11:43:46 +0530 Subject: [PATCH 132/187] qcacmn: Send mode change event after addkey On STA connection, mode change event is sent to userspace after association is completed. This causes delay in processing of M1 frame at supplicant due to latency associated with nl80211_get_wiphy_index function as part of processing mode change vendor event. Fix is to send mode change event for STA after key is added. Change-Id: Id403bfdd26ed3a47449ba3f2967f4b4322ad5da6 CRs-Fixed: 2260483 --- src/wlan_policy_mgr_action.c | 15 +++++++++++---- src/wlan_policy_mgr_core.c | 13 +++++++++++-- src/wlan_policy_mgr_get_set_utils.c | 5 ++++- src/wlan_policy_mgr_i.h | 3 ++- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 7cb62158e3ee..730f3bdeb7b1 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -308,7 +308,7 @@ QDF_STATUS policy_mgr_update_connection_info(struct wlan_objmgr_psoc *psoc, policy_mgr_get_bw(conn_table_entry.chan_width), conn_table_entry.mac_id, chain_mask, - nss, vdev_id, true); + nss, vdev_id, true, true); return QDF_STATUS_SUCCESS; } @@ -1531,7 +1531,7 @@ QDF_STATUS policy_mgr_update_connection_info_utfw( policy_mgr_update_conc_list(psoc, conn_index, policy_mgr_get_mode(type, sub_type), channelid, HW_MODE_20_MHZ, - mac_id, chain_mask, 0, vdev_id, true); + mac_id, chain_mask, 0, vdev_id, true, true); return QDF_STATUS_SUCCESS; } @@ -1543,6 +1543,8 @@ QDF_STATUS policy_mgr_incr_connection_count_utfw(struct wlan_objmgr_psoc *psoc, { QDF_STATUS status = QDF_STATUS_E_FAILURE; uint32_t conn_index = 0; + bool update_conn = true; + enum policy_mgr_con_mode mode; conn_index = policy_mgr_get_connection_count(psoc); if (MAX_NUMBER_OF_CONC_CONNECTIONS <= conn_index) { @@ -1553,10 +1555,15 @@ QDF_STATUS policy_mgr_incr_connection_count_utfw(struct wlan_objmgr_psoc *psoc, } policy_mgr_debug("--> filling entry at index[%d]", conn_index); + mode = policy_mgr_get_mode(type, sub_type); + if (mode == PM_STA_MODE || mode == PM_P2P_CLIENT_MODE) + update_conn = false; + policy_mgr_update_conc_list(psoc, conn_index, - policy_mgr_get_mode(type, sub_type), + mode, channelid, HW_MODE_20_MHZ, - mac_id, chain_mask, 0, vdev_id, true); + mac_id, chain_mask, 0, vdev_id, true, + update_conn); return QDF_STATUS_SUCCESS; } diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index a0b1643d6c81..54583ed52b19 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -526,6 +526,8 @@ QDF_STATUS policy_mgr_get_old_and_new_hw_index( * @chain_mask: Chain mask * @vdev_id: vdev id * @in_use: Flag to indicate if the index is in use or not + * @update_conn: Flag to indicate if mode change event should + * be sent or not * * Updates the index value of the concurrent connection list * @@ -540,7 +542,8 @@ void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc, enum policy_mgr_chain_mode chain_mask, uint32_t original_nss, uint32_t vdev_id, - bool in_use) + bool in_use, + bool update_conn) { struct policy_mgr_psoc_priv_obj *pm_ctx; bool mcc_mode; @@ -568,7 +571,13 @@ void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc, pm_conc_connection_list[conn_index].in_use = in_use; qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); - if (pm_ctx->mode_change_cb) + /* + * For STA and P2P client mode, the mode change event sent as part + * of the callback causes delay in processing M1 frame at supplicant + * resulting in cert test case failure. The mode change event is sent + * as part of add key for STA and P2P client mode. + */ + if (pm_ctx->mode_change_cb && update_conn) pm_ctx->mode_change_cb(); policy_mgr_dump_connection_status_info(psoc); diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index fcc811dbf5c1..7f24349f7298 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1273,6 +1273,7 @@ QDF_STATUS policy_mgr_incr_connection_count( uint8_t chan; uint32_t nss = 0; struct policy_mgr_psoc_priv_obj *pm_ctx; + bool update_conn = true; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -1314,6 +1315,8 @@ QDF_STATUS policy_mgr_incr_connection_count( policy_mgr_err("Error in getting nss"); } + if (mode == PM_STA_MODE || mode == PM_P2P_CLIENT_MODE) + update_conn = false; /* add the entry */ policy_mgr_update_conc_list(psoc, conn_index, @@ -1322,7 +1325,7 @@ QDF_STATUS policy_mgr_incr_connection_count( policy_mgr_get_bw(conn_table_entry.chan_width), conn_table_entry.mac_id, chain_mask, - nss, vdev_id, true); + nss, vdev_id, true, update_conn); policy_mgr_debug("Add at idx:%d vdev %d mac=%d", conn_index, vdev_id, conn_table_entry.mac_id); diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 208f9ceb5f2c..66ceaa043733 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -349,7 +349,8 @@ void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc, enum policy_mgr_chain_mode chain_mask, uint32_t original_nss, uint32_t vdev_id, - bool in_use); + bool in_use, + bool update_conn); void policy_mgr_store_and_del_conn_info(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, bool all_matching_cxn_to_del, From 9b1636dcd4dc8592b129ed121bd62989b1575e5a Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Wed, 27 Jun 2018 13:27:11 -0700 Subject: [PATCH 133/187] qcacmn: Don't move SAP if SCC on lte coex channel is allowed If STA+SAP is doing SCC & g_sta_sap_scc_on_lte_coex_chan is set, don't move SAP to a different channel when LTE channel avoidance event comes. Change-Id: I3dfdbb6d59769a8ff9b3b2e6d828feee94630569 CRs-Fixed: 2268993 --- inc/wlan_policy_mgr_api.h | 10 +++++++++ src/wlan_policy_mgr_get_set_utils.c | 34 +++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index af7e88831592..efdeb088c974 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -2426,4 +2426,14 @@ bool policy_mgr_sta_sap_scc_on_lte_coex_chan( bool policy_mgr_is_valid_for_channel_switch(struct wlan_objmgr_psoc *psoc, uint8_t channel); +/** + * policy_mgr_is_sta_sap_scc() - check whether SAP is doing SCC with + * STA + * @psoc: poniter to psoc + * @sap_ch: operating channel of SAP interface + * This function checks whether SAP is doing SCC with STA + * + * Return: true or false + */ +bool policy_mgr_is_sta_sap_scc(struct wlan_objmgr_psoc *psoc, uint8_t sap_ch); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 7f24349f7298..ab66d8bd5674 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -3141,3 +3141,37 @@ bool policy_mgr_is_valid_for_channel_switch(struct wlan_objmgr_psoc *psoc, policy_mgr_debug("Invalid channel for channel switch"); return false; } + +bool policy_mgr_is_sta_sap_scc(struct wlan_objmgr_psoc *psoc, uint8_t sap_ch) +{ + uint32_t conn_index; + bool is_scc = false; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return is_scc; + } + + if (!policy_mgr_mode_specific_connection_count( + psoc, PM_STA_MODE, NULL)) { + policy_mgr_debug("There is no STA+SAP conc"); + return is_scc; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; + conn_index++) { + if (pm_conc_connection_list[conn_index].in_use && + (pm_conc_connection_list[conn_index].mode == + PM_STA_MODE) && + (sap_ch == pm_conc_connection_list[conn_index].chan)) { + is_scc = true; + break; + } + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return is_scc; +} From 68bdbfa062eb39e65bc8e2398aa891a6fdd3bb35 Mon Sep 17 00:00:00 2001 From: Bala Venkatesh Date: Thu, 14 Jun 2018 12:28:10 +0530 Subject: [PATCH 134/187] qcacmn: Add support to allow user select preferred band for SAP Add enum QDF_MCC_TO_SCC_WITH_PREFERRED_BAND(6) for this. If ini gWlanMccToSccSwitchMode is selected to QDF_MCC_TO_SCC_WITH_PREFERRED_BAND(6) then following will be the behaviour of STA+SAP concurrency. 1. If second interface(SAP/STA) comes in same band as first interface(STA/SAP) respectively then force SCC irrespective of channel. 2. If second interface(SAP/STA) comes in other band as first interface(STA/SAP) then dont force SCC allow interband MCC or DBS based on DBS capability. Allow interband MCC but not intraband MCC. Change-Id: I91d41b4b0306ed4e362b5bcab9538f5fd5feea7d CRs-Fixed: 2260677 --- src/wlan_policy_mgr_get_set_utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index ab66d8bd5674..3a6e71a6c835 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2824,7 +2824,9 @@ bool policy_mgr_is_force_scc(struct wlan_objmgr_psoc *psoc) (pm_ctx->user_cfg.mcc_to_scc_switch_mode == QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL) || (pm_ctx->user_cfg.mcc_to_scc_switch_mode == - QDF_MCC_TO_SCC_SWITCH_FORCE_PREFERRED_WITHOUT_DISCONNECTION)); + QDF_MCC_TO_SCC_SWITCH_FORCE_PREFERRED_WITHOUT_DISCONNECTION) || + (pm_ctx->user_cfg.mcc_to_scc_switch_mode == + QDF_MCC_TO_SCC_WITH_PREFERRED_BAND)); } bool policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan( From 3b3f16f39f8df23cc491e77b17a7a3b5861e1bba Mon Sep 17 00:00:00 2001 From: Bala Venkatesh Date: Wed, 27 Jun 2018 12:50:10 +0530 Subject: [PATCH 135/187] qcacmn: Move the SAP to non DFS channel after STA disconnection Standalone SAP is not allowed on DFS channel if STA+SAP SCC enabled on DFS channel. So move the SAP to a non DFS channel as soon as STA gets disconnect. CRs-Fixed: 2269249 Change-Id: I27d018739f53997641a7113cfc7c844e02bd7e29 --- inc/wlan_policy_mgr_api.h | 27 ++++++++++++ src/wlan_policy_mgr_action.c | 80 ++++++++++++++++++++++++++++++++++-- src/wlan_policy_mgr_i.h | 1 + 3 files changed, 105 insertions(+), 3 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index efdeb088c974..6256fe7fc6cf 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -2426,6 +2426,32 @@ bool policy_mgr_sta_sap_scc_on_lte_coex_chan( bool policy_mgr_is_valid_for_channel_switch(struct wlan_objmgr_psoc *psoc, uint8_t channel); +/** + * policy_mgr_update_user_config_sap_chan() - Update user configured channel + * @psoc: poniter to psoc + * @channel: channel to be upated + * + * Return: void + **/ +void policy_mgr_update_user_config_sap_chan( + struct wlan_objmgr_psoc *psoc, uint32_t channel); + +/** + * policy_mgr_is_sap_restart_required_after_sta_disconnect() - is sap restart + * required + * after sta disconnection + * @psoc: psoc object data + * @intf_ch: sap channel + * + * Check if SAP should be moved to a non dfs channel after STA disconnection. + * This API applicable only for STA+SAP SCC and ini 'sta_sap_scc_on_dfs_chan' + * is enabled. + * + * Return: true if sap restart is required, otherwise false + */ +bool policy_mgr_is_sap_restart_required_after_sta_disconnect( + struct wlan_objmgr_psoc *psoc, uint8_t *intf_ch); + /** * policy_mgr_is_sta_sap_scc() - check whether SAP is doing SCC with * STA @@ -2436,4 +2462,5 @@ bool policy_mgr_is_valid_for_channel_switch(struct wlan_objmgr_psoc *psoc, * Return: true or false */ bool policy_mgr_is_sta_sap_scc(struct wlan_objmgr_psoc *psoc, uint8_t sap_ch); + #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 730f3bdeb7b1..3fa6002fd568 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -758,6 +758,19 @@ QDF_STATUS policy_mgr_handle_conc_multiport(struct wlan_objmgr_psoc *psoc, } #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH +void policy_mgr_update_user_config_sap_chan( + struct wlan_objmgr_psoc *psoc, uint32_t channel) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid pm context and failed to update the user config sap channel"); + return; + } + pm_ctx->user_config_sap_channel = channel; +} + /** * policy_mgr_is_restart_sap_allowed() - Check if restart SAP * allowed during SCC -> MCC switch @@ -820,6 +833,40 @@ bool policy_mgr_is_safe_channel(struct wlan_objmgr_psoc *psoc, return is_safe; } +bool policy_mgr_is_sap_restart_required_after_sta_disconnect( + struct wlan_objmgr_psoc *psoc, uint8_t *intf_ch) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + uint8_t sap_chan = policy_mgr_mode_specific_get_channel(psoc, + PM_SAP_MODE); + bool sta_sap_scc_on_dfs_chan = + policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan(psoc); + + *intf_ch = 0; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid pm context"); + return false; + } + + policy_mgr_debug("sta_sap_scc_on_dfs_chan %u, sap_chan %u", + sta_sap_scc_on_dfs_chan, sap_chan); + + if (!sta_sap_scc_on_dfs_chan || + !(sap_chan && WLAN_REG_IS_5GHZ_CH(sap_chan) && + (wlan_reg_get_channel_state(pm_ctx->pdev, sap_chan) == + CHANNEL_STATE_DFS))) { + return false; + } + + *intf_ch = pm_ctx->user_config_sap_channel; + policy_mgr_debug("Standalone SAP is not allowed on DFS channel, Move it to channel %u", + *intf_ch); + + return true; +} + /** * policy_mgr_check_sta_ap_concurrent_ch_intf() - Restart SAP in STA-AP case * @data: Pointer check concurrent channel work data @@ -1040,12 +1087,28 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( uint8_t operating_channel[MAX_NUMBER_OF_CONC_CONNECTIONS] = {0}; uint8_t vdev_id[MAX_NUMBER_OF_CONC_CONNECTIONS] = {0}; uint32_t cc_count = 0; + bool restart_sap = false; + uint8_t sap_ch; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { policy_mgr_err("Invalid context"); return; } + if (policy_mgr_get_connection_count(psoc) == 1) { + /* + * If STA+SAP sessions are on DFS channel and STA+SAP SCC is + * enabled on DFS channel then move the SAP out of DFS channel + * as soon as STA gets disconnect. + */ + if (policy_mgr_is_sap_restart_required_after_sta_disconnect( + psoc, &sap_ch)) { + policy_mgr_debug("move the SAP to configured channel %u", + sap_ch); + restart_sap = true; + goto sap_restart; + } + } /* * force SCC with STA+STA+SAP will need some additional logic @@ -1069,9 +1132,20 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( return; } - if ((mcc_to_scc_switch != QDF_MCC_TO_SCC_SWITCH_DISABLE) && - policy_mgr_valid_sta_channel_check(psoc, operating_channel[0]) - && !pm_ctx->sta_ap_intf_check_work_info) { +sap_restart: + /* + * If sta_sap_scc_on_dfs_chan is true then standalone SAP is not + * allowed on DFS channel. SAP is allowed on DFS channel only when STA + * is already connected on that channel. + * In following condition restart_sap will be true if + * sta_sap_scc_on_dfs_chan is true and SAP is on DFS channel. + * This scenario can come if STA+SAP are operating on DFS channel and + * STA gets disconnected. + */ + if (restart_sap || + ((mcc_to_scc_switch != QDF_MCC_TO_SCC_SWITCH_DISABLE) && + policy_mgr_valid_sta_channel_check(psoc, operating_channel[0]) && + !pm_ctx->sta_ap_intf_check_work_info)) { struct sta_ap_intf_check_work_ctx *work_info; work_info = qdf_mem_malloc( sizeof(struct sta_ap_intf_check_work_ctx)); diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 66ceaa043733..41c9cc40d200 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -268,6 +268,7 @@ struct policy_mgr_psoc_priv_obj { qdf_event_t opportunistic_update_done_evt; qdf_event_t channel_switch_complete_evt; send_mode_change_event_cb mode_change_cb; + uint32_t user_config_sap_channel; }; /** From 7f6bdd3b9db40310d08fd0c7935659fdbfc6287e Mon Sep 17 00:00:00 2001 From: Jianmin Zhu Date: Fri, 29 Jun 2018 10:39:30 +0800 Subject: [PATCH 136/187] qcacmn: Move SAP to safe channel after STA disconnection Standalone SAP is not allowed on lte-coex channel if STA+SAP SCC enabled on lte-coex channel. So move the SAP to a safe channel once STA disconnected. Change-Id: I00682f5bbb3da772e3e26ccd8d08183be28cc9ec CRs-Fixed: 2265263 --- inc/wlan_policy_mgr_api.h | 2 +- src/wlan_policy_mgr_action.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 6256fe7fc6cf..e48ff10ded08 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -2445,7 +2445,7 @@ void policy_mgr_update_user_config_sap_chan( * * Check if SAP should be moved to a non dfs channel after STA disconnection. * This API applicable only for STA+SAP SCC and ini 'sta_sap_scc_on_dfs_chan' - * is enabled. + * or 'sta_sap_scc_on_lte_coex_chan' is enabled. * * Return: true if sap restart is required, otherwise false */ diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 3fa6002fd568..4a711e74bf37 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -853,10 +853,12 @@ bool policy_mgr_is_sap_restart_required_after_sta_disconnect( policy_mgr_debug("sta_sap_scc_on_dfs_chan %u, sap_chan %u", sta_sap_scc_on_dfs_chan, sap_chan); - if (!sta_sap_scc_on_dfs_chan || - !(sap_chan && WLAN_REG_IS_5GHZ_CH(sap_chan) && - (wlan_reg_get_channel_state(pm_ctx->pdev, sap_chan) == - CHANNEL_STATE_DFS))) { + if ((!sta_sap_scc_on_dfs_chan || + !(sap_chan && WLAN_REG_IS_5GHZ_CH(sap_chan) && + (wlan_reg_get_channel_state(pm_ctx->pdev, sap_chan) == + CHANNEL_STATE_DFS))) && + (!policy_mgr_sta_sap_scc_on_lte_coex_chan(psoc) || + policy_mgr_is_safe_channel(psoc, sap_chan))) { return false; } @@ -1100,6 +1102,9 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( * If STA+SAP sessions are on DFS channel and STA+SAP SCC is * enabled on DFS channel then move the SAP out of DFS channel * as soon as STA gets disconnect. + * If STA+SAP sessions are on unsafe channel and STA+SAP SCC is + * enabled on unsafe channel then move the SAP to safe channel + * as soon as STA disconnected. */ if (policy_mgr_is_sap_restart_required_after_sta_disconnect( psoc, &sap_ch)) { From aa40f60b9c6ee2a64f8e8acfb7cd39a550ce3abe Mon Sep 17 00:00:00 2001 From: Kiran Kumar Lokere Date: Tue, 15 May 2018 15:48:57 -0700 Subject: [PATCH 137/187] qcacmn: Add support for SRD channels in ETSI domain Add support for Short Range Devices 25 mW max power channels in ETSI regulatory domain. Add Short Range Devices 25 mW max power channels only if DSRC feature is disabled. Provide service apis to check SRD and DSRC channels. Change-Id: Ib2a1d7cf191d07319cb29038ad60130f5cbe7f16 CRs-Fixed: 2264790 --- src/wlan_policy_mgr_core.c | 24 ++++++++++++++++++------ src/wlan_policy_mgr_pcl.c | 7 ++++--- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 54583ed52b19..ee1ac42303b2 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -1800,6 +1800,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, uint8_t channel_list_5[QDF_MAX_NUM_CHAN] = {0}; uint8_t sbs_channel_list[QDF_MAX_NUM_CHAN] = {0}; bool skip_dfs_channel = false; + bool is_etsi13_srd_chan_allowed_in_mas_mode = true; uint32_t i = 0, j = 0; struct policy_mgr_psoc_priv_obj *pm_ctx; bool sta_sap_scc_on_dfs_chan; @@ -1840,12 +1841,17 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, sta_sap_scc_on_dfs_chan = policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan(psoc); policy_mgr_debug("sta_sap_scc_on_dfs_chan %u", sta_sap_scc_on_dfs_chan); - if ((((mode == PM_SAP_MODE) || (mode == PM_P2P_GO_MODE)) && - (policy_mgr_mode_specific_connection_count( - psoc, PM_STA_MODE, NULL) > 0)) || - !sta_sap_scc_on_dfs_chan) { - policy_mgr_debug("STA present, skip DFS channels from pcl for SAP/Go"); - skip_dfs_channel = true; + if ((mode == PM_SAP_MODE) || (mode == PM_P2P_GO_MODE)) { + if ((policy_mgr_mode_specific_connection_count(psoc, + PM_STA_MODE, + NULL) > 0) || + !sta_sap_scc_on_dfs_chan) { + policy_mgr_debug("skip DFS ch from pcl for SAP/Go"); + skip_dfs_channel = true; + } + is_etsi13_srd_chan_allowed_in_mas_mode = + wlan_reg_is_etsi13_srd_chan_allowed_master_mode(pm_ctx-> + pdev); } /* Let's divide the list in 2.4 & 5 Ghz lists */ @@ -1878,6 +1884,12 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, chan_index++; continue; } + if (!is_etsi13_srd_chan_allowed_in_mas_mode && + wlan_reg_is_etsi13_srd_chan(pm_ctx->pdev, + channel_list[chan_index])) { + chan_index++; + continue; + } channel_list_5[chan_index_5++] = channel_list[chan_index++]; } diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index b122d2130cbb..88a58f085785 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -1391,13 +1391,14 @@ policy_mgr_get_nondfs_preferred_channel(struct wlan_objmgr_psoc *psoc, } static void policy_mgr_remove_dsrc_channels(uint8_t *chan_list, - uint32_t *num_channels) + uint32_t *num_channels, + struct wlan_objmgr_pdev *pdev) { uint32_t num_chan_temp = 0; int i; for (i = 0; i < *num_channels; i++) { - if (!wlan_is_dsrc_channel(wlan_chan_to_freq(chan_list[i]))) { + if (!wlan_reg_is_dsrc_chan(pdev, chan_list[i])) { chan_list[num_chan_temp] = chan_list[i]; num_chan_temp++; } @@ -1434,7 +1435,7 @@ QDF_STATUS policy_mgr_get_valid_chans(struct wlan_objmgr_psoc *psoc, return status; } - policy_mgr_remove_dsrc_channels(chan_list, list_len); + policy_mgr_remove_dsrc_channels(chan_list, list_len, pm_ctx->pdev); return QDF_STATUS_SUCCESS; } From afa4e1b2248f6c621c15e5aace010575354b84ef Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Thu, 5 Jul 2018 15:04:46 +0530 Subject: [PATCH 138/187] qcacmn: Fix hw mode change issue in case of DBS The driver stops the oppurtunitistic timer for DBS, when the start AP requests come, which results in HW mode stuck in DBS if the next vdev start request comes on the same MAC This further results in NSS = 1 for the MAC, hence throughput decreases. Fix is to set hw mode to single MAC in case the STA/SAP comes up in the band/channel Change-Id: I8ec4282c78594ee7e133a1e7768fa230bb2e8180 CRs-Fixed: 2273443 --- src/wlan_policy_mgr_action.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 4a711e74bf37..bb0beae7bd30 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -1442,6 +1442,10 @@ void policy_mgr_checkn_update_hw_mode_single_mac_mode( return; } + if (QDF_TIMER_STATE_RUNNING == + pm_ctx->dbs_opportunistic_timer.state) + qdf_mc_timer_stop(&pm_ctx->dbs_opportunistic_timer); + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); for (i = 0; i < MAX_NUMBER_OF_CONC_CONNECTIONS; i++) { if (pm_conc_connection_list[i].in_use) @@ -1453,11 +1457,6 @@ void policy_mgr_checkn_update_hw_mode_single_mac_mode( } } qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); - - if (QDF_TIMER_STATE_RUNNING == - pm_ctx->dbs_opportunistic_timer.state) - qdf_mc_timer_stop(&pm_ctx->dbs_opportunistic_timer); - pm_dbs_opportunistic_timer_handler((void *)psoc); } From e57b6b7417a133ea718b978fe0fcfccd8b69c112 Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Mon, 21 May 2018 04:51:47 -0400 Subject: [PATCH 139/187] qcacmn: Extract Hw mode Id and band info Extract/Save the Hw mode ID and Mac0 band info to hw mode list. This helps to identify the 2x2 5G + 1x1 2G and 2x2 2G + 1x1 5G. Change-Id: I0682337b1a80c1b502c3307e0847aaa99479d2d3 CRs-Fixed: 2256152 --- inc/wlan_policy_mgr_public_struct.h | 6 ++-- src/wlan_policy_mgr_action.c | 11 ++++--- src/wlan_policy_mgr_core.c | 12 +++++--- src/wlan_policy_mgr_get_set_utils.c | 41 ++++++++++++++++---------- src/wlan_policy_mgr_i.h | 45 +++++++++++++++++++++-------- 5 files changed, 78 insertions(+), 37 deletions(-) diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 2d7f61042574..8706c61a8c72 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -855,8 +855,9 @@ struct policy_mgr_conc_connection_info { * @mac1_rx_ss: MAC1 Rx spatial stream * @mac0_bw: MAC0 bandwidth * @mac1_bw: MAC1 bandwidth - * @dbs_cap: DBS capabality - * @agile_dfs_cap: Agile DFS capabality + * @mac0_band_cap: mac0 band (5g/2g) capability + * @dbs_cap: DBS capability + * @agile_dfs_cap: Agile DFS capability */ struct policy_mgr_hw_mode_params { uint8_t mac0_tx_ss; @@ -865,6 +866,7 @@ struct policy_mgr_hw_mode_params { uint8_t mac1_rx_ss; uint8_t mac0_bw; uint8_t mac1_bw; + uint8_t mac0_band_cap; uint8_t dbs_cap; uint8_t agile_dfs_cap; uint8_t sbs_cap; diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index bb0beae7bd30..95e126bada3c 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -72,12 +72,15 @@ void policy_mgr_hw_mode_transition_cb(uint32_t old_hw_mode_index, return; } - policy_mgr_debug("MAC0: TxSS:%d, RxSS:%d, Bw:%d", - hw_mode.mac0_tx_ss, hw_mode.mac0_rx_ss, hw_mode.mac0_bw); + policy_mgr_debug("MAC0: TxSS:%d, RxSS:%d, Bw:%d band_cap:%d", + hw_mode.mac0_tx_ss, hw_mode.mac0_rx_ss, + hw_mode.mac0_bw, hw_mode.mac0_band_cap); policy_mgr_debug("MAC1: TxSS:%d, RxSS:%d, Bw:%d", - hw_mode.mac1_tx_ss, hw_mode.mac1_rx_ss, hw_mode.mac1_bw); + hw_mode.mac1_tx_ss, hw_mode.mac1_rx_ss, + hw_mode.mac1_bw); policy_mgr_debug("DBS:%d, Agile DFS:%d, SBS:%d", - hw_mode.dbs_cap, hw_mode.agile_dfs_cap, hw_mode.sbs_cap); + hw_mode.dbs_cap, hw_mode.agile_dfs_cap, + hw_mode.sbs_cap); /* update pm_conc_connection_list */ policy_mgr_update_hw_mode_conn_info(context, num_vdev_mac_entries, diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index ee1ac42303b2..930cfe033d08 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -477,6 +477,7 @@ QDF_STATUS policy_mgr_get_hw_mode_from_idx( hw_mode->mac1_tx_ss = POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_GET(param); hw_mode->mac1_rx_ss = POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_GET(param); hw_mode->mac1_bw = POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_GET(param); + hw_mode->mac0_band_cap = POLICY_MGR_HW_MODE_MAC0_BAND_GET(param); hw_mode->dbs_cap = POLICY_MGR_HW_MODE_DBS_MODE_GET(param); hw_mode->agile_dfs_cap = POLICY_MGR_HW_MODE_AGILE_DFS_GET(param); hw_mode->sbs_cap = POLICY_MGR_HW_MODE_SBS_MODE_GET(param); @@ -815,12 +816,15 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status, return; } - policy_mgr_debug("MAC0: TxSS:%d, RxSS:%d, Bw:%d", - hw_mode.mac0_tx_ss, hw_mode.mac0_rx_ss, hw_mode.mac0_bw); + policy_mgr_debug("MAC0: TxSS:%d, RxSS:%d, Bw:%d, band_cap %d", + hw_mode.mac0_tx_ss, hw_mode.mac0_rx_ss, + hw_mode.mac0_bw, hw_mode.mac0_band_cap); policy_mgr_debug("MAC1: TxSS:%d, RxSS:%d, Bw:%d", - hw_mode.mac1_tx_ss, hw_mode.mac1_rx_ss, hw_mode.mac1_bw); + hw_mode.mac1_tx_ss, hw_mode.mac1_rx_ss, + hw_mode.mac1_bw); policy_mgr_debug("DBS:%d, Agile DFS:%d, SBS:%d", - hw_mode.dbs_cap, hw_mode.agile_dfs_cap, hw_mode.sbs_cap); + hw_mode.dbs_cap, hw_mode.agile_dfs_cap, + hw_mode.sbs_cap); /* update pm_conc_connection_list */ policy_mgr_update_hw_mode_conn_info(context, num_vdev_mac_entries, diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 3a6e71a6c835..281a6845590e 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -154,6 +154,7 @@ static void policy_mgr_get_hw_mode_params( info->mac_bw = policy_mgr_map_wmi_channel_width_to_hw_mode_bw( QDF_MAX(caps->max_bw_supported_2G, caps->max_bw_supported_5G)); + info->mac_band_cap = caps->supported_bands; } /** @@ -162,7 +163,8 @@ static void policy_mgr_get_hw_mode_params( * @wma_handle: pointer to wma global structure * @mac0_ss_bw_info: TX-RX streams, BW for MAC0 * @mac1_ss_bw_info: TX-RX streams, BW for MAC1 - * @pos: refers to hw_mode_index + * @pos: refers to hw_mode_list array index + * @hw_mode_id: hw mode id value used by firmware * @dbs_mode: dbs_mode for the dbs_hw_mode * @sbs_mode: sbs_mode for the sbs_hw_mode * @@ -174,7 +176,7 @@ static void policy_mgr_get_hw_mode_params( static void policy_mgr_set_hw_mode_params(struct wlan_objmgr_psoc *psoc, struct policy_mgr_mac_ss_bw_info mac0_ss_bw_info, struct policy_mgr_mac_ss_bw_info mac1_ss_bw_info, - uint32_t pos, uint32_t dbs_mode, + uint32_t pos, uint32_t hw_mode_id, uint32_t dbs_mode, uint32_t sbs_mode) { struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -212,6 +214,12 @@ static void policy_mgr_set_hw_mode_params(struct wlan_objmgr_psoc *psoc, POLICY_MGR_HW_MODE_SBS_MODE_SET( pm_ctx->hw_mode.hw_mode_list[pos], sbs_mode); + POLICY_MGR_HW_MODE_MAC0_BAND_SET( + pm_ctx->hw_mode.hw_mode_list[pos], + mac0_ss_bw_info.mac_band_cap); + POLICY_MGR_HW_MODE_ID_SET( + pm_ctx->hw_mode.hw_mode_list[pos], + hw_mode_id); } QDF_STATUS policy_mgr_update_hw_mode_list(struct wlan_objmgr_psoc *psoc, @@ -287,7 +295,8 @@ QDF_STATUS policy_mgr_update_hw_mode_list(struct wlan_objmgr_psoc *psoc, /* Updating HW mode list */ policy_mgr_set_hw_mode_params(psoc, mac0_ss_bw_info, - mac1_ss_bw_info, i, dbs_mode, sbs_mode); + mac1_ss_bw_info, i, tmp->hw_mode_id, dbs_mode, + sbs_mode); } return QDF_STATUS_SUCCESS; } @@ -331,19 +340,21 @@ void policy_mgr_dump_dbs_hw_mode(struct wlan_objmgr_psoc *psoc) for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { param = pm_ctx->hw_mode.hw_mode_list[i]; - policy_mgr_debug("[%d]-MAC0: tx_ss:%d rx_ss:%d bw_idx:%d", - i, - POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_GET(param), - POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_GET(param), - POLICY_MGR_HW_MODE_MAC0_BANDWIDTH_GET(param)); + policy_mgr_debug("[%d]-MAC0: tx_ss:%d rx_ss:%d bw_idx:%d band_cap:%d", + i, + POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_GET(param), + POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_GET(param), + POLICY_MGR_HW_MODE_MAC0_BANDWIDTH_GET(param), + POLICY_MGR_HW_MODE_MAC0_BAND_GET(param)); policy_mgr_debug("[%d]-MAC1: tx_ss:%d rx_ss:%d bw_idx:%d", - i, - POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_GET(param), - POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_GET(param), - POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_GET(param)); - policy_mgr_debug("[%d] DBS:%d SBS:%d", i, - POLICY_MGR_HW_MODE_DBS_MODE_GET(param), - POLICY_MGR_HW_MODE_SBS_MODE_GET(param)); + i, + POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_GET(param), + POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_GET(param), + POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_GET(param)); + policy_mgr_debug("[%d] DBS:%d SBS:%d hw_mode_id:%d", i, + POLICY_MGR_HW_MODE_DBS_MODE_GET(param), + POLICY_MGR_HW_MODE_SBS_MODE_GET(param), + POLICY_MGR_HW_MODE_ID_GET(param)); } } diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 41c9cc40d200..32d2cbfeb620 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -57,6 +57,8 @@ #define POLICY_MGR_HW_MODE_DBS_MODE_BITPOS (7) #define POLICY_MGR_HW_MODE_AGILE_DFS_MODE_BITPOS (6) #define POLICY_MGR_HW_MODE_SBS_MODE_BITPOS (5) +#define POLICY_MGR_HW_MODE_MAC0_BAND_BITPOS (3) +#define POLICY_MGR_HW_MODE_ID_BITPOS (0) #define POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_MASK \ (0xf << POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_BITPOS) @@ -76,6 +78,10 @@ (0x1 << POLICY_MGR_HW_MODE_AGILE_DFS_MODE_BITPOS) #define POLICY_MGR_HW_MODE_SBS_MODE_MASK \ (0x1 << POLICY_MGR_HW_MODE_SBS_MODE_BITPOS) +#define POLICY_MGR_HW_MODE_MAC0_BAND_MASK \ + (0x3 << POLICY_MGR_HW_MODE_MAC0_BAND_BITPOS) +#define POLICY_MGR_HW_MODE_ID_MASK \ + (0x7 << POLICY_MGR_HW_MODE_ID_BITPOS) #define POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_SET(hw_mode, value) \ WMI_SET_BITS(hw_mode, POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_BITPOS,\ @@ -104,34 +110,46 @@ #define POLICY_MGR_HW_MODE_SBS_MODE_SET(hw_mode, value) \ WMI_SET_BITS(hw_mode, POLICY_MGR_HW_MODE_SBS_MODE_BITPOS,\ 1, value) +#define POLICY_MGR_HW_MODE_MAC0_BAND_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, POLICY_MGR_HW_MODE_MAC0_BAND_BITPOS,\ + 2, value) +#define POLICY_MGR_HW_MODE_ID_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, POLICY_MGR_HW_MODE_ID_BITPOS,\ + 3, value) #define POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_GET(hw_mode) \ - ((hw_mode & POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_MASK) >> \ + (((hw_mode) & POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_MASK) >> \ POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_BITPOS) #define POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_GET(hw_mode) \ - ((hw_mode & POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_MASK) >> \ + (((hw_mode) & POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_MASK) >> \ POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_BITPOS) #define POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_GET(hw_mode) \ - ((hw_mode & POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_MASK) >> \ + (((hw_mode) & POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_MASK) >> \ POLICY_MGR_HW_MODE_MAC1_TX_STREAMS_BITPOS) #define POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_GET(hw_mode) \ - ((hw_mode & POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_MASK) >> \ + (((hw_mode) & POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_MASK) >> \ POLICY_MGR_HW_MODE_MAC1_RX_STREAMS_BITPOS) #define POLICY_MGR_HW_MODE_MAC0_BANDWIDTH_GET(hw_mode) \ - ((hw_mode & POLICY_MGR_HW_MODE_MAC0_BANDWIDTH_MASK) >> \ + (((hw_mode) & POLICY_MGR_HW_MODE_MAC0_BANDWIDTH_MASK) >> \ POLICY_MGR_HW_MODE_MAC0_BANDWIDTH_BITPOS) #define POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_GET(hw_mode) \ - ((hw_mode & POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_MASK) >> \ + (((hw_mode) & POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_MASK) >> \ POLICY_MGR_HW_MODE_MAC1_BANDWIDTH_BITPOS) #define POLICY_MGR_HW_MODE_DBS_MODE_GET(hw_mode) \ - ((hw_mode & POLICY_MGR_HW_MODE_DBS_MODE_MASK) >> \ + (((hw_mode) & POLICY_MGR_HW_MODE_DBS_MODE_MASK) >> \ POLICY_MGR_HW_MODE_DBS_MODE_BITPOS) #define POLICY_MGR_HW_MODE_AGILE_DFS_GET(hw_mode) \ - ((hw_mode & POLICY_MGR_HW_MODE_AGILE_DFS_MODE_MASK) >> \ + (((hw_mode) & POLICY_MGR_HW_MODE_AGILE_DFS_MODE_MASK) >> \ POLICY_MGR_HW_MODE_AGILE_DFS_MODE_BITPOS) #define POLICY_MGR_HW_MODE_SBS_MODE_GET(hw_mode) \ - ((hw_mode & POLICY_MGR_HW_MODE_SBS_MODE_MASK) >> \ + (((hw_mode) & POLICY_MGR_HW_MODE_SBS_MODE_MASK) >> \ POLICY_MGR_HW_MODE_SBS_MODE_BITPOS) +#define POLICY_MGR_HW_MODE_MAC0_BAND_GET(hw_mode) \ + (((hw_mode) & POLICY_MGR_HW_MODE_MAC0_BAND_MASK) >> \ + POLICY_MGR_HW_MODE_MAC0_BAND_BITPOS) +#define POLICY_MGR_HW_MODE_ID_GET(hw_mode) \ + (((hw_mode) & POLICY_MGR_HW_MODE_ID_MASK) >> \ + POLICY_MGR_HW_MODE_ID_BITPOS) #define POLICY_MGR_DEFAULT_HW_MODE_INDEX 0xFFFF @@ -273,14 +291,17 @@ struct policy_mgr_psoc_priv_obj { /** * struct policy_mgr_mac_ss_bw_info - hw_mode_list PHY/MAC params for each MAC - * @mac_tx_stream: Max TX stream - * @mac_rx_stream: Max RX stream - * @mac_bw: Max bandwidth + * @mac_tx_stream: Max TX stream number supported on MAC + * @mac_rx_stream: Max RX stream number supported on MAC + * @mac_bw: Max bandwidth(wmi_channel_width enum type) + * @mac_band_cap: supported Band bit map(WLAN_2G_CAPABILITY = 0x1, + * WLAN_5G_CAPABILITY = 0x2) */ struct policy_mgr_mac_ss_bw_info { uint32_t mac_tx_stream; uint32_t mac_rx_stream; uint32_t mac_bw; + uint32_t mac_band_cap; }; struct policy_mgr_psoc_priv_obj *policy_mgr_get_context( From eabb08f0668ff53a28d4bf475faffadbaca08ee2 Mon Sep 17 00:00:00 2001 From: Pragaspathi Thilagaraj Date: Tue, 1 May 2018 12:32:47 +0530 Subject: [PATCH 140/187] qcacmn: Fix OOB read in iw_hdd_set_var_ints_getnone From the IOCTL command WE_POLICY_MANAGER_PCL_CMD, we get the cds concurrency mode as argument and pass it to cds_get_pcl to get the pcl channel list. This concurrency mode parameter is used as the array index to retrieve the enum cds_pcl_type. If this value is greater than CDS_MAX_NUM_OF_MODE an OOB read will occur in iw_hdd_set_var_ints_getnone. Add check to validate the input cds mode argument against the macro CDS_MAX_NUM_OF_MODE. Return error if it is violated. Change-Id: I51073061be363d9680abf0566b77be7c7573d0fe CRs-Fixed: 2233991 --- src/wlan_policy_mgr_pcl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 88a58f085785..5303ee8092d1 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -476,8 +476,8 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc, return status; } - if (mode >= PM_MAX_NUM_OF_MODE) { - policy_mgr_err("requested mode:%d is not supported", mode); + if ((mode < 0) || (mode >= PM_MAX_NUM_OF_MODE)) { + policy_mgr_err("Invalid connection mode %d received", mode); return status; } From 77cb42a95239aa0e2e78ebde1a05e84e800b036f Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Fri, 15 Jun 2018 16:46:30 +0530 Subject: [PATCH 141/187] qcacmn: Fix high latency during BTM roaming While processing the WMA_ROAM_OFFLOAD_SYNCH_IND event, The driver takes nearly 150 to 200 msec time to just write fatal, error and info messages to the kmsg log buffer. Also to get tx power supplicant runs another thread while roaming. These cause more latency(300ms) to send WMA_ROAM_OFFLOAD_SYNCH_CNF message to fw. To decrease roam latency, the driver should write the only necessary error message to kmsg buffer. Fix is to change irrelevant fatal, error and info message type to debug. Change-Id: I521104c692eb42112ce2528c15d09785ff3470b6 CRs-Fixed: 2261592 --- src/wlan_policy_mgr_action.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 95e126bada3c..1bd5c4d1cecb 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -799,7 +799,7 @@ static bool policy_mgr_is_restart_sap_allowed( QDF_MCC_TO_SCC_SWITCH_FORCE_PREFERRED_WITHOUT_DISCONNECTION) && ((policy_mgr_get_concurrency_mode(psoc) & sta_go_bit_mask) == sta_go_bit_mask)))) { - policy_mgr_err("MCC switch disabled or not concurrent STA/SAP, STA/GO"); + policy_mgr_debug("MCC switch disabled or not concurrent STA/SAP, STA/GO"); return false; } From 1d78ede2cdf57bd0ac6ff91257e241c3bd4cdc66 Mon Sep 17 00:00:00 2001 From: bings Date: Tue, 10 Jul 2018 17:41:42 +0800 Subject: [PATCH 142/187] qcacmn: Skip DFS channels for SAP/GO when station exists Currently DFS channels are skipped for SAP/GO in cds_get_channel_list when ini g_sta_sap_scc_on_dfs_chan is configured as 0. Refine the logic of DFS channels skipping when station exists. Do not select DFS channels for SAP/GO when below cases are both satisfied. 1. Station exists. 2. Ini g_sta_sap_scc_on_dfs_chan is set as 0. Change-Id: I2f082388a662d54968b3c2e95e5713eeffa1b131 CRs-Fixed: 2275724 --- src/wlan_policy_mgr_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 930cfe033d08..a2b754ee4efb 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -1848,8 +1848,8 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, if ((mode == PM_SAP_MODE) || (mode == PM_P2P_GO_MODE)) { if ((policy_mgr_mode_specific_connection_count(psoc, PM_STA_MODE, - NULL) > 0) || - !sta_sap_scc_on_dfs_chan) { + NULL) > 0) && + (!sta_sap_scc_on_dfs_chan)) { policy_mgr_debug("skip DFS ch from pcl for SAP/Go"); skip_dfs_channel = true; } From 9ace8a9dd9374ba5d3d2ff055cd89628c73bd59e Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Mon, 21 May 2018 05:39:04 -0400 Subject: [PATCH 143/187] qcacmn: Set hw mode Id to FW Firmware needs HW MODE ID not list index. Use HW mode ID to set HW MODE WMI command. Change-Id: I12f9d83daee1c99706c345d85f03781257b492bf CRs-Fixed: 2256175 --- inc/wlan_policy_mgr_api.h | 32 +++++++++++++++ inc/wlan_policy_mgr_public_struct.h | 20 +++++++++ src/wlan_policy_mgr_action.c | 24 ++++++++--- src/wlan_policy_mgr_core.c | 63 ++++++++++++++++++++++------- src/wlan_policy_mgr_i.h | 6 +-- 5 files changed, 120 insertions(+), 25 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index e48ff10ded08..2fa1cd616205 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -712,6 +712,8 @@ enum QDF_OPMODE policy_mgr_get_qdf_mode_from_pm( * @mac0_bw: MAC0 bandwidth configuration * @mac1_ss: MAC1 spatial stream configuration * @mac1_bw: MAC1 bandwidth configuration + * @mac0_band_cap: mac0 band capability requirement + * (0: Don't care, 1: 2.4G, 2: 5G) * @dbs: HW DBS capability * @dfs: HW Agile DFS capability * @sbs: HW SBS capability @@ -724,18 +726,33 @@ enum QDF_OPMODE policy_mgr_get_qdf_mode_from_pm( * e.g.: To configure 2x2_80 * mac0_ss = HW_MODE_SS_2x2, mac0_bw = HW_MODE_80_MHZ * mac1_ss = HW_MODE_SS_0x0, mac1_bw = HW_MODE_BW_NONE + * mac0_band_cap = HW_MODE_MAC_BAND_NONE, * dbs = HW_MODE_DBS_NONE, dfs = HW_MODE_AGILE_DFS_NONE, * sbs = HW_MODE_SBS_NONE * e.g.: To configure 1x1_80_1x1_40 (DBS) * mac0_ss = HW_MODE_SS_1x1, mac0_bw = HW_MODE_80_MHZ * mac1_ss = HW_MODE_SS_1x1, mac1_bw = HW_MODE_40_MHZ + * mac0_band_cap = HW_MODE_MAC_BAND_NONE, * dbs = HW_MODE_DBS, dfs = HW_MODE_AGILE_DFS_NONE, * sbs = HW_MODE_SBS_NONE * e.g.: To configure 1x1_80_1x1_40 (Agile DFS) * mac0_ss = HW_MODE_SS_1x1, mac0_bw = HW_MODE_80_MHZ * mac1_ss = HW_MODE_SS_1x1, mac1_bw = HW_MODE_40_MHZ + * mac0_band_cap = HW_MODE_MAC_BAND_NONE, * dbs = HW_MODE_DBS, dfs = HW_MODE_AGILE_DFS, * sbs = HW_MODE_SBS_NONE + * e.g.: To configure 2x2_5g_80+1x1_2g_40 + * mac0_ss = HW_MODE_SS_2x2, mac0_bw = HW_MODE_80_MHZ + * mac1_ss = HW_MODE_SS_1x1, mac1_bw = HW_MODE_40_MHZ + * mac0_band_cap = HW_MODE_MAC_BAND_5G + * dbs = HW_MODE_DBS, dfs = HW_MODE_AGILE_DFS_NONE, + * sbs = HW_MODE_SBS_NONE + * e.g.: To configure 2x2_2g_40+1x1_5g_40 + * mac0_ss = HW_MODE_SS_2x2, mac0_bw = HW_MODE_40_MHZ + * mac1_ss = HW_MODE_SS_1x1, mac1_bw = HW_MODE_40_MHZ + * mac0_band_cap = HW_MODE_MAC_BAND_2G + * dbs = HW_MODE_DBS, dfs = HW_MODE_AGILE_DFS_NONE, + * sbs = HW_MODE_SBS_NONE * * Return: Success if the message made it down to the next layer */ @@ -745,6 +762,7 @@ QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc, enum hw_mode_bandwidth mac0_bw, enum hw_mode_ss_config mac1_ss, enum hw_mode_bandwidth mac1_bw, + enum hw_mode_mac_band_cap mac0_band_cap, enum hw_mode_dbs_capab dbs, enum hw_mode_agile_dfs_capab dfs, enum hw_mode_sbs_capab sbs, @@ -2463,4 +2481,18 @@ bool policy_mgr_is_sap_restart_required_after_sta_disconnect( */ bool policy_mgr_is_sta_sap_scc(struct wlan_objmgr_psoc *psoc, uint8_t sap_ch); +/** + * policy_mgr_get_hw_mode_from_idx() - Get HW mode based on index + * @psoc: psoc object + * @idx: HW mode id + * @hw_mode: HW mode params + * + * Fetches the HW mode parameters + * + * Return: Success if hw mode is obtained and the hw mode params + */ +QDF_STATUS policy_mgr_get_hw_mode_from_idx( + struct wlan_objmgr_psoc *psoc, + uint32_t idx, + struct policy_mgr_hw_mode_params *hw_mode); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 8706c61a8c72..6b46aab6daaf 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -114,6 +114,26 @@ enum hw_mode_sbs_capab { HW_MODE_SBS, }; +/** + * enum hw_mode_mac_band_cap - mac band capability + * @HW_MODE_MAC_BAND_NONE: No band requirement. + * @HW_MODE_MAC_BAND_2G: 2G band supported. + * @HW_MODE_MAC_BAND_5G: 5G band supported. + * + * To add HW_MODE_MAC_BAND_NONE value to help to + * match the HW DBS mode in hw mode list. + * Other enum values should match with WMI header: + * typedef enum { + * WLAN_2G_CAPABILITY = 0x1, + * WLAN_5G_CAPABILITY = 0x2, + * } WLAN_BAND_CAPABILITY; + */ +enum hw_mode_mac_band_cap { + HW_MODE_MAC_BAND_NONE = 0, + HW_MODE_MAC_BAND_2G = WLAN_2G_CAPABILITY, + HW_MODE_MAC_BAND_5G = WLAN_5G_CAPABILITY, +}; + /** * enum policy_mgr_pcl_group_id - Identifies the pcl groups to be used * @POLICY_MGR_PCL_GROUP_ID1_ID2: Use weights of group1 and group2 diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 1bd5c4d1cecb..603382bfd95c 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -99,6 +99,7 @@ QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc, enum hw_mode_bandwidth mac0_bw, enum hw_mode_ss_config mac1_ss, enum hw_mode_bandwidth mac1_bw, + enum hw_mode_mac_band_cap mac0_band_cap, enum hw_mode_dbs_capab dbs, enum hw_mode_agile_dfs_capab dfs, enum hw_mode_sbs_capab sbs, @@ -130,7 +131,8 @@ QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc, } hw_mode_index = policy_mgr_get_hw_mode_idx_from_dbs_hw_list(psoc, - mac0_ss, mac0_bw, mac1_ss, mac1_bw, dbs, dfs, sbs); + mac0_ss, mac0_bw, mac1_ss, mac1_bw, mac0_band_cap, + dbs, dfs, sbs); if (hw_mode_index < 0) { policy_mgr_err("Invalid HW mode index obtained"); return QDF_STATUS_E_FAILURE; @@ -657,6 +659,7 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, HW_MODE_80_MHZ, nss_dbs.mac1_ss, HW_MODE_40_MHZ, + HW_MODE_MAC_BAND_NONE, HW_MODE_DBS, HW_MODE_AGILE_DFS_NONE, HW_MODE_SBS_NONE, @@ -670,6 +673,7 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, HW_MODE_SS_2x2, HW_MODE_80_MHZ, HW_MODE_SS_0x0, HW_MODE_BW_NONE, + HW_MODE_MAC_BAND_NONE, HW_MODE_DBS_NONE, HW_MODE_AGILE_DFS_NONE, HW_MODE_SBS_NONE, @@ -680,6 +684,7 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, HW_MODE_SS_2x2, HW_MODE_80_MHZ, HW_MODE_SS_0x0, HW_MODE_BW_NONE, + HW_MODE_MAC_BAND_NONE, HW_MODE_DBS_NONE, HW_MODE_AGILE_DFS_NONE, HW_MODE_SBS_NONE, @@ -690,6 +695,7 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, HW_MODE_SS_2x2, HW_MODE_80_MHZ, HW_MODE_SS_2x2, HW_MODE_80_MHZ, + HW_MODE_MAC_BAND_NONE, HW_MODE_DBS, HW_MODE_AGILE_DFS_NONE, HW_MODE_SBS_NONE, @@ -704,6 +710,7 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, HW_MODE_SS_1x1, HW_MODE_80_MHZ, HW_MODE_SS_1x1, HW_MODE_80_MHZ, + HW_MODE_MAC_BAND_NONE, HW_MODE_DBS, HW_MODE_AGILE_DFS_NONE, HW_MODE_SBS, @@ -1541,9 +1548,10 @@ enum policy_mgr_hw_mode_change policy_mgr_get_hw_mode_change_from_hw_mode_index( struct wlan_objmgr_psoc *psoc, uint32_t hw_mode_index) { struct policy_mgr_psoc_priv_obj *pm_ctx; - uint32_t param = 0; + struct policy_mgr_hw_mode_params hw_mode; enum policy_mgr_hw_mode_change value = POLICY_MGR_HW_MODE_NOT_IN_PROGRESS; + QDF_STATUS status; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -1551,16 +1559,20 @@ enum policy_mgr_hw_mode_change policy_mgr_get_hw_mode_change_from_hw_mode_index( return value; } - policy_mgr_info("HW param: %x", param); - param = pm_ctx->hw_mode.hw_mode_list[hw_mode_index]; - if (POLICY_MGR_HW_MODE_DBS_MODE_GET(param)) { + status = policy_mgr_get_hw_mode_from_idx(psoc, hw_mode_index, &hw_mode); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("Failed to get HW mode index"); + return value; + } + + if (hw_mode.dbs_cap) { policy_mgr_info("DBS is requested with HW (%d)", hw_mode_index); value = POLICY_MGR_DBS_IN_PROGRESS; goto ret_value; } - if (POLICY_MGR_HW_MODE_SBS_MODE_GET(param)) { + if (hw_mode.sbs_cap) { policy_mgr_info("SBS is requested with HW (%d)", hw_mode_index); value = POLICY_MGR_SBS_IN_PROGRESS; diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index a2b754ee4efb..b76644192f91 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -300,11 +300,18 @@ void policy_mgr_get_tx_rx_ss_from_config(enum hw_mode_ss_config mac_ss, * @mac1_tx_ss: Number of tx spatial streams of MAC1 * @mac1_rx_ss: Number of rx spatial streams of MAC1 * @mac1_bw: Bandwidth of MAC1 of type 'hw_mode_bandwidth' + * @mac0_band_cap: mac0 band capability requirement + * (0: Don't care, 1: 2.4G, 2: 5G) * @dbs: DBS capability of type 'hw_mode_dbs_capab' * @dfs: Agile DFS capability of type 'hw_mode_agile_dfs_capab' * @sbs: SBS capability of type 'hw_mode_sbs_capab' * - * Fetches the HW mode index corresponding to the HW mode provided + * Fetches the HW mode index corresponding to the HW mode provided. + * In Genoa two DBS HW modes (2x2 5G + 1x1 2G, 2x2 2G + 1x1 5G), + * the "ss" number and "bw" value are not enough to specify the expected + * HW mode. But in both HW mode, the mac0 can support either 5G or 2G. + * So, the Parameter "mac0_band_cap" will specify the expected band support + * requirement on mac 0 to find the expected HW mode. * * Return: Positive hw mode index in case a match is found or a negative * value, otherwise @@ -315,6 +322,7 @@ int8_t policy_mgr_get_matching_hw_mode_index( enum hw_mode_bandwidth mac0_bw, uint32_t mac1_tx_ss, uint32_t mac1_rx_ss, enum hw_mode_bandwidth mac1_bw, + enum hw_mode_mac_band_cap mac0_band_cap, enum hw_mode_dbs_capab dbs, enum hw_mode_agile_dfs_capab dfs, enum hw_mode_sbs_capab sbs) @@ -323,6 +331,7 @@ int8_t policy_mgr_get_matching_hw_mode_index( uint32_t t_mac0_tx_ss, t_mac0_rx_ss, t_mac0_bw; uint32_t t_mac1_tx_ss, t_mac1_rx_ss, t_mac1_bw; uint32_t dbs_mode, agile_dfs_mode, sbs_mode; + uint32_t t_mac0_band_cap; int8_t found = -EINVAL; struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -383,8 +392,16 @@ int8_t policy_mgr_get_matching_hw_mode_index( if (sbs_mode != sbs) continue; - found = i; - policy_mgr_debug("hw_mode index %d found", i); + t_mac0_band_cap = POLICY_MGR_HW_MODE_MAC0_BAND_GET( + pm_ctx->hw_mode.hw_mode_list[i]); + if (mac0_band_cap && t_mac0_band_cap != mac0_band_cap) + continue; + + found = POLICY_MGR_HW_MODE_ID_GET( + pm_ctx->hw_mode.hw_mode_list[i]); + + policy_mgr_debug("hw_mode id %d found at %d", found, i); + break; } return found; @@ -396,6 +413,8 @@ int8_t policy_mgr_get_matching_hw_mode_index( * @mac0_bw: MAC0 bandwidth configuration * @mac1_ss: MAC1 spatial stream configuration * @mac1_bw: MAC1 bandwidth configuration + * @mac0_band_cap: mac0 band capability requirement + * (0: Don't care, 1: 2.4G, 2: 5G) * @dbs: HW DBS capability * @dfs: HW Agile DFS capability * @sbs: HW SBS capability @@ -403,6 +422,12 @@ int8_t policy_mgr_get_matching_hw_mode_index( * Get the HW mode index corresponding to the HW modes spatial stream, * bandwidth, DBS, Agile DFS and SBS capability * + * In Genoa two DBS HW modes (2x2 5G + 1x1 2G, 2x2 2G + 1x1 5G), + * the "ss" number and "bw" value are not enough to specify the expected + * HW mode. But in both HW mode, the mac0 can support either 5G or 2G. + * So, the Parameter "mac0_band_cap" will specify the expected band support + * requirement on mac 0 to find the expected HW mode. + * * Return: Index number if a match is found or -negative value if not found */ int8_t policy_mgr_get_hw_mode_idx_from_dbs_hw_list( @@ -411,6 +436,7 @@ int8_t policy_mgr_get_hw_mode_idx_from_dbs_hw_list( enum hw_mode_bandwidth mac0_bw, enum hw_mode_ss_config mac1_ss, enum hw_mode_bandwidth mac1_bw, + enum hw_mode_mac_band_cap mac0_band_cap, enum hw_mode_dbs_capab dbs, enum hw_mode_agile_dfs_capab dfs, enum hw_mode_sbs_capab sbs) @@ -421,24 +447,26 @@ int8_t policy_mgr_get_hw_mode_idx_from_dbs_hw_list( policy_mgr_get_tx_rx_ss_from_config(mac0_ss, &mac0_tx_ss, &mac0_rx_ss); policy_mgr_get_tx_rx_ss_from_config(mac1_ss, &mac1_tx_ss, &mac1_rx_ss); - policy_mgr_debug("MAC0: TxSS=%d, RxSS=%d, BW=%d", - mac0_tx_ss, mac0_rx_ss, mac0_bw); + policy_mgr_debug("MAC0: TxSS=%d, RxSS=%d, BW=%d band=%d", + mac0_tx_ss, mac0_rx_ss, mac0_bw, mac0_band_cap); policy_mgr_debug("MAC1: TxSS=%d, RxSS=%d, BW=%d", - mac1_tx_ss, mac1_rx_ss, mac1_bw); + mac1_tx_ss, mac1_rx_ss, mac1_bw); policy_mgr_debug("DBS=%d, Agile DFS=%d, SBS=%d", - dbs, dfs, sbs); + dbs, dfs, sbs); return policy_mgr_get_matching_hw_mode_index(psoc, mac0_tx_ss, mac0_rx_ss, mac0_bw, mac1_tx_ss, mac1_rx_ss, mac1_bw, + mac0_band_cap, dbs, dfs, sbs); } /** * policy_mgr_get_hw_mode_from_idx() - Get HW mode based on index - * @idx: HW mode index + * @psoc: psoc object + * @idx: HW mode id * @hw_mode: HW mode params * * Fetches the HW mode parameters @@ -452,24 +480,29 @@ QDF_STATUS policy_mgr_get_hw_mode_from_idx( { uint32_t param; struct policy_mgr_psoc_priv_obj *pm_ctx; + uint32_t i, hw_mode_id; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { policy_mgr_err("Invalid Context"); return QDF_STATUS_E_FAILURE; } - - if (idx > pm_ctx->num_dbs_hw_modes) { - policy_mgr_err("Invalid index"); - return QDF_STATUS_E_FAILURE; - } - if (!pm_ctx->num_dbs_hw_modes) { policy_mgr_err("No dbs hw modes available"); return QDF_STATUS_E_FAILURE; } + for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { + param = pm_ctx->hw_mode.hw_mode_list[i]; + hw_mode_id = POLICY_MGR_HW_MODE_ID_GET(param); + if (hw_mode_id == idx) + break; + } + if (i >= pm_ctx->num_dbs_hw_modes) { + policy_mgr_err("hw mode id %d not found", idx); + return QDF_STATUS_E_FAILURE; + } - param = pm_ctx->hw_mode.hw_mode_list[idx]; + param = pm_ctx->hw_mode.hw_mode_list[i]; hw_mode->mac0_tx_ss = POLICY_MGR_HW_MODE_MAC0_TX_STREAMS_GET(param); hw_mode->mac0_rx_ss = POLICY_MGR_HW_MODE_MAC0_RX_STREAMS_GET(param); diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 32d2cbfeb620..0d7655ec3269 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -342,6 +342,7 @@ int8_t policy_mgr_get_matching_hw_mode_index( enum hw_mode_bandwidth mac0_bw, uint32_t mac1_tx_ss, uint32_t mac1_rx_ss, enum hw_mode_bandwidth mac1_bw, + enum hw_mode_mac_band_cap mac0_band_cap, enum hw_mode_dbs_capab dbs, enum hw_mode_agile_dfs_capab dfs, enum hw_mode_sbs_capab sbs); @@ -351,13 +352,10 @@ int8_t policy_mgr_get_hw_mode_idx_from_dbs_hw_list( enum hw_mode_bandwidth mac0_bw, enum hw_mode_ss_config mac1_ss, enum hw_mode_bandwidth mac1_bw, + enum hw_mode_mac_band_cap mac0_band_cap, enum hw_mode_dbs_capab dbs, enum hw_mode_agile_dfs_capab dfs, enum hw_mode_sbs_capab sbs); -QDF_STATUS policy_mgr_get_hw_mode_from_idx( - struct wlan_objmgr_psoc *psoc, - uint32_t idx, - struct policy_mgr_hw_mode_params *hw_mode); QDF_STATUS policy_mgr_get_old_and_new_hw_index( struct wlan_objmgr_psoc *psoc, uint32_t *old_hw_mode_index, From 226214bc25208d3eb02fe4d56af5781a0e617978 Mon Sep 17 00:00:00 2001 From: Nirav Shah Date: Sat, 23 Jun 2018 14:43:23 +0530 Subject: [PATCH 144/187] qcacmn: Map all module logs to per-level log APIs Map all module level log APIs to per-level log APIs to compile out specific log level if required. Change-Id: I4072b6740cb43200fd95c40943b66e1d5f8f1847 CRs-Fixed: 2266719 --- src/wlan_policy_mgr_i.h | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 0d7655ec3269..787c9fe1669e 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -153,23 +153,18 @@ #define POLICY_MGR_DEFAULT_HW_MODE_INDEX 0xFFFF -#define policy_mgr_log(level, args...) \ - QDF_TRACE(QDF_MODULE_ID_POLICY_MGR, level, ## args) -#define policy_mgr_logfl(level, format, args...) \ - policy_mgr_log(level, FL(format), ## args) - -#define policy_mgr_alert(format, args...) \ - policy_mgr_logfl(QDF_TRACE_LEVEL_FATAL, format, ## args) -#define policy_mgr_err(format, args...) \ - policy_mgr_logfl(QDF_TRACE_LEVEL_ERROR, format, ## args) -#define policy_mgr_warn(format, args...) \ - policy_mgr_logfl(QDF_TRACE_LEVEL_WARN, format, ## args) -#define policy_mgr_notice(format, args...) \ - policy_mgr_logfl(QDF_TRACE_LEVEL_INFO, format, ## args) -#define policy_mgr_info(format, args...) \ - policy_mgr_logfl(QDF_TRACE_LEVEL_INFO_HIGH, format, ## args) -#define policy_mgr_debug(format, args...) \ - policy_mgr_logfl(QDF_TRACE_LEVEL_DEBUG, format, ## args) +#define policy_mgr_alert(params...) \ + QDF_TRACE_FATAL(QDF_MODULE_ID_POLICY_MGR, params) +#define policy_mgr_err(params...) \ + QDF_TRACE_ERROR(QDF_MODULE_ID_POLICY_MGR, params) +#define policy_mgr_warn(params...) \ + QDF_TRACE_WARN(QDF_MODULE_ID_POLICY_MGR, params) +#define policy_mgr_notice(params...) \ + QDF_TRACE_INFO(QDF_MODULE_ID_POLICY_MGR, params) +#define policy_mgr_info(params...) \ + QDF_TRACE_INFO(QDF_MODULE_ID_POLICY_MGR, params) +#define policy_mgr_debug(params...) \ + QDF_TRACE_DEBUG(QDF_MODULE_ID_POLICY_MGR, params) #define PM_CONC_CONNECTION_LIST_VALID_INDEX(index) \ ((MAX_NUMBER_OF_CONC_CONNECTIONS > index) && \ From bdffeb8d955fdedc66d894ddd8e9c50a69b5eadf Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Fri, 13 Jul 2018 09:19:09 +0530 Subject: [PATCH 145/187] qcacmn: Fix channel selection in case of DFS in ACS algo The driver includes the DFS channel in case of force SCC, on 5GHz band, and rejects all 2.4Ghz band channels in the ACS scan list in case of band_width > 40. The DFS SCC not allowed till date prevents the SAP vdev up on that DFS channel, hence the SAP turns on with default channel of 2.4 Ghz i.e channel 1, because the ACS scan channel list didn't contain any 2.4Ghz channel. Fix is to include the 2.4Ghz channel list, and remove that DFS channel in case the force SCC is enabled, and STA is already up on that channel. Change-Id: I1dc14d3890d8128e83910c2bed1cb95d7f70ea1c CRs-Fixed: 2261802 --- src/wlan_policy_mgr_get_set_utils.c | 112 +++++++++++++++------------- 1 file changed, 59 insertions(+), 53 deletions(-) diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 281a6845590e..d81e6d17a775 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2887,7 +2887,7 @@ void policy_mgr_trim_acs_channel_list(struct wlan_objmgr_psoc *psoc, uint8_t *org_ch_list, uint8_t *org_ch_list_count) { uint32_t list[MAX_NUMBER_OF_CONC_CONNECTIONS]; - uint32_t index, count, i, ch_list_count; + uint32_t index = 0, count, i, ch_list_count; uint8_t band_mask = 0, ch_5g = 0, ch_24g = 0; uint8_t ch_list[QDF_MAX_NUM_CHAN]; struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -2909,61 +2909,67 @@ void policy_mgr_trim_acs_channel_list(struct wlan_objmgr_psoc *psoc, */ count = policy_mgr_mode_specific_connection_count( psoc, PM_STA_MODE, list); - if (policy_mgr_is_force_scc(psoc) && count) { - index = 0; - while (index < count) { - if (WLAN_REG_IS_24GHZ_CH( - pm_conc_connection_list[list[index]].chan) && - policy_mgr_is_safe_channel(psoc, - pm_conc_connection_list[list[index]].chan)) { - band_mask |= 1; - ch_24g = pm_conc_connection_list[list[index]].chan; - } - if (WLAN_REG_IS_5GHZ_CH( - pm_conc_connection_list[list[index]].chan) && - policy_mgr_is_safe_channel(psoc, - pm_conc_connection_list[list[index]].chan) && - !wlan_reg_is_dfs_ch(pm_ctx->pdev, - pm_conc_connection_list[list[index]].chan) && - !wlan_reg_is_passive_or_disable_ch(pm_ctx->pdev, - pm_conc_connection_list[list[index]].chan)) { - band_mask |= 2; - ch_5g = pm_conc_connection_list[list[index]].chan; - } - index++; + if (!(policy_mgr_is_force_scc(psoc) && count)) + return; + while (index < count) { + if (WLAN_REG_IS_24GHZ_CH( + pm_conc_connection_list[list[index]].chan) && + policy_mgr_is_safe_channel(psoc, + pm_conc_connection_list[list[index]].chan)) { + band_mask |= 1; + ch_24g = pm_conc_connection_list[list[index]].chan; } - ch_list_count = 0; - if (band_mask == 1) { - ch_list[ch_list_count++] = ch_24g; - for (i = 0; i < *org_ch_list_count; i++) { - if (WLAN_REG_IS_24GHZ_CH( - org_ch_list[i])) - continue; - ch_list[ch_list_count++] = - org_ch_list[i]; - } - } else if (band_mask == 2) { - ch_list[ch_list_count++] = ch_5g; - for (i = 0; i < *org_ch_list_count; i++) { - if (WLAN_REG_IS_5GHZ_CH( - org_ch_list[i])) - continue; - ch_list[ch_list_count++] = - org_ch_list[i]; - } - } else if (band_mask == 3) { - ch_list[ch_list_count++] = ch_24g; - ch_list[ch_list_count++] = ch_5g; - } else { - policy_mgr_debug("unexpected band_mask value %d", - band_mask); - return; + if (WLAN_REG_IS_5GHZ_CH( + pm_conc_connection_list[list[index]].chan) && + policy_mgr_is_safe_channel(psoc, + pm_conc_connection_list[list[index]].chan) && + !wlan_reg_is_dfs_ch(pm_ctx->pdev, + pm_conc_connection_list[list[index]].chan) && + !wlan_reg_is_passive_or_disable_ch(pm_ctx->pdev, + pm_conc_connection_list[list[index]].chan)) { + band_mask |= 2; + ch_5g = pm_conc_connection_list[list[index]].chan; } - - *org_ch_list_count = ch_list_count; - for (i = 0; i < *org_ch_list_count; i++) - org_ch_list[i] = ch_list[i]; + index++; } + ch_list_count = 0; + if (band_mask == 1) { + ch_list[ch_list_count++] = ch_24g; + for (i = 0; i < *org_ch_list_count; i++) { + if (WLAN_REG_IS_24GHZ_CH( + org_ch_list[i])) + continue; + ch_list[ch_list_count++] = + org_ch_list[i]; + } + } else if (band_mask == 2) { + if ((reg_get_channel_state(pm_ctx->pdev, ch_5g) == + CHANNEL_STATE_DFS) && + policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan(psoc)) + ch_list[ch_list_count++] = ch_5g; + else if (!(reg_get_channel_state(pm_ctx->pdev, ch_5g) == + CHANNEL_STATE_DFS)) + ch_list[ch_list_count++] = ch_5g; + for (i = 0; i < *org_ch_list_count; i++) { + if (WLAN_REG_IS_5GHZ_CH( + org_ch_list[i])) + continue; + ch_list[ch_list_count++] = + org_ch_list[i]; + } + } else if (band_mask == 3) { + ch_list[ch_list_count++] = ch_24g; + ch_list[ch_list_count++] = ch_5g; + } else { + policy_mgr_debug("unexpected band_mask value %d", + band_mask); + return; + } + + *org_ch_list_count = ch_list_count; + for (i = 0; i < *org_ch_list_count; i++) + org_ch_list[i] = ch_list[i]; + } uint32_t policy_mgr_get_connection_info(struct wlan_objmgr_psoc *psoc, From c0817c6e73e9b20530785b425f64bd9982a35090 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Thu, 19 Jul 2018 14:09:30 -0700 Subject: [PATCH 146/187] qcacmn: Reduce DBS opportunistic timer value to 5 sec Drop the timeout to 5 sec on hastings as it is a 2x2 DBS solution, as IOT issues due to frequent 2x2 to 1x1 or 1x1 to 2x2 transition can be avoided. Change-Id: I67f9c97a7190baeadba79d709a8773b154932e76 CRs-Fixed: 2281954 --- src/wlan_policy_mgr_i.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 787c9fe1669e..393d4d431b38 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -26,7 +26,7 @@ #include "qdf_defer.h" #include "wlan_reg_services_api.h" -#define DBS_OPPORTUNISTIC_TIME 10 +#define DBS_OPPORTUNISTIC_TIME 5 #ifdef QCA_WIFI_3_0_EMU #define CONNECTION_UPDATE_TIMEOUT 3000 #else From a590ecd80e4cd41532ace95fbf9a6eba2c0ec1eb Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Fri, 25 May 2018 00:56:38 -0400 Subject: [PATCH 147/187] qcacmn: Add Band selection for NSS Update API Add parameter to NSS Update API to specify which Band to downgrade/upgrade. Change-Id: I57ae4304fbf8de366531154f03d04792c18e176d CRs-Fixed: 2256803 --- inc/wlan_policy_mgr_public_struct.h | 4 +++- src/wlan_policy_mgr_action.c | 4 ++-- src/wlan_policy_mgr_core.c | 21 ++++++++++++++++++--- src/wlan_policy_mgr_i.h | 14 ++++++++++++++ 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 6b46aab6daaf..448f7b0532da 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -714,6 +714,7 @@ enum policy_mgr_conc_next_action { * * @POLICY_MGR_BAND_24: 2.4 Ghz band * @POLICY_MGR_BAND_5: 5 Ghz band + * @POLICY_MGR_ANY: to specify all band * @POLICY_MGR_MAX_BAND: Max place holder * * These are generic IDs that identify the various roles @@ -722,7 +723,8 @@ enum policy_mgr_conc_next_action { enum policy_mgr_band { POLICY_MGR_BAND_24 = 0, POLICY_MGR_BAND_5, - POLICY_MGR_MAX_BAND + POLICY_MGR_ANY, + POLICY_MGR_MAX_BAND = POLICY_MGR_ANY, }; /** diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 603382bfd95c..2d9cab406595 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -722,7 +722,7 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, * intially. If yes, update the beacon template & notify FW. */ status = policy_mgr_nss_update(psoc, POLICY_MGR_RX_NSS_1, - PM_NOP, reason); + PM_NOP, POLICY_MGR_ANY, reason); break; case PM_UPGRADE: /* @@ -730,7 +730,7 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, * intially. If yes, update the beacon template & notify FW. */ status = policy_mgr_nss_update(psoc, POLICY_MGR_RX_NSS_2, - PM_NOP, reason); + PM_NOP, POLICY_MGR_ANY, reason); break; default: policy_mgr_err("unexpected action value %d", action); diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index b76644192f91..7882bf29ecb9 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -2501,6 +2501,7 @@ static void policy_mgr_nss_update_cb(struct wlan_objmgr_psoc *psoc, QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc, uint8_t new_nss, uint8_t next_action, + enum policy_mgr_band band, enum policy_mgr_conn_update_reason reason) { QDF_STATUS status = QDF_STATUS_E_FAILURE; @@ -2510,6 +2511,7 @@ QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc, uint32_t vdev_id; uint32_t original_nss; struct policy_mgr_psoc_priv_obj *pm_ctx; + uint8_t chan; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -2524,6 +2526,7 @@ QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc, vdev_id = pm_conc_connection_list[list[index]].vdev_id; original_nss = pm_conc_connection_list[list[index]].original_nss; + chan = pm_conc_connection_list[list[index]].chan; qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); conn_index = policy_mgr_get_connection_for_vdev_id( psoc, vdev_id); @@ -2533,7 +2536,12 @@ QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc, continue; } - if (2 == original_nss) { + if (original_nss == 2 && + (band == POLICY_MGR_ANY || + (band == POLICY_MGR_BAND_24 && + WLAN_REG_IS_24GHZ_CH(chan)) || + (band == POLICY_MGR_BAND_5 && + WLAN_REG_IS_5GHZ_CH(chan)))) { status = pm_ctx->sme_cbacks.sme_nss_update_request( vdev_id, new_nss, policy_mgr_nss_update_cb, @@ -2552,6 +2560,7 @@ QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc, vdev_id = pm_conc_connection_list[list[index]].vdev_id; original_nss = pm_conc_connection_list[list[index]].original_nss; + chan = pm_conc_connection_list[list[index]].chan; qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); conn_index = policy_mgr_get_connection_for_vdev_id( psoc, vdev_id); @@ -2560,7 +2569,12 @@ QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc, vdev_id); continue; } - if (2 == original_nss) { + if (original_nss == 2 && + (band == POLICY_MGR_ANY || + (band == POLICY_MGR_BAND_24 && + WLAN_REG_IS_24GHZ_CH(chan)) || + (band == POLICY_MGR_BAND_5 && + WLAN_REG_IS_5GHZ_CH(chan)))) { status = pm_ctx->sme_cbacks.sme_nss_update_request( vdev_id, new_nss, policy_mgr_nss_update_cb, @@ -2608,7 +2622,8 @@ QDF_STATUS policy_mgr_complete_action(struct wlan_objmgr_psoc *psoc, * protection. So, not taking any lock inside * policy_mgr_complete_action() during pm_conc_connection_list access. */ - status = policy_mgr_nss_update(psoc, new_nss, next_action, reason); + status = policy_mgr_nss_update(psoc, new_nss, next_action, + POLICY_MGR_ANY, reason); if (!QDF_IS_STATUS_SUCCESS(status)) status = policy_mgr_next_actions(psoc, session_id, next_action, reason); diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 393d4d431b38..15c9d9b92b61 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -457,7 +457,21 @@ void policy_mgr_reg_chan_change_callback(struct wlan_objmgr_psoc *psoc, struct avoid_freq_ind_data *avoid_freq_ind, void *arg); +/** + * policy_mgr_nss_update() - update nss for AP vdev + * @psoc: PSOC object information + * @new_nss: new NSS value + * @next_action: Next action after nss update + * @band: update AP vdev on the Band. + * @reason: action reason + * + * The function will update AP vdevs on specific band. + * eg. band = POLICY_MGR_ANY will request to update all band (2g and 5g) + * + * Return: QDF_STATUS_SUCCESS, update requested successfully. + */ QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc, uint8_t new_nss, uint8_t next_action, + enum policy_mgr_band band, enum policy_mgr_conn_update_reason reason); #endif From 0351f170cd96ace2062c16109ac312386ad734ac Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Tue, 31 Jul 2018 12:24:57 -0700 Subject: [PATCH 148/187] qcacmn: Do not invoke get_pcl multiple times during set_pcl to FW Do not invoke get_pcl when calculating weightage of channels sent to FW as part of set_pcl WMI command. Change-Id: I62b39aaf0943cf10deab380d8030d1ef08fbbcb3 CRs-Fixed: 2287649 --- inc/wlan_policy_mgr_api.h | 2 +- src/wlan_policy_mgr_core.c | 8 +++--- src/wlan_policy_mgr_get_set_utils.c | 38 +++++++++++++++++------------ src/wlan_policy_mgr_i.h | 20 +++++++++++++++ src/wlan_policy_mgr_pcl.c | 8 +++--- 5 files changed, 53 insertions(+), 23 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 2fa1cd616205..d0e6ee9e7e62 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -379,7 +379,7 @@ bool policy_mgr_is_any_dfs_beaconing_session_present( /** * policy_mgr_allow_concurrency() - Check for allowed concurrency - * combination + * combination consulting the PCL * @psoc: PSOC object information * @mode: new connection mode * @channel: channel on which new connection is coming up diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 7882bf29ecb9..7bd923ed00c9 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -2264,9 +2264,11 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, policy_mgr_debug("pcl len (%d) and weight list len mismatch (%d)", *len, i); - /* check the channel avoidance list */ - policy_mgr_update_with_safe_channel_list(psoc, pcl_channels, len, - pcl_weights, weight_len); + /* check the channel avoidance list for beaconing entities */ + if ((mode == PM_SAP_MODE) || (mode == PM_P2P_GO_MODE)) + policy_mgr_update_with_safe_channel_list(psoc, pcl_channels, + len, pcl_weights, + weight_len); policy_mgr_set_weight_of_dfs_passive_channels_to_zero(psoc, pcl_channels, len, pcl_weights, weight_len); diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index d81e6d17a775..816f3c6a38b9 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1544,16 +1544,15 @@ static bool policy_mgr_is_sub_20_mhz_enabled(struct wlan_objmgr_psoc *psoc) return pm_ctx->user_cfg.sub_20_mhz_enabled; } -bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, - enum policy_mgr_con_mode mode, - uint8_t channel, enum hw_mode_bandwidth bw) +bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint8_t channel, + enum hw_mode_bandwidth bw) { uint32_t num_connections = 0, count = 0, index = 0; bool status = false, match = false; uint32_t list[MAX_NUMBER_OF_CONC_CONNECTIONS]; struct policy_mgr_psoc_priv_obj *pm_ctx; - QDF_STATUS ret; - struct policy_mgr_pcl_list pcl; bool sta_sap_scc_on_dfs_chan; pm_ctx = policy_mgr_get_context(psoc); @@ -1561,16 +1560,6 @@ bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, policy_mgr_err("Invalid Context"); return status; } - - - qdf_mem_zero(&pcl, sizeof(pcl)); - ret = policy_mgr_get_pcl(psoc, mode, pcl.pcl_list, &pcl.pcl_len, - pcl.weight_list, QDF_ARRAY_SIZE(pcl.weight_list)); - if (QDF_IS_STATUS_ERROR(ret)) { - policy_mgr_err("disallow connection:%d", ret); - goto done; - } - /* find the current connection state from pm_conc_connection_list*/ num_connections = policy_mgr_get_connection_count(psoc); @@ -1748,6 +1737,25 @@ done: return status; } +bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint8_t channel, enum hw_mode_bandwidth bw) +{ + QDF_STATUS status; + struct policy_mgr_pcl_list pcl; + + qdf_mem_zero(&pcl, sizeof(pcl)); + status = policy_mgr_get_pcl(psoc, mode, pcl.pcl_list, &pcl.pcl_len, + pcl.weight_list, + QDF_ARRAY_SIZE(pcl.weight_list)); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("disallow connection:%d", status); + return false; + } + + return policy_mgr_is_concurrency_allowed(psoc, mode, channel, bw); +} + /** * policy_mgr_get_concurrency_mode() - return concurrency mode * @psoc: PSOC object information diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 15c9d9b92b61..73d54904b6e9 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -474,4 +474,24 @@ QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc, uint8_t new_nss, uint8_t next_action, enum policy_mgr_band band, enum policy_mgr_conn_update_reason reason); + +/** + * policy_mgr_is_concurrency_allowed() - Check for allowed + * concurrency combination + * @psoc: PSOC object information + * @mode: new connection mode + * @channel: channel on which new connection is coming up + * @bw: Bandwidth requested by the connection (optional) + * + * When a new connection is about to come up check if current + * concurrency combination including the new connection is + * allowed or not based on the HW capability, but no need to + * invoke get_pcl + * + * Return: True/False + */ +bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint8_t channel, + enum hw_mode_bandwidth bw); #endif diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 5303ee8092d1..1a4c8f4c5200 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -222,7 +222,7 @@ void policy_mgr_update_with_safe_channel_list(struct wlan_objmgr_psoc *psoc, pm_ctx->unsafe_channel_list[j]) { /* Found unsafe channel, update it */ is_unsafe = 1; - policy_mgr_warn("CH %d is not safe", + policy_mgr_debug("CH %d is not safe", current_channel_list[i]); break; } @@ -1646,9 +1646,9 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc, * below! */ for (i = 0; i < weight->saved_num_chan; i++) { - if (policy_mgr_allow_concurrency(psoc, PM_STA_MODE, - weight->saved_chan_list[i], - HW_MODE_20_MHZ)) { + if (policy_mgr_is_concurrency_allowed + (psoc, PM_STA_MODE, weight->saved_chan_list[i], + HW_MODE_20_MHZ)) { weight->weighed_valid_list[i] = WEIGHT_OF_NON_PCL_CHANNELS; } From 95bec5aa1989e65e1e7a89a5773db6d791008ebc Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Sun, 22 Jul 2018 14:53:30 -0700 Subject: [PATCH 149/187] qcacmn: Remove struct extended_caps struct extended_caps is unused, so remove it. Change-Id: I96fd072b7d6b58a9c237165fcba7ed8c8da0eae3 CRs-Fixed: 2289156 --- inc/wlan_policy_mgr_public_struct.h | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 448f7b0532da..5cce4910d47f 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -994,23 +994,6 @@ struct dbs_hw_mode_info { uint32_t *hw_mode_list; }; -/** - * struct extended_caps - new extended caps given by firmware - * @num_hw_modes: number of hardware modes for current SOC - * @each_hw_mode_cap: hw mode id to phy id mapping - * @each_phy_cap_per_hwmode: PHY's caps for each hw mode - * @num_phy_for_hal_reg_cap: number of phy for hal reg cap - * @hw_mode_to_mac_cap_map: map between hw_mode to capabilities - */ -struct extended_caps { - WMI_SOC_MAC_PHY_HW_MODE_CAPS num_hw_modes; - WMI_HW_MODE_CAPABILITIES *each_hw_mode_cap; - WMI_MAC_PHY_CAPABILITIES *each_phy_cap_per_hwmode; - WMI_SOC_HAL_REG_CAPABILITIES num_phy_for_hal_reg_cap; - WMI_HAL_REG_CAPABILITIES_EXT *each_phy_hal_reg_cap; - struct hw_mode_idx_to_mac_cap_idx *hw_mode_to_mac_cap_map; -}; - /** * struct dual_mac_config - Dual MAC configurations * @prev_scan_config: Previous scan configuration From 2b083b6daa9c9a6c12ff2befa35e3401cd68bf9c Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Mon, 6 Aug 2018 13:39:23 -0700 Subject: [PATCH 150/187] qcacmn: Add ENABLE_DBS_CXN_AND_DISABLE_SIMULTANEOUS_SCAN Add ENABLE_DBS_CXN_AND_DISABLE_SIMULTANEOUS_SCAN option for the ini gDualMacFeatureDisable. This is to enable DBS support for the connection and disable simultaneous scan from upper layer. But DBS scan remains enabled in FW. Change-Id: Ic280de2cc63a3775c0d9dd61985ff89df58a4a89 CRs-Fixed: 2291935 --- inc/wlan_policy_mgr_public_struct.h | 6 +++++- src/wlan_policy_mgr_get_set_utils.c | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 5cce4910d47f..ea748b230b35 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -835,6 +835,9 @@ enum policy_mgr_hw_mode_change { * connection and scan but switch off the async scan * @ENABLE_DBS_CXN_AND_DISABLE_DBS_SCAN: Enable DBS support for connection and * disable DBS support for scan + * @ENABLE_DBS_CXN_AND_DISABLE_SIMULTANEOUS_SCAN: Enable DBS + * support for connection and disable simultaneous scan from + * upper layer (DBS scan remains enabled in FW) */ enum dbs_support { ENABLE_DBS_CXN_AND_SCAN, @@ -842,7 +845,8 @@ enum dbs_support { DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN, DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN_WITH_ASYNC_SCAN_OFF, ENABLE_DBS_CXN_AND_ENABLE_SCAN_WITH_ASYNC_SCAN_OFF, - ENABLE_DBS_CXN_AND_DISABLE_DBS_SCAN + ENABLE_DBS_CXN_AND_DISABLE_DBS_SCAN, + ENABLE_DBS_CXN_AND_DISABLE_SIMULTANEOUS_SCAN, }; /** diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 816f3c6a38b9..41d961f120ab 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2740,6 +2740,8 @@ bool policy_mgr_is_scan_simultaneous_capable(struct wlan_objmgr_psoc *psoc) if ((DISABLE_DBS_CXN_AND_SCAN == wlan_objmgr_psoc_get_dual_mac_disable(psoc)) || (ENABLE_DBS_CXN_AND_DISABLE_DBS_SCAN == + wlan_objmgr_psoc_get_dual_mac_disable(psoc)) || + (ENABLE_DBS_CXN_AND_DISABLE_SIMULTANEOUS_SCAN == wlan_objmgr_psoc_get_dual_mac_disable(psoc))) return false; From c304f8924df156919e076401d892ce0c0a0c1bfb Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Wed, 1 Aug 2018 19:15:55 -0700 Subject: [PATCH 151/187] qcacmn: Do HW mode change based on all the candidate APs for STA The driver currently changes the hw_mode based upon the first candidate found in the scan list, and tries to connect to it. It may happen that the connection fails, and the STA then tries to connect to the AP on same channel as the concurrent adapter. It would result in hw_mode = DBS, as it is not updated after connection success/failure. Also if the first AP channel is in same band as that of concurrent adapter, and the connection fails, and the STA tries to connect to an AP in a different band, this too is not allowed as hw_mode is not DBS Fix is to change the hw_mode based upon the scan list. If the driver finds any scan result which may lead to DBS connection, the hw_mode should be set to DBS. Once the connection is done or failed, the driver can check and update the hw_mode again. Change-Id: I3c186f47dd5528f0af2598bb02c1b7e297d01548 CRs-Fixed: 2290760 --- inc/wlan_policy_mgr_api.h | 12 ++++++++++++ src/wlan_policy_mgr_action.c | 34 +++++++++++++++++++++++++++++++++- src/wlan_policy_mgr_pcl.c | 11 +---------- 3 files changed, 46 insertions(+), 11 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index d0e6ee9e7e62..f9d38dc4c9b6 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -704,6 +704,18 @@ enum policy_mgr_con_mode policy_mgr_convert_device_mode_to_qdf_type( enum QDF_OPMODE policy_mgr_get_qdf_mode_from_pm( enum policy_mgr_con_mode device_mode); +/** + * policy_mgr_check_n_start_opportunistic_timer - check single mac upgrade + * needed or not, if needed start the oppurtunistic timer. + * @psoc: pointer to SOC + * + * This function starts the oppurtunistic timer if hw_mode change is needed + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_check_n_start_opportunistic_timer( + struct wlan_objmgr_psoc *psoc); + /** * policy_mgr_pdev_set_hw_mode() - Set HW mode command to FW * @psoc: PSOC object information diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 2d9cab406595..061a068e6eb0 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -93,6 +93,29 @@ void policy_mgr_hw_mode_transition_cb(uint32_t old_hw_mode_index, return; } +QDF_STATUS policy_mgr_check_n_start_opportunistic_timer( + struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + QDF_STATUS status = QDF_STATUS_E_FAILURE; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("PM ctx not valid. Oppurtunistic timer cannot start"); + return QDF_STATUS_E_FAILURE; + } + if (policy_mgr_need_opportunistic_upgrade(psoc)) { + /* let's start the timer */ + qdf_mc_timer_stop(&pm_ctx->dbs_opportunistic_timer); + status = qdf_mc_timer_start( + &pm_ctx->dbs_opportunistic_timer, + DBS_OPPORTUNISTIC_TIME * 1000); + if (!QDF_IS_STATUS_SUCCESS(status)) + policy_mgr_err("Failed to start dbs opportunistic timer"); + } + return status; +} + QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc, uint32_t session_id, enum hw_mode_ss_config mac0_ss, @@ -1458,13 +1481,22 @@ void policy_mgr_checkn_update_hw_mode_single_mac_mode( qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); for (i = 0; i < MAX_NUMBER_OF_CONC_CONNECTIONS; i++) { - if (pm_conc_connection_list[i].in_use) + if (pm_conc_connection_list[i].in_use) { if (!WLAN_REG_IS_SAME_BAND_CHANNELS(channel, pm_conc_connection_list[i].chan)) { qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); policy_mgr_debug("DBS required"); return; } + if (policy_mgr_is_hw_dbs_2x2_capable(psoc) && + (WLAN_REG_IS_24GHZ_CH(channel) || + WLAN_REG_IS_24GHZ_CH + (pm_conc_connection_list[i].chan))) { + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + policy_mgr_debug("DBS required"); + return; + } + } } qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); pm_dbs_opportunistic_timer_handler((void *)psoc); diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 1a4c8f4c5200..e41025045d5d 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -130,16 +130,7 @@ void policy_mgr_decr_session_set_pcl(struct wlan_objmgr_psoc *psoc, */ policy_mgr_set_pcl_for_existing_combo(psoc, PM_STA_MODE); /* do we need to change the HW mode */ - if (policy_mgr_need_opportunistic_upgrade(psoc)) { - /* let's start the timer */ - qdf_mc_timer_stop(&pm_ctx->dbs_opportunistic_timer); - qdf_status = qdf_mc_timer_start( - &pm_ctx->dbs_opportunistic_timer, - DBS_OPPORTUNISTIC_TIME * 1000); - if (!QDF_IS_STATUS_SUCCESS(qdf_status)) - policy_mgr_err("Failed to start dbs opportunistic timer"); - } - + policy_mgr_check_n_start_opportunistic_timer(psoc); return; } From 1a18faf9e8faa5ee290877c96fed276892ec3540 Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Mon, 16 Jul 2018 06:39:29 -0400 Subject: [PATCH 152/187] qcacmn: Limit concurrency of STA(WAPI) When STA role is coexisting with other sessions(P2P, SAP or IBSS), WAPI encryption mode is not allowed. Add a new API to check if the connection/start request should be rejected when: 1) A STA with WAPI encryption is to be connected while there is at least one concurrent session already running. 2) A new session is to be started while there is already a STA connection with WAPI encryption enabled. Change-Id: Idf0d346138eeda339254535f1f7131fda4a5086a CRs-Fixed: 2290549 --- inc/wlan_policy_mgr_api.h | 5 +++++ src/wlan_policy_mgr_get_set_utils.c | 28 ++++++++++++++++++++++++++++ src/wlan_policy_mgr_init_deinit.c | 2 ++ 3 files changed, 35 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index f9d38dc4c9b6..7dc6d12ba209 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -871,6 +871,10 @@ struct policy_mgr_sme_cbacks { * SAP * @get_mode_for_non_connected_vdev: Get the mode for a non * connected vdev + * @hdd_get_device_mode: Get QDF_OPMODE type for session id (vdev id) + * @hdd_wapi_security_sta_exist: Get whether wapi encription station existing + * or not. Some hw doesn't support WAPI encryption concurrency with other + * encryption type. */ struct policy_mgr_hdd_cbacks { void (*sap_restart_chan_switch_cb)(struct wlan_objmgr_psoc *psoc, @@ -885,6 +889,7 @@ struct policy_mgr_hdd_cbacks { struct wlan_objmgr_psoc *psoc, uint8_t vdev_id); enum QDF_OPMODE (*hdd_get_device_mode)(uint32_t session_id); + bool (*hdd_wapi_security_sta_exist)(void); }; diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 41d961f120ab..9079e721b02a 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1544,6 +1544,29 @@ static bool policy_mgr_is_sub_20_mhz_enabled(struct wlan_objmgr_psoc *psoc) return pm_ctx->user_cfg.sub_20_mhz_enabled; } +/** + * policy_mgr_check_privacy_for_new_conn() - Check privacy mode concurrency + * @pm_ctx: policy_mgr_psoc_priv_obj policy mgr context + * + * This routine is called to check vdev security mode allowed in concurrency. + * At present, WAPI security mode is not allowed to run concurrency with any + * other vdev. + * + * Return: true - allow + */ +static bool policy_mgr_check_privacy_for_new_conn( + struct policy_mgr_psoc_priv_obj *pm_ctx) +{ + if (!pm_ctx->hdd_cbacks.hdd_wapi_security_sta_exist) + return true; + + if (pm_ctx->hdd_cbacks.hdd_wapi_security_sta_exist() && + (policy_mgr_get_connection_count(pm_ctx->psoc) > 0)) + return false; + + return true; +} + bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, uint8_t channel, @@ -1731,6 +1754,11 @@ bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc, qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); } + if (!policy_mgr_check_privacy_for_new_conn(pm_ctx)) { + policy_mgr_err("Don't allow new conn when wapi security conn existing"); + goto done; + } + status = true; done: diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 83528a963e27..322de079032d 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -581,6 +581,8 @@ QDF_STATUS policy_mgr_register_hdd_cb(struct wlan_objmgr_psoc *psoc, hdd_cbacks->get_mode_for_non_connected_vdev; pm_ctx->hdd_cbacks.hdd_get_device_mode = hdd_cbacks->hdd_get_device_mode; + pm_ctx->hdd_cbacks.hdd_wapi_security_sta_exist = + hdd_cbacks->hdd_wapi_security_sta_exist; return QDF_STATUS_SUCCESS; } From 18de9c1b54b359702d9775e24fa9fff21313f843 Mon Sep 17 00:00:00 2001 From: Nirav Shah Date: Tue, 24 Jul 2018 16:33:11 +0530 Subject: [PATCH 153/187] qcacmn: umac: Add logging macros without function/line info Add per module logging macros without function/line info to avoid adding function/line info where it is not required. Change-Id: I34ba6f6485f9b506264daf4e116052d2858bed40 CRs-Fixed: 2278876 --- src/wlan_policy_mgr_i.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 73d54904b6e9..cf6ac6d943af 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -166,6 +166,17 @@ #define policy_mgr_debug(params...) \ QDF_TRACE_DEBUG(QDF_MODULE_ID_POLICY_MGR, params) +#define policymgr_nofl_alert(params...) \ + QDF_TRACE_FATAL_NO_FL(QDF_MODULE_ID_POLICY_MGR, params) +#define policymgr_nofl_err(params...) \ + QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_POLICY_MGR, params) +#define policymgr_nofl_warn(params...) \ + QDF_TRACE_WARN_NO_FL(QDF_MODULE_ID_POLICY_MGR, params) +#define policymgr_nofl_info(params...) \ + QDF_TRACE_INFO_NO_FL(QDF_MODULE_ID_POLICY_MGR, params) +#define policymgr_nofl_debug(params...) \ + QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_POLICY_MGR, params) + #define PM_CONC_CONNECTION_LIST_VALID_INDEX(index) \ ((MAX_NUMBER_OF_CONC_CONNECTIONS > index) && \ (pm_conc_connection_list[index].in_use)) From 59d68afe2e99f62d4f51145635c1559448f0bf66 Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Thu, 2 Aug 2018 21:23:58 +0530 Subject: [PATCH 154/187] qcacmn: Remove dual beacon MCC check from SCC check case In the API policy_mgr_dual_beacon_on_single_mac_scc_capable the check of wmi_service_dual_beacon_on_single_mac_mcc_support is there too, which in any case is void, as if the driver supports SCC, then it will return true from the first check itself, and if it doesn't support SCC, it will surely not support MCC too, so the check of MCC after SCC is void anyways Fix is to remove the check of MCC dual beaconing capability from policy_mgr_dual_beacon_on_single_mac_scc_capable Change-Id: Ia427be4fcee0e0267171d81cf7e8e669560d20a9 CRs-Fixed: 2299182 --- src/wlan_policy_mgr_get_set_utils.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 9079e721b02a..c2a1b704bf6f 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -3118,16 +3118,10 @@ bool policy_mgr_dual_beacon_on_single_mac_scc_capable( if (wmi_service_enabled( wmi_handle, wmi_service_dual_beacon_on_single_mac_scc_support)) { - policy_mgr_debug("Support dual beacon on same channel on single MAC"); + policy_mgr_debug("Dual beaconing on same channel on single MAC supported"); return true; } - if (wmi_service_enabled( - wmi_handle, - wmi_service_dual_beacon_on_single_mac_mcc_support)) { - policy_mgr_debug("Support dual beacon on both different and same channel on single MAC"); - return true; - } - policy_mgr_debug("Not support dual beacon on same channel on single MAC"); + policy_mgr_debug("Dual beaconing on same channel on single MAC is not supported"); return false; } @@ -3145,10 +3139,10 @@ bool policy_mgr_dual_beacon_on_single_mac_mcc_capable( if (wmi_service_enabled( wmi_handle, wmi_service_dual_beacon_on_single_mac_mcc_support)) { - policy_mgr_debug("Support dual beacon on different channel on single MAC"); + policy_mgr_debug("Dual beaconing on different channel on single MAC supported"); return true; } - policy_mgr_debug("Not support dual beacon on different channel on single MAC"); + policy_mgr_debug("Dual beaconing on different channel on single MAC is not supported"); return false; } From 0eaef9f0388ccfdc3f9ddf700dd85c109f90b99d Mon Sep 17 00:00:00 2001 From: jiad Date: Fri, 10 Aug 2018 18:21:04 +0800 Subject: [PATCH 155/187] qcacmn: Add SAP-SAP-SAP policy manager next actions SAP-SAP-SAP next actions in policy manager are missing. Fix is to add SAP-SAP-SAP next actions so that correct actions can be taken, such as DBS mode can be enabled. Change-Id: I347540d9aabf44ed59e7be8b695e87dd8d129aea CRs-Fixed: 2297763 --- src/wlan_policy_mgr_tables_1x1_dbs_i.h | 5 ++++- src/wlan_policy_mgr_tables_2x2_dbs_i.h | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/wlan_policy_mgr_tables_1x1_dbs_i.h b/src/wlan_policy_mgr_tables_1x1_dbs_i.h index 92501e8872ce..b1f193fe53d9 100644 --- a/src/wlan_policy_mgr_tables_1x1_dbs_i.h +++ b/src/wlan_policy_mgr_tables_1x1_dbs_i.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1165,6 +1165,9 @@ static policy_mgr_next_action_three_connection_table_type [PM_P2P_CLI_SAP_MCC_24_5_2x2] = {PM_DBS_DOWNGRADE, PM_DBS_DOWNGRADE}, [PM_P2P_CLI_SAP_DBS_1x1] = {PM_NOP, PM_NOP}, + [PM_SAP_SAP_SCC_24_1x1] = {PM_NOP, PM_DBS}, + [PM_SAP_SAP_SCC_5_1x1] = {PM_DBS, PM_NOP}, + }; #endif diff --git a/src/wlan_policy_mgr_tables_2x2_dbs_i.h b/src/wlan_policy_mgr_tables_2x2_dbs_i.h index dd11a9faea0a..370c38cff509 100644 --- a/src/wlan_policy_mgr_tables_2x2_dbs_i.h +++ b/src/wlan_policy_mgr_tables_2x2_dbs_i.h @@ -1384,6 +1384,11 @@ static policy_mgr_next_action_three_connection_table_type [PM_STA_STA_DBS_2x2] = {PM_NOP, PM_NOP}, [PM_STA_STA_SBS_5_1x1] = {PM_DBS_UPGRADE, PM_NOP}, + [PM_SAP_SAP_SCC_24_1x1] = {PM_NOP, PM_DBS}, + [PM_SAP_SAP_SCC_24_2x2] = {PM_NOP, PM_DBS}, + [PM_SAP_SAP_SCC_5_1x1] = {PM_DBS, PM_NOP}, + [PM_SAP_SAP_SCC_5_2x2] = {PM_DBS, PM_NOP}, + }; #endif From 0f192096cdc3f74fab47bb2eb96475e5e34e1ced Mon Sep 17 00:00:00 2001 From: jiad Date: Fri, 10 Aug 2018 15:23:12 +0800 Subject: [PATCH 156/187] qcacmn: Fix SAP-SAP concurrency when they are on single band Currently SAP-SAP concurrency on same band support is indicated through WMI service bit wmi_service_dual_beacon_on_single_mac_scc_support and wmi_service_dual_beacon_on_single_mac_mcc_support. If SCC is supported, channel of desirable SAP is checked against current available SAP interfaces. If channel is different, the desirable SAP is disallowed. Issue is that on DBS capable platforms, this will prevent second SAP from doing DBS. Fix is to check if desirable channel is equal to current SAP interfaces. If equal, SAP-SAP SCC will be allowed. Otherwise fall back to DBS checks and SCC/MCC on single band will be rejected if above two service bits check failed or not supported. Change-Id: I4bfbe5804003797e087bd0234b999cfe1eb4290a CRs-Fixed: 2297756 --- src/wlan_policy_mgr_get_set_utils.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index c2a1b704bf6f..d27f61c5709e 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -3069,13 +3069,12 @@ bool policy_mgr_allow_sap_go_concurrency(struct wlan_objmgr_psoc *psoc, pm_conc_connection_list[id].chan; if (((con_mode == PM_SAP_MODE) || (con_mode == PM_P2P_GO_MODE)) && - (channel != con_chan)) { - policy_mgr_debug("Scc is supported, but first SAP and second SAP are not in same channel, So don't allow second SAP interface"); - return false; + (channel == con_chan)) { + policy_mgr_debug("Scc is supported, allow second SAP interface"); + return true; } } } - return true; } if (!policy_mgr_is_hw_dbs_capable(psoc)) { policy_mgr_debug("DBS is not supported, mcc and scc are not supported too, don't allow second SAP interface"); From 15ca8ea97a238cadbc7ae915c27103fe5a99a118 Mon Sep 17 00:00:00 2001 From: Bala Venkatesh Date: Tue, 21 Aug 2018 19:00:36 +0530 Subject: [PATCH 157/187] qcacmn: Re initialize default SAP mandatory channel list Re initialize default SAP mandatory channel list as part of the start bss. Without this change the 5GHz channels which were added as part of previous start bss are valid for the current start bss operation. Change-Id: Id234b413bbddb05efd3af8c3349271bf93a0a3bd CRs-Fixed: 2300501 --- src/wlan_policy_mgr_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 7bd923ed00c9..8417228ae08a 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -2981,6 +2981,8 @@ void policy_mgr_init_sap_mandatory_2g_chan(struct wlan_objmgr_psoc *psoc) policy_mgr_err("Error in getting valid channels"); return; } + pm_ctx->sap_mandatory_channels_len = 0; + for (i = 0; i < len; i++) { if (WLAN_REG_IS_24GHZ_CH(chan_list[i])) { policy_mgr_debug("Add chan %hu to mandatory list", From 1830013b3fd62f610e095dd086122d16948c7f5b Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Fri, 25 May 2018 01:25:24 -0400 Subject: [PATCH 158/187] qcacmn: Add 2x2+1x1 DBS Action type Add new DBS Action types and handle the Actions in policy_mgr_next_actions API. Change-Id: Iccc62303383c0701955446a172ed956d1aea0e0f CRs-Fixed: 2257692 --- inc/wlan_policy_mgr_api.h | 40 ++++++ inc/wlan_policy_mgr_public_struct.h | 19 ++- src/wlan_policy_mgr_action.c | 190 ++++++++++++++++++++++++---- src/wlan_policy_mgr_core.c | 27 +++- src/wlan_policy_mgr_get_set_utils.c | 81 +++++++++++- 5 files changed, 328 insertions(+), 29 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 7dc6d12ba209..7a70a04bfe6f 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1730,11 +1730,51 @@ bool policy_mgr_is_current_hwmode_dbs(struct wlan_objmgr_psoc *psoc); * DBS and there is no need for downgrading while entering DBS. * true: DBS 2x2 can always be supported * false: hw_modes support DBS 1x1 as well + * Genoa DBS 2x2 + 1x1 will not be included. * * Return: true - DBS2x2, false - DBS1x1 */ bool policy_mgr_is_hw_dbs_2x2_capable(struct wlan_objmgr_psoc *psoc); +/* + * policy_mgr_is_2x2_1x1_dbs_capable() - check 2x2+1x1 DBS supported or not + * @psoc: PSOC object data + * + * This routine is called to check 2x2 5G + 1x1 2G (DBS1) or + * 2x2 2G + 1x1 5G (DBS2) support or not. + * Either DBS1 or DBS2 supported + * + * Return: true/false + */ +bool policy_mgr_is_2x2_1x1_dbs_capable(struct wlan_objmgr_psoc *psoc); + +/* + * policy_mgr_is_2x2_5G_1x1_2G_dbs_capable() - check Genoa DBS1 enabled or not + * @psoc: PSOC object data + * + * This routine is called to check support DBS1 or not. + * Notes: DBS1: 2x2 5G + 1x1 2G. + * This function will call policy_mgr_get_hw_mode_idx_from_dbs_hw_list to match + * the HW mode from hw mode list. The parameters will also be matched to + * 2x2 5G +2x2 2G HW mode. But firmware will not report 2x2 5G + 2x2 2G alone + * with 2x2 5G + 1x1 2G at same time. So, it is safe to find DBS1 with + * policy_mgr_get_hw_mode_idx_from_dbs_hw_list. + * + * Return: true/false + */ +bool policy_mgr_is_2x2_5G_1x1_2G_dbs_capable(struct wlan_objmgr_psoc *psoc); + +/* + * policy_mgr_is_2x2_2G_1x1_5G_dbs_capable() - check Genoa DBS2 enabled or not + * @psoc: PSOC object data + * + * This routine is called to check support DBS2 or not. + * Notes: DBS2: 2x2 2G + 1x1 5G + * + * Return: true/false + */ +bool policy_mgr_is_2x2_2G_1x1_5G_dbs_capable(struct wlan_objmgr_psoc *psoc); + /** * policy_mgr_init() - Policy Manager component initialization * routine diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index ea748b230b35..021ad962227b 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -689,6 +689,12 @@ enum policy_mgr_two_connection_mode { * @PM_SBS_DOWNGRADE: switch to SBS mode & downgrade to 1x1 * @PM_DOWNGRADE: downgrade to 1x1 * @PM_UPGRADE: upgrade to 2x2 + * @PM_DBS1: switch to DBS 1 + * @PM_DBS1_DOWNGRADE: downgrade 2G beaconing entity to 1x1 and switch to DBS1. + * @PM_DBS2: switch to DBS 2 + * @PM_DBS2_DOWNGRADE: downgrade 5G beaconing entity to 1x1 and switch to DBS2. + * @PM_UPGRADE_5G: upgrade 5g beaconing entity to 2x2. + * @PM_UPGRADE_2G: upgrade 2g beaconing entity to 2x2. * @PM_MAX_CONC_PRIORITY_MODE: Max place holder * * These are generic IDs that identify the various roles @@ -705,6 +711,12 @@ enum policy_mgr_conc_next_action { PM_SBS_DOWNGRADE, PM_DOWNGRADE, PM_UPGRADE, + PM_DBS1, + PM_DBS1_DOWNGRADE, + PM_DBS2, + PM_DBS2_DOWNGRADE, + PM_UPGRADE_5G, + PM_UPGRADE_2G, PM_MAX_CONC_NEXT_ACTION }; @@ -882,8 +894,10 @@ struct policy_mgr_conc_connection_info { * @mac0_bw: MAC0 bandwidth * @mac1_bw: MAC1 bandwidth * @mac0_band_cap: mac0 band (5g/2g) capability - * @dbs_cap: DBS capability - * @agile_dfs_cap: Agile DFS capability + * @dbs_cap: DBS capabality + * @agile_dfs_cap: Agile DFS capabality + * @action_type: for dbs mode, the field indicates the "Action type" to be + * used to switch to the mode. To help the hw mode validation. */ struct policy_mgr_hw_mode_params { uint8_t mac0_tx_ss; @@ -896,6 +910,7 @@ struct policy_mgr_hw_mode_params { uint8_t dbs_cap; uint8_t agile_dfs_cap; uint8_t sbs_cap; + enum policy_mgr_conc_next_action action_type; }; /** diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 061a068e6eb0..5f90175345b7 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -620,14 +620,108 @@ done: return status; } -QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, +/** + * policy_mgr_validate_dbs_switch() - Check DBS action valid or not + * @psoc: Pointer to psoc + * @session_id: vdev id + * @action: action requested + * @reason: reason of hw mode change + * + * This routine will check the current hw mode with requested action. + * If we are already in the mode, the caller will do nothing. + * This will be called by policy_mgr_next_actions to check the action needed + * or not. + * + * return : QDF_STATUS_SUCCESS, action is allowed. + * QDF_STATUS_E_ALREADY, action is not needed. + * QDF_STATUS_E_FAILURE, error happens. + * QDF_STATUS_E_NOSUPPORT, the requested mode not supported. + */ +static +QDF_STATUS policy_mgr_validate_dbs_switch( + struct wlan_objmgr_psoc *psoc, + uint32_t session_id, + enum policy_mgr_conc_next_action action, + enum policy_mgr_conn_update_reason reason) +{ + QDF_STATUS status; + struct policy_mgr_hw_mode_params hw_mode; + + /* check for the current HW index to see if really need any action */ + status = policy_mgr_get_current_hw_mode(psoc, &hw_mode); + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("policy_mgr_get_current_hw_mode failed"); + return status; + } + + if (hw_mode.sbs_cap) { + if ((action == PM_SBS) || (action == PM_SBS_DOWNGRADE)) { + if (!policy_mgr_is_hw_sbs_capable(psoc)) { + /* No action */ + policy_mgr_notice("firmware is not sbs capable"); + return QDF_STATUS_E_NOSUPPORT; + } + /* current mode is already SBS nothing to be + * done + */ + policy_mgr_notice("current mode is already SBS"); + return QDF_STATUS_E_ALREADY; + } else { + return QDF_STATUS_SUCCESS; + } + } + + if (!hw_mode.dbs_cap) { + if (action == PM_SINGLE_MAC || + action == PM_SINGLE_MAC_UPGRADE) { + policy_mgr_notice("current mode is already single MAC"); + return QDF_STATUS_E_ALREADY; + } else { + return QDF_STATUS_SUCCESS; + } + } + /** + * If already in DBS, no need to request DBS again (HL, Napier). + * For dual DBS HW, in case DBS1 -> DBS2 or DBS2 -> DBS1 + * switching, we need to check the current DBS mode is same as + * requested or not. + */ + if (policy_mgr_is_2x2_5G_1x1_2G_dbs_capable(psoc) || + policy_mgr_is_2x2_2G_1x1_5G_dbs_capable(psoc)) { + policy_mgr_info("curr dbs action %d new action %d", + hw_mode.action_type, action); + if (hw_mode.action_type == PM_DBS1 && + ((action == PM_DBS1 || + action == PM_DBS1_DOWNGRADE))) { + policy_mgr_err("driver is already in DBS_5G_2x2_24G_1x1 (%d), no further action %d needed", + hw_mode.action_type, action); + return QDF_STATUS_E_ALREADY; + } else if (hw_mode.action_type == PM_DBS2 && + ((action == PM_DBS2 || + action == PM_DBS2_DOWNGRADE))) { + policy_mgr_err("driver is already in DBS_24G_2x2_5G_1x1 (%d), no further action %d needed", + hw_mode.action_type, action); + return QDF_STATUS_E_ALREADY; + } + } else if ((action == PM_DBS_DOWNGRADE) || (action == PM_DBS) || + (action == PM_DBS_UPGRADE)) { + policy_mgr_err("driver is already in %s mode, no further action needed", + (hw_mode.dbs_cap) ? "dbs" : "non dbs"); + return QDF_STATUS_E_ALREADY; + } + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_next_actions( + struct wlan_objmgr_psoc *psoc, uint32_t session_id, enum policy_mgr_conc_next_action action, enum policy_mgr_conn_update_reason reason) { QDF_STATUS status = QDF_STATUS_E_FAILURE; - struct policy_mgr_hw_mode_params hw_mode; struct dbs_nss nss_dbs = {0}; + struct policy_mgr_hw_mode_params hw_mode; + enum policy_mgr_conc_next_action next_action; if (policy_mgr_is_hw_dbs_capable(psoc) == false) { policy_mgr_err("driver isn't dbs capable, no further action needed"); @@ -640,28 +734,14 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, policy_mgr_err("policy_mgr_get_current_hw_mode failed"); return status; } - /** - * if already in DBS no need to request DBS. Might be needed - * to extend the logic when multiple dbs HW mode is available - */ - if ((((PM_DBS_DOWNGRADE == action) || (PM_DBS == action) || - (PM_DBS_UPGRADE == action)) - && hw_mode.dbs_cap)) { - policy_mgr_err("driver is already in %s mode, no further action needed", - (hw_mode.dbs_cap) ? "dbs" : "non dbs"); - return QDF_STATUS_E_ALREADY; - } - - if ((PM_SBS == action) || (action == PM_SBS_DOWNGRADE)) { - if (!policy_mgr_is_hw_sbs_capable(psoc)) { - /* No action */ - policy_mgr_notice("firmware is not sbs capable"); - return QDF_STATUS_E_NOSUPPORT; - } - /* check if current mode is already SBS nothing to be - * done - */ + /* check for the current HW index to see if really need any action */ + status = policy_mgr_validate_dbs_switch(psoc, session_id, action, + reason); + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err(" not take action %d reason %d session %d status %d", + action, reason, session_id, status); + return status; } switch (action) { @@ -755,6 +835,70 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc, status = policy_mgr_nss_update(psoc, POLICY_MGR_RX_NSS_2, PM_NOP, POLICY_MGR_ANY, reason); break; + case PM_DBS1_DOWNGRADE: + status = policy_mgr_complete_action(psoc, POLICY_MGR_RX_NSS_1, + PM_DBS1, reason, + session_id); + break; + case PM_DBS2_DOWNGRADE: + status = policy_mgr_complete_action(psoc, POLICY_MGR_RX_NSS_1, + PM_DBS2, reason, + session_id); + break; + case PM_DBS1: + /* + * PM_DBS1 (2x2 5G + 1x1 2G) will support 5G 2x2. If previous + * mode is DBS, that should be 2x2 2G + 1x1 5G mode and + * the 5G band was downgraded to 1x1. So, we need to + * upgrade 5G vdevs after hw mode change. + */ + if (hw_mode.dbs_cap) + next_action = PM_UPGRADE_5G; + else + next_action = PM_NOP; + status = policy_mgr_pdev_set_hw_mode( + psoc, session_id, + HW_MODE_SS_2x2, + HW_MODE_80_MHZ, + HW_MODE_SS_1x1, HW_MODE_40_MHZ, + HW_MODE_MAC_BAND_5G, + HW_MODE_DBS, + HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS_NONE, + reason, next_action); + break; + case PM_DBS2: + /* + * PM_DBS2 (2x2 2G + 1x1 5G) will support 2G 2x2. If previous + * mode is DBS, that should be 2x2 5G + 1x1 2G mode and + * the 2G band was downgraded to 1x1. So, we need to + * upgrade 5G vdevs after hw mode change. + */ + if (hw_mode.dbs_cap) + next_action = PM_UPGRADE_2G; + else + next_action = PM_NOP; + status = policy_mgr_pdev_set_hw_mode( + psoc, session_id, + HW_MODE_SS_2x2, + HW_MODE_40_MHZ, + HW_MODE_SS_1x1, HW_MODE_40_MHZ, + HW_MODE_MAC_BAND_2G, + HW_MODE_DBS, + HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS_NONE, + reason, next_action); + break; + case PM_UPGRADE_5G: + status = policy_mgr_nss_update( + psoc, POLICY_MGR_RX_NSS_2, + PM_NOP, POLICY_MGR_BAND_5, reason); + break; + case PM_UPGRADE_2G: + status = policy_mgr_nss_update( + psoc, POLICY_MGR_RX_NSS_2, + PM_NOP, POLICY_MGR_BAND_24, reason); + break; default: policy_mgr_err("unexpected action value %d", action); status = QDF_STATUS_E_FAILURE; diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 8417228ae08a..e7f2303e8fa1 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -480,6 +480,8 @@ QDF_STATUS policy_mgr_get_hw_mode_from_idx( { uint32_t param; struct policy_mgr_psoc_priv_obj *pm_ctx; + uint8_t mac0_min_ss; + uint8_t mac1_min_ss; uint32_t i, hw_mode_id; pm_ctx = policy_mgr_get_context(psoc); @@ -514,7 +516,20 @@ QDF_STATUS policy_mgr_get_hw_mode_from_idx( hw_mode->dbs_cap = POLICY_MGR_HW_MODE_DBS_MODE_GET(param); hw_mode->agile_dfs_cap = POLICY_MGR_HW_MODE_AGILE_DFS_GET(param); hw_mode->sbs_cap = POLICY_MGR_HW_MODE_SBS_MODE_GET(param); - + if (hw_mode->dbs_cap) { + mac0_min_ss = QDF_MIN(hw_mode->mac0_tx_ss, hw_mode->mac0_rx_ss); + mac1_min_ss = QDF_MIN(hw_mode->mac1_tx_ss, hw_mode->mac1_rx_ss); + if (hw_mode->mac0_band_cap == WLAN_5G_CAPABILITY && + mac0_min_ss && mac1_min_ss && + mac0_min_ss > mac1_min_ss) + hw_mode->action_type = PM_DBS1; + else if (hw_mode->mac0_band_cap == WLAN_2G_CAPABILITY && + mac0_min_ss && mac1_min_ss && + mac0_min_ss > mac1_min_ss) + hw_mode->action_type = PM_DBS2; + else + hw_mode->action_type = PM_DBS; + } return QDF_STATUS_SUCCESS; } @@ -2613,6 +2628,7 @@ QDF_STATUS policy_mgr_complete_action(struct wlan_objmgr_psoc *psoc, uint32_t session_id) { QDF_STATUS status = QDF_STATUS_E_FAILURE; + enum policy_mgr_band downgrade_band; if (policy_mgr_is_hw_dbs_capable(psoc) == false) { policy_mgr_err("driver isn't dbs capable, no further action needed"); @@ -2624,8 +2640,15 @@ QDF_STATUS policy_mgr_complete_action(struct wlan_objmgr_psoc *psoc, * protection. So, not taking any lock inside * policy_mgr_complete_action() during pm_conc_connection_list access. */ + if (next_action == PM_DBS1) + downgrade_band = POLICY_MGR_BAND_24; + else if (next_action == PM_DBS2) + downgrade_band = POLICY_MGR_BAND_5; + else + downgrade_band = POLICY_MGR_ANY; + status = policy_mgr_nss_update(psoc, new_nss, next_action, - POLICY_MGR_ANY, reason); + downgrade_band, reason); if (!QDF_IS_STATUS_SUCCESS(status)) status = policy_mgr_next_actions(psoc, session_id, next_action, reason); diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index d27f61c5709e..3e239b3b6d0c 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -769,9 +769,86 @@ bool policy_mgr_is_dbs_enable(struct wlan_objmgr_psoc *psoc) bool policy_mgr_is_hw_dbs_2x2_capable(struct wlan_objmgr_psoc *psoc) { struct dbs_nss nss_dbs; + uint32_t nss; - return ((policy_mgr_get_hw_dbs_nss(psoc, &nss_dbs)) >= HW_MODE_SS_2x2) - ? true : false; + nss = policy_mgr_get_hw_dbs_nss(psoc, &nss_dbs); + if (nss >= HW_MODE_SS_2x2 && (nss_dbs.mac0_ss == nss_dbs.mac1_ss)) + return true; + else + return false; +} + +/* + * policy_mgr_is_2x2_1x1_dbs_capable() - check 2x2+1x1 DBS supported or not + * @psoc: PSOC object data + * + * This routine is called to check 2x2 5G + 1x1 2G (DBS1) or + * 2x2 2G + 1x1 5G (DBS2) support or not. + * Either DBS1 or DBS2 supported + * + * Return: true/false + */ +bool policy_mgr_is_2x2_1x1_dbs_capable(struct wlan_objmgr_psoc *psoc) +{ + struct dbs_nss nss_dbs; + uint32_t nss; + + nss = policy_mgr_get_hw_dbs_nss(psoc, &nss_dbs); + if (nss >= HW_MODE_SS_2x2 && (nss_dbs.mac0_ss > nss_dbs.mac1_ss)) + return true; + else + return false; +} + +/* + * policy_mgr_is_2x2_5G_1x1_2G_dbs_capable() - check Genoa DBS1 enabled or not + * @psoc: PSOC object data + * + * This routine is called to check support DBS1 or not. + * Notes: DBS1: 2x2 5G + 1x1 2G. + * This function will call policy_mgr_get_hw_mode_idx_from_dbs_hw_list to match + * the HW mode from hw mode list. The parameters will also be matched to + * 2x2 5G +2x2 2G HW mode. But firmware will not report 2x2 5G + 2x2 2G alone + * with 2x2 5G + 1x1 2G at same time. So, it is safe to find DBS1 with + * policy_mgr_get_hw_mode_idx_from_dbs_hw_list. + * + * Return: true/false + */ +bool policy_mgr_is_2x2_5G_1x1_2G_dbs_capable(struct wlan_objmgr_psoc *psoc) +{ + return policy_mgr_is_2x2_1x1_dbs_capable(psoc) && + (policy_mgr_get_hw_mode_idx_from_dbs_hw_list( + psoc, + HW_MODE_SS_2x2, + HW_MODE_80_MHZ, + HW_MODE_SS_1x1, HW_MODE_40_MHZ, + HW_MODE_MAC_BAND_5G, + HW_MODE_DBS, + HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS_NONE) >= 0); +} + +/* + * policy_mgr_is_2x2_2G_1x1_5G_dbs_capable() - check Genoa DBS2 enabled or not + * @psoc: PSOC object data + * + * This routine is called to check support DBS2 or not. + * Notes: DBS2: 2x2 2G + 1x1 5G + * + * Return: true/false + */ +bool policy_mgr_is_2x2_2G_1x1_5G_dbs_capable(struct wlan_objmgr_psoc *psoc) +{ + return policy_mgr_is_2x2_1x1_dbs_capable(psoc) && + (policy_mgr_get_hw_mode_idx_from_dbs_hw_list( + psoc, + HW_MODE_SS_2x2, + HW_MODE_40_MHZ, + HW_MODE_SS_1x1, HW_MODE_40_MHZ, + HW_MODE_MAC_BAND_2G, + HW_MODE_DBS, + HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS_NONE) >= 0); } uint32_t policy_mgr_get_connection_count(struct wlan_objmgr_psoc *psoc) From 065556ab011d6ebd119b251e487c612dc551a2cf Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Fri, 25 May 2018 03:45:32 -0400 Subject: [PATCH 159/187] qcacmn: Add 2x2_1x1 DBS action tables Add action table for DBS 2x2 5G + 1x1 2G and 2x2 2G + 1x1 5G action tables. Change-Id: Idadb223cde86729c0f2bbf0cdcc97d96d28c72ba CRs-Fixed: 2258683 --- src/wlan_policy_mgr_tables_2x2_2g_1x1_5g.h | 154 +++++++++++++++++++++ src/wlan_policy_mgr_tables_2x2_5g_1x1_2g.h | 154 +++++++++++++++++++++ 2 files changed, 308 insertions(+) create mode 100644 src/wlan_policy_mgr_tables_2x2_2g_1x1_5g.h create mode 100644 src/wlan_policy_mgr_tables_2x2_5g_1x1_2g.h diff --git a/src/wlan_policy_mgr_tables_2x2_2g_1x1_5g.h b/src/wlan_policy_mgr_tables_2x2_2g_1x1_5g.h new file mode 100644 index 000000000000..54d4c8ab80c6 --- /dev/null +++ b/src/wlan_policy_mgr_tables_2x2_2g_1x1_5g.h @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef __WLAN_POLICY_MGR_TABLES_2X2_2G_1X1_5G_DBS_H +#define __WLAN_POLICY_MGR_TABLES_2X2_2G_1X1_5G_DBS_H + +#include "wlan_policy_mgr_api.h" + +/** + * next_action_two_connection_table - table which provides next + * action while a new connection is coming up, with one + * connection already in the system + */ +static policy_mgr_next_action_two_connection_table_type + pm_next_action_two_connection_dbs_2x2_2g_1x1_5g_table = { + [PM_STA_24_1x1] = {PM_NOP, PM_DBS2}, + [PM_STA_24_2x2] = {PM_NOP, PM_DBS2}, + [PM_STA_5_1x1] = {PM_DBS2, PM_NOP}, + [PM_STA_5_2x2] = {PM_DBS2, PM_NOP}, + [PM_P2P_CLI_24_1x1] = {PM_NOP, PM_DBS2}, + [PM_P2P_CLI_24_2x2] = {PM_NOP, PM_DBS2}, + [PM_P2P_CLI_5_1x1] = {PM_DBS2, PM_NOP}, + [PM_P2P_CLI_5_2x2] = {PM_DBS2, PM_NOP}, + [PM_P2P_GO_24_1x1] = {PM_NOP, PM_DBS2}, + [PM_P2P_GO_24_2x2] = {PM_NOP, PM_DBS2}, + [PM_P2P_GO_5_1x1] = {PM_DBS2, PM_NOP}, + [PM_P2P_GO_5_2x2] = {PM_DBS2_DOWNGRADE, PM_NOP}, + [PM_SAP_24_1x1] = {PM_NOP, PM_DBS2}, + [PM_SAP_24_2x2] = {PM_NOP, PM_DBS2}, + [PM_SAP_5_1x1] = {PM_DBS2, PM_NOP}, + [PM_SAP_5_2x2] = {PM_DBS2_DOWNGRADE, PM_NOP}, + [PM_IBSS_24_1x1] = {PM_NOP, PM_DBS2}, + [PM_IBSS_24_2x2] = {PM_NOP, PM_DBS2}, + [PM_IBSS_5_1x1] = {PM_DBS2, PM_NOP}, + [PM_IBSS_5_2x2] = {PM_DBS2_DOWNGRADE, PM_NOP}, +}; + +/** + * next_action_three_connection_table - table which provides next + * action while a new connection is coming up, with two + * connections already in the system + */ +static policy_mgr_next_action_three_connection_table_type + pm_next_action_three_connection_dbs_2x2_2g_1x1_5g_table = { + [PM_STA_SAP_SCC_24_1x1] = {PM_NOP, PM_DBS2}, + [PM_STA_SAP_SCC_24_2x2] = {PM_NOP, PM_DBS2}, + [PM_STA_SAP_MCC_24_1x1] = {PM_NOP, PM_DBS2}, + [PM_STA_SAP_MCC_24_2x2] = {PM_NOP, PM_DBS2}, + [PM_STA_SAP_SCC_5_1x1] = {PM_DBS2, PM_NOP}, + [PM_STA_SAP_SCC_5_2x2] = {PM_DBS2_DOWNGRADE, PM_NOP}, + [PM_STA_SAP_MCC_5_1x1] = {PM_DBS2, PM_NOP}, + [PM_STA_SAP_MCC_5_2x2] = {PM_DBS2_DOWNGRADE, PM_NOP}, + [PM_STA_SAP_MCC_24_5_1x1] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + [PM_STA_SAP_MCC_24_5_2x2] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + [PM_STA_SAP_DBS_1x1] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + [PM_STA_SAP_DBS_2x2] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + + [PM_STA_P2P_GO_SCC_24_1x1] = {PM_NOP, PM_DBS2}, + [PM_STA_P2P_GO_SCC_24_2x2] = {PM_NOP, PM_DBS2}, + [PM_STA_P2P_GO_MCC_24_1x1] = {PM_NOP, PM_DBS2}, + [PM_STA_P2P_GO_MCC_24_2x2] = {PM_NOP, PM_DBS2}, + [PM_STA_P2P_GO_SCC_5_1x1] = {PM_DBS2, PM_NOP}, + [PM_STA_P2P_GO_SCC_5_2x2] = {PM_DBS2_DOWNGRADE, PM_NOP}, + [PM_STA_P2P_GO_MCC_5_1x1] = {PM_DBS2, PM_NOP}, + [PM_STA_P2P_GO_MCC_5_2x2] = {PM_DBS2_DOWNGRADE, PM_NOP}, + [PM_STA_P2P_GO_MCC_24_5_1x1] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + [PM_STA_P2P_GO_MCC_24_5_2x2] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + [PM_STA_P2P_GO_DBS_1x1] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + [PM_STA_P2P_GO_DBS_2x2] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + + [PM_STA_P2P_CLI_SCC_24_1x1] = {PM_NOP, PM_DBS2}, + [PM_STA_P2P_CLI_SCC_24_2x2] = {PM_NOP, PM_DBS2}, + [PM_STA_P2P_CLI_MCC_24_1x1] = {PM_NOP, PM_DBS2}, + [PM_STA_P2P_CLI_MCC_24_2x2] = {PM_NOP, PM_DBS2}, + [PM_STA_P2P_CLI_SCC_5_1x1] = {PM_DBS2, PM_NOP}, + [PM_STA_P2P_CLI_SCC_5_2x2] = {PM_DBS2, PM_NOP}, + [PM_STA_P2P_CLI_MCC_5_1x1] = {PM_DBS2, PM_NOP}, + [PM_STA_P2P_CLI_MCC_5_2x2] = {PM_DBS2, PM_NOP}, + [PM_STA_P2P_CLI_MCC_24_5_1x1] = {PM_NOP, PM_DBS2}, + [PM_STA_P2P_CLI_MCC_24_5_2x2] = {PM_NOP, PM_DBS2}, + [PM_STA_P2P_CLI_DBS_1x1] = {PM_NOP, PM_DBS2}, + [PM_STA_P2P_CLI_DBS_2x2] = {PM_NOP, PM_DBS2}, + + [PM_P2P_GO_P2P_CLI_SCC_24_1x1] = {PM_NOP, PM_DBS2}, + [PM_P2P_GO_P2P_CLI_SCC_24_2x2] = {PM_NOP, PM_DBS2}, + [PM_P2P_GO_P2P_CLI_MCC_24_1x1] = {PM_NOP, PM_DBS2}, + [PM_P2P_GO_P2P_CLI_MCC_24_2x2] = {PM_NOP, PM_DBS2}, + [PM_P2P_GO_P2P_CLI_SCC_5_1x1] = {PM_DBS2, PM_NOP}, + [PM_P2P_GO_P2P_CLI_SCC_5_2x2] = {PM_DBS2_DOWNGRADE, PM_NOP}, + [PM_P2P_GO_P2P_CLI_MCC_5_1x1] = {PM_DBS2, PM_NOP}, + [PM_P2P_GO_P2P_CLI_MCC_5_2x2] = {PM_DBS2_DOWNGRADE, PM_NOP}, + [PM_P2P_GO_P2P_CLI_MCC_24_5_1x1] = {PM_DBS2_DOWNGRADE, + PM_DBS2_DOWNGRADE}, + [PM_P2P_GO_P2P_CLI_MCC_24_5_2x2] = {PM_DBS2_DOWNGRADE, + PM_DBS2_DOWNGRADE}, + [PM_P2P_GO_P2P_CLI_DBS_1x1] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + [PM_P2P_GO_P2P_CLI_DBS_2x2] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + + [PM_P2P_GO_SAP_SCC_24_1x1] = {PM_NOP, PM_DBS2}, + [PM_P2P_GO_SAP_SCC_24_2x2] = {PM_NOP, PM_DBS2}, + [PM_P2P_GO_SAP_MCC_24_1x1] = {PM_NOP, PM_DBS2}, + [PM_P2P_GO_SAP_MCC_24_2x2] = {PM_NOP, PM_DBS2}, + [PM_P2P_GO_SAP_SCC_5_1x1] = {PM_DBS2, PM_NOP}, + [PM_P2P_GO_SAP_SCC_5_2x2] = {PM_DBS2_DOWNGRADE, PM_NOP}, + [PM_P2P_GO_SAP_MCC_5_1x1] = {PM_DBS2, PM_NOP}, + [PM_P2P_GO_SAP_MCC_5_2x2] = {PM_DBS2_DOWNGRADE, PM_NOP}, + [PM_P2P_GO_SAP_MCC_24_5_1x1] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + [PM_P2P_GO_SAP_MCC_24_5_2x2] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + [PM_P2P_GO_SAP_DBS_1x1] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + [PM_P2P_GO_SAP_DBS_2x2] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + + [PM_P2P_CLI_SAP_SCC_24_1x1] = {PM_NOP, PM_DBS2}, + [PM_P2P_CLI_SAP_SCC_24_2x2] = {PM_NOP, PM_DBS2}, + [PM_P2P_CLI_SAP_MCC_24_1x1] = {PM_NOP, PM_DBS2}, + [PM_P2P_CLI_SAP_MCC_24_2x2] = {PM_NOP, PM_DBS2}, + [PM_P2P_CLI_SAP_SCC_5_1x1] = {PM_DBS2, PM_NOP}, + [PM_P2P_CLI_SAP_SCC_5_2x2] = {PM_DBS2_DOWNGRADE, PM_NOP}, + [PM_P2P_CLI_SAP_MCC_5_1x1] = {PM_DBS2, PM_NOP}, + [PM_P2P_CLI_SAP_MCC_5_2x2] = {PM_DBS2_DOWNGRADE, PM_NOP}, + [PM_P2P_CLI_SAP_MCC_24_5_1x1] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + [PM_P2P_CLI_SAP_MCC_24_5_2x2] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + [PM_P2P_CLI_SAP_DBS_1x1] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + [PM_P2P_CLI_SAP_DBS_2x2] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + + [PM_SAP_SAP_SCC_24_1x1] = {PM_NOP, PM_DBS2}, + [PM_SAP_SAP_SCC_24_2x2] = {PM_NOP, PM_DBS2}, + [PM_SAP_SAP_MCC_24_1x1] = {PM_NOP, PM_DBS2}, + [PM_SAP_SAP_MCC_24_2x2] = {PM_NOP, PM_DBS2}, + [PM_SAP_SAP_SCC_5_1x1] = {PM_DBS2, PM_NOP}, + [PM_SAP_SAP_SCC_5_2x2] = {PM_DBS2_DOWNGRADE, PM_NOP}, + [PM_SAP_SAP_MCC_5_1x1] = {PM_DBS2, PM_NOP}, + [PM_SAP_SAP_MCC_5_2x2] = {PM_DBS2_DOWNGRADE, PM_NOP}, + [PM_SAP_SAP_MCC_24_5_1x1] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + [PM_SAP_SAP_MCC_24_5_2x2] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + [PM_SAP_SAP_DBS_1x1] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, + [PM_SAP_SAP_DBS_2x2] = {PM_DBS2_DOWNGRADE, PM_DBS2_DOWNGRADE}, +}; + +#endif diff --git a/src/wlan_policy_mgr_tables_2x2_5g_1x1_2g.h b/src/wlan_policy_mgr_tables_2x2_5g_1x1_2g.h new file mode 100644 index 000000000000..bdf8223d8fbb --- /dev/null +++ b/src/wlan_policy_mgr_tables_2x2_5g_1x1_2g.h @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef __WLAN_POLICY_MGR_TABLES_2X2_5G_1X1_2G_DBS_H +#define __WLAN_POLICY_MGR_TABLES_2X2_5G_1X1_2G_DBS_H + +#include "wlan_policy_mgr_api.h" + +/** + * next_action_two_connection_table - table which provides next + * action while a new connection is coming up, with one + * connection already in the system + */ +static policy_mgr_next_action_two_connection_table_type + pm_next_action_two_connection_dbs_2x2_5g_1x1_2g_table = { + [PM_STA_24_1x1] = {PM_NOP, PM_DBS1}, + [PM_STA_24_2x2] = {PM_NOP, PM_DBS1}, + [PM_STA_5_1x1] = {PM_DBS1, PM_NOP}, + [PM_STA_5_2x2] = {PM_DBS1, PM_NOP}, + [PM_P2P_CLI_24_1x1] = {PM_NOP, PM_DBS1}, + [PM_P2P_CLI_24_2x2] = {PM_NOP, PM_DBS1}, + [PM_P2P_CLI_5_1x1] = {PM_DBS1, PM_NOP}, + [PM_P2P_CLI_5_2x2] = {PM_DBS1, PM_NOP}, + [PM_P2P_GO_24_1x1] = {PM_NOP, PM_DBS1}, + [PM_P2P_GO_24_2x2] = {PM_NOP, PM_DBS1_DOWNGRADE}, + [PM_P2P_GO_5_1x1] = {PM_DBS1, PM_NOP}, + [PM_P2P_GO_5_2x2] = {PM_DBS1, PM_NOP}, + [PM_SAP_24_1x1] = {PM_NOP, PM_DBS1}, + [PM_SAP_24_2x2] = {PM_NOP, PM_DBS1_DOWNGRADE}, + [PM_SAP_5_1x1] = {PM_DBS1, PM_NOP}, + [PM_SAP_5_2x2] = {PM_DBS1, PM_NOP}, + [PM_IBSS_24_1x1] = {PM_NOP, PM_DBS1}, + [PM_IBSS_24_2x2] = {PM_NOP, PM_DBS1_DOWNGRADE}, + [PM_IBSS_5_1x1] = {PM_DBS1, PM_NOP}, + [PM_IBSS_5_2x2] = {PM_DBS1, PM_NOP}, +}; + +/** + * next_action_three_connection_table - table which provides next + * action while a new connection is coming up, with two + * connections already in the system + */ +static policy_mgr_next_action_three_connection_table_type + pm_next_action_three_connection_dbs_2x2_5g_1x1_2g_table = { + [PM_STA_SAP_SCC_24_1x1] = {PM_NOP, PM_DBS1}, + [PM_STA_SAP_SCC_24_2x2] = {PM_NOP, PM_DBS1_DOWNGRADE}, + [PM_STA_SAP_MCC_24_1x1] = {PM_NOP, PM_DBS1}, + [PM_STA_SAP_MCC_24_2x2] = {PM_NOP, PM_DBS1_DOWNGRADE}, + [PM_STA_SAP_SCC_5_1x1] = {PM_DBS1, PM_NOP}, + [PM_STA_SAP_SCC_5_2x2] = {PM_DBS1, PM_NOP}, + [PM_STA_SAP_MCC_5_1x1] = {PM_DBS1, PM_NOP}, + [PM_STA_SAP_MCC_5_2x2] = {PM_DBS1, PM_NOP}, + [PM_STA_SAP_MCC_24_5_1x1] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + [PM_STA_SAP_MCC_24_5_2x2] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + [PM_STA_SAP_DBS_1x1] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + [PM_STA_SAP_DBS_2x2] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + + [PM_STA_P2P_GO_SCC_24_1x1] = {PM_NOP, PM_DBS1}, + [PM_STA_P2P_GO_SCC_24_2x2] = {PM_NOP, PM_DBS1_DOWNGRADE}, + [PM_STA_P2P_GO_MCC_24_1x1] = {PM_NOP, PM_DBS1}, + [PM_STA_P2P_GO_MCC_24_2x2] = {PM_NOP, PM_DBS1_DOWNGRADE}, + [PM_STA_P2P_GO_SCC_5_1x1] = {PM_DBS1, PM_NOP}, + [PM_STA_P2P_GO_SCC_5_2x2] = {PM_DBS1, PM_NOP}, + [PM_STA_P2P_GO_MCC_5_1x1] = {PM_DBS1, PM_NOP}, + [PM_STA_P2P_GO_MCC_5_2x2] = {PM_DBS1, PM_NOP}, + [PM_STA_P2P_GO_MCC_24_5_1x1] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + [PM_STA_P2P_GO_MCC_24_5_2x2] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + [PM_STA_P2P_GO_DBS_1x1] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + [PM_STA_P2P_GO_DBS_2x2] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + + [PM_STA_P2P_CLI_SCC_24_1x1] = {PM_NOP, PM_DBS1}, + [PM_STA_P2P_CLI_SCC_24_2x2] = {PM_NOP, PM_DBS1}, + [PM_STA_P2P_CLI_MCC_24_1x1] = {PM_NOP, PM_DBS1}, + [PM_STA_P2P_CLI_MCC_24_2x2] = {PM_NOP, PM_DBS1}, + [PM_STA_P2P_CLI_SCC_5_1x1] = {PM_DBS1, PM_NOP}, + [PM_STA_P2P_CLI_SCC_5_2x2] = {PM_DBS1, PM_NOP}, + [PM_STA_P2P_CLI_MCC_5_1x1] = {PM_DBS1, PM_NOP}, + [PM_STA_P2P_CLI_MCC_5_2x2] = {PM_DBS1, PM_NOP}, + [PM_STA_P2P_CLI_MCC_24_5_1x1] = {PM_DBS1, PM_DBS1}, + [PM_STA_P2P_CLI_MCC_24_5_2x2] = {PM_DBS1, PM_DBS1}, + [PM_STA_P2P_CLI_DBS_1x1] = {PM_DBS1, PM_DBS1}, + [PM_STA_P2P_CLI_DBS_2x2] = {PM_DBS1, PM_DBS1}, + + [PM_P2P_GO_P2P_CLI_SCC_24_1x1] = {PM_NOP, PM_DBS1}, + [PM_P2P_GO_P2P_CLI_SCC_24_2x2] = {PM_NOP, PM_DBS1_DOWNGRADE}, + [PM_P2P_GO_P2P_CLI_MCC_24_1x1] = {PM_NOP, PM_DBS1}, + [PM_P2P_GO_P2P_CLI_MCC_24_2x2] = {PM_NOP, PM_DBS1_DOWNGRADE}, + [PM_P2P_GO_P2P_CLI_SCC_5_1x1] = {PM_DBS1, PM_NOP}, + [PM_P2P_GO_P2P_CLI_SCC_5_2x2] = {PM_DBS1, PM_NOP}, + [PM_P2P_GO_P2P_CLI_MCC_5_1x1] = {PM_DBS1, PM_NOP}, + [PM_P2P_GO_P2P_CLI_MCC_5_2x2] = {PM_DBS1, PM_NOP}, + [PM_P2P_GO_P2P_CLI_MCC_24_5_1x1] = {PM_DBS1_DOWNGRADE, + PM_DBS1_DOWNGRADE}, + [PM_P2P_GO_P2P_CLI_MCC_24_5_2x2] = {PM_DBS1_DOWNGRADE, + PM_DBS1_DOWNGRADE}, + [PM_P2P_GO_P2P_CLI_DBS_1x1] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + [PM_P2P_GO_P2P_CLI_DBS_2x2] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + + [PM_P2P_GO_SAP_SCC_24_1x1] = {PM_NOP, PM_DBS1}, + [PM_P2P_GO_SAP_SCC_24_2x2] = {PM_NOP, PM_DBS1_DOWNGRADE}, + [PM_P2P_GO_SAP_MCC_24_1x1] = {PM_NOP, PM_DBS1}, + [PM_P2P_GO_SAP_MCC_24_2x2] = {PM_NOP, PM_DBS1_DOWNGRADE}, + [PM_P2P_GO_SAP_SCC_5_1x1] = {PM_DBS1, PM_NOP}, + [PM_P2P_GO_SAP_SCC_5_2x2] = {PM_DBS1, PM_NOP}, + [PM_P2P_GO_SAP_MCC_5_1x1] = {PM_DBS1, PM_NOP}, + [PM_P2P_GO_SAP_MCC_5_2x2] = {PM_DBS1, PM_NOP}, + [PM_P2P_GO_SAP_MCC_24_5_1x1] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + [PM_P2P_GO_SAP_MCC_24_5_2x2] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + [PM_P2P_GO_SAP_DBS_1x1] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + [PM_P2P_GO_SAP_DBS_2x2] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + + [PM_P2P_CLI_SAP_SCC_24_1x1] = {PM_NOP, PM_DBS1}, + [PM_P2P_CLI_SAP_SCC_24_2x2] = {PM_NOP, PM_DBS1_DOWNGRADE}, + [PM_P2P_CLI_SAP_MCC_24_1x1] = {PM_NOP, PM_DBS1}, + [PM_P2P_CLI_SAP_MCC_24_2x2] = {PM_NOP, PM_DBS1_DOWNGRADE}, + [PM_P2P_CLI_SAP_SCC_5_1x1] = {PM_DBS1, PM_NOP}, + [PM_P2P_CLI_SAP_SCC_5_2x2] = {PM_DBS1, PM_NOP}, + [PM_P2P_CLI_SAP_MCC_5_1x1] = {PM_DBS1, PM_NOP}, + [PM_P2P_CLI_SAP_MCC_5_2x2] = {PM_DBS1, PM_NOP}, + [PM_P2P_CLI_SAP_MCC_24_5_1x1] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + [PM_P2P_CLI_SAP_MCC_24_5_2x2] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + [PM_P2P_CLI_SAP_DBS_1x1] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + [PM_P2P_CLI_SAP_DBS_2x2] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + + [PM_SAP_SAP_SCC_24_1x1] = {PM_NOP, PM_DBS1}, + [PM_SAP_SAP_SCC_24_2x2] = {PM_NOP, PM_DBS1_DOWNGRADE}, + [PM_SAP_SAP_MCC_24_1x1] = {PM_NOP, PM_DBS1}, + [PM_SAP_SAP_MCC_24_2x2] = {PM_NOP, PM_DBS1_DOWNGRADE}, + [PM_SAP_SAP_SCC_5_1x1] = {PM_DBS1, PM_NOP}, + [PM_SAP_SAP_SCC_5_2x2] = {PM_DBS1, PM_NOP}, + [PM_SAP_SAP_MCC_5_1x1] = {PM_DBS1, PM_NOP}, + [PM_SAP_SAP_MCC_5_2x2] = {PM_DBS1, PM_NOP}, + [PM_SAP_SAP_MCC_24_5_1x1] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + [PM_SAP_SAP_MCC_24_5_2x2] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + [PM_SAP_SAP_DBS_1x1] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, + [PM_SAP_SAP_DBS_2x2] = {PM_DBS1_DOWNGRADE, PM_DBS1_DOWNGRADE}, +}; + +#endif From e1ebfd058d87df0adbe828525534e0b471f256b9 Mon Sep 17 00:00:00 2001 From: Jianmin Zhu Date: Tue, 21 Aug 2018 19:20:28 +0800 Subject: [PATCH 160/187] qcacmn: Enhance SAP concurrency check to cover AP channel switch case SAP(Go) concurrency check is mainly used for two purposes: 1) When new GO/SAP session is coming up and needs to check if this session's channel can co-exist with existing GO/SAP sessions. For example, in case of single radio platform, MCC for SAP/GO+SAP/GO is not supported, in such case this API should prevent bringing the second connection. 2) There is already existing SAP+GO combination but due to upper layer notifying LTE-COEX event or sending command to move one of the connections to different channel. In such cases before moving existing connection to new channel, check if new channel can co-exist with the other existing connection. For example, one SAP1 is on channel-6 and second SAP2 is on channel-36 and lets say they are doing DBS, and lets say upper layer sends LTE-COEX to move SAP1 from channel-6 to channel-149. In this case, SAP1 and SAP2 will end up doing MCC which may not be desirable result. such cases will be prevented with this API. Add vdev_id check while checking for 2nd case. If connection with given vdev_id exist then it is confirmed that it's a case of channel switch rather than a new connection case. Optimize the performance and readability of policy_mgr_allow_sap_go_concurrency() API by re-organizing the code blocks. Change-Id: Idce5d2df7d21e36d2311946115a19482e4b81a8e CRs-Fixed: 2299105 --- inc/wlan_policy_mgr_api.h | 32 +++++++++--- src/wlan_policy_mgr_get_set_utils.c | 77 +++++++++++------------------ 2 files changed, 54 insertions(+), 55 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 7a70a04bfe6f..192f32db31c0 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -2444,19 +2444,37 @@ QDF_STATUS policy_mgr_register_mode_change_cb(struct wlan_objmgr_psoc *psoc, QDF_STATUS policy_mgr_deregister_mode_change_cb(struct wlan_objmgr_psoc *psoc); /** - * policy_mgr_allow_sap_go_concurrency() - check whether multiple SAP/GO - * interfaces are allowed + * policy_mgr_allow_sap_go_concurrency() - check whether SAP/GO concurrency is + * allowed. * @psoc: pointer to soc - * @policy_mgr_con_mode: operating mode of the new interface - * @channel: operating channel of the new interface - * This function checks whether second SAP/GO interface is allowed on the same - * MAC. + * @policy_mgr_con_mode: operating mode of interface to be checked + * @channel: new operating channel of the interface to be checked + * @vdev_id: vdev id of the connection to be checked, 0xff for new connection + * + * Checks whether new channel SAP/GO can co-exist with the channel of existing + * SAP/GO connection. This API mainly used for two purposes: + * + * 1) When new GO/SAP session is coming up and needs to check if this session's + * channel can co-exist with existing existing GO/SAP sessions. For example, + * when single radio platform comes, MCC for SAP/GO+SAP/GO is not supported, in + * such case this API should prevent bringing the second connection. + * + * 2) There is already existing SAP+GO combination but due to upper layer + * notifying LTE-COEX event or sending command to move one of the connections + * to different channel. In such cases before moving existing connection to new + * channel, check if new channel can co-exist with the other existing + * connection. For example, one SAP1 is on channel-6 and second SAP2 is on + * channel-36 and lets say they are doing DBS, and lets say upper layer sends + * LTE-COEX to move SAP1 from channel-6 to channel-149. In this case, SAP1 and + * SAP2 will end up doing MCC which may not be desirable result. such cases + * will be prevented with this API. * * Return: true or false */ bool policy_mgr_allow_sap_go_concurrency(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, - uint8_t channel); + uint8_t channel, + uint32_t vdev_id); /** * policy_mgr_dual_beacon_on_single_mac_scc_capable() - get capability that diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 3e239b3b6d0c..58fb43f4b187 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1808,7 +1808,8 @@ bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc, } } - if (!policy_mgr_allow_sap_go_concurrency(psoc, mode, channel)) { + if (!policy_mgr_allow_sap_go_concurrency(psoc, mode, channel, + WLAN_INVALID_VDEV_ID)) { policy_mgr_err("This concurrency combination is not allowed"); goto done; } @@ -3117,62 +3118,42 @@ uint32_t policy_mgr_get_connection_info(struct wlan_objmgr_psoc *psoc, bool policy_mgr_allow_sap_go_concurrency(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, - uint8_t channel) + uint8_t channel, + uint32_t vdev_id) { - uint32_t sap_cnt; - uint32_t go_cnt; enum policy_mgr_con_mode con_mode; uint8_t con_chan; int id; + uint32_t vdev; + bool dbs; - sap_cnt = policy_mgr_mode_specific_connection_count(psoc, - PM_SAP_MODE, - NULL); - go_cnt = policy_mgr_mode_specific_connection_count(psoc, - PM_P2P_GO_MODE, - NULL); - - if ((mode == PM_SAP_MODE || mode == PM_P2P_GO_MODE) && - (sap_cnt || go_cnt)) { - if (policy_mgr_dual_beacon_on_single_mac_mcc_capable(psoc)) + if (mode != PM_SAP_MODE && mode != PM_P2P_GO_MODE) + return true; + if (policy_mgr_dual_beacon_on_single_mac_mcc_capable(psoc)) + return true; + dbs = policy_mgr_is_hw_dbs_capable(psoc); + for (id = 0; id < MAX_NUMBER_OF_CONC_CONNECTIONS; id++) { + if (!pm_conc_connection_list[id].in_use) + continue; + vdev = pm_conc_connection_list[id].vdev_id; + if (vdev_id == vdev) + continue; + con_mode = pm_conc_connection_list[id].mode; + if (con_mode != PM_SAP_MODE && con_mode != PM_P2P_GO_MODE) + continue; + con_chan = pm_conc_connection_list[id].chan; + if (policy_mgr_dual_beacon_on_single_mac_scc_capable(psoc) && + (channel == con_chan)) { + policy_mgr_debug("SCC enabled, 2 AP on same channel, allow 2nd AP"); return true; - if (policy_mgr_dual_beacon_on_single_mac_scc_capable(psoc)) { - for (id = 0; id < MAX_NUMBER_OF_CONC_CONNECTIONS; - id++) { - if (pm_conc_connection_list[id].in_use) { - con_mode = - pm_conc_connection_list[id].mode; - con_chan = - pm_conc_connection_list[id].chan; - if (((con_mode == PM_SAP_MODE) || - (con_mode == PM_P2P_GO_MODE)) && - (channel == con_chan)) { - policy_mgr_debug("Scc is supported, allow second SAP interface"); - return true; - } - } - } } - if (!policy_mgr_is_hw_dbs_capable(psoc)) { - policy_mgr_debug("DBS is not supported, mcc and scc are not supported too, don't allow second SAP interface"); + if (!dbs) { + policy_mgr_debug("DBS unsupported, mcc and scc unsupported too, don't allow 2nd AP"); return false; } - /* If DBS is supported then allow second SAP/GO session only if - * the freq band of the second SAP/GO interface is different - * than the first SAP/GO interface. - */ - for (id = 0; id < MAX_NUMBER_OF_CONC_CONNECTIONS; id++) { - if (pm_conc_connection_list[id].in_use) { - con_mode = pm_conc_connection_list[id].mode; - con_chan = pm_conc_connection_list[id].chan; - if (((con_mode == PM_SAP_MODE) || - (con_mode == PM_P2P_GO_MODE)) && - (WLAN_REG_IS_SAME_BAND_CHANNELS(channel, - con_chan))) { - policy_mgr_debug("DBS is supported, but first SAP and second SAP are on same band, So don't allow second SAP interface"); - return false; - } - } + if (WLAN_REG_IS_SAME_BAND_CHANNELS(channel, con_chan)) { + policy_mgr_debug("DBS supported, 2 SAP on same band, reject 2nd AP"); + return false; } } From 687602cfb9723ff6a83a83650b641bfcde018550 Mon Sep 17 00:00:00 2001 From: Jianmin Zhu Date: Fri, 24 Aug 2018 17:01:14 +0800 Subject: [PATCH 161/187] qcacmn: Add API for concurrency check to cover AP channel switch case There is already existing SAP+GO combination but due to upper layer notifying LTE-COEX event or sending command to move one of the connections to different channel. In such cases before moving existing connection to new channel, check if new channel can co-exist with the other existing connection. For example, one SAP1 is on channel-6 and second SAP2 is on channel-36 and lets say they are doing DBS, and lets say upper layer sends LTE-COEX to move SAP1 from channel-6 to channel-149. In this case, SAP1 and SAP2 will end up doing MCC which may not be desirable result. When channel switch, need recheck whether concurrency is allowed, Store the connection's parameter and temporarily delete it from the concurrency table. This way the allow concurrency check can be used as though a new connection is coming up, after check, restore the connection to concurrency table. Change-Id: I66e262774de8dfeba56f9b6f3d1d6721f1748881 CRs-Fixed: 2299105 --- inc/wlan_policy_mgr_api.h | 25 +++++++++++++++++ src/wlan_policy_mgr_core.c | 42 +++++++++++++++++++++++++++++ src/wlan_policy_mgr_get_set_utils.c | 31 +++++++++++++++++++++ src/wlan_policy_mgr_i.h | 21 +++++++++++++++ 4 files changed, 119 insertions(+) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 192f32db31c0..d676607acd69 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -395,6 +395,31 @@ bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, uint8_t channel, enum hw_mode_bandwidth bw); +/** + * policy_mgr_allow_concurrency_csa() - Check for allowed concurrency + * combination when channel switch + * @psoc: PSOC object information + * @mode: connection mode + * @channel: target channel to switch + * @vdev_id: vdev id of channel switch interface + * + * There is already existing SAP+GO combination but due to upper layer + * notifying LTE-COEX event or sending command to move one of the connections + * to different channel. In such cases before moving existing connection to new + * channel, check if new channel can co-exist with the other existing + * connection. For example, one SAP1 is on channel-6 and second SAP2 is on + * channel-36 and lets say they are doing DBS, and lets say upper layer sends + * LTE-COEX to move SAP1 from channel-6 to channel-149. In this case, SAP1 and + * SAP2 will end up doing MCC which may not be desirable result. such cases + * will be prevented with this API. + * + * Return: True/False + */ +bool policy_mgr_allow_concurrency_csa(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint8_t channel, + uint32_t vdev_id); + /** * policy_mgr_get_first_connection_pcl_table_index() - provides the * row index to firstConnectionPclTable to get to the correct diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index e7f2303e8fa1..2ddbbd3f3986 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -720,6 +720,48 @@ void policy_mgr_store_and_del_conn_info(struct wlan_objmgr_psoc *psoc, */ } +void policy_mgr_store_and_del_conn_info_by_vdev_id( + struct wlan_objmgr_psoc *psoc, + uint32_t vdev_id, + struct policy_mgr_conc_connection_info *info, + uint8_t *num_cxn_del) +{ + uint32_t conn_index = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + if (!info || !num_cxn_del) { + policy_mgr_err("Invalid parameters"); + return; + } + *num_cxn_del = 0; + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; + conn_index++) { + if ((pm_conc_connection_list[conn_index].vdev_id == vdev_id) && + pm_conc_connection_list[conn_index].in_use) { + *num_cxn_del = 1; + break; + } + } + /* + * Storing the connection entry which will be + * temporarily deleted. + */ + if (*num_cxn_del == 1) { + *info = pm_conc_connection_list[conn_index]; + /* Deleting the connection entry */ + policy_mgr_decr_connection_count( + psoc, + pm_conc_connection_list[conn_index].vdev_id); + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); +} + /** * policy_mgr_restore_deleted_conn_info() - Restore connection info * @info: An array saving connection info that is to be restored diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 58fb43f4b187..e4490593758d 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1862,6 +1862,37 @@ bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, return policy_mgr_is_concurrency_allowed(psoc, mode, channel, bw); } +bool policy_mgr_allow_concurrency_csa(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint8_t channel, + uint32_t vdev_id) +{ + bool allow = false; + struct policy_mgr_conc_connection_info info; + uint8_t num_cxn_del = 0; + + /* + * Store the connection's parameter and temporarily delete it + * from the concurrency table. This way the allow concurrency + * check can be used as though a new connection is coming up, + * after check, restore the connection to concurrency table. + */ + policy_mgr_store_and_del_conn_info_by_vdev_id(psoc, vdev_id, + &info, &num_cxn_del); + allow = policy_mgr_allow_concurrency( + psoc, + mode, + channel, + HW_MODE_20_MHZ); + if (!allow) + policy_mgr_err("CSA concurrency check failed"); + /* Restore the connection entry */ + if (num_cxn_del > 0) + policy_mgr_restore_deleted_conn_info(psoc, &info, num_cxn_del); + + return allow; +} + /** * policy_mgr_get_concurrency_mode() - return concurrency mode * @psoc: PSOC object information diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index cf6ac6d943af..ba2f708ae1d2 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -382,6 +382,27 @@ void policy_mgr_store_and_del_conn_info(struct wlan_objmgr_psoc *psoc, bool all_matching_cxn_to_del, struct policy_mgr_conc_connection_info *info, uint8_t *num_cxn_del); + +/** + * policy_mgr_store_and_del_conn_info_by_vdev_id() - Store and del a + * connection info by vdev id + * @psoc: PSOC object information + * @vdev_id: vdev id whose entry has to be deleted + * @info: struture array pointer where the connection info will be saved + * @num_cxn_del: number of connection which are going to be deleted + * + * Saves the connection info corresponding to the provided mode + * and deleted that corresponding entry based on vdev from the + * connection info structure + * + * Return: None + */ +void policy_mgr_store_and_del_conn_info_by_vdev_id( + struct wlan_objmgr_psoc *psoc, + uint32_t vdev_id, + struct policy_mgr_conc_connection_info *info, + uint8_t *num_cxn_del); + void policy_mgr_restore_deleted_conn_info(struct wlan_objmgr_psoc *psoc, struct policy_mgr_conc_connection_info *info, uint8_t num_cxn_del); From d540cd08dcd4c2d368284cd5f0cfba3c47369dd4 Mon Sep 17 00:00:00 2001 From: Yeshwanth Sriram Guntuka Date: Thu, 23 Aug 2018 18:25:28 +0530 Subject: [PATCH 162/187] qcacmn: Reduce log level for few prints to debug Change log level for few messages from info/warn/err to debug. Change-Id: I2fd3df21d70326301b39b91efdf827d6b391f4e3 CRs-Fixed: 2301926 --- src/wlan_policy_mgr_action.c | 4 ++-- src/wlan_policy_mgr_core.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 5f90175345b7..98c3c827a41a 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -207,7 +207,7 @@ enum policy_mgr_conc_next_action policy_mgr_need_opportunistic_upgrade( goto done; } if (!hw_mode.dbs_cap) { - policy_mgr_notice("current HW mode is non-DBS capable"); + policy_mgr_debug("current HW mode is non-DBS capable"); goto done; } @@ -1299,7 +1299,7 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( &operating_channel[cc_count], &vdev_id[cc_count], PM_STA_MODE); if (!cc_count) { - policy_mgr_err("Could not get STA operating channel&vdevid"); + policy_mgr_debug("Could not get STA operating channel&vdevid"); return; } diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 2ddbbd3f3986..6fb55a412f0c 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -691,10 +691,10 @@ void policy_mgr_store_and_del_conn_info(struct wlan_objmgr_psoc *psoc, /* Deleting the connection entry */ policy_mgr_decr_connection_count(psoc, info[found_index].vdev_id); - policy_mgr_notice("Stored %d (%d), deleted STA entry with vdev id %d, index %d", - info[found_index].vdev_id, - info[found_index].mode, - info[found_index].vdev_id, conn_index); + policy_mgr_debug("Stored %d (%d), deleted STA entry with vdev id %d, index %d", + info[found_index].vdev_id, + info[found_index].mode, + info[found_index].vdev_id, conn_index); found_index++; if (all_matching_cxn_to_del) continue; From ecbf113b55443c36c619e19005690088d8cb786b Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Fri, 25 May 2018 05:24:12 -0400 Subject: [PATCH 163/187] qcacmn: Attach 2x2+1x1 action tables Attach action tables with 2x2+1x1 DBS hw modes, and select the table based on user dbs preference INI setting. Change-Id: If1fc79ce9a774fbf1ca08d09546679746ba1c4a3 CRs-Fixed: 2258919 --- inc/wlan_policy_mgr_api.h | 27 +++ inc/wlan_policy_mgr_public_struct.h | 32 ++++ src/wlan_policy_mgr_action.c | 248 +++++++++++++++++++++++++++- src/wlan_policy_mgr_get_set_utils.c | 5 +- src/wlan_policy_mgr_i.h | 5 + src/wlan_policy_mgr_init_deinit.c | 36 +++- src/wlan_policy_mgr_pcl.c | 4 + 7 files changed, 346 insertions(+), 11 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index d676607acd69..0fdf5110b199 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -546,6 +546,33 @@ QDF_STATUS policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc, bool policy_mgr_is_dbs_allowed_for_concurrency( struct wlan_objmgr_psoc *psoc, enum QDF_OPMODE new_conn_mode); +/** + * policy_mgr_get_preferred_dbs_action_table() - get dbs action table type + * @psoc: Pointer to psoc + * @vdev_id: vdev Id + * @channel: channel of vdev. + * @reason: reason of request + * + * 1. Based on band preferred and vdev priority setting to choose the preferred + * dbs action. + * 2. This routine will be used to get DBS switching action tables. + * In Genoa, two action tables for DBS1 (2x2 5G + 1x1 2G), DBS2 + * (2x2 2G + 1x1 5G). + * 3. It can be used in mode change case in CSA channel switching or Roaming, + * opportunistic upgrade. If needs switch to DBS, we needs to query this + * function to get preferred DBS mode. + * 4. This is mainly used for dual dbs mode HW. For Legacy HW, there is + * only single DBS mode. This function will return PM_NOP. + * + * return : PM_NOP, PM_DBS1, PM_DBS2 + */ +enum policy_mgr_conc_next_action +policy_mgr_get_preferred_dbs_action_table( + struct wlan_objmgr_psoc *psoc, + uint32_t vdev_id, + uint8_t channel, + enum policy_mgr_conn_update_reason reason); + /** * policy_mgr_is_ibss_conn_exist() - to check if IBSS connection already present * @psoc: PSOC object information diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 021ad962227b..53ec91238654 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -1031,6 +1031,25 @@ struct dual_mac_config { uint32_t req_fw_mode_config; }; +/** + * enum policy_mgr_pri_id - vdev type priority id + * @PM_STA_PRI_ID: station vdev type priority id + * @PM_SAP_PRI_ID: sap vdev type priority id + * @PM_P2P_GO_PRI_ID: p2p go vdev type priority id + * @PM_P2P_CLI_PRI_ID: p2p cli vdev type priority id + * @PM_MAX_PRI_ID: vdev type priority id max value + */ +enum policy_mgr_pri_id { + PM_STA_PRI_ID = 1, + PM_SAP_PRI_ID, + PM_P2P_GO_PRI_ID, + PM_P2P_CLI_PRI_ID, + PM_MAX_PRI_ID = 0xF, +}; + +#define PM_GET_BAND_PREFERRED(_policy_) ((_policy_) & 0x1) +#define PM_GET_VDEV_PRIORITY_ENABLED(_policy_) (((_policy_) & 0x2) >> 1) + /** * struct policy_mgr_user_cfg - Policy manager user config variables * @enable_mcc_adaptive_scheduler: Enable MCC adaptive scheduler @@ -1040,6 +1059,17 @@ struct dual_mac_config { * @enable2x2: 2x2 chain mask user config * @mcc_to_scc_switch_mode: Control SAP channel in concurrency * @sub_20_mhz_enabled: Is 5 or 10 Mhz enabled + * @dbs_selection_policy: band preference or Vdev preference + * bit[0] = 0: 5G 2x2 preferred to select 2x2 5G + 1x1 2G DBS mode. + * bit[0] = 1: 2G 2x2 preferred to select 2x2 2G + 1x1 5G DBS mode. + * bit[1] = 1: vdev priority enabled. + * bit[1] = 0: vdev priority disabled. + * @vdev_priority_list: vdev priority list + * bit[0-3]: pri_id (policy_mgr_pri_id) of highest priority + * bit[4-7]: pri_id (policy_mgr_pri_id) of second priority + * bit[8-11]: pri_id (policy_mgr_pri_id) of third priority + * bit[12-15]: pri_id (policy_mgr_pri_id) of fourth priority + * example: 0x4321 - CLI < GO < SAP < STA */ struct policy_mgr_user_cfg { uint8_t enable_mcc_adaptive_scheduler; @@ -1051,6 +1081,8 @@ struct policy_mgr_user_cfg { bool is_sta_sap_scc_allowed_on_dfs_chan; uint32_t channel_select_logic_conc; uint32_t sta_sap_scc_on_lte_coex_chan; + uint32_t dbs_selection_policy; + uint32_t vdev_priority_list; }; /** diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 98c3c827a41a..d9be9c19b876 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -513,6 +513,242 @@ bool policy_mgr_is_hwmode_set_for_given_chnl(struct wlan_objmgr_psoc *psoc, return true; } +/** + * policy_mgr_pri_id_to_con_mode() - convert policy_mgr_pri_id to + * policy_mgr_con_mode + * @pri_id: policy_mgr_pri_id + * + * The help function converts policy_mgr_pri_id type to policy_mgr_con_mode + * type. + * + * Return: policy_mgr_con_mode type. + */ +static +enum policy_mgr_con_mode policy_mgr_pri_id_to_con_mode( + enum policy_mgr_pri_id pri_id) +{ + switch (pri_id) { + case PM_STA_PRI_ID: + return PM_STA_MODE; + case PM_SAP_PRI_ID: + return PM_SAP_MODE; + case PM_P2P_GO_PRI_ID: + return PM_P2P_GO_MODE; + case PM_P2P_CLI_PRI_ID: + return PM_P2P_CLIENT_MODE; + default: + return PM_MAX_NUM_OF_MODE; + } +} + +enum policy_mgr_conc_next_action +policy_mgr_get_preferred_dbs_action_table( + struct wlan_objmgr_psoc *psoc, + uint32_t vdev_id, + uint8_t channel, + enum policy_mgr_conn_update_reason reason) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + enum policy_mgr_con_mode pri_conn_mode = PM_MAX_NUM_OF_MODE; + enum policy_mgr_con_mode new_conn_mode = PM_MAX_NUM_OF_MODE; + enum QDF_OPMODE new_conn_op_mode = QDF_MAX_NO_OF_MODE; + bool band_pref_5g = true; + bool vdev_priority_enabled = false; + bool dbs_2x2_5g_1x1_2g_supported; + bool dbs_2x2_2g_1x1_5g_supported; + uint32_t vdev_pri_list, vdev_pri_id; + uint8_t chan_list[MAX_NUMBER_OF_CONC_CONNECTIONS + 1]; + uint8_t vdev_list[MAX_NUMBER_OF_CONC_CONNECTIONS + 1]; + uint32_t vdev_count = 0; + uint32_t i; + bool found; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid context"); + return PM_NOP; + } + dbs_2x2_5g_1x1_2g_supported = + policy_mgr_is_2x2_5G_1x1_2G_dbs_capable(psoc); + dbs_2x2_2g_1x1_5g_supported = + policy_mgr_is_2x2_2G_1x1_5G_dbs_capable(psoc); + policy_mgr_debug("target support DBS1 %d DBS2 %d", + dbs_2x2_5g_1x1_2g_supported, + dbs_2x2_2g_1x1_5g_supported); + /* + * If both DBS1 and DBS2 not supported, this should be Legacy Single + * DBS mode HW. The policy_mgr_psoc_enable has setup the correct + * action tables. + */ + if (!dbs_2x2_5g_1x1_2g_supported && !dbs_2x2_2g_1x1_5g_supported) + return PM_NOP; + if (!dbs_2x2_5g_1x1_2g_supported) { + band_pref_5g = false; + policy_mgr_debug("target only supports DBS2!"); + goto DONE; + } + if (!dbs_2x2_2g_1x1_5g_supported) { + policy_mgr_debug("target only supports DBS1!"); + goto DONE; + } + if (PM_GET_BAND_PREFERRED(pm_ctx->user_cfg.dbs_selection_policy) == 1) + band_pref_5g = false; + + if (PM_GET_VDEV_PRIORITY_ENABLED( + pm_ctx->user_cfg.dbs_selection_policy) == 1 && + pm_ctx->user_cfg.vdev_priority_list) + vdev_priority_enabled = true; + + if (!vdev_priority_enabled) + goto DONE; + + if (vdev_id != INVALID_VDEV_ID && channel) { + if (pm_ctx->hdd_cbacks.hdd_get_device_mode) + new_conn_op_mode = pm_ctx->hdd_cbacks. + hdd_get_device_mode(vdev_id); + + new_conn_mode = policy_mgr_convert_device_mode_to_qdf_type( + new_conn_op_mode); + if (new_conn_mode == PM_MAX_NUM_OF_MODE) + policy_mgr_debug("new vdev %d op_mode %d chan %d reason %d: not prioritized", + vdev_id, new_conn_op_mode, + channel, reason); + else + policy_mgr_debug("new vdev %d op_mode %d chan %d : reason %d", + vdev_id, new_conn_op_mode, channel, + reason); + } + vdev_pri_list = pm_ctx->user_cfg.vdev_priority_list; + while (vdev_pri_list) { + vdev_pri_id = vdev_pri_list & 0xF; + pri_conn_mode = policy_mgr_pri_id_to_con_mode(vdev_pri_id); + if (pri_conn_mode == PM_MAX_NUM_OF_MODE) { + policy_mgr_debug("vdev_pri_id %d prioritization not supported", + vdev_pri_id); + goto NEXT; + } + vdev_count = policy_mgr_get_mode_specific_conn_info( + psoc, chan_list, vdev_list, pri_conn_mode); + /** + * Take care of duplication case, the vdev id may + * exist in the conn list already with old chan. + * Replace with new chan before make decision. + */ + found = false; + for (i = 0; i < vdev_count; i++) { + policy_mgr_debug("[%d] vdev %d chan %d conn_mode %d", + i, vdev_list[i], chan_list[i], + pri_conn_mode); + + if (new_conn_mode == pri_conn_mode && + vdev_list[i] == vdev_id) { + chan_list[i] = channel; + found = true; + } + } + /** + * The new coming vdev should be added to the list to + * make decision if it is prioritized. + */ + if (!found && new_conn_mode == pri_conn_mode) { + chan_list[vdev_count] = channel; + vdev_list[vdev_count++] = vdev_id; + } + /** + * if more than one vdev has same priority, keep "band_pref_5g" + * value as default band preference setting. + */ + if (vdev_count > 1) + break; + /** + * select the only active vdev (or new coming vdev) chan as + * preferred band. + */ + if (vdev_count > 0) { + band_pref_5g = WLAN_REG_IS_5GHZ_CH(chan_list[0]); + break; + } +NEXT: + vdev_pri_list >>= 4; + } +DONE: + policy_mgr_debug("band_pref_5g %d", band_pref_5g); + if (band_pref_5g) + return PM_DBS1; + else + return PM_DBS2; +} + +/** + * policy_mgr_get_second_conn_action_table() - get second conn action table + * @psoc: Pointer to psoc + * @vdev_id: vdev Id + * @channel: channel of vdev. + * @reason: reason of request + * + * Get the action table based on current HW Caps and INI user preference. + * This function will be called by policy_mgr_current_connections_update during + * DBS action decision. + * + * return : action table address + */ +static policy_mgr_next_action_two_connection_table_type * +policy_mgr_get_second_conn_action_table( + struct wlan_objmgr_psoc *psoc, + uint32_t vdev_id, + uint8_t channel, + enum policy_mgr_conn_update_reason reason) +{ + enum policy_mgr_conc_next_action preferred_action; + + if (!policy_mgr_is_2x2_1x1_dbs_capable(psoc)) + return next_action_two_connection_table; + + preferred_action = policy_mgr_get_preferred_dbs_action_table( + psoc, vdev_id, channel, reason); + switch (preferred_action) { + case PM_DBS2: + return next_action_two_connection_2x2_2g_1x1_5g_table; + default: + return next_action_two_connection_table; + } +} + +/** + * policy_mgr_get_third_conn_action_table() - get third connection action table + * @psoc: Pointer to psoc + * @vdev_id: vdev Id + * @channel: channel of vdev. + * @reason: reason of request + * + * Get the action table based on current HW Caps and INI user preference. + * This function will be called by policy_mgr_current_connections_update during + * DBS action decision. + * + * return : action table address + */ +static policy_mgr_next_action_three_connection_table_type * +policy_mgr_get_third_conn_action_table( + struct wlan_objmgr_psoc *psoc, + uint32_t vdev_id, + uint8_t channel, + enum policy_mgr_conn_update_reason reason) +{ + enum policy_mgr_conc_next_action preferred_action; + + if (!policy_mgr_is_2x2_1x1_dbs_capable(psoc)) + return next_action_three_connection_table; + + preferred_action = policy_mgr_get_preferred_dbs_action_table( + psoc, vdev_id, channel, reason); + switch (preferred_action) { + case PM_DBS2: + return next_action_three_connection_2x2_2g_1x1_5g_table; + default: + return next_action_three_connection_table; + } +} + QDF_STATUS policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc, uint32_t session_id, uint8_t channel, @@ -522,6 +758,8 @@ QDF_STATUS policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc, uint32_t num_connections = 0; enum policy_mgr_one_connection_mode second_index = 0; enum policy_mgr_two_connection_mode third_index = 0; + policy_mgr_next_action_two_connection_table_type *second_conn_table; + policy_mgr_next_action_three_connection_table_type *third_conn_table; enum policy_mgr_band band; QDF_STATUS status = QDF_STATUS_E_FAILURE; struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -559,8 +797,9 @@ QDF_STATUS policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc, "couldn't find index for 2nd connection next action table"); goto done; } - next_action = - (*next_action_two_connection_table)[second_index][band]; + second_conn_table = policy_mgr_get_second_conn_action_table( + psoc, session_id, channel, reason); + next_action = (*second_conn_table)[second_index][band]; break; case 2: third_index = @@ -570,8 +809,9 @@ QDF_STATUS policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc, "couldn't find index for 3rd connection next action table"); goto done; } - next_action = (*next_action_three_connection_table) - [third_index][band]; + third_conn_table = policy_mgr_get_third_conn_action_table( + psoc, session_id, channel, reason); + next_action = (*third_conn_table)[third_index][band]; break; default: policy_mgr_err("unexpected num_connections value %d", diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index e4490593758d..73dec446db76 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1984,7 +1984,10 @@ QDF_STATUS policy_mgr_set_user_cfg(struct wlan_objmgr_psoc *psoc, } pm_ctx->user_cfg = *user_cfg; - + policy_mgr_debug("dbs_selection_policy 0x%x", + user_cfg->dbs_selection_policy); + policy_mgr_debug("vdev_priority_list 0x%x", + user_cfg->vdev_priority_list); pm_ctx->cur_conc_system_pref = pm_ctx->user_cfg.conc_system_pref; return QDF_STATUS_SUCCESS; diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index ba2f708ae1d2..f079276d81fc 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -195,6 +195,11 @@ extern policy_mgr_next_action_two_connection_table_type *next_action_two_connection_table; extern policy_mgr_next_action_three_connection_table_type *next_action_three_connection_table; +extern policy_mgr_next_action_two_connection_table_type + *next_action_two_connection_2x2_2g_1x1_5g_table; +extern policy_mgr_next_action_three_connection_table_type + *next_action_three_connection_2x2_2g_1x1_5g_table; + extern enum policy_mgr_conc_next_action (*policy_mgr_get_current_pref_hw_mode_ptr) (struct wlan_objmgr_psoc *psoc); diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 322de079032d..2dc015d3f404 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -28,6 +28,8 @@ #include "wlan_policy_mgr_api.h" #include "wlan_policy_mgr_tables_1x1_dbs_i.h" #include "wlan_policy_mgr_tables_2x2_dbs_i.h" +#include "wlan_policy_mgr_tables_2x2_5g_1x1_2g.h" +#include "wlan_policy_mgr_tables_2x2_2g_1x1_5g.h" #include "wlan_policy_mgr_i.h" #include "qdf_types.h" #include "qdf_trace.h" @@ -425,33 +427,55 @@ QDF_STATUS policy_mgr_psoc_enable(struct wlan_objmgr_psoc *psoc) policy_mgr_get_current_pref_hw_mode_ptr = policy_mgr_get_current_pref_hw_mode_dbs_1x1; - if (policy_mgr_is_hw_dbs_2x2_capable(psoc)) + if (policy_mgr_is_hw_dbs_2x2_capable(psoc) || + policy_mgr_is_2x2_1x1_dbs_capable(psoc)) second_connection_pcl_dbs_table = &pm_second_connection_pcl_dbs_2x2_table; else second_connection_pcl_dbs_table = &pm_second_connection_pcl_dbs_1x1_table; - if (policy_mgr_is_hw_dbs_2x2_capable(psoc)) + if (policy_mgr_is_hw_dbs_2x2_capable(psoc) || + policy_mgr_is_2x2_1x1_dbs_capable(psoc)) third_connection_pcl_dbs_table = &pm_third_connection_pcl_dbs_2x2_table; else third_connection_pcl_dbs_table = &pm_third_connection_pcl_dbs_1x1_table; - if (policy_mgr_is_hw_dbs_2x2_capable(psoc)) + if (policy_mgr_is_hw_dbs_2x2_capable(psoc)) { next_action_two_connection_table = &pm_next_action_two_connection_dbs_2x2_table; - else + } else if (policy_mgr_is_2x2_1x1_dbs_capable(psoc)) { + next_action_two_connection_table = + &pm_next_action_two_connection_dbs_2x2_5g_1x1_2g_table; + next_action_two_connection_2x2_2g_1x1_5g_table = + &pm_next_action_two_connection_dbs_2x2_2g_1x1_5g_table; + } else { next_action_two_connection_table = &pm_next_action_two_connection_dbs_1x1_table; + } - if (policy_mgr_is_hw_dbs_2x2_capable(psoc)) + if (policy_mgr_is_hw_dbs_2x2_capable(psoc)) { next_action_three_connection_table = &pm_next_action_three_connection_dbs_2x2_table; - else + } else if (policy_mgr_is_2x2_1x1_dbs_capable(psoc)) { + next_action_three_connection_table = + &pm_next_action_three_connection_dbs_2x2_5g_1x1_2g_table; + next_action_three_connection_2x2_2g_1x1_5g_table = + &pm_next_action_three_connection_dbs_2x2_2g_1x1_5g_table; + } else { next_action_three_connection_table = &pm_next_action_three_connection_dbs_1x1_table; + } + policy_mgr_debug("is DBS Capable %d, is SBS Capable %d", + policy_mgr_is_hw_dbs_capable(psoc), + policy_mgr_is_hw_sbs_capable(psoc)); + policy_mgr_debug("is2x2 %d, is2x2+1x1 %d, is2x2_5g+1x1_2g %d, is2x2_2g+1x1_5g %d", + policy_mgr_is_hw_dbs_2x2_capable(psoc), + policy_mgr_is_2x2_1x1_dbs_capable(psoc), + policy_mgr_is_2x2_5G_1x1_2G_dbs_capable(psoc), + policy_mgr_is_2x2_2G_1x1_5G_dbs_capable(psoc)); return QDF_STATUS_SUCCESS; } diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index e41025045d5d..9db76d523103 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -55,6 +55,10 @@ policy_mgr_next_action_two_connection_table_type *next_action_two_connection_table; policy_mgr_next_action_three_connection_table_type *next_action_three_connection_table; +policy_mgr_next_action_two_connection_table_type + *next_action_two_connection_2x2_2g_1x1_5g_table; +policy_mgr_next_action_three_connection_table_type + *next_action_three_connection_2x2_2g_1x1_5g_table; QDF_STATUS policy_mgr_get_pcl_for_existing_conn(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, From 5dd541e8f6b630b59e2ea515fad77062ec7f87c2 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Thu, 30 Aug 2018 10:20:31 -0700 Subject: [PATCH 164/187] qcacmn: Fix NULL pointer dereference in policy manager In policy_mgr_is_hw_sbs_capable wmi_handle is derived & dereferenced with out a NULL check. Add a NULL check for wmi_handle before it is dereferenced. Change-Id: I6081bb6f24ce52a3016712d4f1b481f5fb6a9c8f CRs-Fixed: 2305529 --- src/wlan_policy_mgr_get_set_utils.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 73dec446db76..671412cae1c6 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -523,7 +523,7 @@ bool policy_mgr_is_hw_dbs_capable(struct wlan_objmgr_psoc *psoc) { uint32_t param, i, found = 0; struct policy_mgr_psoc_priv_obj *pm_ctx; - void *wmi_handle; + struct wmi_unified *wmi_handle; pm_ctx = policy_mgr_get_context(psoc); @@ -537,9 +537,9 @@ bool policy_mgr_is_hw_dbs_capable(struct wlan_objmgr_psoc *psoc) return false; } - wmi_handle = GET_WMI_HDL_FROM_PSOC(psoc); + wmi_handle = get_wmi_unified_hdl_from_psoc(psoc); if (!wmi_handle) { - policy_mgr_debug("Invalid WMA context"); + policy_mgr_debug("Invalid WMI handle"); return false; } @@ -575,7 +575,7 @@ bool policy_mgr_is_hw_sbs_capable(struct wlan_objmgr_psoc *psoc) { uint32_t param, i, found = 0; struct policy_mgr_psoc_priv_obj *pm_ctx; - void *wmi_handle; + struct wmi_unified *wmi_handle; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -583,7 +583,11 @@ bool policy_mgr_is_hw_sbs_capable(struct wlan_objmgr_psoc *psoc) return false; } - wmi_handle = GET_WMI_HDL_FROM_PSOC(psoc); + wmi_handle = get_wmi_unified_hdl_from_psoc(psoc); + if (!wmi_handle) { + policy_mgr_debug("Invalid WMI handle"); + return false; + } policy_mgr_debug("DBS service bit map: %d", wmi_service_enabled(wmi_handle, @@ -3198,9 +3202,9 @@ bool policy_mgr_allow_sap_go_concurrency(struct wlan_objmgr_psoc *psoc, bool policy_mgr_dual_beacon_on_single_mac_scc_capable( struct wlan_objmgr_psoc *psoc) { - void *wmi_handle = NULL; + struct wmi_unified *wmi_handle; - wmi_handle = GET_WMI_HDL_FROM_PSOC(psoc); + wmi_handle = get_wmi_unified_hdl_from_psoc(psoc); if (!wmi_handle) { policy_mgr_debug("Invalid WMI handle"); return false; @@ -3219,9 +3223,9 @@ bool policy_mgr_dual_beacon_on_single_mac_scc_capable( bool policy_mgr_dual_beacon_on_single_mac_mcc_capable( struct wlan_objmgr_psoc *psoc) { - void *wmi_handle = NULL; + struct wmi_unified *wmi_handle; - wmi_handle = GET_WMI_HDL_FROM_PSOC(psoc); + wmi_handle = get_wmi_unified_hdl_from_psoc(psoc); if (!wmi_handle) { policy_mgr_debug("Invalid WMI handle"); return false; From bd8b24bbcd148638ddc4be31b0f27ca362ebfdcf Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Wed, 5 Sep 2018 23:13:52 -0400 Subject: [PATCH 165/187] qcacmn: allow STA SAP SCC on DFS If sta_sap_scc_on_dfs_chan = 1, we allow the SAP on STA's DFS chan. Allow this for DBS chip as well. Change-Id: I115984c0e659ca00f244d7b477daf4ccb3f2ccd2 CRs-Fixed: 2306801 --- src/wlan_policy_mgr_action.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index d9be9c19b876..e2295cf93156 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -1447,6 +1447,12 @@ QDF_STATUS policy_mgr_valid_sap_conc_channel_check( pm_ctx->pdev, channel) || !(policy_mgr_sta_sap_scc_on_lte_coex_chan(psoc) || policy_mgr_is_safe_channel(psoc, channel))) { + if (wlan_reg_is_dfs_ch(pm_ctx->pdev, channel) && + sta_sap_scc_on_dfs_chan) { + policy_mgr_debug("STA SAP SCC is allowed on DFS channel"); + goto update_chan; + } + if (policy_mgr_is_hw_dbs_capable(psoc)) { temp_channel = policy_mgr_get_alternate_channel_for_sap(psoc); @@ -1468,11 +1474,6 @@ QDF_STATUS policy_mgr_valid_sap_conc_channel_check( return QDF_STATUS_E_FAILURE; } } else { - if (wlan_reg_is_dfs_ch(pm_ctx->pdev, channel) && - sta_sap_scc_on_dfs_chan) { - policy_mgr_debug("STA SAP SCC is allowed on DFS channel"); - goto update_chan; - } policy_mgr_warn("Can't have concurrency on %d", channel); return QDF_STATUS_E_FAILURE; From c54f1a6f2d0eccba8526cde3e2ae1eb820ed116d Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Wed, 5 Sep 2018 10:58:05 -0700 Subject: [PATCH 166/187] qcacmn: Fix policy manager utfw API to delete all connection policy_mgr_decr_connection_count_utfw() API is using policy_mgr_psoc_enable() API to reset policy manager table as well as timer deinit but it does more than resetting the table which causes a stablity issue. For example, policy_mgr_psoc_enable() API calls to reinitialization connection_update_done_evt event which triggers stability issue as it has been already initialized once. Purpose of delete all connection option is, to reset the policy manager table, to reset any timers which can be achieved by calling policy_mgr_psoc_disable() followed by policy_mgr_psoc_enable() Change-Id: Ie3328e150ead99418ddd5025b42a2669e95e1553 CRs-Fixed: 2305419 --- src/wlan_policy_mgr_action.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index e2295cf93156..22c07a0bd777 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -2084,6 +2084,11 @@ QDF_STATUS policy_mgr_decr_connection_count_utfw(struct wlan_objmgr_psoc *psoc, QDF_STATUS status; if (del_all) { + status = policy_mgr_psoc_disable(psoc); + if (!QDF_IS_STATUS_SUCCESS(status)) { + policy_mgr_err("Policy manager initialization failed"); + return QDF_STATUS_E_FAILURE; + } status = policy_mgr_psoc_enable(psoc); if (!QDF_IS_STATUS_SUCCESS(status)) { policy_mgr_err("Policy manager initialization failed"); From c05a19115e0da14b60274739aa3fa2dbd44f30c6 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Tue, 18 Sep 2018 15:53:50 -0700 Subject: [PATCH 167/187] qcacmn: Reduce log level in policy manager Reduce log level from error to debug in policy_mgr_convert_device_mode_to_qdf_type, policy_mgr_get_qdf_mode_from_pm, policy_mgr_decr_active_session, policy_mgr_decr_session_set_pcl. Change-Id: I236c6770b87c5a4d4888cb6249aaf128b1cdcb8f CRs-Fixed: 2317899 --- src/wlan_policy_mgr_get_set_utils.c | 10 +++++----- src/wlan_policy_mgr_pcl.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 671412cae1c6..64ad5c2cdd12 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1287,7 +1287,7 @@ QDF_STATUS policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc, policy_mgr_convert_device_mode_to_qdf_type(mode), session_id); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { - policy_mgr_err("No connection with mode:%d vdev_id:%d", + policy_mgr_debug("No connection with mode:%d vdev_id:%d", policy_mgr_convert_device_mode_to_qdf_type(mode), session_id); return qdf_status; @@ -2238,8 +2238,8 @@ enum policy_mgr_con_mode policy_mgr_convert_device_mode_to_qdf_type( mode = PM_IBSS_MODE; break; default: - policy_mgr_err("Unsupported mode (%d)", - device_mode); + policy_mgr_debug("Unsupported mode (%d)", + device_mode); } return mode; @@ -2267,8 +2267,8 @@ enum QDF_OPMODE policy_mgr_get_qdf_mode_from_pm( mode = QDF_IBSS_MODE; break; default: - policy_mgr_err("Unsupported policy mgr mode (%d)", - device_mode); + policy_mgr_debug("Unsupported policy mgr mode (%d)", + device_mode); } return mode; } diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 9db76d523103..8f91e024aea6 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -114,7 +114,7 @@ void policy_mgr_decr_session_set_pcl(struct wlan_objmgr_psoc *psoc, qdf_status = policy_mgr_decr_active_session(psoc, mode, session_id); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { - policy_mgr_err("Invalid active session"); + policy_mgr_debug("Invalid active session"); return; } From 31e789e40f8aa6fba86a44fa1dd0460c1f354981 Mon Sep 17 00:00:00 2001 From: Varun Reddy Yeturu Date: Fri, 14 Sep 2018 15:11:46 -0700 Subject: [PATCH 168/187] qcacmn: Make policy_mgr_pdev_set_pcl as public API Make policy_mgr_pdev_set_pcl as public API Remove SET PCL for STA vdev from policy manager as it is being done now from the roaming start cmd core function which is csr_roam_offload_scan() Change-Id: I3fc0eb4d37278a67a1f18579cec7d65e491bd967 CRs-Fixed: 2320734 --- inc/wlan_policy_mgr_api.h | 10 ++++++++++ src/wlan_policy_mgr_get_set_utils.c | 12 ------------ src/wlan_policy_mgr_i.h | 2 -- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 0fdf5110b199..6cc9fad844a9 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -229,6 +229,16 @@ static inline void policy_mgr_change_sap_channel_with_csa( } #endif +/** + * policy_mgr_pdev_set_pcl() - SET PCL channel list and send to firmware + * @psoc: PSOC object information + * @mode: Adapter mode + * + * Return: None + */ +void policy_mgr_pdev_set_pcl(struct wlan_objmgr_psoc *psoc, + enum QDF_OPMODE mode); + /** * policy_mgr_incr_active_session() - increments the number of active sessions * @psoc: PSOC object information diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 64ad5c2cdd12..3fdc26773b7b 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1219,18 +1219,6 @@ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc, policy_mgr_debug("No.# of active sessions for mode %d = %d", mode, pm_ctx->no_of_active_sessions[mode]); - /* - * Get PCL logic makes use of the connection info structure. - * Let us set the PCL to the FW before updating the connection - * info structure about the new connection. - */ - if (mode == QDF_STA_MODE) { - qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); - /* Set PCL of STA to the FW */ - policy_mgr_pdev_set_pcl(psoc, mode); - qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); - policy_mgr_debug("Set PCL of STA to FW"); - } policy_mgr_incr_connection_count(psoc, session_id); if ((policy_mgr_mode_specific_connection_count( psoc, PM_STA_MODE, NULL) > 0) && (mode != QDF_STA_MODE)) { diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index f079276d81fc..31e90e3a6490 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -423,8 +423,6 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status, enum policy_mgr_conn_update_reason reason, uint32_t session_id, void *context); void policy_mgr_dump_current_concurrency(struct wlan_objmgr_psoc *psoc); -void policy_mgr_pdev_set_pcl(struct wlan_objmgr_psoc *psoc, - enum QDF_OPMODE mode); void policy_mgr_set_pcl_for_existing_combo( struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode); void pm_dbs_opportunistic_timer_handler(void *data); From 89036a7c26769f881eb2d38f276f60c58bf4bf63 Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Mon, 1 Oct 2018 14:50:15 -0700 Subject: [PATCH 169/187] qcacmn: Protect sap restart work for driver unload Protect sap restart work handler from SSR to avoid accessing data structures which are freed already. Change-Id: I75d2032b022aa68817ec102cbe65f635a627eb82 CRs-Fixed: 2325966 --- src/wlan_policy_mgr_action.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 22c07a0bd777..191384b81f07 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -31,6 +31,7 @@ #include "qdf_types.h" #include "qdf_trace.h" #include "wlan_objmgr_global_obj.h" +#include "qdf_platform.h" enum policy_mgr_conc_next_action (*policy_mgr_get_current_pref_hw_mode_ptr) (struct wlan_objmgr_psoc *psoc); @@ -1286,15 +1287,7 @@ bool policy_mgr_is_sap_restart_required_after_sta_disconnect( return true; } -/** - * policy_mgr_check_sta_ap_concurrent_ch_intf() - Restart SAP in STA-AP case - * @data: Pointer check concurrent channel work data - * - * Restarts the SAP interface in STA-AP concurrency scenario - * - * Restart: None - */ -void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) +static void __policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) { struct wlan_objmgr_psoc *psoc; struct policy_mgr_psoc_priv_obj *pm_ctx = NULL; @@ -1305,6 +1298,11 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) uint8_t operating_channel[MAX_NUMBER_OF_CONC_CONNECTIONS]; uint8_t vdev_id[MAX_NUMBER_OF_CONC_CONNECTIONS]; + if (qdf_is_module_state_transitioning()) { + policy_mgr_err("Module transition in progress"); + goto end; + } + work_info = (struct sta_ap_intf_check_work_ctx *) data; if (!work_info) { policy_mgr_err("Invalid work_info"); @@ -1379,6 +1377,13 @@ end: } } +void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) +{ + qdf_ssr_protect(__func__); + __policy_mgr_check_sta_ap_concurrent_ch_intf(data); + qdf_ssr_unprotect(__func__); +} + static bool policy_mgr_valid_sta_channel_check(struct wlan_objmgr_psoc *psoc, uint8_t sta_channel) { From 93b3c7fdba0d11bff4afcbe59bbc692ed9a61d0f Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Thu, 23 Aug 2018 21:46:44 +0530 Subject: [PATCH 170/187] qcacmn: Add SRD channel check in restart SAP Currently the driver doesn't have a check to bring up a SAP on STA SCC channel if its a SRD channel and does force SCC on it, even if SRD master mode is not supported. Fix is to check the SRD ini before SAP bringup on the STA channel. Change-Id: I850d8b252afb20d9e4374e1fb4932d7ef17f3e51 CRs-Fixed: 2302742 --- src/wlan_policy_mgr_action.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 191384b81f07..ab5dff442c96 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -1448,10 +1448,11 @@ QDF_STATUS policy_mgr_valid_sap_conc_channel_check( if (policy_mgr_valid_sta_channel_check(psoc, channel)) { if (wlan_reg_is_dfs_ch(pm_ctx->pdev, channel) || - wlan_reg_is_passive_or_disable_ch( - pm_ctx->pdev, channel) || + wlan_reg_is_passive_or_disable_ch(pm_ctx->pdev, channel) || !(policy_mgr_sta_sap_scc_on_lte_coex_chan(psoc) || - policy_mgr_is_safe_channel(psoc, channel))) { + policy_mgr_is_safe_channel(psoc, channel)) || + (!reg_is_etsi13_srd_chan_allowed_master_mode(pm_ctx->pdev) + && reg_is_etsi13_srd_chan(pm_ctx->pdev, channel))) { if (wlan_reg_is_dfs_ch(pm_ctx->pdev, channel) && sta_sap_scc_on_dfs_chan) { policy_mgr_debug("STA SAP SCC is allowed on DFS channel"); From 9ba5f5e9f94c9713a23ec726cd443c432f645a2d Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Thu, 4 Oct 2018 01:36:09 +0530 Subject: [PATCH 171/187] qcacmn: Fix BSS scoring params Currently the driver calculates the nss score based upon the max capability of the AP, and not the hw_mde config which would be there after connection for example, the driver calculates the score for a 2x2 11n AP, and 1x1 VHT (11ac) AP, it connects to the 11n AP in 1x1 mode, if a concurrent connection is present, which affects throughput Fix is to check whether the current AP channel results in DBS or not, if yes then change the NSS to 1 instead of 2 Change-Id: I80e2af00044b760325eb1a51b09a45189d58a417 CRs-Fixed: 2271976 --- inc/wlan_policy_mgr_api.h | 14 ++++++++++++++ src/wlan_policy_mgr_action.c | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 6cc9fad844a9..c09031a0a29b 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -125,6 +125,20 @@ uint8_t policy_mgr_search_and_check_for_session_conc( struct wlan_objmgr_psoc *psoc, uint8_t session_id, void *roam_profile); +/** + * policy_mgr_is_chnl_in_diff_band() - to check that given channel + * is in diff band from existing channel or not + * @psoc: pointer to psoc + * @channel: given channel + * + * This API will check that if the passed channel is in diff band than the + * already existing connections or not. + * + * Return: true if channel is in diff band + */ +bool policy_mgr_is_chnl_in_diff_band(struct wlan_objmgr_psoc *psoc, + uint8_t channel); + /** * policy_mgr_check_for_session_conc() - Check if concurrency is * allowed for a session diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index ab5dff442c96..1cad53c5f7bf 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -444,7 +444,7 @@ bool policy_mgr_is_dbs_allowed_for_concurrency( return ret; } -static bool policy_mgr_is_chnl_in_diff_band(struct wlan_objmgr_psoc *psoc, +bool policy_mgr_is_chnl_in_diff_band(struct wlan_objmgr_psoc *psoc, uint8_t channel) { uint8_t i, pm_chnl; From 1acaac7e9441649372d78494b2a3637d7a66d03a Mon Sep 17 00:00:00 2001 From: Tushnim Bhattacharyya Date: Mon, 8 Oct 2018 12:47:26 -0700 Subject: [PATCH 172/187] qcacmn: Fix OOB in __policy_mgr_check_sta_ap_concurrent_ch_intf Fix out of bound array access for operating_channel[] in __policy_mgr_check_sta_ap_concurrent_ch_intf. Change-Id: I3945d2fd5b1e3d02a9e827ba4a907b48b4170fd2 CRs-Fixed: 2329332 --- src/wlan_policy_mgr_action.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 1cad53c5f7bf..5c1d4a344f6d 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -1334,10 +1334,13 @@ static void __policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) &vdev_id[cc_count], PM_SAP_MODE); policy_mgr_debug("Number of concurrent SAP: %d", cc_count); - cc_count = cc_count + policy_mgr_get_mode_specific_conn_info(psoc, - &operating_channel[cc_count], - &vdev_id[cc_count], - PM_P2P_GO_MODE); + if (cc_count < MAX_NUMBER_OF_CONC_CONNECTIONS) + cc_count = cc_count + + policy_mgr_get_mode_specific_conn_info + (psoc, + &operating_channel[cc_count], + &vdev_id[cc_count], + PM_P2P_GO_MODE); policy_mgr_debug("Number of beaconing entities (SAP + GO):%d", cc_count); if (!cc_count) { @@ -1357,16 +1360,18 @@ static void __policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) policy_mgr_err("SAP restart get channel callback in NULL"); goto end; } - for (i = 0; i < cc_count; i++) { - status = pm_ctx->hdd_cbacks. - wlan_hdd_get_channel_for_sap_restart(psoc, + if (cc_count < MAX_NUMBER_OF_CONC_CONNECTIONS) + for (i = 0; i < cc_count; i++) { + status = pm_ctx->hdd_cbacks. + wlan_hdd_get_channel_for_sap_restart + (psoc, vdev_id[i], &channel, &sec_ch); - if (status == QDF_STATUS_SUCCESS) { - policy_mgr_info("SAP restarts due to MCC->SCC switch, old chan :%d new chan: %d" + if (status == QDF_STATUS_SUCCESS) { + policy_mgr_info("SAP restarts due to MCC->SCC switch, old chan :%d new chan: %d" , operating_channel[i], channel); - break; + break; + } } - } if (status != QDF_STATUS_SUCCESS) policy_mgr_err("Failed to switch SAP channel"); end: From af9e1da39ed2ce6ec95b57ce96aa28697f52e3eb Mon Sep 17 00:00:00 2001 From: Varun Reddy Yeturu Date: Wed, 10 Oct 2018 17:21:01 -0700 Subject: [PATCH 173/187] qcacmn: Make policy_mgr_set_pcl_for_existing_combo as public API Make policy_mgr_set_pcl_for_existing_combo as public API Move policy_mgr_pdev_set_pcl to policy manager internal header file Change-Id: I6ef45fb34c4bc4bc0c07cad6f546a777922fde9d CRs-Fixed: 2331254 --- inc/wlan_policy_mgr_api.h | 9 ++++----- src/wlan_policy_mgr_i.h | 12 ++++++++++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index c09031a0a29b..da66a3e47e8b 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -244,15 +244,14 @@ static inline void policy_mgr_change_sap_channel_with_csa( #endif /** - * policy_mgr_pdev_set_pcl() - SET PCL channel list and send to firmware + * policy_mgr_set_pcl_for_existing_combo() - SET PCL for existing combo * @psoc: PSOC object information - * @mode: Adapter mode + * @mode: Adapter mode * * Return: None */ -void policy_mgr_pdev_set_pcl(struct wlan_objmgr_psoc *psoc, - enum QDF_OPMODE mode); - +void policy_mgr_set_pcl_for_existing_combo(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode); /** * policy_mgr_incr_active_session() - increments the number of active sessions * @psoc: PSOC object information diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 31e90e3a6490..c5a54dbd8d51 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -423,8 +423,16 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status, enum policy_mgr_conn_update_reason reason, uint32_t session_id, void *context); void policy_mgr_dump_current_concurrency(struct wlan_objmgr_psoc *psoc); -void policy_mgr_set_pcl_for_existing_combo( - struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode); + +/** + * policy_mgr_pdev_set_pcl() - SET PCL channel list and send to firmware + * @psoc: PSOC object information + * @mode: Adapter mode + * + * Return: None + */ +void policy_mgr_pdev_set_pcl(struct wlan_objmgr_psoc *psoc, + enum QDF_OPMODE mode); void pm_dbs_opportunistic_timer_handler(void *data); enum policy_mgr_con_mode policy_mgr_get_mode(uint8_t type, uint8_t subtype); From 42e98abae19fc862c26db3a2994fdd6fe606eff7 Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Thu, 27 Sep 2018 18:35:21 -0700 Subject: [PATCH 174/187] qcacmn: Add new INI/CFG infrastructure for Policy Manager Policy Manager component needs to adopt a new INI/CFG infrastructure Provide a new infrastructure and remove old INI/CFGs related to policy manager component. CRs-Fixed: 2324395 Change-Id: Ia16845c2aef3c5877b0b164fcef13fe7cd41c736 --- inc/wlan_policy_mgr_api.h | 91 ++++++++++ inc/wlan_policy_mgr_cfg.h | 255 ++++++++++++++++++++++++++++ inc/wlan_policy_mgr_ucfg.h | 143 ++++++++++++++++ src/wlan_policy_mgr_get_set_utils.c | 122 +++++++++++++ src/wlan_policy_mgr_i.h | 23 +++ src/wlan_policy_mgr_ucfg.c | 123 ++++++++++++++ 6 files changed, 757 insertions(+) create mode 100644 inc/wlan_policy_mgr_cfg.h create mode 100644 inc/wlan_policy_mgr_ucfg.h create mode 100644 src/wlan_policy_mgr_ucfg.c diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index da66a3e47e8b..202896167519 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -64,6 +64,97 @@ typedef const enum policy_mgr_conc_next_action ((channel_select_logic_conc & PM_FW_MODE_STA_P2P_BIT_MASK) >> \ PM_FW_MODE_STA_P2P_BIT_POS) +/** + * policy_mgr_get_mcc_scc_switch() - To mcc to scc switch setting from INI + * @psoc: pointer to psoc + * @mcc_scc_switch: value to be filled + * + * This API pulls mcc to scc switch setting which is given as part of INI and + * stored in policy manager's CFGs. + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS policy_mgr_get_mcc_scc_switch(struct wlan_objmgr_psoc *psoc, + uint8_t *mcc_scc_switch); +/** + * policy_mgr_get_sys_pref() - to get system preference + * @psoc: pointer to psoc + * @sys_pref: value to be filled + * + * This API pulls the system preference for policy manager to provide + * PCL + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS policy_mgr_get_sys_pref(struct wlan_objmgr_psoc *psoc, + uint8_t *sys_pref); +/** + * policy_mgr_get_max_conc_cxns() - to get max num of conc connections + * @psoc: pointer to psoc + * @max_conc_cxns: value to be filled + * + * This API pulls max number of active connections which can be allowed + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS policy_mgr_get_max_conc_cxns(struct wlan_objmgr_psoc *psoc, + uint8_t *max_conc_cxns); +/** + * policy_mgr_get_conc_rule1() - to find out if conc rule1 is enabled + * @psoc: pointer to psoc + * @conc_rule1: value to be filled + * + * This API is used to find out if conc rule-1 is enabled by user + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS policy_mgr_get_conc_rule1(struct wlan_objmgr_psoc *psoc, + uint8_t *conc_rule1); +/** + * policy_mgr_get_conc_rule2() - to find out if conc rule2 is enabled + * @psoc: pointer to psoc + * @conc_rule2: value to be filled + * + * This API is used to find out if conc rule-2 is enabled by user + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS policy_mgr_get_conc_rule2(struct wlan_objmgr_psoc *psoc, + uint8_t *conc_rule2); +/** + * policy_mgr_get_dbs_selection_plcy() - DBS HW mode selection setting + * @psoc: pointer to psoc + * @dbs_selection_policy: value to be filled + * + * This API is used to find out DBS HW mode preference. + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS policy_mgr_get_dbs_selection_plcy(struct wlan_objmgr_psoc *psoc, + uint32_t *dbs_selection_policy); +/** + * policy_mgr_get_vdev_priority_list() - to get vdev priority list + * @psoc: pointer to psoc + * @vdev_priority_list: value to be filled + * + * This API is used to find out vdev_priority_list setting + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS policy_mgr_get_vdev_priority_list(struct wlan_objmgr_psoc *psoc, + uint32_t *vdev_priority_list); +/** + * policy_mgr_get_chnl_select_plcy() - to get channel selection policy + * @psoc: pointer to psoc + * @chnl_select_plcy: value to be filled + * + * This API is used to find out which channel selection policy has been + * configured + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS policy_mgr_get_chnl_select_plcy(struct wlan_objmgr_psoc *psoc, + uint32_t *chnl_select_plcy); /** * policy_mgr_set_concurrency_mode() - To set concurrency mode * @psoc: PSOC object data diff --git a/inc/wlan_policy_mgr_cfg.h b/inc/wlan_policy_mgr_cfg.h new file mode 100644 index 000000000000..19b0495859ac --- /dev/null +++ b/inc/wlan_policy_mgr_cfg.h @@ -0,0 +1,255 @@ +/* + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef __CFG_POLICY_MGR +#define __CFG_POLICY_MGR +#include "qdf_types.h" + +/* + * + * gWlanMccToSccSwitchMode - Control SAP channel. + * @Min: 0 + * @Max: 5 + * @Default: 0 + * + * This ini is used to override SAP channel. + * If gWlanMccToSccSwitchMode = 0: disabled. + * If gWlanMccToSccSwitchMode = 1: Enable switch. + * If gWlainMccToSccSwitchMode = 2: Force switch with SAP restart. + * If gWlainMccToSccSwitchMode = 3: Force switch without SAP restart. + * If gWlainMccToSccSwitchMode = 4: Switch using + * fav channel(s)without SAP restart. + * If gWlainMccToSccSwitchMode = 5: Force switch without SAP restart.MCC allowed + * in exceptional cases. + * If gWlainMccToSccSwitchMode = 6: Force Switch without SAP restart only in + user preffered band. + * Related: None. + * + * Supported Feature: Concurrency + * + * Usage: Internal/External + * + * + */ +#define CFG_MCC_TO_SCC_SWITCH CFG_INI_UINT(\ + "gWlanMccToSccSwitchMode", \ + QDF_MCC_TO_SCC_SWITCH_DISABLE, \ + QDF_MCC_TO_SCC_SWITCH_MAX - 1, \ + QDF_MCC_TO_SCC_SWITCH_DISABLE, \ + CFG_VALUE_OR_DEFAULT, \ + "Provides MCC to SCC switch mode") +/* + * + * gSystemPref - Configure wlan system preference for PCL. + * @Min: 0 + * @Max: 2 + * @Default: 0 + * + * This ini is used to configure wlan system preference option to help + * policy manager decide on Preferred Channel List for a new connection. + * For possible values refer to enum hdd_conc_priority_mode + * + * Related: None. + * + * Supported Feature: DBS + * + * Usage: Internal/External + * + * + */ +#define CFG_CONC_SYS_PREF CFG_INI_UINT(\ + "gSystemPref", 0, 2, 0, \ + CFG_VALUE_OR_DEFAULT, \ + "System preference to predict PCL") +/* + * + * gMaxConcurrentActiveSessions - Maximum number of concurrent connections. + * @Min: 1 + * @Max: 4 + * @Default: 3 + * + * This ini is used to configure the maximum number of concurrent connections. + * + * Related: None. + * + * Supported Feature: Concurrency + * + * Usage: Internal/External + * + * + */ +#define CFG_MAX_CONC_CXNS CFG_INI_UINT(\ + "gMaxConcurrentActiveSessions", \ + 1, 4, 3, \ + CFG_VALUE_OR_DEFAULT, \ + "Config max num allowed connections") +/* + * + * channel_select_logic_conc - Set channel selection logic + * for different concurrency combinations to DBS or inter band + * MCC. Default is DBS for STA+STA and STA+P2P. + * @Min: 0x00000000 + * @Max: 0xFFFFFFFF + * @Default: 0x00000000 + * + * 0 - inter-band MCC + * 1 - DBS + * + * BIT 0: STA+STA + * BIT 1: STA+P2P + * BIT 2-31: Reserved + * + * Supported Feature: STA+STA, STA+P2P + * + * Usage: External + * + * + */ +#define CFG_CHNL_SELECT_LOGIC_CONC CFG_INI_UINT(\ + "channel_select_logic_conc",\ + 0x00000000, \ + 0xFFFFFFFF, \ + 0x00000003, \ + CFG_VALUE_OR_DEFAULT, \ + "Set channel selection policy for various concurrency") +/* + * + * dbs_selection_policy - Configure dbs selection policy. + * @Min: 0 + * @Max: 3 + * @Default: 0 + * + * set band preference or Vdev preference. + * bit[0] = 0: 5G 2x2 preferred to select 2x2 5G + 1x1 2G DBS mode. + * bit[0] = 1: 2G 2x2 preferred to select 2x2 2G + 1x1 5G DBS mode. + * bit[1] = 1: vdev priority enabled. The INI "vdev_priority_list" will + * specify the vdev priority. + * bit[1] = 0: vdev priority disabled. + * This INI only take effect for Genoa dual DBS hw. + * + * Supported Feature: DBS + * + * Usage: Internal/External + * + * + */ +#define CFG_DBS_SELECTION_PLCY CFG_INI_UINT(\ + "dbs_selection_policy", \ + 0, 3, 0, \ + CFG_VALUE_OR_DEFAULT, \ + "Configure dbs selection policy") +/* + * + * vdev_priority_list - Configure vdev priority list. + * @Min: 0 + * @Max: 0x4444 + * @Default: 0x4321 + * + * @vdev_priority_list: vdev priority list + * bit[0-3]: pri_id (policy_mgr_pri_id) of highest priority + * bit[4-7]: pri_id (policy_mgr_pri_id) of second priority + * bit[8-11]: pri_id (policy_mgr_pri_id) of third priority + * bit[12-15]: pri_id (policy_mgr_pri_id) of fourth priority + * example: 0x4321 - CLI < GO < SAP < STA + * vdev priority id mapping: + * PM_STA_PRI_ID = 1, + * PM_SAP_PRI_ID = 2, + * PM_P2P_GO_PRI_ID = 3, + * PM_P2P_CLI_PRI_ID = 4, + * When the previous INI "dbs_selection_policy" bit[1]=1, which means + * the vdev 2x2 prioritization enabled. Then this INI will be used to + * specify the vdev type priority list. For example : + * dbs_selection_policy=0x2 + * vdev_priority_list=0x4312 + * means: default preference 2x2 band is 5G, vdev 2x2 prioritization enabled. + * And the priority list is CLI < GO < STA < SAP + * + * This INI only take effect for Genoa dual DBS hw. + * + * Supported Feature: DBS + * + * Usage: Internal/External + * + * + */ +#define CFG_VDEV_CUSTOM_PRIORITY_LIST CFG_INI_UINT(\ + "vdev_priority_list", \ + 0, 0x4444, 0x4321, \ + CFG_VALUE_OR_DEFAULT, \ + "Configure vdev priority list") +/* + * + * gEnableCustomConcRule1 - Enable custom concurrency rule1. + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to enable/disable custom concurrency rule1. + * If SAP comes up first and STA comes up later then SAP needs to follow STA's + * channel. + * + * Related: None. + * + * Supported Feature: Concurrency + * + * Usage: Internal/External + * + * + */ +#define CFG_ENABLE_CONC_RULE1 CFG_INI_UINT(\ + "gEnableCustomConcRule1", \ + 0, 1, 0, \ + CFG_VALUE_OR_DEFAULT, \ + "Enable custom concurrency rule 1") +/* + * + * gEnableCustomConcRule2 - Enable custom concurrency rule2. + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to enable/disable custom concurrency rule2. + * If P2PGO comes up first and STA comes up later then P2PGO need to follow + * STA's channel in 5Ghz. In following if condition we are just adding sanity + * check to make sure that by this time P2PGO's channel is same as STA's + * channel. + * + * Related: None. + * + * Supported Feature: Concurrency + * + * Usage: Internal/External + * + * + */ +#define CFG_ENABLE_CONC_RULE2 CFG_INI_UINT(\ + "gEnableCustomConcRule2", \ + 0, 1, 0, \ + CFG_VALUE_OR_DEFAULT, \ + "Enable custom concurrency rule 2") + +#define CFG_POLICY_MGR_ALL \ + CFG(CFG_MCC_TO_SCC_SWITCH) \ + CFG(CFG_CONC_SYS_PREF) \ + CFG(CFG_MAX_CONC_CXNS) \ + CFG(CFG_DBS_SELECTION_PLCY) \ + CFG(CFG_VDEV_CUSTOM_PRIORITY_LIST) \ + CFG(CFG_CHNL_SELECT_LOGIC_CONC) \ + CFG(CFG_ENABLE_CONC_RULE1) \ + CFG(CFG_ENABLE_CONC_RULE2) +#endif diff --git a/inc/wlan_policy_mgr_ucfg.h b/inc/wlan_policy_mgr_ucfg.h new file mode 100644 index 000000000000..eb17a3c425da --- /dev/null +++ b/inc/wlan_policy_mgr_ucfg.h @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2018 The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ +#ifndef __WLAN_POLICY_MGR_UCFG +#define __WLAN_POLICY_MGR_UCFG +#include "wlan_objmgr_psoc_obj.h" +#include "wlan_objmgr_global_obj.h" +#include "qdf_status.h" + + +/** + * ucfg_policy_mgr_psoc_open() - This API sets CFGs to policy manager context + * + * This API pulls policy manager's context from PSOC and initialize the CFG + * structure of policy manager. + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS ucfg_policy_mgr_psoc_open(struct wlan_objmgr_psoc *psoc); +/** + * ucfg_policy_mgr_psoc_close() - This API resets CFGs for policy manager ctx + * + * This API pulls policy manager's context from PSOC and resets the CFG + * structure of policy manager. + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +void ucfg_policy_mgr_psoc_close(struct wlan_objmgr_psoc *psoc); +#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH +/** + * ucfg_policy_mgr_get_mcc_scc_switch() - To mcc to scc switch setting from INI + * @psoc: pointer to psoc + * @mcc_scc_switch: value to be filled + * + * This API pulls mcc to scc switch setting which is given as part of INI and + * stored in policy manager's CFGs. + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS ucfg_policy_mgr_get_mcc_scc_switch(struct wlan_objmgr_psoc *psoc, + uint8_t *mcc_scc_switch); +#else +static inline +QDF_STATUS ucfg_policy_mgr_get_mcc_scc_switch(struct wlan_objmgr_psoc *psoc, + uint8_t *mcc_scc_switch) +{ + return QDF_STATUS_SUCCESS; +} +#endif //FEATURE_WLAN_MCC_TO_SCC_SWITCH +/** + * ucfg_policy_mgr_get_sys_pref() - to get system preference + * @psoc: pointer to psoc + * @sys_pref: value to be filled + * + * This API pulls the system preference for policy manager to provide + * PCL + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS ucfg_policy_mgr_get_sys_pref(struct wlan_objmgr_psoc *psoc, + uint8_t *sys_pref); +/** + * ucfg_policy_mgr_get_max_conc_cxns() - to get max num of conc connections + * @psoc: pointer to psoc + * @max_conc_cxns: value to be filled + * + * This API pulls max number of active connections which can be allowed + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS ucfg_policy_mgr_get_max_conc_cxns(struct wlan_objmgr_psoc *psoc, + uint8_t *max_conc_cxns); +/** + * ucfg_policy_mgr_get_conc_rule1() - to find out if conc rule1 is enabled + * @psoc: pointer to psoc + * @conc_rule1: value to be filled + * + * This API is used to find out if conc rule-1 is enabled by user + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS ucfg_policy_mgr_get_conc_rule1(struct wlan_objmgr_psoc *psoc, + uint8_t *conc_rule1); +/** + * ucfg_policy_mgr_get_conc_rule2() - to find out if conc rule2 is enabled + * @psoc: pointer to psoc + * @conc_rule2: value to be filled + * + * This API is used to find out if conc rule-2 is enabled by user + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS ucfg_policy_mgr_get_conc_rule2(struct wlan_objmgr_psoc *psoc, + uint8_t *conc_rule2); +/** + * ucfg_policy_mgr_get_dbs_selection_plcy() - DBS HW mode selection setting + * @psoc: pointer to psoc + * @dbs_selection_policy: value to be filled + * + * This API is used to find out DBS HW mode preference. + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS ucfg_policy_mgr_get_dbs_selection_plcy(struct wlan_objmgr_psoc *psoc, + uint32_t *dbs_selection_policy); +/** + * ucfg_policy_mgr_get_vdev_priority_list() - to get vdev priority list + * @psoc: pointer to psoc + * @vdev_priority_list: value to be filled + * + * This API is used to find out vdev_priority_list setting + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS ucfg_policy_mgr_get_vdev_priority_list(struct wlan_objmgr_psoc *psoc, + uint32_t *vdev_priority_list); +/** + * policy_mgr_get_chnl_select_plcy() - to get channel selection policy + * @psoc: pointer to psoc + * @chnl_select_plcy: value to be filled + * + * This API is used to find out which channel selection policy has been + * configured + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS ucfg_policy_mgr_get_chnl_select_plcy(struct wlan_objmgr_psoc *psoc, + uint32_t *chnl_select_plcy); +#endif //__WLAN_POLICY_MGR_UCFG diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 3fdc26773b7b..0c65de943518 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -36,6 +36,128 @@ /* invalid channel id. */ #define INVALID_CHANNEL_ID 0 +QDF_STATUS policy_mgr_get_mcc_scc_switch(struct wlan_objmgr_psoc *psoc, + uint8_t *mcc_scc_switch) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("pm_ctx is NULL"); + return QDF_STATUS_E_FAILURE; + } + *mcc_scc_switch = pm_ctx->cfg.mcc_to_scc_switch; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_get_sys_pref(struct wlan_objmgr_psoc *psoc, + uint8_t *sys_pref) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("pm_ctx is NULL"); + return QDF_STATUS_E_FAILURE; + } + *sys_pref = pm_ctx->cfg.sys_pref; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_get_max_conc_cxns(struct wlan_objmgr_psoc *psoc, + uint8_t *max_conc_cxns) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("pm_ctx is NULL"); + return QDF_STATUS_E_FAILURE; + } + *max_conc_cxns = pm_ctx->cfg.max_conc_cxns; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_get_conc_rule1(struct wlan_objmgr_psoc *psoc, + uint8_t *conc_rule1) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("pm_ctx is NULL"); + return QDF_STATUS_E_FAILURE; + } + *conc_rule1 = pm_ctx->cfg.conc_rule1; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_get_conc_rule2(struct wlan_objmgr_psoc *psoc, + uint8_t *conc_rule2) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("pm_ctx is NULL"); + return QDF_STATUS_E_FAILURE; + } + *conc_rule2 = pm_ctx->cfg.conc_rule2; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_get_dbs_selection_plcy(struct wlan_objmgr_psoc *psoc, + uint32_t *dbs_selection_plcy) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("pm_ctx is NULL"); + return QDF_STATUS_E_FAILURE; + } + *dbs_selection_plcy = pm_ctx->cfg.dbs_selection_plcy; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_get_vdev_priority_list(struct wlan_objmgr_psoc *psoc, + uint32_t *vdev_priority_list) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("pm_ctx is NULL"); + return QDF_STATUS_E_FAILURE; + } + *vdev_priority_list = pm_ctx->cfg.vdev_priority_list; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS policy_mgr_get_chnl_select_plcy(struct wlan_objmgr_psoc *psoc, + uint32_t *chnl_select_plcy) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("pm_ctx is NULL"); + return QDF_STATUS_E_FAILURE; + } + *chnl_select_plcy = pm_ctx->cfg.chnl_select_plcy; + + return QDF_STATUS_SUCCESS; +} + + + void policy_mgr_update_new_hw_mode_index(struct wlan_objmgr_psoc *psoc, uint32_t new_hw_mode_index) { diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index c5a54dbd8d51..afc03034d421 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -213,6 +213,28 @@ struct sta_ap_intf_check_work_ctx { struct wlan_objmgr_psoc *psoc; }; +/** + * struct policy_mgr_cfg - all the policy manager owned configs + * @mcc_to_scc_switch: switch to indicate MCC to SCC config + * @sys_pref: system's preference while selecting PCLs + * @max_conc_cxns: Max allowed concurrenct active connections + * @conc_rule1: concurrency rule1 + * @conc_rule2: concurrency rule2 + * @dbs_selection_plcy: DBS selection policy for concurrency + * @vdev_priority_list: Priority list for various vdevs + * @chnl_select_plcy: Channel selection policy + */ +struct policy_mgr_cfg { + uint8_t mcc_to_scc_switch; + uint8_t sys_pref; + uint8_t max_conc_cxns; + uint8_t conc_rule1; + uint8_t conc_rule2; + uint32_t dbs_selection_plcy; + uint32_t vdev_priority_list; + uint32_t chnl_select_plcy; +}; + /** * struct policy_mgr_psoc_priv_obj - Policy manager private data * @psoc: pointer to PSOC object information @@ -298,6 +320,7 @@ struct policy_mgr_psoc_priv_obj { qdf_event_t channel_switch_complete_evt; send_mode_change_event_cb mode_change_cb; uint32_t user_config_sap_channel; + struct policy_mgr_cfg cfg; }; /** diff --git a/src/wlan_policy_mgr_ucfg.c b/src/wlan_policy_mgr_ucfg.c new file mode 100644 index 000000000000..70f9e851635c --- /dev/null +++ b/src/wlan_policy_mgr_ucfg.c @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2018 The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ +#include "wlan_policy_mgr_ucfg.h" +#include "wlan_policy_mgr_i.h" +#include "cfg_ucfg_api.h" +#include "wlan_policy_mgr_api.h" + +static QDF_STATUS policy_mgr_init_cfg(struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + struct policy_mgr_cfg *cfg; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("pm_ctx is NULL"); + return QDF_STATUS_E_FAILURE; + } + cfg = &pm_ctx->cfg; + + cfg->mcc_to_scc_switch = cfg_get(psoc, CFG_MCC_TO_SCC_SWITCH); + cfg->sys_pref = cfg_get(psoc, CFG_CONC_SYS_PREF); + cfg->max_conc_cxns = cfg_get(psoc, CFG_MAX_CONC_CXNS); + cfg->conc_rule1 = cfg_get(psoc, CFG_ENABLE_CONC_RULE1); + cfg->conc_rule2 = cfg_get(psoc, CFG_ENABLE_CONC_RULE2); + cfg->dbs_selection_plcy = cfg_get(psoc, CFG_DBS_SELECTION_PLCY); + cfg->vdev_priority_list = cfg_get(psoc, CFG_VDEV_CUSTOM_PRIORITY_LIST); + cfg->chnl_select_plcy = cfg_get(psoc, CFG_CHNL_SELECT_LOGIC_CONC); + + return QDF_STATUS_SUCCESS; +} + +static void policy_mgr_deinit_cfg(struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("pm_ctx is NULL"); + return; + } + + qdf_mem_zero(&pm_ctx->cfg, sizeof(pm_ctx->cfg)); +} + +QDF_STATUS ucfg_policy_mgr_psoc_open(struct wlan_objmgr_psoc *psoc) +{ + QDF_STATUS status; + + status = policy_mgr_init_cfg(psoc); + if (status != QDF_STATUS_SUCCESS) { + policy_mgr_err("pm_ctx is NULL"); + return status; + } + return QDF_STATUS_SUCCESS; +} + +void ucfg_policy_mgr_psoc_close(struct wlan_objmgr_psoc *psoc) +{ + policy_mgr_deinit_cfg(psoc); +} + +QDF_STATUS ucfg_policy_mgr_get_mcc_scc_switch(struct wlan_objmgr_psoc *psoc, + uint8_t *mcc_scc_switch) +{ + return policy_mgr_get_mcc_scc_switch(psoc, mcc_scc_switch); +} + +QDF_STATUS ucfg_policy_mgr_get_sys_pref(struct wlan_objmgr_psoc *psoc, + uint8_t *sys_pref) +{ + return policy_mgr_get_sys_pref(psoc, sys_pref); +} + +QDF_STATUS ucfg_policy_mgr_get_max_conc_cxns(struct wlan_objmgr_psoc *psoc, + uint8_t *max_conc_cxns) +{ + return policy_mgr_get_max_conc_cxns(psoc, max_conc_cxns);; +} + +QDF_STATUS ucfg_policy_mgr_get_conc_rule1(struct wlan_objmgr_psoc *psoc, + uint8_t *conc_rule1) +{ + return policy_mgr_get_conc_rule1(psoc, conc_rule1); +} + +QDF_STATUS ucfg_policy_mgr_get_conc_rule2(struct wlan_objmgr_psoc *psoc, + uint8_t *conc_rule2) +{ + return policy_mgr_get_conc_rule2(psoc, conc_rule2); +} + +QDF_STATUS ucfg_policy_mgr_get_dbs_selection_plcy(struct wlan_objmgr_psoc *psoc, + uint32_t *dbs_selection_plcy) +{ + return policy_mgr_get_dbs_selection_plcy(psoc, dbs_selection_plcy); +} + +QDF_STATUS ucfg_policy_mgr_get_vdev_priority_list(struct wlan_objmgr_psoc *psoc, + uint32_t *vdev_priority_list) +{ + return policy_mgr_get_vdev_priority_list(psoc, vdev_priority_list); +} + +QDF_STATUS ucfg_policy_mgr_get_chnl_select_plcy(struct wlan_objmgr_psoc *psoc, + uint32_t *chnl_select_plcy) +{ + return policy_mgr_get_chnl_select_plcy(psoc, chnl_select_plcy); +} From d36b207ac45045513de34fef5866bfe906511ec8 Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Wed, 26 Sep 2018 17:02:14 -0700 Subject: [PATCH 175/187] qcacmn: Refactor operation related to INI gWlanMccToSccSwitchMode Ownership of gWlanMccToSccSwitchMode is changed from HDD to Policy manager. So policy manager doesn't have to rely on HDD to obtain the INI setting. CRs-Fixed: 2324395 Change-Id: Id8bdee52ebf83b1c8b3c8f9132a2fc74b28f42a0 --- inc/wlan_policy_mgr_public_struct.h | 2 -- src/wlan_policy_mgr_action.c | 4 ++-- src/wlan_policy_mgr_core.c | 6 +++--- src/wlan_policy_mgr_get_set_utils.c | 8 ++++---- src/wlan_policy_mgr_i.h | 4 ++-- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 53ec91238654..7782f5c39f39 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -1057,7 +1057,6 @@ enum policy_mgr_pri_id { * connections * @conc_system_pref: System preference for PCL table * @enable2x2: 2x2 chain mask user config - * @mcc_to_scc_switch_mode: Control SAP channel in concurrency * @sub_20_mhz_enabled: Is 5 or 10 Mhz enabled * @dbs_selection_policy: band preference or Vdev preference * bit[0] = 0: 5G 2x2 preferred to select 2x2 5G + 1x1 2G DBS mode. @@ -1076,7 +1075,6 @@ struct policy_mgr_user_cfg { uint8_t max_concurrent_active_sessions; uint8_t conc_system_pref; bool enable2x2; - uint32_t mcc_to_scc_switch_mode; bool sub_20_mhz_enabled; bool is_sta_sap_scc_allowed_on_dfs_chan; uint32_t channel_select_logic_conc; diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 5c1d4a344f6d..ac2ddf75df79 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -1321,7 +1321,7 @@ static void __policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) goto end; } mcc_to_scc_switch = - policy_mgr_mcc_to_scc_switch_mode_in_user_cfg(psoc); + policy_mgr_get_mcc_to_scc_switch_mode(psoc); policy_mgr_info("Concurrent open sessions running: %d", policy_mgr_concurrent_open_sessions_running(psoc)); @@ -1556,7 +1556,7 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( } mcc_to_scc_switch = - policy_mgr_mcc_to_scc_switch_mode_in_user_cfg(psoc); + policy_mgr_get_mcc_to_scc_switch_mode(psoc); policy_mgr_info("MCC to SCC switch: %d chan: %d", mcc_to_scc_switch, operating_channel[0]); diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 6fb55a412f0c..e3f78bba11ce 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -155,7 +155,7 @@ bool policy_mgr_is_dual_mac_disabled_in_ini( return is_disabled; } -uint32_t policy_mgr_mcc_to_scc_switch_mode_in_user_cfg( +uint32_t policy_mgr_get_mcc_to_scc_switch_mode( struct wlan_objmgr_psoc *psoc) { struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -166,7 +166,7 @@ uint32_t policy_mgr_mcc_to_scc_switch_mode_in_user_cfg( return 0; } - return pm_ctx->user_cfg.mcc_to_scc_switch_mode; + return pm_ctx->cfg.mcc_to_scc_switch; } /** @@ -2402,7 +2402,7 @@ bool policy_mgr_allow_new_home_channel(struct wlan_objmgr_psoc *psoc, return false; } mcc_to_scc_switch = - policy_mgr_mcc_to_scc_switch_mode_in_user_cfg(psoc); + policy_mgr_get_mcc_to_scc_switch_mode(psoc); qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); if (num_connections == 2) { diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 0c65de943518..3891909533b0 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -3094,13 +3094,13 @@ bool policy_mgr_is_force_scc(struct wlan_objmgr_psoc *psoc) return 0; } - return ((pm_ctx->user_cfg.mcc_to_scc_switch_mode == + return ((pm_ctx->cfg.mcc_to_scc_switch == QDF_MCC_TO_SCC_SWITCH_FORCE_WITHOUT_DISCONNECTION) || - (pm_ctx->user_cfg.mcc_to_scc_switch_mode == + (pm_ctx->cfg.mcc_to_scc_switch == QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL) || - (pm_ctx->user_cfg.mcc_to_scc_switch_mode == + (pm_ctx->cfg.mcc_to_scc_switch == QDF_MCC_TO_SCC_SWITCH_FORCE_PREFERRED_WITHOUT_DISCONNECTION) || - (pm_ctx->user_cfg.mcc_to_scc_switch_mode == + (pm_ctx->cfg.mcc_to_scc_switch == QDF_MCC_TO_SCC_WITH_PREFERRED_BAND)); } diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index afc03034d421..1be204cfdbaf 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -355,7 +355,7 @@ bool policy_mgr_is_dual_mac_disabled_in_ini( struct wlan_objmgr_psoc *psoc); /** - * policy_mgr_mcc_to_scc_switch_mode_in_user_cfg() - MCC to SCC + * policy_mgr_get_mcc_to_scc_switch_mode() - MCC to SCC * switch mode value in the user config * @psoc: PSOC object information * @@ -363,7 +363,7 @@ bool policy_mgr_is_dual_mac_disabled_in_ini( * * Return: MCC to SCC switch mode value */ -uint32_t policy_mgr_mcc_to_scc_switch_mode_in_user_cfg( +uint32_t policy_mgr_get_mcc_to_scc_switch_mode( struct wlan_objmgr_psoc *psoc); bool policy_mgr_get_dbs_config(struct wlan_objmgr_psoc *psoc); bool policy_mgr_get_agile_dfs_config(struct wlan_objmgr_psoc *psoc); From 6dd2208e936029ca973f82e29e8008e12c21c63f Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Thu, 27 Sep 2018 10:40:24 -0700 Subject: [PATCH 176/187] qcacmn: Refactor operation related to INI gSystemPref Ownership of gSystemPref is changed from HDD to Policy manager. So policy manager doesn't have to rely on HDD to obtain the INI setting. CRs-Fixed: 2324395 Change-Id: Ia586896ea55c6e71d8dcff705bf0e74879931dbb --- inc/wlan_policy_mgr_api.h | 12 ++++++++++++ inc/wlan_policy_mgr_public_struct.h | 2 -- inc/wlan_policy_mgr_ucfg.h | 12 ++++++++++++ src/wlan_policy_mgr_get_set_utils.c | 17 ++++++++++++++++- src/wlan_policy_mgr_ucfg.c | 6 ++++++ 5 files changed, 46 insertions(+), 3 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 202896167519..28024645b332 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -88,6 +88,18 @@ QDF_STATUS policy_mgr_get_mcc_scc_switch(struct wlan_objmgr_psoc *psoc, */ QDF_STATUS policy_mgr_get_sys_pref(struct wlan_objmgr_psoc *psoc, uint8_t *sys_pref); +/** + * policy_mgr_set_sys_pref() - to set system preference + * @psoc: pointer to psoc + * @sys_pref: value to be applied as new INI setting + * + * This API is meant to override original INI setting for system pref + * with new value which is used by policy manager to provide PCL + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS policy_mgr_set_sys_pref(struct wlan_objmgr_psoc *psoc, + uint8_t sys_pref); /** * policy_mgr_get_max_conc_cxns() - to get max num of conc connections * @psoc: pointer to psoc diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 7782f5c39f39..a816b139d466 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -1055,7 +1055,6 @@ enum policy_mgr_pri_id { * @enable_mcc_adaptive_scheduler: Enable MCC adaptive scheduler * @max_concurrent_active_sessions: User allowed maximum active * connections - * @conc_system_pref: System preference for PCL table * @enable2x2: 2x2 chain mask user config * @sub_20_mhz_enabled: Is 5 or 10 Mhz enabled * @dbs_selection_policy: band preference or Vdev preference @@ -1073,7 +1072,6 @@ enum policy_mgr_pri_id { struct policy_mgr_user_cfg { uint8_t enable_mcc_adaptive_scheduler; uint8_t max_concurrent_active_sessions; - uint8_t conc_system_pref; bool enable2x2; bool sub_20_mhz_enabled; bool is_sta_sap_scc_allowed_on_dfs_chan; diff --git a/inc/wlan_policy_mgr_ucfg.h b/inc/wlan_policy_mgr_ucfg.h index eb17a3c425da..ab6e51c192d3 100644 --- a/inc/wlan_policy_mgr_ucfg.h +++ b/inc/wlan_policy_mgr_ucfg.h @@ -73,6 +73,18 @@ QDF_STATUS ucfg_policy_mgr_get_mcc_scc_switch(struct wlan_objmgr_psoc *psoc, */ QDF_STATUS ucfg_policy_mgr_get_sys_pref(struct wlan_objmgr_psoc *psoc, uint8_t *sys_pref); +/** + * ucfg_policy_mgr_set_sys_pref() - to set system preference + * @psoc: pointer to psoc + * @sys_pref: value to be applied as new INI setting + * + * This API is meant to override original INI setting for system pref + * with new value which is used by policy manager to provide PCL + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS ucfg_policy_mgr_set_sys_pref(struct wlan_objmgr_psoc *psoc, + uint8_t sys_pref); /** * ucfg_policy_mgr_get_max_conc_cxns() - to get max num of conc connections * @psoc: pointer to psoc diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 3891909533b0..168d9876b212 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -66,6 +66,21 @@ QDF_STATUS policy_mgr_get_sys_pref(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +QDF_STATUS policy_mgr_set_sys_pref(struct wlan_objmgr_psoc *psoc, + uint8_t sys_pref) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("pm_ctx is NULL"); + return QDF_STATUS_E_FAILURE; + } + pm_ctx->cfg.sys_pref = sys_pref; + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS policy_mgr_get_max_conc_cxns(struct wlan_objmgr_psoc *psoc, uint8_t *max_conc_cxns) { @@ -2102,7 +2117,7 @@ QDF_STATUS policy_mgr_set_user_cfg(struct wlan_objmgr_psoc *psoc, user_cfg->dbs_selection_policy); policy_mgr_debug("vdev_priority_list 0x%x", user_cfg->vdev_priority_list); - pm_ctx->cur_conc_system_pref = pm_ctx->user_cfg.conc_system_pref; + pm_ctx->cur_conc_system_pref = pm_ctx->cfg.sys_pref; return QDF_STATUS_SUCCESS; } diff --git a/src/wlan_policy_mgr_ucfg.c b/src/wlan_policy_mgr_ucfg.c index 70f9e851635c..aad715d8e80d 100644 --- a/src/wlan_policy_mgr_ucfg.c +++ b/src/wlan_policy_mgr_ucfg.c @@ -86,6 +86,12 @@ QDF_STATUS ucfg_policy_mgr_get_sys_pref(struct wlan_objmgr_psoc *psoc, return policy_mgr_get_sys_pref(psoc, sys_pref); } +QDF_STATUS ucfg_policy_mgr_set_sys_pref(struct wlan_objmgr_psoc *psoc, + uint8_t sys_pref) +{ + return policy_mgr_set_sys_pref(psoc, sys_pref); +} + QDF_STATUS ucfg_policy_mgr_get_max_conc_cxns(struct wlan_objmgr_psoc *psoc, uint8_t *max_conc_cxns) { From 1c7a1e9cf0682ba98f42cc15f617f3a7c27e48aa Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Thu, 27 Sep 2018 10:55:17 -0700 Subject: [PATCH 177/187] qcacmn: Refactor operation related to INI gMaxConcurrentActiveSessions Ownership of gMaxConcurrentActiveSessions is changed from HDD to Policy manager. So policy manager doesn't have to rely on HDD to obtain the INI setting. CRs-Fixed: 2324395 Change-Id: Iac1451fc457d9bceee73596affdae54895917040 --- inc/wlan_policy_mgr_public_struct.h | 3 --- src/wlan_policy_mgr_get_set_utils.c | 9 ++++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index a816b139d466..a52029f0f7a7 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -1053,8 +1053,6 @@ enum policy_mgr_pri_id { /** * struct policy_mgr_user_cfg - Policy manager user config variables * @enable_mcc_adaptive_scheduler: Enable MCC adaptive scheduler - * @max_concurrent_active_sessions: User allowed maximum active - * connections * @enable2x2: 2x2 chain mask user config * @sub_20_mhz_enabled: Is 5 or 10 Mhz enabled * @dbs_selection_policy: band preference or Vdev preference @@ -1071,7 +1069,6 @@ enum policy_mgr_pri_id { */ struct policy_mgr_user_cfg { uint8_t enable_mcc_adaptive_scheduler; - uint8_t max_concurrent_active_sessions; bool enable2x2; bool sub_20_mhz_enabled; bool is_sta_sap_scc_allowed_on_dfs_chan; diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 168d9876b212..582db6828544 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -1499,9 +1499,9 @@ QDF_STATUS policy_mgr_incr_connection_count( } conn_index = policy_mgr_get_connection_count(psoc); - if (pm_ctx->user_cfg.max_concurrent_active_sessions < conn_index) { + if (pm_ctx->cfg.max_conc_cxns < conn_index) { policy_mgr_err("exceeded max connection limit %d", - pm_ctx->user_cfg.max_concurrent_active_sessions); + pm_ctx->cfg.max_conc_cxns); return status; } if (pm_ctx->wma_cbacks.wma_get_connection_info) { @@ -1730,8 +1730,7 @@ bool policy_mgr_max_concurrent_connections_reached( for (i = 0; i < QDF_MAX_NO_OF_MODE; i++) j += pm_ctx->no_of_active_sessions[i]; return j > - (pm_ctx->user_cfg. - max_concurrent_active_sessions - 1); + (pm_ctx->cfg.max_conc_cxns - 1); } return false; @@ -1800,7 +1799,7 @@ bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc, if (policy_mgr_max_concurrent_connections_reached(psoc)) { policy_mgr_err("Reached max concurrent connections: %d", - pm_ctx->user_cfg.max_concurrent_active_sessions); + pm_ctx->cfg.max_conc_cxns); goto done; } From d4e542be30efcdb6f9dae094d581e2d9238f70cd Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Thu, 27 Sep 2018 12:40:33 -0700 Subject: [PATCH 178/187] qcacmn: Refactor operation related to DBS/vdev/channel selection INIs Ownership of dbs_selection_policy, vdev_priority_list, channel_select_logic_conc INIs' are changed from HDD to Policy manager. So policy manager doesn't have to rely on HDD to obtain the INI setting. CRs-Fixed: 2324395 Change-Id: I8b38916d92931ef9cd1727481740bc61cad8f808 --- inc/wlan_policy_mgr_api.h | 4 ++-- inc/wlan_policy_mgr_public_struct.h | 14 -------------- inc/wlan_policy_mgr_ucfg.h | 4 ++-- src/wlan_policy_mgr_action.c | 16 ++++++++-------- src/wlan_policy_mgr_get_set_utils.c | 6 +++--- 5 files changed, 15 insertions(+), 29 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 28024645b332..59b645a28428 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -136,14 +136,14 @@ QDF_STATUS policy_mgr_get_conc_rule2(struct wlan_objmgr_psoc *psoc, /** * policy_mgr_get_dbs_selection_plcy() - DBS HW mode selection setting * @psoc: pointer to psoc - * @dbs_selection_policy: value to be filled + * @dbs_selection_plcy: value to be filled * * This API is used to find out DBS HW mode preference. * * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. */ QDF_STATUS policy_mgr_get_dbs_selection_plcy(struct wlan_objmgr_psoc *psoc, - uint32_t *dbs_selection_policy); + uint32_t *dbs_selection_plcy); /** * policy_mgr_get_vdev_priority_list() - to get vdev priority list * @psoc: pointer to psoc diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index a52029f0f7a7..89cb5c6ce7bd 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -1055,27 +1055,13 @@ enum policy_mgr_pri_id { * @enable_mcc_adaptive_scheduler: Enable MCC adaptive scheduler * @enable2x2: 2x2 chain mask user config * @sub_20_mhz_enabled: Is 5 or 10 Mhz enabled - * @dbs_selection_policy: band preference or Vdev preference - * bit[0] = 0: 5G 2x2 preferred to select 2x2 5G + 1x1 2G DBS mode. - * bit[0] = 1: 2G 2x2 preferred to select 2x2 2G + 1x1 5G DBS mode. - * bit[1] = 1: vdev priority enabled. - * bit[1] = 0: vdev priority disabled. - * @vdev_priority_list: vdev priority list - * bit[0-3]: pri_id (policy_mgr_pri_id) of highest priority - * bit[4-7]: pri_id (policy_mgr_pri_id) of second priority - * bit[8-11]: pri_id (policy_mgr_pri_id) of third priority - * bit[12-15]: pri_id (policy_mgr_pri_id) of fourth priority - * example: 0x4321 - CLI < GO < SAP < STA */ struct policy_mgr_user_cfg { uint8_t enable_mcc_adaptive_scheduler; bool enable2x2; bool sub_20_mhz_enabled; bool is_sta_sap_scc_allowed_on_dfs_chan; - uint32_t channel_select_logic_conc; uint32_t sta_sap_scc_on_lte_coex_chan; - uint32_t dbs_selection_policy; - uint32_t vdev_priority_list; }; /** diff --git a/inc/wlan_policy_mgr_ucfg.h b/inc/wlan_policy_mgr_ucfg.h index ab6e51c192d3..33e246cfa3fa 100644 --- a/inc/wlan_policy_mgr_ucfg.h +++ b/inc/wlan_policy_mgr_ucfg.h @@ -121,14 +121,14 @@ QDF_STATUS ucfg_policy_mgr_get_conc_rule2(struct wlan_objmgr_psoc *psoc, /** * ucfg_policy_mgr_get_dbs_selection_plcy() - DBS HW mode selection setting * @psoc: pointer to psoc - * @dbs_selection_policy: value to be filled + * @dbs_selection_plcy: value to be filled * * This API is used to find out DBS HW mode preference. * * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. */ QDF_STATUS ucfg_policy_mgr_get_dbs_selection_plcy(struct wlan_objmgr_psoc *psoc, - uint32_t *dbs_selection_policy); + uint32_t *dbs_selection_plcy); /** * ucfg_policy_mgr_get_vdev_priority_list() - to get vdev priority list * @psoc: pointer to psoc diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index ac2ddf75df79..a7514fbd9a8b 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -392,6 +392,7 @@ bool policy_mgr_is_dbs_allowed_for_concurrency( struct policy_mgr_psoc_priv_obj *pm_ctx; uint32_t count, dbs_for_sta_sta, dbs_for_sta_p2p; bool ret = true; + uint32_t ch_sel_plcy; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -404,10 +405,9 @@ bool policy_mgr_is_dbs_allowed_for_concurrency( if (count != 1 || new_conn_mode == QDF_MAX_NO_OF_MODE) return ret; - dbs_for_sta_sta = PM_CHANNEL_SELECT_LOGIC_STA_STA_GET(pm_ctx->user_cfg. - channel_select_logic_conc); - dbs_for_sta_p2p = PM_CHANNEL_SELECT_LOGIC_STA_P2P_GET(pm_ctx->user_cfg. - channel_select_logic_conc); + ch_sel_plcy = pm_ctx->cfg.chnl_select_plcy; + dbs_for_sta_sta = PM_CHANNEL_SELECT_LOGIC_STA_STA_GET(ch_sel_plcy); + dbs_for_sta_p2p = PM_CHANNEL_SELECT_LOGIC_STA_P2P_GET(ch_sel_plcy); switch (pm_conc_connection_list[0].mode) { case PM_STA_MODE: @@ -592,12 +592,12 @@ policy_mgr_get_preferred_dbs_action_table( policy_mgr_debug("target only supports DBS1!"); goto DONE; } - if (PM_GET_BAND_PREFERRED(pm_ctx->user_cfg.dbs_selection_policy) == 1) + if (PM_GET_BAND_PREFERRED(pm_ctx->cfg.dbs_selection_plcy) == 1) band_pref_5g = false; if (PM_GET_VDEV_PRIORITY_ENABLED( - pm_ctx->user_cfg.dbs_selection_policy) == 1 && - pm_ctx->user_cfg.vdev_priority_list) + pm_ctx->cfg.dbs_selection_plcy) == 1 && + pm_ctx->cfg.vdev_priority_list) vdev_priority_enabled = true; if (!vdev_priority_enabled) @@ -619,7 +619,7 @@ policy_mgr_get_preferred_dbs_action_table( vdev_id, new_conn_op_mode, channel, reason); } - vdev_pri_list = pm_ctx->user_cfg.vdev_priority_list; + vdev_pri_list = pm_ctx->cfg.vdev_priority_list; while (vdev_pri_list) { vdev_pri_id = vdev_pri_list & 0xF; pri_conn_mode = policy_mgr_pri_id_to_con_mode(vdev_pri_id); diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 582db6828544..3aeddd794bac 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -2112,10 +2112,10 @@ QDF_STATUS policy_mgr_set_user_cfg(struct wlan_objmgr_psoc *psoc, } pm_ctx->user_cfg = *user_cfg; - policy_mgr_debug("dbs_selection_policy 0x%x", - user_cfg->dbs_selection_policy); + policy_mgr_debug("dbs_selection_plcy 0x%x", + pm_ctx->cfg.dbs_selection_plcy); policy_mgr_debug("vdev_priority_list 0x%x", - user_cfg->vdev_priority_list); + pm_ctx->cfg.vdev_priority_list); pm_ctx->cur_conc_system_pref = pm_ctx->cfg.sys_pref; return QDF_STATUS_SUCCESS; From c9af406975cfa5cabe4cd327232349a15abfaa47 Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Thu, 27 Sep 2018 14:31:20 -0700 Subject: [PATCH 179/187] qcacmn: Refactor operation related to gEnableMCCAdaptiveScheduler INI Ownership of gEnableMCCAdaptiveScheduler is changed from HDD to Policy manager. So policy manager doesn't have to rely on HDD to obtain the INI setting. CRs-Fixed: 2324395 Change-Id: Ib86004c4ee753b37b392de69551c777e3e9011de --- inc/wlan_policy_mgr_api.h | 25 ++++++++++++------------- inc/wlan_policy_mgr_cfg.h | 25 ++++++++++++++++++++++++- inc/wlan_policy_mgr_public_struct.h | 2 -- inc/wlan_policy_mgr_ucfg.h | 12 ++++++++++++ src/wlan_policy_mgr_get_set_utils.c | 28 ++++++++++++++-------------- src/wlan_policy_mgr_i.h | 2 ++ src/wlan_policy_mgr_ucfg.c | 9 +++++++++ 7 files changed, 73 insertions(+), 30 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 59b645a28428..14c239e9af88 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -167,6 +167,18 @@ QDF_STATUS policy_mgr_get_vdev_priority_list(struct wlan_objmgr_psoc *psoc, */ QDF_STATUS policy_mgr_get_chnl_select_plcy(struct wlan_objmgr_psoc *psoc, uint32_t *chnl_select_plcy); + +/** + * policy_mgr_get_mcc_adaptive_sch() - to get mcc adaptive scheduler + * @psoc: pointer to psoc + * @enable_mcc_adaptive_sch: value to be filled + * + * This API is used to find out if mcc adaptive scheduler enabled or disabled + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS policy_mgr_get_mcc_adaptive_sch(struct wlan_objmgr_psoc *psoc, + uint8_t *enable_mcc_adaptive_sch); /** * policy_mgr_set_concurrency_mode() - To set concurrency mode * @psoc: PSOC object data @@ -2127,19 +2139,6 @@ enum policy_mgr_hw_mode_change policy_mgr_get_hw_mode_change_from_hw_mode_index( */ bool policy_mgr_is_scan_simultaneous_capable(struct wlan_objmgr_psoc *psoc); -/** - * policy_mgr_is_mcc_adaptive_scheduler_enabled() - Function to - * gets the policy manager mcc adaptive scheduler enabled - * @psoc: PSOC object information - * - * This function gets the value mcc adaptive scheduler - * - * Return: true if MCC adaptive scheduler is set else false - * - */ -bool policy_mgr_is_mcc_adaptive_scheduler_enabled( - struct wlan_objmgr_psoc *psoc); - /** * policy_mgr_set_user_cfg() - Function to set user cfg variables * required by policy manager component diff --git a/inc/wlan_policy_mgr_cfg.h b/inc/wlan_policy_mgr_cfg.h index 19b0495859ac..df63b6466e19 100644 --- a/inc/wlan_policy_mgr_cfg.h +++ b/inc/wlan_policy_mgr_cfg.h @@ -242,6 +242,28 @@ 0, 1, 0, \ CFG_VALUE_OR_DEFAULT, \ "Enable custom concurrency rule 2") +/* + * + * gEnableMCCAdaptiveScheduler - MCC Adaptive Scheduler feature. + * @Min: 0 + * @Max: 1 + * @Default: 1 + * + * This ini is used to enable/disable MCC Adaptive Scheduler feature. + * + * Related: None. + * + * Supported Feature: Concurrency + * + * Usage: Internal/External + * + * + */ +#define CFG_ENABLE_MCC_ADATIVE_SCH_ENABLED_NAME CFG_INI_UINT(\ + "gEnableMCCAdaptiveScheduler", \ + 0, 1, 1, \ + CFG_VALUE_OR_DEFAULT, \ + "Enable/Disable MCC Adaptive Scheduler") #define CFG_POLICY_MGR_ALL \ CFG(CFG_MCC_TO_SCC_SWITCH) \ @@ -251,5 +273,6 @@ CFG(CFG_VDEV_CUSTOM_PRIORITY_LIST) \ CFG(CFG_CHNL_SELECT_LOGIC_CONC) \ CFG(CFG_ENABLE_CONC_RULE1) \ - CFG(CFG_ENABLE_CONC_RULE2) + CFG(CFG_ENABLE_CONC_RULE2) \ + CFG(CFG_ENABLE_MCC_ADATIVE_SCH_ENABLED_NAME) #endif diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 89cb5c6ce7bd..53c605853ab0 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -1052,12 +1052,10 @@ enum policy_mgr_pri_id { /** * struct policy_mgr_user_cfg - Policy manager user config variables - * @enable_mcc_adaptive_scheduler: Enable MCC adaptive scheduler * @enable2x2: 2x2 chain mask user config * @sub_20_mhz_enabled: Is 5 or 10 Mhz enabled */ struct policy_mgr_user_cfg { - uint8_t enable_mcc_adaptive_scheduler; bool enable2x2; bool sub_20_mhz_enabled; bool is_sta_sap_scc_allowed_on_dfs_chan; diff --git a/inc/wlan_policy_mgr_ucfg.h b/inc/wlan_policy_mgr_ucfg.h index 33e246cfa3fa..bc27c19286a4 100644 --- a/inc/wlan_policy_mgr_ucfg.h +++ b/inc/wlan_policy_mgr_ucfg.h @@ -152,4 +152,16 @@ QDF_STATUS ucfg_policy_mgr_get_vdev_priority_list(struct wlan_objmgr_psoc *psoc, */ QDF_STATUS ucfg_policy_mgr_get_chnl_select_plcy(struct wlan_objmgr_psoc *psoc, uint32_t *chnl_select_plcy); +/** + * policy_mgr_get_mcc_adaptive_sch() - to get mcc adaptive scheduler + * @psoc: pointer to psoc + * @enable_mcc_adaptive_sch: value to be filled + * + * This API is used to find out if mcc adaptive scheduler enabled or disabled + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS +ucfg_policy_mgr_get_mcc_adaptive_sch(struct wlan_objmgr_psoc *psoc, + uint8_t *enable_mcc_adaptive_sch); #endif //__WLAN_POLICY_MGR_UCFG diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 3aeddd794bac..3e640c749a78 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -172,6 +172,20 @@ QDF_STATUS policy_mgr_get_chnl_select_plcy(struct wlan_objmgr_psoc *psoc, } +QDF_STATUS policy_mgr_get_mcc_adaptive_sch(struct wlan_objmgr_psoc *psoc, + uint8_t *enable_mcc_adaptive_sch) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("pm_ctx is NULL"); + return QDF_STATUS_E_FAILURE; + } + *enable_mcc_adaptive_sch = pm_ctx->cfg.enable_mcc_adaptive_sch; + + return QDF_STATUS_SUCCESS; +} void policy_mgr_update_new_hw_mode_index(struct wlan_objmgr_psoc *psoc, uint32_t new_hw_mode_index) @@ -2275,20 +2289,6 @@ bool policy_mgr_check_for_session_conc(struct wlan_objmgr_psoc *psoc, return true; } -bool policy_mgr_is_mcc_adaptive_scheduler_enabled( - struct wlan_objmgr_psoc *psoc) { - struct policy_mgr_psoc_priv_obj *pm_ctx; - - pm_ctx = policy_mgr_get_context(psoc); - if (!pm_ctx) { - policy_mgr_err("Invalid context"); - return false; - } - - return pm_ctx->user_cfg.enable_mcc_adaptive_scheduler ? - true : false; -} - /** * policy_mgr_change_mcc_go_beacon_interval() - Change MCC beacon interval * @psoc: PSOC object information diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 1be204cfdbaf..e5be24789e13 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -223,6 +223,7 @@ struct sta_ap_intf_check_work_ctx { * @dbs_selection_plcy: DBS selection policy for concurrency * @vdev_priority_list: Priority list for various vdevs * @chnl_select_plcy: Channel selection policy + * @enable_mcc_adaptive_sch: Enable/Disable MCC adaptive scheduler */ struct policy_mgr_cfg { uint8_t mcc_to_scc_switch; @@ -230,6 +231,7 @@ struct policy_mgr_cfg { uint8_t max_conc_cxns; uint8_t conc_rule1; uint8_t conc_rule2; + uint8_t enable_mcc_adaptive_sch; uint32_t dbs_selection_plcy; uint32_t vdev_priority_list; uint32_t chnl_select_plcy; diff --git a/src/wlan_policy_mgr_ucfg.c b/src/wlan_policy_mgr_ucfg.c index aad715d8e80d..80365392e685 100644 --- a/src/wlan_policy_mgr_ucfg.c +++ b/src/wlan_policy_mgr_ucfg.c @@ -40,6 +40,8 @@ static QDF_STATUS policy_mgr_init_cfg(struct wlan_objmgr_psoc *psoc) cfg->dbs_selection_plcy = cfg_get(psoc, CFG_DBS_SELECTION_PLCY); cfg->vdev_priority_list = cfg_get(psoc, CFG_VDEV_CUSTOM_PRIORITY_LIST); cfg->chnl_select_plcy = cfg_get(psoc, CFG_CHNL_SELECT_LOGIC_CONC); + cfg->enable_mcc_adaptive_sch = + cfg_get(psoc, CFG_ENABLE_MCC_ADATIVE_SCH_ENABLED_NAME); return QDF_STATUS_SUCCESS; } @@ -127,3 +129,10 @@ QDF_STATUS ucfg_policy_mgr_get_chnl_select_plcy(struct wlan_objmgr_psoc *psoc, { return policy_mgr_get_chnl_select_plcy(psoc, chnl_select_plcy); } + + +QDF_STATUS ucfg_policy_mgr_get_mcc_adaptive_sch(struct wlan_objmgr_psoc *psoc, + uint8_t *mcc_adaptive_sch) +{ + return policy_mgr_get_mcc_adaptive_sch(psoc, mcc_adaptive_sch); +} From dd8bf40a4473ec7d086fabe045f65c119c3f878b Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Thu, 27 Sep 2018 17:34:25 -0700 Subject: [PATCH 180/187] qcacmn: Refactor operation related to gEnableStaConnectionIn5Ghz INI Ownership of gEnableStaConnectionIn5Ghz is changed from HDD to Policy manager. So policy manager doesn't have to rely on HDD to obtain the INI setting. CRs-Fixed: 2324395 Change-Id: I894467bab4b0bddf309463802b98904ef1150536 --- inc/wlan_policy_mgr_api.h | 14 ++++++++++++++ inc/wlan_policy_mgr_cfg.h | 26 +++++++++++++++++++++++++- inc/wlan_policy_mgr_ucfg.h | 14 ++++++++++++++ src/wlan_policy_mgr_get_set_utils.c | 15 +++++++++++++++ src/wlan_policy_mgr_i.h | 2 ++ src/wlan_policy_mgr_ucfg.c | 8 ++++++++ 6 files changed, 78 insertions(+), 1 deletion(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 14c239e9af88..31da207ed607 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -179,6 +179,20 @@ QDF_STATUS policy_mgr_get_chnl_select_plcy(struct wlan_objmgr_psoc *psoc, */ QDF_STATUS policy_mgr_get_mcc_adaptive_sch(struct wlan_objmgr_psoc *psoc, uint8_t *enable_mcc_adaptive_sch); + +/** + * policy_mgr_get_sta_cxn_5g_band() - to get STA's connection in 5G config + * + * @psoc: pointer to psoc + * @enable_sta_cxn_5g_band: value to be filled + * + * This API is used to find out if STA connection in 5G band is allowed or + * disallowed. + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS policy_mgr_get_sta_cxn_5g_band(struct wlan_objmgr_psoc *psoc, + uint8_t *enable_sta_cxn_5g_band); /** * policy_mgr_set_concurrency_mode() - To set concurrency mode * @psoc: PSOC object data diff --git a/inc/wlan_policy_mgr_cfg.h b/inc/wlan_policy_mgr_cfg.h index df63b6466e19..22900022d06e 100644 --- a/inc/wlan_policy_mgr_cfg.h +++ b/inc/wlan_policy_mgr_cfg.h @@ -265,6 +265,29 @@ CFG_VALUE_OR_DEFAULT, \ "Enable/Disable MCC Adaptive Scheduler") +/* + * + * gEnableStaConnectionIn5Ghz - To enable/disable STA connection in 5G + * @Min: 0 + * @Max: 1 + * @Default: 1 + * + * This ini is used to enable/disable STA connection in 5G band + * + * Related: STA + * + * Supported Feature: Concurrency + * + * Usage: Internal/External + * + * + */ +#define CFG_ENABLE_STA_CONNECTION_IN_5GHZ CFG_INI_UINT(\ + "gEnableStaConnectionIn5Ghz", \ + 0, 1, 1, \ + CFG_VALUE_OR_DEFAULT, \ + "Enable/Disable STA connection in 5G") + #define CFG_POLICY_MGR_ALL \ CFG(CFG_MCC_TO_SCC_SWITCH) \ CFG(CFG_CONC_SYS_PREF) \ @@ -274,5 +297,6 @@ CFG(CFG_CHNL_SELECT_LOGIC_CONC) \ CFG(CFG_ENABLE_CONC_RULE1) \ CFG(CFG_ENABLE_CONC_RULE2) \ - CFG(CFG_ENABLE_MCC_ADATIVE_SCH_ENABLED_NAME) + CFG(CFG_ENABLE_MCC_ADATIVE_SCH_ENABLED_NAME)\ + CFG(CFG_ENABLE_STA_CONNECTION_IN_5GHZ) #endif diff --git a/inc/wlan_policy_mgr_ucfg.h b/inc/wlan_policy_mgr_ucfg.h index bc27c19286a4..661eebdec81e 100644 --- a/inc/wlan_policy_mgr_ucfg.h +++ b/inc/wlan_policy_mgr_ucfg.h @@ -164,4 +164,18 @@ QDF_STATUS ucfg_policy_mgr_get_chnl_select_plcy(struct wlan_objmgr_psoc *psoc, QDF_STATUS ucfg_policy_mgr_get_mcc_adaptive_sch(struct wlan_objmgr_psoc *psoc, uint8_t *enable_mcc_adaptive_sch); + +/** + * ucfg_policy_mgr_get_sta_cxn_5g_band() - to get STA's connection in 5G config + * + * @psoc: pointer to psoc + * @enable_sta_cxn_5g_band: value to be filled + * + * This API is used to find out if STA connection in 5G band is allowed or + * disallowed. + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS ucfg_policy_mgr_get_sta_cxn_5g_band(struct wlan_objmgr_psoc *psoc, + uint8_t *enable_sta_cxn_5g_band); #endif //__WLAN_POLICY_MGR_UCFG diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 3e640c749a78..250b5fb94988 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -187,6 +187,21 @@ QDF_STATUS policy_mgr_get_mcc_adaptive_sch(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +QDF_STATUS policy_mgr_get_sta_cxn_5g_band(struct wlan_objmgr_psoc *psoc, + uint8_t *enable_sta_cxn_5g_band) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("pm_ctx is NULL"); + return QDF_STATUS_E_FAILURE; + } + *enable_sta_cxn_5g_band = pm_ctx->cfg.enable_sta_cxn_5g_band; + + return QDF_STATUS_SUCCESS; +} + void policy_mgr_update_new_hw_mode_index(struct wlan_objmgr_psoc *psoc, uint32_t new_hw_mode_index) { diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index e5be24789e13..cc8c3436c388 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -224,6 +224,7 @@ struct sta_ap_intf_check_work_ctx { * @vdev_priority_list: Priority list for various vdevs * @chnl_select_plcy: Channel selection policy * @enable_mcc_adaptive_sch: Enable/Disable MCC adaptive scheduler + * @enable_sta_cxn_5g_band: Enable/Disable STA connection in 5G band */ struct policy_mgr_cfg { uint8_t mcc_to_scc_switch; @@ -232,6 +233,7 @@ struct policy_mgr_cfg { uint8_t conc_rule1; uint8_t conc_rule2; uint8_t enable_mcc_adaptive_sch; + uint8_t enable_sta_cxn_5g_band; uint32_t dbs_selection_plcy; uint32_t vdev_priority_list; uint32_t chnl_select_plcy; diff --git a/src/wlan_policy_mgr_ucfg.c b/src/wlan_policy_mgr_ucfg.c index 80365392e685..310019ba3249 100644 --- a/src/wlan_policy_mgr_ucfg.c +++ b/src/wlan_policy_mgr_ucfg.c @@ -42,6 +42,8 @@ static QDF_STATUS policy_mgr_init_cfg(struct wlan_objmgr_psoc *psoc) cfg->chnl_select_plcy = cfg_get(psoc, CFG_CHNL_SELECT_LOGIC_CONC); cfg->enable_mcc_adaptive_sch = cfg_get(psoc, CFG_ENABLE_MCC_ADATIVE_SCH_ENABLED_NAME); + cfg->enable_sta_cxn_5g_band = + cfg_get(psoc, CFG_ENABLE_STA_CONNECTION_IN_5GHZ); return QDF_STATUS_SUCCESS; } @@ -136,3 +138,9 @@ QDF_STATUS ucfg_policy_mgr_get_mcc_adaptive_sch(struct wlan_objmgr_psoc *psoc, { return policy_mgr_get_mcc_adaptive_sch(psoc, mcc_adaptive_sch); } + +QDF_STATUS ucfg_policy_mgr_get_sta_cxn_5g_band(struct wlan_objmgr_psoc *psoc, + uint8_t *enable_sta_cxn_5g_band) +{ + return policy_mgr_get_sta_cxn_5g_band(psoc, enable_sta_cxn_5g_band); +} From fef8741bd1357d465a6b646f8dd9496d7fe06752 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Wed, 17 Oct 2018 12:18:01 +0530 Subject: [PATCH 181/187] qcacmn: Select non SRD channel for SAP in STA+SAP Currently the driver selects the first channel available in the PCL channel-list which could be STA channel itself, and it may happen that this STA channel is not valid for SAP bringup(SRD). Fix is to select a non SRD channel from PCL channel-list for SAP. Change-Id: Ia9d3bfc0534e28972a6ddb0d588b62a55e3f6e23 CRs-Fixed: 2308072 --- src/wlan_policy_mgr_pcl.c | 51 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 8f91e024aea6..46d1556c61d3 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -358,6 +358,46 @@ static QDF_STATUS policy_mgr_modify_sap_pcl_based_on_nol( return QDF_STATUS_SUCCESS; } +static QDF_STATUS +policy_mgr_modify_sap_pcl_based_on_srd(struct wlan_objmgr_psoc *psoc, + uint8_t *pcl_list_org, + uint8_t *weight_list_org, + uint32_t *pcl_len_org) +{ + uint32_t i, pcl_len = 0; + uint8_t pcl_list[QDF_MAX_NUM_CHAN]; + uint8_t weight_list[QDF_MAX_NUM_CHAN]; + struct policy_mgr_psoc_priv_obj *pm_ctx; + bool is_etsi13_srd_chan_allowed_in_mas_mode = true; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + is_etsi13_srd_chan_allowed_in_mas_mode = + wlan_reg_is_etsi13_srd_chan_allowed_master_mode(pm_ctx->pdev); + + if (is_etsi13_srd_chan_allowed_in_mas_mode) + return QDF_STATUS_SUCCESS; + + for (i = 0; i < *pcl_len_org; i++) { + if (wlan_reg_is_etsi13_srd_chan(pm_ctx->pdev, + pcl_list_org[i])) + continue; + pcl_list[pcl_len] = pcl_list_org[i]; + weight_list[pcl_len++] = weight_list_org[i]; + } + + qdf_mem_zero(pcl_list_org, QDF_ARRAY_SIZE(pcl_list_org)); + qdf_mem_zero(weight_list_org, QDF_ARRAY_SIZE(weight_list_org)); + qdf_mem_copy(pcl_list_org, pcl_list, pcl_len); + qdf_mem_copy(weight_list_org, weight_list, pcl_len); + *pcl_len_org = pcl_len; + + return QDF_STATUS_SUCCESS; +} + static QDF_STATUS policy_mgr_pcl_modification_for_sap( struct wlan_objmgr_psoc *psoc, uint8_t *pcl_channels, uint8_t *pcl_weight, @@ -390,6 +430,17 @@ static QDF_STATUS policy_mgr_pcl_modification_for_sap( policy_mgr_debug("chan:%d weight:%d", pcl_channels[i], pcl_weight[i]); + status = policy_mgr_modify_sap_pcl_based_on_srd + (psoc, pcl_channels, pcl_weight, len); + if (QDF_IS_STATUS_ERROR(status)) { + policy_mgr_err("failed to get modified pcl for SAP"); + return status; + } + policy_mgr_debug("modified final pcl len:%d", *len); + for (i = 0; i < *len; i++) + policy_mgr_debug("chan:%d weight:%d", + pcl_channels[i], pcl_weight[i]); + return QDF_STATUS_SUCCESS; } From dae31901cdbb14a220138148b231ec31accae76a Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Sun, 21 Oct 2018 23:40:06 -0400 Subject: [PATCH 182/187] qcacmn: Add original vdev info for NSS update API Add original hw mode change request vdev id to NSS update APIs, so that the correct vdev to be used to do post processing after hw mode change, such as doing connect for hidden SSID case. Change-Id: Ie7f7b55a100ec4e23be2fc710d9b0d83cb33088d CRs-Fixed: 2336439 --- inc/wlan_policy_mgr_api.h | 9 ++++++--- src/wlan_policy_mgr_action.c | 12 ++++++++---- src/wlan_policy_mgr_core.c | 22 +++++++++++++++------- src/wlan_policy_mgr_i.h | 4 +++- 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 31da207ed607..423b4430e2b2 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1021,6 +1021,7 @@ typedef void (*policy_mgr_pdev_set_hw_mode_cback)(uint32_t status, * @next_action: next action to happen at policy mgr after * beacon update * @reason: Reason for nss update + * @original_vdev_id: original request hwmode change vdev id * * This function is the callback registered with SME at nss * update request time @@ -1031,7 +1032,8 @@ typedef void (*policy_mgr_nss_update_cback)(struct wlan_objmgr_psoc *psoc, uint8_t tx_status, uint8_t vdev_id, uint8_t next_action, - enum policy_mgr_conn_update_reason reason); + enum policy_mgr_conn_update_reason reason, + uint32_t original_vdev_id); /** * struct policy_mgr_sme_cbacks - SME Callbacks to be invoked @@ -1055,9 +1057,10 @@ struct policy_mgr_sme_cbacks { QDF_STATUS (*sme_pdev_set_hw_mode)(struct policy_mgr_hw_mode msg); QDF_STATUS (*sme_pdev_set_pcl)(struct policy_mgr_pcl_list *msg); QDF_STATUS (*sme_nss_update_request)(uint32_t vdev_id, - uint8_t new_nss, policy_mgr_nss_update_cback cback, + uint8_t new_nss, policy_mgr_nss_update_cback cback, uint8_t next_action, struct wlan_objmgr_psoc *psoc, - enum policy_mgr_conn_update_reason reason); + enum policy_mgr_conn_update_reason reason, + uint32_t original_vdev_id); QDF_STATUS (*sme_change_mcc_beacon_interval)(uint8_t session_id); QDF_STATUS (*sme_get_ap_channel_from_scan)( void *roam_profile, diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index a7514fbd9a8b..874ea495bafd 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -1066,7 +1066,8 @@ QDF_STATUS policy_mgr_next_actions( * intially. If yes, update the beacon template & notify FW. */ status = policy_mgr_nss_update(psoc, POLICY_MGR_RX_NSS_1, - PM_NOP, POLICY_MGR_ANY, reason); + PM_NOP, POLICY_MGR_ANY, reason, + session_id); break; case PM_UPGRADE: /* @@ -1074,7 +1075,8 @@ QDF_STATUS policy_mgr_next_actions( * intially. If yes, update the beacon template & notify FW. */ status = policy_mgr_nss_update(psoc, POLICY_MGR_RX_NSS_2, - PM_NOP, POLICY_MGR_ANY, reason); + PM_NOP, POLICY_MGR_ANY, reason, + session_id); break; case PM_DBS1_DOWNGRADE: status = policy_mgr_complete_action(psoc, POLICY_MGR_RX_NSS_1, @@ -1133,12 +1135,14 @@ QDF_STATUS policy_mgr_next_actions( case PM_UPGRADE_5G: status = policy_mgr_nss_update( psoc, POLICY_MGR_RX_NSS_2, - PM_NOP, POLICY_MGR_BAND_5, reason); + PM_NOP, POLICY_MGR_BAND_5, reason, + session_id); break; case PM_UPGRADE_2G: status = policy_mgr_nss_update( psoc, POLICY_MGR_RX_NSS_2, - PM_NOP, POLICY_MGR_BAND_24, reason); + PM_NOP, POLICY_MGR_BAND_24, reason, + session_id); break; default: policy_mgr_err("unexpected action value %d", action); diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index e3f78bba11ce..3b0a04b8f101 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -2517,6 +2517,7 @@ bool policy_mgr_is_5g_channel_allowed(struct wlan_objmgr_psoc *psoc, * @next_action: next action to happen at policy mgr after * beacon update * @reason: Reason for nss update + * @original_vdev_id: original request hwmode change vdev id * * This function is the callback registered with SME at nss * update request time @@ -2527,7 +2528,8 @@ static void policy_mgr_nss_update_cb(struct wlan_objmgr_psoc *psoc, uint8_t tx_status, uint8_t vdev_id, uint8_t next_action, - enum policy_mgr_conn_update_reason reason) + enum policy_mgr_conn_update_reason reason, + uint32_t original_vdev_id) { uint32_t conn_index = 0; QDF_STATUS ret; @@ -2545,9 +2547,11 @@ static void policy_mgr_nss_update_cb(struct wlan_objmgr_psoc *psoc, return; } - policy_mgr_debug("nss update successful for vdev:%d", vdev_id); + policy_mgr_debug("nss update successful for vdev:%d ori %d reason %d", + vdev_id, original_vdev_id, reason); if (PM_NOP != next_action) - policy_mgr_next_actions(psoc, vdev_id, next_action, reason); + policy_mgr_next_actions(psoc, original_vdev_id, next_action, + reason); else { policy_mgr_debug("No action needed right now"); ret = policy_mgr_set_opportunistic_update(psoc); @@ -2561,7 +2565,8 @@ static void policy_mgr_nss_update_cb(struct wlan_objmgr_psoc *psoc, QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc, uint8_t new_nss, uint8_t next_action, enum policy_mgr_band band, - enum policy_mgr_conn_update_reason reason) + enum policy_mgr_conn_update_reason reason, + uint32_t original_vdev_id) { QDF_STATUS status = QDF_STATUS_E_FAILURE; uint32_t index, count; @@ -2604,7 +2609,8 @@ QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc, status = pm_ctx->sme_cbacks.sme_nss_update_request( vdev_id, new_nss, policy_mgr_nss_update_cb, - next_action, psoc, reason); + next_action, psoc, reason, + original_vdev_id); if (!QDF_IS_STATUS_SUCCESS(status)) { policy_mgr_err("sme_nss_update_request() failed for vdev %d", vdev_id); @@ -2637,7 +2643,8 @@ QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc, status = pm_ctx->sme_cbacks.sme_nss_update_request( vdev_id, new_nss, policy_mgr_nss_update_cb, - next_action, psoc, reason); + next_action, psoc, reason, + original_vdev_id); if (!QDF_IS_STATUS_SUCCESS(status)) { policy_mgr_err("sme_nss_update_request() failed for vdev %d", vdev_id); @@ -2690,7 +2697,8 @@ QDF_STATUS policy_mgr_complete_action(struct wlan_objmgr_psoc *psoc, downgrade_band = POLICY_MGR_ANY; status = policy_mgr_nss_update(psoc, new_nss, next_action, - downgrade_band, reason); + downgrade_band, reason, + session_id); if (!QDF_IS_STATUS_SUCCESS(status)) status = policy_mgr_next_actions(psoc, session_id, next_action, reason); diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index cc8c3436c388..0a9d52b47050 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -534,6 +534,7 @@ void policy_mgr_reg_chan_change_callback(struct wlan_objmgr_psoc *psoc, * @next_action: Next action after nss update * @band: update AP vdev on the Band. * @reason: action reason + * @original_vdev_id: original request hwmode change vdev id * * The function will update AP vdevs on specific band. * eg. band = POLICY_MGR_ANY will request to update all band (2g and 5g) @@ -543,7 +544,8 @@ void policy_mgr_reg_chan_change_callback(struct wlan_objmgr_psoc *psoc, QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc, uint8_t new_nss, uint8_t next_action, enum policy_mgr_band band, - enum policy_mgr_conn_update_reason reason); + enum policy_mgr_conn_update_reason reason, + uint32_t original_vdev_id); /** * policy_mgr_is_concurrency_allowed() - Check for allowed From 88ddf823c2c9c282b189b41b8b4cf38b02a7b4c3 Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Fri, 25 May 2018 05:55:37 -0400 Subject: [PATCH 183/187] qcacmn: Add DBS to DBS switch for vdev Down Add DBS to DBS switch in opportunistic timer handler when vdev prioritization enabled. Change-Id: I902316d7f64427bcadf1131cc0b822d23fc172fa CRs-Fixed: 2338092 --- inc/wlan_policy_mgr_api.h | 32 +++++++++++++++------- inc/wlan_policy_mgr_public_struct.h | 5 ++++ src/wlan_policy_mgr_action.c | 41 +++++++++++++++++++++++------ src/wlan_policy_mgr_core.c | 5 ++-- 4 files changed, 64 insertions(+), 19 deletions(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 423b4430e2b2..f39b636346ed 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -1150,16 +1150,30 @@ struct policy_mgr_wma_cbacks { }; /** - * policy_mgr_need_opportunistic_upgrade() - Tells us if we really - * need an upgrade to 2x2 - * @psoc: PSOC object information - * This function returns if updrade to 2x2 is needed - * - * Return: PM_NOP = upgrade is not needed, otherwise upgrade is - * needed - */ +* policy_mgr_need_opportunistic_upgrade - check whether needs to change current +* HW mode to single mac 2x2 or the other DBS mode(for Dual DBS HW only). +* @psoc: PSOC object information +* @reason: enum policy_mgr_conn_update_reason +* +* This function is to check whether needs to change to single Mac mode. +* when opportunistic timer fired. But a special case for Dual DBS HW, this +* function will check DBS to DBS change is required or not: +* 1. For Dual DBS HW, if user set vdev priority list, we may need to do +* DBS to DBS switching. +* eg. P2P GO (2g) < SAP (5G) < STA (2g) in DBS2. +* If STA down, we need to switch to DBS1: P2P GO (2g) < SAP (5g). +* So, for opportunistic checking, we need to add DBS ->DBS checking +* as well. +* 2. Reason code : +* DBS -> Single MAC : POLICY_MGR_UPDATE_REASON_OPPORTUNISTIC +* DBS -> DBS : POLICY_MGR_UPDATE_REASON_PRI_VDEV_CHANGE +* +* return: PM_NOP, upgrade is not needed, otherwise new action type +* and reason code be returned. +*/ enum policy_mgr_conc_next_action policy_mgr_need_opportunistic_upgrade( - struct wlan_objmgr_psoc *psoc); + struct wlan_objmgr_psoc *psoc, + enum policy_mgr_conn_update_reason *reason); /** * policy_mgr_next_actions() - initiates actions needed on current diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index 53c605853ab0..182afded647a 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -751,6 +751,10 @@ enum policy_mgr_band { * @POLICY_MGR_UPDATE_REASON_NSS_UPDATE: NSS update * @POLICY_MGR_UPDATE_REASON_CHANNEL_SWITCH: Channel switch * @POLICY_MGR_UPDATE_REASON_CHANNEL_SWITCH_STA: Channel switch for STA + * @POLICY_MGR_UPDATE_REASON_PRI_VDEV_CHANGE: In Dual DBS HW, if the vdev based + * 2x2 preference enabled, the vdev down may cause prioritized active + * vdev change, then DBS hw mode may needs to change from one DBS mode + * to the other DBS mode. This reason code indicates such condition. */ enum policy_mgr_conn_update_reason { POLICY_MGR_UPDATE_REASON_SET_OPER_CHAN, @@ -764,6 +768,7 @@ enum policy_mgr_conn_update_reason { POLICY_MGR_UPDATE_REASON_CHANNEL_SWITCH, POLICY_MGR_UPDATE_REASON_CHANNEL_SWITCH_STA, POLICY_MGR_UPDATE_REASON_PRE_CAC, + POLICY_MGR_UPDATE_REASON_PRI_VDEV_CHANGE, }; /** diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 874ea495bafd..27bf91d634e2 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -105,7 +105,7 @@ QDF_STATUS policy_mgr_check_n_start_opportunistic_timer( policy_mgr_err("PM ctx not valid. Oppurtunistic timer cannot start"); return QDF_STATUS_E_FAILURE; } - if (policy_mgr_need_opportunistic_upgrade(psoc)) { + if (policy_mgr_need_opportunistic_upgrade(psoc, NULL)) { /* let's start the timer */ qdf_mc_timer_stop(&pm_ctx->dbs_opportunistic_timer); status = qdf_mc_timer_start( @@ -182,10 +182,12 @@ QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc, } enum policy_mgr_conc_next_action policy_mgr_need_opportunistic_upgrade( - struct wlan_objmgr_psoc *psoc) + struct wlan_objmgr_psoc *psoc, + enum policy_mgr_conn_update_reason *reason) { uint32_t conn_index; enum policy_mgr_conc_next_action upgrade = PM_NOP; + enum policy_mgr_conc_next_action preferred_dbs_action; uint8_t mac = 0; struct policy_mgr_hw_mode_params hw_mode; QDF_STATUS status = QDF_STATUS_E_FAILURE; @@ -194,22 +196,22 @@ enum policy_mgr_conc_next_action policy_mgr_need_opportunistic_upgrade( pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { policy_mgr_err("Invalid Context"); - goto done; + goto exit; } if (policy_mgr_is_hw_dbs_capable(psoc) == false) { policy_mgr_err("driver isn't dbs capable, no further action needed"); - goto done; + goto exit; } status = policy_mgr_get_current_hw_mode(psoc, &hw_mode); if (!QDF_IS_STATUS_SUCCESS(status)) { policy_mgr_err("policy_mgr_get_current_hw_mode failed"); - goto done; + goto exit; } if (!hw_mode.dbs_cap) { policy_mgr_debug("current HW mode is non-DBS capable"); - goto done; + goto exit; } qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); @@ -248,6 +250,8 @@ enum policy_mgr_conc_next_action policy_mgr_need_opportunistic_upgrade( } /* Let's request for single MAC mode */ upgrade = PM_SINGLE_MAC; + if (reason) + *reason = POLICY_MGR_UPDATE_REASON_OPPORTUNISTIC; /* Is there any connection had an initial connection with 2x2 */ for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; conn_index++) { @@ -261,6 +265,26 @@ enum policy_mgr_conc_next_action policy_mgr_need_opportunistic_upgrade( qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); done: + if (upgrade == PM_NOP && hw_mode.dbs_cap && + policy_mgr_is_2x2_1x1_dbs_capable(psoc)) { + preferred_dbs_action = + policy_mgr_get_preferred_dbs_action_table( + psoc, INVALID_VDEV_ID, 0, 0); + if (hw_mode.action_type == PM_DBS1 && + preferred_dbs_action == PM_DBS2) { + upgrade = PM_DBS2_DOWNGRADE; + if (reason) + *reason = + POLICY_MGR_UPDATE_REASON_PRI_VDEV_CHANGE; + } else if (hw_mode.action_type == PM_DBS2 && + preferred_dbs_action == PM_DBS1) { + upgrade = PM_DBS1_DOWNGRADE; + if (reason) + *reason = + POLICY_MGR_UPDATE_REASON_PRI_VDEV_CHANGE; + } + } +exit: return upgrade; } @@ -1908,6 +1932,7 @@ void policy_mgr_check_and_stop_opportunistic_timer( struct policy_mgr_psoc_priv_obj *pm_ctx; enum policy_mgr_conc_next_action action = PM_NOP; QDF_STATUS status = QDF_STATUS_E_FAILURE; + enum policy_mgr_conn_update_reason reason; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { @@ -1917,11 +1942,11 @@ void policy_mgr_check_and_stop_opportunistic_timer( if (QDF_TIMER_STATE_RUNNING == pm_ctx->dbs_opportunistic_timer.state) { qdf_mc_timer_stop(&pm_ctx->dbs_opportunistic_timer); - action = policy_mgr_need_opportunistic_upgrade(psoc); + action = policy_mgr_need_opportunistic_upgrade(psoc, &reason); if (action) { qdf_event_reset(&pm_ctx->opportunistic_update_done_evt); status = policy_mgr_next_actions(psoc, id, action, - POLICY_MGR_UPDATE_REASON_OPPORTUNISTIC); + reason); if (status != QDF_STATUS_SUCCESS) { policy_mgr_err("Failed in policy_mgr_next_actions"); return; diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 3b0a04b8f101..de1763c75df2 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -1394,6 +1394,7 @@ void pm_dbs_opportunistic_timer_handler(void *data) enum policy_mgr_conc_next_action action = PM_NOP; uint32_t session_id; struct wlan_objmgr_psoc *psoc = (struct wlan_objmgr_psoc *)data; + enum policy_mgr_conn_update_reason reason; if (!psoc) { policy_mgr_err("Invalid Context"); @@ -1401,13 +1402,13 @@ void pm_dbs_opportunistic_timer_handler(void *data) } /* if we still need it */ - action = policy_mgr_need_opportunistic_upgrade(psoc); + action = policy_mgr_need_opportunistic_upgrade(psoc, &reason); policy_mgr_debug("action:%d", action); if (!action) return; session_id = pm_get_vdev_id_of_first_conn_idx(psoc); policy_mgr_next_actions(psoc, session_id, action, - POLICY_MGR_UPDATE_REASON_OPPORTUNISTIC); + reason); } /** From e85dfe6956f08c44fffdd2166adb8d107ae204a5 Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Fri, 25 May 2018 06:31:57 -0400 Subject: [PATCH 184/187] qcacmn: Add chan change HW mode change Add policy_mgr_get_current_pref_hw_mode_dual_dbs API for dual dbs HW. In Dual DBS mode HW, it decides the actual DBS mode when DBS required. Change-Id: Ic45b09fa49e1ff923f1a2dad50a3ce7e4007a3fd CRs-Fixed: 2338105 --- src/wlan_policy_mgr_action.c | 4 +++- src/wlan_policy_mgr_core.c | 33 +++++++++++++++++++++++++++++++ src/wlan_policy_mgr_i.h | 14 +++++++++++++ src/wlan_policy_mgr_init_deinit.c | 3 +++ 4 files changed, 53 insertions(+), 1 deletion(-) diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 27bf91d634e2..809406cc8191 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -1855,7 +1855,9 @@ QDF_STATUS policy_mgr_set_hw_mode_on_channel_switch( action = (*policy_mgr_get_current_pref_hw_mode_ptr)(psoc); if ((action != PM_DBS_DOWNGRADE) && - (action != PM_SINGLE_MAC_UPGRADE)) { + (action != PM_SINGLE_MAC_UPGRADE) && + (action != PM_DBS1_DOWNGRADE) && + (action != PM_DBS2_DOWNGRADE)) { policy_mgr_err("Invalid action: %d", action); status = QDF_STATUS_SUCCESS; goto done; diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index de1763c75df2..a91ecd9c1f12 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -2955,6 +2955,39 @@ enum policy_mgr_conc_next_action return next_action; } +enum policy_mgr_conc_next_action +policy_mgr_get_current_pref_hw_mode_dual_dbs( + struct wlan_objmgr_psoc *psoc) +{ + enum policy_mgr_conc_next_action next_action; + struct policy_mgr_psoc_priv_obj *pm_ctx; + enum policy_mgr_conc_next_action preferred_dbs; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return PM_NOP; + } + + next_action = policy_mgr_get_current_pref_hw_mode_dbs_1x1(psoc); + policy_mgr_info("next_action %d", next_action); + if (next_action != PM_DBS_DOWNGRADE) + return next_action; + + preferred_dbs = policy_mgr_get_preferred_dbs_action_table( + psoc, INVALID_VDEV_ID, 0, 0); + if (preferred_dbs == PM_DBS1) { + next_action = PM_DBS1_DOWNGRADE; + } else if (preferred_dbs == PM_DBS2) { + next_action = PM_DBS2_DOWNGRADE; + } else { + policy_mgr_err("DBS1 and DBS2 hw mode not supported"); + return PM_NOP; + } + policy_mgr_info("preferred_dbs %d", next_action); + return next_action; +} + /** * policy_mgr_reset_sap_mandatory_channels() - Reset the SAP mandatory channels * diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 0a9d52b47050..5f29c534f726 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -489,6 +489,20 @@ enum policy_mgr_conc_next_action enum policy_mgr_conc_next_action policy_mgr_get_current_pref_hw_mode_dbs_1x1( struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_get_current_pref_hw_mode_dual_dbs() - Get the + * current preferred hw mode + * + * Get the preferred hw mode based on the current connection combinations + * + * Return: No change (PM_NOP), (PM_SINGLE_MAC_UPGRADE), + * DBS (PM_DBS1_DOWNGRADE or PM_DBS2_DOWNGRADE) + */ +enum policy_mgr_conc_next_action + policy_mgr_get_current_pref_hw_mode_dual_dbs( + struct wlan_objmgr_psoc *psoc); + QDF_STATUS policy_mgr_reset_sap_mandatory_channels( struct policy_mgr_psoc_priv_obj *pm_ctx); diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 2dc015d3f404..3b99c7ce6620 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -423,6 +423,9 @@ QDF_STATUS policy_mgr_psoc_enable(struct wlan_objmgr_psoc *psoc) if (policy_mgr_is_hw_dbs_2x2_capable(psoc)) policy_mgr_get_current_pref_hw_mode_ptr = policy_mgr_get_current_pref_hw_mode_dbs_2x2; + else if (policy_mgr_is_2x2_1x1_dbs_capable(psoc)) + policy_mgr_get_current_pref_hw_mode_ptr = + policy_mgr_get_current_pref_hw_mode_dual_dbs; else policy_mgr_get_current_pref_hw_mode_ptr = policy_mgr_get_current_pref_hw_mode_dbs_1x1; From 2a4e082ad71360a96eeeb4e3b234d87ab7e87ae9 Mon Sep 17 00:00:00 2001 From: Yeshwanth Sriram Guntuka Date: Mon, 29 Oct 2018 19:45:57 +0530 Subject: [PATCH 185/187] qcacmn: Reduce scan time when in GO+STA MCC Scan on STA interface is taking around 10 secs to complete. There is a 7secs expiry time used in nl which could result in scan results received for the first 3secs, which are from 2G channels, to be flushed. Fix is to not set offchannel simultaneous feature capability, decrease the active dwell time for 2G channels to 40msecs and increase burst duration to 240msecs when GO is active. Change-Id: If014b2115048018432943d863bbe184beb498408 CRs-Fixed: 2340516 --- src/wlan_policy_mgr_get_set_utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 250b5fb94988..c41b794d0a6b 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -3025,7 +3025,8 @@ bool policy_mgr_is_scan_simultaneous_capable(struct wlan_objmgr_psoc *psoc) (ENABLE_DBS_CXN_AND_DISABLE_DBS_SCAN == wlan_objmgr_psoc_get_dual_mac_disable(psoc)) || (ENABLE_DBS_CXN_AND_DISABLE_SIMULTANEOUS_SCAN == - wlan_objmgr_psoc_get_dual_mac_disable(psoc))) + wlan_objmgr_psoc_get_dual_mac_disable(psoc)) || + !policy_mgr_is_hw_dbs_capable(psoc)) return false; return true; From 862a3441dea6675f90b677fc28ba68a977c90a0d Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Tue, 6 Nov 2018 18:52:18 +0530 Subject: [PATCH 186/187] qcacmn: Possible Out of bound read in policy_mgr_get_channel_list To prepare the channel list suggestion for a new connection, policy_mgr_get_channel_list invokes policy_mgr_get_valid_chans to get the number of valid channels. Driver uses returned num channel and iterates channel list to divide the list into 2.4 & 5 GHz lists. In case if, num of valid channel returned by policy_mgr_get_valid_chans is greater than the maximum number of channel supported in the channel list, QDF_MAX_NUM_CHAN(128), possible OOB read occurs. Validate the value of chan_index of channel list in policy_mgr_get_channel_list against the maximum number of channels supported in the channel list. Change-Id: I6beb9231aaef491731557434d1ae210ac0bdb036 CRs-Fixed: 2346125 --- src/wlan_policy_mgr_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index a91ecd9c1f12..f4dc476c016c 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -1972,6 +1972,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc, } while ((chan_index < num_channels) && + (chan_index < QDF_MAX_NUM_CHAN) && (chan_index_5 < QDF_MAX_NUM_CHAN)) { if ((true == skip_dfs_channel) && wlan_reg_is_dfs_ch(pm_ctx->pdev, @@ -3090,7 +3091,7 @@ void policy_mgr_init_sap_mandatory_2g_chan(struct wlan_objmgr_psoc *psoc) } pm_ctx->sap_mandatory_channels_len = 0; - for (i = 0; i < len; i++) { + for (i = 0; (i < len) && (i < QDF_MAX_NUM_CHAN); i++) { if (WLAN_REG_IS_24GHZ_CH(chan_list[i])) { policy_mgr_debug("Add chan %hu to mandatory list", chan_list[i]); From 478b1fa7a87e646ad1bf8087753e42268bed50bd Mon Sep 17 00:00:00 2001 From: Linux Build Service Account Date: Tue, 4 Dec 2018 15:59:42 +0530 Subject: [PATCH 187/187] Move umac/cmn_services/policy_mgr to components/cmn_services/policy_mgr Change-Id: Ie67730cd3f1a249c3dcbb2b6eaf95a55cbd08306 --- .../cmn_services/policy_mgr/inc}/wlan_policy_mgr_api.h | 0 .../cmn_services/policy_mgr/inc}/wlan_policy_mgr_cfg.h | 0 .../cmn_services/policy_mgr/inc}/wlan_policy_mgr_public_struct.h | 0 .../cmn_services/policy_mgr/inc}/wlan_policy_mgr_ucfg.h | 0 .../cmn_services/policy_mgr/src}/wlan_policy_mgr_action.c | 0 .../cmn_services/policy_mgr/src}/wlan_policy_mgr_core.c | 0 .../cmn_services/policy_mgr/src}/wlan_policy_mgr_get_set_utils.c | 0 .../cmn_services/policy_mgr/src}/wlan_policy_mgr_i.h | 0 .../cmn_services/policy_mgr/src}/wlan_policy_mgr_init_deinit.c | 0 .../cmn_services/policy_mgr/src}/wlan_policy_mgr_pcl.c | 0 .../policy_mgr/src}/wlan_policy_mgr_tables_1x1_dbs_i.h | 0 .../policy_mgr/src}/wlan_policy_mgr_tables_2x2_2g_1x1_5g.h | 0 .../policy_mgr/src}/wlan_policy_mgr_tables_2x2_5g_1x1_2g.h | 0 .../policy_mgr/src}/wlan_policy_mgr_tables_2x2_dbs_i.h | 0 .../policy_mgr/src}/wlan_policy_mgr_tables_no_dbs_i.h | 0 .../cmn_services/policy_mgr/src}/wlan_policy_mgr_ucfg.c | 0 16 files changed, 0 insertions(+), 0 deletions(-) rename {inc => components/cmn_services/policy_mgr/inc}/wlan_policy_mgr_api.h (100%) rename {inc => components/cmn_services/policy_mgr/inc}/wlan_policy_mgr_cfg.h (100%) rename {inc => components/cmn_services/policy_mgr/inc}/wlan_policy_mgr_public_struct.h (100%) rename {inc => components/cmn_services/policy_mgr/inc}/wlan_policy_mgr_ucfg.h (100%) rename {src => components/cmn_services/policy_mgr/src}/wlan_policy_mgr_action.c (100%) rename {src => components/cmn_services/policy_mgr/src}/wlan_policy_mgr_core.c (100%) rename {src => components/cmn_services/policy_mgr/src}/wlan_policy_mgr_get_set_utils.c (100%) rename {src => components/cmn_services/policy_mgr/src}/wlan_policy_mgr_i.h (100%) rename {src => components/cmn_services/policy_mgr/src}/wlan_policy_mgr_init_deinit.c (100%) rename {src => components/cmn_services/policy_mgr/src}/wlan_policy_mgr_pcl.c (100%) rename {src => components/cmn_services/policy_mgr/src}/wlan_policy_mgr_tables_1x1_dbs_i.h (100%) rename {src => components/cmn_services/policy_mgr/src}/wlan_policy_mgr_tables_2x2_2g_1x1_5g.h (100%) rename {src => components/cmn_services/policy_mgr/src}/wlan_policy_mgr_tables_2x2_5g_1x1_2g.h (100%) rename {src => components/cmn_services/policy_mgr/src}/wlan_policy_mgr_tables_2x2_dbs_i.h (100%) rename {src => components/cmn_services/policy_mgr/src}/wlan_policy_mgr_tables_no_dbs_i.h (100%) rename {src => components/cmn_services/policy_mgr/src}/wlan_policy_mgr_ucfg.c (100%) diff --git a/inc/wlan_policy_mgr_api.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h similarity index 100% rename from inc/wlan_policy_mgr_api.h rename to components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h diff --git a/inc/wlan_policy_mgr_cfg.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h similarity index 100% rename from inc/wlan_policy_mgr_cfg.h rename to components/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h diff --git a/inc/wlan_policy_mgr_public_struct.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h similarity index 100% rename from inc/wlan_policy_mgr_public_struct.h rename to components/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h diff --git a/inc/wlan_policy_mgr_ucfg.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_ucfg.h similarity index 100% rename from inc/wlan_policy_mgr_ucfg.h rename to components/cmn_services/policy_mgr/inc/wlan_policy_mgr_ucfg.h diff --git a/src/wlan_policy_mgr_action.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c similarity index 100% rename from src/wlan_policy_mgr_action.c rename to components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c diff --git a/src/wlan_policy_mgr_core.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c similarity index 100% rename from src/wlan_policy_mgr_core.c rename to components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c diff --git a/src/wlan_policy_mgr_get_set_utils.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c similarity index 100% rename from src/wlan_policy_mgr_get_set_utils.c rename to components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c diff --git a/src/wlan_policy_mgr_i.h b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h similarity index 100% rename from src/wlan_policy_mgr_i.h rename to components/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h diff --git a/src/wlan_policy_mgr_init_deinit.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c similarity index 100% rename from src/wlan_policy_mgr_init_deinit.c rename to components/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c diff --git a/src/wlan_policy_mgr_pcl.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c similarity index 100% rename from src/wlan_policy_mgr_pcl.c rename to components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c diff --git a/src/wlan_policy_mgr_tables_1x1_dbs_i.h b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_1x1_dbs_i.h similarity index 100% rename from src/wlan_policy_mgr_tables_1x1_dbs_i.h rename to components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_1x1_dbs_i.h diff --git a/src/wlan_policy_mgr_tables_2x2_2g_1x1_5g.h b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_2x2_2g_1x1_5g.h similarity index 100% rename from src/wlan_policy_mgr_tables_2x2_2g_1x1_5g.h rename to components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_2x2_2g_1x1_5g.h diff --git a/src/wlan_policy_mgr_tables_2x2_5g_1x1_2g.h b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_2x2_5g_1x1_2g.h similarity index 100% rename from src/wlan_policy_mgr_tables_2x2_5g_1x1_2g.h rename to components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_2x2_5g_1x1_2g.h diff --git a/src/wlan_policy_mgr_tables_2x2_dbs_i.h b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_2x2_dbs_i.h similarity index 100% rename from src/wlan_policy_mgr_tables_2x2_dbs_i.h rename to components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_2x2_dbs_i.h diff --git a/src/wlan_policy_mgr_tables_no_dbs_i.h b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_no_dbs_i.h similarity index 100% rename from src/wlan_policy_mgr_tables_no_dbs_i.h rename to components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_no_dbs_i.h diff --git a/src/wlan_policy_mgr_ucfg.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_ucfg.c similarity index 100% rename from src/wlan_policy_mgr_ucfg.c rename to components/cmn_services/policy_mgr/src/wlan_policy_mgr_ucfg.c