developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 1 | From 7f0f9705e413d6a879b03e1989b7691e031ea2a0 Mon Sep 17 00:00:00 2001 |
| 2 | From: Michael-CY Lee <michael-cy.lee@mediatek.com> |
| 3 | Date: Fri, 17 May 2024 17:02:08 +0800 |
| 4 | Subject: [PATCH 091/126] mtk: hostapd: refactor the operating channel width |
| 5 | naming |
| 6 | |
| 7 | There are many data structures about channel width in hostapd. This |
| 8 | commit re-names the one which is used to describe the operating |
| 9 | channel width so that following commits can use other channel width |
| 10 | variables. |
| 11 | |
| 12 | Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com> |
| 13 | --- |
| 14 | wpa_supplicant/ucode.c | 24 ++++++++++++------------ |
| 15 | 1 file changed, 12 insertions(+), 12 deletions(-) |
| 16 | |
| 17 | diff --git a/wpa_supplicant/ucode.c b/wpa_supplicant/ucode.c |
| 18 | index 050bed6ae..bc5cf2ab9 100644 |
| 19 | --- a/wpa_supplicant/ucode.c |
| 20 | +++ b/wpa_supplicant/ucode.c |
| 21 | @@ -98,7 +98,7 @@ void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_d |
| 22 | { |
| 23 | const char *state; |
| 24 | uc_value_t *val; |
| 25 | - enum oper_chan_width ch_width; |
| 26 | + enum oper_chan_width oper_chwidth; |
| 27 | int control_freq, center_freq1, bw320_offset = 1, band_idx; |
| 28 | |
| 29 | if (event != EVENT_CH_SWITCH_STARTED && |
| 30 | @@ -129,27 +129,27 @@ void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_d |
| 31 | |
| 32 | switch (data->ch_switch.ch_width) { |
| 33 | case CHAN_WIDTH_80: |
| 34 | - ch_width = CONF_OPER_CHWIDTH_80MHZ; |
| 35 | + oper_chwidth = CONF_OPER_CHWIDTH_80MHZ; |
| 36 | break; |
| 37 | case CHAN_WIDTH_80P80: |
| 38 | - ch_width = CONF_OPER_CHWIDTH_80P80MHZ; |
| 39 | + oper_chwidth = CONF_OPER_CHWIDTH_80P80MHZ; |
| 40 | break; |
| 41 | case CHAN_WIDTH_160: |
| 42 | - ch_width = CONF_OPER_CHWIDTH_160MHZ; |
| 43 | + oper_chwidth = CONF_OPER_CHWIDTH_160MHZ; |
| 44 | break; |
| 45 | case CHAN_WIDTH_320: |
| 46 | - ch_width = CONF_OPER_CHWIDTH_320MHZ; |
| 47 | + oper_chwidth = CONF_OPER_CHWIDTH_320MHZ; |
| 48 | break; |
| 49 | case CHAN_WIDTH_20_NOHT: |
| 50 | case CHAN_WIDTH_20: |
| 51 | case CHAN_WIDTH_40: |
| 52 | default: |
| 53 | - ch_width = CONF_OPER_CHWIDTH_USE_HT; |
| 54 | + oper_chwidth = CONF_OPER_CHWIDTH_USE_HT; |
| 55 | break; |
| 56 | } |
| 57 | |
| 58 | /* Check bandwidth 320 MHz-2 */ |
| 59 | - if (ch_width == CONF_OPER_CHWIDTH_320MHZ && |
| 60 | + if (oper_chwidth == CONF_OPER_CHWIDTH_320MHZ && |
| 61 | (center_freq1 == 6265) || center_freq1 == 6585 || |
| 62 | center_freq1 == 6905) |
| 63 | bw320_offset = 2; |
| 64 | @@ -176,7 +176,7 @@ void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_d |
| 65 | ucv_object_add(val, "sec_chan_offset", ucv_int64_new(data->ch_switch.ch_offset)); |
| 66 | ucv_object_add(val, "center_freq1", ucv_int64_new(center_freq1)); |
| 67 | ucv_object_add(val, "center_freq2", ucv_int64_new(data->ch_switch.cf2)); |
| 68 | - ucv_object_add(val, "ch_width", ucv_int64_new(ch_width)); |
| 69 | + ucv_object_add(val, "ch_width", ucv_int64_new(oper_chwidth)); |
| 70 | ucv_object_add(val, "bw320_offset", ucv_int64_new(bw320_offset)); |
| 71 | ucv_object_add(val, "band_idx", ucv_int64_new(band_idx)); |
| 72 | } |
| 73 | @@ -274,7 +274,7 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs) |
| 74 | uc_value_t *ret, *val, *link_obj = uc_fn_arg(0); |
| 75 | struct wpa_channel_info ci; |
| 76 | u8 op_class, channel; |
| 77 | - enum oper_chan_width ch_width = CONF_OPER_CHWIDTH_USE_HT; |
| 78 | + enum oper_chan_width oper_chwidth = CONF_OPER_CHWIDTH_USE_HT; |
| 79 | int center_freq1, bw320_offset = 1, is_24ghz, band_idx; |
| 80 | enum hostapd_hw_mode hw_mode; |
| 81 | int link_id = ucv_int64_get(link_obj); |
| 82 | @@ -319,9 +319,9 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs) |
| 83 | |
| 84 | if (!ieee80211_chaninfo_to_channel(ci.frequency, ci.chanwidth, |
| 85 | sec_chan, &op_class, &channel)) |
| 86 | - ch_width = op_class_to_ch_width(op_class); |
| 87 | + oper_chwidth = op_class_to_ch_width(op_class); |
| 88 | |
| 89 | - if (ch_width == CONF_OPER_CHWIDTH_320MHZ && |
| 90 | + if (oper_chwidth == CONF_OPER_CHWIDTH_320MHZ && |
| 91 | (center_freq1 == 6265) || center_freq1 == 6585 || |
| 92 | center_freq1 == 6905) { |
| 93 | /* Bandwidth 320 MHz-2 */ |
| 94 | @@ -330,7 +330,7 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs) |
| 95 | |
| 96 | ucv_object_add(ret, "sec_chan_offset", ucv_int64_new(sec_chan)); |
| 97 | ucv_object_add(ret, "frequency", ucv_int64_new(bss->freq)); |
| 98 | - ucv_object_add(ret, "ch_width", ucv_int64_new(ch_width)); |
| 99 | + ucv_object_add(ret, "ch_width", ucv_int64_new(oper_chwidth)); |
| 100 | ucv_object_add(ret, "bw320_offset", ucv_int64_new(bw320_offset)); |
| 101 | ucv_object_add(ret, "band_idx", ucv_int64_new(band_idx)); |
| 102 | } |
| 103 | -- |
| 104 | 2.18.0 |
| 105 | |