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) 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
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -34,6 +34,7 @@
|
||||
|
||||
struct hdd_context;
|
||||
struct hdd_adapter;
|
||||
struct wlan_hdd_link_info;
|
||||
struct wma_tgt_cfg;
|
||||
struct wmi_twt_add_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
|
||||
* @adapter: adapter
|
||||
* @link_info: Link info pointer in HDD adapter
|
||||
*
|
||||
* This function checks if association exists and TWT session is setup,
|
||||
* then send the TWT teardown vendor NL event to the user space.
|
||||
*
|
||||
* 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
|
||||
@@ -430,8 +432,8 @@ void hdd_send_twt_role_disable_cmd(struct hdd_context *hdd_ctx,
|
||||
{
|
||||
}
|
||||
|
||||
static inline
|
||||
void hdd_send_twt_del_all_sessions_to_userspace(struct hdd_adapter *adapter)
|
||||
static inline void
|
||||
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;
|
||||
bool value;
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
struct wlan_hdd_link_info *link_info;
|
||||
|
||||
hdd_enter();
|
||||
|
||||
@@ -9261,15 +9262,15 @@ QDF_STATUS hdd_reset_all_adapters(struct hdd_context *hdd_ctx)
|
||||
qdf_opmode_str(adapter->device_mode),
|
||||
adapter->device_mode);
|
||||
|
||||
|
||||
hdd_adapter_for_each_active_link_info(adapter, link_info) {
|
||||
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(adapter);
|
||||
hdd_send_twt_del_all_sessions_to_userspace(link_info);
|
||||
|
||||
/* Stop tdls timers */
|
||||
vdev = hdd_objmgr_get_vdev_by_user(adapter->deflink,
|
||||
vdev = hdd_objmgr_get_vdev_by_user(link_info,
|
||||
WLAN_OSIF_TDLS_ID);
|
||||
if (vdev) {
|
||||
hdd_notify_tdls_reset_adapter(vdev);
|
||||
@@ -9291,10 +9292,11 @@ QDF_STATUS hdd_reset_all_adapters(struct hdd_context *hdd_ctx)
|
||||
}
|
||||
|
||||
/*
|
||||
* Clear fc flag if it was set before SSR to avoid TX queues
|
||||
* permanently stopped after SSR.
|
||||
* Here WLAN_START_ALL_NETIF_QUEUE will actually not start any
|
||||
* queue since it's blocked by reason WLAN_CONTROL_PATH.
|
||||
* Clear fc flag if it was set before SSR to avoid
|
||||
* TX queues permanently stopped after SSR.
|
||||
* Here WLAN_START_ALL_NETIF_QUEUE will actually
|
||||
* 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,
|
||||
@@ -9310,6 +9312,7 @@ QDF_STATUS hdd_reset_all_adapters(struct hdd_context *hdd_ctx)
|
||||
|
||||
hdd_debug("Flush any mgmt references held by peer");
|
||||
hdd_stop_adapter(hdd_ctx, adapter);
|
||||
}
|
||||
hdd_adapter_dev_put_debug(adapter,
|
||||
NET_DEV_HOLD_RESET_ALL_ADAPTERS);
|
||||
}
|
||||
@@ -16975,22 +16978,21 @@ void wlan_hdd_auto_shutdown_enable(struct hdd_context *hdd_ctx, bool enable)
|
||||
}
|
||||
|
||||
/* 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))
|
||||
goto start_timer;
|
||||
|
||||
hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter,
|
||||
next_adapter, dbgid) {
|
||||
link_info = adapter->deflink;
|
||||
if (adapter->device_mode == QDF_STA_MODE) {
|
||||
if (hdd_cm_is_vdev_associated(link_info)) {
|
||||
hdd_adapter_for_each_active_link_info(adapter, link_info) {
|
||||
if (adapter->device_mode == QDF_STA_MODE &&
|
||||
hdd_cm_is_vdev_associated(link_info)) {
|
||||
sta_connected = true;
|
||||
hdd_adapter_dev_put_debug(adapter,
|
||||
dbgid);
|
||||
hdd_adapter_dev_put_debug(adapter, dbgid);
|
||||
if (next_adapter)
|
||||
hdd_adapter_dev_put_debug(
|
||||
next_adapter,
|
||||
hdd_adapter_dev_put_debug(next_adapter,
|
||||
dbgid);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (adapter->device_mode == QDF_SAP_MODE) {
|
||||
ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(link_info);
|
||||
@@ -17005,10 +17007,11 @@ void wlan_hdd_auto_shutdown_enable(struct hdd_context *hdd_ctx, bool enable)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
hdd_adapter_dev_put_debug(adapter, dbgid);
|
||||
}
|
||||
}
|
||||
|
||||
start_timer:
|
||||
if (ap_connected == true || sta_connected == true) {
|
||||
hdd_debug("CC Session active. Shutdown timer not enabled");
|
||||
return;
|
||||
|
@@ -138,7 +138,7 @@ void wlan_hdd_twt_deinit(struct hdd_context *hdd_ctx)
|
||||
}
|
||||
|
||||
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
|
||||
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 hdd_station_ctx *hdd_sta_ctx = NULL;
|
||||
struct wmi_twt_del_dialog_complete_event_param params;
|
||||
|
||||
hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter->deflink);
|
||||
if (!hdd_cm_is_vdev_associated(adapter->deflink)) {
|
||||
hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(link_info);
|
||||
if (!hdd_cm_is_vdev_associated(link_info)) {
|
||||
hdd_debug("Not associated, vdev %d mode %d",
|
||||
adapter->deflink->vdev_id, adapter->device_mode);
|
||||
link_info->vdev_id, adapter->device_mode);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2404,13 +2405,13 @@ hdd_send_twt_del_all_sessions_to_userspace(struct hdd_adapter *adapter)
|
||||
&hdd_sta_ctx->conn_info.bssid,
|
||||
TWT_ALL_SESSIONS_DIALOG_ID)) {
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
||||
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.status = WMI_HOST_DEL_TWT_STATUS_UNKNOWN_ERROR;
|
||||
qdf_mem_copy(params.peer_macaddr, hdd_sta_ctx->conn_info.bssid.bytes,
|
||||
|
Reference in New Issue
Block a user