blob: ecd524f2928638a03a12a81136bbf1be0de418d2 [file] [log] [blame]
From b81e4dd857867be4af9bff4b698aec0edc333b34 Mon Sep 17 00:00:00 2001
From: Michael-CY Lee <michael-cy.lee@mediatek.com>
Date: Fri, 17 May 2024 17:05:54 +0800
Subject: [PATCH 092/126] mtk: hostapd: refactor legacy STA getting operating
channel information
The refactor is for following MLO extension.
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
---
wpa_supplicant/ucode.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/wpa_supplicant/ucode.c b/wpa_supplicant/ucode.c
index bc5cf2ab9..d4b2160b6 100644
--- a/wpa_supplicant/ucode.c
+++ b/wpa_supplicant/ucode.c
@@ -274,10 +274,12 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs)
uc_value_t *ret, *val, *link_obj = uc_fn_arg(0);
struct wpa_channel_info ci;
u8 op_class, channel;
+ enum chan_width chwidth;
enum oper_chan_width oper_chwidth = CONF_OPER_CHWIDTH_USE_HT;
int center_freq1, bw320_offset = 1, is_24ghz, band_idx;
enum hostapd_hw_mode hw_mode;
int link_id = ucv_int64_get(link_obj);
+ u32 freq;
if (!wpa_s)
return NULL;
@@ -308,7 +310,9 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs)
band_idx = 2;
wpa_drv_channel_info(wpa_s, &ci);
+ freq = ci.frequency;
center_freq1 = ci.center_frq1;
+ chwidth=ci.chanwidth;
if (bss->freq != center_freq1) {
if (is_24ghz)
@@ -317,8 +321,8 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs)
sec_chan = (bss->freq / 20) & 1 ? 1 : -1;
}
- if (!ieee80211_chaninfo_to_channel(ci.frequency, ci.chanwidth,
- sec_chan, &op_class, &channel))
+ if (!ieee80211_chaninfo_to_channel(freq, chwidth, sec_chan,
+ &op_class, &channel))
oper_chwidth = op_class_to_ch_width(op_class);
if (oper_chwidth == CONF_OPER_CHWIDTH_320MHZ &&
@@ -329,7 +333,7 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs)
}
ucv_object_add(ret, "sec_chan_offset", ucv_int64_new(sec_chan));
- ucv_object_add(ret, "frequency", ucv_int64_new(bss->freq));
+ ucv_object_add(ret, "frequency", ucv_int64_new(freq));
ucv_object_add(ret, "ch_width", ucv_int64_new(oper_chwidth));
ucv_object_add(ret, "bw320_offset", ucv_int64_new(bw320_offset));
ucv_object_add(ret, "band_idx", ucv_int64_new(band_idx));
--
2.18.0