qcacmn: Trigger UMAC reset with mode1 SSR teardown

Add support to trigger UMAC reset with mode1 teardown request
for mode1 target recovery SSR.

Change-Id: Ib2d1679162a2084488081c76f6753287a6e4d5c4
CRs-Fixed: 3458369
This commit is contained in:
Surya Prakash Raajen 2023-04-26 15:28:20 +05:30 committed by Madan Koyyalamudi
parent 351f4a79a7
commit cb01519700
8 changed files with 95 additions and 33 deletions

View File

@ -2893,14 +2893,14 @@ QDF_STATUS target_if_mlo_ready(struct wlan_objmgr_pdev **pdev,
/**
* target_if_mlo_teardown_req() - API to trigger MLO teardown sequence
* @pdev: Array of pointers to pdev object that are part of ML group
* @num_pdevs: Number of pdevs in above array
* @pdev: Pointer to pdev object
* @reason: Reason for triggering teardown
* @reset: UMAC reset for mode1 SSR
*
* Return: QDF_STATUS codes
*/
QDF_STATUS target_if_mlo_teardown_req(struct wlan_objmgr_pdev **pdev,
uint8_t num_pdevs, uint32_t reason);
QDF_STATUS target_if_mlo_teardown_req(struct wlan_objmgr_pdev *pdev,
uint32_t reason, bool reset);
#endif /*WLAN_FEATURE_11BE_MLO && WLAN_MLO_MULTI_CHIP*/
/**

View File

@ -1226,9 +1226,10 @@ QDF_STATUS target_if_mlo_ready(struct wlan_objmgr_pdev **pdev,
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS
target_if_mlo_teardown_send(struct wlan_objmgr_pdev *pdev,
enum wmi_mlo_teardown_reason reason)
QDF_STATUS
target_if_mlo_teardown_req(struct wlan_objmgr_pdev *pdev,
enum wmi_mlo_teardown_reason reason,
bool reset)
{
wmi_unified_t wmi_handle;
struct wmi_mlo_teardown_params params = {0};
@ -1239,19 +1240,8 @@ target_if_mlo_teardown_send(struct wlan_objmgr_pdev *pdev,
params.pdev_id = wlan_objmgr_pdev_get_pdev_id(pdev);
params.reason = reason;
params.umac_reset = reset;
return wmi_mlo_teardown_cmd_send(wmi_handle, &params);
}
QDF_STATUS target_if_mlo_teardown_req(struct wlan_objmgr_pdev **pdev,
uint8_t num_pdevs,
enum wmi_mlo_teardown_reason reason)
{
uint8_t idx;
for (idx = 0; idx < num_pdevs; idx++)
target_if_mlo_teardown_send(pdev[idx], reason);
return QDF_STATUS_SUCCESS;
}
#endif /*WLAN_FEATURE_11BE_MLO && WLAN_MLO_MULTI_CHIP*/

View File

@ -589,9 +589,8 @@ struct wlan_lmac_if_mlme_tx_ops {
uint8_t grp_id);
QDF_STATUS (*target_if_mlo_ready)(struct wlan_objmgr_pdev **pdev,
uint8_t num_pdevs);
QDF_STATUS (*target_if_mlo_teardown_req)(struct wlan_objmgr_pdev **pdev,
uint8_t num_pdevs,
uint32_t grp_id);
QDF_STATUS (*target_if_mlo_teardown_req)(struct wlan_objmgr_pdev *pdev,
uint32_t grp_id, bool reset);
#endif
#ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
QDF_STATUS (*vdev_send_set_mac_addr)(struct qdf_mac_addr mac_addr,

View File

@ -143,6 +143,7 @@ struct mlo_chip_info {
* @soc_id_list: list of soc ids part of this mlo group
* @state: MLO link state
* @valid_link_bitmap: valid MLO link bitmap
* @trigger_umac_reset: teardown require umac reset, for mode1 SSR
* @state_lock: lock to protect access to link state
* @event: event for teardown completion
* @dp_handle: pointer to DP ML context
@ -160,6 +161,7 @@ struct mlo_setup_info {
uint8_t soc_id_list[MAX_MLO_CHIPS];
enum MLO_LINK_STATE state[MAX_MLO_LINKS];
uint16_t valid_link_bitmap;
bool trigger_umac_reset;
qdf_spinlock_t state_lock;
qdf_event_t event;
struct cdp_mlo_ctxt *dp_handle;

View File

@ -612,6 +612,8 @@ void wlan_mlo_partner_peer_disconnect_notify(struct wlan_objmgr_peer *src_peer)
}
}
qdf_export_symbol(wlan_mlo_partner_peer_disconnect_notify);
static void mlo_peer_populate_link_peer(
struct wlan_mlo_peer_context *ml_peer,
struct wlan_objmgr_peer *link_peer)
@ -1988,6 +1990,8 @@ bool wlan_mlo_partner_peer_delete_is_allowed(struct wlan_objmgr_peer *src_peer)
return true;
}
qdf_export_symbol(wlan_mlo_partner_peer_delete_is_allowed);
#endif
QDF_STATUS wlan_mlo_validate_reassocreq(struct wlan_mlo_peer_context *ml_peer)

View File

@ -918,6 +918,8 @@ void mlo_link_teardown_complete(struct wlan_objmgr_pdev *pdev, uint8_t grp_id)
qdf_info("Teardown complete");
setup_info->trigger_umac_reset = false;
qdf_event_set(&setup_info->event);
}
@ -944,12 +946,78 @@ static void mlo_force_teardown(uint8_t grp_id)
setup_info->state[link_idx] = MLO_LINK_TEARDOWN;
}
static void mlo_send_teardown_req(struct wlan_objmgr_psoc *psoc,
uint8_t grp_id, uint32_t reason)
{
struct mlo_mgr_context *mlo_ctx = wlan_objmgr_get_mlo_ctx();
struct wlan_lmac_if_tx_ops *tx_ops;
struct wlan_objmgr_pdev *temp_pdev;
struct mlo_setup_info *setup_info;
uint8_t link_idx;
uint8_t tot_links;
bool umac_reset = 0;
if (!mlo_ctx)
return;
if (grp_id >= mlo_ctx->total_grp) {
mlo_err("Invalid grp id %d, total no of groups %d",
grp_id, mlo_ctx->total_grp);
return;
}
tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
if (!tx_ops) {
mlo_err("Tx Ops is null for the psoc id %d",
wlan_psoc_get_id(psoc));
return;
}
setup_info = &mlo_ctx->setup_info[grp_id];
tot_links = setup_info->tot_links;
if (reason == WMI_MLO_TEARDOWN_REASON_MODE1_SSR) {
for (link_idx = 0; link_idx < tot_links; link_idx++) {
umac_reset = 0;
temp_pdev = setup_info->pdev_list[link_idx];
if (!temp_pdev)
continue;
if (!setup_info->trigger_umac_reset) {
if (psoc == wlan_pdev_get_psoc(temp_pdev)) {
umac_reset = 1;
setup_info->trigger_umac_reset = 1;
}
}
if (tx_ops && tx_ops->mops.target_if_mlo_teardown_req) {
mlo_info(
"Trigger Teardown with Pdev %d Psoc id %d link idx %d Umac reset %d for Mode 1",
wlan_objmgr_pdev_get_pdev_id(temp_pdev),
wlan_psoc_get_id(wlan_pdev_get_psoc(temp_pdev)),
link_idx, umac_reset);
tx_ops->mops.target_if_mlo_teardown_req(
setup_info->pdev_list[link_idx],
reason, umac_reset);
}
}
} else {
for (link_idx = 0; link_idx < setup_info->tot_links; link_idx++)
if (tx_ops && tx_ops->mops.target_if_mlo_teardown_req) {
if (!setup_info->pdev_list[link_idx])
continue;
tx_ops->mops.target_if_mlo_teardown_req(
setup_info->pdev_list[link_idx],
reason, 0);
}
}
}
#define MLO_MGR_TEARDOWN_TIMEOUT 3000
QDF_STATUS mlo_link_teardown_link(struct wlan_objmgr_psoc *psoc,
uint8_t grp_id,
uint32_t reason)
{
struct wlan_lmac_if_tx_ops *tx_ops;
QDF_STATUS status;
struct mlo_setup_info *setup_info;
struct mlo_mgr_context *mlo_ctx = wlan_objmgr_get_mlo_ctx();
@ -977,14 +1045,8 @@ QDF_STATUS mlo_link_teardown_link(struct wlan_objmgr_psoc *psoc,
if (!mlo_check_all_pdev_state(psoc, grp_id, MLO_LINK_TEARDOWN))
return QDF_STATUS_SUCCESS;
tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
/* Trigger MLO teardown */
if (tx_ops && tx_ops->mops.target_if_mlo_teardown_req) {
tx_ops->mops.target_if_mlo_teardown_req(
setup_info->pdev_list,
setup_info->num_links,
reason);
}
mlo_send_teardown_req(psoc, grp_id, reason);
if (reason == WMI_MLO_TEARDOWN_REASON_SSR) {
/* do not wait for teardown event completion here for SSR */

View File

@ -1,7 +1,7 @@
/*
* Copyright (c) 2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-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 above
@ -47,21 +47,23 @@ struct wmi_mlo_ready_params {
/** enum wmi_mlo_teardown_reason - Reason code in WMI MLO teardown command
* @WMI_MLO_TEARDOWN_REASON_DOWN: Wifi down
* @WMI_MLO_TEARDOWN_REASON_SSR: Wifi Recovery
* @WMI_MLO_TEARDOWN_REASON_CLEANUP_DONE: SSR related cleanup done
* @WMI_MLO_TEARDOWN_REASON_MODE1_SSR: Recovery Mode1 SSR teardown
*/
enum wmi_mlo_teardown_reason {
WMI_MLO_TEARDOWN_REASON_DOWN,
WMI_MLO_TEARDOWN_REASON_SSR,
WMI_MLO_TEARDOWN_REASON_CLEANUP_DONE,
WMI_MLO_TEARDOWN_REASON_MODE1_SSR,
};
/** struct wmi_mlo_teardown_params - MLO teardown command params
* @pdev_id: pdev id of radio on which this command is sent
* @reason: reason code from enum wmi_mlo_teardown_reason
* @umac_reset: trigger umac reset for mode1 or not
*/
struct wmi_mlo_teardown_params {
uint32_t pdev_id;
enum wmi_mlo_teardown_reason reason;
bool umac_reset;
};
/** enum wmi_mlo_setup_status - Status code in WMI MLO setup completion event

View File

@ -1645,6 +1645,7 @@ QDF_STATUS mlo_teardown_cmd_send_tlv(struct wmi_unified *wmi_handle,
param->pdev_id);
switch (param->reason) {
case WMI_MLO_TEARDOWN_REASON_SSR:
case WMI_MLO_TEARDOWN_REASON_MODE1_SSR:
cmd->reason_code = WMI_MLO_TEARDOWN_SSR_REASON;
break;
case WMI_MLO_TEARDOWN_REASON_DOWN:
@ -1653,6 +1654,8 @@ QDF_STATUS mlo_teardown_cmd_send_tlv(struct wmi_unified *wmi_handle,
break;
}
cmd->trigger_umac_reset = param->umac_reset;
wmi_mtrace(WMI_MLO_TEARDOWN_CMDID, NO_SESSION, 0);
ret = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_MLO_TEARDOWN_CMDID);