qcacmn: FW Link switch request event handler and cnf resp

Once the FW sends the link switch request to host handle
the request from scheduler thread and send confirmation
back on completion of link switch process with status of
link switch (success/failure).

Add new serialization command type for link switch.

Introduce flags to get the current state of link switch
request, set the state to idle when no link switch in
progress or once the current link switch is completed.
Access to state is protected with MLO dev context lock.
Implement various helper API to:
    a) Transition link switch to next state.
    b) Get current state of link switch.
    c) To check whether any link switch is in progress.
    c) To check whether link switch is happening
       on assoc VDEV or not.

Introduce a new VDEV flag to suggest the VDEV is in
link switch process and also implement helper APIs to
set/get/clear this VDEV flag.
   a) The flag is set at start of link switch, once
      the FW request params are validated and before
      proceeding for link switch disconnect on VDEV.
   b) Clear the flag once the Link switch confirmation
      is sent to FW.

Validate the link switch request params:
     a) IEEE link ID's received.
     b) Check if new connection is part of MLO connection.
     c) Check if VDEV is MLO STA VDEV or not.
     d) Is VDEV in connected state or not, that means
        VDEV is not in transitioning state due to disconnect.
     e) Check if any link switch in progress on this MLD
     f) Current link ID of VDEV equals the FW params.

If validation is successful, serialize the link switch
command and in the serialization activation start the
actual link switch process.

Change-Id: Ie582650541054c8cf39aaa8316e86a7a40256a15
CRs-Fixed: 3556422
このコミットが含まれているのは:
Vinod Kumar Pirla
2023-07-06 03:33:50 -07:00
committed by Rahul Choudhary
コミット af6cf93a07
13個のファイルの変更970行の追加16行の削除

ファイルの表示

