qcacmn: Make changes for updating Link qualifier parameters
1. Make changes to selectively send the Link control WMI to the FW with out including the T2LM TLV. 2. Modify the TLV definitions for Link preference to use the newer Link control TLV. Change-Id: Id8beae8376ee5d2fb3434367530a0a6bb976597d CRs-Fixed: 3422692
This commit is contained in:

committed by
Madan Koyyalamudi

parent
53deac6358
commit
db04e08c9a
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
@@ -126,10 +126,12 @@ QDF_STATUS wmi_extract_mgmt_rx_mlo_link_removal_info(
|
||||
* wmi_send_mlo_peer_tid_to_link_map_cmd() - send TID-to-link mapping command
|
||||
* @wmi: WMI handle for this pdev
|
||||
* @params: Pointer to TID-to-link mapping params
|
||||
* @t2lm_info: T2LM info presence flag
|
||||
*/
|
||||
QDF_STATUS wmi_send_mlo_peer_tid_to_link_map_cmd(
|
||||
wmi_unified_t wmi,
|
||||
struct wmi_host_tid_to_link_map_params *params);
|
||||
struct wmi_host_tid_to_link_map_params *params,
|
||||
bool t2lm_info);
|
||||
|
||||
/**
|
||||
* wmi_send_mlo_vdev_tid_to_link_map_cmd() - send TID-to-link mapping command
|
||||
|
@@ -1111,11 +1111,21 @@ typedef struct {
|
||||
* is present.
|
||||
* @preffered_link_order: Preferred links in order.
|
||||
* @timeout: timeout values for all the access categories.
|
||||
* @tlt_characterization_params: Bitmask to select Tx-Link Tuple from ordered
|
||||
* list.
|
||||
* Bit 0-15 : Each bit maps to the corresponding Link ID
|
||||
* Bit 16-31: Reserved
|
||||
* @link_control_flags: Link control flags.
|
||||
* Bit 0: TLT enable/disable
|
||||
* Bit 1: Preferred Link enable/disable
|
||||
* Bit 2-31: Reserved
|
||||
*/
|
||||
struct wlan_host_preferred_links {
|
||||
uint8_t num_pref_links;
|
||||
uint8_t preffered_link_order[MAX_PREFERRED_LINKS];
|
||||
uint32_t timeout[WMI_HOST_WLAN_MAX_AC];
|
||||
uint32_t tlt_characterization_params;
|
||||
uint32_t link_control_flags;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@@ -3151,7 +3151,8 @@ QDF_STATUS
|
||||
#ifdef WLAN_FEATURE_11BE
|
||||
QDF_STATUS (*send_mlo_peer_tid_to_link_map)(
|
||||
wmi_unified_t wmi_handle,
|
||||
struct wmi_host_tid_to_link_map_params *params);
|
||||
struct wmi_host_tid_to_link_map_params *params,
|
||||
bool t2lm_info);
|
||||
|
||||
QDF_STATUS (*send_mlo_vdev_tid_to_link_map)(
|
||||
wmi_unified_t wmi_handle,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
@@ -62,10 +62,11 @@ wmi_send_mlo_link_set_active_cmd(wmi_unified_t wmi,
|
||||
#ifdef WLAN_FEATURE_11BE
|
||||
QDF_STATUS wmi_send_mlo_peer_tid_to_link_map_cmd(
|
||||
wmi_unified_t wmi,
|
||||
struct wmi_host_tid_to_link_map_params *params)
|
||||
struct wmi_host_tid_to_link_map_params *params,
|
||||
bool t2lm_info)
|
||||
{
|
||||
if (wmi->ops->send_mlo_peer_tid_to_link_map)
|
||||
return wmi->ops->send_mlo_peer_tid_to_link_map(wmi, params);
|
||||
return wmi->ops->send_mlo_peer_tid_to_link_map(wmi, params, t2lm_info);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
@@ -914,60 +914,98 @@ uint8_t *peer_assoc_add_tid_to_link_map(uint8_t *buf_ptr,
|
||||
|
||||
#ifdef WMI_AP_SUPPORT
|
||||
static uint32_t find_buf_len_pref_link(
|
||||
struct wmi_host_tid_to_link_map_params *params)
|
||||
struct wmi_host_tid_to_link_map_params *params,
|
||||
bool t2lm_info)
|
||||
{
|
||||
uint32_t buf_len = 0;
|
||||
|
||||
buf_len = sizeof(wmi_peer_tid_to_link_map_fixed_param) +
|
||||
WMI_TLV_HDR_SIZE + (params->num_dir * T2LM_MAX_NUM_TIDS *
|
||||
sizeof(wmi_tid_to_link_map)) +
|
||||
WMI_TLV_HDR_SIZE + sizeof(wmi_peer_preferred_link_map);
|
||||
buf_len = sizeof(wmi_peer_tid_to_link_map_fixed_param);
|
||||
|
||||
/* Update the length for T2LM info TLV */
|
||||
if (t2lm_info) {
|
||||
buf_len += (WMI_TLV_HDR_SIZE +
|
||||
(params->num_dir * T2LM_MAX_NUM_TIDS *
|
||||
sizeof(wmi_tid_to_link_map)));
|
||||
} else {
|
||||
buf_len += WMI_TLV_HDR_SIZE;
|
||||
}
|
||||
|
||||
/* Update the length for Preferred Link TLV.
|
||||
* The Link Preference TLV is planned to be deprecated,
|
||||
* so the TLV is going to be exlcuded by default
|
||||
*/
|
||||
buf_len += WMI_TLV_HDR_SIZE;
|
||||
|
||||
/* Update the length for Link control TLV */
|
||||
if (params->preferred_links.num_pref_links) {
|
||||
buf_len += (WMI_TLV_HDR_SIZE +
|
||||
sizeof(wmi_mlo_peer_link_control_param));
|
||||
} else {
|
||||
buf_len += WMI_TLV_HDR_SIZE;
|
||||
}
|
||||
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
static uint8_t *populate_preferred_link_tlv(
|
||||
static uint8_t *populate_link_control_tlv(
|
||||
uint8_t *buf_ptr,
|
||||
struct wmi_host_tid_to_link_map_params *params)
|
||||
{
|
||||
wmi_peer_preferred_link_map *pref_links;
|
||||
wmi_mlo_peer_link_control_param *link_control;
|
||||
uint8_t pref_link = 0;
|
||||
uint8_t latency = 0;
|
||||
uint8_t links = 0;
|
||||
|
||||
/* The Link Preference TLV is planned to be deprecated,
|
||||
* so the TLV is going to be exlcuded by default.
|
||||
*/
|
||||
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0);
|
||||
buf_ptr = buf_ptr + WMI_TLV_HDR_SIZE;
|
||||
|
||||
if (params->preferred_links.num_pref_links) {
|
||||
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
|
||||
sizeof(wmi_peer_preferred_link_map));
|
||||
sizeof(wmi_mlo_peer_link_control_param));
|
||||
buf_ptr += sizeof(uint32_t);
|
||||
|
||||
pref_links = (wmi_peer_preferred_link_map *)buf_ptr;
|
||||
link_control = (wmi_mlo_peer_link_control_param *)buf_ptr;
|
||||
|
||||
WMITLV_SET_HDR(&pref_links->tlv_header,
|
||||
WMITLV_TAG_STRUC_wmi_peer_preferred_link_map,
|
||||
WMITLV_GET_STRUCT_TLVLEN(wmi_peer_preferred_link_map));
|
||||
WMITLV_SET_HDR(&link_control->tlv_header,
|
||||
WMITLV_TAG_STRUC_wmi_mlo_peer_link_control_param,
|
||||
WMITLV_GET_STRUCT_TLVLEN(wmi_mlo_peer_link_control_param));
|
||||
|
||||
pref_links->num_preferred_links =
|
||||
params->preferred_links.num_pref_links;
|
||||
link_control->num_links = params->preferred_links.num_pref_links;
|
||||
links = params->preferred_links.num_pref_links;
|
||||
|
||||
for (pref_link = 0; pref_link < links; pref_link++) {
|
||||
pref_links->preferred_link_order[pref_link] =
|
||||
link_control->link_priority_order[pref_link] =
|
||||
params->preferred_links.preffered_link_order[pref_link];
|
||||
wmi_debug("Add preference link TLV: preffered_link_order: %d",
|
||||
pref_links->preferred_link_order[pref_link]);
|
||||
link_control->link_priority_order[pref_link]);
|
||||
}
|
||||
|
||||
link_control->flags =
|
||||
params->preferred_links.link_control_flags;
|
||||
link_control->tx_link_tuple_bitmap =
|
||||
params->preferred_links.tlt_characterization_params;
|
||||
|
||||
for (latency = 0; latency < WLAN_MAX_AC; latency++) {
|
||||
pref_links->expected_max_latency_ms[latency] =
|
||||
link_control->max_timeout_ms[latency] =
|
||||
params->preferred_links.timeout[latency];
|
||||
wmi_debug("Add preference link TLV: expected_timeout_ms: %d",
|
||||
pref_links->expected_max_latency_ms[latency]);
|
||||
link_control->max_timeout_ms[latency]);
|
||||
}
|
||||
buf_ptr += sizeof(wmi_mlo_peer_link_control_param);
|
||||
} else {
|
||||
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0);
|
||||
buf_ptr = buf_ptr + WMI_TLV_HDR_SIZE;
|
||||
}
|
||||
|
||||
buf_ptr += sizeof(wmi_peer_preferred_link_map);
|
||||
return buf_ptr;
|
||||
}
|
||||
#else
|
||||
static uint32_t find_buf_len_pref_link(
|
||||
struct wmi_host_tid_to_link_map_params *params)
|
||||
struct wmi_host_tid_to_link_map_params *params,
|
||||
bool t2lm_info)
|
||||
{
|
||||
uint32_t buf_len = 0;
|
||||
|
||||
@@ -977,7 +1015,7 @@ static uint32_t find_buf_len_pref_link(
|
||||
return buf_len;
|
||||
}
|
||||
|
||||
static uint8_t *populate_preferred_link_tlv(
|
||||
static uint8_t *populate_link_control_tlv(
|
||||
uint8_t *buf_ptr,
|
||||
struct wmi_host_tid_to_link_map_params *params)
|
||||
{
|
||||
@@ -987,7 +1025,8 @@ static uint8_t *populate_preferred_link_tlv(
|
||||
|
||||
static QDF_STATUS send_mlo_peer_tid_to_link_map_cmd_tlv(
|
||||
wmi_unified_t wmi_handle,
|
||||
struct wmi_host_tid_to_link_map_params *params)
|
||||
struct wmi_host_tid_to_link_map_params *params,
|
||||
bool t2lm_info)
|
||||
{
|
||||
wmi_peer_tid_to_link_map_fixed_param *cmd;
|
||||
wmi_tid_to_link_map *t2lm;
|
||||
@@ -998,7 +1037,7 @@ static QDF_STATUS send_mlo_peer_tid_to_link_map_cmd_tlv(
|
||||
uint8_t dir = 0;
|
||||
uint8_t tid_num = 0;
|
||||
|
||||
buf_len = find_buf_len_pref_link(params);
|
||||
buf_len = find_buf_len_pref_link(params, t2lm_info);
|
||||
buf = wmi_buf_alloc(wmi_handle, buf_len);
|
||||
if (!buf) {
|
||||
wmi_err("wmi buf alloc failed for mlo_peer_mac: "
|
||||
@@ -1022,6 +1061,7 @@ static QDF_STATUS send_mlo_peer_tid_to_link_map_cmd_tlv(
|
||||
|
||||
buf_ptr += sizeof(wmi_peer_tid_to_link_map_fixed_param);
|
||||
|
||||
if (t2lm_info) {
|
||||
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
|
||||
(params->num_dir * T2LM_MAX_NUM_TIDS *
|
||||
sizeof(wmi_tid_to_link_map)));
|
||||
@@ -1067,8 +1107,12 @@ static QDF_STATUS send_mlo_peer_tid_to_link_map_cmd_tlv(
|
||||
t2lm->tid_to_link_map_info);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0);
|
||||
buf_ptr = buf_ptr + WMI_TLV_HDR_SIZE;
|
||||
}
|
||||
|
||||
buf_ptr = populate_preferred_link_tlv(buf_ptr, params);
|
||||
buf_ptr = populate_link_control_tlv(buf_ptr, params);
|
||||
wmi_mtrace(WMI_MLO_PEER_TID_TO_LINK_MAP_CMDID, cmd->pdev_id, 0);
|
||||
ret = wmi_unified_cmd_send(wmi_handle, buf, buf_len,
|
||||
WMI_MLO_PEER_TID_TO_LINK_MAP_CMDID);
|
||||
|
Reference in New Issue
Block a user