12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201 |
- From: Matthias Schiffer <mschiffer@universe-factory.net>
- Date: Mon, 19 May 2014 15:59:06 +0200
- Subject: Backport hostapd from Barrier Breaker (r41029)
- diff --git a/package/hostapd/Makefile b/package/hostapd/Makefile
- index b4dc242..beb37a3 100644
- --- a/package/hostapd/Makefile
- +++ b/package/hostapd/Makefile
- @@ -8,9 +8,9 @@
- include $(TOPDIR)/rules.mk
-
- PKG_NAME:=hostapd
- -PKG_VERSION:=20131120
- +PKG_VERSION:=2014-06-03
- PKG_RELEASE:=1
- -PKG_REV:=594516b4c28a94ca686b17f1e463dfd6712b75a7
- +PKG_REV:=84df167554569af8c87f0a8ac1fb508192417d8e
-
- PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
- PKG_SOURCE_URL:=git://w1.fi/srv/git/hostap.git
- diff --git a/package/hostapd/files/hostapd.sh b/package/hostapd/files/hostapd.sh
- index b55b63d..2a16bb4 100644
- --- a/package/hostapd/files/hostapd.sh
- +++ b/package/hostapd/files/hostapd.sh
- @@ -130,7 +130,9 @@ hostapd_set_bss_options() {
- append "$var" "radius_das_client=$dae_client $dae_secret" "$N"
- }
- config_get nasid "$vif" nasid
- + config_get ownip "$vif" ownip
- append "$var" "nas_identifier=$nasid" "$N"
- + append "$var" "own_ip_addr=$ownip" "$N"
- append "$var" "eapol_key_index_workaround=1" "$N"
- append "$var" "ieee8021x=1" "$N"
- append "$var" "wpa_key_mgmt=WPA-EAP" "$N"
- diff --git a/package/hostapd/patches/100-madwifi_key_fixes.patch b/package/hostapd/patches/100-madwifi_key_fixes.patch
- index dcd6d10..a46943b 100644
- --- a/package/hostapd/patches/100-madwifi_key_fixes.patch
- +++ b/package/hostapd/patches/100-madwifi_key_fixes.patch
- @@ -1,6 +1,6 @@
- --- a/src/drivers/driver_madwifi.c
- +++ b/src/drivers/driver_madwifi.c
- -@@ -450,7 +450,9 @@ wpa_driver_madwifi_set_key(const char *i
- +@@ -449,7 +449,9 @@ wpa_driver_madwifi_set_key(const char *i
-
- memset(&wk, 0, sizeof(wk));
- wk.ik_type = cipher;
- @@ -11,7 +11,7 @@
- if (addr == NULL || is_broadcast_ether_addr(addr)) {
- memset(wk.ik_macaddr, 0xff, IEEE80211_ADDR_LEN);
- wk.ik_keyix = key_idx;
- -@@ -462,6 +464,20 @@ wpa_driver_madwifi_set_key(const char *i
- +@@ -461,6 +463,20 @@ wpa_driver_madwifi_set_key(const char *i
- wk.ik_keylen = key_len;
- memcpy(wk.ik_keydata, key, key_len);
-
- diff --git a/package/hostapd/patches/110-bool_fix.patch b/package/hostapd/patches/110-bool_fix.patch
- index 9f82b0b..1ad84bf 100644
- --- a/package/hostapd/patches/110-bool_fix.patch
- +++ b/package/hostapd/patches/110-bool_fix.patch
- @@ -1,6 +1,6 @@
- --- a/src/ap/ieee802_1x.c
- +++ b/src/ap/ieee802_1x.c
- -@@ -1933,9 +1933,9 @@ void ieee802_1x_notify_pre_auth(struct e
- +@@ -2119,9 +2119,9 @@ void ieee802_1x_notify_pre_auth(struct e
- }
-
-
- diff --git a/package/hostapd/patches/130-no_eapol_fix.patch b/package/hostapd/patches/130-no_eapol_fix.patch
- new file mode 100644
- index 0000000..3c19cb3
- --- /dev/null
- +++ b/package/hostapd/patches/130-no_eapol_fix.patch
- @@ -0,0 +1,14 @@
- +--- a/wpa_supplicant/wpa_supplicant.c
- ++++ b/wpa_supplicant/wpa_supplicant.c
- +@@ -247,9 +247,10 @@ void wpa_supplicant_cancel_auth_timeout(
- + */
- + void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s)
- + {
- ++ struct wpa_ssid *ssid = wpa_s->current_ssid;
- ++
- + #ifdef IEEE8021X_EAPOL
- + struct eapol_config eapol_conf;
- +- struct wpa_ssid *ssid = wpa_s->current_ssid;
- +
- + #ifdef CONFIG_IBSS_RSN
- + if (ssid->mode == WPAS_MODE_IBSS &&
- diff --git a/package/hostapd/patches/130-wds_sta_del_fix.patch b/package/hostapd/patches/130-wds_sta_del_fix.patch
- deleted file mode 100644
- index 06b6906..0000000
- --- a/package/hostapd/patches/130-wds_sta_del_fix.patch
- +++ /dev/null
- @@ -1,13 +0,0 @@
- ---- a/src/drivers/driver_nl80211.c
- -+++ b/src/drivers/driver_nl80211.c
- -@@ -9083,8 +9083,8 @@ static int i802_set_wds_sta(void *priv,
- - name);
- -
- - i802_set_sta_vlan(priv, addr, bss->ifname, 0);
- -- return wpa_driver_nl80211_if_remove(priv, WPA_IF_AP_VLAN,
- -- name);
- -+ nl80211_remove_iface(drv, if_nametoindex(name));
- -+ return 0;
- - }
- - }
- -
- diff --git a/package/hostapd/patches/200-multicall.patch b/package/hostapd/patches/200-multicall.patch
- index 2289f51..efe151c 100644
- --- a/package/hostapd/patches/200-multicall.patch
- +++ b/package/hostapd/patches/200-multicall.patch
- @@ -1,14 +1,14 @@
- --- a/hostapd/Makefile
- +++ b/hostapd/Makefile
- -@@ -14,6 +14,7 @@ CFLAGS += -I../src/utils
- +@@ -14,6 +14,7 @@ CFLAGS += -I$(abspath ../src/utils)
- # CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include
-
- -include .config
- +-include $(if $(MULTICALL), ../wpa_supplicant/.config)
-
- - ifndef CONFIG_OS
- - ifdef CONFIG_NATIVE_WINDOWS
- -@@ -200,10 +201,14 @@ ifdef CONFIG_IEEE80211AC
- + ifdef CONFIG_TESTING_OPTIONS
- + CFLAGS += -DCONFIG_TESTING_OPTIONS
- +@@ -223,10 +224,14 @@ ifdef CONFIG_IEEE80211AC
- CFLAGS += -DCONFIG_IEEE80211AC
- endif
-
- @@ -26,7 +26,7 @@
- LIBS += $(DRV_AP_LIBS)
-
- ifdef CONFIG_L2_PACKET
- -@@ -890,6 +895,12 @@ install: all
- +@@ -913,6 +918,12 @@ install: all
-
- BCHECK=../src/drivers/build.hostapd
-
- @@ -39,7 +39,7 @@
- hostapd: $(BCHECK) $(OBJS)
- $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
- @$(E) " LD " $@
- -@@ -928,6 +939,12 @@ HOBJS += ../src/crypto/aes-internal.o
- +@@ -951,6 +962,12 @@ HOBJS += ../src/crypto/aes-internal.o
- HOBJS += ../src/crypto/aes-internal-enc.o
- endif
-
- @@ -54,15 +54,15 @@
- @$(E) " LD " $@
- --- a/wpa_supplicant/Makefile
- +++ b/wpa_supplicant/Makefile
- -@@ -14,6 +14,7 @@ CFLAGS += -I../src
- - CFLAGS += -I../src/utils
- +@@ -14,6 +14,7 @@ CFLAGS += -I$(abspath ../src)
- + CFLAGS += -I$(abspath ../src/utils)
-
- -include .config
- +-include $(if $(MULTICALL),../hostapd/.config)
-
- - BINALL=wpa_supplicant wpa_cli
- -
- -@@ -727,6 +728,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
- + ifdef CONFIG_TESTING_OPTIONS
- + CFLAGS += -DCONFIG_TESTING_OPTIONS
- +@@ -741,6 +742,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
- CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
- LIBS += -ldl -rdynamic
- endif
- @@ -72,8 +72,8 @@
- + endif
- endif
-
- - ifdef CONFIG_AP
- -@@ -735,9 +740,11 @@ NEED_EAP_COMMON=y
- + ifdef CONFIG_MACSEC
- +@@ -762,9 +767,11 @@ NEED_EAP_COMMON=y
- NEED_RSN_AUTHENTICATOR=y
- CFLAGS += -DCONFIG_AP
- OBJS += ap.o
- @@ -85,7 +85,7 @@
- OBJS += ../src/ap/hostapd.o
- OBJS += ../src/ap/wpa_auth_glue.o
- OBJS += ../src/ap/utils.o
- -@@ -799,10 +806,18 @@ endif
- +@@ -826,10 +833,18 @@ endif
- ifdef CONFIG_HS20
- OBJS += ../src/ap/hs20.o
- endif
- @@ -104,7 +104,7 @@
- NEED_AES_WRAP=y
- OBJS += ../src/ap/wpa_auth.o
- OBJS += ../src/ap/wpa_auth_ie.o
- -@@ -1551,6 +1566,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
- +@@ -1602,6 +1617,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
-
- $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
-
- @@ -117,7 +117,7 @@
- wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
- $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
- @$(E) " LD " $@
- -@@ -1625,6 +1646,12 @@ eap_eke.so: ../src/eap_peer/eap_eke.c ..
- +@@ -1682,6 +1703,12 @@ endif
- %@.service: %.service.arg.in
- sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
-
- @@ -132,7 +132,7 @@
- wpa_cli.exe: wpa_cli
- --- a/src/drivers/driver.h
- +++ b/src/drivers/driver.h
- -@@ -4079,8 +4079,8 @@ union wpa_event_data {
- +@@ -4117,8 +4117,8 @@ union wpa_event_data {
- * Driver wrapper code should call this function whenever an event is received
- * from the driver.
- */
- @@ -145,7 +145,7 @@
- /*
- --- a/src/ap/drv_callbacks.c
- +++ b/src/ap/drv_callbacks.c
- -@@ -844,8 +844,8 @@ static void hostapd_event_dfs_nop_finish
- +@@ -926,8 +926,8 @@ static void hostapd_event_dfs_nop_finish
- #endif /* NEED_AP_MLME */
-
-
- @@ -158,7 +158,7 @@
- #ifndef CONFIG_NO_STDOUT_DEBUG
- --- a/wpa_supplicant/wpa_priv.c
- +++ b/wpa_supplicant/wpa_priv.c
- -@@ -817,8 +817,8 @@ static void wpa_priv_send_ft_response(st
- +@@ -815,8 +815,8 @@ static void wpa_priv_send_ft_response(st
- }
-
-
- @@ -169,7 +169,7 @@
- {
- struct wpa_priv_interface *iface = ctx;
-
- -@@ -960,6 +960,7 @@ int main(int argc, char *argv[])
- +@@ -956,6 +956,7 @@ int main(int argc, char *argv[])
- if (os_program_init())
- return -1;
-
- @@ -179,7 +179,7 @@
- for (;;) {
- --- a/wpa_supplicant/events.c
- +++ b/wpa_supplicant/events.c
- -@@ -2710,8 +2710,8 @@ static void wpa_supplicant_update_channe
- +@@ -2919,8 +2919,8 @@ static void wpa_supplicant_notify_avoid_
- }
-
-
- @@ -192,7 +192,7 @@
-
- --- a/wpa_supplicant/wpa_supplicant.c
- +++ b/wpa_supplicant/wpa_supplicant.c
- -@@ -3138,6 +3138,9 @@ static void wpa_supplicant_deinit_iface(
- +@@ -3811,6 +3811,9 @@ static void wpa_supplicant_deinit_iface(
- os_free(wpa_s);
- }
-
- @@ -202,7 +202,7 @@
-
- /**
- * wpa_supplicant_add_iface - Add a new network interface
- -@@ -3329,6 +3332,7 @@ struct wpa_global * wpa_supplicant_init(
- +@@ -4002,6 +4005,7 @@ struct wpa_global * wpa_supplicant_init(
- wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
- #endif /* CONFIG_NO_WPA_MSG */
-
- @@ -212,7 +212,7 @@
- wpa_debug_open_syslog();
- --- a/hostapd/main.c
- +++ b/hostapd/main.c
- -@@ -511,6 +511,9 @@ static int hostapd_get_ctrl_iface_group(
- +@@ -502,6 +502,9 @@ static int hostapd_get_ctrl_iface_group(
- return 0;
- }
-
- @@ -220,27 +220,57 @@
- + union wpa_event_data *data);
- +
-
- - int main(int argc, char *argv[])
- - {
- -@@ -541,6 +544,7 @@ int main(int argc, char *argv[])
- + #ifdef CONFIG_WPS
- + static int gen_uuid(const char *txt_addr)
- +@@ -553,6 +556,7 @@ int main(int argc, char *argv[])
- interfaces.global_iface_name = NULL;
- interfaces.global_ctrl_sock = -1;
-
- + wpa_supplicant_event = hostapd_wpa_event;
- for (;;) {
- - c = getopt(argc, argv, "b:Bde:f:hKP:Ttvg:G:");
- + c = getopt(argc, argv, "b:Bde:f:hKP:Ttu:vg:G:");
- if (c < 0)
- --- a/src/drivers/drivers.c
- +++ b/src/drivers/drivers.c
- -@@ -7,7 +7,11 @@
- - */
- -
- - #include "includes.h"
- -+#include "common.h"
- -+#include "driver.h"
- +@@ -10,6 +10,9 @@
- + #include "utils/common.h"
- + #include "driver.h"
-
- +void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
- + union wpa_event_data *data);
- -
- ++
- #ifdef CONFIG_DRIVER_WEXT
- extern struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
- + #endif /* CONFIG_DRIVER_WEXT */
- +--- a/wpa_supplicant/eapol_test.c
- ++++ b/wpa_supplicant/eapol_test.c
- +@@ -28,8 +28,12 @@
- + #include "ctrl_iface.h"
- + #include "pcsc_funcs.h"
- + #include "wpas_glue.h"
- ++#include "drivers/driver.h"
- +
- +
- ++void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
- ++ union wpa_event_data *data);
- ++
- + struct wpa_driver_ops *wpa_drivers[] = { NULL };
- +
- +
- +@@ -1185,6 +1189,8 @@ static void usage(void)
- + "option several times.\n");
- + }
- +
- ++extern void supplicant_event(void *ctx, enum wpa_event_type event,
- ++ union wpa_event_data *data);
- +
- + int main(int argc, char *argv[])
- + {
- +@@ -1203,6 +1209,7 @@ int main(int argc, char *argv[])
- + if (os_program_init())
- + return -1;
- +
- ++ wpa_supplicant_event = supplicant_event;
- + hostapd_logger_register_cb(hostapd_logger_cb);
- +
- + os_memset(&eapol_test, 0, sizeof(eapol_test));
- diff --git a/package/hostapd/patches/300-noscan.patch b/package/hostapd/patches/300-noscan.patch
- index 17e7661..4ea26b6 100644
- --- a/package/hostapd/patches/300-noscan.patch
- +++ b/package/hostapd/patches/300-noscan.patch
- @@ -1,17 +1,17 @@
- --- a/hostapd/config_file.c
- +++ b/hostapd/config_file.c
- -@@ -2412,6 +2412,8 @@ static int hostapd_config_fill(struct ho
- - }
- +@@ -2639,6 +2639,8 @@ static int hostapd_config_fill(struct ho
- + }
- #endif /* CONFIG_IEEE80211W */
- #ifdef CONFIG_IEEE80211N
- -+ } else if (os_strcmp(buf, "noscan") == 0) {
- -+ conf->noscan = atoi(pos);
- - } else if (os_strcmp(buf, "ieee80211n") == 0) {
- - conf->ieee80211n = atoi(pos);
- - } else if (os_strcmp(buf, "ht_capab") == 0) {
- ++ } else if (os_strcmp(buf, "noscan") == 0) {
- ++ conf->noscan = atoi(pos);
- + } else if (os_strcmp(buf, "ieee80211n") == 0) {
- + conf->ieee80211n = atoi(pos);
- + } else if (os_strcmp(buf, "ht_capab") == 0) {
- --- a/src/ap/ap_config.h
- +++ b/src/ap/ap_config.h
- -@@ -527,6 +527,7 @@ struct hostapd_config {
- +@@ -576,6 +576,7 @@ struct hostapd_config {
-
- int ht_op_mode_fixed;
- u16 ht_capab;
- @@ -21,9 +21,9 @@
- int require_ht;
- --- a/src/ap/hw_features.c
- +++ b/src/ap/hw_features.c
- -@@ -577,7 +577,7 @@ static int ieee80211n_check_40mhz(struct
- - {
- +@@ -690,7 +690,7 @@ static int ieee80211n_check_40mhz(struct
- struct wpa_driver_scan_params params;
- + int ret;
-
- - if (!iface->conf->secondary_channel)
- + if (!iface->conf->secondary_channel || iface->conf->noscan)
- diff --git a/package/hostapd/patches/310-rescan_immediately.patch b/package/hostapd/patches/310-rescan_immediately.patch
- index 043f07c..dac0f6e 100644
- --- a/package/hostapd/patches/310-rescan_immediately.patch
- +++ b/package/hostapd/patches/310-rescan_immediately.patch
- @@ -1,6 +1,6 @@
- --- a/wpa_supplicant/wpa_supplicant.c
- +++ b/wpa_supplicant/wpa_supplicant.c
- -@@ -2488,7 +2488,7 @@ static struct wpa_supplicant * wpa_suppl
- +@@ -2752,7 +2752,7 @@ static struct wpa_supplicant * wpa_suppl
- if (wpa_s == NULL)
- return NULL;
- wpa_s->scan_req = INITIAL_SCAN_REQ;
- diff --git a/package/hostapd/patches/320-optional_rfkill.patch b/package/hostapd/patches/320-optional_rfkill.patch
- index 7ec51b1..3808f9b 100644
- --- a/package/hostapd/patches/320-optional_rfkill.patch
- +++ b/package/hostapd/patches/320-optional_rfkill.patch
- @@ -1,221 +1,6 @@
- ---- a/src/drivers/driver_nl80211.c
- -+++ b/src/drivers/driver_nl80211.c
- -@@ -254,7 +254,9 @@ struct wpa_driver_nl80211_data {
- - int if_removed;
- - int if_disabled;
- - int ignore_if_down_event;
- -+#ifdef CONFIG_RFKILL
- - struct rfkill_data *rfkill;
- -+#endif
- - struct wpa_driver_capa capa;
- - u8 *extended_capa, *extended_capa_mask;
- - unsigned int extended_capa_len;
- -@@ -3630,7 +3632,7 @@ static int wpa_driver_nl80211_init_nl(st
- - return 0;
- - }
- -
- --
- -+#ifdef CONFIG_RFKILL
- - static void wpa_driver_nl80211_rfkill_blocked(void *ctx)
- - {
- - wpa_printf(MSG_DEBUG, "nl80211: RFKILL blocked");
- -@@ -3652,6 +3654,7 @@ static void wpa_driver_nl80211_rfkill_un
- - }
- - /* rtnetlink ifup handler will report interface as enabled */
- - }
- -+#endif /* CONFIG_RFKILL */
- -
- -
- - static void wpa_driver_nl80211_handle_eapol_tx_status(int sock,
- -@@ -3740,7 +3743,9 @@ static void * wpa_driver_nl80211_drv_ini
- - const u8 *set_addr)
- - {
- - struct wpa_driver_nl80211_data *drv;
- -+#ifdef CONFIG_RFKILL
- - struct rfkill_config *rcfg;
- -+#endif
- - struct i802_bss *bss;
- -
- - if (global_priv == NULL)
- -@@ -3778,6 +3783,7 @@ static void * wpa_driver_nl80211_drv_ini
- - if (nl80211_init_bss(bss))
- - goto failed;
- -
- -+#ifdef CONFIG_RFKILL
- - rcfg = os_zalloc(sizeof(*rcfg));
- - if (rcfg == NULL)
- - goto failed;
- -@@ -3790,6 +3796,7 @@ static void * wpa_driver_nl80211_drv_ini
- - wpa_printf(MSG_DEBUG, "nl80211: RFKILL status not available");
- - os_free(rcfg);
- - }
- -+#endif /* CONFIG_RFKILL */
- -
- - if (linux_iface_up(drv->global->ioctl_sock, ifname) > 0)
- - drv->start_iface_up = 1;
- -@@ -4116,10 +4123,12 @@ static void nl80211_mgmt_unsubscribe(str
- - }
- -
- -
- -+#ifdef CONFIG_RFKILL
- - static void wpa_driver_nl80211_send_rfkill(void *eloop_ctx, void *timeout_ctx)
- - {
- - wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL);
- - }
- -+#endif /* CONFIG_RFKILL */
- -
- -
- - static void nl80211_del_p2pdev(struct i802_bss *bss)
- -@@ -4246,13 +4255,16 @@ wpa_driver_nl80211_finish_drv_init(struc
- - }
- -
- - if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1)) {
- -+#ifdef CONFIG_RFKILL
- - if (rfkill_is_blocked(drv->rfkill)) {
- - wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable "
- - "interface '%s' due to rfkill",
- - bss->ifname);
- - drv->if_disabled = 1;
- - send_rfkill_event = 1;
- -- } else {
- -+ } else
- -+#endif
- -+ {
- - wpa_printf(MSG_ERROR, "nl80211: Could not set "
- - "interface '%s' UP", bss->ifname);
- - return -1;
- -@@ -4268,8 +4280,10 @@ wpa_driver_nl80211_finish_drv_init(struc
- - return -1;
- -
- - if (send_rfkill_event) {
- -+#ifdef CONFIG_RFKILL
- - eloop_register_timeout(0, 0, wpa_driver_nl80211_send_rfkill,
- - drv, drv->ctx);
- -+#endif
- - }
- -
- - return 0;
- -@@ -4347,7 +4361,9 @@ static void wpa_driver_nl80211_deinit(st
- -
- - netlink_send_oper_ifla(drv->global->netlink, drv->ifindex, 0,
- - IF_OPER_UP);
- -+#ifdef CONFIG_RFKILL
- - rfkill_deinit(drv->rfkill);
- -+#endif
- -
- - eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv, drv->ctx);
- -
- ---- a/src/drivers/driver_wext.c
- -+++ b/src/drivers/driver_wext.c
- -@@ -740,7 +740,7 @@ static void wpa_driver_wext_event_rtm_de
- - }
- - }
- -
- --
- -+#ifdef CONFIG_RFKILL
- - static void wpa_driver_wext_rfkill_blocked(void *ctx)
- - {
- - wpa_printf(MSG_DEBUG, "WEXT: RFKILL blocked");
- -@@ -762,7 +762,7 @@ static void wpa_driver_wext_rfkill_unblo
- - }
- - /* rtnetlink ifup handler will report interface as enabled */
- - }
- --
- -+#endif /* CONFIG_RFKILL */
- -
- - static void wext_get_phy_name(struct wpa_driver_wext_data *drv)
- - {
- -@@ -808,7 +808,9 @@ void * wpa_driver_wext_init(void *ctx, c
- - {
- - struct wpa_driver_wext_data *drv;
- - struct netlink_config *cfg;
- -+#ifdef CONFIG_RFKILL
- - struct rfkill_config *rcfg;
- -+#endif
- - char path[128];
- - struct stat buf;
- -
- -@@ -843,6 +845,7 @@ void * wpa_driver_wext_init(void *ctx, c
- - goto err2;
- - }
- -
- -+#ifdef CONFIG_RFKILL
- - rcfg = os_zalloc(sizeof(*rcfg));
- - if (rcfg == NULL)
- - goto err3;
- -@@ -855,6 +858,7 @@ void * wpa_driver_wext_init(void *ctx, c
- - wpa_printf(MSG_DEBUG, "WEXT: RFKILL status not available");
- - os_free(rcfg);
- - }
- -+#endif /* CONFIG_RFKILL */
- -
- - drv->mlme_sock = -1;
- -
- -@@ -872,7 +876,9 @@ void * wpa_driver_wext_init(void *ctx, c
- - return drv;
- -
- - err3:
- -+#ifdef CONFIG_RFKILL
- - rfkill_deinit(drv->rfkill);
- -+#endif
- - netlink_deinit(drv->netlink);
- - err2:
- - close(drv->ioctl_sock);
- -@@ -882,10 +888,12 @@ err1:
- - }
- -
- -
- -+#ifdef CONFIG_RFKILL
- - static void wpa_driver_wext_send_rfkill(void *eloop_ctx, void *timeout_ctx)
- - {
- - wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL);
- - }
- -+#endif /* CONFIG_RFKILL */
- -
- -
- - static int wpa_driver_wext_finish_drv_init(struct wpa_driver_wext_data *drv)
- -@@ -893,13 +901,16 @@ static int wpa_driver_wext_finish_drv_in
- - int send_rfkill_event = 0;
- -
- - if (linux_set_iface_flags(drv->ioctl_sock, drv->ifname, 1) < 0) {
- -+#ifdef CONFIG_RFKILL
- - if (rfkill_is_blocked(drv->rfkill)) {
- - wpa_printf(MSG_DEBUG, "WEXT: Could not yet enable "
- - "interface '%s' due to rfkill",
- - drv->ifname);
- - drv->if_disabled = 1;
- - send_rfkill_event = 1;
- -- } else {
- -+ } else
- -+#endif
- -+ {
- - wpa_printf(MSG_ERROR, "WEXT: Could not set "
- - "interface '%s' UP", drv->ifname);
- - return -1;
- -@@ -947,8 +958,10 @@ static int wpa_driver_wext_finish_drv_in
- - 1, IF_OPER_DORMANT);
- -
- - if (send_rfkill_event) {
- -+#ifdef CONFIG_RFKILL
- - eloop_register_timeout(0, 0, wpa_driver_wext_send_rfkill,
- - drv, drv->ctx);
- -+#endif
- - }
- -
- - return 0;
- -@@ -978,7 +991,9 @@ void wpa_driver_wext_deinit(void *priv)
- -
- - netlink_send_oper_ifla(drv->netlink, drv->ifindex, 0, IF_OPER_UP);
- - netlink_deinit(drv->netlink);
- -+#ifdef CONFIG_RFKILL
- - rfkill_deinit(drv->rfkill);
- -+#endif
- -
- - if (drv->mlme_sock >= 0)
- - eloop_unregister_read_sock(drv->mlme_sock);
- --- a/src/drivers/drivers.mak
- +++ b/src/drivers/drivers.mak
- -@@ -25,7 +25,6 @@ NEED_SME=y
- +@@ -30,7 +30,6 @@ NEED_SME=y
- NEED_AP_MLME=y
- NEED_NETLINK=y
- NEED_LINUX_IOCTL=y
- @@ -223,7 +8,7 @@
-
- ifdef CONFIG_LIBNL32
- DRV_LIBS += -lnl-3
- -@@ -109,7 +108,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
- +@@ -114,7 +113,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
- CONFIG_WIRELESS_EXTENSION=y
- NEED_NETLINK=y
- NEED_LINUX_IOCTL=y
- @@ -231,7 +16,7 @@
- endif
-
- ifdef CONFIG_DRIVER_NDIS
- -@@ -135,7 +133,6 @@ endif
- +@@ -140,7 +138,6 @@ endif
- ifdef CONFIG_WIRELESS_EXTENSION
- DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION
- DRV_WPA_OBJS += ../src/drivers/driver_wext.o
- @@ -239,7 +24,7 @@
- endif
-
- ifdef NEED_NETLINK
- -@@ -148,6 +145,7 @@ endif
- +@@ -153,6 +150,7 @@ endif
-
- ifdef NEED_RFKILL
- DRV_OBJS += ../src/drivers/rfkill.o
- @@ -247,15 +32,30 @@
- endif
-
- ifdef CONFIG_VLAN_NETLINK
- ---- a/src/drivers/driver_wext.h
- -+++ b/src/drivers/driver_wext.h
- -@@ -22,7 +22,9 @@ struct wpa_driver_wext_data {
- - int ifindex2;
- - int if_removed;
- - int if_disabled;
- -+#ifdef CONFIG_RFKILL
- - struct rfkill_data *rfkill;
- -+#endif
- - u8 *assoc_req_ies;
- - size_t assoc_req_ies_len;
- - u8 *assoc_resp_ies;
- +--- a/src/drivers/rfkill.h
- ++++ b/src/drivers/rfkill.h
- +@@ -18,8 +18,24 @@ struct rfkill_config {
- + void (*unblocked_cb)(void *ctx);
- + };
- +
- ++#ifdef CONFIG_RFKILL
- + struct rfkill_data * rfkill_init(struct rfkill_config *cfg);
- + void rfkill_deinit(struct rfkill_data *rfkill);
- + int rfkill_is_blocked(struct rfkill_data *rfkill);
- ++#else
- ++static inline struct rfkill_data * rfkill_init(struct rfkill_config *cfg)
- ++{
- ++ return (void *) 1;
- ++}
- ++
- ++static inline void rfkill_deinit(struct rfkill_data *rfkill)
- ++{
- ++}
- ++
- ++static inline int rfkill_is_blocked(struct rfkill_data *rfkill)
- ++{
- ++ return 0;
- ++}
- ++#endif
- +
- + #endif /* RFKILL_H */
- diff --git a/package/hostapd/patches/330-nl80211_fix_set_freq.patch b/package/hostapd/patches/330-nl80211_fix_set_freq.patch
- index a505a60..dbc9ef8 100644
- --- a/package/hostapd/patches/330-nl80211_fix_set_freq.patch
- +++ b/package/hostapd/patches/330-nl80211_fix_set_freq.patch
- @@ -1,15 +1,15 @@
- --- a/src/drivers/driver_nl80211.c
- +++ b/src/drivers/driver_nl80211.c
- -@@ -6860,7 +6860,7 @@ static int wpa_driver_nl80211_set_freq(s
- -
- - nl80211_cmd(drv, msg, 0, NL80211_CMD_SET_WIPHY);
- +@@ -7488,7 +7488,7 @@ static int nl80211_set_channel(struct i8
- + nl80211_cmd(drv, msg, 0, set_chan ? NL80211_CMD_SET_CHANNEL :
- + NL80211_CMD_SET_WIPHY);
-
- - NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex);
- + NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, bss->ifindex);
- if (nl80211_put_freq_params(msg, freq) < 0)
- goto nla_put_failure;
-
- -@@ -11322,7 +11322,7 @@ static int nl80211_switch_channel(void *
- +@@ -12047,7 +12047,7 @@ static int nl80211_switch_channel(void *
- return -ENOMEM;
-
- nl80211_cmd(drv, msg, 0, NL80211_CMD_CHANNEL_SWITCH);
- diff --git a/package/hostapd/patches/340-reload_freq_change.patch b/package/hostapd/patches/340-reload_freq_change.patch
- index 9316794..d3e8918 100644
- --- a/package/hostapd/patches/340-reload_freq_change.patch
- +++ b/package/hostapd/patches/340-reload_freq_change.patch
- @@ -1,6 +1,6 @@
- --- a/src/ap/hostapd.c
- +++ b/src/ap/hostapd.c
- -@@ -72,6 +72,16 @@ static void hostapd_reload_bss(struct ho
- +@@ -70,6 +70,16 @@ static void hostapd_reload_bss(struct ho
- #endif /* CONFIG_NO_RADIUS */
-
- ssid = &hapd->conf->ssid;
- @@ -17,7 +17,7 @@
- if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next &&
- ssid->wpa_passphrase_set && ssid->wpa_passphrase) {
- /*
- -@@ -172,6 +182,9 @@ int hostapd_reload_config(struct hostapd
- +@@ -170,20 +180,12 @@ int hostapd_reload_config(struct hostapd
- oldconf = hapd->iconf;
- iface->conf = newconf;
-
- @@ -27,3 +27,17 @@
- for (j = 0; j < iface->num_bss; j++) {
- hapd = iface->bss[j];
- hapd->iconf = newconf;
- +- hapd->iconf->channel = oldconf->channel;
- +- hapd->iconf->secondary_channel = oldconf->secondary_channel;
- +- hapd->iconf->ieee80211n = oldconf->ieee80211n;
- +- hapd->iconf->ieee80211ac = oldconf->ieee80211ac;
- +- hapd->iconf->ht_capab = oldconf->ht_capab;
- +- hapd->iconf->vht_capab = oldconf->vht_capab;
- +- hapd->iconf->vht_oper_chwidth = oldconf->vht_oper_chwidth;
- +- hapd->iconf->vht_oper_centr_freq_seg0_idx =
- +- oldconf->vht_oper_centr_freq_seg0_idx;
- +- hapd->iconf->vht_oper_centr_freq_seg1_idx =
- +- oldconf->vht_oper_centr_freq_seg1_idx;
- + hapd->conf = newconf->bss[j];
- + hostapd_reload_bss(hapd);
- + }
- diff --git a/package/hostapd/patches/350-nl80211_del_beacon_bss.patch b/package/hostapd/patches/350-nl80211_del_beacon_bss.patch
- index 885922c..e6f6cf3 100644
- --- a/package/hostapd/patches/350-nl80211_del_beacon_bss.patch
- +++ b/package/hostapd/patches/350-nl80211_del_beacon_bss.patch
- @@ -1,6 +1,6 @@
- --- a/src/drivers/driver_nl80211.c
- +++ b/src/drivers/driver_nl80211.c
- -@@ -4290,18 +4290,20 @@ wpa_driver_nl80211_finish_drv_init(struc
- +@@ -4817,18 +4817,20 @@ wpa_driver_nl80211_finish_drv_init(struc
- }
-
-
- @@ -24,7 +24,7 @@
-
- return send_and_recv_msgs(drv, msg, NULL, NULL);
- nla_put_failure:
- -@@ -4309,6 +4311,15 @@ static int wpa_driver_nl80211_del_beacon
- +@@ -4836,6 +4838,15 @@ static int wpa_driver_nl80211_del_beacon
- return -ENOBUFS;
- }
-
- @@ -40,7 +40,7 @@
-
- /**
- * wpa_driver_nl80211_deinit - Deinitialize nl80211 driver interface
- -@@ -9911,7 +9922,6 @@ static int wpa_driver_nl80211_stop_ap(vo
- +@@ -10617,7 +10628,6 @@ static int wpa_driver_nl80211_stop_ap(vo
- if (!is_ap_interface(drv->nlmode))
- return -1;
- wpa_driver_nl80211_del_beacon(drv);
- diff --git a/package/hostapd/patches/360-ctrl_iface_reload.patch b/package/hostapd/patches/360-ctrl_iface_reload.patch
- index 170d4f2..e69c3d3 100644
- --- a/package/hostapd/patches/360-ctrl_iface_reload.patch
- +++ b/package/hostapd/patches/360-ctrl_iface_reload.patch
- @@ -1,6 +1,6 @@
- --- a/hostapd/ctrl_iface.c
- +++ b/hostapd/ctrl_iface.c
- -@@ -34,6 +34,7 @@
- +@@ -37,6 +37,7 @@
- #include "wps/wps.h"
- #include "config_file.h"
- #include "ctrl_iface.h"
- @@ -8,7 +8,7 @@
-
-
- struct wpa_ctrl_dst {
- -@@ -44,6 +45,7 @@ struct wpa_ctrl_dst {
- +@@ -47,6 +48,7 @@ struct wpa_ctrl_dst {
- int errors;
- };
-
- @@ -16,7 +16,7 @@
-
- static void hostapd_ctrl_iface_send(struct hostapd_data *hapd, int level,
- const char *buf, size_t len);
- -@@ -153,6 +155,68 @@ static int hostapd_ctrl_iface_new_sta(st
- +@@ -156,6 +158,68 @@ static int hostapd_ctrl_iface_new_sta(st
- return 0;
- }
-
- @@ -85,14 +85,14 @@
-
- #ifdef CONFIG_IEEE80211W
- #ifdef NEED_AP_MLME
- -@@ -1199,6 +1263,10 @@ static void hostapd_ctrl_iface_receive(i
- - reply_len += res;
- - }
- - #endif /* CONFIG_NO_RADIUS */
- +@@ -1546,6 +1610,10 @@ static void hostapd_ctrl_iface_receive(i
- + } else if (os_strncmp(buf, "VENDOR ", 7) == 0) {
- + reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply,
- + reply_size);
- + } else if (os_strcmp(buf, "DOWN") == 0) {
- + hostapd_ctrl_iface_set_down(hapd);
- + } else if (os_strncmp(buf, "UPDATE ", 7) == 0) {
- + hostapd_ctrl_iface_update(hapd, buf + 7);
- - } else if (os_strcmp(buf, "STA-FIRST") == 0) {
- - reply_len = hostapd_ctrl_iface_sta_first(hapd, reply,
- - reply_size);
- +
- + } else {
- + os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
- diff --git a/package/hostapd/patches/370-ap_sta_support.patch b/package/hostapd/patches/370-ap_sta_support.patch
- index a3d0572..8a92ead 100644
- --- a/package/hostapd/patches/370-ap_sta_support.patch
- +++ b/package/hostapd/patches/370-ap_sta_support.patch
- @@ -1,6 +1,6 @@
- --- a/wpa_supplicant/wpa_supplicant_i.h
- +++ b/wpa_supplicant/wpa_supplicant_i.h
- -@@ -96,6 +96,11 @@ struct wpa_interface {
- +@@ -108,6 +108,11 @@ struct wpa_interface {
- const char *ifname;
-
- /**
- @@ -12,7 +12,7 @@
- * bridge_ifname - Optional bridge interface name
- *
- * If the driver interface (ifname) is included in a Linux bridge
- -@@ -325,6 +330,8 @@ struct wpa_supplicant {
- +@@ -395,6 +400,8 @@ struct wpa_supplicant {
- #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
- char bridge_ifname[16];
-
- @@ -20,12 +20,12 @@
- +
- char *confname;
- char *confanother;
- - struct wpa_config *conf;
- +
- --- a/wpa_supplicant/Makefile
- +++ b/wpa_supplicant/Makefile
- @@ -13,6 +13,10 @@ PKG_CONFIG ?= pkg-config
- - CFLAGS += -I../src
- - CFLAGS += -I../src/utils
- + CFLAGS += -I$(abspath ../src)
- + CFLAGS += -I$(abspath ../src/utils)
-
- +ifdef MULTICALL
- +CFLAGS += -DMULTICALL
- @@ -34,7 +34,7 @@
- -include .config
- -include $(if $(MULTICALL),../hostapd/.config)
-
- -@@ -76,6 +80,8 @@ OBJS_c = wpa_cli.o ../src/common/wpa_ctr
- +@@ -82,6 +86,8 @@ OBJS_c = wpa_cli.o ../src/common/wpa_ctr
- OBJS_c += ../src/utils/wpa_debug.o
- OBJS_c += ../src/utils/common.o
-
- @@ -45,9 +45,9 @@
- CONFIG_OS=win32
- --- a/wpa_supplicant/wpa_supplicant.c
- +++ b/wpa_supplicant/wpa_supplicant.c
- -@@ -109,6 +109,46 @@ extern int wpa_debug_show_keys;
- - extern int wpa_debug_timestamp;
- - extern struct wpa_driver_ops *wpa_drivers[];
- +@@ -105,6 +105,55 @@ const char *wpa_supplicant_full_license5
- + "\n";
- + #endif /* CONFIG_NO_STDOUT_DEBUG */
-
- +static int hostapd_stop(struct wpa_supplicant *wpa_s)
- +{
- @@ -69,14 +69,23 @@
- + int len = sizeof(buf);
- + enum hostapd_hw_mode hw_mode;
- + u8 channel;
- ++ int sec_chan = 0;
- + int ret;
- +
- + if (!bss)
- + return;
- +
- ++ if (bss->ht_param & HT_INFO_HT_PARAM_STA_CHNL_WIDTH) {
- ++ int sec = bss->ht_param & HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK;
- ++ if (sec == HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE)
- ++ sec_chan = 1;
- ++ else if (sec == HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW)
- ++ sec_chan = -1;
- ++ }
- ++
- + hw_mode = ieee80211_freq_to_chan(bss->freq, &channel);
- -+ if (asprintf(&cmd, "UPDATE channel=%d sec_chan=0 hw_mode=%d ieee80211n=%d",
- -+ channel, hw_mode, !!bss->ht_capab) < 0)
- ++ if (asprintf(&cmd, "UPDATE channel=%d sec_chan=%d hw_mode=%d ieee80211n=%d",
- ++ channel, sec_chan, hw_mode, !!bss->ht_capab) < 0)
- + return -1;
- +
- + ret = wpa_ctrl_request(wpa_s->hostapd, cmd, os_strlen(cmd), buf, &len, NULL);
- @@ -92,7 +101,7 @@
- /* Configure default/group WEP keys for static WEP */
- int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
- {
- -@@ -685,8 +725,12 @@ void wpa_supplicant_set_state(struct wpa
- +@@ -711,8 +760,12 @@ void wpa_supplicant_set_state(struct wpa
- #endif /* CONFIG_P2P */
-
- sme_sched_obss_scan(wpa_s, 1);
- @@ -105,7 +114,7 @@
- wpa_s->new_connection = 1;
- wpa_drv_set_operstate(wpa_s, 0);
- #ifndef IEEE8021X_EAPOL
- -@@ -2906,6 +2950,20 @@ static int wpa_supplicant_init_iface(str
- +@@ -3595,6 +3648,20 @@ static int wpa_supplicant_init_iface(str
- sizeof(wpa_s->bridge_ifname));
- }
-
- @@ -126,7 +135,7 @@
- /* RSNA Supplicant Key Management - INITIALIZE */
- eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE);
- eapol_sm_notify_portValid(wpa_s->eapol, FALSE);
- -@@ -3125,6 +3183,11 @@ static void wpa_supplicant_deinit_iface(
- +@@ -3798,6 +3865,11 @@ static void wpa_supplicant_deinit_iface(
- if (terminate)
- wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING);
-
- @@ -148,41 +157,45 @@
- #include "drivers/driver.h"
- #include "wpa_supplicant_i.h"
- #include "config.h"
- -@@ -245,6 +246,9 @@ static void calculate_update_time(const
- +@@ -247,6 +248,10 @@ static void calculate_update_time(const
- static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src,
- - struct os_time *fetch_time)
- + struct os_reltime *fetch_time)
- {
- + struct ieee80211_ht_capabilities *capab;
- ++ struct ieee80211_ht_operation *oper;
- + struct ieee802_11_elems elems;
- +
- dst->flags = src->flags;
- os_memcpy(dst->bssid, src->bssid, ETH_ALEN);
- dst->freq = src->freq;
- -@@ -255,6 +259,12 @@ static void wpa_bss_copy_res(struct wpa_
- +@@ -257,6 +262,15 @@ static void wpa_bss_copy_res(struct wpa_
- dst->level = src->level;
- dst->tsf = src->tsf;
-
- + memset(&elems, 0, sizeof(elems));
- + ieee802_11_parse_elems((u8 *) (src + 1), src->ie_len, &elems, 0);
- + capab = (struct ieee80211_ht_capabilities *) elems.ht_capabilities;
- ++ oper = (struct ieee80211_ht_operation *) elems.ht_operation;
- + if (capab)
- + dst->ht_capab = le_to_host16(capab->ht_capabilities_info);
- ++ if (oper)
- ++ dst->ht_param = oper->ht_param;
- +
- calculate_update_time(fetch_time, src->age, &dst->last_update);
- }
-
- --- a/wpa_supplicant/main.c
- +++ b/wpa_supplicant/main.c
- -@@ -27,7 +27,7 @@ static void usage(void)
- - " wpa_supplicant [-BddhKLqqstuvW] [-P<pid file>] "
- +@@ -33,7 +33,7 @@ static void usage(void)
- + "vW] [-P<pid file>] "
- "[-g<global ctrl>] \\\n"
- " [-G<group>] \\\n"
- - " -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] "
- + " -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-H<hostapd path>] "
- "[-p<driver_param>] \\\n"
- - " [-b<br_ifname>] [-f<debug file>] [-e<entropy file>] "
- - "\\\n"
- -@@ -72,6 +72,7 @@ static void usage(void)
- + " [-b<br_ifname>] [-e<entropy file>]"
- + #ifdef CONFIG_DEBUG_FILE
- +@@ -84,6 +84,7 @@ static void usage(void)
- #endif /* CONFIG_DEBUG_LINUX_TRACING */
- printf(" -t = include timestamp in debug messages\n"
- " -h = show this help text\n"
- @@ -190,16 +203,16 @@
- " -L = show license (BSD)\n"
- " -o = override driver parameter for new interfaces\n"
- " -O = override ctrl_interface parameter for new interfaces\n"
- -@@ -160,7 +161,7 @@ int main(int argc, char *argv[])
- +@@ -175,7 +176,7 @@ int main(int argc, char *argv[])
-
- for (;;) {
- c = getopt(argc, argv,
- -- "b:Bc:C:D:de:f:g:G:hi:I:KLNo:O:p:P:qsTtuvW");
- -+ "b:Bc:C:D:de:f:g:G:hH:i:I:KLNo:O:p:P:qsTtuvW");
- +- "b:Bc:C:D:de:f:g:G:hi:I:KLm:No:O:p:P:qsTtuvW");
- ++ "b:Bc:C:D:de:f:g:G:hH:i:I:KLm:No:O:p:P:qsTtuvW");
- if (c < 0)
- break;
- switch (c) {
- -@@ -207,6 +208,9 @@ int main(int argc, char *argv[])
- +@@ -222,6 +223,9 @@ int main(int argc, char *argv[])
- usage();
- exitcode = 0;
- goto out;
- @@ -211,12 +224,14 @@
- break;
- --- a/wpa_supplicant/bss.h
- +++ b/wpa_supplicant/bss.h
- -@@ -69,6 +69,8 @@ struct wpa_bss {
- +@@ -70,6 +70,10 @@ struct wpa_bss {
- u8 ssid[32];
- /** Length of SSID */
- size_t ssid_len;
- + /** HT caapbilities */
- + u16 ht_capab;
- ++ /* Five octets of HT Operation Information */
- ++ u8 ht_param;
- /** Frequency of the channel in MHz (e.g., 2412 = channel 1) */
- int freq;
- /** Beacon interval in TUs (host byte order) */
- diff --git a/package/hostapd/patches/380-disable_ctrl_iface_mib.patch b/package/hostapd/patches/380-disable_ctrl_iface_mib.patch
- index 27f21bd..dee1ab3 100644
- --- a/package/hostapd/patches/380-disable_ctrl_iface_mib.patch
- +++ b/package/hostapd/patches/380-disable_ctrl_iface_mib.patch
- @@ -1,6 +1,6 @@
- --- a/hostapd/Makefile
- +++ b/hostapd/Makefile
- -@@ -144,6 +144,9 @@ endif
- +@@ -163,6 +163,9 @@ endif
- ifdef CONFIG_NO_CTRL_IFACE
- CFLAGS += -DCONFIG_NO_CTRL_IFACE
- else
- @@ -12,28 +12,15 @@
- endif
- --- a/hostapd/ctrl_iface.c
- +++ b/hostapd/ctrl_iface.c
- -@@ -1234,6 +1234,7 @@ static void hostapd_ctrl_iface_receive(i
- - } else if (os_strcmp(buf, "STATUS") == 0) {
- - reply_len = hostapd_ctrl_iface_status(hapd, reply,
- +@@ -1447,6 +1447,7 @@ static void hostapd_ctrl_iface_receive(i
- reply_size);
- + } else if (os_strcmp(buf, "STATUS-DRIVER") == 0) {
- + reply_len = hostapd_drv_status(hapd, reply, reply_size);
- +#ifdef CONFIG_CTRL_IFACE_MIB
- } else if (os_strcmp(buf, "MIB") == 0) {
- reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
- if (reply_len >= 0) {
- -@@ -1263,10 +1264,12 @@ static void hostapd_ctrl_iface_receive(i
- - reply_len += res;
- - }
- - #endif /* CONFIG_NO_RADIUS */
- -+#endif
- - } else if (os_strcmp(buf, "DOWN") == 0) {
- - hostapd_ctrl_iface_set_down(hapd);
- - } else if (os_strncmp(buf, "UPDATE ", 7) == 0) {
- - hostapd_ctrl_iface_update(hapd, buf + 7);
- -+#ifdef CONFIG_CTRL_IFACE_MIB
- - } else if (os_strcmp(buf, "STA-FIRST") == 0) {
- - reply_len = hostapd_ctrl_iface_sta_first(hapd, reply,
- - reply_size);
- -@@ -1276,6 +1279,7 @@ static void hostapd_ctrl_iface_receive(i
- +@@ -1488,6 +1489,7 @@ static void hostapd_ctrl_iface_receive(i
- } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
- reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply,
- reply_size);
- @@ -43,7 +30,7 @@
- reply_len = -1;
- --- a/wpa_supplicant/Makefile
- +++ b/wpa_supplicant/Makefile
- -@@ -778,6 +778,9 @@ ifdef CONFIG_WNM
- +@@ -805,6 +805,9 @@ ifdef CONFIG_WNM
- OBJS += ../src/ap/wnm_ap.o
- endif
- ifdef CONFIG_CTRL_IFACE
- @@ -55,7 +42,7 @@
-
- --- a/wpa_supplicant/ctrl_iface.c
- +++ b/wpa_supplicant/ctrl_iface.c
- -@@ -5262,6 +5262,7 @@ char * wpa_supplicant_ctrl_iface_process
- +@@ -6243,6 +6243,7 @@ char * wpa_supplicant_ctrl_iface_process
- reply_len = -1;
- } else if (os_strncmp(buf, "NOTE ", 5) == 0) {
- wpa_printf(MSG_INFO, "NOTE: %s", buf + 5);
- @@ -63,7 +50,7 @@
- } else if (os_strcmp(buf, "MIB") == 0) {
- reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
- if (reply_len >= 0) {
- -@@ -5273,6 +5274,7 @@ char * wpa_supplicant_ctrl_iface_process
- +@@ -6254,6 +6255,7 @@ char * wpa_supplicant_ctrl_iface_process
- else
- reply_len += res;
- }
- @@ -71,7 +58,7 @@
- } else if (os_strncmp(buf, "STATUS", 6) == 0) {
- reply_len = wpa_supplicant_ctrl_iface_status(
- wpa_s, buf + 6, reply, reply_size);
- -@@ -5687,6 +5689,7 @@ char * wpa_supplicant_ctrl_iface_process
- +@@ -6661,6 +6663,7 @@ char * wpa_supplicant_ctrl_iface_process
- reply_len = wpa_supplicant_ctrl_iface_bss(
- wpa_s, buf + 4, reply, reply_size);
- #ifdef CONFIG_AP
- @@ -79,7 +66,7 @@
- } else if (os_strcmp(buf, "STA-FIRST") == 0) {
- reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size);
- } else if (os_strncmp(buf, "STA ", 4) == 0) {
- -@@ -5695,6 +5698,7 @@ char * wpa_supplicant_ctrl_iface_process
- +@@ -6669,6 +6672,7 @@ char * wpa_supplicant_ctrl_iface_process
- } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
- reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply,
- reply_size);
- @@ -89,15 +76,15 @@
- reply_len = -1;
- --- a/src/ap/ctrl_iface_ap.c
- +++ b/src/ap/ctrl_iface_ap.c
- -@@ -20,6 +20,7 @@
- +@@ -21,6 +21,7 @@
- #include "ctrl_iface_ap.h"
- #include "ap_drv_ops.h"
-
- +#ifdef CONFIG_CTRL_IFACE_MIB
-
- - static int hostapd_get_sta_conn_time(struct sta_info *sta,
- - char *buf, size_t buflen)
- -@@ -129,6 +130,7 @@ int hostapd_ctrl_iface_sta_next(struct h
- + static int hostapd_get_sta_tx_rx(struct hostapd_data *hapd,
- + struct sta_info *sta,
- +@@ -214,6 +215,7 @@ int hostapd_ctrl_iface_sta_next(struct h
- return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen);
- }
-
- @@ -105,14 +92,14 @@
-
- #ifdef CONFIG_P2P_MANAGER
- static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
- -@@ -423,3 +425,4 @@ int hostapd_parse_csa_settings(const cha
- +@@ -526,3 +528,4 @@ int hostapd_parse_csa_settings(const cha
-
- return 0;
- }
- +
- --- a/src/ap/ieee802_1x.c
- +++ b/src/ap/ieee802_1x.c
- -@@ -1938,6 +1938,7 @@ static const char * bool_txt(Boolean boo
- +@@ -2124,6 +2124,7 @@ static const char * bool_txt(Boolean boo
- return bool_val ? "TRUE" : "FALSE";
- }
-
- @@ -120,17 +107,17 @@
-
- int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
- {
- -@@ -2090,6 +2091,7 @@ int ieee802_1x_get_mib_sta(struct hostap
- +@@ -2291,6 +2292,7 @@ int ieee802_1x_get_mib_sta(struct hostap
- return len;
- }
-
- +#endif
-
- static void ieee802_1x_finished(struct hostapd_data *hapd,
- - struct sta_info *sta, int success)
- + struct sta_info *sta, int success,
- --- a/src/ap/wpa_auth.c
- +++ b/src/ap/wpa_auth.c
- -@@ -2708,6 +2708,7 @@ static const char * wpa_bool_txt(int boo
- +@@ -2832,6 +2832,7 @@ static const char * wpa_bool_txt(int boo
- return bool ? "TRUE" : "FALSE";
- }
-
- @@ -138,7 +125,7 @@
-
- #define RSN_SUITE "%02x-%02x-%02x-%d"
- #define RSN_SUITE_ARG(s) \
- -@@ -2852,7 +2853,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
- +@@ -2976,7 +2977,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
-
- return len;
- }
- @@ -149,7 +136,7 @@
- {
- --- a/src/rsn_supp/wpa.c
- +++ b/src/rsn_supp/wpa.c
- -@@ -1844,6 +1844,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
- +@@ -1911,6 +1911,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
- }
-
-
- @@ -158,7 +145,7 @@
- #define RSN_SUITE "%02x-%02x-%02x-%d"
- #define RSN_SUITE_ARG(s) \
- ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
- -@@ -1927,6 +1929,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
- +@@ -1994,6 +1996,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
-
- return (int) len;
- }
- diff --git a/package/hostapd/patches/390-wpa_ie_cap_workaround.patch b/package/hostapd/patches/390-wpa_ie_cap_workaround.patch
- index 00a3222..40148fc 100644
- --- a/package/hostapd/patches/390-wpa_ie_cap_workaround.patch
- +++ b/package/hostapd/patches/390-wpa_ie_cap_workaround.patch
- @@ -1,6 +1,6 @@
- --- a/src/common/wpa_common.c
- +++ b/src/common/wpa_common.c
- -@@ -959,6 +959,31 @@ const char * wpa_key_mgmt_txt(int key_mg
- +@@ -1002,6 +1002,31 @@ const char * wpa_key_mgmt_txt(int key_mg
- }
-
-
- @@ -32,7 +32,7 @@
- int wpa_compare_rsn_ie(int ft_initial_assoc,
- const u8 *ie1, size_t ie1len,
- const u8 *ie2, size_t ie2len)
- -@@ -966,8 +991,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
- +@@ -1009,8 +1034,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
- if (ie1 == NULL || ie2 == NULL)
- return -1;
-
- diff --git a/package/hostapd/patches/400-terminate_on_setup_failure.patch b/package/hostapd/patches/400-terminate_on_setup_failure.patch
- deleted file mode 100644
- index 0d9065a..0000000
- --- a/package/hostapd/patches/400-terminate_on_setup_failure.patch
- +++ /dev/null
- @@ -1,85 +0,0 @@
- ---- a/src/ap/hostapd.c
- -+++ b/src/ap/hostapd.c
- -@@ -1103,13 +1103,8 @@ int hostapd_setup_interface_complete(str
- - size_t j;
- - u8 *prev_addr;
- -
- -- if (err) {
- -- wpa_printf(MSG_ERROR, "Interface initialization failed");
- -- hostapd_set_state(iface, HAPD_IFACE_DISABLED);
- -- if (iface->interfaces && iface->interfaces->terminate_on_error)
- -- eloop_terminate();
- -- return -1;
- -- }
- -+ if (err)
- -+ goto error;
- -
- - wpa_printf(MSG_DEBUG, "Completing interface initialization");
- - if (iface->conf->channel) {
- -@@ -1140,7 +1135,7 @@ int hostapd_setup_interface_complete(str
- - hapd->iconf->vht_oper_centr_freq_seg1_idx)) {
- - wpa_printf(MSG_ERROR, "Could not set channel for "
- - "kernel driver");
- -- return -1;
- -+ goto error;
- - }
- - }
- -
- -@@ -1151,7 +1146,7 @@ int hostapd_setup_interface_complete(str
- - hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
- - HOSTAPD_LEVEL_WARNING,
- - "Failed to prepare rates table.");
- -- return -1;
- -+ goto error;
- - }
- - }
- -
- -@@ -1159,14 +1154,14 @@ int hostapd_setup_interface_complete(str
- - hostapd_set_rts(hapd, hapd->iconf->rts_threshold)) {
- - wpa_printf(MSG_ERROR, "Could not set RTS threshold for "
- - "kernel driver");
- -- return -1;
- -+ goto error;
- - }
- -
- - if (hapd->iconf->fragm_threshold > -1 &&
- - hostapd_set_frag(hapd, hapd->iconf->fragm_threshold)) {
- - wpa_printf(MSG_ERROR, "Could not set fragmentation threshold "
- - "for kernel driver");
- -- return -1;
- -+ goto error;
- - }
- -
- - prev_addr = hapd->own_addr;
- -@@ -1176,7 +1171,7 @@ int hostapd_setup_interface_complete(str
- - if (j)
- - os_memcpy(hapd->own_addr, prev_addr, ETH_ALEN);
- - if (hostapd_setup_bss(hapd, j == 0))
- -- return -1;
- -+ goto error;
- - if (hostapd_mac_comp_empty(hapd->conf->bssid) == 0)
- - prev_addr = hapd->own_addr;
- - }
- -@@ -1191,7 +1186,7 @@ int hostapd_setup_interface_complete(str
- - if (hostapd_driver_commit(hapd) < 0) {
- - wpa_printf(MSG_ERROR, "%s: Failed to commit driver "
- - "configuration", __func__);
- -- return -1;
- -+ goto error;
- - }
- -
- - /*
- -@@ -1216,6 +1211,13 @@ int hostapd_setup_interface_complete(str
- - iface->interfaces->terminate_on_error--;
- -
- - return 0;
- -+
- -+error:
- -+ wpa_printf(MSG_ERROR, "Interface initialization failed");
- -+ hostapd_set_state(iface, HAPD_IFACE_DISABLED);
- -+ if (iface->interfaces && iface->interfaces->terminate_on_error)
- -+ eloop_terminate();
- -+ return -1;
- - }
- -
- -
- diff --git a/package/hostapd/patches/410-bring_down_interface.patch b/package/hostapd/patches/410-bring_down_interface.patch
- index 31033a0..165484b 100644
- --- a/package/hostapd/patches/410-bring_down_interface.patch
- +++ b/package/hostapd/patches/410-bring_down_interface.patch
- @@ -1,6 +1,6 @@
- --- a/src/drivers/driver_nl80211.c
- +++ b/src/drivers/driver_nl80211.c
- -@@ -8480,12 +8480,7 @@ static int wpa_driver_nl80211_set_mode(s
- +@@ -9070,12 +9070,7 @@ static int wpa_driver_nl80211_set_mode(s
- /* Try to set the mode again while the interface is
- * down */
- ret = nl80211_set_mode(drv, drv->ifindex, nlmode);
- @@ -14,7 +14,7 @@
- break;
- } else
- wpa_printf(MSG_DEBUG, "nl80211: Failed to set "
- -@@ -8498,6 +8493,8 @@ static int wpa_driver_nl80211_set_mode(s
- +@@ -9088,6 +9083,8 @@ static int wpa_driver_nl80211_set_mode(s
- "interface is down");
- drv->nlmode = nlmode;
- drv->ignore_if_down_event = 1;
- diff --git a/package/hostapd/patches/420-fix_wps_pin_crash.patch b/package/hostapd/patches/420-fix_wps_pin_crash.patch
- index 130bd53..31995c4 100644
- --- a/package/hostapd/patches/420-fix_wps_pin_crash.patch
- +++ b/package/hostapd/patches/420-fix_wps_pin_crash.patch
- @@ -1,6 +1,6 @@
- --- a/hostapd/ctrl_iface.c
- +++ b/hostapd/ctrl_iface.c
- -@@ -480,6 +480,9 @@ static int hostapd_ctrl_iface_wps_ap_pin
- +@@ -540,6 +540,9 @@ static int hostapd_ctrl_iface_wps_ap_pin
- char *pos;
- const char *pin_txt;
-
- diff --git a/package/hostapd/patches/430-wps_single_auth_enc_type.patch b/package/hostapd/patches/430-wps_single_auth_enc_type.patch
- index 6e86658..8dae52b 100644
- --- a/package/hostapd/patches/430-wps_single_auth_enc_type.patch
- +++ b/package/hostapd/patches/430-wps_single_auth_enc_type.patch
- @@ -1,6 +1,6 @@
- --- a/src/ap/wps_hostapd.c
- +++ b/src/ap/wps_hostapd.c
- -@@ -1069,11 +1069,9 @@ int hostapd_init_wps(struct hostapd_data
- +@@ -1051,11 +1051,9 @@ int hostapd_init_wps(struct hostapd_data
-
- if (conf->rsn_pairwise & WPA_CIPHER_CCMP)
- wps->encr_types |= WPS_ENCR_AES;
- @@ -14,7 +14,7 @@
- if (conf->wpa_key_mgmt & WPA_KEY_MGMT_PSK)
- wps->auth_types |= WPS_AUTH_WPAPSK;
- if (conf->wpa_key_mgmt & WPA_KEY_MGMT_IEEE8021X)
- -@@ -1081,7 +1079,7 @@ int hostapd_init_wps(struct hostapd_data
- +@@ -1063,7 +1061,7 @@ int hostapd_init_wps(struct hostapd_data
-
- if (conf->wpa_pairwise & WPA_CIPHER_CCMP)
- wps->encr_types |= WPS_ENCR_AES;
- diff --git a/package/hostapd/patches/440-dynamic_20_40_mhz.patch b/package/hostapd/patches/440-dynamic_20_40_mhz.patch
- deleted file mode 100644
- index 905ec2c..0000000
- --- a/package/hostapd/patches/440-dynamic_20_40_mhz.patch
- +++ /dev/null
- @@ -1,206 +0,0 @@
- ---- a/hostapd/config_file.c
- -+++ b/hostapd/config_file.c
- -@@ -2422,6 +2422,10 @@ static int hostapd_config_fill(struct ho
- - "ht_capab", line);
- - errors++;
- - }
- -+ } else if (os_strcmp(buf, "dynamic_ht40") == 0) {
- -+ conf->dynamic_ht40 = atoi(pos);
- -+ if (conf->dynamic_ht40 == 1)
- -+ conf->dynamic_ht40 = 1500;
- - } else if (os_strcmp(buf, "require_ht") == 0) {
- - conf->require_ht = atoi(pos);
- - } else if (os_strcmp(buf, "obss_interval") == 0) {
- ---- a/src/ap/ap_config.h
- -+++ b/src/ap/ap_config.h
- -@@ -531,6 +531,7 @@ struct hostapd_config {
- - int ieee80211n;
- - int secondary_channel;
- - int require_ht;
- -+ int dynamic_ht40;
- - int obss_interval;
- - u32 vht_capab;
- - int ieee80211ac;
- ---- a/src/ap/hostapd.c
- -+++ b/src/ap/hostapd.c
- -@@ -23,6 +23,7 @@
- - #include "beacon.h"
- - #include "iapp.h"
- - #include "ieee802_1x.h"
- -+#include "ieee802_11.h"
- - #include "ieee802_11_auth.h"
- - #include "vlan_init.h"
- - #include "wpa_auth.h"
- -@@ -332,6 +333,7 @@ static void hostapd_cleanup(struct hosta
- - static void hostapd_cleanup_iface_partial(struct hostapd_iface *iface)
- - {
- - wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface);
- -+ hostapd_deinit_ht(iface);
- - hostapd_free_hw_features(iface->hw_features, iface->num_hw_features);
- - iface->hw_features = NULL;
- - os_free(iface->current_rates);
- ---- a/src/ap/hostapd.h
- -+++ b/src/ap/hostapd.h
- -@@ -326,6 +326,9 @@ struct hostapd_iface {
- - /* Overlapping BSS information */
- - int olbc_ht;
- -
- -+ int force_20mhz;
- -+ struct os_time last_20mhz_trigger;
- -+
- - u16 ht_op_mode;
- -
- - /* surveying helpers */
- ---- a/src/ap/ieee802_11.c
- -+++ b/src/ap/ieee802_11.c
- -@@ -1538,6 +1538,9 @@ static void handle_beacon(struct hostapd
- - sizeof(mgmt->u.beacon)), &elems,
- - 0);
- -
- -+ if (!elems.ht_capabilities)
- -+ hostapd_trigger_20mhz(hapd->iface);
- -+
- - ap_list_process_beacon(hapd->iface, mgmt, &elems, fi);
- - }
- -
- ---- a/src/ap/ieee802_11.h
- -+++ b/src/ap/ieee802_11.h
- -@@ -82,4 +82,17 @@ int hostapd_update_time_adv(struct hosta
- - void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr);
- - u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid);
- -
- -+#ifdef CONFIG_IEEE80211N
- -+void hostapd_trigger_20mhz(struct hostapd_iface *iface);
- -+void hostapd_deinit_ht(struct hostapd_iface *iface);
- -+
- -+#else
- -+static inline void hostapd_deinit_ht(struct hostapd_iface *iface)
- -+{
- -+}
- -+static inline void hostapd_trigger_20mhz(struct hostapd_iface *iface)
- -+{
- -+}
- -+#endif /* CONFIG_IEEE80211N */
- -+
- - #endif /* IEEE802_11_H */
- ---- a/src/ap/ieee802_11_ht.c
- -+++ b/src/ap/ieee802_11_ht.c
- -@@ -20,9 +20,11 @@
- - #include "drivers/driver.h"
- - #include "hostapd.h"
- - #include "ap_config.h"
- -+#include "ap_drv_ops.h"
- - #include "sta_info.h"
- - #include "beacon.h"
- - #include "ieee802_11.h"
- -+#include "utils/eloop.h"
- -
- -
- - u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid)
- -@@ -86,12 +88,15 @@ u8 * hostapd_eid_ht_operation(struct hos
- -
- - oper->control_chan = hapd->iconf->channel;
- - oper->operation_mode = host_to_le16(hapd->iface->ht_op_mode);
- -- if (hapd->iconf->secondary_channel == 1)
- -- oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE |
- -- HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
- -- if (hapd->iconf->secondary_channel == -1)
- -- oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW |
- -- HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
- -+
- -+ if (!hapd->iface->force_20mhz) {
- -+ if (hapd->iconf->secondary_channel == 1)
- -+ oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE |
- -+ HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
- -+ if (hapd->iconf->secondary_channel == -1)
- -+ oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW |
- -+ HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
- -+ }
- -
- - pos += sizeof(*oper);
- -
- -@@ -286,3 +291,84 @@ void hostapd_get_ht_capab(struct hostapd
- -
- - neg_ht_cap->ht_capabilities_info = host_to_le16(cap);
- - }
- -+
- -+static void hostapd_set_force_20mhz(struct hostapd_iface *iface);
- -+
- -+static void hostapd_restore_40mhz(void *eloop_data, void *user_ctx)
- -+{
- -+ struct hostapd_iface *iface = eloop_data;
- -+ struct os_time time;
- -+ int timeout;
- -+
- -+ if (!iface->last_20mhz_trigger.sec)
- -+ return;
- -+
- -+ os_get_time(&time);
- -+ timeout = iface->last_20mhz_trigger.sec + iface->conf->dynamic_ht40 -
- -+ time.sec;
- -+
- -+ if (timeout > 0) {
- -+ eloop_register_timeout(timeout, 0, hostapd_restore_40mhz,
- -+ iface, NULL);
- -+ return;
- -+ }
- -+
- -+ iface->last_20mhz_trigger.sec = 0;
- -+ iface->last_20mhz_trigger.usec = 0;
- -+
- -+ iface->force_20mhz = 0;
- -+ hostapd_set_force_20mhz(iface);
- -+}
- -+
- -+static void hostapd_set_force_20mhz(struct hostapd_iface *iface)
- -+{
- -+ int secondary_channel;
- -+ int i;
- -+
- -+ ieee802_11_set_beacons(iface);
- -+
- -+ for (i = 0; i < iface->num_bss; i++) {
- -+ struct hostapd_data *hapd = iface->bss[i];
- -+
- -+ if (iface->force_20mhz)
- -+ secondary_channel = 0;
- -+ else
- -+ secondary_channel = hapd->iconf->secondary_channel;
- -+
- -+ if (hostapd_set_freq(hapd, hapd->iconf->hw_mode, iface->freq,
- -+ hapd->iconf->channel,
- -+ hapd->iconf->ieee80211n,
- -+ hapd->iconf->ieee80211ac,
- -+ secondary_channel,
- -+ hapd->iconf->vht_oper_chwidth,
- -+ hapd->iconf->vht_oper_centr_freq_seg0_idx,
- -+ hapd->iconf->vht_oper_centr_freq_seg1_idx)) {
- -+ wpa_printf(MSG_ERROR, "Could not set channel for "
- -+ "kernel driver");
- -+ }
- -+ }
- -+}
- -+
- -+void hostapd_deinit_ht(struct hostapd_iface *iface)
- -+{
- -+ eloop_cancel_timeout(hostapd_restore_40mhz, iface, NULL);
- -+}
- -+
- -+void hostapd_trigger_20mhz(struct hostapd_iface *iface)
- -+{
- -+ if (!iface->conf->dynamic_ht40)
- -+ return;
- -+
- -+ if (!iface->force_20mhz) {
- -+ iface->force_20mhz = 1;
- -+ hostapd_set_force_20mhz(iface);
- -+ }
- -+
- -+ if (!iface->last_20mhz_trigger.sec) {
- -+ eloop_cancel_timeout(hostapd_restore_40mhz, iface, NULL);
- -+ eloop_register_timeout(iface->conf->dynamic_ht40, 0,
- -+ hostapd_restore_40mhz, iface, NULL);
- -+ }
- -+
- -+ os_get_time(&iface->last_20mhz_trigger);
- -+}
- diff --git a/package/hostapd/patches/450-limit_debug_messages.patch b/package/hostapd/patches/450-limit_debug_messages.patch
- index aaea941..08f17dc 100644
- --- a/package/hostapd/patches/450-limit_debug_messages.patch
- +++ b/package/hostapd/patches/450-limit_debug_messages.patch
- @@ -20,40 +20,41 @@
- {
- size_t i;
-
- -@@ -375,20 +375,9 @@ static void _wpa_hexdump(int level, cons
- +@@ -375,20 +375,8 @@ static void _wpa_hexdump(int level, cons
- #endif /* CONFIG_ANDROID_LOG */
- }
-
- --void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len)
- +-void wpa_hexdump(int level, const char *title, const void *buf, size_t len)
- -{
- - _wpa_hexdump(level, title, buf, len, 1);
- -}
- -
- -
- --void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len)
- +-void wpa_hexdump_key(int level, const char *title, const void *buf, size_t len)
- -{
- - _wpa_hexdump(level, title, buf, len, wpa_debug_show_keys);
- -}
- -
- -
- --static void _wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
- +-
- +-static void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
- - size_t len, int show)
- -+void _wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
- ++void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
- + size_t len, int show)
- {
- size_t i, llen;
- const u8 *pos = buf;
- -@@ -495,19 +484,6 @@ static void _wpa_hexdump_ascii(int level
- +@@ -495,20 +483,6 @@ static void _wpa_hexdump_ascii(int level
- }
-
-
- --void wpa_hexdump_ascii(int level, const char *title, const u8 *buf, size_t len)
- +-void wpa_hexdump_ascii(int level, const char *title, const void *buf,
- +- size_t len)
- -{
- - _wpa_hexdump_ascii(level, title, buf, len, 1);
- -}
- -
- -
- --void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf,
- +-void wpa_hexdump_ascii_key(int level, const char *title, const void *buf,
- - size_t len)
- -{
- - _wpa_hexdump_ascii(level, title, buf, len, wpa_debug_show_keys);
- @@ -63,7 +64,7 @@
- #ifdef CONFIG_DEBUG_FILE
- static char *last_path = NULL;
- #endif /* CONFIG_DEBUG_FILE */
- -@@ -591,7 +567,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_
- +@@ -592,7 +566,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_
- }
-
-
- @@ -72,7 +73,7 @@
- {
- va_list ap;
- char *buf;
- -@@ -625,7 +601,7 @@ void wpa_msg(void *ctx, int level, const
- +@@ -630,7 +604,7 @@ void wpa_msg(void *ctx, int level, const
- }
-
-
- @@ -83,14 +84,14 @@
- char *buf;
- --- a/src/utils/wpa_debug.h
- +++ b/src/utils/wpa_debug.h
- -@@ -43,6 +43,17 @@ int wpa_debug_open_file(const char *path
- +@@ -47,6 +47,17 @@ int wpa_debug_open_file(const char *path
- int wpa_debug_reopen_file(void);
- void wpa_debug_close_file(void);
-
- +/* internal */
- +void _wpa_hexdump(int level, const char *title, const u8 *buf,
- + size_t len, int show);
- -+void _wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
- ++void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
- + size_t len, int show);
- +extern int wpa_debug_show_keys;
- +
- @@ -101,7 +102,7 @@
- /**
- * wpa_debug_printf_timestamp - Print timestamp for debug output
- *
- -@@ -63,9 +74,15 @@ void wpa_debug_print_timestamp(void);
- +@@ -67,9 +78,15 @@ void wpa_debug_print_timestamp(void);
- *
- * Note: New line '\n' is added to the end of the text when printing to stdout.
- */
- @@ -118,11 +119,11 @@
- /**
- * wpa_hexdump - conditional hex dump
- * @level: priority level (MSG_*) of the message
- -@@ -77,7 +94,13 @@ PRINTF_FORMAT(2, 3);
- +@@ -81,7 +98,13 @@ PRINTF_FORMAT(2, 3);
- * output may be directed to stdout, stderr, and/or syslog based on
- * configuration. The contents of buf is printed out has hex dump.
- */
- --void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len);
- +-void wpa_hexdump(int level, const char *title, const void *buf, size_t len);
- +static inline void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len)
- +{
- + if (level < CONFIG_MSG_MIN_PRIORITY)
- @@ -133,11 +134,11 @@
-
- static inline void wpa_hexdump_buf(int level, const char *title,
- const struct wpabuf *buf)
- -@@ -99,7 +122,13 @@ static inline void wpa_hexdump_buf(int l
- +@@ -103,7 +126,13 @@ static inline void wpa_hexdump_buf(int l
- * like wpa_hexdump(), but by default, does not include secret keys (passwords,
- * etc.) in debug output.
- */
- --void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len);
- +-void wpa_hexdump_key(int level, const char *title, const void *buf, size_t len);
- +static inline void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len)
- +{
- + if (level < CONFIG_MSG_MIN_PRIORITY)
- @@ -148,11 +149,11 @@
-
- static inline void wpa_hexdump_buf_key(int level, const char *title,
- const struct wpabuf *buf)
- -@@ -121,8 +150,14 @@ static inline void wpa_hexdump_buf_key(i
- +@@ -125,8 +154,14 @@ static inline void wpa_hexdump_buf_key(i
- * the hex numbers and ASCII characters (for printable range) are shown. 16
- * bytes per line will be shown.
- */
- --void wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
- +-void wpa_hexdump_ascii(int level, const char *title, const void *buf,
- - size_t len);
- +static inline void wpa_hexdump_ascii(int level, const char *title,
- + const u8 *buf, size_t len)
- @@ -165,11 +166,11 @@
-
- /**
- * wpa_hexdump_ascii_key - conditional hex dump, hide keys
- -@@ -138,8 +173,14 @@ void wpa_hexdump_ascii(int level, const
- +@@ -142,8 +177,14 @@ void wpa_hexdump_ascii(int level, const
- * bytes per line will be shown. This works like wpa_hexdump_ascii(), but by
- * default, does not include secret keys (passwords, etc.) in debug output.
- */
- --void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf,
- +-void wpa_hexdump_ascii_key(int level, const char *title, const void *buf,
- - size_t len);
- +static inline void wpa_hexdump_ascii_key(int level, const char *title,
- + const u8 *buf, size_t len)
- @@ -182,7 +183,7 @@
-
- /*
- * wpa_dbg() behaves like wpa_msg(), but it can be removed from build to reduce
- -@@ -174,7 +215,12 @@ void wpa_hexdump_ascii_key(int level, co
- +@@ -178,7 +219,12 @@ void wpa_hexdump_ascii_key(int level, co
- *
- * Note: New line '\n' is added to the end of the text when printing to stdout.
- */
- @@ -196,7 +197,7 @@
-
- /**
- * wpa_msg_ctrl - Conditional printf for ctrl_iface monitors
- -@@ -188,8 +234,13 @@ void wpa_msg(void *ctx, int level, const
- +@@ -192,8 +238,13 @@ void wpa_msg(void *ctx, int level, const
- * attached ctrl_iface monitors. In other words, it can be used for frequent
- * events that do not need to be sent to syslog.
- */
- diff --git a/package/hostapd/patches/460-indicate-features.patch b/package/hostapd/patches/460-indicate-features.patch
- index 7a44da1..cee3e76 100644
- --- a/package/hostapd/patches/460-indicate-features.patch
- +++ b/package/hostapd/patches/460-indicate-features.patch
- @@ -1,23 +1,23 @@
- --- a/hostapd/main.c
- +++ b/hostapd/main.c
- -@@ -14,6 +14,7 @@
- -
- +@@ -15,6 +15,7 @@
- #include "utils/common.h"
- #include "utils/eloop.h"
- + #include "utils/uuid.h"
- +#include "utils/build_features.h"
- #include "crypto/random.h"
- #include "crypto/tls.h"
- #include "common/version.h"
- -@@ -546,7 +547,7 @@ int main(int argc, char *argv[])
- +@@ -558,7 +559,7 @@ int main(int argc, char *argv[])
-
- wpa_supplicant_event = hostapd_wpa_event;
- for (;;) {
- -- c = getopt(argc, argv, "b:Bde:f:hKP:Ttvg:G:");
- -+ c = getopt(argc, argv, "b:Bde:f:hKP:Ttg:G:v::");
- +- c = getopt(argc, argv, "b:Bde:f:hKP:Ttu:vg:G:");
- ++ c = getopt(argc, argv, "b:Bde:f:hKP:Ttu:g:G:v::");
- if (c < 0)
- break;
- switch (c) {
- -@@ -583,6 +584,8 @@ int main(int argc, char *argv[])
- +@@ -595,6 +596,8 @@ int main(int argc, char *argv[])
- break;
- #endif /* CONFIG_DEBUG_LINUX_TRACING */
- case 'v':
- @@ -36,16 +36,16 @@
- #include "wpa_supplicant_i.h"
- #include "driver_i.h"
- #include "p2p_supplicant.h"
- -@@ -161,7 +162,7 @@ int main(int argc, char *argv[])
- +@@ -176,7 +177,7 @@ int main(int argc, char *argv[])
-
- for (;;) {
- c = getopt(argc, argv,
- -- "b:Bc:C:D:de:f:g:G:hH:i:I:KLNo:O:p:P:qsTtuvW");
- -+ "b:Bc:C:D:de:f:g:G:hH:i:I:KLNo:O:p:P:qsTtuv::W");
- +- "b:Bc:C:D:de:f:g:G:hH:i:I:KLm:No:O:p:P:qsTtuvW");
- ++ "b:Bc:C:D:de:f:g:G:hH:i:I:KLm:No:O:p:P:qsTtuv::W");
- if (c < 0)
- break;
- switch (c) {
- -@@ -259,8 +260,12 @@ int main(int argc, char *argv[])
- +@@ -279,8 +280,12 @@ int main(int argc, char *argv[])
- break;
- #endif /* CONFIG_DBUS */
- case 'v':
- diff --git a/package/hostapd/patches/470-hostapd_cli_ifdef.patch b/package/hostapd/patches/470-hostapd_cli_ifdef.patch
- index 5ac0fdd..d4a0f12 100644
- --- a/package/hostapd/patches/470-hostapd_cli_ifdef.patch
- +++ b/package/hostapd/patches/470-hostapd_cli_ifdef.patch
- @@ -16,7 +16,7 @@
- " get_config show current configuration\n"
- " help show this usage help\n"
- " interface [ifname] show interfaces/select interface\n"
- -@@ -352,7 +350,6 @@ static int hostapd_cli_cmd_sa_query(stru
- +@@ -362,7 +360,6 @@ static int hostapd_cli_cmd_sa_query(stru
- #endif /* CONFIG_IEEE80211W */
-
-
- @@ -24,7 +24,7 @@
- static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc,
- char *argv[])
- {
- -@@ -578,7 +575,6 @@ static int hostapd_cli_cmd_wps_config(st
- +@@ -588,7 +585,6 @@ static int hostapd_cli_cmd_wps_config(st
- ssid_hex, argv[1]);
- return wpa_ctrl_command(ctrl, buf);
- }
- @@ -32,7 +32,7 @@
-
-
- static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc,
- -@@ -903,7 +899,6 @@ static struct hostapd_cli_cmd hostapd_cl
- +@@ -979,7 +975,6 @@ static struct hostapd_cli_cmd hostapd_cl
- #ifdef CONFIG_IEEE80211W
- { "sa_query", hostapd_cli_cmd_sa_query },
- #endif /* CONFIG_IEEE80211W */
- @@ -40,7 +40,7 @@
- { "wps_pin", hostapd_cli_cmd_wps_pin },
- { "wps_check_pin", hostapd_cli_cmd_wps_check_pin },
- { "wps_pbc", hostapd_cli_cmd_wps_pbc },
- -@@ -917,7 +912,6 @@ static struct hostapd_cli_cmd hostapd_cl
- +@@ -993,7 +988,6 @@ static struct hostapd_cli_cmd hostapd_cl
- { "wps_ap_pin", hostapd_cli_cmd_wps_ap_pin },
- { "wps_config", hostapd_cli_cmd_wps_config },
- { "wps_get_status", hostapd_cli_cmd_wps_get_status },
- diff --git a/package/hostapd/patches/471-wpa_cli_ifdef.patch b/package/hostapd/patches/471-wpa_cli_ifdef.patch
- index cc84444..36b5a44 100644
- --- a/package/hostapd/patches/471-wpa_cli_ifdef.patch
- +++ b/package/hostapd/patches/471-wpa_cli_ifdef.patch
- @@ -10,4 +10,4 @@
- +
- static const char *wpa_cli_version =
- "wpa_cli v" VERSION_STR "\n"
- - "Copyright (c) 2004-2013, Jouni Malinen <j@w1.fi> and contributors";
- + "Copyright (c) 2004-2014, Jouni Malinen <j@w1.fi> and contributors";
- diff --git a/package/hostapd/patches/480-max_num_sta_probe.patch b/package/hostapd/patches/480-max_num_sta_probe.patch
- index e5ca8b4..e238bf4 100644
- --- a/package/hostapd/patches/480-max_num_sta_probe.patch
- +++ b/package/hostapd/patches/480-max_num_sta_probe.patch
- @@ -1,6 +1,6 @@
- --- a/src/ap/beacon.c
- +++ b/src/ap/beacon.c
- -@@ -501,6 +501,10 @@ void handle_probe_req(struct hostapd_dat
- +@@ -599,6 +599,10 @@ void handle_probe_req(struct hostapd_dat
- return;
- }
-
- @@ -9,5 +9,5 @@
- + " too many connected stations.", MAC2STR(mgmt->sa));
- +
- #ifdef CONFIG_INTERWORKING
- - if (elems.interworking && elems.interworking_len >= 1) {
- - u8 ant = elems.interworking[0] & 0x0f;
- + if (hapd->conf->interworking &&
- + elems.interworking && elems.interworking_len >= 1) {
- diff --git a/package/hostapd/patches/490-scan_wait.patch b/package/hostapd/patches/490-scan_wait.patch
- index 61715d6..3459a61 100644
- --- a/package/hostapd/patches/490-scan_wait.patch
- +++ b/package/hostapd/patches/490-scan_wait.patch
- @@ -1,15 +1,15 @@
- --- a/hostapd/main.c
- +++ b/hostapd/main.c
- -@@ -33,6 +33,8 @@
- - extern int wpa_debug_level;
- - extern int wpa_debug_show_keys;
- - extern int wpa_debug_timestamp;
- +@@ -36,6 +36,8 @@ struct hapd_global {
- + };
- +
- + static struct hapd_global global;
- +static int daemonize = 0;
- +static char *pid_file = NULL;
-
- - extern struct wpa_driver_ops *wpa_drivers[];
-
- -@@ -147,6 +149,14 @@ static void hostapd_logger_cb(void *ctx,
- + #ifndef CONFIG_NO_HOSTAPD_LOGGER
- +@@ -141,6 +143,14 @@ static void hostapd_logger_cb(void *ctx,
- }
- #endif /* CONFIG_NO_HOSTAPD_LOGGER */
-
- @@ -24,7 +24,7 @@
-
- /**
- * hostapd_driver_init - Preparate driver interface
- -@@ -165,6 +175,8 @@ static int hostapd_driver_init(struct ho
- +@@ -159,6 +169,8 @@ static int hostapd_driver_init(struct ho
- return -1;
- }
-
- @@ -33,7 +33,7 @@
- /* Initialize the driver interface */
- if (!(b[0] | b[1] | b[2] | b[3] | b[4] | b[5]))
- b = NULL;
- -@@ -381,8 +393,6 @@ static void hostapd_global_deinit(const
- +@@ -372,8 +384,6 @@ static void hostapd_global_deinit(const
- #endif /* CONFIG_NATIVE_WINDOWS */
-
- eap_server_unregister_methods();
- @@ -42,7 +42,7 @@
- }
-
-
- -@@ -408,11 +418,6 @@ static int hostapd_global_run(struct hap
- +@@ -399,11 +409,6 @@ static int hostapd_global_run(struct hap
- }
- #endif /* EAP_SERVER_TNC */
-
- @@ -54,7 +54,7 @@
- eloop_run();
-
- return 0;
- -@@ -521,8 +526,7 @@ int main(int argc, char *argv[])
- +@@ -533,8 +538,7 @@ int main(int argc, char *argv[])
- struct hapd_interfaces interfaces;
- int ret = 1;
- size_t i, j;
- diff --git a/package/hostapd/patches/500-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/hostapd/patches/500-wpa_supplicant-add-new-config-params-to-be-used-with.patch
- index 544151e..9f4a5f5 100644
- --- a/package/hostapd/patches/500-wpa_supplicant-add-new-config-params-to-be-used-with.patch
- +++ b/package/hostapd/patches/500-wpa_supplicant-add-new-config-params-to-be-used-with.patch
- @@ -22,9 +22,9 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
- #include "common/defs.h"
- #include "utils/list.h"
-
- -@@ -404,6 +405,11 @@ struct wpa_driver_associate_params {
- - */
- - int freq;
- +@@ -414,6 +415,11 @@ struct wpa_driver_associate_params {
- + * responsible for selecting with which BSS to associate. */
- + const u8 *bssid;
-
- + int beacon_interval;
- + int fixed_freq;
- @@ -32,11 +32,11 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
- + int mcast_rate;
- +
- /**
- - * bg_scan_period - Background scan period in seconds, 0 to disable
- - * background scan, or -1 to indicate no change to default driver
- + * bssid_hint - BSSID of a proposed AP
- + *
- --- a/wpa_supplicant/config.c
- +++ b/wpa_supplicant/config.c
- -@@ -14,6 +14,7 @@
- +@@ -15,6 +15,7 @@
- #include "rsn_supp/wpa.h"
- #include "eap_peer/eap.h"
- #include "p2p/p2p.h"
- @@ -44,7 +44,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
- #include "config.h"
-
-
- -@@ -1512,6 +1513,97 @@ static char * wpa_config_write_psk_list(
- +@@ -1527,6 +1528,97 @@ static char * wpa_config_write_psk_list(
-
- #endif /* CONFIG_P2P */
-
- @@ -142,16 +142,16 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
- /* Helper macros for network block parser */
-
- #ifdef OFFSET
- -@@ -1715,6 +1807,9 @@ static const struct parse_data ssid_fiel
- +@@ -1733,6 +1825,9 @@ static const struct parse_data ssid_fiel
- { INT(ap_max_inactivity) },
- { INT(dtim_period) },
- { INT(beacon_int) },
- + { INT_RANGE(fixed_freq, 0, 1) },
- + { FUNC(rates) },
- + { FUNC(mcast_rate) },
- - };
- -
- - #undef OFFSET
- + #ifdef CONFIG_MACSEC
- + { INT_RANGE(macsec_policy, 0, 1) },
- + #endif /* CONFIG_MACSEC */
- --- a/wpa_supplicant/config_ssid.h
- +++ b/wpa_supplicant/config_ssid.h
- @@ -12,6 +12,7 @@
- @@ -162,37 +162,24 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
-
- #define MAX_SSID_LEN 32
-
- -@@ -620,6 +621,10 @@ struct wpa_ssid {
- - * dereferences since it may not be updated in all cases.
- +@@ -637,6 +638,10 @@ struct wpa_ssid {
- */
- void *parent_cred;
- -+
- +
- + int fixed_freq;
- + unsigned char rates[NL80211_MAX_SUPP_RATES];
- + double mcast_rate;
- - };
- -
- - #endif /* CONFIG_SSID_H */
- ++
- + #ifdef CONFIG_MACSEC
- + /**
- + * macsec_policy - Determines the policy for MACsec secure session
- --- a/wpa_supplicant/wpa_supplicant.c
- +++ b/wpa_supplicant/wpa_supplicant.c
- -@@ -1623,15 +1623,24 @@ void wpa_supplicant_associate(struct wpa
- - params.ssid_len = ssid->ssid_len;
- - }
- -
- -- if (ssid->mode == WPAS_MODE_IBSS && ssid->bssid_set &&
- -- wpa_s->conf->ap_scan == 2) {
- -- params.bssid = ssid->bssid;
- -- params.fixed_bssid = 1;
- -+ if (ssid->mode == WPAS_MODE_IBSS) {
- -+ if (ssid->bssid_set && wpa_s->conf->ap_scan == 2) {
- -+ params.bssid = ssid->bssid;
- -+ params.fixed_bssid = 1;
- -+ }
- -+ if (ssid->frequency > 0 && params.freq == 0)
- -+ /* Initial channel for IBSS */
- -+ params.freq = ssid->frequency;
- +@@ -1806,6 +1806,13 @@ static void wpas_start_assoc_cb(struct w
- + params.beacon_int = ssid->beacon_int;
- + else
- + params.beacon_int = wpa_s->conf->beacon_int;
- + params.fixed_freq = ssid->fixed_freq;
- -+ params.beacon_interval = ssid->beacon_int;
- + i = 0;
- + while (i < NL80211_MAX_SUPP_RATES) {
- + params.rates[i] = ssid->rates[i];
- @@ -201,9 +188,4 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
- + params.mcast_rate = ssid->mcast_rate;
- }
-
- -- if (ssid->mode == WPAS_MODE_IBSS && ssid->frequency > 0 &&
- -- params.freq == 0)
- -- params.freq = ssid->frequency; /* Initial channel for IBSS */
- params.wpa_ie = wpa_ie;
- - params.wpa_ie_len = wpa_ie_len;
- - params.pairwise_suite = cipher_pairwise;
- diff --git a/package/hostapd/patches/501-driver_nl80211-use-new-parameters-during-ibss-join.patch b/package/hostapd/patches/501-driver_nl80211-use-new-parameters-during-ibss-join.patch
- index 565bbc9..e7484d9 100644
- --- a/package/hostapd/patches/501-driver_nl80211-use-new-parameters-during-ibss-join.patch
- +++ b/package/hostapd/patches/501-driver_nl80211-use-new-parameters-during-ibss-join.patch
- @@ -10,7 +10,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
-
- --- a/src/drivers/driver_nl80211.c
- +++ b/src/drivers/driver_nl80211.c
- -@@ -7903,7 +7903,7 @@ static int wpa_driver_nl80211_ibss(struc
- +@@ -8581,7 +8581,7 @@ static int wpa_driver_nl80211_ibss(struc
- struct wpa_driver_associate_params *params)
- {
- struct nl_msg *msg;
- @@ -19,9 +19,9 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
- int count = 0;
-
- wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex);
- -@@ -7936,6 +7936,37 @@ retry:
- - wpa_printf(MSG_DEBUG, " * freq=%d", params->freq);
- - NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, params->freq);
- +@@ -8620,6 +8620,37 @@ retry:
- + params->beacon_int);
- + }
-
- + if (params->fixed_freq) {
- + wpa_printf(MSG_DEBUG, " * fixed_freq");
- diff --git a/package/hostapd/patches/502-wpa_s-support-htmode-param.patch b/package/hostapd/patches/502-wpa_s-support-htmode-param.patch
- index adb20a2..b4c4034 100644
- --- a/package/hostapd/patches/502-wpa_s-support-htmode-param.patch
- +++ b/package/hostapd/patches/502-wpa_s-support-htmode-param.patch
- @@ -16,7 +16,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
-
- --- a/src/drivers/driver.h
- +++ b/src/drivers/driver.h
- -@@ -409,6 +409,8 @@ struct wpa_driver_associate_params {
- +@@ -419,6 +419,8 @@ struct wpa_driver_associate_params {
- int fixed_freq;
- unsigned char rates[NL80211_MAX_SUPP_RATES];
- int mcast_rate;
- @@ -24,10 +24,10 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
- + unsigned int htmode;
-
- /**
- - * bg_scan_period - Background scan period in seconds, 0 to disable
- + * bssid_hint - BSSID of a proposed AP
- --- a/src/drivers/driver_nl80211.c
- +++ b/src/drivers/driver_nl80211.c
- -@@ -7967,6 +7967,22 @@ retry:
- +@@ -8651,6 +8651,22 @@ retry:
- NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate);
- }
-
- @@ -52,7 +52,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
- goto nla_put_failure;
- --- a/wpa_supplicant/config.c
- +++ b/wpa_supplicant/config.c
- -@@ -1544,6 +1544,71 @@ static char * wpa_config_write_mcast_rat
- +@@ -1559,6 +1559,71 @@ static char * wpa_config_write_mcast_rat
- }
- #endif /* NO_CONFIG_WRITE */
-
- @@ -124,28 +124,28 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
- static int wpa_config_parse_rates(const struct parse_data *data,
- struct wpa_ssid *ssid, int line,
- const char *value)
- -@@ -1810,6 +1875,7 @@ static const struct parse_data ssid_fiel
- +@@ -1828,6 +1893,7 @@ static const struct parse_data ssid_fiel
- { INT_RANGE(fixed_freq, 0, 1) },
- { FUNC(rates) },
- { FUNC(mcast_rate) },
- + { FUNC(htmode) },
- - };
- -
- - #undef OFFSET
- + #ifdef CONFIG_MACSEC
- + { INT_RANGE(macsec_policy, 0, 1) },
- + #endif /* CONFIG_MACSEC */
- --- a/wpa_supplicant/config_ssid.h
- +++ b/wpa_supplicant/config_ssid.h
- -@@ -625,6 +625,8 @@ struct wpa_ssid {
- +@@ -641,6 +641,8 @@ struct wpa_ssid {
- int fixed_freq;
- unsigned char rates[NL80211_MAX_SUPP_RATES];
- double mcast_rate;
- + int ht_set;
- + unsigned int htmode;
- - };
-
- - #endif /* CONFIG_SSID_H */
- + #ifdef CONFIG_MACSEC
- + /**
- --- a/wpa_supplicant/wpa_supplicant.c
- +++ b/wpa_supplicant/wpa_supplicant.c
- -@@ -1639,6 +1639,8 @@ void wpa_supplicant_associate(struct wpa
- +@@ -1813,6 +1813,8 @@ static void wpas_start_assoc_cb(struct w
- i++;
- }
- params.mcast_rate = ssid->mcast_rate;
- diff --git a/package/hostapd/patches/510-wpa_supplicant_p2p_parse_ifcomb.patch b/package/hostapd/patches/510-wpa_supplicant_p2p_parse_ifcomb.patch
- deleted file mode 100644
- index fe72ee2..0000000
- --- a/package/hostapd/patches/510-wpa_supplicant_p2p_parse_ifcomb.patch
- +++ /dev/null
- @@ -1,18 +0,0 @@
- ---- a/src/drivers/driver_nl80211.c
- -+++ b/src/drivers/driver_nl80211.c
- -@@ -3157,10 +3157,12 @@ static int wiphy_info_iface_comb_process
- - }
- -
- - if (combination_has_p2p && combination_has_mgd) {
- -- info->p2p_concurrent = 1;
- -- info->num_multichan_concurrent =
- -+ int num_channels =
- - nla_get_u32(tb_comb[NL80211_IFACE_COMB_NUM_CHANNELS]);
- -- return 1;
- -+
- -+ info->p2p_concurrent = 1;
- -+ if (info->num_multichan_concurrent < num_channels)
- -+ info->num_multichan_concurrent = num_channels;
- - }
- -
- - return 0;
|