qcacld-3.0: Iterate all links in shutdown and reset adapter
Iterate through all the active links in adapter in the following APIs to loop the VDEVs. 1) hdd_reset_all_adapters() 2) wlan_hdd_auto_shutdown_enable() The below API is changed to take link info pointer as function argument 1) hdd_send_twt_del_all_sessions_to_userspace() Change-Id: I689037a11c86602e7f9a2cd1f0b66ddeaa1a4228 CRs-Fixed: 3523139
This commit is contained in:

committed by
Rahul Choudhary

parent
44ddeedbd9
commit
13441796a7
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
|
||||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -34,6 +34,7 @@
|
|||||||
|
|
||||||
struct hdd_context;
|
struct hdd_context;
|
||||||
struct hdd_adapter;
|
struct hdd_adapter;
|
||||||
|
struct wlan_hdd_link_info;
|
||||||
struct wma_tgt_cfg;
|
struct wma_tgt_cfg;
|
||||||
struct wmi_twt_add_dialog_param;
|
struct wmi_twt_add_dialog_param;
|
||||||
struct wmi_twt_del_dialog_param;
|
struct wmi_twt_del_dialog_param;
|
||||||
@@ -257,14 +258,15 @@ void hdd_send_twt_role_disable_cmd(struct hdd_context *hdd_ctx,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* hdd_send_twt_del_all_sessions_to_userspace() - Terminate all TWT sessions
|
* hdd_send_twt_del_all_sessions_to_userspace() - Terminate all TWT sessions
|
||||||
* @adapter: adapter
|
* @link_info: Link info pointer in HDD adapter
|
||||||
*
|
*
|
||||||
* This function checks if association exists and TWT session is setup,
|
* This function checks if association exists and TWT session is setup,
|
||||||
* then send the TWT teardown vendor NL event to the user space.
|
* then send the TWT teardown vendor NL event to the user space.
|
||||||
*
|
*
|
||||||
* Return: None
|
* Return: None
|
||||||
*/
|
*/
|
||||||
void hdd_send_twt_del_all_sessions_to_userspace(struct hdd_adapter *adapter);
|
void
|
||||||
|
hdd_send_twt_del_all_sessions_to_userspace(struct wlan_hdd_link_info *link_info);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hdd_twt_concurrency_update_on_scc() - Send TWT disable command to fw if
|
* hdd_twt_concurrency_update_on_scc() - Send TWT disable command to fw if
|
||||||
@@ -430,8 +432,8 @@ void hdd_send_twt_role_disable_cmd(struct hdd_context *hdd_ctx,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline
|
static inline void
|
||||||
void hdd_send_twt_del_all_sessions_to_userspace(struct hdd_adapter *adapter)
|
hdd_send_twt_del_all_sessions_to_userspace(struct wlan_hdd_link_info *link_info)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -9249,6 +9249,7 @@ QDF_STATUS hdd_reset_all_adapters(struct hdd_context *hdd_ctx)
|
|||||||
struct hdd_adapter *adapter, *next_adapter = NULL;
|
struct hdd_adapter *adapter, *next_adapter = NULL;
|
||||||
bool value;
|
bool value;
|
||||||
struct wlan_objmgr_vdev *vdev;
|
struct wlan_objmgr_vdev *vdev;
|
||||||
|
struct wlan_hdd_link_info *link_info;
|
||||||
|
|
||||||
hdd_enter();
|
hdd_enter();
|
||||||
|
|
||||||
@@ -9261,55 +9262,57 @@ QDF_STATUS hdd_reset_all_adapters(struct hdd_context *hdd_ctx)
|
|||||||
qdf_opmode_str(adapter->device_mode),
|
qdf_opmode_str(adapter->device_mode),
|
||||||
adapter->device_mode);
|
adapter->device_mode);
|
||||||
|
|
||||||
|
hdd_adapter_for_each_active_link_info(adapter, link_info) {
|
||||||
|
hdd_adapter_abort_tx_flow(adapter);
|
||||||
|
|
||||||
hdd_adapter_abort_tx_flow(adapter);
|
if ((adapter->device_mode == QDF_STA_MODE) ||
|
||||||
|
(adapter->device_mode == QDF_P2P_CLIENT_MODE)) {
|
||||||
|
hdd_send_twt_del_all_sessions_to_userspace(link_info);
|
||||||
|
|
||||||
if ((adapter->device_mode == QDF_STA_MODE) ||
|
/* Stop tdls timers */
|
||||||
(adapter->device_mode == QDF_P2P_CLIENT_MODE)) {
|
vdev = hdd_objmgr_get_vdev_by_user(link_info,
|
||||||
hdd_send_twt_del_all_sessions_to_userspace(adapter);
|
|
||||||
|
|
||||||
/* Stop tdls timers */
|
|
||||||
vdev = hdd_objmgr_get_vdev_by_user(adapter->deflink,
|
|
||||||
WLAN_OSIF_TDLS_ID);
|
WLAN_OSIF_TDLS_ID);
|
||||||
if (vdev) {
|
if (vdev) {
|
||||||
hdd_notify_tdls_reset_adapter(vdev);
|
hdd_notify_tdls_reset_adapter(vdev);
|
||||||
hdd_objmgr_put_vdev_by_user(vdev,
|
hdd_objmgr_put_vdev_by_user(vdev,
|
||||||
WLAN_OSIF_TDLS_ID);
|
WLAN_OSIF_TDLS_ID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (value &&
|
if (value &&
|
||||||
adapter->device_mode == QDF_SAP_MODE) {
|
adapter->device_mode == QDF_SAP_MODE) {
|
||||||
hdd_medium_assess_ssr_enable_flag();
|
hdd_medium_assess_ssr_enable_flag();
|
||||||
wlan_hdd_netif_queue_control(adapter,
|
wlan_hdd_netif_queue_control(adapter,
|
||||||
WLAN_STOP_ALL_NETIF_QUEUE,
|
WLAN_STOP_ALL_NETIF_QUEUE,
|
||||||
WLAN_CONTROL_PATH);
|
WLAN_CONTROL_PATH);
|
||||||
} else {
|
} else {
|
||||||
wlan_hdd_netif_queue_control(adapter,
|
wlan_hdd_netif_queue_control(adapter,
|
||||||
WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER,
|
WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER,
|
||||||
WLAN_CONTROL_PATH);
|
WLAN_CONTROL_PATH);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clear fc flag if it was set before SSR to avoid TX queues
|
* Clear fc flag if it was set before SSR to avoid
|
||||||
* permanently stopped after SSR.
|
* TX queues permanently stopped after SSR.
|
||||||
* Here WLAN_START_ALL_NETIF_QUEUE will actually not start any
|
* Here WLAN_START_ALL_NETIF_QUEUE will actually
|
||||||
* queue since it's blocked by reason WLAN_CONTROL_PATH.
|
* not start any queue since it's blocked by reason
|
||||||
*/
|
* WLAN_CONTROL_PATH.
|
||||||
if (adapter->pause_map & (1 << WLAN_DATA_FLOW_CONTROL))
|
*/
|
||||||
wlan_hdd_netif_queue_control(adapter,
|
if (adapter->pause_map & (1 << WLAN_DATA_FLOW_CONTROL))
|
||||||
|
wlan_hdd_netif_queue_control(adapter,
|
||||||
WLAN_START_ALL_NETIF_QUEUE,
|
WLAN_START_ALL_NETIF_QUEUE,
|
||||||
WLAN_DATA_FLOW_CONTROL);
|
WLAN_DATA_FLOW_CONTROL);
|
||||||
|
|
||||||
hdd_reset_scan_operation(hdd_ctx, adapter);
|
hdd_reset_scan_operation(hdd_ctx, adapter);
|
||||||
|
|
||||||
if (test_bit(WMM_INIT_DONE, &adapter->event_flags)) {
|
if (test_bit(WMM_INIT_DONE, &adapter->event_flags)) {
|
||||||
hdd_wmm_adapter_close(adapter);
|
hdd_wmm_adapter_close(adapter);
|
||||||
clear_bit(WMM_INIT_DONE, &adapter->event_flags);
|
clear_bit(WMM_INIT_DONE, &adapter->event_flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
hdd_debug("Flush any mgmt references held by peer");
|
||||||
|
hdd_stop_adapter(hdd_ctx, adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
hdd_debug("Flush any mgmt references held by peer");
|
|
||||||
hdd_stop_adapter(hdd_ctx, adapter);
|
|
||||||
hdd_adapter_dev_put_debug(adapter,
|
hdd_adapter_dev_put_debug(adapter,
|
||||||
NET_DEV_HOLD_RESET_ALL_ADAPTERS);
|
NET_DEV_HOLD_RESET_ALL_ADAPTERS);
|
||||||
}
|
}
|
||||||
@@ -16975,21 +16978,20 @@ void wlan_hdd_auto_shutdown_enable(struct hdd_context *hdd_ctx, bool enable)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* To enable shutdown timer check conncurrency */
|
/* To enable shutdown timer check conncurrency */
|
||||||
if (policy_mgr_concurrent_open_sessions_running(hdd_ctx->psoc)) {
|
if (!policy_mgr_concurrent_open_sessions_running(hdd_ctx->psoc))
|
||||||
hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter,
|
goto start_timer;
|
||||||
next_adapter, dbgid) {
|
|
||||||
link_info = adapter->deflink;
|
hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter,
|
||||||
if (adapter->device_mode == QDF_STA_MODE) {
|
next_adapter, dbgid) {
|
||||||
if (hdd_cm_is_vdev_associated(link_info)) {
|
hdd_adapter_for_each_active_link_info(adapter, link_info) {
|
||||||
sta_connected = true;
|
if (adapter->device_mode == QDF_STA_MODE &&
|
||||||
hdd_adapter_dev_put_debug(adapter,
|
hdd_cm_is_vdev_associated(link_info)) {
|
||||||
|
sta_connected = true;
|
||||||
|
hdd_adapter_dev_put_debug(adapter, dbgid);
|
||||||
|
if (next_adapter)
|
||||||
|
hdd_adapter_dev_put_debug(next_adapter,
|
||||||
dbgid);
|
dbgid);
|
||||||
if (next_adapter)
|
break;
|
||||||
hdd_adapter_dev_put_debug(
|
|
||||||
next_adapter,
|
|
||||||
dbgid);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (adapter->device_mode == QDF_SAP_MODE) {
|
if (adapter->device_mode == QDF_SAP_MODE) {
|
||||||
@@ -17005,10 +17007,11 @@ void wlan_hdd_auto_shutdown_enable(struct hdd_context *hdd_ctx, bool enable)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hdd_adapter_dev_put_debug(adapter, dbgid);
|
|
||||||
}
|
}
|
||||||
|
hdd_adapter_dev_put_debug(adapter, dbgid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
start_timer:
|
||||||
if (ap_connected == true || sta_connected == true) {
|
if (ap_connected == true || sta_connected == true) {
|
||||||
hdd_debug("CC Session active. Shutdown timer not enabled");
|
hdd_debug("CC Session active. Shutdown timer not enabled");
|
||||||
return;
|
return;
|
||||||
|
@@ -138,7 +138,7 @@ void wlan_hdd_twt_deinit(struct hdd_context *hdd_ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
hdd_send_twt_del_all_sessions_to_userspace(struct hdd_adapter *adapter)
|
hdd_send_twt_del_all_sessions_to_userspace(struct wlan_hdd_link_info *link_info)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2387,16 +2387,17 @@ hdd_twt_del_dialog_comp_cb(struct wlan_objmgr_psoc *psoc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
hdd_send_twt_del_all_sessions_to_userspace(struct hdd_adapter *adapter)
|
hdd_send_twt_del_all_sessions_to_userspace(struct wlan_hdd_link_info *link_info)
|
||||||
{
|
{
|
||||||
|
struct hdd_adapter *adapter = link_info->adapter;
|
||||||
struct wlan_objmgr_psoc *psoc = adapter->hdd_ctx->psoc;
|
struct wlan_objmgr_psoc *psoc = adapter->hdd_ctx->psoc;
|
||||||
struct hdd_station_ctx *hdd_sta_ctx = NULL;
|
struct hdd_station_ctx *hdd_sta_ctx = NULL;
|
||||||
struct wmi_twt_del_dialog_complete_event_param params;
|
struct wmi_twt_del_dialog_complete_event_param params;
|
||||||
|
|
||||||
hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter->deflink);
|
hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(link_info);
|
||||||
if (!hdd_cm_is_vdev_associated(adapter->deflink)) {
|
if (!hdd_cm_is_vdev_associated(link_info)) {
|
||||||
hdd_debug("Not associated, vdev %d mode %d",
|
hdd_debug("Not associated, vdev %d mode %d",
|
||||||
adapter->deflink->vdev_id, adapter->device_mode);
|
link_info->vdev_id, adapter->device_mode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2404,13 +2405,13 @@ hdd_send_twt_del_all_sessions_to_userspace(struct hdd_adapter *adapter)
|
|||||||
&hdd_sta_ctx->conn_info.bssid,
|
&hdd_sta_ctx->conn_info.bssid,
|
||||||
TWT_ALL_SESSIONS_DIALOG_ID)) {
|
TWT_ALL_SESSIONS_DIALOG_ID)) {
|
||||||
hdd_debug("No active TWT sessions, vdev_id: %d dialog_id: %d",
|
hdd_debug("No active TWT sessions, vdev_id: %d dialog_id: %d",
|
||||||
adapter->deflink->vdev_id,
|
link_info->vdev_id,
|
||||||
TWT_ALL_SESSIONS_DIALOG_ID);
|
TWT_ALL_SESSIONS_DIALOG_ID);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
qdf_mem_zero(¶ms, sizeof(params));
|
qdf_mem_zero(¶ms, sizeof(params));
|
||||||
params.vdev_id = adapter->deflink->vdev_id;
|
params.vdev_id = link_info->vdev_id;
|
||||||
params.dialog_id = TWT_ALL_SESSIONS_DIALOG_ID;
|
params.dialog_id = TWT_ALL_SESSIONS_DIALOG_ID;
|
||||||
params.status = WMI_HOST_DEL_TWT_STATUS_UNKNOWN_ERROR;
|
params.status = WMI_HOST_DEL_TWT_STATUS_UNKNOWN_ERROR;
|
||||||
qdf_mem_copy(params.peer_macaddr, hdd_sta_ctx->conn_info.bssid.bytes,
|
qdf_mem_copy(params.peer_macaddr, hdd_sta_ctx->conn_info.bssid.bytes,
|
||||||
|
Reference in New Issue
Block a user