developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 1 | From f046d62580187077b4d75c3e5f183a8ad8ad9079 Mon Sep 17 00:00:00 2001 |
| 2 | From: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 3 | Date: Tue, 6 Aug 2024 10:11:22 +0800 |
| 4 | Subject: [PATCH 123/126] mtk: hostapd: add puncture bitmap to ucode |
| 5 | |
| 6 | Add puncture bitmap to ucode since fw might trigger channel switch due |
| 7 | to pp bitmap change. |
| 8 | Therefore, the changed pp bitmap should be synchronized to extender's AP |
| 9 | when root AP changes its pp bitmap. |
| 10 | |
| 11 | Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 12 | --- |
| 13 | src/ap/ucode.c | 4 ++++ |
| 14 | src/utils/ucode.c | 2 ++ |
| 15 | wpa_supplicant/ucode.c | 1 + |
| 16 | 3 files changed, 7 insertions(+) |
| 17 | |
| 18 | diff --git a/src/ap/ucode.c b/src/ap/ucode.c |
| 19 | index 8c05404f5..0c6f4043c 100644 |
| 20 | --- a/src/ap/ucode.c |
| 21 | +++ b/src/ap/ucode.c |
| 22 | @@ -726,6 +726,8 @@ uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs) |
| 23 | csa.freq_params.center_freq1 = intval; |
| 24 | if ((intval = ucv_int64_get(ucv_object_get(info, "center_freq2", NULL))) && !errno) |
| 25 | csa.freq_params.center_freq2 = intval; |
| 26 | + if ((intval = ucv_int64_get(ucv_object_get(info, "punct_bitmap", NULL))) && !errno) |
| 27 | + csa.freq_params.punct_bitmap = intval; |
| 28 | |
| 29 | intval = ucv_int64_get(ucv_object_get(info, "band_idx", NULL)); |
| 30 | band_idx = errno ? iface->conf->band_idx : intval; |
| 31 | @@ -740,6 +742,8 @@ uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs) |
| 32 | csa.freq_params.center_freq1); |
| 33 | wpa_printf(MSG_INFO, " * center_freq2 is %d\n", |
| 34 | csa.freq_params.center_freq2); |
| 35 | + wpa_printf(MSG_INFO, " * punct_bitmap is %d\n", |
| 36 | + csa.freq_params.punct_bitmap); |
| 37 | wpa_printf(MSG_INFO, " * band_idx is %d\n", |
| 38 | band_idx); |
| 39 | |
| 40 | diff --git a/src/utils/ucode.c b/src/utils/ucode.c |
| 41 | index 8bbbbbeff..c688d9bee 100644 |
| 42 | --- a/src/utils/ucode.c |
| 43 | +++ b/src/utils/ucode.c |
| 44 | @@ -110,6 +110,7 @@ uc_value_t *uc_wpa_freq_info(uc_vm_t *vm, size_t nargs) |
| 45 | uc_value_t *freq = uc_fn_arg(0); |
| 46 | uc_value_t *sec = uc_fn_arg(1); |
| 47 | int width = ucv_uint64_get(uc_fn_arg(2)); |
| 48 | + int punct_bitmap = ucv_uint64_get(uc_fn_arg(5)); |
| 49 | int bw320_offset = 1, band_idx; |
| 50 | int freq_val, center_idx, center_ofs; |
| 51 | enum oper_chan_width chanwidth; |
| 52 | @@ -185,6 +186,7 @@ uc_value_t *uc_wpa_freq_info(uc_vm_t *vm, size_t nargs) |
| 53 | ucv_object_add(ret, "frequency", ucv_int64_new(freq_val)); |
| 54 | ucv_object_add(ret, "oper_chwidth", ucv_int64_new(chanwidth)); |
| 55 | ucv_object_add(ret, "band_idx", ucv_int64_new(band_idx)); |
| 56 | + ucv_object_add(ret, "punct_bitmap", ucv_int64_new(punct_bitmap)); |
| 57 | |
| 58 | if (chanwidth == CONF_OPER_CHWIDTH_USE_HT) { |
| 59 | center_idx = freq_val < 3000 ? 0 : channel; |
| 60 | diff --git a/wpa_supplicant/ucode.c b/wpa_supplicant/ucode.c |
| 61 | index 450780737..124038def 100644 |
| 62 | --- a/wpa_supplicant/ucode.c |
| 63 | +++ b/wpa_supplicant/ucode.c |
| 64 | @@ -178,6 +178,7 @@ void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_d |
| 65 | ucv_object_add(val, "center_freq2", ucv_int64_new(data->ch_switch.cf2)); |
| 66 | ucv_object_add(val, "ch_width", ucv_int64_new(oper_chwidth)); |
| 67 | ucv_object_add(val, "bw320_offset", ucv_int64_new(bw320_offset)); |
| 68 | + ucv_object_add(val, "punct_bitmap", ucv_int64_new(data->ch_switch.punct_bitmap)); |
| 69 | ucv_object_add(val, "band_idx", ucv_int64_new(band_idx)); |
| 70 | } |
| 71 | |
| 72 | -- |
| 73 | 2.18.0 |
| 74 | |