developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 1 | From b81e4dd857867be4af9bff4b698aec0edc333b34 Mon Sep 17 00:00:00 2001 |
| 2 | From: Michael-CY Lee <michael-cy.lee@mediatek.com> |
| 3 | Date: Fri, 17 May 2024 17:05:54 +0800 |
| 4 | Subject: [PATCH 092/126] mtk: hostapd: refactor legacy STA getting operating |
| 5 | channel information |
| 6 | |
| 7 | The refactor is for following MLO extension. |
| 8 | |
| 9 | Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com> |
| 10 | --- |
| 11 | wpa_supplicant/ucode.c | 10 +++++++--- |
| 12 | 1 file changed, 7 insertions(+), 3 deletions(-) |
| 13 | |
| 14 | diff --git a/wpa_supplicant/ucode.c b/wpa_supplicant/ucode.c |
| 15 | index bc5cf2ab9..d4b2160b6 100644 |
| 16 | --- a/wpa_supplicant/ucode.c |
| 17 | +++ b/wpa_supplicant/ucode.c |
| 18 | @@ -274,10 +274,12 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs) |
| 19 | uc_value_t *ret, *val, *link_obj = uc_fn_arg(0); |
| 20 | struct wpa_channel_info ci; |
| 21 | u8 op_class, channel; |
| 22 | + enum chan_width chwidth; |
| 23 | enum oper_chan_width oper_chwidth = CONF_OPER_CHWIDTH_USE_HT; |
| 24 | int center_freq1, bw320_offset = 1, is_24ghz, band_idx; |
| 25 | enum hostapd_hw_mode hw_mode; |
| 26 | int link_id = ucv_int64_get(link_obj); |
| 27 | + u32 freq; |
| 28 | |
| 29 | if (!wpa_s) |
| 30 | return NULL; |
| 31 | @@ -308,7 +310,9 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs) |
| 32 | band_idx = 2; |
| 33 | |
| 34 | wpa_drv_channel_info(wpa_s, &ci); |
| 35 | + freq = ci.frequency; |
| 36 | center_freq1 = ci.center_frq1; |
| 37 | + chwidth=ci.chanwidth; |
| 38 | |
| 39 | if (bss->freq != center_freq1) { |
| 40 | if (is_24ghz) |
| 41 | @@ -317,8 +321,8 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs) |
| 42 | sec_chan = (bss->freq / 20) & 1 ? 1 : -1; |
| 43 | } |
| 44 | |
| 45 | - if (!ieee80211_chaninfo_to_channel(ci.frequency, ci.chanwidth, |
| 46 | - sec_chan, &op_class, &channel)) |
| 47 | + if (!ieee80211_chaninfo_to_channel(freq, chwidth, sec_chan, |
| 48 | + &op_class, &channel)) |
| 49 | oper_chwidth = op_class_to_ch_width(op_class); |
| 50 | |
| 51 | if (oper_chwidth == CONF_OPER_CHWIDTH_320MHZ && |
| 52 | @@ -329,7 +333,7 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs) |
| 53 | } |
| 54 | |
| 55 | ucv_object_add(ret, "sec_chan_offset", ucv_int64_new(sec_chan)); |
| 56 | - ucv_object_add(ret, "frequency", ucv_int64_new(bss->freq)); |
| 57 | + ucv_object_add(ret, "frequency", ucv_int64_new(freq)); |
| 58 | ucv_object_add(ret, "ch_width", ucv_int64_new(oper_chwidth)); |
| 59 | ucv_object_add(ret, "bw320_offset", ucv_int64_new(bw320_offset)); |
| 60 | ucv_object_add(ret, "band_idx", ucv_int64_new(band_idx)); |
| 61 | -- |
| 62 | 2.18.0 |
| 63 | |