qcacmn: Add support to send chan info for standby link

As per new requirement, host should send proper values
to get_channel request from upper layer for standby link.

Upper layer can use these information to fetch CU values
for standby link and print on console.

Change-Id: I045b8c5a3035f96e55281bd31d3e0b8043df4cb7
CRs-Fixed: 3719534
This commit is contained in:
Abhinav Kumar
2024-01-29 06:49:22 -08:00
committed by Ravindra Konda
parent 784c8b910d
commit 0e88ed7844
4 changed files with 53 additions and 6 deletions

View File

@@ -50,6 +50,7 @@
#ifdef CONNECTIVITY_DIAG_EVENT #ifdef CONNECTIVITY_DIAG_EVENT
#include "wlan_connectivity_logging.h" #include "wlan_connectivity_logging.h"
#endif #endif
#include "wlan_mlme_api.h"
void void
cm_fill_failure_resp_from_cm_id(struct cnx_mgr *cm_ctx, cm_fill_failure_resp_from_cm_id(struct cnx_mgr *cm_ctx,
@@ -2956,23 +2957,30 @@ static void cm_update_link_channel_info(struct wlan_objmgr_vdev *vdev,
struct wlan_channel channel; struct wlan_channel channel;
pdev = wlan_vdev_get_pdev(vdev); pdev = wlan_vdev_get_pdev(vdev);
cache_entry = wlan_scan_get_scan_entry_by_mac_freq(pdev, mac_addr, cache_entry = wlan_scan_get_scan_entry_by_mac_freq(pdev, mac_addr,
freq); freq);
if (!cache_entry) { if (!cache_entry) {
mlme_debug("not found the mac_addr from scan entry"); mlme_debug("not found the mac_addr from scan entry");
return; return;
} }
link_id = wlan_vdev_get_link_id(vdev);
link_id = wlan_vdev_get_link_id(vdev);
channel.ch_freq = cache_entry->channel.chan_freq; channel.ch_freq = cache_entry->channel.chan_freq;
channel.ch_ieee = wlan_reg_freq_to_chan(pdev, channel.ch_freq); channel.ch_ieee = wlan_reg_freq_to_chan(pdev, channel.ch_freq);
channel.ch_phymode = cache_entry->phy_mode; channel.ch_phymode = cache_entry->phy_mode;
channel.ch_cfreq1 = cache_entry->channel.cfreq0; channel.ch_cfreq1 = cache_entry->channel.cfreq0;
channel.ch_cfreq2 = cache_entry->channel.cfreq1; channel.ch_cfreq2 = cache_entry->channel.cfreq1;
channel.ch_width =
wlan_mlme_get_ch_width_from_phymode(cache_entry->phy_mode);
/*
* Supplicant needs non zero center_freq1 in case of 20 MHz connection
* also as a response of get_channel request. In case of 20 MHz channel
* width central frequency is same as channel frequency
*/
if (channel.ch_width == CH_WIDTH_20MHZ)
channel.ch_cfreq1 = channel.ch_freq;
util_scan_free_cache_entry(cache_entry); util_scan_free_cache_entry(cache_entry);
mlo_mgr_update_ap_channel_info(vdev, link_id, (uint8_t *)mac_addr, mlo_mgr_update_ap_channel_info(vdev, link_id, (uint8_t *)mac_addr,
channel); channel);
} }

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2021, The Linux Foundation. All rights reserved. * Copyright (c) 2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@@ -1241,4 +1241,25 @@ mlo_is_chan_switch_in_progress(struct wlan_objmgr_vdev *vdev)
return false; return false;
} }
#endif #endif
#ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
/**
* mlo_mgr_get_per_link_chan_info: Get wlan channel info per link id
* @vdev: vdev obj
* @link_id: link id
* @chan_info: wlan channel info buffer
*
* Return: zero for success, non-zero for failure
*/
int mlo_mgr_get_per_link_chan_info(struct wlan_objmgr_vdev *vdev, int link_id,
struct wlan_channel *chan_info);
#else
static inline int
mlo_mgr_get_per_link_chan_info(struct wlan_objmgr_vdev *vdev, int link_id,
struct wlan_channel *chan_info)
{
return -EINVAL;
}
#endif
#endif #endif

View File

@@ -137,10 +137,10 @@ void mlo_mgr_update_ap_channel_info(struct wlan_objmgr_vdev *vdev, uint8_t link_
qdf_mem_copy(link_info->link_chan_info, &channel, qdf_mem_copy(link_info->link_chan_info, &channel,
sizeof(*link_info->link_chan_info)); sizeof(*link_info->link_chan_info));
mlo_debug("Update AP Channel info link_id: %d, vdev_id:%d, link_addr:" QDF_MAC_ADDR_FMT, mlo_debug("update AP channel info link_id: %d, vdev_id:%d, link_addr:" QDF_MAC_ADDR_FMT,
link_info->link_id, link_info->vdev_id, link_info->link_id, link_info->vdev_id,
QDF_MAC_ADDR_REF(link_info->ap_link_addr.bytes)); QDF_MAC_ADDR_REF(link_info->ap_link_addr.bytes));
mlo_debug("Ch_freq: %d, freq1: %d, freq2: %d phy_mode: %d", mlo_debug("ch_freq: %d, freq1: %d, freq2: %d, phy_mode: %d",
link_info->link_chan_info->ch_freq, link_info->link_chan_info->ch_freq,
link_info->link_chan_info->ch_cfreq1, link_info->link_chan_info->ch_cfreq1,
link_info->link_chan_info->ch_cfreq2, link_info->link_chan_info->ch_cfreq2,

View File

@@ -316,6 +316,24 @@ static void mlo_free_copied_conn_req(struct wlan_mlo_sta *sta_ctx)
} }
#ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE #ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
int mlo_mgr_get_per_link_chan_info(struct wlan_objmgr_vdev *vdev, int link_id,
struct wlan_channel *chan_info)
{
struct mlo_link_info *ml_link_info;
ml_link_info = mlo_mgr_get_ap_link_by_link_id(vdev->mlo_dev_ctx,
link_id);
if (!ml_link_info) {
mlo_debug("ml_link_info null for link_id: %d", link_id);
return -EINVAL;
}
qdf_mem_copy(chan_info, ml_link_info->link_chan_info,
sizeof(*chan_info));
return 0;
}
static QDF_STATUS static QDF_STATUS
mlo_validate_connect_req(struct wlan_objmgr_vdev *vdev, mlo_validate_connect_req(struct wlan_objmgr_vdev *vdev,
struct wlan_mlo_dev_context *mlo_dev_ctx, struct wlan_mlo_dev_context *mlo_dev_ctx,