| From 7f0f9705e413d6a879b03e1989b7691e031ea2a0 Mon Sep 17 00:00:00 2001 |
| From: Michael-CY Lee <michael-cy.lee@mediatek.com> |
| Date: Fri, 17 May 2024 17:02:08 +0800 |
| Subject: [PATCH 091/126] mtk: hostapd: refactor the operating channel width |
| naming |
| |
| There are many data structures about channel width in hostapd. This |
| commit re-names the one which is used to describe the operating |
| channel width so that following commits can use other channel width |
| variables. |
| |
| Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com> |
| --- |
| wpa_supplicant/ucode.c | 24 ++++++++++++------------ |
| 1 file changed, 12 insertions(+), 12 deletions(-) |
| |
| diff --git a/wpa_supplicant/ucode.c b/wpa_supplicant/ucode.c |
| index 050bed6ae..bc5cf2ab9 100644 |
| --- a/wpa_supplicant/ucode.c |
| +++ b/wpa_supplicant/ucode.c |
| @@ -98,7 +98,7 @@ void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_d |
| { |
| const char *state; |
| uc_value_t *val; |
| - enum oper_chan_width ch_width; |
| + enum oper_chan_width oper_chwidth; |
| int control_freq, center_freq1, bw320_offset = 1, band_idx; |
| |
| if (event != EVENT_CH_SWITCH_STARTED && |
| @@ -129,27 +129,27 @@ void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_d |
| |
| switch (data->ch_switch.ch_width) { |
| case CHAN_WIDTH_80: |
| - ch_width = CONF_OPER_CHWIDTH_80MHZ; |
| + oper_chwidth = CONF_OPER_CHWIDTH_80MHZ; |
| break; |
| case CHAN_WIDTH_80P80: |
| - ch_width = CONF_OPER_CHWIDTH_80P80MHZ; |
| + oper_chwidth = CONF_OPER_CHWIDTH_80P80MHZ; |
| break; |
| case CHAN_WIDTH_160: |
| - ch_width = CONF_OPER_CHWIDTH_160MHZ; |
| + oper_chwidth = CONF_OPER_CHWIDTH_160MHZ; |
| break; |
| case CHAN_WIDTH_320: |
| - ch_width = CONF_OPER_CHWIDTH_320MHZ; |
| + oper_chwidth = CONF_OPER_CHWIDTH_320MHZ; |
| break; |
| case CHAN_WIDTH_20_NOHT: |
| case CHAN_WIDTH_20: |
| case CHAN_WIDTH_40: |
| default: |
| - ch_width = CONF_OPER_CHWIDTH_USE_HT; |
| + oper_chwidth = CONF_OPER_CHWIDTH_USE_HT; |
| break; |
| } |
| |
| /* Check bandwidth 320 MHz-2 */ |
| - if (ch_width == CONF_OPER_CHWIDTH_320MHZ && |
| + if (oper_chwidth == CONF_OPER_CHWIDTH_320MHZ && |
| (center_freq1 == 6265) || center_freq1 == 6585 || |
| center_freq1 == 6905) |
| bw320_offset = 2; |
| @@ -176,7 +176,7 @@ void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_d |
| ucv_object_add(val, "sec_chan_offset", ucv_int64_new(data->ch_switch.ch_offset)); |
| ucv_object_add(val, "center_freq1", ucv_int64_new(center_freq1)); |
| ucv_object_add(val, "center_freq2", ucv_int64_new(data->ch_switch.cf2)); |
| - ucv_object_add(val, "ch_width", ucv_int64_new(ch_width)); |
| + ucv_object_add(val, "ch_width", ucv_int64_new(oper_chwidth)); |
| ucv_object_add(val, "bw320_offset", ucv_int64_new(bw320_offset)); |
| ucv_object_add(val, "band_idx", ucv_int64_new(band_idx)); |
| } |
| @@ -274,7 +274,7 @@ 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 oper_chan_width ch_width = CONF_OPER_CHWIDTH_USE_HT; |
| + 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); |
| @@ -319,9 +319,9 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs) |
| |
| if (!ieee80211_chaninfo_to_channel(ci.frequency, ci.chanwidth, |
| sec_chan, &op_class, &channel)) |
| - ch_width = op_class_to_ch_width(op_class); |
| + oper_chwidth = op_class_to_ch_width(op_class); |
| |
| - if (ch_width == CONF_OPER_CHWIDTH_320MHZ && |
| + if (oper_chwidth == CONF_OPER_CHWIDTH_320MHZ && |
| (center_freq1 == 6265) || center_freq1 == 6585 || |
| center_freq1 == 6905) { |
| /* Bandwidth 320 MHz-2 */ |
| @@ -330,7 +330,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, "ch_width", ucv_int64_new(ch_width)); |
| + 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 |
| |