8e6485a1bcb0 PEAP client: Update Phase 2 authentication requirements de9a11f4dde9 TTLS client: Support phase2_auth=2 b2a1e7fe7ab9 tests: PEAP and TTLS phase2_auth behavior 518ae8c7cca8 P2P: Do not print control characters in debug a4c133ea73c7 WPS: Optimize attribute parsing workaround 7a37a94eaa0d Check whether element parsing has failed f80d83368818 ACS: Remove invalid debug print fb2b7858a728 FILS: Fix HE MCS field initialization 50ee26fc7044 P2P: Check p2p_channel_select() return value a50d1ea6a2b3 Add QCA vendor attributes for user defined power save parameters 4636476b7f22 Set RRM used config if the (Re)Association Request frame has RRM IE e53d44ac63e8 AP MLD: Use STA assoc link address in external auth status to the driver 99a96b2f9df7 AP MLD: OWE when SME is offloaded to the driver 96deacf5d710 nl80211: Skip STA MLO link channel switch handling in AP mode d320692d918a AP MLD: Handle new STA event when using SME offload to the driver faee8b99e928 tests: Fix eht_mld_sae_legacy_client to restore sae_pwe c3f465c56c94 wlantest: Handle variable length MIC field in EAPOL-Key with OWE 605034240e0c wlantest: Support multiple input files 053bd8af8ed2 Recognize FTE MLO subelements 43b5f11d969a Defragmentation of FTE 3973300b8ded FTE protected element check for MLO Reassociation Response frame 74e4a0a6f1e4 wlantest: Learn AP MLD MAC address from Beacon frames a5a0b2cf7b1b wlantest: Find non-AP MLD only from affiliated BSSs of the AP MLD 74472758584d wlantest: Recognize non-AP MLD based on any link address for decryption 1ffabd697c67 wlantest: Learn non-AP MLD MAC address from (Re)Association Request frames 4e8e515f92b9 wlantest: Use MLO search for the STA in reassociation 49bf9f2df95a wlantest: Use the MLD MAC address as well for matching STA entries 5434a42ec69c wlantest: Search for FT Target AP using MLD MAC address as well a19fcf685cae wlantest: Include the MLD MAC address of the AP MLD in new-STA prints 709d46da73da wlantest: Do not claim update to AP MD MAC address if no change 770760454f9e wlantest: Do not update BSS entries for other AP MLDs in PTK cloning 084745ffc508 Add QCA vendor attributes for NDP setup bf9cbb462fd9 Fix writing of BIGTK in FT protocol 011775af9443 tests: Check for beacon loss when using beacon protection 8f148d51322f Fix a compiler warning on prototype mismatch b7db495ad9c9 AP: Fix ieee802_1x_ml_set_sta_authorized() 232667eafe0d Fix CCMP test vector issues 30771e6e05ed Include PTID in PV1 nonce construction for CCMP test vector 34841cfd9aba Minor formatting changes to CCMP test vectors a685d84139e6 BSS coloring: Fix CCA with multiple BSS bc0636841a70 wpa_supplicant: Fix configuration parsing error for tx_queue_* 2763d1d97e66 hostapd: Fix AID assignment in multiple BSSID 763a19286e2f AP: Add configuration option to specify the desired MLD address bd209633eb10 AP: Use is_zero_ether_addr() to check if BSSID is NULL bc0268d053b4 wlantest: Guess SAE/OWE group from EAPOL-Key length mismatch a94ba5322803 EHT: Support puncturing for 320 MHz channel bandwidth 7e1f5c44c97e EHT: 320 MHz DFS support 6f293b32112a QCA vendor attributes for updating roaming AP BSSID info 5856373554eb Extend QCA vendor command to include more parameters for netdev events e080930aa0a5 Define QCA vendor roam control RSSI attributes fe72afe713ad Define QCA vendor attribute for high RSSI roam trigger threshold 47a65ccbfde2 P2P: Clean wpa_s->last_ssid when removing a temporary group network 884125ab7d21 tests: P2P autonomous GO and clearing of networking information 7637d0f25053 P2P: Do not filter pref_freq_list if the driver does not provide one dd1330b502ff Fix hostapd interface cleanup with multiple interfaces 0a6842d5030e nl80211: Fix beacon rate configuration for legacy rates 36, 48, 54 Mbps d606efe054d5 tests: Beacon rate configuration for 54 Mbps f91d10c0e6aa tests: Update RSA 3k certificates 07d3c1177bbb tests: Make sae_proto_hostapd_status_* more robust 1085e3bdc6f6 Update iface->current_mode when fetching new hw_features 338a78846b44 Add a QCA vendor sub command for transmit latency statistics 9318db7c38bc wlantest: Use local variables for AA/SPA in FT Request/Response processing 628b9f10223d wlantest: Derive PMK-R1 and PTK using AA/SPA for MLO FT over-the-DS 104aa291e5c8 wlantest: Fix FT over-the-DS decryption 37c87efecfe3 wlantest: Search SPA using MLO aware find for FT Request/Response frame 19f33d7929e8 wlantest: Learn the Link ID for AP MLD affiliated BSSs 6ae43bb10323 wlantest: Learn link address for assoc link from (Re)Association Request 4c079dcc64da Increment hmac_sha*_vector() maximum num_elem value to 25 e6f64a8e1daf FT: FTE MIC calculation for MLO Reassociation Request frame a83575df5994 wlantest: FTE MIC calculation for MLO Reassociation Request frames ff02f734baf8 wlantest: Allow specific link BSS to be found with bss_find_mld() 7381c60db8f0 FT: Make FTE MIC calculation more flexible ac9bf1cc2a4c Decrement hmac_sha*_vector() maximum num_elem value to 11 aa08d9d76803 Fix use of defragmented FTE information 78b153f90a74 Calculate defragmented FTE length during IE parsing 8cf919ffd5c4 wlantest: FTE MIC calculation for MLO Reassociation Response frame d12a3dce82a9 wlantest: Store and check SNonce/ANonce for FT Authentication 20febfd7838d wlantest: Dump MLO association information in debug 609864d6a8a1 Add QCA vendor attribute to configure MLD ID in ML probe request 12154861e24a Add support for conversion to little endian for 24 bits c437665041c0 Add Non EHT SCS Capability in (Re)Association Request frames 33da386553b7 SCS: Add support for QoS Characteristics in SCS request edfca280cbe8 SCS: Add support for optional QoS Charateristics parameters 32dcec9529ec Send actual MFP configuration when driver takes care of BSS selection 123d16d860fa Update hw_mode when CSA finishes b3d852560bda Change QCA vendor configure attribution name of peer MAC address 12fabc4765c2 Add QCA vendor attribute for configuring max A-MPDU aggregation count f6eaa7b729cb Add QCA vendor attribute for TTLM negotiation support type f6dcd326fea7 wlantest: Indicate ToDS/FromDS values for BSS DATA entries 6ce745bb87d4 wlantest: MLO support for decrypting 4-address frames 850dc1482953 wlantest: Remove duplicated A1/A2/A3 override detection for MLO 770e5a808fbb wlantest: Determine whether A1 points to STA once in rx_data_bss_prot() 377d617b574a Define new BSS command info mask for AP MLD address d3ab6e001f62 wlantest: Use non-AP MLD's MLD MAC address in FT over-the-air derivation a845601ffe32 wlantest: Derive PTK in MLO using MLD MAC addresses for FT over-the-air 0cd2bfc8a402 wlantest: Fix FTE MIC calculation for MLO Reassociation Response frames 528abdeb673b wlantest: Learn group keys from MLO FT Reassociation Response frames 990600753dd9 wlantest: Defragment Basic MLE before processing de043ec01ab5 wlantest: Defragment the Per-STA Profile subelement bae1ec693c44 wlantest: Minimal parsing of Basic MLE STA Profile ba1579f3bf7c Clear BIGTK values from wpa_supplicant state machine when not needed b46c4b9a916a tests: Beacon protection and reconnection 3e71516936b7 Document per-ESS MAC address (mac_addr=3 and mac_value) f85b2b2dee3b Extend wpa_parse_kde_ies() to include EHT capabilities e3a68081bc1e driver: Add option for link ID to be specified for send_tdls_mgmt() c7561502f2e8 nl80211: Use a QCA vendor command to set the link for TDLS Discovery Response a41c8dbdd84e TDLS: Copy peer's EHT capabilities 626501434be1 TDLS: Learn MLD link ID from TDLS Discovery Response 5f30f62eead7 TDLS: Reply to Discovery Request on the link with matching BSSID 940ef9a05c0f TDLS: Use link-specific BSSID instead of sm->bssid for MLO cases f429064189c3 TDLS: Set EHT/MLO information for TDLS STA into the driver dd25885a9daa Remove space-before-tab in QCA vendor related definitions af6e0306b2a9 Fix typos in QCA vendor related definitions 4c9af238c1e4 Fix inconsistent whitespace use in QCA vendor related definitions e5ccbfc69ecf Split long comment lines in QCA vendor related definitions Signed-off-by: Felix Fietkau <nbd@nbd.name>
544 lines
16 KiB
Diff
544 lines
16 KiB
Diff
--- a/hostapd/Makefile
|
|
+++ b/hostapd/Makefile
|
|
@@ -168,9 +168,21 @@ OBJS += ../src/eapol_auth/eapol_auth_sm.
|
|
|
|
ifdef CONFIG_UBUS
|
|
CFLAGS += -DUBUS_SUPPORT
|
|
-OBJS += ../src/utils/uloop.o
|
|
OBJS += ../src/ap/ubus.o
|
|
-LIBS += -lubox -lubus
|
|
+LIBS += -lubus
|
|
+NEED_ULOOP:=y
|
|
+endif
|
|
+
|
|
+ifdef CONFIG_UCODE
|
|
+CFLAGS += -DUCODE_SUPPORT
|
|
+OBJS += ../src/utils/ucode.o
|
|
+OBJS += ../src/ap/ucode.o
|
|
+NEED_ULOOP:=y
|
|
+endif
|
|
+
|
|
+ifdef NEED_ULOOP
|
|
+OBJS += ../src/utils/uloop.o
|
|
+LIBS += -lubox
|
|
endif
|
|
|
|
ifdef CONFIG_CODE_COVERAGE
|
|
--- a/hostapd/main.c
|
|
+++ b/hostapd/main.c
|
|
@@ -1007,6 +1007,7 @@ int main(int argc, char *argv[])
|
|
}
|
|
|
|
hostapd_global_ctrl_iface_init(&interfaces);
|
|
+ hostapd_ucode_init(&interfaces);
|
|
|
|
if (hostapd_global_run(&interfaces, daemonize, pid_file)) {
|
|
wpa_printf(MSG_ERROR, "Failed to start eloop");
|
|
@@ -1016,6 +1017,7 @@ int main(int argc, char *argv[])
|
|
ret = 0;
|
|
|
|
out:
|
|
+ hostapd_ucode_free();
|
|
hostapd_global_ctrl_iface_deinit(&interfaces);
|
|
/* Deinitialize all interfaces */
|
|
for (i = 0; i < interfaces.count; i++) {
|
|
--- a/src/ap/hostapd.h
|
|
+++ b/src/ap/hostapd.h
|
|
@@ -19,6 +19,7 @@
|
|
#include "ap_config.h"
|
|
#include "drivers/driver.h"
|
|
#include "ubus.h"
|
|
+#include "ucode.h"
|
|
|
|
#define OCE_STA_CFON_ENABLED(hapd) \
|
|
((hapd->conf->oce & OCE_STA_CFON) && \
|
|
@@ -51,6 +52,10 @@ struct hapd_interfaces {
|
|
struct hostapd_config * (*config_read_cb)(const char *config_fname);
|
|
int (*ctrl_iface_init)(struct hostapd_data *hapd);
|
|
void (*ctrl_iface_deinit)(struct hostapd_data *hapd);
|
|
+ int (*ctrl_iface_recv)(struct hostapd_data *hapd,
|
|
+ char *buf, char *reply, int reply_size,
|
|
+ struct sockaddr_storage *from,
|
|
+ socklen_t fromlen);
|
|
int (*for_each_interface)(struct hapd_interfaces *interfaces,
|
|
int (*cb)(struct hostapd_iface *iface,
|
|
void *ctx), void *ctx);
|
|
@@ -186,6 +191,7 @@ struct hostapd_data {
|
|
struct hostapd_config *iconf;
|
|
struct hostapd_bss_config *conf;
|
|
struct hostapd_ubus_bss ubus;
|
|
+ struct hostapd_ucode_bss ucode;
|
|
int interface_added; /* virtual interface added for this BSS */
|
|
unsigned int started:1;
|
|
unsigned int disabled:1;
|
|
@@ -506,6 +512,7 @@ struct hostapd_sta_info {
|
|
*/
|
|
struct hostapd_iface {
|
|
struct hapd_interfaces *interfaces;
|
|
+ struct hostapd_ucode_iface ucode;
|
|
void *owner;
|
|
char *config_fname;
|
|
struct hostapd_config *conf;
|
|
@@ -706,6 +713,8 @@ struct hostapd_iface * hostapd_init(stru
|
|
struct hostapd_iface *
|
|
hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy,
|
|
const char *config_fname, int debug);
|
|
+int hostapd_setup_bss(struct hostapd_data *hapd, int first, bool start_beacon);
|
|
+void hostapd_bss_deinit(struct hostapd_data *hapd);
|
|
void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
|
|
int reassoc);
|
|
void hostapd_interface_deinit_free(struct hostapd_iface *iface);
|
|
--- a/src/ap/hostapd.c
|
|
+++ b/src/ap/hostapd.c
|
|
@@ -252,6 +252,8 @@ int hostapd_reload_config(struct hostapd
|
|
struct hostapd_config *newconf, *oldconf;
|
|
size_t j;
|
|
|
|
+ hostapd_ucode_reload_bss(hapd);
|
|
+
|
|
if (iface->config_fname == NULL) {
|
|
/* Only in-memory config in use - assume it has been updated */
|
|
hostapd_clear_old(iface);
|
|
@@ -435,6 +437,7 @@ void hostapd_free_hapd_data(struct hosta
|
|
hapd->beacon_set_done = 0;
|
|
|
|
wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface);
|
|
+ hostapd_ucode_free_bss(hapd);
|
|
hostapd_ubus_free_bss(hapd);
|
|
accounting_deinit(hapd);
|
|
hostapd_deinit_wpa(hapd);
|
|
@@ -599,6 +602,7 @@ void hostapd_cleanup_iface_partial(struc
|
|
static void hostapd_cleanup_iface(struct hostapd_iface *iface)
|
|
{
|
|
wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface);
|
|
+ hostapd_ucode_free_iface(iface);
|
|
eloop_cancel_timeout(channel_list_update_timeout, iface, NULL);
|
|
eloop_cancel_timeout(hostapd_interface_setup_failure_handler, iface,
|
|
NULL);
|
|
@@ -1189,6 +1193,7 @@ static int hostapd_start_beacon(struct h
|
|
hapd->driver->set_operstate(hapd->drv_priv, 1);
|
|
|
|
hostapd_ubus_add_bss(hapd);
|
|
+ hostapd_ucode_add_bss(hapd);
|
|
|
|
return 0;
|
|
}
|
|
@@ -1211,8 +1216,7 @@ static int hostapd_start_beacon(struct h
|
|
* initialized. Most of the modules that are initialized here will be
|
|
* deinitialized in hostapd_cleanup().
|
|
*/
|
|
-static int hostapd_setup_bss(struct hostapd_data *hapd, int first,
|
|
- bool start_beacon)
|
|
+int hostapd_setup_bss(struct hostapd_data *hapd, int first, bool start_beacon)
|
|
{
|
|
struct hostapd_bss_config *conf = hapd->conf;
|
|
u8 ssid[SSID_MAX_LEN + 1];
|
|
@@ -2698,7 +2702,7 @@ hostapd_alloc_bss_data(struct hostapd_if
|
|
}
|
|
|
|
|
|
-static void hostapd_bss_deinit(struct hostapd_data *hapd)
|
|
+void hostapd_bss_deinit(struct hostapd_data *hapd)
|
|
{
|
|
if (!hapd)
|
|
return;
|
|
--- a/wpa_supplicant/Makefile
|
|
+++ b/wpa_supplicant/Makefile
|
|
@@ -195,8 +195,20 @@ endif
|
|
ifdef CONFIG_UBUS
|
|
CFLAGS += -DUBUS_SUPPORT
|
|
OBJS += ubus.o
|
|
+LIBS += -lubus
|
|
+NEED_ULOOP:=y
|
|
+endif
|
|
+
|
|
+ifdef CONFIG_UCODE
|
|
+CFLAGS += -DUCODE_SUPPORT
|
|
+OBJS += ../src/utils/ucode.o
|
|
+OBJS += ucode.o
|
|
+NEED_ULOOP:=y
|
|
+endif
|
|
+
|
|
+ifdef NEED_ULOOP
|
|
OBJS += ../src/utils/uloop.o
|
|
-LIBS += -lubox -lubus
|
|
+LIBS += -lubox
|
|
endif
|
|
|
|
ifdef CONFIG_CODE_COVERAGE
|
|
@@ -997,6 +1009,9 @@ OBJS += ../src/ap/ctrl_iface_ap.o
|
|
ifdef CONFIG_UBUS
|
|
OBJS += ../src/ap/ubus.o
|
|
endif
|
|
+ifdef CONFIG_UCODE
|
|
+OBJS += ../src/ap/ucode.o
|
|
+endif
|
|
endif
|
|
|
|
CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
|
|
--- a/wpa_supplicant/wpa_supplicant.c
|
|
+++ b/wpa_supplicant/wpa_supplicant.c
|
|
@@ -1044,6 +1044,7 @@ void wpa_supplicant_set_state(struct wpa
|
|
sme_sched_obss_scan(wpa_s, 0);
|
|
}
|
|
wpa_s->wpa_state = state;
|
|
+ wpas_ucode_update_state(wpa_s);
|
|
|
|
#ifdef CONFIG_BGSCAN
|
|
if (state == WPA_COMPLETED && wpa_s->current_ssid != wpa_s->bgscan_ssid)
|
|
@@ -7594,6 +7595,7 @@ struct wpa_supplicant * wpa_supplicant_a
|
|
#endif /* CONFIG_P2P */
|
|
|
|
wpas_ubus_add_bss(wpa_s);
|
|
+ wpas_ucode_add_bss(wpa_s);
|
|
|
|
return wpa_s;
|
|
}
|
|
@@ -7621,6 +7623,7 @@ int wpa_supplicant_remove_iface(struct w
|
|
struct wpa_supplicant *parent = wpa_s->parent;
|
|
#endif /* CONFIG_MESH */
|
|
|
|
+ wpas_ucode_free_bss(wpa_s);
|
|
wpas_ubus_free_bss(wpa_s);
|
|
|
|
/* Remove interface from the global list of interfaces */
|
|
@@ -7931,6 +7934,7 @@ struct wpa_global * wpa_supplicant_init(
|
|
|
|
eloop_register_timeout(WPA_SUPPLICANT_CLEANUP_INTERVAL, 0,
|
|
wpas_periodic, global, NULL);
|
|
+ wpas_ucode_init(global);
|
|
|
|
return global;
|
|
}
|
|
@@ -7969,12 +7973,8 @@ int wpa_supplicant_run(struct wpa_global
|
|
eloop_register_signal_terminate(wpa_supplicant_terminate, global);
|
|
eloop_register_signal_reconfig(wpa_supplicant_reconfig, global);
|
|
|
|
- wpas_ubus_add(global);
|
|
-
|
|
eloop_run();
|
|
|
|
- wpas_ubus_free(global);
|
|
-
|
|
return 0;
|
|
}
|
|
|
|
@@ -8007,6 +8007,8 @@ void wpa_supplicant_deinit(struct wpa_gl
|
|
|
|
wpas_notify_supplicant_deinitialized(global);
|
|
|
|
+ wpas_ucode_free();
|
|
+
|
|
eap_peer_unregister_methods();
|
|
#ifdef CONFIG_AP
|
|
eap_server_unregister_methods();
|
|
--- a/wpa_supplicant/wpa_supplicant_i.h
|
|
+++ b/wpa_supplicant/wpa_supplicant_i.h
|
|
@@ -22,6 +22,7 @@
|
|
#include "wmm_ac.h"
|
|
#include "pasn/pasn_common.h"
|
|
#include "ubus.h"
|
|
+#include "ucode.h"
|
|
|
|
extern const char *const wpa_supplicant_version;
|
|
extern const char *const wpa_supplicant_license;
|
|
@@ -689,6 +690,7 @@ struct wpa_supplicant {
|
|
unsigned char perm_addr[ETH_ALEN];
|
|
char ifname[100];
|
|
struct wpas_ubus_bss ubus;
|
|
+ struct wpas_ucode_bss ucode;
|
|
#ifdef CONFIG_MATCH_IFACE
|
|
int matched;
|
|
#endif /* CONFIG_MATCH_IFACE */
|
|
--- a/hostapd/ctrl_iface.c
|
|
+++ b/hostapd/ctrl_iface.c
|
|
@@ -4856,6 +4856,7 @@ try_again:
|
|
return -1;
|
|
}
|
|
|
|
+ interface->ctrl_iface_recv = hostapd_ctrl_iface_receive_process;
|
|
wpa_msg_register_cb(hostapd_ctrl_iface_msg_cb);
|
|
|
|
return 0;
|
|
@@ -4957,6 +4958,7 @@ fail:
|
|
os_free(fname);
|
|
|
|
interface->global_ctrl_sock = s;
|
|
+ interface->ctrl_iface_recv = hostapd_ctrl_iface_receive_process;
|
|
eloop_register_read_sock(s, hostapd_global_ctrl_iface_receive,
|
|
interface, NULL);
|
|
|
|
--- a/src/drivers/driver.h
|
|
+++ b/src/drivers/driver.h
|
|
@@ -3787,6 +3787,25 @@ struct wpa_driver_ops {
|
|
const char *ifname);
|
|
|
|
/**
|
|
+ * if_rename - Rename a virtual interface
|
|
+ * @priv: Private driver interface data
|
|
+ * @type: Interface type
|
|
+ * @ifname: Interface name of the virtual interface to be renamed
|
|
+ * (NULL when renaming the AP BSS interface)
|
|
+ * @new_name: New interface name of the virtual interface
|
|
+ * Returns: 0 on success, -1 on failure
|
|
+ */
|
|
+ int (*if_rename)(void *priv, enum wpa_driver_if_type type,
|
|
+ const char *ifname, const char *new_name);
|
|
+
|
|
+ /**
|
|
+ * set_first_bss - Make a virtual interface the first (primary) bss
|
|
+ * @priv: Private driver interface data
|
|
+ * Returns: 0 on success, -1 on failure
|
|
+ */
|
|
+ int (*set_first_bss)(void *priv);
|
|
+
|
|
+ /**
|
|
* set_sta_vlan - Bind a station into a specific interface (AP only)
|
|
* @priv: Private driver interface data
|
|
* @ifname: Interface (main or virtual BSS or VLAN)
|
|
@@ -6440,6 +6459,7 @@ union wpa_event_data {
|
|
|
|
/**
|
|
* struct ch_switch
|
|
+ * @count: Count until channel switch activates
|
|
* @freq: Frequency of new channel in MHz
|
|
* @ht_enabled: Whether this is an HT channel
|
|
* @ch_offset: Secondary channel offset
|
|
@@ -6450,6 +6470,7 @@ union wpa_event_data {
|
|
* @punct_bitmap: Puncturing bitmap
|
|
*/
|
|
struct ch_switch {
|
|
+ int count;
|
|
int freq;
|
|
int ht_enabled;
|
|
int ch_offset;
|
|
--- a/src/drivers/driver_nl80211_event.c
|
|
+++ b/src/drivers/driver_nl80211_event.c
|
|
@@ -1202,6 +1202,7 @@ static void mlme_event_ch_switch(struct
|
|
struct nlattr *bw, struct nlattr *cf1,
|
|
struct nlattr *cf2,
|
|
struct nlattr *punct_bitmap,
|
|
+ struct nlattr *count,
|
|
int finished)
|
|
{
|
|
struct i802_bss *bss;
|
|
@@ -1265,6 +1266,8 @@ static void mlme_event_ch_switch(struct
|
|
data.ch_switch.cf1 = nla_get_u32(cf1);
|
|
if (cf2)
|
|
data.ch_switch.cf2 = nla_get_u32(cf2);
|
|
+ if (count)
|
|
+ data.ch_switch.count = nla_get_u32(count);
|
|
|
|
if (finished)
|
|
bss->flink->freq = data.ch_switch.freq;
|
|
@@ -3912,6 +3915,7 @@ static void do_process_drv_event(struct
|
|
tb[NL80211_ATTR_CENTER_FREQ1],
|
|
tb[NL80211_ATTR_CENTER_FREQ2],
|
|
tb[NL80211_ATTR_PUNCT_BITMAP],
|
|
+ tb[NL80211_ATTR_CH_SWITCH_COUNT],
|
|
0);
|
|
break;
|
|
case NL80211_CMD_CH_SWITCH_NOTIFY:
|
|
@@ -3924,6 +3928,7 @@ static void do_process_drv_event(struct
|
|
tb[NL80211_ATTR_CENTER_FREQ1],
|
|
tb[NL80211_ATTR_CENTER_FREQ2],
|
|
tb[NL80211_ATTR_PUNCT_BITMAP],
|
|
+ NULL,
|
|
1);
|
|
break;
|
|
case NL80211_CMD_DISCONNECT:
|
|
--- a/wpa_supplicant/events.c
|
|
+++ b/wpa_supplicant/events.c
|
|
@@ -5389,6 +5389,7 @@ void supplicant_event(void *ctx, enum wp
|
|
event_to_string(event), event);
|
|
#endif /* CONFIG_NO_STDOUT_DEBUG */
|
|
|
|
+ wpas_ucode_event(wpa_s, event, data);
|
|
switch (event) {
|
|
case EVENT_AUTH:
|
|
#ifdef CONFIG_FST
|
|
--- a/src/ap/ap_drv_ops.h
|
|
+++ b/src/ap/ap_drv_ops.h
|
|
@@ -393,6 +393,23 @@ static inline int hostapd_drv_stop_ap(st
|
|
return hapd->driver->stop_ap(hapd->drv_priv);
|
|
}
|
|
|
|
+static inline int hostapd_drv_if_rename(struct hostapd_data *hapd,
|
|
+ enum wpa_driver_if_type type,
|
|
+ const char *ifname,
|
|
+ const char *new_name)
|
|
+{
|
|
+ if (!hapd->driver || !hapd->driver->if_rename || !hapd->drv_priv)
|
|
+ return -1;
|
|
+ return hapd->driver->if_rename(hapd->drv_priv, type, ifname, new_name);
|
|
+}
|
|
+
|
|
+static inline int hostapd_drv_set_first_bss(struct hostapd_data *hapd)
|
|
+{
|
|
+ if (!hapd->driver || !hapd->driver->set_first_bss || !hapd->drv_priv)
|
|
+ return 0;
|
|
+ return hapd->driver->set_first_bss(hapd->drv_priv);
|
|
+}
|
|
+
|
|
static inline int hostapd_drv_channel_info(struct hostapd_data *hapd,
|
|
struct wpa_channel_info *ci)
|
|
{
|
|
--- a/src/drivers/driver_nl80211.c
|
|
+++ b/src/drivers/driver_nl80211.c
|
|
@@ -1333,7 +1333,7 @@ static void wpa_driver_nl80211_event_rtm
|
|
}
|
|
wpa_printf(MSG_DEBUG, "nl80211: Interface down (%s/%s)",
|
|
namebuf, ifname);
|
|
- if (os_strcmp(drv->first_bss->ifname, ifname) != 0) {
|
|
+ if (drv->first_bss->ifindex != ifi->ifi_index) {
|
|
wpa_printf(MSG_DEBUG,
|
|
"nl80211: Not the main interface (%s) - do not indicate interface down",
|
|
drv->first_bss->ifname);
|
|
@@ -1369,7 +1369,7 @@ static void wpa_driver_nl80211_event_rtm
|
|
}
|
|
wpa_printf(MSG_DEBUG, "nl80211: Interface up (%s/%s)",
|
|
namebuf, ifname);
|
|
- if (os_strcmp(drv->first_bss->ifname, ifname) != 0) {
|
|
+ if (drv->first_bss->ifindex != ifi->ifi_index) {
|
|
wpa_printf(MSG_DEBUG,
|
|
"nl80211: Not the main interface (%s) - do not indicate interface up",
|
|
drv->first_bss->ifname);
|
|
@@ -8432,6 +8432,7 @@ static void *i802_init(struct hostapd_da
|
|
char master_ifname[IFNAMSIZ];
|
|
int ifindex, br_ifindex = 0;
|
|
int br_added = 0;
|
|
+ int err;
|
|
|
|
bss = wpa_driver_nl80211_drv_init(hapd, params->ifname,
|
|
params->global_priv, 1,
|
|
@@ -8491,21 +8492,17 @@ static void *i802_init(struct hostapd_da
|
|
(params->num_bridge == 0 || !params->bridge[0]))
|
|
add_ifidx(drv, br_ifindex, drv->ifindex);
|
|
|
|
- if (bss->added_if_into_bridge || bss->already_in_bridge) {
|
|
- int err;
|
|
-
|
|
- drv->rtnl_sk = nl_socket_alloc();
|
|
- if (drv->rtnl_sk == NULL) {
|
|
- wpa_printf(MSG_ERROR, "nl80211: Failed to allocate nl_sock");
|
|
- goto failed;
|
|
- }
|
|
+ drv->rtnl_sk = nl_socket_alloc();
|
|
+ if (drv->rtnl_sk == NULL) {
|
|
+ wpa_printf(MSG_ERROR, "nl80211: Failed to allocate nl_sock");
|
|
+ goto failed;
|
|
+ }
|
|
|
|
- err = nl_connect(drv->rtnl_sk, NETLINK_ROUTE);
|
|
- if (err) {
|
|
- wpa_printf(MSG_ERROR, "nl80211: Failed to connect nl_sock to NETLINK_ROUTE: %s",
|
|
- nl_geterror(err));
|
|
- goto failed;
|
|
- }
|
|
+ err = nl_connect(drv->rtnl_sk, NETLINK_ROUTE);
|
|
+ if (err) {
|
|
+ wpa_printf(MSG_ERROR, "nl80211: Failed to connect nl_sock to NETLINK_ROUTE: %s",
|
|
+ nl_geterror(err));
|
|
+ goto failed;
|
|
}
|
|
|
|
if (drv->capa.flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX) {
|
|
@@ -8874,6 +8871,50 @@ static int wpa_driver_nl80211_if_remove(
|
|
return 0;
|
|
}
|
|
|
|
+static int wpa_driver_nl80211_if_rename(struct i802_bss *bss,
|
|
+ enum wpa_driver_if_type type,
|
|
+ const char *ifname, const char *new_name)
|
|
+{
|
|
+ struct wpa_driver_nl80211_data *drv = bss->drv;
|
|
+ struct ifinfomsg ifi = {
|
|
+ .ifi_family = AF_UNSPEC,
|
|
+ .ifi_index = bss->ifindex,
|
|
+ };
|
|
+ struct nl_msg *msg;
|
|
+ int res = -ENOMEM;
|
|
+
|
|
+ if (ifname)
|
|
+ ifi.ifi_index = if_nametoindex(ifname);
|
|
+
|
|
+ msg = nlmsg_alloc_simple(RTM_SETLINK, 0);
|
|
+ if (!msg)
|
|
+ return res;
|
|
+
|
|
+ if (nlmsg_append(msg, &ifi, sizeof(ifi), NLMSG_ALIGNTO) < 0)
|
|
+ goto out;
|
|
+
|
|
+ if (nla_put_string(msg, IFLA_IFNAME, new_name))
|
|
+ goto out;
|
|
+
|
|
+ res = nl_send_auto_complete(drv->rtnl_sk, msg);
|
|
+ if (res < 0)
|
|
+ goto out;
|
|
+
|
|
+ res = nl_wait_for_ack(drv->rtnl_sk);
|
|
+ if (res) {
|
|
+ wpa_printf(MSG_INFO,
|
|
+ "nl80211: Renaming device %s to %s failed: %s",
|
|
+ ifname ? ifname : bss->ifname, new_name, nl_geterror(res));
|
|
+ goto out;
|
|
+ }
|
|
+
|
|
+ if (type == WPA_IF_AP_BSS && !ifname)
|
|
+ os_strlcpy(bss->ifname, new_name, sizeof(bss->ifname));
|
|
+
|
|
+out:
|
|
+ nlmsg_free(msg);
|
|
+ return res;
|
|
+}
|
|
|
|
static int cookie_handler(struct nl_msg *msg, void *arg)
|
|
{
|
|
@@ -10512,6 +10553,37 @@ static int driver_nl80211_if_remove(void
|
|
}
|
|
|
|
|
|
+static int driver_nl80211_if_rename(void *priv, enum wpa_driver_if_type type,
|
|
+ const char *ifname, const char *new_name)
|
|
+{
|
|
+ struct i802_bss *bss = priv;
|
|
+ return wpa_driver_nl80211_if_rename(bss, type, ifname, new_name);
|
|
+}
|
|
+
|
|
+
|
|
+static int driver_nl80211_set_first_bss(void *priv)
|
|
+{
|
|
+ struct i802_bss *bss = priv, *tbss;
|
|
+ struct wpa_driver_nl80211_data *drv = bss->drv;
|
|
+
|
|
+ if (drv->first_bss == bss)
|
|
+ return 0;
|
|
+
|
|
+ for (tbss = drv->first_bss; tbss; tbss = tbss->next) {
|
|
+ if (tbss->next != bss)
|
|
+ continue;
|
|
+
|
|
+ tbss->next = bss->next;
|
|
+ bss->next = drv->first_bss;
|
|
+ drv->first_bss = bss;
|
|
+ drv->ctx = bss->ctx;
|
|
+ return 0;
|
|
+ }
|
|
+
|
|
+ return -1;
|
|
+}
|
|
+
|
|
+
|
|
static int driver_nl80211_send_mlme(void *priv, const u8 *data,
|
|
size_t data_len, int noack,
|
|
unsigned int freq,
|
|
@@ -13696,6 +13768,8 @@ const struct wpa_driver_ops wpa_driver_n
|
|
.set_acl = wpa_driver_nl80211_set_acl,
|
|
.if_add = wpa_driver_nl80211_if_add,
|
|
.if_remove = driver_nl80211_if_remove,
|
|
+ .if_rename = driver_nl80211_if_rename,
|
|
+ .set_first_bss = driver_nl80211_set_first_bss,
|
|
.send_mlme = driver_nl80211_send_mlme,
|
|
.get_hw_feature_data = nl80211_get_hw_feature_data,
|
|
.sta_add = wpa_driver_nl80211_sta_add,
|