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
This commit is contained in:
@@ -680,6 +680,8 @@ enum policy_mgr_con_mode policy_mgr_convert_device_mode_to_qdf_type(
|
|||||||
* @dfs: HW Agile DFS capability
|
* @dfs: HW Agile DFS capability
|
||||||
* @sbs: HW SBS capability
|
* @sbs: HW SBS capability
|
||||||
* @reason: Reason for connection update
|
* @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
|
* 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_dbs_capab dbs,
|
||||||
enum hw_mode_agile_dfs_capab dfs,
|
enum hw_mode_agile_dfs_capab dfs,
|
||||||
enum hw_mode_sbs_capab sbs,
|
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
|
* policy_mgr_nss_update_cback() - callback invoked by other
|
||||||
|
@@ -668,6 +668,8 @@ enum policy_mgr_two_connection_mode {
|
|||||||
* @PM_SINGLE_MAC_UPGRADE: switch to MCC/SCC mode & upgrade to 2x2
|
* @PM_SINGLE_MAC_UPGRADE: switch to MCC/SCC mode & upgrade to 2x2
|
||||||
* @PM_SBS: switch to SBS mode
|
* @PM_SBS: switch to SBS mode
|
||||||
* @PM_SBS_DOWNGRADE: switch to SBS mode & downgrade to 1x1
|
* @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
|
* @PM_MAX_CONC_PRIORITY_MODE: Max place holder
|
||||||
*
|
*
|
||||||
* These are generic IDs that identify the various roles
|
* These are generic IDs that identify the various roles
|
||||||
@@ -682,6 +684,8 @@ enum policy_mgr_conc_next_action {
|
|||||||
PM_SINGLE_MAC_UPGRADE,
|
PM_SINGLE_MAC_UPGRADE,
|
||||||
PM_SBS,
|
PM_SBS,
|
||||||
PM_SBS_DOWNGRADE,
|
PM_SBS_DOWNGRADE,
|
||||||
|
PM_DOWNGRADE,
|
||||||
|
PM_UPGRADE,
|
||||||
|
|
||||||
PM_MAX_CONC_NEXT_ACTION
|
PM_MAX_CONC_NEXT_ACTION
|
||||||
};
|
};
|
||||||
@@ -889,6 +893,7 @@ struct policy_mgr_dual_mac_config {
|
|||||||
* @set_hw_mode_cb: HDD set HW mode callback
|
* @set_hw_mode_cb: HDD set HW mode callback
|
||||||
* @reason: Reason for HW mode change
|
* @reason: Reason for HW mode change
|
||||||
* @session_id: Session id
|
* @session_id: Session id
|
||||||
|
* @next_action: next action to happen at policy mgr
|
||||||
* @context: psoc context
|
* @context: psoc context
|
||||||
*/
|
*/
|
||||||
struct policy_mgr_hw_mode {
|
struct policy_mgr_hw_mode {
|
||||||
@@ -896,7 +901,7 @@ struct policy_mgr_hw_mode {
|
|||||||
void *set_hw_mode_cb;
|
void *set_hw_mode_cb;
|
||||||
enum policy_mgr_conn_update_reason reason;
|
enum policy_mgr_conn_update_reason reason;
|
||||||
uint32_t session_id;
|
uint32_t session_id;
|
||||||
struct wlan_objmgr_vdev *vdev;
|
uint8_t next_action;
|
||||||
struct wlan_objmgr_psoc *context;
|
struct wlan_objmgr_psoc *context;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -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_dbs_capab dbs,
|
||||||
enum hw_mode_agile_dfs_capab dfs,
|
enum hw_mode_agile_dfs_capab dfs,
|
||||||
enum hw_mode_sbs_capab sbs,
|
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;
|
int8_t hw_mode_index;
|
||||||
struct policy_mgr_hw_mode msg;
|
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.set_hw_mode_cb = (void *)policy_mgr_pdev_set_hw_mode_cb;
|
||||||
msg.reason = reason;
|
msg.reason = reason;
|
||||||
msg.session_id = session_id;
|
msg.session_id = session_id;
|
||||||
|
msg.next_action = next_action;
|
||||||
msg.context = psoc;
|
msg.context = psoc;
|
||||||
|
|
||||||
policy_mgr_debug("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",
|
||||||
@@ -488,7 +490,7 @@ QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc,
|
|||||||
HW_MODE_DBS,
|
HW_MODE_DBS,
|
||||||
HW_MODE_AGILE_DFS_NONE,
|
HW_MODE_AGILE_DFS_NONE,
|
||||||
HW_MODE_SBS_NONE,
|
HW_MODE_SBS_NONE,
|
||||||
reason);
|
reason, PM_NOP);
|
||||||
break;
|
break;
|
||||||
case PM_SINGLE_MAC_UPGRADE:
|
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_DBS_NONE,
|
||||||
HW_MODE_AGILE_DFS_NONE,
|
HW_MODE_AGILE_DFS_NONE,
|
||||||
HW_MODE_SBS_NONE,
|
HW_MODE_SBS_NONE,
|
||||||
reason);
|
reason, PM_UPGRADE);
|
||||||
/*
|
|
||||||
* 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;
|
break;
|
||||||
case PM_SINGLE_MAC:
|
case PM_SINGLE_MAC:
|
||||||
status = policy_mgr_pdev_set_hw_mode(psoc, session_id,
|
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_DBS_NONE,
|
||||||
HW_MODE_AGILE_DFS_NONE,
|
HW_MODE_AGILE_DFS_NONE,
|
||||||
HW_MODE_SBS_NONE,
|
HW_MODE_SBS_NONE,
|
||||||
reason);
|
reason, PM_NOP);
|
||||||
break;
|
break;
|
||||||
case PM_DBS_UPGRADE:
|
case PM_DBS_UPGRADE:
|
||||||
status = policy_mgr_pdev_set_hw_mode(psoc, session_id,
|
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_DBS,
|
||||||
HW_MODE_AGILE_DFS_NONE,
|
HW_MODE_AGILE_DFS_NONE,
|
||||||
HW_MODE_SBS_NONE,
|
HW_MODE_SBS_NONE,
|
||||||
reason);
|
reason, PM_UPGRADE);
|
||||||
|
|
||||||
status = policy_mgr_complete_action(psoc, POLICY_MGR_RX_NSS_2,
|
|
||||||
PM_DBS, reason, session_id);
|
|
||||||
break;
|
break;
|
||||||
case PM_SBS_DOWNGRADE:
|
case PM_SBS_DOWNGRADE:
|
||||||
status = policy_mgr_complete_action(psoc, POLICY_MGR_RX_NSS_1,
|
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_DBS,
|
||||||
HW_MODE_AGILE_DFS_NONE,
|
HW_MODE_AGILE_DFS_NONE,
|
||||||
HW_MODE_SBS,
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
policy_mgr_err("unexpected action value %d", action);
|
policy_mgr_err("unexpected action value %d", action);
|
||||||
|
@@ -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_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,
|
void policy_mgr_pdev_set_hw_mode_cb(uint32_t status,
|
||||||
uint32_t cfgd_hw_mode_index,
|
uint32_t cfgd_hw_mode_index,
|
||||||
uint32_t num_vdev_mac_entries,
|
uint32_t num_vdev_mac_entries,
|
||||||
struct policy_mgr_vdev_mac_map *vdev_mac_map,
|
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;
|
QDF_STATUS ret;
|
||||||
struct policy_mgr_hw_mode_params hw_mode;
|
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))
|
if (!QDF_IS_STATUS_SUCCESS(ret))
|
||||||
policy_mgr_err("ERROR: set connection_update_done event failed");
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2404,26 +2399,9 @@ static void policy_mgr_nss_update_cb(struct wlan_objmgr_psoc *psoc,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
QDF_STATUS policy_mgr_nss_update(struct wlan_objmgr_psoc *psoc,
|
||||||
* policy_mgr_complete_action() - initiates actions needed on
|
uint8_t new_nss, uint8_t next_action,
|
||||||
* current connections once channel has been decided for the new
|
enum policy_mgr_conn_update_reason reason)
|
||||||
* 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;
|
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||||
uint32_t index, count;
|
uint32_t index, count;
|
||||||
@@ -2439,16 +2417,6 @@ QDF_STATUS policy_mgr_complete_action(struct wlan_objmgr_psoc *psoc,
|
|||||||
return status;
|
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,
|
count = policy_mgr_mode_specific_connection_count(psoc,
|
||||||
PM_P2P_GO_MODE, list);
|
PM_P2P_GO_MODE, list);
|
||||||
for (index = 0; index < count; index++) {
|
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))
|
if (!QDF_IS_STATUS_SUCCESS(status))
|
||||||
status = policy_mgr_next_actions(psoc, session_id,
|
status = policy_mgr_next_actions(psoc, session_id,
|
||||||
next_action, reason);
|
next_action, reason);
|
||||||
|
@@ -369,7 +369,9 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status,
|
|||||||
uint32_t cfgd_hw_mode_index,
|
uint32_t cfgd_hw_mode_index,
|
||||||
uint32_t num_vdev_mac_entries,
|
uint32_t num_vdev_mac_entries,
|
||||||
struct policy_mgr_vdev_mac_map *vdev_mac_map,
|
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_dump_current_concurrency(struct wlan_objmgr_psoc *psoc);
|
||||||
void policy_mgr_pdev_set_pcl(struct wlan_objmgr_psoc *psoc,
|
void policy_mgr_pdev_set_pcl(struct wlan_objmgr_psoc *psoc,
|
||||||
enum QDF_OPMODE mode);
|
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 regulatory_channel *chan_list,
|
||||||
struct avoid_freq_ind_data *avoid_freq_ind,
|
struct avoid_freq_ind_data *avoid_freq_ind,
|
||||||
void *arg);
|
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
|
#endif
|
||||||
|
Reference in New Issue
Block a user