qcacmn: MLO setup, teardown, ready WMI API
Add WMI APIs for MLO setup, ready and teardown command send and extract routines Change-Id: If986124032c4fb9bb3ed2ffbf2ac6db8fe9e0f1f CRs-Fixed: 2981067
This commit is contained in:

committed by
Madan Koyyalamudi

parent
8082901907
commit
718f574750
101
wmi/inc/wmi_unified_11be_param.h
Normal file
101
wmi/inc/wmi_unified_11be_param.h
Normal file
@@ -0,0 +1,101 @@
|
||||
|
||||
/*
|
||||
* Copyright (c) 2021, The Linux Foundation. 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
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef _WMI_UNIFIED_11BE_PARAM_H_
|
||||
#define _WMI_UNIFIED_11BE_PARAM_H_
|
||||
|
||||
#include <wmi_unified_param.h>
|
||||
|
||||
#ifdef WLAN_FEATURE_11BE_MLO
|
||||
|
||||
#define MAX_LINK_IN_MLO 6
|
||||
/** struct wmi_mlo_setup_params - MLO setup command params
|
||||
* @mld_grp_id: Unique ID to FW for MLD group
|
||||
* @pdev_id: pdev id of radio on which this command is sent
|
||||
* @num_valid_hw_links: Num of valid links in partner_links array
|
||||
* @partner_links[MAX_LINK_IN_MLO]: Partner link IDs
|
||||
*/
|
||||
struct wmi_mlo_setup_params {
|
||||
uint32_t mld_grp_id;
|
||||
uint32_t pdev_id;
|
||||
uint8_t num_valid_hw_links;
|
||||
uint32_t partner_links[MAX_LINK_IN_MLO];
|
||||
};
|
||||
|
||||
/** struct wmi_mlo_ready_params - MLO ready command params
|
||||
* @pdev_id: pdev id of radio on which this command is sent
|
||||
*/
|
||||
struct wmi_mlo_ready_params {
|
||||
uint32_t pdev_id;
|
||||
};
|
||||
|
||||
/** 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
|
||||
*/
|
||||
enum wmi_mlo_teardown_reason {
|
||||
WMI_MLO_TEARDOWN_REASON_DOWN,
|
||||
WMI_MLO_TEARDOWN_REASON_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
|
||||
*/
|
||||
struct wmi_mlo_teardown_params {
|
||||
uint32_t pdev_id;
|
||||
enum wmi_mlo_teardown_reason reason;
|
||||
};
|
||||
|
||||
/** enum wmi_mlo_setup_status - Status code in WMI MLO setup completion event
|
||||
* @WMI_MLO_SETUP_STATUS_SUCCESS: Success
|
||||
* @WMI_MLO_SETUP_STATUS_FAILURE: Failure
|
||||
*/
|
||||
enum wmi_mlo_setup_status {
|
||||
WMI_MLO_SETUP_STATUS_SUCCESS,
|
||||
WMI_MLO_SETUP_STATUS_FAILURE,
|
||||
};
|
||||
|
||||
/** struct wmi_mlo_setup_complete_params - MLO setup complete event params
|
||||
* @pdev_id: pdev id of radio on which this event is received
|
||||
* @status: status code
|
||||
*/
|
||||
struct wmi_mlo_setup_complete_params {
|
||||
uint32_t pdev_id;
|
||||
enum wmi_mlo_setup_status status;
|
||||
};
|
||||
|
||||
/** enum wmi_mlo_teardown_status - Status code in WMI MLO teardown completion
|
||||
* event
|
||||
* @WMI_MLO_TEARDOWN_STATUS_SUCCESS: Success
|
||||
* @WMI_MLO_TEARDOWN_STATUS_FAILURE: Failure
|
||||
*/
|
||||
enum wmi_mlo_teardown_status {
|
||||
WMI_MLO_TEARDOWN_STATUS_SUCCESS,
|
||||
WMI_MLO_TEARDOWN_STATUS_FAILURE,
|
||||
};
|
||||
|
||||
/** struct wmi_mlo_teardown_cmpl_params - MLO setup teardown event params
|
||||
* @pdev_id: pdev id of radio on which this event is received
|
||||
* @status: Teardown status from enum wmi_mlo_teardown_status
|
||||
*/
|
||||
struct wmi_mlo_teardown_cmpl_params {
|
||||
uint32_t pdev_id;
|
||||
enum wmi_mlo_teardown_status status;
|
||||
};
|
||||
#endif
|
||||
#endif
|
79
wmi/inc/wmi_unified_11be_setup_api.h
Normal file
79
wmi/inc/wmi_unified_11be_setup_api.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Copyright (c) 2021, The Linux Foundation. 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
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef _WMI_UNIFIED_11BE_API_H_
|
||||
#define _WMI_UNIFIED_11BE_API_H_
|
||||
|
||||
#include <wmi_unified_11be_param.h>
|
||||
|
||||
#ifdef WLAN_FEATURE_11BE_MLO
|
||||
/**
|
||||
* wmi_mlo_setup_cmd_send() - Send MLO setup command
|
||||
* @wmi_handle: WMI handle for this pdev
|
||||
* @params: MLO setup params
|
||||
*
|
||||
* Return: QDF_STATUS code
|
||||
*/
|
||||
QDF_STATUS wmi_mlo_setup_cmd_send(wmi_unified_t wmi_handle,
|
||||
struct wmi_mlo_setup_params *params);
|
||||
|
||||
/**
|
||||
* wmi_mlo_teardown_cmd_send() - Send MLO teardown command
|
||||
* @wmi_handle: WMI handle for this pdev
|
||||
* @params: MLO teardown params
|
||||
*
|
||||
* Return: QDF_STATUS code
|
||||
*/
|
||||
QDF_STATUS wmi_mlo_teardown_cmd_send(wmi_unified_t wmi_handle,
|
||||
struct wmi_mlo_teardown_params *params);
|
||||
|
||||
/**
|
||||
* wmi_mlo_ready_cmd_send() - Send MLO ready command
|
||||
* @wmi_handle: WMI handle for this pdev
|
||||
* @params: MLO ready params
|
||||
*
|
||||
* Return: QDF_STATUS code
|
||||
*/
|
||||
QDF_STATUS wmi_mlo_ready_cmd_send(wmi_unified_t wmi_handle,
|
||||
struct wmi_mlo_ready_params *params);
|
||||
|
||||
/**
|
||||
* wmi_extract_mlo_setup_cmpl_event() - Extract MLO setup completion event
|
||||
* @wmi_handle: WMI handle for this pdev
|
||||
* @buf: Event buffer
|
||||
* @params: MLO setup event params
|
||||
*
|
||||
* Return: QDF_STATUS code
|
||||
*/
|
||||
QDF_STATUS
|
||||
wmi_extract_mlo_setup_cmpl_event(wmi_unified_t wmi_handle,
|
||||
uint8_t *buf,
|
||||
struct wmi_mlo_setup_complete_params *params);
|
||||
|
||||
/**
|
||||
* wmi_extract_mlo_teardown_cmpl_event() - Extract MLO teardown completion
|
||||
* @wmi_handle: WMI handle for this pdev
|
||||
* @buf: Event buffer
|
||||
* @params: MLO teardown event params
|
||||
*
|
||||
* Return: QDF_STATUS code
|
||||
*/
|
||||
QDF_STATUS
|
||||
wmi_extract_mlo_teardown_cmpl_event(wmi_unified_t wmi_handle,
|
||||
uint8_t *buf,
|
||||
struct wmi_mlo_teardown_cmpl_params *param);
|
||||
#endif /*WLAN_FEATURE_11BE_MLO*/
|
||||
#endif /*_WMI_UNIFIED_11BE_API_H_*/
|
@@ -109,6 +109,10 @@ uint8_t *peer_assoc_add_mlo_params(uint8_t *buf_ptr,
|
||||
*/
|
||||
uint8_t *peer_assoc_add_ml_partner_links(uint8_t *buf_ptr,
|
||||
struct peer_assoc_params *req);
|
||||
/** wmi_11be_tlv_attach_tlv - Attach 11be relaated callbacks
|
||||
* @wmi_handle: WMI handle
|
||||
*/
|
||||
void wmi_11be_attach_tlv(wmi_unified_t wmi_handle);
|
||||
#else
|
||||
static uint8_t *vdev_create_add_mlo_params(uint8_t *buf_ptr,
|
||||
struct vdev_create_params *param)
|
||||
@@ -183,5 +187,7 @@ static uint8_t *peer_assoc_add_ml_partner_links(uint8_t *buf_ptr,
|
||||
return buf_ptr + WMI_TLV_HDR_SIZE;
|
||||
}
|
||||
|
||||
static void wmi_11be_attach_tlv(wmi_unified_t wmi_handle)
|
||||
{ }
|
||||
#endif /*WLAN_FEATURE_11BE_MLO*/
|
||||
#endif /*_WMI_UNIFIED_11BE_TLV_H_*/
|
||||
|
@@ -118,6 +118,10 @@
|
||||
|
||||
#include "wmi_unified_cp_stats_api.h"
|
||||
|
||||
#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
|
||||
#include "wmi_unified_11be_setup_api.h"
|
||||
#endif
|
||||
|
||||
typedef qdf_nbuf_t wmi_buf_t;
|
||||
#define wmi_buf_data(_buf) qdf_nbuf_data(_buf)
|
||||
|
||||
|
@@ -4690,6 +4690,10 @@ typedef enum {
|
||||
wmi_pdev_aoa_phasedelta_event_id,
|
||||
#ifdef WLAN_MGMT_RX_REO_SUPPORT
|
||||
wmi_mgmt_rx_fw_consumed_eventid,
|
||||
#endif
|
||||
#ifdef WLAN_FEATURE_11BE_MLO
|
||||
wmi_mlo_setup_complete_event_id,
|
||||
wmi_mlo_teardown_complete_event_id,
|
||||
#endif
|
||||
wmi_events_max,
|
||||
} wmi_conv_event_id;
|
||||
|
@@ -93,6 +93,10 @@
|
||||
#include <wmi_unified_ap_params.h>
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_11BE_MLO
|
||||
#include <wmi_unified_11be_param.h>
|
||||
#endif
|
||||
|
||||
#define WMI_UNIFIED_MAX_EVENT 0x100
|
||||
|
||||
#ifdef WMI_EXT_DBG
|
||||
@@ -2687,6 +2691,23 @@ QDF_STATUS (*send_mgmt_rx_reo_filter_config_cmd)(
|
||||
uint8_t pdev_id,
|
||||
struct mgmt_rx_reo_filter *filter);
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_11BE_MLO
|
||||
QDF_STATUS (*mlo_setup_cmd_send)(wmi_unified_t wmi_handle,
|
||||
struct wmi_mlo_setup_params *params);
|
||||
QDF_STATUS (*mlo_teardown_cmd_send)(wmi_unified_t wmi_handle,
|
||||
struct wmi_mlo_teardown_params *params);
|
||||
QDF_STATUS (*mlo_ready_cmd_send)(wmi_unified_t wmi_handle,
|
||||
struct wmi_mlo_ready_params *params);
|
||||
QDF_STATUS
|
||||
(*extract_mlo_setup_cmpl_event)(wmi_unified_t wmi_handle,
|
||||
uint8_t *buf,
|
||||
struct wmi_mlo_setup_complete_params *params);
|
||||
QDF_STATUS
|
||||
(*extract_mlo_teardown_cmpl_event)(wmi_unified_t wmi_handle,
|
||||
uint8_t *buf,
|
||||
struct wmi_mlo_teardown_cmpl_params *param);
|
||||
#endif
|
||||
};
|
||||
|
||||
/* Forward declartion for psoc*/
|
||||
|
111
wmi/src/wmi_unified_11be_setup_api.c
Normal file
111
wmi/src/wmi_unified_11be_setup_api.c
Normal file
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* Copyright (c) 2021, The Linux Foundation. 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
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
#include "wmi_unified_priv.h"
|
||||
#ifdef WLAN_MLO_MULTI_CHIP
|
||||
#include "wmi_unified_11be_setup_api.h"
|
||||
#endif
|
||||
#include "wmi_unified_11be_tlv.h"
|
||||
|
||||
/**
|
||||
* wmi_mlo_setup_cmd_send() - Send MLO setup command
|
||||
* @wmi_handle: WMI handle for this pdev
|
||||
* @params: MLO setup params
|
||||
*
|
||||
* Return: QDF_STATUS code
|
||||
*/
|
||||
QDF_STATUS wmi_mlo_setup_cmd_send(wmi_unified_t wmi_handle,
|
||||
struct wmi_mlo_setup_params *params)
|
||||
{
|
||||
if (wmi_handle->ops->mlo_setup_cmd_send)
|
||||
return wmi_handle->ops->mlo_setup_cmd_send(
|
||||
wmi_handle, params);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
/**
|
||||
* wmi_mlo_teardown_cmd_send() - Send MLO teardown command
|
||||
* @wmi_handle: WMI handle for this pdev
|
||||
* @params: MLO teardown params
|
||||
*
|
||||
* Return: QDF_STATUS code
|
||||
*/
|
||||
QDF_STATUS wmi_mlo_teardown_cmd_send(wmi_unified_t wmi_handle,
|
||||
struct wmi_mlo_teardown_params *params)
|
||||
{
|
||||
if (wmi_handle->ops->mlo_teardown_cmd_send)
|
||||
return wmi_handle->ops->mlo_teardown_cmd_send(
|
||||
wmi_handle, params);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
/**
|
||||
* wmi_mlo_ready_cmd_send() - Send MLO ready command
|
||||
* @wmi_handle: WMI handle for this pdev
|
||||
* @params: MLO ready params
|
||||
*
|
||||
* Return: QDF_STATUS code
|
||||
*/
|
||||
QDF_STATUS wmi_mlo_ready_cmd_send(wmi_unified_t wmi_handle,
|
||||
struct wmi_mlo_ready_params *params)
|
||||
{
|
||||
if (wmi_handle->ops->mlo_ready_cmd_send)
|
||||
return wmi_handle->ops->mlo_ready_cmd_send(
|
||||
wmi_handle, params);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
/**
|
||||
* wmi_extract_mlo_setup_cmpl_event() - Extract MLO setup completion event
|
||||
* @wmi_handle: WMI handle for this pdev
|
||||
* @buf: Event buffer
|
||||
* @params: MLO setup event params
|
||||
*
|
||||
* Return: QDF_STATUS code
|
||||
*/
|
||||
QDF_STATUS
|
||||
wmi_extract_mlo_setup_cmpl_event(wmi_unified_t wmi_handle,
|
||||
uint8_t *buf,
|
||||
struct wmi_mlo_setup_complete_params *params)
|
||||
{
|
||||
if (wmi_handle->ops->extract_mlo_setup_cmpl_event)
|
||||
return wmi_handle->ops->extract_mlo_setup_cmpl_event(
|
||||
wmi_handle, buf, params);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
/**
|
||||
* wmi_extract_mlo_teardown_cmpl_event() - Extract MLO teardown completion
|
||||
* @wmi_handle: WMI handle for this pdev
|
||||
* @buf: Event buffer
|
||||
* @param: MLO teardown event params
|
||||
*
|
||||
* Return: QDF_STATUS code
|
||||
*/
|
||||
QDF_STATUS
|
||||
wmi_extract_mlo_teardown_cmpl_event(wmi_unified_t wmi_handle,
|
||||
uint8_t *buf,
|
||||
struct wmi_mlo_teardown_cmpl_params *param)
|
||||
{
|
||||
if (wmi_handle->ops->extract_mlo_teardown_cmpl_event)
|
||||
return wmi_handle->ops->extract_mlo_teardown_cmpl_event(
|
||||
wmi_handle, buf, param);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
@@ -14,10 +14,13 @@
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "wmi_unified_api.h"
|
||||
#include <osdep.h>
|
||||
#include "wmi.h"
|
||||
#include "wmi_unified_priv.h"
|
||||
#include "wmi_unified_param.h"
|
||||
#include "wmi_unified_api.h"
|
||||
#ifdef WLAN_MLO_MULTI_CHIP
|
||||
#include "wmi_unified_11be_setup_api.h"
|
||||
#endif
|
||||
#include "wmi_unified_11be_tlv.h"
|
||||
|
||||
size_t vdev_create_mlo_params_size(void)
|
||||
@@ -254,3 +257,204 @@ uint8_t *peer_assoc_add_ml_partner_links(uint8_t *buf_ptr,
|
||||
(req->ml_links.num_links *
|
||||
sizeof(wmi_peer_assoc_mlo_partner_link_params));
|
||||
}
|
||||
|
||||
#ifdef WLAN_MLO_MULTI_CHIP
|
||||
QDF_STATUS mlo_setup_cmd_send_tlv(struct wmi_unified *wmi_handle,
|
||||
struct wmi_mlo_setup_params *param)
|
||||
{
|
||||
QDF_STATUS ret;
|
||||
wmi_mlo_setup_cmd_fixed_param *cmd;
|
||||
wmi_buf_t buf;
|
||||
int32_t len;
|
||||
uint8_t *buf_ptr;
|
||||
uint32_t *partner_links;
|
||||
uint8_t idx;
|
||||
|
||||
if (param->num_valid_hw_links > MAX_LINK_IN_MLO)
|
||||
return QDF_STATUS_E_INVAL;
|
||||
|
||||
len = sizeof(*cmd) +
|
||||
(param->num_valid_hw_links * sizeof(uint32_t)) +
|
||||
WMI_TLV_HDR_SIZE;
|
||||
|
||||
buf = wmi_buf_alloc(wmi_handle, len);
|
||||
if (!buf)
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
|
||||
cmd = (wmi_mlo_setup_cmd_fixed_param *)wmi_buf_data(buf);
|
||||
WMITLV_SET_HDR(&cmd->tlv_header,
|
||||
WMITLV_TAG_STRUC_wmi_mlo_setup_cmd_fixed_param,
|
||||
WMITLV_GET_STRUCT_TLVLEN(wmi_mlo_setup_cmd_fixed_param));
|
||||
|
||||
cmd->mld_group_id = param->mld_grp_id;
|
||||
cmd->pdev_id = wmi_handle->ops->convert_pdev_id_host_to_target(
|
||||
wmi_handle,
|
||||
param->pdev_id);
|
||||
buf_ptr = (uint8_t *)cmd + sizeof(*cmd);
|
||||
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_UINT32,
|
||||
(sizeof(uint32_t) * param->num_valid_hw_links));
|
||||
partner_links = (uint32_t *)(buf_ptr + WMI_TLV_HDR_SIZE);
|
||||
for (idx = 0; idx < param->num_valid_hw_links; idx++)
|
||||
partner_links[idx] = param->partner_links[idx];
|
||||
|
||||
wmi_mtrace(WMI_MLO_SETUP_CMDID, NO_SESSION, 0);
|
||||
ret = wmi_unified_cmd_send(wmi_handle, buf, len, WMI_MLO_SETUP_CMDID);
|
||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||
wmi_err("Failed to send MLO setup command ret = %d", ret);
|
||||
wmi_buf_free(buf);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
QDF_STATUS mlo_ready_cmd_send_tlv(struct wmi_unified *wmi_handle,
|
||||
struct wmi_mlo_ready_params *param)
|
||||
{
|
||||
QDF_STATUS ret;
|
||||
wmi_mlo_ready_cmd_fixed_param *cmd;
|
||||
wmi_buf_t buf;
|
||||
int32_t len;
|
||||
|
||||
len = sizeof(*cmd);
|
||||
|
||||
buf = wmi_buf_alloc(wmi_handle, len);
|
||||
if (!buf)
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
|
||||
cmd = (wmi_mlo_ready_cmd_fixed_param *)wmi_buf_data(buf);
|
||||
WMITLV_SET_HDR(&cmd->tlv_header,
|
||||
WMITLV_TAG_STRUC_wmi_mlo_ready_cmd_fixed_param,
|
||||
WMITLV_GET_STRUCT_TLVLEN(wmi_mlo_ready_cmd_fixed_param));
|
||||
|
||||
cmd->pdev_id = wmi_handle->ops->convert_pdev_id_host_to_target(
|
||||
wmi_handle,
|
||||
param->pdev_id);
|
||||
|
||||
wmi_mtrace(WMI_MLO_READY_CMDID, NO_SESSION, 0);
|
||||
ret = wmi_unified_cmd_send(wmi_handle, buf, len, WMI_MLO_READY_CMDID);
|
||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||
wmi_err("Failed to send MLO ready command ret = %d", ret);
|
||||
wmi_buf_free(buf);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
QDF_STATUS mlo_teardown_cmd_send_tlv(struct wmi_unified *wmi_handle,
|
||||
struct wmi_mlo_teardown_params *param)
|
||||
{
|
||||
QDF_STATUS ret;
|
||||
wmi_mlo_teardown_fixed_param *cmd;
|
||||
wmi_buf_t buf;
|
||||
int32_t len;
|
||||
|
||||
len = sizeof(*cmd);
|
||||
|
||||
buf = wmi_buf_alloc(wmi_handle, len);
|
||||
if (!buf)
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
|
||||
cmd = (wmi_mlo_teardown_fixed_param *)wmi_buf_data(buf);
|
||||
WMITLV_SET_HDR(&cmd->tlv_header,
|
||||
WMITLV_TAG_STRUC_wmi_mlo_teardown_fixed_param,
|
||||
WMITLV_GET_STRUCT_TLVLEN(wmi_mlo_teardown_fixed_param));
|
||||
|
||||
cmd->pdev_id = wmi_handle->ops->convert_pdev_id_host_to_target(
|
||||
wmi_handle,
|
||||
param->pdev_id);
|
||||
switch (param->reason) {
|
||||
case WMI_MLO_TEARDOWN_REASON_SSR:
|
||||
cmd->reason_code = WMI_MLO_TEARDOWN_SSR_REASON;
|
||||
break;
|
||||
case WMI_MLO_TEARDOWN_REASON_DOWN:
|
||||
default:
|
||||
cmd->reason_code = WMI_MLO_TEARDOWN_SSR_REASON + 1;
|
||||
break;
|
||||
}
|
||||
|
||||
wmi_mtrace(WMI_MLO_TEARDOWN_CMDID, NO_SESSION, 0);
|
||||
ret = wmi_unified_cmd_send(wmi_handle, buf, len,
|
||||
WMI_MLO_TEARDOWN_CMDID);
|
||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||
wmi_err("Failed to send MLO Teardown command ret = %d", ret);
|
||||
wmi_buf_free(buf);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
extract_mlo_setup_cmpl_event_tlv(struct wmi_unified *wmi_handle,
|
||||
uint8_t *buf,
|
||||
struct wmi_mlo_setup_complete_params *params)
|
||||
{
|
||||
WMI_MLO_SETUP_COMPLETE_EVENTID_param_tlvs *param_buf;
|
||||
wmi_mlo_setup_complete_event_fixed_param *ev;
|
||||
|
||||
param_buf = (WMI_MLO_SETUP_COMPLETE_EVENTID_param_tlvs *)buf;
|
||||
if (!param_buf) {
|
||||
wmi_err_rl("Param_buf is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
ev = (wmi_mlo_setup_complete_event_fixed_param *)param_buf->fixed_param;
|
||||
|
||||
params->pdev_id = wmi_handle->ops->convert_pdev_id_target_to_host(
|
||||
wmi_handle,
|
||||
ev->pdev_id);
|
||||
if (!ev->status)
|
||||
params->status = WMI_MLO_SETUP_STATUS_SUCCESS;
|
||||
else
|
||||
params->status = WMI_MLO_SETUP_STATUS_FAILURE;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
extract_mlo_teardown_cmpl_event_tlv(struct wmi_unified *wmi_handle,
|
||||
uint8_t *buf,
|
||||
struct wmi_mlo_teardown_cmpl_params *params)
|
||||
{
|
||||
WMI_MLO_TEARDOWN_COMPLETE_EVENTID_param_tlvs *param_buf;
|
||||
wmi_mlo_teardown_complete_fixed_param *ev;
|
||||
|
||||
param_buf = (WMI_MLO_TEARDOWN_COMPLETE_EVENTID_param_tlvs *)buf;
|
||||
if (!param_buf) {
|
||||
wmi_err_rl("Param_buf is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
ev = (wmi_mlo_teardown_complete_fixed_param *)param_buf->fixed_param;
|
||||
|
||||
params->pdev_id = wmi_handle->ops->convert_pdev_id_target_to_host(
|
||||
wmi_handle,
|
||||
ev->pdev_id);
|
||||
if (!ev->status)
|
||||
params->status = WMI_MLO_TEARDOWN_STATUS_SUCCESS;
|
||||
else
|
||||
params->status = WMI_MLO_TEARDOWN_STATUS_FAILURE;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static void wmi_11be_attach_mlo_setup_tlv(wmi_unified_t wmi_handle)
|
||||
{
|
||||
struct wmi_ops *ops = wmi_handle->ops;
|
||||
|
||||
ops->mlo_setup_cmd_send = mlo_setup_cmd_send_tlv;
|
||||
ops->mlo_teardown_cmd_send = mlo_teardown_cmd_send_tlv;
|
||||
ops->mlo_ready_cmd_send = mlo_ready_cmd_send_tlv;
|
||||
ops->extract_mlo_setup_cmpl_event = extract_mlo_setup_cmpl_event_tlv;
|
||||
ops->extract_mlo_teardown_cmpl_event =
|
||||
extract_mlo_teardown_cmpl_event_tlv;
|
||||
}
|
||||
|
||||
#else /*WLAN_MLO_MULTI_CHIP*/
|
||||
|
||||
static void wmi_11be_attach_mlo_setup_tlv(wmi_unified_t wmi_handle)
|
||||
{}
|
||||
|
||||
#endif /*WLAN_MLO_MULTI_CHIP*/
|
||||
|
||||
void wmi_11be_attach_tlv(wmi_unified_t wmi_handle)
|
||||
{
|
||||
wmi_11be_attach_mlo_setup_tlv(wmi_handle);
|
||||
}
|
||||
|
@@ -16763,6 +16763,12 @@ event_ids[wmi_roam_scan_chan_list_id] =
|
||||
event_ids[wmi_mgmt_rx_fw_consumed_eventid] =
|
||||
WMI_MGMT_RX_FW_CONSUMED_EVENTID;
|
||||
#endif
|
||||
#ifdef WLAN_FEATURE_11BE_MLO
|
||||
event_ids[wmi_mlo_setup_complete_event_id] =
|
||||
WMI_MLO_SETUP_COMPLETE_EVENTID;
|
||||
event_ids[wmi_mlo_teardown_complete_event_id] =
|
||||
WMI_MLO_TEARDOWN_COMPLETE_EVENTID;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_LINK_LAYER_STATS
|
||||
@@ -17247,6 +17253,7 @@ void wmi_tlv_attach(wmi_unified_t wmi_handle)
|
||||
wmi_cfr_attach_tlv(wmi_handle);
|
||||
wmi_cp_stats_attach_tlv(wmi_handle);
|
||||
wmi_gpio_attach_tlv(wmi_handle);
|
||||
wmi_11be_attach_tlv(wmi_handle);
|
||||
}
|
||||
qdf_export_symbol(wmi_tlv_attach);
|
||||
|
||||
|
Reference in New Issue
Block a user