0017-Backport-hostapd-from-Barrier-Breaker-r41029.patch 72 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Mon, 19 May 2014 15:59:06 +0200
  3. Subject: Backport hostapd from Barrier Breaker (r41029)
  4. diff --git a/package/hostapd/Makefile b/package/hostapd/Makefile
  5. index b4dc242..beb37a3 100644
  6. --- a/package/hostapd/Makefile
  7. +++ b/package/hostapd/Makefile
  8. @@ -8,9 +8,9 @@
  9. include $(TOPDIR)/rules.mk
  10. PKG_NAME:=hostapd
  11. -PKG_VERSION:=20131120
  12. +PKG_VERSION:=2014-06-03
  13. PKG_RELEASE:=1
  14. -PKG_REV:=594516b4c28a94ca686b17f1e463dfd6712b75a7
  15. +PKG_REV:=84df167554569af8c87f0a8ac1fb508192417d8e
  16. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  17. PKG_SOURCE_URL:=git://w1.fi/srv/git/hostap.git
  18. diff --git a/package/hostapd/files/hostapd.sh b/package/hostapd/files/hostapd.sh
  19. index b55b63d..2a16bb4 100644
  20. --- a/package/hostapd/files/hostapd.sh
  21. +++ b/package/hostapd/files/hostapd.sh
  22. @@ -130,7 +130,9 @@ hostapd_set_bss_options() {
  23. append "$var" "radius_das_client=$dae_client $dae_secret" "$N"
  24. }
  25. config_get nasid "$vif" nasid
  26. + config_get ownip "$vif" ownip
  27. append "$var" "nas_identifier=$nasid" "$N"
  28. + append "$var" "own_ip_addr=$ownip" "$N"
  29. append "$var" "eapol_key_index_workaround=1" "$N"
  30. append "$var" "ieee8021x=1" "$N"
  31. append "$var" "wpa_key_mgmt=WPA-EAP" "$N"
  32. diff --git a/package/hostapd/patches/100-madwifi_key_fixes.patch b/package/hostapd/patches/100-madwifi_key_fixes.patch
  33. index dcd6d10..a46943b 100644
  34. --- a/package/hostapd/patches/100-madwifi_key_fixes.patch
  35. +++ b/package/hostapd/patches/100-madwifi_key_fixes.patch
  36. @@ -1,6 +1,6 @@
  37. --- a/src/drivers/driver_madwifi.c
  38. +++ b/src/drivers/driver_madwifi.c
  39. -@@ -450,7 +450,9 @@ wpa_driver_madwifi_set_key(const char *i
  40. +@@ -449,7 +449,9 @@ wpa_driver_madwifi_set_key(const char *i
  41. memset(&wk, 0, sizeof(wk));
  42. wk.ik_type = cipher;
  43. @@ -11,7 +11,7 @@
  44. if (addr == NULL || is_broadcast_ether_addr(addr)) {
  45. memset(wk.ik_macaddr, 0xff, IEEE80211_ADDR_LEN);
  46. wk.ik_keyix = key_idx;
  47. -@@ -462,6 +464,20 @@ wpa_driver_madwifi_set_key(const char *i
  48. +@@ -461,6 +463,20 @@ wpa_driver_madwifi_set_key(const char *i
  49. wk.ik_keylen = key_len;
  50. memcpy(wk.ik_keydata, key, key_len);
  51. diff --git a/package/hostapd/patches/110-bool_fix.patch b/package/hostapd/patches/110-bool_fix.patch
  52. index 9f82b0b..1ad84bf 100644
  53. --- a/package/hostapd/patches/110-bool_fix.patch
  54. +++ b/package/hostapd/patches/110-bool_fix.patch
  55. @@ -1,6 +1,6 @@
  56. --- a/src/ap/ieee802_1x.c
  57. +++ b/src/ap/ieee802_1x.c
  58. -@@ -1933,9 +1933,9 @@ void ieee802_1x_notify_pre_auth(struct e
  59. +@@ -2119,9 +2119,9 @@ void ieee802_1x_notify_pre_auth(struct e
  60. }
  61. diff --git a/package/hostapd/patches/130-no_eapol_fix.patch b/package/hostapd/patches/130-no_eapol_fix.patch
  62. new file mode 100644
  63. index 0000000..3c19cb3
  64. --- /dev/null
  65. +++ b/package/hostapd/patches/130-no_eapol_fix.patch
  66. @@ -0,0 +1,14 @@
  67. +--- a/wpa_supplicant/wpa_supplicant.c
  68. ++++ b/wpa_supplicant/wpa_supplicant.c
  69. +@@ -247,9 +247,10 @@ void wpa_supplicant_cancel_auth_timeout(
  70. + */
  71. + void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s)
  72. + {
  73. ++ struct wpa_ssid *ssid = wpa_s->current_ssid;
  74. ++
  75. + #ifdef IEEE8021X_EAPOL
  76. + struct eapol_config eapol_conf;
  77. +- struct wpa_ssid *ssid = wpa_s->current_ssid;
  78. +
  79. + #ifdef CONFIG_IBSS_RSN
  80. + if (ssid->mode == WPAS_MODE_IBSS &&
  81. diff --git a/package/hostapd/patches/130-wds_sta_del_fix.patch b/package/hostapd/patches/130-wds_sta_del_fix.patch
  82. deleted file mode 100644
  83. index 06b6906..0000000
  84. --- a/package/hostapd/patches/130-wds_sta_del_fix.patch
  85. +++ /dev/null
  86. @@ -1,13 +0,0 @@
  87. ---- a/src/drivers/driver_nl80211.c
  88. -+++ b/src/drivers/driver_nl80211.c
  89. -@@ -9083,8 +9083,8 @@ static int i802_set_wds_sta(void *priv,
  90. - name);
  91. -
  92. - i802_set_sta_vlan(priv, addr, bss->ifname, 0);
  93. -- return wpa_driver_nl80211_if_remove(priv, WPA_IF_AP_VLAN,
  94. -- name);
  95. -+ nl80211_remove_iface(drv, if_nametoindex(name));
  96. -+ return 0;
  97. - }
  98. - }
  99. -
  100. diff --git a/package/hostapd/patches/200-multicall.patch b/package/hostapd/patches/200-multicall.patch
  101. index 2289f51..efe151c 100644
  102. --- a/package/hostapd/patches/200-multicall.patch
  103. +++ b/package/hostapd/patches/200-multicall.patch
  104. @@ -1,14 +1,14 @@
  105. --- a/hostapd/Makefile
  106. +++ b/hostapd/Makefile
  107. -@@ -14,6 +14,7 @@ CFLAGS += -I../src/utils
  108. +@@ -14,6 +14,7 @@ CFLAGS += -I$(abspath ../src/utils)
  109. # CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include
  110. -include .config
  111. +-include $(if $(MULTICALL), ../wpa_supplicant/.config)
  112. - ifndef CONFIG_OS
  113. - ifdef CONFIG_NATIVE_WINDOWS
  114. -@@ -200,10 +201,14 @@ ifdef CONFIG_IEEE80211AC
  115. + ifdef CONFIG_TESTING_OPTIONS
  116. + CFLAGS += -DCONFIG_TESTING_OPTIONS
  117. +@@ -223,10 +224,14 @@ ifdef CONFIG_IEEE80211AC
  118. CFLAGS += -DCONFIG_IEEE80211AC
  119. endif
  120. @@ -26,7 +26,7 @@
  121. LIBS += $(DRV_AP_LIBS)
  122. ifdef CONFIG_L2_PACKET
  123. -@@ -890,6 +895,12 @@ install: all
  124. +@@ -913,6 +918,12 @@ install: all
  125. BCHECK=../src/drivers/build.hostapd
  126. @@ -39,7 +39,7 @@
  127. hostapd: $(BCHECK) $(OBJS)
  128. $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
  129. @$(E) " LD " $@
  130. -@@ -928,6 +939,12 @@ HOBJS += ../src/crypto/aes-internal.o
  131. +@@ -951,6 +962,12 @@ HOBJS += ../src/crypto/aes-internal.o
  132. HOBJS += ../src/crypto/aes-internal-enc.o
  133. endif
  134. @@ -54,15 +54,15 @@
  135. @$(E) " LD " $@
  136. --- a/wpa_supplicant/Makefile
  137. +++ b/wpa_supplicant/Makefile
  138. -@@ -14,6 +14,7 @@ CFLAGS += -I../src
  139. - CFLAGS += -I../src/utils
  140. +@@ -14,6 +14,7 @@ CFLAGS += -I$(abspath ../src)
  141. + CFLAGS += -I$(abspath ../src/utils)
  142. -include .config
  143. +-include $(if $(MULTICALL),../hostapd/.config)
  144. - BINALL=wpa_supplicant wpa_cli
  145. -
  146. -@@ -727,6 +728,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
  147. + ifdef CONFIG_TESTING_OPTIONS
  148. + CFLAGS += -DCONFIG_TESTING_OPTIONS
  149. +@@ -741,6 +742,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
  150. CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
  151. LIBS += -ldl -rdynamic
  152. endif
  153. @@ -72,8 +72,8 @@
  154. + endif
  155. endif
  156. - ifdef CONFIG_AP
  157. -@@ -735,9 +740,11 @@ NEED_EAP_COMMON=y
  158. + ifdef CONFIG_MACSEC
  159. +@@ -762,9 +767,11 @@ NEED_EAP_COMMON=y
  160. NEED_RSN_AUTHENTICATOR=y
  161. CFLAGS += -DCONFIG_AP
  162. OBJS += ap.o
  163. @@ -85,7 +85,7 @@
  164. OBJS += ../src/ap/hostapd.o
  165. OBJS += ../src/ap/wpa_auth_glue.o
  166. OBJS += ../src/ap/utils.o
  167. -@@ -799,10 +806,18 @@ endif
  168. +@@ -826,10 +833,18 @@ endif
  169. ifdef CONFIG_HS20
  170. OBJS += ../src/ap/hs20.o
  171. endif
  172. @@ -104,7 +104,7 @@
  173. NEED_AES_WRAP=y
  174. OBJS += ../src/ap/wpa_auth.o
  175. OBJS += ../src/ap/wpa_auth_ie.o
  176. -@@ -1551,6 +1566,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
  177. +@@ -1602,6 +1617,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
  178. $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
  179. @@ -117,7 +117,7 @@
  180. wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
  181. $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
  182. @$(E) " LD " $@
  183. -@@ -1625,6 +1646,12 @@ eap_eke.so: ../src/eap_peer/eap_eke.c ..
  184. +@@ -1682,6 +1703,12 @@ endif
  185. %@.service: %.service.arg.in
  186. sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
  187. @@ -132,7 +132,7 @@
  188. wpa_cli.exe: wpa_cli
  189. --- a/src/drivers/driver.h
  190. +++ b/src/drivers/driver.h
  191. -@@ -4079,8 +4079,8 @@ union wpa_event_data {
  192. +@@ -4117,8 +4117,8 @@ union wpa_event_data {
  193. * Driver wrapper code should call this function whenever an event is received
  194. * from the driver.
  195. */
  196. @@ -145,7 +145,7 @@
  197. /*
  198. --- a/src/ap/drv_callbacks.c
  199. +++ b/src/ap/drv_callbacks.c
  200. -@@ -844,8 +844,8 @@ static void hostapd_event_dfs_nop_finish
  201. +@@ -926,8 +926,8 @@ static void hostapd_event_dfs_nop_finish
  202. #endif /* NEED_AP_MLME */
  203. @@ -158,7 +158,7 @@
  204. #ifndef CONFIG_NO_STDOUT_DEBUG
  205. --- a/wpa_supplicant/wpa_priv.c
  206. +++ b/wpa_supplicant/wpa_priv.c
  207. -@@ -817,8 +817,8 @@ static void wpa_priv_send_ft_response(st
  208. +@@ -815,8 +815,8 @@ static void wpa_priv_send_ft_response(st
  209. }
  210. @@ -169,7 +169,7 @@
  211. {
  212. struct wpa_priv_interface *iface = ctx;
  213. -@@ -960,6 +960,7 @@ int main(int argc, char *argv[])
  214. +@@ -956,6 +956,7 @@ int main(int argc, char *argv[])
  215. if (os_program_init())
  216. return -1;
  217. @@ -179,7 +179,7 @@
  218. for (;;) {
  219. --- a/wpa_supplicant/events.c
  220. +++ b/wpa_supplicant/events.c
  221. -@@ -2710,8 +2710,8 @@ static void wpa_supplicant_update_channe
  222. +@@ -2919,8 +2919,8 @@ static void wpa_supplicant_notify_avoid_
  223. }
  224. @@ -192,7 +192,7 @@
  225. --- a/wpa_supplicant/wpa_supplicant.c
  226. +++ b/wpa_supplicant/wpa_supplicant.c
  227. -@@ -3138,6 +3138,9 @@ static void wpa_supplicant_deinit_iface(
  228. +@@ -3811,6 +3811,9 @@ static void wpa_supplicant_deinit_iface(
  229. os_free(wpa_s);
  230. }
  231. @@ -202,7 +202,7 @@
  232. /**
  233. * wpa_supplicant_add_iface - Add a new network interface
  234. -@@ -3329,6 +3332,7 @@ struct wpa_global * wpa_supplicant_init(
  235. +@@ -4002,6 +4005,7 @@ struct wpa_global * wpa_supplicant_init(
  236. wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
  237. #endif /* CONFIG_NO_WPA_MSG */
  238. @@ -212,7 +212,7 @@
  239. wpa_debug_open_syslog();
  240. --- a/hostapd/main.c
  241. +++ b/hostapd/main.c
  242. -@@ -511,6 +511,9 @@ static int hostapd_get_ctrl_iface_group(
  243. +@@ -502,6 +502,9 @@ static int hostapd_get_ctrl_iface_group(
  244. return 0;
  245. }
  246. @@ -220,27 +220,57 @@
  247. + union wpa_event_data *data);
  248. +
  249. - int main(int argc, char *argv[])
  250. - {
  251. -@@ -541,6 +544,7 @@ int main(int argc, char *argv[])
  252. + #ifdef CONFIG_WPS
  253. + static int gen_uuid(const char *txt_addr)
  254. +@@ -553,6 +556,7 @@ int main(int argc, char *argv[])
  255. interfaces.global_iface_name = NULL;
  256. interfaces.global_ctrl_sock = -1;
  257. + wpa_supplicant_event = hostapd_wpa_event;
  258. for (;;) {
  259. - c = getopt(argc, argv, "b:Bde:f:hKP:Ttvg:G:");
  260. + c = getopt(argc, argv, "b:Bde:f:hKP:Ttu:vg:G:");
  261. if (c < 0)
  262. --- a/src/drivers/drivers.c
  263. +++ b/src/drivers/drivers.c
  264. -@@ -7,7 +7,11 @@
  265. - */
  266. -
  267. - #include "includes.h"
  268. -+#include "common.h"
  269. -+#include "driver.h"
  270. +@@ -10,6 +10,9 @@
  271. + #include "utils/common.h"
  272. + #include "driver.h"
  273. +void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
  274. + union wpa_event_data *data);
  275. -
  276. ++
  277. #ifdef CONFIG_DRIVER_WEXT
  278. extern struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
  279. + #endif /* CONFIG_DRIVER_WEXT */
  280. +--- a/wpa_supplicant/eapol_test.c
  281. ++++ b/wpa_supplicant/eapol_test.c
  282. +@@ -28,8 +28,12 @@
  283. + #include "ctrl_iface.h"
  284. + #include "pcsc_funcs.h"
  285. + #include "wpas_glue.h"
  286. ++#include "drivers/driver.h"
  287. +
  288. +
  289. ++void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
  290. ++ union wpa_event_data *data);
  291. ++
  292. + struct wpa_driver_ops *wpa_drivers[] = { NULL };
  293. +
  294. +
  295. +@@ -1185,6 +1189,8 @@ static void usage(void)
  296. + "option several times.\n");
  297. + }
  298. +
  299. ++extern void supplicant_event(void *ctx, enum wpa_event_type event,
  300. ++ union wpa_event_data *data);
  301. +
  302. + int main(int argc, char *argv[])
  303. + {
  304. +@@ -1203,6 +1209,7 @@ int main(int argc, char *argv[])
  305. + if (os_program_init())
  306. + return -1;
  307. +
  308. ++ wpa_supplicant_event = supplicant_event;
  309. + hostapd_logger_register_cb(hostapd_logger_cb);
  310. +
  311. + os_memset(&eapol_test, 0, sizeof(eapol_test));
  312. diff --git a/package/hostapd/patches/300-noscan.patch b/package/hostapd/patches/300-noscan.patch
  313. index 17e7661..4ea26b6 100644
  314. --- a/package/hostapd/patches/300-noscan.patch
  315. +++ b/package/hostapd/patches/300-noscan.patch
  316. @@ -1,17 +1,17 @@
  317. --- a/hostapd/config_file.c
  318. +++ b/hostapd/config_file.c
  319. -@@ -2412,6 +2412,8 @@ static int hostapd_config_fill(struct ho
  320. - }
  321. +@@ -2639,6 +2639,8 @@ static int hostapd_config_fill(struct ho
  322. + }
  323. #endif /* CONFIG_IEEE80211W */
  324. #ifdef CONFIG_IEEE80211N
  325. -+ } else if (os_strcmp(buf, "noscan") == 0) {
  326. -+ conf->noscan = atoi(pos);
  327. - } else if (os_strcmp(buf, "ieee80211n") == 0) {
  328. - conf->ieee80211n = atoi(pos);
  329. - } else if (os_strcmp(buf, "ht_capab") == 0) {
  330. ++ } else if (os_strcmp(buf, "noscan") == 0) {
  331. ++ conf->noscan = atoi(pos);
  332. + } else if (os_strcmp(buf, "ieee80211n") == 0) {
  333. + conf->ieee80211n = atoi(pos);
  334. + } else if (os_strcmp(buf, "ht_capab") == 0) {
  335. --- a/src/ap/ap_config.h
  336. +++ b/src/ap/ap_config.h
  337. -@@ -527,6 +527,7 @@ struct hostapd_config {
  338. +@@ -576,6 +576,7 @@ struct hostapd_config {
  339. int ht_op_mode_fixed;
  340. u16 ht_capab;
  341. @@ -21,9 +21,9 @@
  342. int require_ht;
  343. --- a/src/ap/hw_features.c
  344. +++ b/src/ap/hw_features.c
  345. -@@ -577,7 +577,7 @@ static int ieee80211n_check_40mhz(struct
  346. - {
  347. +@@ -690,7 +690,7 @@ static int ieee80211n_check_40mhz(struct
  348. struct wpa_driver_scan_params params;
  349. + int ret;
  350. - if (!iface->conf->secondary_channel)
  351. + if (!iface->conf->secondary_channel || iface->conf->noscan)
  352. diff --git a/package/hostapd/patches/310-rescan_immediately.patch b/package/hostapd/patches/310-rescan_immediately.patch
  353. index 043f07c..dac0f6e 100644
  354. --- a/package/hostapd/patches/310-rescan_immediately.patch
  355. +++ b/package/hostapd/patches/310-rescan_immediately.patch
  356. @@ -1,6 +1,6 @@
  357. --- a/wpa_supplicant/wpa_supplicant.c
  358. +++ b/wpa_supplicant/wpa_supplicant.c
  359. -@@ -2488,7 +2488,7 @@ static struct wpa_supplicant * wpa_suppl
  360. +@@ -2752,7 +2752,7 @@ static struct wpa_supplicant * wpa_suppl
  361. if (wpa_s == NULL)
  362. return NULL;
  363. wpa_s->scan_req = INITIAL_SCAN_REQ;
  364. diff --git a/package/hostapd/patches/320-optional_rfkill.patch b/package/hostapd/patches/320-optional_rfkill.patch
  365. index 7ec51b1..3808f9b 100644
  366. --- a/package/hostapd/patches/320-optional_rfkill.patch
  367. +++ b/package/hostapd/patches/320-optional_rfkill.patch
  368. @@ -1,221 +1,6 @@
  369. ---- a/src/drivers/driver_nl80211.c
  370. -+++ b/src/drivers/driver_nl80211.c
  371. -@@ -254,7 +254,9 @@ struct wpa_driver_nl80211_data {
  372. - int if_removed;
  373. - int if_disabled;
  374. - int ignore_if_down_event;
  375. -+#ifdef CONFIG_RFKILL
  376. - struct rfkill_data *rfkill;
  377. -+#endif
  378. - struct wpa_driver_capa capa;
  379. - u8 *extended_capa, *extended_capa_mask;
  380. - unsigned int extended_capa_len;
  381. -@@ -3630,7 +3632,7 @@ static int wpa_driver_nl80211_init_nl(st
  382. - return 0;
  383. - }
  384. -
  385. --
  386. -+#ifdef CONFIG_RFKILL
  387. - static void wpa_driver_nl80211_rfkill_blocked(void *ctx)
  388. - {
  389. - wpa_printf(MSG_DEBUG, "nl80211: RFKILL blocked");
  390. -@@ -3652,6 +3654,7 @@ static void wpa_driver_nl80211_rfkill_un
  391. - }
  392. - /* rtnetlink ifup handler will report interface as enabled */
  393. - }
  394. -+#endif /* CONFIG_RFKILL */
  395. -
  396. -
  397. - static void wpa_driver_nl80211_handle_eapol_tx_status(int sock,
  398. -@@ -3740,7 +3743,9 @@ static void * wpa_driver_nl80211_drv_ini
  399. - const u8 *set_addr)
  400. - {
  401. - struct wpa_driver_nl80211_data *drv;
  402. -+#ifdef CONFIG_RFKILL
  403. - struct rfkill_config *rcfg;
  404. -+#endif
  405. - struct i802_bss *bss;
  406. -
  407. - if (global_priv == NULL)
  408. -@@ -3778,6 +3783,7 @@ static void * wpa_driver_nl80211_drv_ini
  409. - if (nl80211_init_bss(bss))
  410. - goto failed;
  411. -
  412. -+#ifdef CONFIG_RFKILL
  413. - rcfg = os_zalloc(sizeof(*rcfg));
  414. - if (rcfg == NULL)
  415. - goto failed;
  416. -@@ -3790,6 +3796,7 @@ static void * wpa_driver_nl80211_drv_ini
  417. - wpa_printf(MSG_DEBUG, "nl80211: RFKILL status not available");
  418. - os_free(rcfg);
  419. - }
  420. -+#endif /* CONFIG_RFKILL */
  421. -
  422. - if (linux_iface_up(drv->global->ioctl_sock, ifname) > 0)
  423. - drv->start_iface_up = 1;
  424. -@@ -4116,10 +4123,12 @@ static void nl80211_mgmt_unsubscribe(str
  425. - }
  426. -
  427. -
  428. -+#ifdef CONFIG_RFKILL
  429. - static void wpa_driver_nl80211_send_rfkill(void *eloop_ctx, void *timeout_ctx)
  430. - {
  431. - wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL);
  432. - }
  433. -+#endif /* CONFIG_RFKILL */
  434. -
  435. -
  436. - static void nl80211_del_p2pdev(struct i802_bss *bss)
  437. -@@ -4246,13 +4255,16 @@ wpa_driver_nl80211_finish_drv_init(struc
  438. - }
  439. -
  440. - if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1)) {
  441. -+#ifdef CONFIG_RFKILL
  442. - if (rfkill_is_blocked(drv->rfkill)) {
  443. - wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable "
  444. - "interface '%s' due to rfkill",
  445. - bss->ifname);
  446. - drv->if_disabled = 1;
  447. - send_rfkill_event = 1;
  448. -- } else {
  449. -+ } else
  450. -+#endif
  451. -+ {
  452. - wpa_printf(MSG_ERROR, "nl80211: Could not set "
  453. - "interface '%s' UP", bss->ifname);
  454. - return -1;
  455. -@@ -4268,8 +4280,10 @@ wpa_driver_nl80211_finish_drv_init(struc
  456. - return -1;
  457. -
  458. - if (send_rfkill_event) {
  459. -+#ifdef CONFIG_RFKILL
  460. - eloop_register_timeout(0, 0, wpa_driver_nl80211_send_rfkill,
  461. - drv, drv->ctx);
  462. -+#endif
  463. - }
  464. -
  465. - return 0;
  466. -@@ -4347,7 +4361,9 @@ static void wpa_driver_nl80211_deinit(st
  467. -
  468. - netlink_send_oper_ifla(drv->global->netlink, drv->ifindex, 0,
  469. - IF_OPER_UP);
  470. -+#ifdef CONFIG_RFKILL
  471. - rfkill_deinit(drv->rfkill);
  472. -+#endif
  473. -
  474. - eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv, drv->ctx);
  475. -
  476. ---- a/src/drivers/driver_wext.c
  477. -+++ b/src/drivers/driver_wext.c
  478. -@@ -740,7 +740,7 @@ static void wpa_driver_wext_event_rtm_de
  479. - }
  480. - }
  481. -
  482. --
  483. -+#ifdef CONFIG_RFKILL
  484. - static void wpa_driver_wext_rfkill_blocked(void *ctx)
  485. - {
  486. - wpa_printf(MSG_DEBUG, "WEXT: RFKILL blocked");
  487. -@@ -762,7 +762,7 @@ static void wpa_driver_wext_rfkill_unblo
  488. - }
  489. - /* rtnetlink ifup handler will report interface as enabled */
  490. - }
  491. --
  492. -+#endif /* CONFIG_RFKILL */
  493. -
  494. - static void wext_get_phy_name(struct wpa_driver_wext_data *drv)
  495. - {
  496. -@@ -808,7 +808,9 @@ void * wpa_driver_wext_init(void *ctx, c
  497. - {
  498. - struct wpa_driver_wext_data *drv;
  499. - struct netlink_config *cfg;
  500. -+#ifdef CONFIG_RFKILL
  501. - struct rfkill_config *rcfg;
  502. -+#endif
  503. - char path[128];
  504. - struct stat buf;
  505. -
  506. -@@ -843,6 +845,7 @@ void * wpa_driver_wext_init(void *ctx, c
  507. - goto err2;
  508. - }
  509. -
  510. -+#ifdef CONFIG_RFKILL
  511. - rcfg = os_zalloc(sizeof(*rcfg));
  512. - if (rcfg == NULL)
  513. - goto err3;
  514. -@@ -855,6 +858,7 @@ void * wpa_driver_wext_init(void *ctx, c
  515. - wpa_printf(MSG_DEBUG, "WEXT: RFKILL status not available");
  516. - os_free(rcfg);
  517. - }
  518. -+#endif /* CONFIG_RFKILL */
  519. -
  520. - drv->mlme_sock = -1;
  521. -
  522. -@@ -872,7 +876,9 @@ void * wpa_driver_wext_init(void *ctx, c
  523. - return drv;
  524. -
  525. - err3:
  526. -+#ifdef CONFIG_RFKILL
  527. - rfkill_deinit(drv->rfkill);
  528. -+#endif
  529. - netlink_deinit(drv->netlink);
  530. - err2:
  531. - close(drv->ioctl_sock);
  532. -@@ -882,10 +888,12 @@ err1:
  533. - }
  534. -
  535. -
  536. -+#ifdef CONFIG_RFKILL
  537. - static void wpa_driver_wext_send_rfkill(void *eloop_ctx, void *timeout_ctx)
  538. - {
  539. - wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL);
  540. - }
  541. -+#endif /* CONFIG_RFKILL */
  542. -
  543. -
  544. - static int wpa_driver_wext_finish_drv_init(struct wpa_driver_wext_data *drv)
  545. -@@ -893,13 +901,16 @@ static int wpa_driver_wext_finish_drv_in
  546. - int send_rfkill_event = 0;
  547. -
  548. - if (linux_set_iface_flags(drv->ioctl_sock, drv->ifname, 1) < 0) {
  549. -+#ifdef CONFIG_RFKILL
  550. - if (rfkill_is_blocked(drv->rfkill)) {
  551. - wpa_printf(MSG_DEBUG, "WEXT: Could not yet enable "
  552. - "interface '%s' due to rfkill",
  553. - drv->ifname);
  554. - drv->if_disabled = 1;
  555. - send_rfkill_event = 1;
  556. -- } else {
  557. -+ } else
  558. -+#endif
  559. -+ {
  560. - wpa_printf(MSG_ERROR, "WEXT: Could not set "
  561. - "interface '%s' UP", drv->ifname);
  562. - return -1;
  563. -@@ -947,8 +958,10 @@ static int wpa_driver_wext_finish_drv_in
  564. - 1, IF_OPER_DORMANT);
  565. -
  566. - if (send_rfkill_event) {
  567. -+#ifdef CONFIG_RFKILL
  568. - eloop_register_timeout(0, 0, wpa_driver_wext_send_rfkill,
  569. - drv, drv->ctx);
  570. -+#endif
  571. - }
  572. -
  573. - return 0;
  574. -@@ -978,7 +991,9 @@ void wpa_driver_wext_deinit(void *priv)
  575. -
  576. - netlink_send_oper_ifla(drv->netlink, drv->ifindex, 0, IF_OPER_UP);
  577. - netlink_deinit(drv->netlink);
  578. -+#ifdef CONFIG_RFKILL
  579. - rfkill_deinit(drv->rfkill);
  580. -+#endif
  581. -
  582. - if (drv->mlme_sock >= 0)
  583. - eloop_unregister_read_sock(drv->mlme_sock);
  584. --- a/src/drivers/drivers.mak
  585. +++ b/src/drivers/drivers.mak
  586. -@@ -25,7 +25,6 @@ NEED_SME=y
  587. +@@ -30,7 +30,6 @@ NEED_SME=y
  588. NEED_AP_MLME=y
  589. NEED_NETLINK=y
  590. NEED_LINUX_IOCTL=y
  591. @@ -223,7 +8,7 @@
  592. ifdef CONFIG_LIBNL32
  593. DRV_LIBS += -lnl-3
  594. -@@ -109,7 +108,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
  595. +@@ -114,7 +113,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
  596. CONFIG_WIRELESS_EXTENSION=y
  597. NEED_NETLINK=y
  598. NEED_LINUX_IOCTL=y
  599. @@ -231,7 +16,7 @@
  600. endif
  601. ifdef CONFIG_DRIVER_NDIS
  602. -@@ -135,7 +133,6 @@ endif
  603. +@@ -140,7 +138,6 @@ endif
  604. ifdef CONFIG_WIRELESS_EXTENSION
  605. DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION
  606. DRV_WPA_OBJS += ../src/drivers/driver_wext.o
  607. @@ -239,7 +24,7 @@
  608. endif
  609. ifdef NEED_NETLINK
  610. -@@ -148,6 +145,7 @@ endif
  611. +@@ -153,6 +150,7 @@ endif
  612. ifdef NEED_RFKILL
  613. DRV_OBJS += ../src/drivers/rfkill.o
  614. @@ -247,15 +32,30 @@
  615. endif
  616. ifdef CONFIG_VLAN_NETLINK
  617. ---- a/src/drivers/driver_wext.h
  618. -+++ b/src/drivers/driver_wext.h
  619. -@@ -22,7 +22,9 @@ struct wpa_driver_wext_data {
  620. - int ifindex2;
  621. - int if_removed;
  622. - int if_disabled;
  623. -+#ifdef CONFIG_RFKILL
  624. - struct rfkill_data *rfkill;
  625. -+#endif
  626. - u8 *assoc_req_ies;
  627. - size_t assoc_req_ies_len;
  628. - u8 *assoc_resp_ies;
  629. +--- a/src/drivers/rfkill.h
  630. ++++ b/src/drivers/rfkill.h
  631. +@@ -18,8 +18,24 @@ struct rfkill_config {
  632. + void (*unblocked_cb)(void *ctx);
  633. + };
  634. +
  635. ++#ifdef CONFIG_RFKILL
  636. + struct rfkill_data * rfkill_init(struct rfkill_config *cfg);
  637. + void rfkill_deinit(struct rfkill_data *rfkill);
  638. + int rfkill_is_blocked(struct rfkill_data *rfkill);
  639. ++#else
  640. ++static inline struct rfkill_data * rfkill_init(struct rfkill_config *cfg)
  641. ++{
  642. ++ return (void *) 1;
  643. ++}
  644. ++
  645. ++static inline void rfkill_deinit(struct rfkill_data *rfkill)
  646. ++{
  647. ++}
  648. ++
  649. ++static inline int rfkill_is_blocked(struct rfkill_data *rfkill)
  650. ++{
  651. ++ return 0;
  652. ++}
  653. ++#endif
  654. +
  655. + #endif /* RFKILL_H */
  656. diff --git a/package/hostapd/patches/330-nl80211_fix_set_freq.patch b/package/hostapd/patches/330-nl80211_fix_set_freq.patch
  657. index a505a60..dbc9ef8 100644
  658. --- a/package/hostapd/patches/330-nl80211_fix_set_freq.patch
  659. +++ b/package/hostapd/patches/330-nl80211_fix_set_freq.patch
  660. @@ -1,15 +1,15 @@
  661. --- a/src/drivers/driver_nl80211.c
  662. +++ b/src/drivers/driver_nl80211.c
  663. -@@ -6860,7 +6860,7 @@ static int wpa_driver_nl80211_set_freq(s
  664. -
  665. - nl80211_cmd(drv, msg, 0, NL80211_CMD_SET_WIPHY);
  666. +@@ -7488,7 +7488,7 @@ static int nl80211_set_channel(struct i8
  667. + nl80211_cmd(drv, msg, 0, set_chan ? NL80211_CMD_SET_CHANNEL :
  668. + NL80211_CMD_SET_WIPHY);
  669. - NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex);
  670. + NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, bss->ifindex);
  671. if (nl80211_put_freq_params(msg, freq) < 0)
  672. goto nla_put_failure;
  673. -@@ -11322,7 +11322,7 @@ static int nl80211_switch_channel(void *
  674. +@@ -12047,7 +12047,7 @@ static int nl80211_switch_channel(void *
  675. return -ENOMEM;
  676. nl80211_cmd(drv, msg, 0, NL80211_CMD_CHANNEL_SWITCH);
  677. diff --git a/package/hostapd/patches/340-reload_freq_change.patch b/package/hostapd/patches/340-reload_freq_change.patch
  678. index 9316794..d3e8918 100644
  679. --- a/package/hostapd/patches/340-reload_freq_change.patch
  680. +++ b/package/hostapd/patches/340-reload_freq_change.patch
  681. @@ -1,6 +1,6 @@
  682. --- a/src/ap/hostapd.c
  683. +++ b/src/ap/hostapd.c
  684. -@@ -72,6 +72,16 @@ static void hostapd_reload_bss(struct ho
  685. +@@ -70,6 +70,16 @@ static void hostapd_reload_bss(struct ho
  686. #endif /* CONFIG_NO_RADIUS */
  687. ssid = &hapd->conf->ssid;
  688. @@ -17,7 +17,7 @@
  689. if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next &&
  690. ssid->wpa_passphrase_set && ssid->wpa_passphrase) {
  691. /*
  692. -@@ -172,6 +182,9 @@ int hostapd_reload_config(struct hostapd
  693. +@@ -170,20 +180,12 @@ int hostapd_reload_config(struct hostapd
  694. oldconf = hapd->iconf;
  695. iface->conf = newconf;
  696. @@ -27,3 +27,17 @@
  697. for (j = 0; j < iface->num_bss; j++) {
  698. hapd = iface->bss[j];
  699. hapd->iconf = newconf;
  700. +- hapd->iconf->channel = oldconf->channel;
  701. +- hapd->iconf->secondary_channel = oldconf->secondary_channel;
  702. +- hapd->iconf->ieee80211n = oldconf->ieee80211n;
  703. +- hapd->iconf->ieee80211ac = oldconf->ieee80211ac;
  704. +- hapd->iconf->ht_capab = oldconf->ht_capab;
  705. +- hapd->iconf->vht_capab = oldconf->vht_capab;
  706. +- hapd->iconf->vht_oper_chwidth = oldconf->vht_oper_chwidth;
  707. +- hapd->iconf->vht_oper_centr_freq_seg0_idx =
  708. +- oldconf->vht_oper_centr_freq_seg0_idx;
  709. +- hapd->iconf->vht_oper_centr_freq_seg1_idx =
  710. +- oldconf->vht_oper_centr_freq_seg1_idx;
  711. + hapd->conf = newconf->bss[j];
  712. + hostapd_reload_bss(hapd);
  713. + }
  714. diff --git a/package/hostapd/patches/350-nl80211_del_beacon_bss.patch b/package/hostapd/patches/350-nl80211_del_beacon_bss.patch
  715. index 885922c..e6f6cf3 100644
  716. --- a/package/hostapd/patches/350-nl80211_del_beacon_bss.patch
  717. +++ b/package/hostapd/patches/350-nl80211_del_beacon_bss.patch
  718. @@ -1,6 +1,6 @@
  719. --- a/src/drivers/driver_nl80211.c
  720. +++ b/src/drivers/driver_nl80211.c
  721. -@@ -4290,18 +4290,20 @@ wpa_driver_nl80211_finish_drv_init(struc
  722. +@@ -4817,18 +4817,20 @@ wpa_driver_nl80211_finish_drv_init(struc
  723. }
  724. @@ -24,7 +24,7 @@
  725. return send_and_recv_msgs(drv, msg, NULL, NULL);
  726. nla_put_failure:
  727. -@@ -4309,6 +4311,15 @@ static int wpa_driver_nl80211_del_beacon
  728. +@@ -4836,6 +4838,15 @@ static int wpa_driver_nl80211_del_beacon
  729. return -ENOBUFS;
  730. }
  731. @@ -40,7 +40,7 @@
  732. /**
  733. * wpa_driver_nl80211_deinit - Deinitialize nl80211 driver interface
  734. -@@ -9911,7 +9922,6 @@ static int wpa_driver_nl80211_stop_ap(vo
  735. +@@ -10617,7 +10628,6 @@ static int wpa_driver_nl80211_stop_ap(vo
  736. if (!is_ap_interface(drv->nlmode))
  737. return -1;
  738. wpa_driver_nl80211_del_beacon(drv);
  739. diff --git a/package/hostapd/patches/360-ctrl_iface_reload.patch b/package/hostapd/patches/360-ctrl_iface_reload.patch
  740. index 170d4f2..e69c3d3 100644
  741. --- a/package/hostapd/patches/360-ctrl_iface_reload.patch
  742. +++ b/package/hostapd/patches/360-ctrl_iface_reload.patch
  743. @@ -1,6 +1,6 @@
  744. --- a/hostapd/ctrl_iface.c
  745. +++ b/hostapd/ctrl_iface.c
  746. -@@ -34,6 +34,7 @@
  747. +@@ -37,6 +37,7 @@
  748. #include "wps/wps.h"
  749. #include "config_file.h"
  750. #include "ctrl_iface.h"
  751. @@ -8,7 +8,7 @@
  752. struct wpa_ctrl_dst {
  753. -@@ -44,6 +45,7 @@ struct wpa_ctrl_dst {
  754. +@@ -47,6 +48,7 @@ struct wpa_ctrl_dst {
  755. int errors;
  756. };
  757. @@ -16,7 +16,7 @@
  758. static void hostapd_ctrl_iface_send(struct hostapd_data *hapd, int level,
  759. const char *buf, size_t len);
  760. -@@ -153,6 +155,68 @@ static int hostapd_ctrl_iface_new_sta(st
  761. +@@ -156,6 +158,68 @@ static int hostapd_ctrl_iface_new_sta(st
  762. return 0;
  763. }
  764. @@ -85,14 +85,14 @@
  765. #ifdef CONFIG_IEEE80211W
  766. #ifdef NEED_AP_MLME
  767. -@@ -1199,6 +1263,10 @@ static void hostapd_ctrl_iface_receive(i
  768. - reply_len += res;
  769. - }
  770. - #endif /* CONFIG_NO_RADIUS */
  771. +@@ -1546,6 +1610,10 @@ static void hostapd_ctrl_iface_receive(i
  772. + } else if (os_strncmp(buf, "VENDOR ", 7) == 0) {
  773. + reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply,
  774. + reply_size);
  775. + } else if (os_strcmp(buf, "DOWN") == 0) {
  776. + hostapd_ctrl_iface_set_down(hapd);
  777. + } else if (os_strncmp(buf, "UPDATE ", 7) == 0) {
  778. + hostapd_ctrl_iface_update(hapd, buf + 7);
  779. - } else if (os_strcmp(buf, "STA-FIRST") == 0) {
  780. - reply_len = hostapd_ctrl_iface_sta_first(hapd, reply,
  781. - reply_size);
  782. +
  783. + } else {
  784. + os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
  785. diff --git a/package/hostapd/patches/370-ap_sta_support.patch b/package/hostapd/patches/370-ap_sta_support.patch
  786. index a3d0572..8a92ead 100644
  787. --- a/package/hostapd/patches/370-ap_sta_support.patch
  788. +++ b/package/hostapd/patches/370-ap_sta_support.patch
  789. @@ -1,6 +1,6 @@
  790. --- a/wpa_supplicant/wpa_supplicant_i.h
  791. +++ b/wpa_supplicant/wpa_supplicant_i.h
  792. -@@ -96,6 +96,11 @@ struct wpa_interface {
  793. +@@ -108,6 +108,11 @@ struct wpa_interface {
  794. const char *ifname;
  795. /**
  796. @@ -12,7 +12,7 @@
  797. * bridge_ifname - Optional bridge interface name
  798. *
  799. * If the driver interface (ifname) is included in a Linux bridge
  800. -@@ -325,6 +330,8 @@ struct wpa_supplicant {
  801. +@@ -395,6 +400,8 @@ struct wpa_supplicant {
  802. #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
  803. char bridge_ifname[16];
  804. @@ -20,12 +20,12 @@
  805. +
  806. char *confname;
  807. char *confanother;
  808. - struct wpa_config *conf;
  809. +
  810. --- a/wpa_supplicant/Makefile
  811. +++ b/wpa_supplicant/Makefile
  812. @@ -13,6 +13,10 @@ PKG_CONFIG ?= pkg-config
  813. - CFLAGS += -I../src
  814. - CFLAGS += -I../src/utils
  815. + CFLAGS += -I$(abspath ../src)
  816. + CFLAGS += -I$(abspath ../src/utils)
  817. +ifdef MULTICALL
  818. +CFLAGS += -DMULTICALL
  819. @@ -34,7 +34,7 @@
  820. -include .config
  821. -include $(if $(MULTICALL),../hostapd/.config)
  822. -@@ -76,6 +80,8 @@ OBJS_c = wpa_cli.o ../src/common/wpa_ctr
  823. +@@ -82,6 +86,8 @@ OBJS_c = wpa_cli.o ../src/common/wpa_ctr
  824. OBJS_c += ../src/utils/wpa_debug.o
  825. OBJS_c += ../src/utils/common.o
  826. @@ -45,9 +45,9 @@
  827. CONFIG_OS=win32
  828. --- a/wpa_supplicant/wpa_supplicant.c
  829. +++ b/wpa_supplicant/wpa_supplicant.c
  830. -@@ -109,6 +109,46 @@ extern int wpa_debug_show_keys;
  831. - extern int wpa_debug_timestamp;
  832. - extern struct wpa_driver_ops *wpa_drivers[];
  833. +@@ -105,6 +105,55 @@ const char *wpa_supplicant_full_license5
  834. + "\n";
  835. + #endif /* CONFIG_NO_STDOUT_DEBUG */
  836. +static int hostapd_stop(struct wpa_supplicant *wpa_s)
  837. +{
  838. @@ -69,14 +69,23 @@
  839. + int len = sizeof(buf);
  840. + enum hostapd_hw_mode hw_mode;
  841. + u8 channel;
  842. ++ int sec_chan = 0;
  843. + int ret;
  844. +
  845. + if (!bss)
  846. + return;
  847. +
  848. ++ if (bss->ht_param & HT_INFO_HT_PARAM_STA_CHNL_WIDTH) {
  849. ++ int sec = bss->ht_param & HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK;
  850. ++ if (sec == HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE)
  851. ++ sec_chan = 1;
  852. ++ else if (sec == HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW)
  853. ++ sec_chan = -1;
  854. ++ }
  855. ++
  856. + hw_mode = ieee80211_freq_to_chan(bss->freq, &channel);
  857. -+ if (asprintf(&cmd, "UPDATE channel=%d sec_chan=0 hw_mode=%d ieee80211n=%d",
  858. -+ channel, hw_mode, !!bss->ht_capab) < 0)
  859. ++ if (asprintf(&cmd, "UPDATE channel=%d sec_chan=%d hw_mode=%d ieee80211n=%d",
  860. ++ channel, sec_chan, hw_mode, !!bss->ht_capab) < 0)
  861. + return -1;
  862. +
  863. + ret = wpa_ctrl_request(wpa_s->hostapd, cmd, os_strlen(cmd), buf, &len, NULL);
  864. @@ -92,7 +101,7 @@
  865. /* Configure default/group WEP keys for static WEP */
  866. int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
  867. {
  868. -@@ -685,8 +725,12 @@ void wpa_supplicant_set_state(struct wpa
  869. +@@ -711,8 +760,12 @@ void wpa_supplicant_set_state(struct wpa
  870. #endif /* CONFIG_P2P */
  871. sme_sched_obss_scan(wpa_s, 1);
  872. @@ -105,7 +114,7 @@
  873. wpa_s->new_connection = 1;
  874. wpa_drv_set_operstate(wpa_s, 0);
  875. #ifndef IEEE8021X_EAPOL
  876. -@@ -2906,6 +2950,20 @@ static int wpa_supplicant_init_iface(str
  877. +@@ -3595,6 +3648,20 @@ static int wpa_supplicant_init_iface(str
  878. sizeof(wpa_s->bridge_ifname));
  879. }
  880. @@ -126,7 +135,7 @@
  881. /* RSNA Supplicant Key Management - INITIALIZE */
  882. eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE);
  883. eapol_sm_notify_portValid(wpa_s->eapol, FALSE);
  884. -@@ -3125,6 +3183,11 @@ static void wpa_supplicant_deinit_iface(
  885. +@@ -3798,6 +3865,11 @@ static void wpa_supplicant_deinit_iface(
  886. if (terminate)
  887. wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING);
  888. @@ -148,41 +157,45 @@
  889. #include "drivers/driver.h"
  890. #include "wpa_supplicant_i.h"
  891. #include "config.h"
  892. -@@ -245,6 +246,9 @@ static void calculate_update_time(const
  893. +@@ -247,6 +248,10 @@ static void calculate_update_time(const
  894. static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src,
  895. - struct os_time *fetch_time)
  896. + struct os_reltime *fetch_time)
  897. {
  898. + struct ieee80211_ht_capabilities *capab;
  899. ++ struct ieee80211_ht_operation *oper;
  900. + struct ieee802_11_elems elems;
  901. +
  902. dst->flags = src->flags;
  903. os_memcpy(dst->bssid, src->bssid, ETH_ALEN);
  904. dst->freq = src->freq;
  905. -@@ -255,6 +259,12 @@ static void wpa_bss_copy_res(struct wpa_
  906. +@@ -257,6 +262,15 @@ static void wpa_bss_copy_res(struct wpa_
  907. dst->level = src->level;
  908. dst->tsf = src->tsf;
  909. + memset(&elems, 0, sizeof(elems));
  910. + ieee802_11_parse_elems((u8 *) (src + 1), src->ie_len, &elems, 0);
  911. + capab = (struct ieee80211_ht_capabilities *) elems.ht_capabilities;
  912. ++ oper = (struct ieee80211_ht_operation *) elems.ht_operation;
  913. + if (capab)
  914. + dst->ht_capab = le_to_host16(capab->ht_capabilities_info);
  915. ++ if (oper)
  916. ++ dst->ht_param = oper->ht_param;
  917. +
  918. calculate_update_time(fetch_time, src->age, &dst->last_update);
  919. }
  920. --- a/wpa_supplicant/main.c
  921. +++ b/wpa_supplicant/main.c
  922. -@@ -27,7 +27,7 @@ static void usage(void)
  923. - " wpa_supplicant [-BddhKLqqstuvW] [-P<pid file>] "
  924. +@@ -33,7 +33,7 @@ static void usage(void)
  925. + "vW] [-P<pid file>] "
  926. "[-g<global ctrl>] \\\n"
  927. " [-G<group>] \\\n"
  928. - " -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] "
  929. + " -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-H<hostapd path>] "
  930. "[-p<driver_param>] \\\n"
  931. - " [-b<br_ifname>] [-f<debug file>] [-e<entropy file>] "
  932. - "\\\n"
  933. -@@ -72,6 +72,7 @@ static void usage(void)
  934. + " [-b<br_ifname>] [-e<entropy file>]"
  935. + #ifdef CONFIG_DEBUG_FILE
  936. +@@ -84,6 +84,7 @@ static void usage(void)
  937. #endif /* CONFIG_DEBUG_LINUX_TRACING */
  938. printf(" -t = include timestamp in debug messages\n"
  939. " -h = show this help text\n"
  940. @@ -190,16 +203,16 @@
  941. " -L = show license (BSD)\n"
  942. " -o = override driver parameter for new interfaces\n"
  943. " -O = override ctrl_interface parameter for new interfaces\n"
  944. -@@ -160,7 +161,7 @@ int main(int argc, char *argv[])
  945. +@@ -175,7 +176,7 @@ int main(int argc, char *argv[])
  946. for (;;) {
  947. c = getopt(argc, argv,
  948. -- "b:Bc:C:D:de:f:g:G:hi:I:KLNo:O:p:P:qsTtuvW");
  949. -+ "b:Bc:C:D:de:f:g:G:hH:i:I:KLNo:O:p:P:qsTtuvW");
  950. +- "b:Bc:C:D:de:f:g:G:hi:I:KLm:No:O:p:P:qsTtuvW");
  951. ++ "b:Bc:C:D:de:f:g:G:hH:i:I:KLm:No:O:p:P:qsTtuvW");
  952. if (c < 0)
  953. break;
  954. switch (c) {
  955. -@@ -207,6 +208,9 @@ int main(int argc, char *argv[])
  956. +@@ -222,6 +223,9 @@ int main(int argc, char *argv[])
  957. usage();
  958. exitcode = 0;
  959. goto out;
  960. @@ -211,12 +224,14 @@
  961. break;
  962. --- a/wpa_supplicant/bss.h
  963. +++ b/wpa_supplicant/bss.h
  964. -@@ -69,6 +69,8 @@ struct wpa_bss {
  965. +@@ -70,6 +70,10 @@ struct wpa_bss {
  966. u8 ssid[32];
  967. /** Length of SSID */
  968. size_t ssid_len;
  969. + /** HT caapbilities */
  970. + u16 ht_capab;
  971. ++ /* Five octets of HT Operation Information */
  972. ++ u8 ht_param;
  973. /** Frequency of the channel in MHz (e.g., 2412 = channel 1) */
  974. int freq;
  975. /** Beacon interval in TUs (host byte order) */
  976. diff --git a/package/hostapd/patches/380-disable_ctrl_iface_mib.patch b/package/hostapd/patches/380-disable_ctrl_iface_mib.patch
  977. index 27f21bd..dee1ab3 100644
  978. --- a/package/hostapd/patches/380-disable_ctrl_iface_mib.patch
  979. +++ b/package/hostapd/patches/380-disable_ctrl_iface_mib.patch
  980. @@ -1,6 +1,6 @@
  981. --- a/hostapd/Makefile
  982. +++ b/hostapd/Makefile
  983. -@@ -144,6 +144,9 @@ endif
  984. +@@ -163,6 +163,9 @@ endif
  985. ifdef CONFIG_NO_CTRL_IFACE
  986. CFLAGS += -DCONFIG_NO_CTRL_IFACE
  987. else
  988. @@ -12,28 +12,15 @@
  989. endif
  990. --- a/hostapd/ctrl_iface.c
  991. +++ b/hostapd/ctrl_iface.c
  992. -@@ -1234,6 +1234,7 @@ static void hostapd_ctrl_iface_receive(i
  993. - } else if (os_strcmp(buf, "STATUS") == 0) {
  994. - reply_len = hostapd_ctrl_iface_status(hapd, reply,
  995. +@@ -1447,6 +1447,7 @@ static void hostapd_ctrl_iface_receive(i
  996. reply_size);
  997. + } else if (os_strcmp(buf, "STATUS-DRIVER") == 0) {
  998. + reply_len = hostapd_drv_status(hapd, reply, reply_size);
  999. +#ifdef CONFIG_CTRL_IFACE_MIB
  1000. } else if (os_strcmp(buf, "MIB") == 0) {
  1001. reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
  1002. if (reply_len >= 0) {
  1003. -@@ -1263,10 +1264,12 @@ static void hostapd_ctrl_iface_receive(i
  1004. - reply_len += res;
  1005. - }
  1006. - #endif /* CONFIG_NO_RADIUS */
  1007. -+#endif
  1008. - } else if (os_strcmp(buf, "DOWN") == 0) {
  1009. - hostapd_ctrl_iface_set_down(hapd);
  1010. - } else if (os_strncmp(buf, "UPDATE ", 7) == 0) {
  1011. - hostapd_ctrl_iface_update(hapd, buf + 7);
  1012. -+#ifdef CONFIG_CTRL_IFACE_MIB
  1013. - } else if (os_strcmp(buf, "STA-FIRST") == 0) {
  1014. - reply_len = hostapd_ctrl_iface_sta_first(hapd, reply,
  1015. - reply_size);
  1016. -@@ -1276,6 +1279,7 @@ static void hostapd_ctrl_iface_receive(i
  1017. +@@ -1488,6 +1489,7 @@ static void hostapd_ctrl_iface_receive(i
  1018. } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
  1019. reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply,
  1020. reply_size);
  1021. @@ -43,7 +30,7 @@
  1022. reply_len = -1;
  1023. --- a/wpa_supplicant/Makefile
  1024. +++ b/wpa_supplicant/Makefile
  1025. -@@ -778,6 +778,9 @@ ifdef CONFIG_WNM
  1026. +@@ -805,6 +805,9 @@ ifdef CONFIG_WNM
  1027. OBJS += ../src/ap/wnm_ap.o
  1028. endif
  1029. ifdef CONFIG_CTRL_IFACE
  1030. @@ -55,7 +42,7 @@
  1031. --- a/wpa_supplicant/ctrl_iface.c
  1032. +++ b/wpa_supplicant/ctrl_iface.c
  1033. -@@ -5262,6 +5262,7 @@ char * wpa_supplicant_ctrl_iface_process
  1034. +@@ -6243,6 +6243,7 @@ char * wpa_supplicant_ctrl_iface_process
  1035. reply_len = -1;
  1036. } else if (os_strncmp(buf, "NOTE ", 5) == 0) {
  1037. wpa_printf(MSG_INFO, "NOTE: %s", buf + 5);
  1038. @@ -63,7 +50,7 @@
  1039. } else if (os_strcmp(buf, "MIB") == 0) {
  1040. reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
  1041. if (reply_len >= 0) {
  1042. -@@ -5273,6 +5274,7 @@ char * wpa_supplicant_ctrl_iface_process
  1043. +@@ -6254,6 +6255,7 @@ char * wpa_supplicant_ctrl_iface_process
  1044. else
  1045. reply_len += res;
  1046. }
  1047. @@ -71,7 +58,7 @@
  1048. } else if (os_strncmp(buf, "STATUS", 6) == 0) {
  1049. reply_len = wpa_supplicant_ctrl_iface_status(
  1050. wpa_s, buf + 6, reply, reply_size);
  1051. -@@ -5687,6 +5689,7 @@ char * wpa_supplicant_ctrl_iface_process
  1052. +@@ -6661,6 +6663,7 @@ char * wpa_supplicant_ctrl_iface_process
  1053. reply_len = wpa_supplicant_ctrl_iface_bss(
  1054. wpa_s, buf + 4, reply, reply_size);
  1055. #ifdef CONFIG_AP
  1056. @@ -79,7 +66,7 @@
  1057. } else if (os_strcmp(buf, "STA-FIRST") == 0) {
  1058. reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size);
  1059. } else if (os_strncmp(buf, "STA ", 4) == 0) {
  1060. -@@ -5695,6 +5698,7 @@ char * wpa_supplicant_ctrl_iface_process
  1061. +@@ -6669,6 +6672,7 @@ char * wpa_supplicant_ctrl_iface_process
  1062. } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
  1063. reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply,
  1064. reply_size);
  1065. @@ -89,15 +76,15 @@
  1066. reply_len = -1;
  1067. --- a/src/ap/ctrl_iface_ap.c
  1068. +++ b/src/ap/ctrl_iface_ap.c
  1069. -@@ -20,6 +20,7 @@
  1070. +@@ -21,6 +21,7 @@
  1071. #include "ctrl_iface_ap.h"
  1072. #include "ap_drv_ops.h"
  1073. +#ifdef CONFIG_CTRL_IFACE_MIB
  1074. - static int hostapd_get_sta_conn_time(struct sta_info *sta,
  1075. - char *buf, size_t buflen)
  1076. -@@ -129,6 +130,7 @@ int hostapd_ctrl_iface_sta_next(struct h
  1077. + static int hostapd_get_sta_tx_rx(struct hostapd_data *hapd,
  1078. + struct sta_info *sta,
  1079. +@@ -214,6 +215,7 @@ int hostapd_ctrl_iface_sta_next(struct h
  1080. return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen);
  1081. }
  1082. @@ -105,14 +92,14 @@
  1083. #ifdef CONFIG_P2P_MANAGER
  1084. static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
  1085. -@@ -423,3 +425,4 @@ int hostapd_parse_csa_settings(const cha
  1086. +@@ -526,3 +528,4 @@ int hostapd_parse_csa_settings(const cha
  1087. return 0;
  1088. }
  1089. +
  1090. --- a/src/ap/ieee802_1x.c
  1091. +++ b/src/ap/ieee802_1x.c
  1092. -@@ -1938,6 +1938,7 @@ static const char * bool_txt(Boolean boo
  1093. +@@ -2124,6 +2124,7 @@ static const char * bool_txt(Boolean boo
  1094. return bool_val ? "TRUE" : "FALSE";
  1095. }
  1096. @@ -120,17 +107,17 @@
  1097. int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
  1098. {
  1099. -@@ -2090,6 +2091,7 @@ int ieee802_1x_get_mib_sta(struct hostap
  1100. +@@ -2291,6 +2292,7 @@ int ieee802_1x_get_mib_sta(struct hostap
  1101. return len;
  1102. }
  1103. +#endif
  1104. static void ieee802_1x_finished(struct hostapd_data *hapd,
  1105. - struct sta_info *sta, int success)
  1106. + struct sta_info *sta, int success,
  1107. --- a/src/ap/wpa_auth.c
  1108. +++ b/src/ap/wpa_auth.c
  1109. -@@ -2708,6 +2708,7 @@ static const char * wpa_bool_txt(int boo
  1110. +@@ -2832,6 +2832,7 @@ static const char * wpa_bool_txt(int boo
  1111. return bool ? "TRUE" : "FALSE";
  1112. }
  1113. @@ -138,7 +125,7 @@
  1114. #define RSN_SUITE "%02x-%02x-%02x-%d"
  1115. #define RSN_SUITE_ARG(s) \
  1116. -@@ -2852,7 +2853,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
  1117. +@@ -2976,7 +2977,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
  1118. return len;
  1119. }
  1120. @@ -149,7 +136,7 @@
  1121. {
  1122. --- a/src/rsn_supp/wpa.c
  1123. +++ b/src/rsn_supp/wpa.c
  1124. -@@ -1844,6 +1844,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
  1125. +@@ -1911,6 +1911,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
  1126. }
  1127. @@ -158,7 +145,7 @@
  1128. #define RSN_SUITE "%02x-%02x-%02x-%d"
  1129. #define RSN_SUITE_ARG(s) \
  1130. ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
  1131. -@@ -1927,6 +1929,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
  1132. +@@ -1994,6 +1996,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
  1133. return (int) len;
  1134. }
  1135. diff --git a/package/hostapd/patches/390-wpa_ie_cap_workaround.patch b/package/hostapd/patches/390-wpa_ie_cap_workaround.patch
  1136. index 00a3222..40148fc 100644
  1137. --- a/package/hostapd/patches/390-wpa_ie_cap_workaround.patch
  1138. +++ b/package/hostapd/patches/390-wpa_ie_cap_workaround.patch
  1139. @@ -1,6 +1,6 @@
  1140. --- a/src/common/wpa_common.c
  1141. +++ b/src/common/wpa_common.c
  1142. -@@ -959,6 +959,31 @@ const char * wpa_key_mgmt_txt(int key_mg
  1143. +@@ -1002,6 +1002,31 @@ const char * wpa_key_mgmt_txt(int key_mg
  1144. }
  1145. @@ -32,7 +32,7 @@
  1146. int wpa_compare_rsn_ie(int ft_initial_assoc,
  1147. const u8 *ie1, size_t ie1len,
  1148. const u8 *ie2, size_t ie2len)
  1149. -@@ -966,8 +991,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
  1150. +@@ -1009,8 +1034,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
  1151. if (ie1 == NULL || ie2 == NULL)
  1152. return -1;
  1153. diff --git a/package/hostapd/patches/400-terminate_on_setup_failure.patch b/package/hostapd/patches/400-terminate_on_setup_failure.patch
  1154. deleted file mode 100644
  1155. index 0d9065a..0000000
  1156. --- a/package/hostapd/patches/400-terminate_on_setup_failure.patch
  1157. +++ /dev/null
  1158. @@ -1,85 +0,0 @@
  1159. ---- a/src/ap/hostapd.c
  1160. -+++ b/src/ap/hostapd.c
  1161. -@@ -1103,13 +1103,8 @@ int hostapd_setup_interface_complete(str
  1162. - size_t j;
  1163. - u8 *prev_addr;
  1164. -
  1165. -- if (err) {
  1166. -- wpa_printf(MSG_ERROR, "Interface initialization failed");
  1167. -- hostapd_set_state(iface, HAPD_IFACE_DISABLED);
  1168. -- if (iface->interfaces && iface->interfaces->terminate_on_error)
  1169. -- eloop_terminate();
  1170. -- return -1;
  1171. -- }
  1172. -+ if (err)
  1173. -+ goto error;
  1174. -
  1175. - wpa_printf(MSG_DEBUG, "Completing interface initialization");
  1176. - if (iface->conf->channel) {
  1177. -@@ -1140,7 +1135,7 @@ int hostapd_setup_interface_complete(str
  1178. - hapd->iconf->vht_oper_centr_freq_seg1_idx)) {
  1179. - wpa_printf(MSG_ERROR, "Could not set channel for "
  1180. - "kernel driver");
  1181. -- return -1;
  1182. -+ goto error;
  1183. - }
  1184. - }
  1185. -
  1186. -@@ -1151,7 +1146,7 @@ int hostapd_setup_interface_complete(str
  1187. - hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
  1188. - HOSTAPD_LEVEL_WARNING,
  1189. - "Failed to prepare rates table.");
  1190. -- return -1;
  1191. -+ goto error;
  1192. - }
  1193. - }
  1194. -
  1195. -@@ -1159,14 +1154,14 @@ int hostapd_setup_interface_complete(str
  1196. - hostapd_set_rts(hapd, hapd->iconf->rts_threshold)) {
  1197. - wpa_printf(MSG_ERROR, "Could not set RTS threshold for "
  1198. - "kernel driver");
  1199. -- return -1;
  1200. -+ goto error;
  1201. - }
  1202. -
  1203. - if (hapd->iconf->fragm_threshold > -1 &&
  1204. - hostapd_set_frag(hapd, hapd->iconf->fragm_threshold)) {
  1205. - wpa_printf(MSG_ERROR, "Could not set fragmentation threshold "
  1206. - "for kernel driver");
  1207. -- return -1;
  1208. -+ goto error;
  1209. - }
  1210. -
  1211. - prev_addr = hapd->own_addr;
  1212. -@@ -1176,7 +1171,7 @@ int hostapd_setup_interface_complete(str
  1213. - if (j)
  1214. - os_memcpy(hapd->own_addr, prev_addr, ETH_ALEN);
  1215. - if (hostapd_setup_bss(hapd, j == 0))
  1216. -- return -1;
  1217. -+ goto error;
  1218. - if (hostapd_mac_comp_empty(hapd->conf->bssid) == 0)
  1219. - prev_addr = hapd->own_addr;
  1220. - }
  1221. -@@ -1191,7 +1186,7 @@ int hostapd_setup_interface_complete(str
  1222. - if (hostapd_driver_commit(hapd) < 0) {
  1223. - wpa_printf(MSG_ERROR, "%s: Failed to commit driver "
  1224. - "configuration", __func__);
  1225. -- return -1;
  1226. -+ goto error;
  1227. - }
  1228. -
  1229. - /*
  1230. -@@ -1216,6 +1211,13 @@ int hostapd_setup_interface_complete(str
  1231. - iface->interfaces->terminate_on_error--;
  1232. -
  1233. - return 0;
  1234. -+
  1235. -+error:
  1236. -+ wpa_printf(MSG_ERROR, "Interface initialization failed");
  1237. -+ hostapd_set_state(iface, HAPD_IFACE_DISABLED);
  1238. -+ if (iface->interfaces && iface->interfaces->terminate_on_error)
  1239. -+ eloop_terminate();
  1240. -+ return -1;
  1241. - }
  1242. -
  1243. -
  1244. diff --git a/package/hostapd/patches/410-bring_down_interface.patch b/package/hostapd/patches/410-bring_down_interface.patch
  1245. index 31033a0..165484b 100644
  1246. --- a/package/hostapd/patches/410-bring_down_interface.patch
  1247. +++ b/package/hostapd/patches/410-bring_down_interface.patch
  1248. @@ -1,6 +1,6 @@
  1249. --- a/src/drivers/driver_nl80211.c
  1250. +++ b/src/drivers/driver_nl80211.c
  1251. -@@ -8480,12 +8480,7 @@ static int wpa_driver_nl80211_set_mode(s
  1252. +@@ -9070,12 +9070,7 @@ static int wpa_driver_nl80211_set_mode(s
  1253. /* Try to set the mode again while the interface is
  1254. * down */
  1255. ret = nl80211_set_mode(drv, drv->ifindex, nlmode);
  1256. @@ -14,7 +14,7 @@
  1257. break;
  1258. } else
  1259. wpa_printf(MSG_DEBUG, "nl80211: Failed to set "
  1260. -@@ -8498,6 +8493,8 @@ static int wpa_driver_nl80211_set_mode(s
  1261. +@@ -9088,6 +9083,8 @@ static int wpa_driver_nl80211_set_mode(s
  1262. "interface is down");
  1263. drv->nlmode = nlmode;
  1264. drv->ignore_if_down_event = 1;
  1265. diff --git a/package/hostapd/patches/420-fix_wps_pin_crash.patch b/package/hostapd/patches/420-fix_wps_pin_crash.patch
  1266. index 130bd53..31995c4 100644
  1267. --- a/package/hostapd/patches/420-fix_wps_pin_crash.patch
  1268. +++ b/package/hostapd/patches/420-fix_wps_pin_crash.patch
  1269. @@ -1,6 +1,6 @@
  1270. --- a/hostapd/ctrl_iface.c
  1271. +++ b/hostapd/ctrl_iface.c
  1272. -@@ -480,6 +480,9 @@ static int hostapd_ctrl_iface_wps_ap_pin
  1273. +@@ -540,6 +540,9 @@ static int hostapd_ctrl_iface_wps_ap_pin
  1274. char *pos;
  1275. const char *pin_txt;
  1276. diff --git a/package/hostapd/patches/430-wps_single_auth_enc_type.patch b/package/hostapd/patches/430-wps_single_auth_enc_type.patch
  1277. index 6e86658..8dae52b 100644
  1278. --- a/package/hostapd/patches/430-wps_single_auth_enc_type.patch
  1279. +++ b/package/hostapd/patches/430-wps_single_auth_enc_type.patch
  1280. @@ -1,6 +1,6 @@
  1281. --- a/src/ap/wps_hostapd.c
  1282. +++ b/src/ap/wps_hostapd.c
  1283. -@@ -1069,11 +1069,9 @@ int hostapd_init_wps(struct hostapd_data
  1284. +@@ -1051,11 +1051,9 @@ int hostapd_init_wps(struct hostapd_data
  1285. if (conf->rsn_pairwise & WPA_CIPHER_CCMP)
  1286. wps->encr_types |= WPS_ENCR_AES;
  1287. @@ -14,7 +14,7 @@
  1288. if (conf->wpa_key_mgmt & WPA_KEY_MGMT_PSK)
  1289. wps->auth_types |= WPS_AUTH_WPAPSK;
  1290. if (conf->wpa_key_mgmt & WPA_KEY_MGMT_IEEE8021X)
  1291. -@@ -1081,7 +1079,7 @@ int hostapd_init_wps(struct hostapd_data
  1292. +@@ -1063,7 +1061,7 @@ int hostapd_init_wps(struct hostapd_data
  1293. if (conf->wpa_pairwise & WPA_CIPHER_CCMP)
  1294. wps->encr_types |= WPS_ENCR_AES;
  1295. diff --git a/package/hostapd/patches/440-dynamic_20_40_mhz.patch b/package/hostapd/patches/440-dynamic_20_40_mhz.patch
  1296. deleted file mode 100644
  1297. index 905ec2c..0000000
  1298. --- a/package/hostapd/patches/440-dynamic_20_40_mhz.patch
  1299. +++ /dev/null
  1300. @@ -1,206 +0,0 @@
  1301. ---- a/hostapd/config_file.c
  1302. -+++ b/hostapd/config_file.c
  1303. -@@ -2422,6 +2422,10 @@ static int hostapd_config_fill(struct ho
  1304. - "ht_capab", line);
  1305. - errors++;
  1306. - }
  1307. -+ } else if (os_strcmp(buf, "dynamic_ht40") == 0) {
  1308. -+ conf->dynamic_ht40 = atoi(pos);
  1309. -+ if (conf->dynamic_ht40 == 1)
  1310. -+ conf->dynamic_ht40 = 1500;
  1311. - } else if (os_strcmp(buf, "require_ht") == 0) {
  1312. - conf->require_ht = atoi(pos);
  1313. - } else if (os_strcmp(buf, "obss_interval") == 0) {
  1314. ---- a/src/ap/ap_config.h
  1315. -+++ b/src/ap/ap_config.h
  1316. -@@ -531,6 +531,7 @@ struct hostapd_config {
  1317. - int ieee80211n;
  1318. - int secondary_channel;
  1319. - int require_ht;
  1320. -+ int dynamic_ht40;
  1321. - int obss_interval;
  1322. - u32 vht_capab;
  1323. - int ieee80211ac;
  1324. ---- a/src/ap/hostapd.c
  1325. -+++ b/src/ap/hostapd.c
  1326. -@@ -23,6 +23,7 @@
  1327. - #include "beacon.h"
  1328. - #include "iapp.h"
  1329. - #include "ieee802_1x.h"
  1330. -+#include "ieee802_11.h"
  1331. - #include "ieee802_11_auth.h"
  1332. - #include "vlan_init.h"
  1333. - #include "wpa_auth.h"
  1334. -@@ -332,6 +333,7 @@ static void hostapd_cleanup(struct hosta
  1335. - static void hostapd_cleanup_iface_partial(struct hostapd_iface *iface)
  1336. - {
  1337. - wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface);
  1338. -+ hostapd_deinit_ht(iface);
  1339. - hostapd_free_hw_features(iface->hw_features, iface->num_hw_features);
  1340. - iface->hw_features = NULL;
  1341. - os_free(iface->current_rates);
  1342. ---- a/src/ap/hostapd.h
  1343. -+++ b/src/ap/hostapd.h
  1344. -@@ -326,6 +326,9 @@ struct hostapd_iface {
  1345. - /* Overlapping BSS information */
  1346. - int olbc_ht;
  1347. -
  1348. -+ int force_20mhz;
  1349. -+ struct os_time last_20mhz_trigger;
  1350. -+
  1351. - u16 ht_op_mode;
  1352. -
  1353. - /* surveying helpers */
  1354. ---- a/src/ap/ieee802_11.c
  1355. -+++ b/src/ap/ieee802_11.c
  1356. -@@ -1538,6 +1538,9 @@ static void handle_beacon(struct hostapd
  1357. - sizeof(mgmt->u.beacon)), &elems,
  1358. - 0);
  1359. -
  1360. -+ if (!elems.ht_capabilities)
  1361. -+ hostapd_trigger_20mhz(hapd->iface);
  1362. -+
  1363. - ap_list_process_beacon(hapd->iface, mgmt, &elems, fi);
  1364. - }
  1365. -
  1366. ---- a/src/ap/ieee802_11.h
  1367. -+++ b/src/ap/ieee802_11.h
  1368. -@@ -82,4 +82,17 @@ int hostapd_update_time_adv(struct hosta
  1369. - void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr);
  1370. - u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid);
  1371. -
  1372. -+#ifdef CONFIG_IEEE80211N
  1373. -+void hostapd_trigger_20mhz(struct hostapd_iface *iface);
  1374. -+void hostapd_deinit_ht(struct hostapd_iface *iface);
  1375. -+
  1376. -+#else
  1377. -+static inline void hostapd_deinit_ht(struct hostapd_iface *iface)
  1378. -+{
  1379. -+}
  1380. -+static inline void hostapd_trigger_20mhz(struct hostapd_iface *iface)
  1381. -+{
  1382. -+}
  1383. -+#endif /* CONFIG_IEEE80211N */
  1384. -+
  1385. - #endif /* IEEE802_11_H */
  1386. ---- a/src/ap/ieee802_11_ht.c
  1387. -+++ b/src/ap/ieee802_11_ht.c
  1388. -@@ -20,9 +20,11 @@
  1389. - #include "drivers/driver.h"
  1390. - #include "hostapd.h"
  1391. - #include "ap_config.h"
  1392. -+#include "ap_drv_ops.h"
  1393. - #include "sta_info.h"
  1394. - #include "beacon.h"
  1395. - #include "ieee802_11.h"
  1396. -+#include "utils/eloop.h"
  1397. -
  1398. -
  1399. - u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid)
  1400. -@@ -86,12 +88,15 @@ u8 * hostapd_eid_ht_operation(struct hos
  1401. -
  1402. - oper->control_chan = hapd->iconf->channel;
  1403. - oper->operation_mode = host_to_le16(hapd->iface->ht_op_mode);
  1404. -- if (hapd->iconf->secondary_channel == 1)
  1405. -- oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE |
  1406. -- HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
  1407. -- if (hapd->iconf->secondary_channel == -1)
  1408. -- oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW |
  1409. -- HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
  1410. -+
  1411. -+ if (!hapd->iface->force_20mhz) {
  1412. -+ if (hapd->iconf->secondary_channel == 1)
  1413. -+ oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE |
  1414. -+ HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
  1415. -+ if (hapd->iconf->secondary_channel == -1)
  1416. -+ oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW |
  1417. -+ HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
  1418. -+ }
  1419. -
  1420. - pos += sizeof(*oper);
  1421. -
  1422. -@@ -286,3 +291,84 @@ void hostapd_get_ht_capab(struct hostapd
  1423. -
  1424. - neg_ht_cap->ht_capabilities_info = host_to_le16(cap);
  1425. - }
  1426. -+
  1427. -+static void hostapd_set_force_20mhz(struct hostapd_iface *iface);
  1428. -+
  1429. -+static void hostapd_restore_40mhz(void *eloop_data, void *user_ctx)
  1430. -+{
  1431. -+ struct hostapd_iface *iface = eloop_data;
  1432. -+ struct os_time time;
  1433. -+ int timeout;
  1434. -+
  1435. -+ if (!iface->last_20mhz_trigger.sec)
  1436. -+ return;
  1437. -+
  1438. -+ os_get_time(&time);
  1439. -+ timeout = iface->last_20mhz_trigger.sec + iface->conf->dynamic_ht40 -
  1440. -+ time.sec;
  1441. -+
  1442. -+ if (timeout > 0) {
  1443. -+ eloop_register_timeout(timeout, 0, hostapd_restore_40mhz,
  1444. -+ iface, NULL);
  1445. -+ return;
  1446. -+ }
  1447. -+
  1448. -+ iface->last_20mhz_trigger.sec = 0;
  1449. -+ iface->last_20mhz_trigger.usec = 0;
  1450. -+
  1451. -+ iface->force_20mhz = 0;
  1452. -+ hostapd_set_force_20mhz(iface);
  1453. -+}
  1454. -+
  1455. -+static void hostapd_set_force_20mhz(struct hostapd_iface *iface)
  1456. -+{
  1457. -+ int secondary_channel;
  1458. -+ int i;
  1459. -+
  1460. -+ ieee802_11_set_beacons(iface);
  1461. -+
  1462. -+ for (i = 0; i < iface->num_bss; i++) {
  1463. -+ struct hostapd_data *hapd = iface->bss[i];
  1464. -+
  1465. -+ if (iface->force_20mhz)
  1466. -+ secondary_channel = 0;
  1467. -+ else
  1468. -+ secondary_channel = hapd->iconf->secondary_channel;
  1469. -+
  1470. -+ if (hostapd_set_freq(hapd, hapd->iconf->hw_mode, iface->freq,
  1471. -+ hapd->iconf->channel,
  1472. -+ hapd->iconf->ieee80211n,
  1473. -+ hapd->iconf->ieee80211ac,
  1474. -+ secondary_channel,
  1475. -+ hapd->iconf->vht_oper_chwidth,
  1476. -+ hapd->iconf->vht_oper_centr_freq_seg0_idx,
  1477. -+ hapd->iconf->vht_oper_centr_freq_seg1_idx)) {
  1478. -+ wpa_printf(MSG_ERROR, "Could not set channel for "
  1479. -+ "kernel driver");
  1480. -+ }
  1481. -+ }
  1482. -+}
  1483. -+
  1484. -+void hostapd_deinit_ht(struct hostapd_iface *iface)
  1485. -+{
  1486. -+ eloop_cancel_timeout(hostapd_restore_40mhz, iface, NULL);
  1487. -+}
  1488. -+
  1489. -+void hostapd_trigger_20mhz(struct hostapd_iface *iface)
  1490. -+{
  1491. -+ if (!iface->conf->dynamic_ht40)
  1492. -+ return;
  1493. -+
  1494. -+ if (!iface->force_20mhz) {
  1495. -+ iface->force_20mhz = 1;
  1496. -+ hostapd_set_force_20mhz(iface);
  1497. -+ }
  1498. -+
  1499. -+ if (!iface->last_20mhz_trigger.sec) {
  1500. -+ eloop_cancel_timeout(hostapd_restore_40mhz, iface, NULL);
  1501. -+ eloop_register_timeout(iface->conf->dynamic_ht40, 0,
  1502. -+ hostapd_restore_40mhz, iface, NULL);
  1503. -+ }
  1504. -+
  1505. -+ os_get_time(&iface->last_20mhz_trigger);
  1506. -+}
  1507. diff --git a/package/hostapd/patches/450-limit_debug_messages.patch b/package/hostapd/patches/450-limit_debug_messages.patch
  1508. index aaea941..08f17dc 100644
  1509. --- a/package/hostapd/patches/450-limit_debug_messages.patch
  1510. +++ b/package/hostapd/patches/450-limit_debug_messages.patch
  1511. @@ -20,40 +20,41 @@
  1512. {
  1513. size_t i;
  1514. -@@ -375,20 +375,9 @@ static void _wpa_hexdump(int level, cons
  1515. +@@ -375,20 +375,8 @@ static void _wpa_hexdump(int level, cons
  1516. #endif /* CONFIG_ANDROID_LOG */
  1517. }
  1518. --void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len)
  1519. +-void wpa_hexdump(int level, const char *title, const void *buf, size_t len)
  1520. -{
  1521. - _wpa_hexdump(level, title, buf, len, 1);
  1522. -}
  1523. -
  1524. -
  1525. --void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len)
  1526. +-void wpa_hexdump_key(int level, const char *title, const void *buf, size_t len)
  1527. -{
  1528. - _wpa_hexdump(level, title, buf, len, wpa_debug_show_keys);
  1529. -}
  1530. -
  1531. -
  1532. --static void _wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
  1533. +-
  1534. +-static void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
  1535. - size_t len, int show)
  1536. -+void _wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
  1537. ++void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
  1538. + size_t len, int show)
  1539. {
  1540. size_t i, llen;
  1541. const u8 *pos = buf;
  1542. -@@ -495,19 +484,6 @@ static void _wpa_hexdump_ascii(int level
  1543. +@@ -495,20 +483,6 @@ static void _wpa_hexdump_ascii(int level
  1544. }
  1545. --void wpa_hexdump_ascii(int level, const char *title, const u8 *buf, size_t len)
  1546. +-void wpa_hexdump_ascii(int level, const char *title, const void *buf,
  1547. +- size_t len)
  1548. -{
  1549. - _wpa_hexdump_ascii(level, title, buf, len, 1);
  1550. -}
  1551. -
  1552. -
  1553. --void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf,
  1554. +-void wpa_hexdump_ascii_key(int level, const char *title, const void *buf,
  1555. - size_t len)
  1556. -{
  1557. - _wpa_hexdump_ascii(level, title, buf, len, wpa_debug_show_keys);
  1558. @@ -63,7 +64,7 @@
  1559. #ifdef CONFIG_DEBUG_FILE
  1560. static char *last_path = NULL;
  1561. #endif /* CONFIG_DEBUG_FILE */
  1562. -@@ -591,7 +567,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_
  1563. +@@ -592,7 +566,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_
  1564. }
  1565. @@ -72,7 +73,7 @@
  1566. {
  1567. va_list ap;
  1568. char *buf;
  1569. -@@ -625,7 +601,7 @@ void wpa_msg(void *ctx, int level, const
  1570. +@@ -630,7 +604,7 @@ void wpa_msg(void *ctx, int level, const
  1571. }
  1572. @@ -83,14 +84,14 @@
  1573. char *buf;
  1574. --- a/src/utils/wpa_debug.h
  1575. +++ b/src/utils/wpa_debug.h
  1576. -@@ -43,6 +43,17 @@ int wpa_debug_open_file(const char *path
  1577. +@@ -47,6 +47,17 @@ int wpa_debug_open_file(const char *path
  1578. int wpa_debug_reopen_file(void);
  1579. void wpa_debug_close_file(void);
  1580. +/* internal */
  1581. +void _wpa_hexdump(int level, const char *title, const u8 *buf,
  1582. + size_t len, int show);
  1583. -+void _wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
  1584. ++void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
  1585. + size_t len, int show);
  1586. +extern int wpa_debug_show_keys;
  1587. +
  1588. @@ -101,7 +102,7 @@
  1589. /**
  1590. * wpa_debug_printf_timestamp - Print timestamp for debug output
  1591. *
  1592. -@@ -63,9 +74,15 @@ void wpa_debug_print_timestamp(void);
  1593. +@@ -67,9 +78,15 @@ void wpa_debug_print_timestamp(void);
  1594. *
  1595. * Note: New line '\n' is added to the end of the text when printing to stdout.
  1596. */
  1597. @@ -118,11 +119,11 @@
  1598. /**
  1599. * wpa_hexdump - conditional hex dump
  1600. * @level: priority level (MSG_*) of the message
  1601. -@@ -77,7 +94,13 @@ PRINTF_FORMAT(2, 3);
  1602. +@@ -81,7 +98,13 @@ PRINTF_FORMAT(2, 3);
  1603. * output may be directed to stdout, stderr, and/or syslog based on
  1604. * configuration. The contents of buf is printed out has hex dump.
  1605. */
  1606. --void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len);
  1607. +-void wpa_hexdump(int level, const char *title, const void *buf, size_t len);
  1608. +static inline void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len)
  1609. +{
  1610. + if (level < CONFIG_MSG_MIN_PRIORITY)
  1611. @@ -133,11 +134,11 @@
  1612. static inline void wpa_hexdump_buf(int level, const char *title,
  1613. const struct wpabuf *buf)
  1614. -@@ -99,7 +122,13 @@ static inline void wpa_hexdump_buf(int l
  1615. +@@ -103,7 +126,13 @@ static inline void wpa_hexdump_buf(int l
  1616. * like wpa_hexdump(), but by default, does not include secret keys (passwords,
  1617. * etc.) in debug output.
  1618. */
  1619. --void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len);
  1620. +-void wpa_hexdump_key(int level, const char *title, const void *buf, size_t len);
  1621. +static inline void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len)
  1622. +{
  1623. + if (level < CONFIG_MSG_MIN_PRIORITY)
  1624. @@ -148,11 +149,11 @@
  1625. static inline void wpa_hexdump_buf_key(int level, const char *title,
  1626. const struct wpabuf *buf)
  1627. -@@ -121,8 +150,14 @@ static inline void wpa_hexdump_buf_key(i
  1628. +@@ -125,8 +154,14 @@ static inline void wpa_hexdump_buf_key(i
  1629. * the hex numbers and ASCII characters (for printable range) are shown. 16
  1630. * bytes per line will be shown.
  1631. */
  1632. --void wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
  1633. +-void wpa_hexdump_ascii(int level, const char *title, const void *buf,
  1634. - size_t len);
  1635. +static inline void wpa_hexdump_ascii(int level, const char *title,
  1636. + const u8 *buf, size_t len)
  1637. @@ -165,11 +166,11 @@
  1638. /**
  1639. * wpa_hexdump_ascii_key - conditional hex dump, hide keys
  1640. -@@ -138,8 +173,14 @@ void wpa_hexdump_ascii(int level, const
  1641. +@@ -142,8 +177,14 @@ void wpa_hexdump_ascii(int level, const
  1642. * bytes per line will be shown. This works like wpa_hexdump_ascii(), but by
  1643. * default, does not include secret keys (passwords, etc.) in debug output.
  1644. */
  1645. --void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf,
  1646. +-void wpa_hexdump_ascii_key(int level, const char *title, const void *buf,
  1647. - size_t len);
  1648. +static inline void wpa_hexdump_ascii_key(int level, const char *title,
  1649. + const u8 *buf, size_t len)
  1650. @@ -182,7 +183,7 @@
  1651. /*
  1652. * wpa_dbg() behaves like wpa_msg(), but it can be removed from build to reduce
  1653. -@@ -174,7 +215,12 @@ void wpa_hexdump_ascii_key(int level, co
  1654. +@@ -178,7 +219,12 @@ void wpa_hexdump_ascii_key(int level, co
  1655. *
  1656. * Note: New line '\n' is added to the end of the text when printing to stdout.
  1657. */
  1658. @@ -196,7 +197,7 @@
  1659. /**
  1660. * wpa_msg_ctrl - Conditional printf for ctrl_iface monitors
  1661. -@@ -188,8 +234,13 @@ void wpa_msg(void *ctx, int level, const
  1662. +@@ -192,8 +238,13 @@ void wpa_msg(void *ctx, int level, const
  1663. * attached ctrl_iface monitors. In other words, it can be used for frequent
  1664. * events that do not need to be sent to syslog.
  1665. */
  1666. diff --git a/package/hostapd/patches/460-indicate-features.patch b/package/hostapd/patches/460-indicate-features.patch
  1667. index 7a44da1..cee3e76 100644
  1668. --- a/package/hostapd/patches/460-indicate-features.patch
  1669. +++ b/package/hostapd/patches/460-indicate-features.patch
  1670. @@ -1,23 +1,23 @@
  1671. --- a/hostapd/main.c
  1672. +++ b/hostapd/main.c
  1673. -@@ -14,6 +14,7 @@
  1674. -
  1675. +@@ -15,6 +15,7 @@
  1676. #include "utils/common.h"
  1677. #include "utils/eloop.h"
  1678. + #include "utils/uuid.h"
  1679. +#include "utils/build_features.h"
  1680. #include "crypto/random.h"
  1681. #include "crypto/tls.h"
  1682. #include "common/version.h"
  1683. -@@ -546,7 +547,7 @@ int main(int argc, char *argv[])
  1684. +@@ -558,7 +559,7 @@ int main(int argc, char *argv[])
  1685. wpa_supplicant_event = hostapd_wpa_event;
  1686. for (;;) {
  1687. -- c = getopt(argc, argv, "b:Bde:f:hKP:Ttvg:G:");
  1688. -+ c = getopt(argc, argv, "b:Bde:f:hKP:Ttg:G:v::");
  1689. +- c = getopt(argc, argv, "b:Bde:f:hKP:Ttu:vg:G:");
  1690. ++ c = getopt(argc, argv, "b:Bde:f:hKP:Ttu:g:G:v::");
  1691. if (c < 0)
  1692. break;
  1693. switch (c) {
  1694. -@@ -583,6 +584,8 @@ int main(int argc, char *argv[])
  1695. +@@ -595,6 +596,8 @@ int main(int argc, char *argv[])
  1696. break;
  1697. #endif /* CONFIG_DEBUG_LINUX_TRACING */
  1698. case 'v':
  1699. @@ -36,16 +36,16 @@
  1700. #include "wpa_supplicant_i.h"
  1701. #include "driver_i.h"
  1702. #include "p2p_supplicant.h"
  1703. -@@ -161,7 +162,7 @@ int main(int argc, char *argv[])
  1704. +@@ -176,7 +177,7 @@ int main(int argc, char *argv[])
  1705. for (;;) {
  1706. c = getopt(argc, argv,
  1707. -- "b:Bc:C:D:de:f:g:G:hH:i:I:KLNo:O:p:P:qsTtuvW");
  1708. -+ "b:Bc:C:D:de:f:g:G:hH:i:I:KLNo:O:p:P:qsTtuv::W");
  1709. +- "b:Bc:C:D:de:f:g:G:hH:i:I:KLm:No:O:p:P:qsTtuvW");
  1710. ++ "b:Bc:C:D:de:f:g:G:hH:i:I:KLm:No:O:p:P:qsTtuv::W");
  1711. if (c < 0)
  1712. break;
  1713. switch (c) {
  1714. -@@ -259,8 +260,12 @@ int main(int argc, char *argv[])
  1715. +@@ -279,8 +280,12 @@ int main(int argc, char *argv[])
  1716. break;
  1717. #endif /* CONFIG_DBUS */
  1718. case 'v':
  1719. diff --git a/package/hostapd/patches/470-hostapd_cli_ifdef.patch b/package/hostapd/patches/470-hostapd_cli_ifdef.patch
  1720. index 5ac0fdd..d4a0f12 100644
  1721. --- a/package/hostapd/patches/470-hostapd_cli_ifdef.patch
  1722. +++ b/package/hostapd/patches/470-hostapd_cli_ifdef.patch
  1723. @@ -16,7 +16,7 @@
  1724. " get_config show current configuration\n"
  1725. " help show this usage help\n"
  1726. " interface [ifname] show interfaces/select interface\n"
  1727. -@@ -352,7 +350,6 @@ static int hostapd_cli_cmd_sa_query(stru
  1728. +@@ -362,7 +360,6 @@ static int hostapd_cli_cmd_sa_query(stru
  1729. #endif /* CONFIG_IEEE80211W */
  1730. @@ -24,7 +24,7 @@
  1731. static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc,
  1732. char *argv[])
  1733. {
  1734. -@@ -578,7 +575,6 @@ static int hostapd_cli_cmd_wps_config(st
  1735. +@@ -588,7 +585,6 @@ static int hostapd_cli_cmd_wps_config(st
  1736. ssid_hex, argv[1]);
  1737. return wpa_ctrl_command(ctrl, buf);
  1738. }
  1739. @@ -32,7 +32,7 @@
  1740. static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc,
  1741. -@@ -903,7 +899,6 @@ static struct hostapd_cli_cmd hostapd_cl
  1742. +@@ -979,7 +975,6 @@ static struct hostapd_cli_cmd hostapd_cl
  1743. #ifdef CONFIG_IEEE80211W
  1744. { "sa_query", hostapd_cli_cmd_sa_query },
  1745. #endif /* CONFIG_IEEE80211W */
  1746. @@ -40,7 +40,7 @@
  1747. { "wps_pin", hostapd_cli_cmd_wps_pin },
  1748. { "wps_check_pin", hostapd_cli_cmd_wps_check_pin },
  1749. { "wps_pbc", hostapd_cli_cmd_wps_pbc },
  1750. -@@ -917,7 +912,6 @@ static struct hostapd_cli_cmd hostapd_cl
  1751. +@@ -993,7 +988,6 @@ static struct hostapd_cli_cmd hostapd_cl
  1752. { "wps_ap_pin", hostapd_cli_cmd_wps_ap_pin },
  1753. { "wps_config", hostapd_cli_cmd_wps_config },
  1754. { "wps_get_status", hostapd_cli_cmd_wps_get_status },
  1755. diff --git a/package/hostapd/patches/471-wpa_cli_ifdef.patch b/package/hostapd/patches/471-wpa_cli_ifdef.patch
  1756. index cc84444..36b5a44 100644
  1757. --- a/package/hostapd/patches/471-wpa_cli_ifdef.patch
  1758. +++ b/package/hostapd/patches/471-wpa_cli_ifdef.patch
  1759. @@ -10,4 +10,4 @@
  1760. +
  1761. static const char *wpa_cli_version =
  1762. "wpa_cli v" VERSION_STR "\n"
  1763. - "Copyright (c) 2004-2013, Jouni Malinen <j@w1.fi> and contributors";
  1764. + "Copyright (c) 2004-2014, Jouni Malinen <j@w1.fi> and contributors";
  1765. diff --git a/package/hostapd/patches/480-max_num_sta_probe.patch b/package/hostapd/patches/480-max_num_sta_probe.patch
  1766. index e5ca8b4..e238bf4 100644
  1767. --- a/package/hostapd/patches/480-max_num_sta_probe.patch
  1768. +++ b/package/hostapd/patches/480-max_num_sta_probe.patch
  1769. @@ -1,6 +1,6 @@
  1770. --- a/src/ap/beacon.c
  1771. +++ b/src/ap/beacon.c
  1772. -@@ -501,6 +501,10 @@ void handle_probe_req(struct hostapd_dat
  1773. +@@ -599,6 +599,10 @@ void handle_probe_req(struct hostapd_dat
  1774. return;
  1775. }
  1776. @@ -9,5 +9,5 @@
  1777. + " too many connected stations.", MAC2STR(mgmt->sa));
  1778. +
  1779. #ifdef CONFIG_INTERWORKING
  1780. - if (elems.interworking && elems.interworking_len >= 1) {
  1781. - u8 ant = elems.interworking[0] & 0x0f;
  1782. + if (hapd->conf->interworking &&
  1783. + elems.interworking && elems.interworking_len >= 1) {
  1784. diff --git a/package/hostapd/patches/490-scan_wait.patch b/package/hostapd/patches/490-scan_wait.patch
  1785. index 61715d6..3459a61 100644
  1786. --- a/package/hostapd/patches/490-scan_wait.patch
  1787. +++ b/package/hostapd/patches/490-scan_wait.patch
  1788. @@ -1,15 +1,15 @@
  1789. --- a/hostapd/main.c
  1790. +++ b/hostapd/main.c
  1791. -@@ -33,6 +33,8 @@
  1792. - extern int wpa_debug_level;
  1793. - extern int wpa_debug_show_keys;
  1794. - extern int wpa_debug_timestamp;
  1795. +@@ -36,6 +36,8 @@ struct hapd_global {
  1796. + };
  1797. +
  1798. + static struct hapd_global global;
  1799. +static int daemonize = 0;
  1800. +static char *pid_file = NULL;
  1801. - extern struct wpa_driver_ops *wpa_drivers[];
  1802. -@@ -147,6 +149,14 @@ static void hostapd_logger_cb(void *ctx,
  1803. + #ifndef CONFIG_NO_HOSTAPD_LOGGER
  1804. +@@ -141,6 +143,14 @@ static void hostapd_logger_cb(void *ctx,
  1805. }
  1806. #endif /* CONFIG_NO_HOSTAPD_LOGGER */
  1807. @@ -24,7 +24,7 @@
  1808. /**
  1809. * hostapd_driver_init - Preparate driver interface
  1810. -@@ -165,6 +175,8 @@ static int hostapd_driver_init(struct ho
  1811. +@@ -159,6 +169,8 @@ static int hostapd_driver_init(struct ho
  1812. return -1;
  1813. }
  1814. @@ -33,7 +33,7 @@
  1815. /* Initialize the driver interface */
  1816. if (!(b[0] | b[1] | b[2] | b[3] | b[4] | b[5]))
  1817. b = NULL;
  1818. -@@ -381,8 +393,6 @@ static void hostapd_global_deinit(const
  1819. +@@ -372,8 +384,6 @@ static void hostapd_global_deinit(const
  1820. #endif /* CONFIG_NATIVE_WINDOWS */
  1821. eap_server_unregister_methods();
  1822. @@ -42,7 +42,7 @@
  1823. }
  1824. -@@ -408,11 +418,6 @@ static int hostapd_global_run(struct hap
  1825. +@@ -399,11 +409,6 @@ static int hostapd_global_run(struct hap
  1826. }
  1827. #endif /* EAP_SERVER_TNC */
  1828. @@ -54,7 +54,7 @@
  1829. eloop_run();
  1830. return 0;
  1831. -@@ -521,8 +526,7 @@ int main(int argc, char *argv[])
  1832. +@@ -533,8 +538,7 @@ int main(int argc, char *argv[])
  1833. struct hapd_interfaces interfaces;
  1834. int ret = 1;
  1835. size_t i, j;
  1836. 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
  1837. index 544151e..9f4a5f5 100644
  1838. --- a/package/hostapd/patches/500-wpa_supplicant-add-new-config-params-to-be-used-with.patch
  1839. +++ b/package/hostapd/patches/500-wpa_supplicant-add-new-config-params-to-be-used-with.patch
  1840. @@ -22,9 +22,9 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  1841. #include "common/defs.h"
  1842. #include "utils/list.h"
  1843. -@@ -404,6 +405,11 @@ struct wpa_driver_associate_params {
  1844. - */
  1845. - int freq;
  1846. +@@ -414,6 +415,11 @@ struct wpa_driver_associate_params {
  1847. + * responsible for selecting with which BSS to associate. */
  1848. + const u8 *bssid;
  1849. + int beacon_interval;
  1850. + int fixed_freq;
  1851. @@ -32,11 +32,11 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  1852. + int mcast_rate;
  1853. +
  1854. /**
  1855. - * bg_scan_period - Background scan period in seconds, 0 to disable
  1856. - * background scan, or -1 to indicate no change to default driver
  1857. + * bssid_hint - BSSID of a proposed AP
  1858. + *
  1859. --- a/wpa_supplicant/config.c
  1860. +++ b/wpa_supplicant/config.c
  1861. -@@ -14,6 +14,7 @@
  1862. +@@ -15,6 +15,7 @@
  1863. #include "rsn_supp/wpa.h"
  1864. #include "eap_peer/eap.h"
  1865. #include "p2p/p2p.h"
  1866. @@ -44,7 +44,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  1867. #include "config.h"
  1868. -@@ -1512,6 +1513,97 @@ static char * wpa_config_write_psk_list(
  1869. +@@ -1527,6 +1528,97 @@ static char * wpa_config_write_psk_list(
  1870. #endif /* CONFIG_P2P */
  1871. @@ -142,16 +142,16 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  1872. /* Helper macros for network block parser */
  1873. #ifdef OFFSET
  1874. -@@ -1715,6 +1807,9 @@ static const struct parse_data ssid_fiel
  1875. +@@ -1733,6 +1825,9 @@ static const struct parse_data ssid_fiel
  1876. { INT(ap_max_inactivity) },
  1877. { INT(dtim_period) },
  1878. { INT(beacon_int) },
  1879. + { INT_RANGE(fixed_freq, 0, 1) },
  1880. + { FUNC(rates) },
  1881. + { FUNC(mcast_rate) },
  1882. - };
  1883. -
  1884. - #undef OFFSET
  1885. + #ifdef CONFIG_MACSEC
  1886. + { INT_RANGE(macsec_policy, 0, 1) },
  1887. + #endif /* CONFIG_MACSEC */
  1888. --- a/wpa_supplicant/config_ssid.h
  1889. +++ b/wpa_supplicant/config_ssid.h
  1890. @@ -12,6 +12,7 @@
  1891. @@ -162,37 +162,24 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  1892. #define MAX_SSID_LEN 32
  1893. -@@ -620,6 +621,10 @@ struct wpa_ssid {
  1894. - * dereferences since it may not be updated in all cases.
  1895. +@@ -637,6 +638,10 @@ struct wpa_ssid {
  1896. */
  1897. void *parent_cred;
  1898. -+
  1899. +
  1900. + int fixed_freq;
  1901. + unsigned char rates[NL80211_MAX_SUPP_RATES];
  1902. + double mcast_rate;
  1903. - };
  1904. -
  1905. - #endif /* CONFIG_SSID_H */
  1906. ++
  1907. + #ifdef CONFIG_MACSEC
  1908. + /**
  1909. + * macsec_policy - Determines the policy for MACsec secure session
  1910. --- a/wpa_supplicant/wpa_supplicant.c
  1911. +++ b/wpa_supplicant/wpa_supplicant.c
  1912. -@@ -1623,15 +1623,24 @@ void wpa_supplicant_associate(struct wpa
  1913. - params.ssid_len = ssid->ssid_len;
  1914. - }
  1915. -
  1916. -- if (ssid->mode == WPAS_MODE_IBSS && ssid->bssid_set &&
  1917. -- wpa_s->conf->ap_scan == 2) {
  1918. -- params.bssid = ssid->bssid;
  1919. -- params.fixed_bssid = 1;
  1920. -+ if (ssid->mode == WPAS_MODE_IBSS) {
  1921. -+ if (ssid->bssid_set && wpa_s->conf->ap_scan == 2) {
  1922. -+ params.bssid = ssid->bssid;
  1923. -+ params.fixed_bssid = 1;
  1924. -+ }
  1925. -+ if (ssid->frequency > 0 && params.freq == 0)
  1926. -+ /* Initial channel for IBSS */
  1927. -+ params.freq = ssid->frequency;
  1928. +@@ -1806,6 +1806,13 @@ static void wpas_start_assoc_cb(struct w
  1929. + params.beacon_int = ssid->beacon_int;
  1930. + else
  1931. + params.beacon_int = wpa_s->conf->beacon_int;
  1932. + params.fixed_freq = ssid->fixed_freq;
  1933. -+ params.beacon_interval = ssid->beacon_int;
  1934. + i = 0;
  1935. + while (i < NL80211_MAX_SUPP_RATES) {
  1936. + params.rates[i] = ssid->rates[i];
  1937. @@ -201,9 +188,4 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  1938. + params.mcast_rate = ssid->mcast_rate;
  1939. }
  1940. -- if (ssid->mode == WPAS_MODE_IBSS && ssid->frequency > 0 &&
  1941. -- params.freq == 0)
  1942. -- params.freq = ssid->frequency; /* Initial channel for IBSS */
  1943. params.wpa_ie = wpa_ie;
  1944. - params.wpa_ie_len = wpa_ie_len;
  1945. - params.pairwise_suite = cipher_pairwise;
  1946. 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
  1947. index 565bbc9..e7484d9 100644
  1948. --- a/package/hostapd/patches/501-driver_nl80211-use-new-parameters-during-ibss-join.patch
  1949. +++ b/package/hostapd/patches/501-driver_nl80211-use-new-parameters-during-ibss-join.patch
  1950. @@ -10,7 +10,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  1951. --- a/src/drivers/driver_nl80211.c
  1952. +++ b/src/drivers/driver_nl80211.c
  1953. -@@ -7903,7 +7903,7 @@ static int wpa_driver_nl80211_ibss(struc
  1954. +@@ -8581,7 +8581,7 @@ static int wpa_driver_nl80211_ibss(struc
  1955. struct wpa_driver_associate_params *params)
  1956. {
  1957. struct nl_msg *msg;
  1958. @@ -19,9 +19,9 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  1959. int count = 0;
  1960. wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex);
  1961. -@@ -7936,6 +7936,37 @@ retry:
  1962. - wpa_printf(MSG_DEBUG, " * freq=%d", params->freq);
  1963. - NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, params->freq);
  1964. +@@ -8620,6 +8620,37 @@ retry:
  1965. + params->beacon_int);
  1966. + }
  1967. + if (params->fixed_freq) {
  1968. + wpa_printf(MSG_DEBUG, " * fixed_freq");
  1969. diff --git a/package/hostapd/patches/502-wpa_s-support-htmode-param.patch b/package/hostapd/patches/502-wpa_s-support-htmode-param.patch
  1970. index adb20a2..b4c4034 100644
  1971. --- a/package/hostapd/patches/502-wpa_s-support-htmode-param.patch
  1972. +++ b/package/hostapd/patches/502-wpa_s-support-htmode-param.patch
  1973. @@ -16,7 +16,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
  1974. --- a/src/drivers/driver.h
  1975. +++ b/src/drivers/driver.h
  1976. -@@ -409,6 +409,8 @@ struct wpa_driver_associate_params {
  1977. +@@ -419,6 +419,8 @@ struct wpa_driver_associate_params {
  1978. int fixed_freq;
  1979. unsigned char rates[NL80211_MAX_SUPP_RATES];
  1980. int mcast_rate;
  1981. @@ -24,10 +24,10 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
  1982. + unsigned int htmode;
  1983. /**
  1984. - * bg_scan_period - Background scan period in seconds, 0 to disable
  1985. + * bssid_hint - BSSID of a proposed AP
  1986. --- a/src/drivers/driver_nl80211.c
  1987. +++ b/src/drivers/driver_nl80211.c
  1988. -@@ -7967,6 +7967,22 @@ retry:
  1989. +@@ -8651,6 +8651,22 @@ retry:
  1990. NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate);
  1991. }
  1992. @@ -52,7 +52,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
  1993. goto nla_put_failure;
  1994. --- a/wpa_supplicant/config.c
  1995. +++ b/wpa_supplicant/config.c
  1996. -@@ -1544,6 +1544,71 @@ static char * wpa_config_write_mcast_rat
  1997. +@@ -1559,6 +1559,71 @@ static char * wpa_config_write_mcast_rat
  1998. }
  1999. #endif /* NO_CONFIG_WRITE */
  2000. @@ -124,28 +124,28 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
  2001. static int wpa_config_parse_rates(const struct parse_data *data,
  2002. struct wpa_ssid *ssid, int line,
  2003. const char *value)
  2004. -@@ -1810,6 +1875,7 @@ static const struct parse_data ssid_fiel
  2005. +@@ -1828,6 +1893,7 @@ static const struct parse_data ssid_fiel
  2006. { INT_RANGE(fixed_freq, 0, 1) },
  2007. { FUNC(rates) },
  2008. { FUNC(mcast_rate) },
  2009. + { FUNC(htmode) },
  2010. - };
  2011. -
  2012. - #undef OFFSET
  2013. + #ifdef CONFIG_MACSEC
  2014. + { INT_RANGE(macsec_policy, 0, 1) },
  2015. + #endif /* CONFIG_MACSEC */
  2016. --- a/wpa_supplicant/config_ssid.h
  2017. +++ b/wpa_supplicant/config_ssid.h
  2018. -@@ -625,6 +625,8 @@ struct wpa_ssid {
  2019. +@@ -641,6 +641,8 @@ struct wpa_ssid {
  2020. int fixed_freq;
  2021. unsigned char rates[NL80211_MAX_SUPP_RATES];
  2022. double mcast_rate;
  2023. + int ht_set;
  2024. + unsigned int htmode;
  2025. - };
  2026. - #endif /* CONFIG_SSID_H */
  2027. + #ifdef CONFIG_MACSEC
  2028. + /**
  2029. --- a/wpa_supplicant/wpa_supplicant.c
  2030. +++ b/wpa_supplicant/wpa_supplicant.c
  2031. -@@ -1639,6 +1639,8 @@ void wpa_supplicant_associate(struct wpa
  2032. +@@ -1813,6 +1813,8 @@ static void wpas_start_assoc_cb(struct w
  2033. i++;
  2034. }
  2035. params.mcast_rate = ssid->mcast_rate;
  2036. diff --git a/package/hostapd/patches/510-wpa_supplicant_p2p_parse_ifcomb.patch b/package/hostapd/patches/510-wpa_supplicant_p2p_parse_ifcomb.patch
  2037. deleted file mode 100644
  2038. index fe72ee2..0000000
  2039. --- a/package/hostapd/patches/510-wpa_supplicant_p2p_parse_ifcomb.patch
  2040. +++ /dev/null
  2041. @@ -1,18 +0,0 @@
  2042. ---- a/src/drivers/driver_nl80211.c
  2043. -+++ b/src/drivers/driver_nl80211.c
  2044. -@@ -3157,10 +3157,12 @@ static int wiphy_info_iface_comb_process
  2045. - }
  2046. -
  2047. - if (combination_has_p2p && combination_has_mgd) {
  2048. -- info->p2p_concurrent = 1;
  2049. -- info->num_multichan_concurrent =
  2050. -+ int num_channels =
  2051. - nla_get_u32(tb_comb[NL80211_IFACE_COMB_NUM_CHANNELS]);
  2052. -- return 1;
  2053. -+
  2054. -+ info->p2p_concurrent = 1;
  2055. -+ if (info->num_multichan_concurrent < num_channels)
  2056. -+ info->num_multichan_concurrent = num_channels;
  2057. - }
  2058. -
  2059. - return 0;