@@ -191,6 +191,139 @@ target_if_extract_mlo_link_removal_info_mgmt_rx(
return QDF_STATUS_SUCCESS;
}
#ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
static QDF_STATUS
target_if_send_mlo_link_switch_cnf_cmd(struct wlan_objmgr_psoc *psoc,
struct wlan_mlo_link_switch_cnf *params)
{
struct wmi_unified *wmi_handle = NULL;
if (!psoc) {
target_if_err("null pdev");
return QDF_STATUS_E_NULL_VALUE;
}
if (!params) {
target_if_err("params is null");
return QDF_STATUS_E_NULL_VALUE;
}
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
if (!wmi_handle) {
target_if_err("null wmi handle");
return QDF_STATUS_E_NULL_VALUE;
}
return wmi_send_mlo_link_switch_req_cnf_cmd(wmi_handle, params);
}
static int
target_if_mlo_link_switch_request_event_handler(ol_scn_t scn, uint8_t *data,
uint32_t datalen)
{
struct wlan_objmgr_psoc *psoc;
struct wmi_unified *wmi_handle;
struct wlan_lmac_if_mlo_rx_ops *mlo_rx_ops;
QDF_STATUS status;
struct wlan_mlo_link_switch_req req = {0};
if (!scn || !data) {
target_if_err("scn: 0x%pK, data: 0x%pK", scn, data);
return -EINVAL;
}
psoc = target_if_get_psoc_from_scn_hdl(scn);
if (!psoc) {
target_if_err("null psoc");
return -EINVAL;
}
mlo_rx_ops = target_if_mlo_get_rx_ops(psoc);
if (!mlo_rx_ops || !mlo_rx_ops->mlo_link_switch_request_handler) {
target_if_err("callback not registered");
return -EINVAL;
}
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
if (!wmi_handle) {
target_if_err("wmi_handle is null");
return -EINVAL;
}
status = wmi_extract_mlo_link_switch_request_evt(wmi_handle, data,
&req);
if (QDF_IS_STATUS_ERROR(status)) {
target_if_err("Unable to extract fixed param, ret = %d",
status);
goto exit;
}
status = mlo_rx_ops->mlo_link_switch_request_handler(psoc, &req);
exit:
return status;
}
static inline void
target_if_mlo_register_link_switch_cnf_handler(struct wlan_lmac_if_mlo_tx_ops *mlo_tx_ops)
{
mlo_tx_ops->send_mlo_link_switch_cnf_cmd =
target_if_send_mlo_link_switch_cnf_cmd;
}
static QDF_STATUS
target_if_mlo_register_link_switch_event_handler(struct wmi_unified *wmi_handle)
{
QDF_STATUS status;
status = wmi_unified_register_event_handler(
wmi_handle,
wmi_mlo_link_switch_request_eventid,
target_if_mlo_link_switch_request_event_handler,
WMI_RX_SERIALIZER_CTX);
return status;
}
static inline void
target_if_mlo_unregister_link_switch_event_handler(struct wmi_unified *wmi_handle)
{
wmi_unified_unregister_event(wmi_handle,
wmi_mlo_link_switch_request_eventid);
}
#else
static inline QDF_STATUS
target_if_mlo_register_link_switch_event_handler(struct wmi_unified *wmi_handle)
{
return QDF_STATUS_E_NOSUPPORT;
}
static inline void
target_if_mlo_unregister_link_switch_event_handler(struct wmi_unified *wmi_handle)
{
}
static inline QDF_STATUS
target_if_send_mlo_link_switch_cnf_cmd(struct wlan_objmgr_psoc *psoc,
struct wlan_mlo_link_switch_cnf *params)
{
return QDF_STATUS_SUCCESS;
}
static inline void
target_if_mlo_register_link_switch_cnf_handler(struct wlan_lmac_if_mlo_tx_ops *mlo_tx_ops)
{
}
static inline int
target_if_mlo_link_switch_request_event_handler(ol_scn_t scn, uint8_t *data,
uint32_t datalen)
{
return 0;
}
#endif
/**
* target_if_mlo_link_disable_request_event_handler() - Handler for MLO
* link disable request event sent by the FW
@@ -287,7 +420,7 @@ target_if_mlo_register_event_handler(struct wlan_objmgr_psoc *psoc)
if (QDF_IS_STATUS_ERROR(status)) {
target_if_err("Register mlo link set active resp cb errcode %d",
status);
if (status == QDF_STATUS_E_NOSUPPORT)
if (status == QDF_STATUS_E_NOSUPPORT)
status = QDF_STATUS_SUCCESS;
}
@@ -301,7 +434,15 @@ target_if_mlo_register_event_handler(struct wlan_objmgr_psoc *psoc)
if (QDF_IS_STATUS_ERROR(status)) {
target_if_err("Couldn't register handler for link disable request WMI event %d",
status);
if (status == QDF_STATUS_E_NOSUPPORT)
if (status == QDF_STATUS_E_NOSUPPORT)
status = QDF_STATUS_SUCCESS;
}
status = target_if_mlo_register_link_switch_event_handler(wmi_handle);
if (QDF_IS_STATUS_ERROR(status)) {
target_if_err("Couldn't register handler for link switch WMI event %d",
status);
if (status == QDF_STATUS_E_NOSUPPORT)
status = QDF_STATUS_SUCCESS;
}
@@ -343,6 +484,8 @@ target_if_mlo_unregister_event_handler(struct wlan_objmgr_psoc *psoc)
wmi_unified_unregister_event(wmi_handle,
wmi_mlo_link_disable_request_eventid);
target_if_mlo_unregister_link_switch_event_handler(wmi_handle);
return QDF_STATUS_SUCCESS;
}
@@ -734,6 +877,8 @@ target_if_mlo_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
target_if_request_ml_link_state_info;
mlo_tx_ops->send_vdev_pause = target_if_mlo_send_vdev_pause;
target_if_mlo_register_link_switch_cnf_handler(mlo_tx_ops);
target_if_mlo_register_peer_ptqm_migrate_send(mlo_tx_ops);
return QDF_STATUS_SUCCESS;
}