developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 1 | From c3f080cfa523b13726b223411cc1bf574000883b Mon Sep 17 00:00:00 2001 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 2 | From: Bo Jiao <Bo.Jiao@mediatek.com> |
| 3 | Date: Thu, 19 Oct 2023 13:38:11 +0800 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 4 | Subject: [PATCH 059/126] mtk: hostapd: initialize i802_bss's flink->freq with |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 5 | iface freq. |
| 6 | |
| 7 | Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com> |
| 8 | --- |
| 9 | src/ap/ap_drv_ops.c | 6 +++--- |
| 10 | src/ap/ap_drv_ops.h | 2 +- |
| 11 | src/ap/hostapd.c | 2 +- |
| 12 | src/drivers/driver.h | 2 +- |
| 13 | src/drivers/driver_nl80211.c | 4 ++-- |
| 14 | wpa_supplicant/driver_i.h | 2 +- |
| 15 | 6 files changed, 9 insertions(+), 9 deletions(-) |
| 16 | |
| 17 | diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 18 | index d4be02b77..011bb37f8 100644 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 19 | --- a/src/ap/ap_drv_ops.c |
| 20 | +++ b/src/ap/ap_drv_ops.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 21 | @@ -371,7 +371,7 @@ int hostapd_vlan_if_add(struct hostapd_data *hapd, const char *ifname) |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 22 | char force_ifname[IFNAMSIZ]; |
| 23 | u8 if_addr[ETH_ALEN]; |
| 24 | return hostapd_if_add(hapd, WPA_IF_AP_VLAN, ifname, hapd->own_addr, |
| 25 | - NULL, NULL, force_ifname, if_addr, NULL, 0); |
| 26 | + NULL, NULL, force_ifname, if_addr, NULL, 0, hapd->iface->freq); |
| 27 | } |
| 28 | |
| 29 | |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 30 | @@ -589,13 +589,13 @@ int hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len) |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 31 | int hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type, |
| 32 | const char *ifname, const u8 *addr, void *bss_ctx, |
| 33 | void **drv_priv, char *force_ifname, u8 *if_addr, |
| 34 | - const char *bridge, int use_existing) |
| 35 | + const char *bridge, int use_existing, int freq) |
| 36 | { |
| 37 | if (hapd->driver == NULL || hapd->driver->if_add == NULL) |
| 38 | return -1; |
| 39 | return hapd->driver->if_add(hapd->drv_priv, type, ifname, addr, |
| 40 | bss_ctx, drv_priv, force_ifname, if_addr, |
| 41 | - bridge, use_existing, 1); |
| 42 | + bridge, use_existing, 1, freq); |
| 43 | } |
| 44 | |
| 45 | |
| 46 | diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 47 | index 2ee4ebd04..8c783610c 100644 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 48 | --- a/src/ap/ap_drv_ops.h |
| 49 | +++ b/src/ap/ap_drv_ops.h |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 50 | @@ -61,7 +61,7 @@ int hostapd_set_ssid(struct hostapd_data *hapd, const u8 *buf, size_t len); |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 51 | int hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type, |
| 52 | const char *ifname, const u8 *addr, void *bss_ctx, |
| 53 | void **drv_priv, char *force_ifname, u8 *if_addr, |
| 54 | - const char *bridge, int use_existing); |
| 55 | + const char *bridge, int use_existing, int freq); |
| 56 | int hostapd_if_remove(struct hostapd_data *hapd, enum wpa_driver_if_type type, |
| 57 | const char *ifname); |
| 58 | int hostapd_if_link_remove(struct hostapd_data *hapd, |
| 59 | diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 60 | index 97bc4808e..f64f17ee6 100644 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 61 | --- a/src/ap/hostapd.c |
| 62 | +++ b/src/ap/hostapd.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 63 | @@ -1487,7 +1487,7 @@ int hostapd_setup_bss(struct hostapd_data *hapd, int first, bool start_beacon) |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 64 | conf->iface, addr, hapd, |
| 65 | &hapd->drv_priv, force_ifname, if_addr, |
| 66 | conf->bridge[0] ? conf->bridge : NULL, |
| 67 | - first == -1)) { |
| 68 | + first == -1, hapd->iface->freq)) { |
| 69 | wpa_printf(MSG_ERROR, "Failed to add BSS (BSSID=" |
| 70 | MACSTR ")", MAC2STR(hapd->own_addr)); |
| 71 | hapd->interface_added = 0; |
| 72 | diff --git a/src/drivers/driver.h b/src/drivers/driver.h |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 73 | index b24caae8a..8f5d260aa 100644 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 74 | --- a/src/drivers/driver.h |
| 75 | +++ b/src/drivers/driver.h |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 76 | @@ -3892,7 +3892,7 @@ struct wpa_driver_ops { |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 77 | int (*if_add)(void *priv, enum wpa_driver_if_type type, |
| 78 | const char *ifname, const u8 *addr, void *bss_ctx, |
| 79 | void **drv_priv, char *force_ifname, u8 *if_addr, |
| 80 | - const char *bridge, int use_existing, int setup_ap); |
| 81 | + const char *bridge, int use_existing, int setup_ap, int freq); |
| 82 | |
| 83 | /** |
| 84 | * if_remove - Remove a virtual interface |
| 85 | diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 86 | index 10e5c837b..7cb65a2bc 100644 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 87 | --- a/src/drivers/driver_nl80211.c |
| 88 | +++ b/src/drivers/driver_nl80211.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 89 | @@ -8869,7 +8869,7 @@ static int wpa_driver_nl80211_if_add(void *priv, enum wpa_driver_if_type type, |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 90 | void *bss_ctx, void **drv_priv, |
| 91 | char *force_ifname, u8 *if_addr, |
| 92 | const char *bridge, int use_existing, |
| 93 | - int setup_ap) |
| 94 | + int setup_ap, int freq) |
| 95 | { |
| 96 | enum nl80211_iftype nlmode; |
| 97 | struct i802_bss *bss = priv; |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 98 | @@ -8989,7 +8989,7 @@ static int wpa_driver_nl80211_if_add(void *priv, enum wpa_driver_if_type type, |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 99 | new_bss->valid_links = 0; |
| 100 | os_memcpy(new_bss->flink->addr, new_bss->addr, ETH_ALEN); |
| 101 | |
| 102 | - new_bss->flink->freq = drv->first_bss->flink->freq; |
| 103 | + new_bss->flink->freq = (freq == -1) ? drv->first_bss->flink->freq : freq; |
| 104 | new_bss->ctx = bss_ctx; |
| 105 | new_bss->added_if = added; |
| 106 | drv->first_bss->next = new_bss; |
| 107 | diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h |
| 108 | index 663e16053..624192ebd 100644 |
| 109 | --- a/wpa_supplicant/driver_i.h |
| 110 | +++ b/wpa_supplicant/driver_i.h |
| 111 | @@ -446,7 +446,7 @@ static inline int wpa_drv_if_add(struct wpa_supplicant *wpa_s, |
| 112 | if (wpa_s->driver->if_add) |
| 113 | return wpa_s->driver->if_add(wpa_s->drv_priv, type, ifname, |
| 114 | addr, bss_ctx, NULL, force_ifname, |
| 115 | - if_addr, bridge, 0, 0); |
| 116 | + if_addr, bridge, 0, 0, -1); |
| 117 | return -1; |
| 118 | } |
| 119 | |
| 120 | -- |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 121 | 2.18.0 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 122 | |