qcacld-3.0: Inform teardown all TWT sessions when SSR happens

When SSR happens, Inform the user space about teardown all TWT sessions.

Change-Id: I2bb321bacac02291bbea1f22e231669d911c53e7
CRs-Fixed: 2870599
This commit is contained in:
Srinivas Girigowda 2021-02-08 18:38:42 -08:00
commit 6a80c77084
4 changed files with 56 additions and 4 deletions

View file

@ -205,6 +205,17 @@ int hdd_test_config_twt_terminate_session(struct hdd_adapter *adapter,
void hdd_send_twt_role_disable_cmd(struct hdd_context *hdd_ctx,
enum twt_role role);
/**
* hdd_send_twt_del_all_sessions_to_userspace() - Terminate all TWT sessions
* @adapter: 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);
#define FEATURE_VENDOR_SUBCMD_WIFI_CONFIG_TWT \
{ \
.info.vendor_id = QCA_NL80211_VENDOR_ID, \
@ -260,6 +271,11 @@ void hdd_send_twt_role_disable_cmd(struct hdd_context *hdd_ctx,
enum twt_role role)
{
}
static inline
void hdd_send_twt_del_all_sessions_to_userspace(struct hdd_adapter *adapter)
{
}
#define FEATURE_VENDOR_SUBCMD_WIFI_CONFIG_TWT
#endif

View file

@ -7730,6 +7730,10 @@ QDF_STATUS hdd_reset_all_adapters(struct hdd_context *hdd_ctx)
hdd_adapter_abort_tx_flow(adapter);
if (adapter->device_mode == QDF_STA_MODE)
hdd_send_twt_del_all_sessions_to_userspace(adapter);
if ((adapter->device_mode == QDF_STA_MODE) ||
(adapter->device_mode == QDF_P2P_CLIENT_MODE)) {
/* Stop tdls timers */

View file

@ -1494,8 +1494,7 @@ hdd_twt_del_dialog_comp_cb(struct wlan_objmgr_psoc *psoc,
}
hdd_ctx = WLAN_HDD_GET_CTX(adapter);
status = wlan_hdd_validate_context(hdd_ctx);
if (QDF_IS_STATUS_ERROR(status))
if (!hdd_ctx || cds_is_load_or_unload_in_progress())
return;
wdev = adapter->dev->ieee80211_ptr;
@ -1529,6 +1528,39 @@ hdd_twt_del_dialog_comp_cb(struct wlan_objmgr_psoc *psoc,
return;
}
void
hdd_send_twt_del_all_sessions_to_userspace(struct hdd_adapter *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);
if (hdd_sta_ctx->conn_info.conn_state != eConnectionState_Associated) {
hdd_debug("Not associated, vdev %d mode %d state %d",
adapter->vdev_id, adapter->device_mode,
hdd_sta_ctx->conn_info.conn_state);
return;
}
if (!ucfg_mlme_is_twt_setup_done(psoc,
&hdd_sta_ctx->conn_info.bssid,
WLAN_ALL_SESSIONS_DIALOG_ID)) {
hdd_debug("No active TWT sessions, vdev_id: %d dialog_id: %d",
adapter->vdev_id, WLAN_ALL_SESSIONS_DIALOG_ID);
return;
}
qdf_mem_zero(&params, sizeof(params));
params.vdev_id = adapter->vdev_id;
params.dialog_id = WLAN_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,
QDF_MAC_ADDR_SIZE);
hdd_twt_del_dialog_comp_cb(psoc, &params);
}
/**
* hdd_send_twt_del_dialog_cmd() - Send TWT del dialog command to target
* @hdd_ctx: HDD Context

View file

@ -2148,8 +2148,8 @@ sme_process_twt_del_dialog_event(struct mac_context *mac,
param->dialog_id != WLAN_ALL_SESSIONS_DIALOG_ID &&
param->status != WMI_HOST_DEL_TWT_STATUS_ROAMING &&
param->status != WMI_HOST_DEL_TWT_STATUS_PEER_INIT_TEARDOWN) {
sme_debug("Del dialog event dropped for id:%d",
param->dialog_id);
sme_debug("Del dialog event dropped for id:%d status:%d",
param->dialog_id, param->status);
return;
}