qcacmn: Implement handling of mlo standby csa
Implement handling of mlo sta standby csa beacon and initiate the transmission of a link bss request command tlv to the firmware for standby link. Change-Id: Ibdf903c69757b47f301ab9fa7c563407915532d6 CRs-Fixed: 3605764
Šī revīzija ir iekļauta:

revīziju iesūtīja
Rahul Choudhary

vecāks
a9d8a404fc
revīzija
760a93969c
@@ -826,6 +826,41 @@ target_if_mlo_send_wsi_link_info_cmd(struct wlan_objmgr_pdev *pdev,
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
static QDF_STATUS
|
||||
target_if_send_link_set_bss_params_cmd(struct wlan_objmgr_psoc *psoc,
|
||||
struct mlo_link_bss_params *cmd)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
struct wmi_unified *wmi_handle = NULL;
|
||||
struct wmi_host_link_bss_params params = {0};
|
||||
|
||||
if (!psoc) {
|
||||
target_if_err("null pdev");
|
||||
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;
|
||||
}
|
||||
if (!cmd) {
|
||||
target_if_err("cmd is null");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
params.link_id = cmd->link_id;
|
||||
qdf_mem_copy(¶ms.ap_mld_mac[0], &cmd->ap_mld_mac[0],
|
||||
QDF_MAC_ADDR_SIZE);
|
||||
|
||||
params.chan.ch_freq = cmd->chan->ch_freq;
|
||||
params.chan.ch_cfreq1 = cmd->chan->ch_cfreq1;
|
||||
params.chan.ch_cfreq2 = cmd->chan->ch_cfreq2;
|
||||
params.chan.ch_phymode = cmd->chan->ch_phymode;
|
||||
|
||||
status = wmi_send_link_set_bss_params_cmd(wmi_handle, ¶ms);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS target_if_mlo_send_link_removal_cmd(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
@@ -945,6 +980,8 @@ target_if_mlo_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
|
||||
mlo_tx_ops->send_link_removal_cmd = target_if_mlo_send_link_removal_cmd;
|
||||
mlo_tx_ops->request_link_state_info_cmd =
|
||||
target_if_request_ml_link_state_info;
|
||||
mlo_tx_ops->send_link_set_bss_params_cmd =
|
||||
target_if_send_link_set_bss_params_cmd;
|
||||
mlo_tx_ops->send_vdev_pause = target_if_mlo_send_vdev_pause;
|
||||
|
||||
target_if_mlo_register_link_switch_cnf_handler(mlo_tx_ops);
|
||||
|
@@ -1525,6 +1525,7 @@ struct wlan_lmac_if_son_rx_ops {
|
||||
* @unregister_events: function to de-register event handlers with FW
|
||||
* @link_set_active: function to send mlo link set active command to FW
|
||||
* @request_link_state_info_cmd: function pointer to send link state info
|
||||
* @send_link_set_bss_params_cmd: function pointer to send link set bss cmd
|
||||
* @shmem_local_ops: operations specific to WLAN_MLO_GLOBAL_SHMEM_SUPPORT
|
||||
* @send_tid_to_link_mapping: function to send T2LM command to FW
|
||||
* @send_link_removal_cmd: function to send MLO link removal command to FW
|
||||
@@ -1541,6 +1542,9 @@ struct wlan_lmac_if_mlo_tx_ops {
|
||||
QDF_STATUS (*request_link_state_info_cmd)(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
struct mlo_link_state_cmd_params *param);
|
||||
QDF_STATUS (*send_link_set_bss_params_cmd)(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
struct mlo_link_bss_params *param);
|
||||
|
||||
#ifdef WLAN_MLO_GLOBAL_SHMEM_SUPPORT
|
||||
struct wlan_lmac_if_global_shmem_local_ops shmem_local_ops;
|
||||
|
@@ -403,6 +403,18 @@ struct wlan_mlo_key_mgmt {
|
||||
bool keys_saved;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct mlo_link_bss_params - link bss param
|
||||
* @link_id: link id
|
||||
* @ap_mld_mac: mld mac address
|
||||
* @chan: channel
|
||||
*/
|
||||
struct mlo_link_bss_params {
|
||||
int8_t link_id;
|
||||
int8_t ap_mld_mac[QDF_MAC_ADDR_SIZE];
|
||||
struct wlan_channel *chan;
|
||||
};
|
||||
|
||||
#ifdef WLAN_FEATURE_11BE_MLO
|
||||
/**
|
||||
* struct mlo_link_state_cmd_params - MLO link state params
|
||||
|
@@ -771,7 +771,32 @@ bool mlo_is_sta_csa_synced(struct wlan_mlo_dev_context *mlo_dev_ctx,
|
||||
QDF_STATUS mlo_sta_csa_save_params(struct wlan_mlo_dev_context *mlo_dev_ctx,
|
||||
uint8_t link_id,
|
||||
struct csa_offload_params *csa_param);
|
||||
|
||||
#ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
|
||||
/**
|
||||
* mlo_sta_handle_csa_standby_link - Handle csa parameters for standby link
|
||||
* @mlo_dev_ctx: mlo context
|
||||
* @link_id: link id
|
||||
* @csa_param: csa parameters to be saved
|
||||
* @vdev: vdev obj mgr
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS mlo_sta_handle_csa_standby_link(
|
||||
struct wlan_mlo_dev_context *mlo_dev_ctx,
|
||||
uint8_t link_id,
|
||||
struct csa_offload_params *csa_param,
|
||||
struct wlan_objmgr_vdev *vdev);
|
||||
#else
|
||||
static inline
|
||||
QDF_STATUS mlo_sta_handle_csa_standby_link(
|
||||
struct wlan_mlo_dev_context *mlo_dev_ctx,
|
||||
uint8_t link_id,
|
||||
struct csa_offload_params *csa_param,
|
||||
struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
/**
|
||||
* mlo_sta_up_active_notify - mlo sta up active notify
|
||||
* @vdev: vdev obj mgr
|
||||
|
@@ -1902,6 +1902,87 @@ bool mlo_is_sta_csa_synced(struct wlan_mlo_dev_context *mlo_dev_ctx,
|
||||
return sta_csa_synced;
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
|
||||
QDF_STATUS mlo_sta_handle_csa_standby_link(
|
||||
struct wlan_mlo_dev_context *mlo_dev_ctx,
|
||||
uint8_t link_id,
|
||||
struct csa_offload_params *csa_param,
|
||||
struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
struct wlan_lmac_if_mlo_tx_ops *mlo_tx_ops;
|
||||
struct mlo_link_info *link_info;
|
||||
struct mlo_link_bss_params params = {0};
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
|
||||
if (!mlo_dev_ctx) {
|
||||
mlo_err("invalid mlo_dev_ctx");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
if (!psoc) {
|
||||
mlo_err("null psoc");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
mlo_tx_ops = &psoc->soc_cb.tx_ops->mlo_ops;
|
||||
|
||||
link_info = mlo_mgr_get_ap_link_by_link_id(mlo_dev_ctx, link_id);
|
||||
if (!link_info) {
|
||||
mlo_err("link info null");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
if (link_info->vdev_id != WLAN_INVALID_VDEV_ID) {
|
||||
mlo_debug("vdev id %d link id %d ", link_info->vdev_id,
|
||||
link_id);
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
mlo_mgr_update_csa_link_info(mlo_dev_ctx, csa_param, link_id);
|
||||
|
||||
params.link_id = link_info->link_id;
|
||||
params.chan = qdf_mem_malloc(sizeof(struct wlan_channel));
|
||||
if (!params.chan) {
|
||||
mlo_err("no mem allocated");
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
wlan_vdev_get_bss_peer_mld_mac(
|
||||
vdev,
|
||||
(struct qdf_mac_addr *)¶ms.ap_mld_mac[0]);
|
||||
|
||||
params.chan->ch_freq = link_info->link_chan_info->ch_freq;
|
||||
params.chan->ch_cfreq1 = link_info->link_chan_info->ch_cfreq1;
|
||||
params.chan->ch_cfreq2 = link_info->link_chan_info->ch_cfreq2;
|
||||
params.chan->ch_phymode = link_info->link_chan_info->ch_phymode;
|
||||
|
||||
mlo_debug("link id %d chan freq %d cfreq1 %d cfreq2 %d host phymode %d ap mld mac " QDF_MAC_ADDR_FMT,
|
||||
link_info->link_id, link_info->link_chan_info->ch_freq,
|
||||
link_info->link_chan_info->ch_cfreq1,
|
||||
link_info->link_chan_info->ch_cfreq2,
|
||||
link_info->link_chan_info->ch_phymode,
|
||||
QDF_MAC_ADDR_REF(¶ms.ap_mld_mac[0]));
|
||||
|
||||
if (!mlo_tx_ops->send_link_set_bss_params_cmd) {
|
||||
mlo_err("handler is not registered");
|
||||
qdf_mem_free(params.chan);
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
status = mlo_tx_ops->send_link_set_bss_params_cmd(psoc, ¶ms);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
mlo_err("failed to send link set bss request command to FW");
|
||||
qdf_mem_free(params.chan);
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
qdf_mem_free(params.chan);
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
|
||||
QDF_STATUS mlo_sta_csa_save_params(struct wlan_mlo_dev_context *mlo_dev_ctx,
|
||||
uint8_t link_id,
|
||||
struct csa_offload_params *csa_param)
|
||||
|
@@ -161,6 +161,15 @@ QDF_STATUS wmi_send_mlo_link_state_request_cmd(
|
||||
wmi_unified_t wmi,
|
||||
struct wmi_host_link_state_params *params);
|
||||
|
||||
/**
|
||||
* wmi_send_link_set_bss_params_cmd - send link set bss cmd
|
||||
* @wmi: wmi handler
|
||||
* @params: pointer to link bss param
|
||||
*/
|
||||
QDF_STATUS wmi_send_link_set_bss_params_cmd(
|
||||
wmi_unified_t wmi,
|
||||
struct wmi_host_link_bss_params *params);
|
||||
|
||||
/**
|
||||
* wmi_extract_mlo_vdev_tid_to_link_map_event() - extract mlo t2lm info for vdev
|
||||
* @wmi: wmi handle
|
||||
|
@@ -1209,6 +1209,18 @@ struct wmi_host_link_state_params {
|
||||
uint8_t mld_mac[QDF_MAC_ADDR_SIZE];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct wmi_host_link_bss_params - link bss params
|
||||
* @link_id: link id
|
||||
* @ap_mld_mac: ap mld mac address
|
||||
* @chan: channel
|
||||
*/
|
||||
struct wmi_host_link_bss_params {
|
||||
uint8_t link_id;
|
||||
uint8_t ap_mld_mac[QDF_MAC_ADDR_SIZE];
|
||||
struct wlan_channel chan;
|
||||
};
|
||||
|
||||
#endif /* WLAN_FEATURE_11BE */
|
||||
|
||||
#ifdef WLAN_FEATURE_11BE_MLO
|
||||
|
@@ -3292,6 +3292,10 @@ QDF_STATUS (*send_mlo_link_state_request)(
|
||||
wmi_unified_t wmi_handle,
|
||||
struct wmi_host_link_state_params *params);
|
||||
|
||||
QDF_STATUS (*send_link_set_bss_params_cmd)(
|
||||
wmi_unified_t wmi_handle,
|
||||
struct wmi_host_link_bss_params *params);
|
||||
|
||||
QDF_STATUS (*extract_mlo_vdev_tid_to_link_map_event)(
|
||||
struct wmi_unified *wmi_handle,
|
||||
uint8_t *buf,
|
||||
|
@@ -115,6 +115,15 @@ QDF_STATUS wmi_send_mlo_link_state_request_cmd(
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
QDF_STATUS wmi_send_link_set_bss_params_cmd(
|
||||
wmi_unified_t wmi,
|
||||
struct wmi_host_link_bss_params *params)
|
||||
{
|
||||
if (wmi->ops->send_link_set_bss_params_cmd)
|
||||
return wmi->ops->send_link_set_bss_params_cmd(wmi, params);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
wmi_extract_mlo_vdev_tid_to_link_map_event(
|
||||
wmi_unified_t wmi, void *evt_buf,
|
||||
|
@@ -1598,6 +1598,77 @@ send_link_state_request_cmd_tlv(wmi_unified_t wmi_handle,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static QDF_STATUS
|
||||
send_link_set_bss_params_cmd_tlv(wmi_unified_t wmi_handle,
|
||||
struct wmi_host_link_bss_params *params)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
wmi_buf_t buf;
|
||||
wmi_mlo_set_link_bss_params_cmd_fixed_param *cmd;
|
||||
uint8_t *buf_ptr;
|
||||
wmi_mlo_link_bss_param *bss_param;
|
||||
WMI_HOST_WLAN_PHY_MODE fw_phy_mode;
|
||||
|
||||
size_t len = sizeof(*cmd) +
|
||||
sizeof(wmi_mlo_link_bss_param) +
|
||||
WMI_TLV_HDR_SIZE;
|
||||
|
||||
buf = wmi_buf_alloc(wmi_handle, len);
|
||||
if (!buf) {
|
||||
wmi_err("wmi_buf_alloc failed");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
buf_ptr = (uint8_t *)wmi_buf_data(buf);
|
||||
cmd =
|
||||
(wmi_mlo_set_link_bss_params_cmd_fixed_param *)buf_ptr;
|
||||
WMITLV_SET_HDR(
|
||||
&cmd->tlv_header,
|
||||
WMITLV_TAG_STRUC_wmi_mlo_set_link_bss_params_cmd_fixed_param,
|
||||
WMITLV_GET_STRUCT_TLVLEN(
|
||||
wmi_mlo_set_link_bss_params_cmd_fixed_param));
|
||||
|
||||
WMI_CHAR_ARRAY_TO_MAC_ADDR(params->ap_mld_mac, &cmd->ap_mld_macaddr);
|
||||
|
||||
buf_ptr += sizeof(wmi_mlo_set_link_bss_params_cmd_fixed_param);
|
||||
|
||||
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
|
||||
(sizeof(wmi_mlo_link_bss_param)));
|
||||
buf_ptr += WMI_TLV_HDR_SIZE;
|
||||
|
||||
bss_param =
|
||||
(wmi_mlo_link_bss_param *)buf_ptr;
|
||||
|
||||
WMITLV_SET_HDR(&bss_param->tlv_header,
|
||||
WMITLV_TAG_STRUC_wmi_mlo_link_bss_param,
|
||||
WMITLV_GET_STRUCT_TLVLEN(wmi_mlo_link_bss_param));
|
||||
|
||||
bss_param->ieee_link_id = params->link_id;
|
||||
|
||||
bss_param->wmi_chan.mhz = params->chan.ch_freq;
|
||||
bss_param->wmi_chan.band_center_freq1 = params->chan.ch_cfreq1;
|
||||
bss_param->wmi_chan.band_center_freq2 = params->chan.ch_cfreq2;
|
||||
fw_phy_mode = wmi_host_to_fw_phymode(params->chan.ch_phymode);
|
||||
WMI_SET_CHANNEL_MODE(&bss_param->wmi_chan, fw_phy_mode);
|
||||
wmi_debug("ap mld mac: " QDF_MAC_ADDR_FMT " link id %d chan freq %d cfreq1 %d cfreq2 %d fw phymode %d",
|
||||
QDF_MAC_ADDR_REF(params->ap_mld_mac), bss_param->ieee_link_id,
|
||||
bss_param->wmi_chan.mhz,
|
||||
bss_param->wmi_chan.band_center_freq1,
|
||||
bss_param->wmi_chan.band_center_freq2,
|
||||
fw_phy_mode);
|
||||
|
||||
buf_ptr += sizeof(wmi_mlo_link_bss_param);
|
||||
|
||||
wmi_mtrace(WMI_MLO_LINK_SET_BSS_PARAMS_CMDID, 0, 0);
|
||||
status = wmi_unified_cmd_send(wmi_handle, buf, len,
|
||||
WMI_MLO_LINK_SET_BSS_PARAMS_CMDID);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
wmi_err("Failed to send link set bss command ret = %d", status);
|
||||
wmi_buf_free(buf);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static QDF_STATUS
|
||||
extract_mlo_link_state_event_tlv(struct wmi_unified *wmi_handle,
|
||||
void *buf,
|
||||
@@ -2486,6 +2557,8 @@ void wmi_11be_attach_tlv(wmi_unified_t wmi_handle)
|
||||
send_mlo_vdev_tid_to_link_map_cmd_tlv;
|
||||
ops->send_mlo_link_state_request =
|
||||
send_link_state_request_cmd_tlv;
|
||||
ops->send_link_set_bss_params_cmd =
|
||||
send_link_set_bss_params_cmd_tlv;
|
||||
ops->extract_mlo_vdev_tid_to_link_map_event =
|
||||
extract_mlo_vdev_tid_to_link_map_event_tlv;
|
||||
ops->extract_mlo_vdev_bcast_tid_to_link_map_event =
|
||||
|
Atsaukties uz šo jaunā problēmā
Block a user