ieee80211_i.h 66 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105
  1. /*
  2. * Copyright 2002-2005, Instant802 Networks, Inc.
  3. * Copyright 2005, Devicescape Software, Inc.
  4. * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
  5. * Copyright 2007-2010 Johannes Berg <johannes@sipsolutions.net>
  6. * Copyright 2013-2014 Intel Mobile Communications GmbH
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #ifndef IEEE80211_I_H
  13. #define IEEE80211_I_H
  14. #include <linux/kernel.h>
  15. #include <linux/device.h>
  16. #include <linux/if_ether.h>
  17. #include <linux/interrupt.h>
  18. #include <linux/list.h>
  19. #include <linux/netdevice.h>
  20. #include <linux/skbuff.h>
  21. #include <linux/workqueue.h>
  22. #include <linux/types.h>
  23. #include <linux/spinlock.h>
  24. #include <linux/etherdevice.h>
  25. #include <linux/leds.h>
  26. #include <linux/idr.h>
  27. #include <linux/rhashtable.h>
  28. #include <net/ieee80211_radiotap.h>
  29. #include <net/cfg80211.h>
  30. #include <net/mac80211.h>
  31. #include <net/fq.h>
  32. #include "key.h"
  33. #include "sta_info.h"
  34. #include "debug.h"
  35. extern const struct cfg80211_ops mac80211_config_ops;
  36. struct ieee80211_local;
  37. /* Maximum number of broadcast/multicast frames to buffer when some of the
  38. * associated stations are using power saving. */
  39. #define AP_MAX_BC_BUFFER 128
  40. /* Maximum number of frames buffered to all STAs, including multicast frames.
  41. * Note: increasing this limit increases the potential memory requirement. Each
  42. * frame can be up to about 2 kB long. */
  43. #define TOTAL_MAX_TX_BUFFER 512
  44. /* Required encryption head and tailroom */
  45. #define IEEE80211_ENCRYPT_HEADROOM 8
  46. #define IEEE80211_ENCRYPT_TAILROOM 18
  47. /* IEEE 802.11 (Ch. 9.5 Defragmentation) requires support for concurrent
  48. * reception of at least three fragmented frames. This limit can be increased
  49. * by changing this define, at the cost of slower frame reassembly and
  50. * increased memory use (about 2 kB of RAM per entry). */
  51. #define IEEE80211_FRAGMENT_MAX 4
  52. /* power level hasn't been configured (or set to automatic) */
  53. #define IEEE80211_UNSET_POWER_LEVEL INT_MIN
  54. /*
  55. * Some APs experience problems when working with U-APSD. Decreasing the
  56. * probability of that happening by using legacy mode for all ACs but VO isn't
  57. * enough.
  58. *
  59. * Cisco 4410N originally forced us to enable VO by default only because it
  60. * treated non-VO ACs as legacy.
  61. *
  62. * However some APs (notably Netgear R7000) silently reclassify packets to
  63. * different ACs. Since u-APSD ACs require trigger frames for frame retrieval
  64. * clients would never see some frames (e.g. ARP responses) or would fetch them
  65. * accidentally after a long time.
  66. *
  67. * It makes little sense to enable u-APSD queues by default because it needs
  68. * userspace applications to be aware of it to actually take advantage of the
  69. * possible additional powersavings. Implicitly depending on driver autotrigger
  70. * frame support doesn't make much sense.
  71. */
  72. #define IEEE80211_DEFAULT_UAPSD_QUEUES 0
  73. #define IEEE80211_DEFAULT_MAX_SP_LEN \
  74. IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL
  75. #define IEEE80211_DEAUTH_FRAME_LEN (24 /* hdr */ + 2 /* reason */)
  76. struct ieee80211_fragment_entry {
  77. struct sk_buff_head skb_list;
  78. unsigned long first_frag_time;
  79. u16 seq;
  80. u16 extra_len;
  81. u16 last_frag;
  82. u8 rx_queue;
  83. bool check_sequential_pn; /* needed for CCMP/GCMP */
  84. u8 last_pn[6]; /* PN of the last fragment if CCMP was used */
  85. };
  86. struct ieee80211_bss {
  87. u32 device_ts_beacon, device_ts_presp;
  88. bool wmm_used;
  89. bool uapsd_supported;
  90. #define IEEE80211_MAX_SUPP_RATES 32
  91. u8 supp_rates[IEEE80211_MAX_SUPP_RATES];
  92. size_t supp_rates_len;
  93. struct ieee80211_rate *beacon_rate;
  94. /*
  95. * During association, we save an ERP value from a probe response so
  96. * that we can feed ERP info to the driver when handling the
  97. * association completes. these fields probably won't be up-to-date
  98. * otherwise, you probably don't want to use them.
  99. */
  100. bool has_erp_value;
  101. u8 erp_value;
  102. /* Keep track of the corruption of the last beacon/probe response. */
  103. u8 corrupt_data;
  104. /* Keep track of what bits of information we have valid info for. */
  105. u8 valid_data;
  106. };
  107. /**
  108. * enum ieee80211_corrupt_data_flags - BSS data corruption flags
  109. * @IEEE80211_BSS_CORRUPT_BEACON: last beacon frame received was corrupted
  110. * @IEEE80211_BSS_CORRUPT_PROBE_RESP: last probe response received was corrupted
  111. *
  112. * These are bss flags that are attached to a bss in the
  113. * @corrupt_data field of &struct ieee80211_bss.
  114. */
  115. enum ieee80211_bss_corrupt_data_flags {
  116. IEEE80211_BSS_CORRUPT_BEACON = BIT(0),
  117. IEEE80211_BSS_CORRUPT_PROBE_RESP = BIT(1)
  118. };
  119. /**
  120. * enum ieee80211_valid_data_flags - BSS valid data flags
  121. * @IEEE80211_BSS_VALID_WMM: WMM/UAPSD data was gathered from non-corrupt IE
  122. * @IEEE80211_BSS_VALID_RATES: Supported rates were gathered from non-corrupt IE
  123. * @IEEE80211_BSS_VALID_ERP: ERP flag was gathered from non-corrupt IE
  124. *
  125. * These are bss flags that are attached to a bss in the
  126. * @valid_data field of &struct ieee80211_bss. They show which parts
  127. * of the data structure were received as a result of an un-corrupted
  128. * beacon/probe response.
  129. */
  130. enum ieee80211_bss_valid_data_flags {
  131. IEEE80211_BSS_VALID_WMM = BIT(1),
  132. IEEE80211_BSS_VALID_RATES = BIT(2),
  133. IEEE80211_BSS_VALID_ERP = BIT(3)
  134. };
  135. typedef unsigned __bitwise__ ieee80211_tx_result;
  136. #define TX_CONTINUE ((__force ieee80211_tx_result) 0u)
  137. #define TX_DROP ((__force ieee80211_tx_result) 1u)
  138. #define TX_QUEUED ((__force ieee80211_tx_result) 2u)
  139. #define IEEE80211_TX_UNICAST BIT(1)
  140. #define IEEE80211_TX_PS_BUFFERED BIT(2)
  141. struct ieee80211_tx_data {
  142. struct sk_buff *skb;
  143. struct sk_buff_head skbs;
  144. struct ieee80211_local *local;
  145. struct ieee80211_sub_if_data *sdata;
  146. struct sta_info *sta;
  147. struct ieee80211_key *key;
  148. struct ieee80211_tx_rate rate;
  149. unsigned int flags;
  150. };
  151. typedef unsigned __bitwise__ ieee80211_rx_result;
  152. #define RX_CONTINUE ((__force ieee80211_rx_result) 0u)
  153. #define RX_DROP_UNUSABLE ((__force ieee80211_rx_result) 1u)
  154. #define RX_DROP_MONITOR ((__force ieee80211_rx_result) 2u)
  155. #define RX_QUEUED ((__force ieee80211_rx_result) 3u)
  156. /**
  157. * enum ieee80211_packet_rx_flags - packet RX flags
  158. * @IEEE80211_RX_AMSDU: a-MSDU packet
  159. * @IEEE80211_RX_MALFORMED_ACTION_FRM: action frame is malformed
  160. * @IEEE80211_RX_DEFERRED_RELEASE: frame was subjected to receive reordering
  161. *
  162. * These are per-frame flags that are attached to a frame in the
  163. * @rx_flags field of &struct ieee80211_rx_status.
  164. */
  165. enum ieee80211_packet_rx_flags {
  166. IEEE80211_RX_AMSDU = BIT(3),
  167. IEEE80211_RX_MALFORMED_ACTION_FRM = BIT(4),
  168. IEEE80211_RX_DEFERRED_RELEASE = BIT(5),
  169. };
  170. /**
  171. * enum ieee80211_rx_flags - RX data flags
  172. *
  173. * @IEEE80211_RX_CMNTR: received on cooked monitor already
  174. * @IEEE80211_RX_BEACON_REPORTED: This frame was already reported
  175. * to cfg80211_report_obss_beacon().
  176. *
  177. * These flags are used across handling multiple interfaces
  178. * for a single frame.
  179. */
  180. enum ieee80211_rx_flags {
  181. IEEE80211_RX_CMNTR = BIT(0),
  182. IEEE80211_RX_BEACON_REPORTED = BIT(1),
  183. };
  184. struct ieee80211_rx_data {
  185. struct napi_struct *napi;
  186. struct sk_buff *skb;
  187. struct ieee80211_local *local;
  188. struct ieee80211_sub_if_data *sdata;
  189. struct sta_info *sta;
  190. struct ieee80211_key *key;
  191. unsigned int flags;
  192. /*
  193. * Index into sequence numbers array, 0..16
  194. * since the last (16) is used for non-QoS,
  195. * will be 16 on non-QoS frames.
  196. */
  197. int seqno_idx;
  198. /*
  199. * Index into the security IV/PN arrays, 0..16
  200. * since the last (16) is used for CCMP-encrypted
  201. * management frames, will be set to 16 on mgmt
  202. * frames and 0 on non-QoS frames.
  203. */
  204. int security_idx;
  205. u32 tkip_iv32;
  206. u16 tkip_iv16;
  207. };
  208. struct ieee80211_csa_settings {
  209. const u16 *counter_offsets_beacon;
  210. const u16 *counter_offsets_presp;
  211. int n_counter_offsets_beacon;
  212. int n_counter_offsets_presp;
  213. u8 count;
  214. };
  215. struct beacon_data {
  216. u8 *head, *tail;
  217. int head_len, tail_len;
  218. struct ieee80211_meshconf_ie *meshconf;
  219. u16 csa_counter_offsets[IEEE80211_MAX_CSA_COUNTERS_NUM];
  220. u8 csa_current_counter;
  221. struct rcu_head rcu_head;
  222. };
  223. struct probe_resp {
  224. struct rcu_head rcu_head;
  225. int len;
  226. u16 csa_counter_offsets[IEEE80211_MAX_CSA_COUNTERS_NUM];
  227. u8 data[0];
  228. };
  229. struct ps_data {
  230. /* yes, this looks ugly, but guarantees that we can later use
  231. * bitmap_empty :)
  232. * NB: don't touch this bitmap, use sta_info_{set,clear}_tim_bit */
  233. u8 tim[sizeof(unsigned long) * BITS_TO_LONGS(IEEE80211_MAX_AID + 1)]
  234. __aligned(__alignof__(unsigned long));
  235. struct sk_buff_head bc_buf;
  236. atomic_t num_sta_ps; /* number of stations in PS mode */
  237. int dtim_count;
  238. bool dtim_bc_mc;
  239. };
  240. struct ieee80211_if_ap {
  241. struct beacon_data __rcu *beacon;
  242. struct probe_resp __rcu *probe_resp;
  243. /* to be used after channel switch. */
  244. struct cfg80211_beacon_data *next_beacon;
  245. struct list_head vlans; /* write-protected with RTNL and local->mtx */
  246. struct ps_data ps;
  247. atomic_t num_mcast_sta; /* number of stations receiving multicast */
  248. enum ieee80211_smps_mode req_smps, /* requested smps mode */
  249. driver_smps_mode; /* smps mode request */
  250. struct work_struct request_smps_work;
  251. };
  252. struct ieee80211_if_wds {
  253. struct sta_info *sta;
  254. u8 remote_addr[ETH_ALEN];
  255. };
  256. struct ieee80211_if_vlan {
  257. struct list_head list; /* write-protected with RTNL and local->mtx */
  258. /* used for all tx if the VLAN is configured to 4-addr mode */
  259. struct sta_info __rcu *sta;
  260. };
  261. struct mesh_stats {
  262. __u32 fwded_mcast; /* Mesh forwarded multicast frames */
  263. __u32 fwded_unicast; /* Mesh forwarded unicast frames */
  264. __u32 fwded_frames; /* Mesh total forwarded frames */
  265. __u32 dropped_frames_ttl; /* Not transmitted since mesh_ttl == 0*/
  266. __u32 dropped_frames_no_route; /* Not transmitted, no route found */
  267. __u32 dropped_frames_congestion;/* Not forwarded due to congestion */
  268. };
  269. #define PREQ_Q_F_START 0x1
  270. #define PREQ_Q_F_REFRESH 0x2
  271. struct mesh_preq_queue {
  272. struct list_head list;
  273. u8 dst[ETH_ALEN];
  274. u8 flags;
  275. };
  276. struct ieee80211_roc_work {
  277. struct list_head list;
  278. struct ieee80211_sub_if_data *sdata;
  279. struct ieee80211_channel *chan;
  280. bool started, abort, hw_begun, notified;
  281. bool on_channel;
  282. unsigned long start_time;
  283. u32 duration, req_duration;
  284. struct sk_buff *frame;
  285. u64 cookie, mgmt_tx_cookie;
  286. enum ieee80211_roc_type type;
  287. };
  288. /* flags used in struct ieee80211_if_managed.flags */
  289. enum ieee80211_sta_flags {
  290. IEEE80211_STA_CONNECTION_POLL = BIT(1),
  291. IEEE80211_STA_CONTROL_PORT = BIT(2),
  292. IEEE80211_STA_DISABLE_HT = BIT(4),
  293. IEEE80211_STA_MFP_ENABLED = BIT(6),
  294. IEEE80211_STA_UAPSD_ENABLED = BIT(7),
  295. IEEE80211_STA_NULLFUNC_ACKED = BIT(8),
  296. IEEE80211_STA_RESET_SIGNAL_AVE = BIT(9),
  297. IEEE80211_STA_DISABLE_40MHZ = BIT(10),
  298. IEEE80211_STA_DISABLE_VHT = BIT(11),
  299. IEEE80211_STA_DISABLE_80P80MHZ = BIT(12),
  300. IEEE80211_STA_DISABLE_160MHZ = BIT(13),
  301. IEEE80211_STA_DISABLE_WMM = BIT(14),
  302. IEEE80211_STA_ENABLE_RRM = BIT(15),
  303. };
  304. struct ieee80211_mgd_auth_data {
  305. struct cfg80211_bss *bss;
  306. unsigned long timeout;
  307. int tries;
  308. u16 algorithm, expected_transaction;
  309. u8 key[WLAN_KEY_LEN_WEP104];
  310. u8 key_len, key_idx;
  311. bool done;
  312. bool timeout_started;
  313. u16 sae_trans, sae_status;
  314. size_t data_len;
  315. u8 data[];
  316. };
  317. struct ieee80211_mgd_assoc_data {
  318. struct cfg80211_bss *bss;
  319. const u8 *supp_rates;
  320. unsigned long timeout;
  321. int tries;
  322. u16 capability;
  323. u8 prev_bssid[ETH_ALEN];
  324. u8 ssid[IEEE80211_MAX_SSID_LEN];
  325. u8 ssid_len;
  326. u8 supp_rates_len;
  327. bool wmm, uapsd;
  328. bool need_beacon;
  329. bool synced;
  330. bool timeout_started;
  331. u8 ap_ht_param;
  332. struct ieee80211_vht_cap ap_vht_cap;
  333. size_t ie_len;
  334. u8 ie[];
  335. };
  336. struct ieee80211_sta_tx_tspec {
  337. /* timestamp of the first packet in the time slice */
  338. unsigned long time_slice_start;
  339. u32 admitted_time; /* in usecs, unlike over the air */
  340. u8 tsid;
  341. s8 up; /* signed to be able to invalidate with -1 during teardown */
  342. /* consumed TX time in microseconds in the time slice */
  343. u32 consumed_tx_time;
  344. enum {
  345. TX_TSPEC_ACTION_NONE = 0,
  346. TX_TSPEC_ACTION_DOWNGRADE,
  347. TX_TSPEC_ACTION_STOP_DOWNGRADE,
  348. } action;
  349. bool downgraded;
  350. };
  351. DECLARE_EWMA(beacon_signal, 16, 4)
  352. struct ieee80211_if_managed {
  353. struct timer_list timer;
  354. struct timer_list conn_mon_timer;
  355. struct timer_list bcn_mon_timer;
  356. struct timer_list chswitch_timer;
  357. struct work_struct monitor_work;
  358. struct work_struct chswitch_work;
  359. struct work_struct beacon_connection_loss_work;
  360. struct work_struct csa_connection_drop_work;
  361. unsigned long beacon_timeout;
  362. unsigned long probe_timeout;
  363. int probe_send_count;
  364. bool nullfunc_failed;
  365. bool connection_loss;
  366. struct cfg80211_bss *associated;
  367. struct ieee80211_mgd_auth_data *auth_data;
  368. struct ieee80211_mgd_assoc_data *assoc_data;
  369. u8 bssid[ETH_ALEN];
  370. u16 aid;
  371. bool powersave; /* powersave requested for this iface */
  372. bool broken_ap; /* AP is broken -- turn off powersave */
  373. bool have_beacon;
  374. u8 dtim_period;
  375. enum ieee80211_smps_mode req_smps, /* requested smps mode */
  376. driver_smps_mode; /* smps mode request */
  377. struct work_struct request_smps_work;
  378. unsigned int flags;
  379. bool csa_waiting_bcn;
  380. bool csa_ignored_same_chan;
  381. bool beacon_crc_valid;
  382. u32 beacon_crc;
  383. bool status_acked;
  384. bool status_received;
  385. __le16 status_fc;
  386. enum {
  387. IEEE80211_MFP_DISABLED,
  388. IEEE80211_MFP_OPTIONAL,
  389. IEEE80211_MFP_REQUIRED
  390. } mfp; /* management frame protection */
  391. /*
  392. * Bitmask of enabled u-apsd queues,
  393. * IEEE80211_WMM_IE_STA_QOSINFO_AC_BE & co. Needs a new association
  394. * to take effect.
  395. */
  396. unsigned int uapsd_queues;
  397. /*
  398. * Maximum number of buffered frames AP can deliver during a
  399. * service period, IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL or similar.
  400. * Needs a new association to take effect.
  401. */
  402. unsigned int uapsd_max_sp_len;
  403. int wmm_last_param_set;
  404. u8 use_4addr;
  405. s16 p2p_noa_index;
  406. struct ewma_beacon_signal ave_beacon_signal;
  407. /*
  408. * Number of Beacon frames used in ave_beacon_signal. This can be used
  409. * to avoid generating less reliable cqm events that would be based
  410. * only on couple of received frames.
  411. */
  412. unsigned int count_beacon_signal;
  413. /* Number of times beacon loss was invoked. */
  414. unsigned int beacon_loss_count;
  415. /*
  416. * Last Beacon frame signal strength average (ave_beacon_signal / 16)
  417. * that triggered a cqm event. 0 indicates that no event has been
  418. * generated for the current association.
  419. */
  420. int last_cqm_event_signal;
  421. /*
  422. * State variables for keeping track of RSSI of the AP currently
  423. * connected to and informing driver when RSSI has gone
  424. * below/above a certain threshold.
  425. */
  426. int rssi_min_thold, rssi_max_thold;
  427. int last_ave_beacon_signal;
  428. struct ieee80211_ht_cap ht_capa; /* configured ht-cap over-rides */
  429. struct ieee80211_ht_cap ht_capa_mask; /* Valid parts of ht_capa */
  430. struct ieee80211_vht_cap vht_capa; /* configured VHT overrides */
  431. struct ieee80211_vht_cap vht_capa_mask; /* Valid parts of vht_capa */
  432. /* TDLS support */
  433. u8 tdls_peer[ETH_ALEN] __aligned(2);
  434. struct delayed_work tdls_peer_del_work;
  435. struct sk_buff *orig_teardown_skb; /* The original teardown skb */
  436. struct sk_buff *teardown_skb; /* A copy to send through the AP */
  437. spinlock_t teardown_lock; /* To lock changing teardown_skb */
  438. bool tdls_chan_switch_prohibited;
  439. bool tdls_wider_bw_prohibited;
  440. /* WMM-AC TSPEC support */
  441. struct ieee80211_sta_tx_tspec tx_tspec[IEEE80211_NUM_ACS];
  442. /* Use a separate work struct so that we can do something here
  443. * while the sdata->work is flushing the queues, for example.
  444. * otherwise, in scenarios where we hardly get any traffic out
  445. * on the BE queue, but there's a lot of VO traffic, we might
  446. * get stuck in a downgraded situation and flush takes forever.
  447. */
  448. struct delayed_work tx_tspec_wk;
  449. };
  450. struct ieee80211_if_ibss {
  451. struct timer_list timer;
  452. struct work_struct csa_connection_drop_work;
  453. unsigned long last_scan_completed;
  454. u32 basic_rates;
  455. bool fixed_bssid;
  456. bool fixed_channel;
  457. bool privacy;
  458. bool control_port;
  459. bool userspace_handles_dfs;
  460. u8 bssid[ETH_ALEN] __aligned(2);
  461. u8 ssid[IEEE80211_MAX_SSID_LEN];
  462. u8 ssid_len, ie_len;
  463. u8 *ie;
  464. struct cfg80211_chan_def chandef;
  465. unsigned long ibss_join_req;
  466. /* probe response/beacon for IBSS */
  467. struct beacon_data __rcu *presp;
  468. struct ieee80211_ht_cap ht_capa; /* configured ht-cap over-rides */
  469. struct ieee80211_ht_cap ht_capa_mask; /* Valid parts of ht_capa */
  470. spinlock_t incomplete_lock;
  471. struct list_head incomplete_stations;
  472. enum {
  473. IEEE80211_IBSS_MLME_SEARCH,
  474. IEEE80211_IBSS_MLME_JOINED,
  475. } state;
  476. };
  477. /**
  478. * struct ieee80211_if_ocb - OCB mode state
  479. *
  480. * @housekeeping_timer: timer for periodic invocation of a housekeeping task
  481. * @wrkq_flags: OCB deferred task action
  482. * @incomplete_lock: delayed STA insertion lock
  483. * @incomplete_stations: list of STAs waiting for delayed insertion
  484. * @joined: indication if the interface is connected to an OCB network
  485. */
  486. struct ieee80211_if_ocb {
  487. struct timer_list housekeeping_timer;
  488. unsigned long wrkq_flags;
  489. spinlock_t incomplete_lock;
  490. struct list_head incomplete_stations;
  491. bool joined;
  492. };
  493. /**
  494. * struct ieee80211_mesh_sync_ops - Extensible synchronization framework interface
  495. *
  496. * these declarations define the interface, which enables
  497. * vendor-specific mesh synchronization
  498. *
  499. */
  500. struct ieee802_11_elems;
  501. struct ieee80211_mesh_sync_ops {
  502. void (*rx_bcn_presp)(struct ieee80211_sub_if_data *sdata,
  503. u16 stype,
  504. struct ieee80211_mgmt *mgmt,
  505. struct ieee802_11_elems *elems,
  506. struct ieee80211_rx_status *rx_status);
  507. /* should be called with beacon_data under RCU read lock */
  508. void (*adjust_tbtt)(struct ieee80211_sub_if_data *sdata,
  509. struct beacon_data *beacon);
  510. /* add other framework functions here */
  511. };
  512. struct mesh_csa_settings {
  513. struct rcu_head rcu_head;
  514. struct cfg80211_csa_settings settings;
  515. };
  516. struct ieee80211_if_mesh {
  517. struct timer_list housekeeping_timer;
  518. struct timer_list mesh_path_timer;
  519. struct timer_list mesh_path_root_timer;
  520. unsigned long wrkq_flags;
  521. unsigned long mbss_changed;
  522. u8 mesh_id[IEEE80211_MAX_MESH_ID_LEN];
  523. size_t mesh_id_len;
  524. /* Active Path Selection Protocol Identifier */
  525. u8 mesh_pp_id;
  526. /* Active Path Selection Metric Identifier */
  527. u8 mesh_pm_id;
  528. /* Congestion Control Mode Identifier */
  529. u8 mesh_cc_id;
  530. /* Synchronization Protocol Identifier */
  531. u8 mesh_sp_id;
  532. /* Authentication Protocol Identifier */
  533. u8 mesh_auth_id;
  534. /* Local mesh Sequence Number */
  535. u32 sn;
  536. /* Last used PREQ ID */
  537. u32 preq_id;
  538. atomic_t mpaths;
  539. /* Timestamp of last SN update */
  540. unsigned long last_sn_update;
  541. /* Time when it's ok to send next PERR */
  542. unsigned long next_perr;
  543. /* Timestamp of last PREQ sent */
  544. unsigned long last_preq;
  545. struct mesh_rmc *rmc;
  546. spinlock_t mesh_preq_queue_lock;
  547. struct mesh_preq_queue preq_queue;
  548. int preq_queue_len;
  549. struct mesh_stats mshstats;
  550. struct mesh_config mshcfg;
  551. atomic_t estab_plinks;
  552. u32 mesh_seqnum;
  553. bool accepting_plinks;
  554. int num_gates;
  555. struct beacon_data __rcu *beacon;
  556. const u8 *ie;
  557. u8 ie_len;
  558. enum {
  559. IEEE80211_MESH_SEC_NONE = 0x0,
  560. IEEE80211_MESH_SEC_AUTHED = 0x1,
  561. IEEE80211_MESH_SEC_SECURED = 0x2,
  562. } security;
  563. bool user_mpm;
  564. /* Extensible Synchronization Framework */
  565. const struct ieee80211_mesh_sync_ops *sync_ops;
  566. s64 sync_offset_clockdrift_max;
  567. spinlock_t sync_offset_lock;
  568. bool adjusting_tbtt;
  569. /* mesh power save */
  570. enum nl80211_mesh_power_mode nonpeer_pm;
  571. int ps_peers_light_sleep;
  572. int ps_peers_deep_sleep;
  573. struct ps_data ps;
  574. /* Channel Switching Support */
  575. struct mesh_csa_settings __rcu *csa;
  576. enum {
  577. IEEE80211_MESH_CSA_ROLE_NONE,
  578. IEEE80211_MESH_CSA_ROLE_INIT,
  579. IEEE80211_MESH_CSA_ROLE_REPEATER,
  580. } csa_role;
  581. u8 chsw_ttl;
  582. u16 pre_value;
  583. /* offset from skb->data while building IE */
  584. int meshconf_offset;
  585. struct mesh_table *mesh_paths;
  586. struct mesh_table *mpp_paths; /* Store paths for MPP&MAP */
  587. int mesh_paths_generation;
  588. int mpp_paths_generation;
  589. };
  590. #ifdef CONFIG_MAC80211_MESH
  591. #define IEEE80211_IFSTA_MESH_CTR_INC(msh, name) \
  592. do { (msh)->mshstats.name++; } while (0)
  593. #else
  594. #define IEEE80211_IFSTA_MESH_CTR_INC(msh, name) \
  595. do { } while (0)
  596. #endif
  597. /**
  598. * enum ieee80211_sub_if_data_flags - virtual interface flags
  599. *
  600. * @IEEE80211_SDATA_ALLMULTI: interface wants all multicast packets
  601. * @IEEE80211_SDATA_OPERATING_GMODE: operating in G-only mode
  602. * @IEEE80211_SDATA_DONT_BRIDGE_PACKETS: bridge packets between
  603. * associated stations and deliver multicast frames both
  604. * back to wireless media and to the local net stack.
  605. * @IEEE80211_SDATA_DISCONNECT_RESUME: Disconnect after resume.
  606. * @IEEE80211_SDATA_IN_DRIVER: indicates interface was added to driver
  607. */
  608. enum ieee80211_sub_if_data_flags {
  609. IEEE80211_SDATA_ALLMULTI = BIT(0),
  610. IEEE80211_SDATA_OPERATING_GMODE = BIT(2),
  611. IEEE80211_SDATA_DONT_BRIDGE_PACKETS = BIT(3),
  612. IEEE80211_SDATA_DISCONNECT_RESUME = BIT(4),
  613. IEEE80211_SDATA_IN_DRIVER = BIT(5),
  614. };
  615. /**
  616. * enum ieee80211_sdata_state_bits - virtual interface state bits
  617. * @SDATA_STATE_RUNNING: virtual interface is up & running; this
  618. * mirrors netif_running() but is separate for interface type
  619. * change handling while the interface is up
  620. * @SDATA_STATE_OFFCHANNEL: This interface is currently in offchannel
  621. * mode, so queues are stopped
  622. * @SDATA_STATE_OFFCHANNEL_BEACON_STOPPED: Beaconing was stopped due
  623. * to offchannel, reset when offchannel returns
  624. */
  625. enum ieee80211_sdata_state_bits {
  626. SDATA_STATE_RUNNING,
  627. SDATA_STATE_OFFCHANNEL,
  628. SDATA_STATE_OFFCHANNEL_BEACON_STOPPED,
  629. };
  630. /**
  631. * enum ieee80211_chanctx_mode - channel context configuration mode
  632. *
  633. * @IEEE80211_CHANCTX_SHARED: channel context may be used by
  634. * multiple interfaces
  635. * @IEEE80211_CHANCTX_EXCLUSIVE: channel context can be used
  636. * only by a single interface. This can be used for example for
  637. * non-fixed channel IBSS.
  638. */
  639. enum ieee80211_chanctx_mode {
  640. IEEE80211_CHANCTX_SHARED,
  641. IEEE80211_CHANCTX_EXCLUSIVE
  642. };
  643. /**
  644. * enum ieee80211_chanctx_replace_state - channel context replacement state
  645. *
  646. * This is used for channel context in-place reservations that require channel
  647. * context switch/swap.
  648. *
  649. * @IEEE80211_CHANCTX_REPLACE_NONE: no replacement is taking place
  650. * @IEEE80211_CHANCTX_WILL_BE_REPLACED: this channel context will be replaced
  651. * by a (not yet registered) channel context pointed by %replace_ctx.
  652. * @IEEE80211_CHANCTX_REPLACES_OTHER: this (not yet registered) channel context
  653. * replaces an existing channel context pointed to by %replace_ctx.
  654. */
  655. enum ieee80211_chanctx_replace_state {
  656. IEEE80211_CHANCTX_REPLACE_NONE,
  657. IEEE80211_CHANCTX_WILL_BE_REPLACED,
  658. IEEE80211_CHANCTX_REPLACES_OTHER,
  659. };
  660. struct ieee80211_chanctx {
  661. struct list_head list;
  662. struct rcu_head rcu_head;
  663. struct list_head assigned_vifs;
  664. struct list_head reserved_vifs;
  665. enum ieee80211_chanctx_replace_state replace_state;
  666. struct ieee80211_chanctx *replace_ctx;
  667. enum ieee80211_chanctx_mode mode;
  668. bool driver_present;
  669. struct ieee80211_chanctx_conf conf;
  670. };
  671. struct mac80211_qos_map {
  672. struct cfg80211_qos_map qos_map;
  673. struct rcu_head rcu_head;
  674. };
  675. enum txq_info_flags {
  676. IEEE80211_TXQ_STOP,
  677. IEEE80211_TXQ_AMPDU,
  678. IEEE80211_TXQ_NO_AMSDU,
  679. };
  680. /**
  681. * struct txq_info - per tid queue
  682. *
  683. * @tin: contains packets split into multiple flows
  684. * @def_flow: used as a fallback flow when a packet destined to @tin hashes to
  685. * a fq_flow which is already owned by a different tin
  686. * @def_cvars: codel vars for @def_flow
  687. */
  688. struct txq_info {
  689. struct fq_tin tin;
  690. struct fq_flow def_flow;
  691. struct codel_vars def_cvars;
  692. unsigned long flags;
  693. /* keep last! */
  694. struct ieee80211_txq txq;
  695. };
  696. struct ieee80211_sub_if_data {
  697. struct list_head list;
  698. struct wireless_dev wdev;
  699. /* keys */
  700. struct list_head key_list;
  701. /* count for keys needing tailroom space allocation */
  702. int crypto_tx_tailroom_needed_cnt;
  703. int crypto_tx_tailroom_pending_dec;
  704. struct delayed_work dec_tailroom_needed_wk;
  705. struct net_device *dev;
  706. struct ieee80211_local *local;
  707. unsigned int flags;
  708. unsigned long state;
  709. char name[IFNAMSIZ];
  710. /* Fragment table for host-based reassembly */
  711. struct ieee80211_fragment_entry fragments[IEEE80211_FRAGMENT_MAX];
  712. unsigned int fragment_next;
  713. /* TID bitmap for NoAck policy */
  714. u16 noack_map;
  715. /* bit field of ACM bits (BIT(802.1D tag)) */
  716. u8 wmm_acm;
  717. struct ieee80211_key __rcu *keys[NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS];
  718. struct ieee80211_key __rcu *default_unicast_key;
  719. struct ieee80211_key __rcu *default_multicast_key;
  720. struct ieee80211_key __rcu *default_mgmt_key;
  721. u16 sequence_number;
  722. __be16 control_port_protocol;
  723. bool control_port_no_encrypt;
  724. int encrypt_headroom;
  725. atomic_t num_tx_queued;
  726. struct ieee80211_tx_queue_params tx_conf[IEEE80211_NUM_ACS];
  727. struct mac80211_qos_map __rcu *qos_map;
  728. struct work_struct csa_finalize_work;
  729. bool csa_block_tx; /* write-protected by sdata_lock and local->mtx */
  730. struct cfg80211_chan_def csa_chandef;
  731. struct list_head assigned_chanctx_list; /* protected by chanctx_mtx */
  732. struct list_head reserved_chanctx_list; /* protected by chanctx_mtx */
  733. /* context reservation -- protected with chanctx_mtx */
  734. struct ieee80211_chanctx *reserved_chanctx;
  735. struct cfg80211_chan_def reserved_chandef;
  736. bool reserved_radar_required;
  737. bool reserved_ready;
  738. /* used to reconfigure hardware SM PS */
  739. struct work_struct recalc_smps;
  740. struct work_struct work;
  741. struct sk_buff_head skb_queue;
  742. u8 needed_rx_chains;
  743. enum ieee80211_smps_mode smps_mode;
  744. int user_power_level; /* in dBm */
  745. int ap_power_level; /* in dBm */
  746. bool radar_required;
  747. struct delayed_work dfs_cac_timer_work;
  748. /*
  749. * AP this belongs to: self in AP mode and
  750. * corresponding AP in VLAN mode, NULL for
  751. * all others (might be needed later in IBSS)
  752. */
  753. struct ieee80211_if_ap *bss;
  754. /* bitmap of allowed (non-MCS) rate indexes for rate control */
  755. u32 rc_rateidx_mask[NUM_NL80211_BANDS];
  756. bool rc_has_mcs_mask[NUM_NL80211_BANDS];
  757. u8 rc_rateidx_mcs_mask[NUM_NL80211_BANDS][IEEE80211_HT_MCS_MASK_LEN];
  758. bool rc_has_vht_mcs_mask[NUM_NL80211_BANDS];
  759. u16 rc_rateidx_vht_mcs_mask[NUM_NL80211_BANDS][NL80211_VHT_NSS_MAX];
  760. union {
  761. struct ieee80211_if_ap ap;
  762. struct ieee80211_if_wds wds;
  763. struct ieee80211_if_vlan vlan;
  764. struct ieee80211_if_managed mgd;
  765. struct ieee80211_if_ibss ibss;
  766. struct ieee80211_if_mesh mesh;
  767. struct ieee80211_if_ocb ocb;
  768. u32 mntr_flags;
  769. } u;
  770. #ifdef CONFIG_MAC80211_DEBUGFS
  771. struct {
  772. struct dentry *subdir_stations;
  773. struct dentry *default_unicast_key;
  774. struct dentry *default_multicast_key;
  775. struct dentry *default_mgmt_key;
  776. } debugfs;
  777. #endif
  778. /* must be last, dynamically sized area in this! */
  779. struct ieee80211_vif vif;
  780. };
  781. static inline
  782. struct ieee80211_sub_if_data *vif_to_sdata(struct ieee80211_vif *p)
  783. {
  784. return container_of(p, struct ieee80211_sub_if_data, vif);
  785. }
  786. static inline void sdata_lock(struct ieee80211_sub_if_data *sdata)
  787. __acquires(&sdata->wdev.mtx)
  788. {
  789. mutex_lock(&sdata->wdev.mtx);
  790. __acquire(&sdata->wdev.mtx);
  791. }
  792. static inline void sdata_unlock(struct ieee80211_sub_if_data *sdata)
  793. __releases(&sdata->wdev.mtx)
  794. {
  795. mutex_unlock(&sdata->wdev.mtx);
  796. __release(&sdata->wdev.mtx);
  797. }
  798. #define sdata_dereference(p, sdata) \
  799. rcu_dereference_protected(p, lockdep_is_held(&sdata->wdev.mtx))
  800. static inline void
  801. sdata_assert_lock(struct ieee80211_sub_if_data *sdata)
  802. {
  803. lockdep_assert_held(&sdata->wdev.mtx);
  804. }
  805. static inline enum nl80211_band
  806. ieee80211_get_sdata_band(struct ieee80211_sub_if_data *sdata)
  807. {
  808. enum nl80211_band band = NL80211_BAND_2GHZ;
  809. struct ieee80211_chanctx_conf *chanctx_conf;
  810. rcu_read_lock();
  811. chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
  812. if (!WARN_ON(!chanctx_conf))
  813. band = chanctx_conf->def.chan->band;
  814. rcu_read_unlock();
  815. return band;
  816. }
  817. static inline int
  818. ieee80211_chandef_get_shift(struct cfg80211_chan_def *chandef)
  819. {
  820. switch (chandef->width) {
  821. case NL80211_CHAN_WIDTH_5:
  822. return 2;
  823. case NL80211_CHAN_WIDTH_10:
  824. return 1;
  825. default:
  826. return 0;
  827. }
  828. }
  829. static inline int
  830. ieee80211_vif_get_shift(struct ieee80211_vif *vif)
  831. {
  832. struct ieee80211_chanctx_conf *chanctx_conf;
  833. int shift = 0;
  834. rcu_read_lock();
  835. chanctx_conf = rcu_dereference(vif->chanctx_conf);
  836. if (chanctx_conf)
  837. shift = ieee80211_chandef_get_shift(&chanctx_conf->def);
  838. rcu_read_unlock();
  839. return shift;
  840. }
  841. struct ieee80211_rx_agg {
  842. u8 addr[ETH_ALEN];
  843. u16 tid;
  844. };
  845. enum sdata_queue_type {
  846. IEEE80211_SDATA_QUEUE_TYPE_FRAME = 0,
  847. IEEE80211_SDATA_QUEUE_AGG_START = 1,
  848. IEEE80211_SDATA_QUEUE_AGG_STOP = 2,
  849. IEEE80211_SDATA_QUEUE_RX_AGG_START = 3,
  850. IEEE80211_SDATA_QUEUE_RX_AGG_STOP = 4,
  851. };
  852. enum {
  853. IEEE80211_RX_MSG = 1,
  854. IEEE80211_TX_STATUS_MSG = 2,
  855. };
  856. enum queue_stop_reason {
  857. IEEE80211_QUEUE_STOP_REASON_DRIVER,
  858. IEEE80211_QUEUE_STOP_REASON_PS,
  859. IEEE80211_QUEUE_STOP_REASON_CSA,
  860. IEEE80211_QUEUE_STOP_REASON_AGGREGATION,
  861. IEEE80211_QUEUE_STOP_REASON_SUSPEND,
  862. IEEE80211_QUEUE_STOP_REASON_SKB_ADD,
  863. IEEE80211_QUEUE_STOP_REASON_OFFCHANNEL,
  864. IEEE80211_QUEUE_STOP_REASON_FLUSH,
  865. IEEE80211_QUEUE_STOP_REASON_TDLS_TEARDOWN,
  866. IEEE80211_QUEUE_STOP_REASON_RESERVE_TID,
  867. IEEE80211_QUEUE_STOP_REASONS,
  868. };
  869. #ifdef CONFIG_MAC80211_LEDS
  870. struct tpt_led_trigger {
  871. char name[32];
  872. const struct ieee80211_tpt_blink *blink_table;
  873. unsigned int blink_table_len;
  874. struct timer_list timer;
  875. unsigned long prev_traffic;
  876. unsigned long tx_bytes, rx_bytes;
  877. unsigned int active, want;
  878. bool running;
  879. };
  880. #endif
  881. /**
  882. * mac80211 scan flags - currently active scan mode
  883. *
  884. * @SCAN_SW_SCANNING: We're currently in the process of scanning but may as
  885. * well be on the operating channel
  886. * @SCAN_HW_SCANNING: The hardware is scanning for us, we have no way to
  887. * determine if we are on the operating channel or not
  888. * @SCAN_ONCHANNEL_SCANNING: Do a software scan on only the current operating
  889. * channel. This should not interrupt normal traffic.
  890. * @SCAN_COMPLETED: Set for our scan work function when the driver reported
  891. * that the scan completed.
  892. * @SCAN_ABORTED: Set for our scan work function when the driver reported
  893. * a scan complete for an aborted scan.
  894. * @SCAN_HW_CANCELLED: Set for our scan work function when the scan is being
  895. * cancelled.
  896. */
  897. enum {
  898. SCAN_SW_SCANNING,
  899. SCAN_HW_SCANNING,
  900. SCAN_ONCHANNEL_SCANNING,
  901. SCAN_COMPLETED,
  902. SCAN_ABORTED,
  903. SCAN_HW_CANCELLED,
  904. };
  905. /**
  906. * enum mac80211_scan_state - scan state machine states
  907. *
  908. * @SCAN_DECISION: Main entry point to the scan state machine, this state
  909. * determines if we should keep on scanning or switch back to the
  910. * operating channel
  911. * @SCAN_SET_CHANNEL: Set the next channel to be scanned
  912. * @SCAN_SEND_PROBE: Send probe requests and wait for probe responses
  913. * @SCAN_SUSPEND: Suspend the scan and go back to operating channel to
  914. * send out data
  915. * @SCAN_RESUME: Resume the scan and scan the next channel
  916. * @SCAN_ABORT: Abort the scan and go back to operating channel
  917. */
  918. enum mac80211_scan_state {
  919. SCAN_DECISION,
  920. SCAN_SET_CHANNEL,
  921. SCAN_SEND_PROBE,
  922. SCAN_SUSPEND,
  923. SCAN_RESUME,
  924. SCAN_ABORT,
  925. };
  926. struct ieee80211_local {
  927. /* embed the driver visible part.
  928. * don't cast (use the static inlines below), but we keep
  929. * it first anyway so they become a no-op */
  930. struct ieee80211_hw hw;
  931. struct fq fq;
  932. struct codel_vars *cvars;
  933. struct codel_params cparams;
  934. struct codel_stats cstats;
  935. const struct ieee80211_ops *ops;
  936. /*
  937. * private workqueue to mac80211. mac80211 makes this accessible
  938. * via ieee80211_queue_work()
  939. */
  940. struct workqueue_struct *workqueue;
  941. unsigned long queue_stop_reasons[IEEE80211_MAX_QUEUES];
  942. int q_stop_reasons[IEEE80211_MAX_QUEUES][IEEE80211_QUEUE_STOP_REASONS];
  943. /* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */
  944. spinlock_t queue_stop_reason_lock;
  945. int open_count;
  946. int monitors, cooked_mntrs;
  947. /* number of interfaces with corresponding FIF_ flags */
  948. int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss, fif_pspoll,
  949. fif_probe_req;
  950. int probe_req_reg;
  951. unsigned int filter_flags; /* FIF_* */
  952. bool wiphy_ciphers_allocated;
  953. bool use_chanctx;
  954. /* protects the aggregated multicast list and filter calls */
  955. spinlock_t filter_lock;
  956. /* used for uploading changed mc list */
  957. struct work_struct reconfig_filter;
  958. /* aggregated multicast list */
  959. struct netdev_hw_addr_list mc_list;
  960. bool tim_in_locked_section; /* see ieee80211_beacon_get() */
  961. /*
  962. * suspended is true if we finished all the suspend _and_ we have
  963. * not yet come up from resume. This is to be used by mac80211
  964. * to ensure driver sanity during suspend and mac80211's own
  965. * sanity. It can eventually be used for WoW as well.
  966. */
  967. bool suspended;
  968. /*
  969. * Resuming is true while suspended, but when we're reprogramming the
  970. * hardware -- at that time it's allowed to use ieee80211_queue_work()
  971. * again even though some other parts of the stack are still suspended
  972. * and we still drop received frames to avoid waking the stack.
  973. */
  974. bool resuming;
  975. /*
  976. * quiescing is true during the suspend process _only_ to
  977. * ease timer cancelling etc.
  978. */
  979. bool quiescing;
  980. /* device is started */
  981. bool started;
  982. /* device is during a HW reconfig */
  983. bool in_reconfig;
  984. /* wowlan is enabled -- don't reconfig on resume */
  985. bool wowlan;
  986. struct work_struct radar_detected_work;
  987. /* number of RX chains the hardware has */
  988. u8 rx_chains;
  989. int tx_headroom; /* required headroom for hardware/radiotap */
  990. /* Tasklet and skb queue to process calls from IRQ mode. All frames
  991. * added to skb_queue will be processed, but frames in
  992. * skb_queue_unreliable may be dropped if the total length of these
  993. * queues increases over the limit. */
  994. #define IEEE80211_IRQSAFE_QUEUE_LIMIT 128
  995. struct tasklet_struct tasklet;
  996. struct sk_buff_head skb_queue;
  997. struct sk_buff_head skb_queue_unreliable;
  998. spinlock_t rx_path_lock;
  999. /* Station data */
  1000. /*
  1001. * The mutex only protects the list, hash table and
  1002. * counter, reads are done with RCU.
  1003. */
  1004. struct mutex sta_mtx;
  1005. spinlock_t tim_lock;
  1006. unsigned long num_sta;
  1007. struct list_head sta_list;
  1008. struct rhashtable sta_hash;
  1009. struct timer_list sta_cleanup;
  1010. int sta_generation;
  1011. struct sk_buff_head pending[IEEE80211_MAX_QUEUES];
  1012. struct tasklet_struct tx_pending_tasklet;
  1013. atomic_t agg_queue_stop[IEEE80211_MAX_QUEUES];
  1014. /* number of interfaces with allmulti RX */
  1015. atomic_t iff_allmultis;
  1016. struct rate_control_ref *rate_ctrl;
  1017. struct crypto_cipher *wep_tx_tfm;
  1018. struct crypto_cipher *wep_rx_tfm;
  1019. u32 wep_iv;
  1020. /* see iface.c */
  1021. struct list_head interfaces;
  1022. struct mutex iflist_mtx;
  1023. /*
  1024. * Key mutex, protects sdata's key_list and sta_info's
  1025. * key pointers (write access, they're RCU.)
  1026. */
  1027. struct mutex key_mtx;
  1028. /* mutex for scan and work locking */
  1029. struct mutex mtx;
  1030. /* Scanning and BSS list */
  1031. unsigned long scanning;
  1032. struct cfg80211_ssid scan_ssid;
  1033. struct cfg80211_scan_request *int_scan_req;
  1034. struct cfg80211_scan_request __rcu *scan_req;
  1035. struct ieee80211_scan_request *hw_scan_req;
  1036. struct cfg80211_chan_def scan_chandef;
  1037. enum nl80211_band hw_scan_band;
  1038. int scan_channel_idx;
  1039. int scan_ies_len;
  1040. int hw_scan_ies_bufsize;
  1041. struct cfg80211_scan_info scan_info;
  1042. struct work_struct sched_scan_stopped_work;
  1043. struct ieee80211_sub_if_data __rcu *sched_scan_sdata;
  1044. struct cfg80211_sched_scan_request __rcu *sched_scan_req;
  1045. u8 scan_addr[ETH_ALEN];
  1046. unsigned long leave_oper_channel_time;
  1047. enum mac80211_scan_state next_scan_state;
  1048. struct delayed_work scan_work;
  1049. struct ieee80211_sub_if_data __rcu *scan_sdata;
  1050. /* For backward compatibility only -- do not use */
  1051. struct cfg80211_chan_def _oper_chandef;
  1052. /* Temporary remain-on-channel for off-channel operations */
  1053. struct ieee80211_channel *tmp_channel;
  1054. /* channel contexts */
  1055. struct list_head chanctx_list;
  1056. struct mutex chanctx_mtx;
  1057. #ifdef CONFIG_MAC80211_LEDS
  1058. struct led_trigger tx_led, rx_led, assoc_led, radio_led;
  1059. struct led_trigger tpt_led;
  1060. atomic_t tx_led_active, rx_led_active, assoc_led_active;
  1061. atomic_t radio_led_active, tpt_led_active;
  1062. struct tpt_led_trigger *tpt_led_trigger;
  1063. #endif
  1064. #ifdef CONFIG_MAC80211_DEBUG_COUNTERS
  1065. /* SNMP counters */
  1066. /* dot11CountersTable */
  1067. u32 dot11TransmittedFragmentCount;
  1068. u32 dot11MulticastTransmittedFrameCount;
  1069. u32 dot11FailedCount;
  1070. u32 dot11RetryCount;
  1071. u32 dot11MultipleRetryCount;
  1072. u32 dot11FrameDuplicateCount;
  1073. u32 dot11ReceivedFragmentCount;
  1074. u32 dot11MulticastReceivedFrameCount;
  1075. u32 dot11TransmittedFrameCount;
  1076. /* TX/RX handler statistics */
  1077. unsigned int tx_handlers_drop;
  1078. unsigned int tx_handlers_queued;
  1079. unsigned int tx_handlers_drop_wep;
  1080. unsigned int tx_handlers_drop_not_assoc;
  1081. unsigned int tx_handlers_drop_unauth_port;
  1082. unsigned int rx_handlers_drop;
  1083. unsigned int rx_handlers_queued;
  1084. unsigned int rx_handlers_drop_nullfunc;
  1085. unsigned int rx_handlers_drop_defrag;
  1086. unsigned int tx_expand_skb_head;
  1087. unsigned int tx_expand_skb_head_cloned;
  1088. unsigned int rx_expand_skb_head_defrag;
  1089. unsigned int rx_handlers_fragments;
  1090. unsigned int tx_status_drop;
  1091. #define I802_DEBUG_INC(c) (c)++
  1092. #else /* CONFIG_MAC80211_DEBUG_COUNTERS */
  1093. #define I802_DEBUG_INC(c) do { } while (0)
  1094. #endif /* CONFIG_MAC80211_DEBUG_COUNTERS */
  1095. int total_ps_buffered; /* total number of all buffered unicast and
  1096. * multicast packets for power saving stations
  1097. */
  1098. bool pspolling;
  1099. bool offchannel_ps_enabled;
  1100. /*
  1101. * PS can only be enabled when we have exactly one managed
  1102. * interface (and monitors) in PS, this then points there.
  1103. */
  1104. struct ieee80211_sub_if_data *ps_sdata;
  1105. struct work_struct dynamic_ps_enable_work;
  1106. struct work_struct dynamic_ps_disable_work;
  1107. struct timer_list dynamic_ps_timer;
  1108. struct notifier_block ifa_notifier;
  1109. struct notifier_block ifa6_notifier;
  1110. /*
  1111. * The dynamic ps timeout configured from user space via WEXT -
  1112. * this will override whatever chosen by mac80211 internally.
  1113. */
  1114. int dynamic_ps_forced_timeout;
  1115. int user_power_level; /* in dBm, for all interfaces */
  1116. enum ieee80211_smps_mode smps_mode;
  1117. struct work_struct restart_work;
  1118. #ifdef CONFIG_MAC80211_DEBUGFS
  1119. struct local_debugfsdentries {
  1120. struct dentry *rcdir;
  1121. struct dentry *keys;
  1122. } debugfs;
  1123. #endif
  1124. /*
  1125. * Remain-on-channel support
  1126. */
  1127. struct delayed_work roc_work;
  1128. struct list_head roc_list;
  1129. struct work_struct hw_roc_start, hw_roc_done;
  1130. unsigned long hw_roc_start_time;
  1131. u64 roc_cookie_counter;
  1132. struct idr ack_status_frames;
  1133. spinlock_t ack_status_lock;
  1134. struct ieee80211_sub_if_data __rcu *p2p_sdata;
  1135. /* virtual monitor interface */
  1136. struct ieee80211_sub_if_data __rcu *monitor_sdata;
  1137. struct cfg80211_chan_def monitor_chandef;
  1138. /* extended capabilities provided by mac80211 */
  1139. u8 ext_capa[8];
  1140. /* TDLS channel switch */
  1141. struct work_struct tdls_chsw_work;
  1142. struct sk_buff_head skb_queue_tdls_chsw;
  1143. };
  1144. static inline struct ieee80211_sub_if_data *
  1145. IEEE80211_DEV_TO_SUB_IF(struct net_device *dev)
  1146. {
  1147. return netdev_priv(dev);
  1148. }
  1149. static inline struct ieee80211_sub_if_data *
  1150. IEEE80211_WDEV_TO_SUB_IF(struct wireless_dev *wdev)
  1151. {
  1152. return container_of(wdev, struct ieee80211_sub_if_data, wdev);
  1153. }
  1154. /* this struct represents 802.11n's RA/TID combination */
  1155. struct ieee80211_ra_tid {
  1156. u8 ra[ETH_ALEN];
  1157. u16 tid;
  1158. };
  1159. /* this struct holds the value parsing from channel switch IE */
  1160. struct ieee80211_csa_ie {
  1161. struct cfg80211_chan_def chandef;
  1162. u8 mode;
  1163. u8 count;
  1164. u8 ttl;
  1165. u16 pre_value;
  1166. };
  1167. /* Parsed Information Elements */
  1168. struct ieee802_11_elems {
  1169. const u8 *ie_start;
  1170. size_t total_len;
  1171. /* pointers to IEs */
  1172. const struct ieee80211_tdls_lnkie *lnk_id;
  1173. const struct ieee80211_ch_switch_timing *ch_sw_timing;
  1174. const u8 *ext_capab;
  1175. const u8 *ssid;
  1176. const u8 *supp_rates;
  1177. const u8 *ds_params;
  1178. const struct ieee80211_tim_ie *tim;
  1179. const u8 *challenge;
  1180. const u8 *rsn;
  1181. const u8 *erp_info;
  1182. const u8 *ext_supp_rates;
  1183. const u8 *wmm_info;
  1184. const u8 *wmm_param;
  1185. const struct ieee80211_ht_cap *ht_cap_elem;
  1186. const struct ieee80211_ht_operation *ht_operation;
  1187. const struct ieee80211_vht_cap *vht_cap_elem;
  1188. const struct ieee80211_vht_operation *vht_operation;
  1189. const struct ieee80211_meshconf_ie *mesh_config;
  1190. const u8 *mesh_id;
  1191. const u8 *peering;
  1192. const __le16 *awake_window;
  1193. const u8 *preq;
  1194. const u8 *prep;
  1195. const u8 *perr;
  1196. const struct ieee80211_rann_ie *rann;
  1197. const struct ieee80211_channel_sw_ie *ch_switch_ie;
  1198. const struct ieee80211_ext_chansw_ie *ext_chansw_ie;
  1199. const struct ieee80211_wide_bw_chansw_ie *wide_bw_chansw_ie;
  1200. const u8 *country_elem;
  1201. const u8 *pwr_constr_elem;
  1202. const u8 *cisco_dtpc_elem;
  1203. const struct ieee80211_timeout_interval_ie *timeout_int;
  1204. const u8 *opmode_notif;
  1205. const struct ieee80211_sec_chan_offs_ie *sec_chan_offs;
  1206. const struct ieee80211_mesh_chansw_params_ie *mesh_chansw_params_ie;
  1207. /* length of them, respectively */
  1208. u8 ext_capab_len;
  1209. u8 ssid_len;
  1210. u8 supp_rates_len;
  1211. u8 tim_len;
  1212. u8 challenge_len;
  1213. u8 rsn_len;
  1214. u8 ext_supp_rates_len;
  1215. u8 wmm_info_len;
  1216. u8 wmm_param_len;
  1217. u8 mesh_id_len;
  1218. u8 peering_len;
  1219. u8 preq_len;
  1220. u8 prep_len;
  1221. u8 perr_len;
  1222. u8 country_elem_len;
  1223. /* whether a parse error occurred while retrieving these elements */
  1224. bool parse_error;
  1225. };
  1226. static inline struct ieee80211_local *hw_to_local(
  1227. struct ieee80211_hw *hw)
  1228. {
  1229. return container_of(hw, struct ieee80211_local, hw);
  1230. }
  1231. static inline struct txq_info *to_txq_info(struct ieee80211_txq *txq)
  1232. {
  1233. return container_of(txq, struct txq_info, txq);
  1234. }
  1235. static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr)
  1236. {
  1237. return ether_addr_equal(raddr, addr) ||
  1238. is_broadcast_ether_addr(raddr);
  1239. }
  1240. static inline bool
  1241. ieee80211_have_rx_timestamp(struct ieee80211_rx_status *status)
  1242. {
  1243. WARN_ON_ONCE(status->flag & RX_FLAG_MACTIME_START &&
  1244. status->flag & RX_FLAG_MACTIME_END);
  1245. if (status->flag & (RX_FLAG_MACTIME_START | RX_FLAG_MACTIME_END))
  1246. return true;
  1247. /* can't handle HT/VHT preamble yet */
  1248. if (status->flag & RX_FLAG_MACTIME_PLCP_START &&
  1249. !(status->flag & (RX_FLAG_HT | RX_FLAG_VHT)))
  1250. return true;
  1251. return false;
  1252. }
  1253. u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local,
  1254. struct ieee80211_rx_status *status,
  1255. unsigned int mpdu_len,
  1256. unsigned int mpdu_offset);
  1257. int ieee80211_hw_config(struct ieee80211_local *local, u32 changed);
  1258. void ieee80211_tx_set_protected(struct ieee80211_tx_data *tx);
  1259. void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
  1260. u32 changed);
  1261. void ieee80211_configure_filter(struct ieee80211_local *local);
  1262. u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata);
  1263. u64 ieee80211_mgmt_tx_cookie(struct ieee80211_local *local);
  1264. int ieee80211_attach_ack_skb(struct ieee80211_local *local, struct sk_buff *skb,
  1265. u64 *cookie, gfp_t gfp);
  1266. void ieee80211_check_fast_rx(struct sta_info *sta);
  1267. void __ieee80211_check_fast_rx_iface(struct ieee80211_sub_if_data *sdata);
  1268. void ieee80211_check_fast_rx_iface(struct ieee80211_sub_if_data *sdata);
  1269. void ieee80211_clear_fast_rx(struct sta_info *sta);
  1270. /* STA code */
  1271. void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata);
  1272. int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
  1273. struct cfg80211_auth_request *req);
  1274. int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
  1275. struct cfg80211_assoc_request *req);
  1276. int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
  1277. struct cfg80211_deauth_request *req);
  1278. int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
  1279. struct cfg80211_disassoc_request *req);
  1280. void ieee80211_send_pspoll(struct ieee80211_local *local,
  1281. struct ieee80211_sub_if_data *sdata);
  1282. void ieee80211_recalc_ps(struct ieee80211_local *local);
  1283. void ieee80211_recalc_ps_vif(struct ieee80211_sub_if_data *sdata);
  1284. int ieee80211_set_arp_filter(struct ieee80211_sub_if_data *sdata);
  1285. void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata);
  1286. void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
  1287. struct sk_buff *skb);
  1288. void ieee80211_sta_reset_beacon_monitor(struct ieee80211_sub_if_data *sdata);
  1289. void ieee80211_sta_reset_conn_monitor(struct ieee80211_sub_if_data *sdata);
  1290. void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata);
  1291. void ieee80211_mgd_conn_tx_status(struct ieee80211_sub_if_data *sdata,
  1292. __le16 fc, bool acked);
  1293. void ieee80211_mgd_quiesce(struct ieee80211_sub_if_data *sdata);
  1294. void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata);
  1295. void ieee80211_sta_handle_tspec_ac_params(struct ieee80211_sub_if_data *sdata);
  1296. /* IBSS code */
  1297. void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local);
  1298. void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata);
  1299. void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
  1300. const u8 *bssid, const u8 *addr, u32 supp_rates);
  1301. int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
  1302. struct cfg80211_ibss_params *params);
  1303. int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata);
  1304. void ieee80211_ibss_work(struct ieee80211_sub_if_data *sdata);
  1305. void ieee80211_ibss_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
  1306. struct sk_buff *skb);
  1307. int ieee80211_ibss_csa_beacon(struct ieee80211_sub_if_data *sdata,
  1308. struct cfg80211_csa_settings *csa_settings);
  1309. int ieee80211_ibss_finish_csa(struct ieee80211_sub_if_data *sdata);
  1310. void ieee80211_ibss_stop(struct ieee80211_sub_if_data *sdata);
  1311. /* OCB code */
  1312. void ieee80211_ocb_work(struct ieee80211_sub_if_data *sdata);
  1313. void ieee80211_ocb_rx_no_sta(struct ieee80211_sub_if_data *sdata,
  1314. const u8 *bssid, const u8 *addr, u32 supp_rates);
  1315. void ieee80211_ocb_setup_sdata(struct ieee80211_sub_if_data *sdata);
  1316. int ieee80211_ocb_join(struct ieee80211_sub_if_data *sdata,
  1317. struct ocb_setup *setup);
  1318. int ieee80211_ocb_leave(struct ieee80211_sub_if_data *sdata);
  1319. /* mesh code */
  1320. void ieee80211_mesh_work(struct ieee80211_sub_if_data *sdata);
  1321. void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
  1322. struct sk_buff *skb);
  1323. int ieee80211_mesh_csa_beacon(struct ieee80211_sub_if_data *sdata,
  1324. struct cfg80211_csa_settings *csa_settings);
  1325. int ieee80211_mesh_finish_csa(struct ieee80211_sub_if_data *sdata);
  1326. /* scan/BSS handling */
  1327. void ieee80211_scan_work(struct work_struct *work);
  1328. int ieee80211_request_ibss_scan(struct ieee80211_sub_if_data *sdata,
  1329. const u8 *ssid, u8 ssid_len,
  1330. struct ieee80211_channel **channels,
  1331. unsigned int n_channels,
  1332. enum nl80211_bss_scan_width scan_width);
  1333. int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata,
  1334. struct cfg80211_scan_request *req);
  1335. void ieee80211_scan_cancel(struct ieee80211_local *local);
  1336. void ieee80211_run_deferred_scan(struct ieee80211_local *local);
  1337. void ieee80211_scan_rx(struct ieee80211_local *local, struct sk_buff *skb);
  1338. void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local);
  1339. struct ieee80211_bss *
  1340. ieee80211_bss_info_update(struct ieee80211_local *local,
  1341. struct ieee80211_rx_status *rx_status,
  1342. struct ieee80211_mgmt *mgmt,
  1343. size_t len,
  1344. struct ieee802_11_elems *elems,
  1345. struct ieee80211_channel *channel);
  1346. void ieee80211_rx_bss_put(struct ieee80211_local *local,
  1347. struct ieee80211_bss *bss);
  1348. /* scheduled scan handling */
  1349. int
  1350. __ieee80211_request_sched_scan_start(struct ieee80211_sub_if_data *sdata,
  1351. struct cfg80211_sched_scan_request *req);
  1352. int ieee80211_request_sched_scan_start(struct ieee80211_sub_if_data *sdata,
  1353. struct cfg80211_sched_scan_request *req);
  1354. int ieee80211_request_sched_scan_stop(struct ieee80211_local *local);
  1355. void ieee80211_sched_scan_end(struct ieee80211_local *local);
  1356. void ieee80211_sched_scan_stopped_work(struct work_struct *work);
  1357. /* off-channel/mgmt-tx */
  1358. void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local);
  1359. void ieee80211_offchannel_return(struct ieee80211_local *local);
  1360. void ieee80211_roc_setup(struct ieee80211_local *local);
  1361. void ieee80211_start_next_roc(struct ieee80211_local *local);
  1362. void ieee80211_roc_purge(struct ieee80211_local *local,
  1363. struct ieee80211_sub_if_data *sdata);
  1364. int ieee80211_remain_on_channel(struct wiphy *wiphy, struct wireless_dev *wdev,
  1365. struct ieee80211_channel *chan,
  1366. unsigned int duration, u64 *cookie);
  1367. int ieee80211_cancel_remain_on_channel(struct wiphy *wiphy,
  1368. struct wireless_dev *wdev, u64 cookie);
  1369. int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
  1370. struct cfg80211_mgmt_tx_params *params, u64 *cookie);
  1371. int ieee80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
  1372. struct wireless_dev *wdev, u64 cookie);
  1373. /* channel switch handling */
  1374. void ieee80211_csa_finalize_work(struct work_struct *work);
  1375. int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
  1376. struct cfg80211_csa_settings *params);
  1377. /* interface handling */
  1378. int ieee80211_iface_init(void);
  1379. void ieee80211_iface_exit(void);
  1380. int ieee80211_if_add(struct ieee80211_local *local, const char *name,
  1381. unsigned char name_assign_type,
  1382. struct wireless_dev **new_wdev, enum nl80211_iftype type,
  1383. struct vif_params *params);
  1384. int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata,
  1385. enum nl80211_iftype type);
  1386. void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata);
  1387. void ieee80211_remove_interfaces(struct ieee80211_local *local);
  1388. u32 ieee80211_idle_off(struct ieee80211_local *local);
  1389. void ieee80211_recalc_idle(struct ieee80211_local *local);
  1390. void ieee80211_adjust_monitor_flags(struct ieee80211_sub_if_data *sdata,
  1391. const int offset);
  1392. int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up);
  1393. void ieee80211_sdata_stop(struct ieee80211_sub_if_data *sdata);
  1394. int ieee80211_add_virtual_monitor(struct ieee80211_local *local);
  1395. void ieee80211_del_virtual_monitor(struct ieee80211_local *local);
  1396. bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata);
  1397. void ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata,
  1398. bool update_bss);
  1399. static inline bool ieee80211_sdata_running(struct ieee80211_sub_if_data *sdata)
  1400. {
  1401. return test_bit(SDATA_STATE_RUNNING, &sdata->state);
  1402. }
  1403. /* tx handling */
  1404. void ieee80211_clear_tx_pending(struct ieee80211_local *local);
  1405. void ieee80211_tx_pending(unsigned long data);
  1406. netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
  1407. struct net_device *dev);
  1408. netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
  1409. struct net_device *dev);
  1410. void __ieee80211_subif_start_xmit(struct sk_buff *skb,
  1411. struct net_device *dev,
  1412. u32 info_flags);
  1413. void ieee80211_purge_tx_queue(struct ieee80211_hw *hw,
  1414. struct sk_buff_head *skbs);
  1415. struct sk_buff *
  1416. ieee80211_build_data_template(struct ieee80211_sub_if_data *sdata,
  1417. struct sk_buff *skb, u32 info_flags);
  1418. void ieee80211_tx_monitor(struct ieee80211_local *local, struct sk_buff *skb,
  1419. struct ieee80211_supported_band *sband,
  1420. int retry_count, int shift, bool send_to_cooked);
  1421. void ieee80211_check_fast_xmit(struct sta_info *sta);
  1422. void ieee80211_check_fast_xmit_all(struct ieee80211_local *local);
  1423. void ieee80211_check_fast_xmit_iface(struct ieee80211_sub_if_data *sdata);
  1424. void ieee80211_clear_fast_xmit(struct sta_info *sta);
  1425. /* HT */
  1426. void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
  1427. struct ieee80211_sta_ht_cap *ht_cap);
  1428. bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata,
  1429. struct ieee80211_supported_band *sband,
  1430. const struct ieee80211_ht_cap *ht_cap_ie,
  1431. struct sta_info *sta);
  1432. void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata,
  1433. const u8 *da, u16 tid,
  1434. u16 initiator, u16 reason_code);
  1435. int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata,
  1436. enum ieee80211_smps_mode smps, const u8 *da,
  1437. const u8 *bssid);
  1438. void ieee80211_request_smps_ap_work(struct work_struct *work);
  1439. void ieee80211_request_smps_mgd_work(struct work_struct *work);
  1440. bool ieee80211_smps_is_restrictive(enum ieee80211_smps_mode smps_mode_old,
  1441. enum ieee80211_smps_mode smps_mode_new);
  1442. void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
  1443. u16 initiator, u16 reason, bool stop);
  1444. void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
  1445. u16 initiator, u16 reason, bool stop);
  1446. void __ieee80211_start_rx_ba_session(struct sta_info *sta,
  1447. u8 dialog_token, u16 timeout,
  1448. u16 start_seq_num, u16 ba_policy, u16 tid,
  1449. u16 buf_size, bool tx, bool auto_seq);
  1450. void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta,
  1451. enum ieee80211_agg_stop_reason reason);
  1452. void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata,
  1453. struct sta_info *sta,
  1454. struct ieee80211_mgmt *mgmt, size_t len);
  1455. void ieee80211_process_addba_resp(struct ieee80211_local *local,
  1456. struct sta_info *sta,
  1457. struct ieee80211_mgmt *mgmt,
  1458. size_t len);
  1459. void ieee80211_process_addba_request(struct ieee80211_local *local,
  1460. struct sta_info *sta,
  1461. struct ieee80211_mgmt *mgmt,
  1462. size_t len);
  1463. int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
  1464. enum ieee80211_agg_stop_reason reason);
  1465. int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
  1466. enum ieee80211_agg_stop_reason reason);
  1467. void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid);
  1468. void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid);
  1469. void ieee80211_ba_session_work(struct work_struct *work);
  1470. void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid);
  1471. void ieee80211_release_reorder_timeout(struct sta_info *sta, int tid);
  1472. u8 ieee80211_mcs_to_chains(const struct ieee80211_mcs_info *mcs);
  1473. /* VHT */
  1474. void
  1475. ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata,
  1476. struct ieee80211_supported_band *sband,
  1477. const struct ieee80211_vht_cap *vht_cap_ie,
  1478. struct sta_info *sta);
  1479. enum ieee80211_sta_rx_bandwidth ieee80211_sta_cap_rx_bw(struct sta_info *sta);
  1480. enum ieee80211_sta_rx_bandwidth ieee80211_sta_cur_vht_bw(struct sta_info *sta);
  1481. void ieee80211_sta_set_rx_nss(struct sta_info *sta);
  1482. enum ieee80211_sta_rx_bandwidth
  1483. ieee80211_chan_width_to_rx_bw(enum nl80211_chan_width width);
  1484. enum nl80211_chan_width ieee80211_sta_cap_chan_bw(struct sta_info *sta);
  1485. void ieee80211_sta_set_rx_nss(struct sta_info *sta);
  1486. void ieee80211_process_mu_groups(struct ieee80211_sub_if_data *sdata,
  1487. struct ieee80211_mgmt *mgmt);
  1488. u32 __ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
  1489. struct sta_info *sta, u8 opmode,
  1490. enum nl80211_band band);
  1491. void ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
  1492. struct sta_info *sta, u8 opmode,
  1493. enum nl80211_band band);
  1494. void ieee80211_apply_vhtcap_overrides(struct ieee80211_sub_if_data *sdata,
  1495. struct ieee80211_sta_vht_cap *vht_cap);
  1496. void ieee80211_get_vht_mask_from_cap(__le16 vht_cap,
  1497. u16 vht_mask[NL80211_VHT_NSS_MAX]);
  1498. /* Spectrum management */
  1499. void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
  1500. struct ieee80211_mgmt *mgmt,
  1501. size_t len);
  1502. /**
  1503. * ieee80211_parse_ch_switch_ie - parses channel switch IEs
  1504. * @sdata: the sdata of the interface which has received the frame
  1505. * @elems: parsed 802.11 elements received with the frame
  1506. * @current_band: indicates the current band
  1507. * @sta_flags: contains information about own capabilities and restrictions
  1508. * to decide which channel switch announcements can be accepted. Only the
  1509. * following subset of &enum ieee80211_sta_flags are evaluated:
  1510. * %IEEE80211_STA_DISABLE_HT, %IEEE80211_STA_DISABLE_VHT,
  1511. * %IEEE80211_STA_DISABLE_40MHZ, %IEEE80211_STA_DISABLE_80P80MHZ,
  1512. * %IEEE80211_STA_DISABLE_160MHZ.
  1513. * @bssid: the currently connected bssid (for reporting)
  1514. * @csa_ie: parsed 802.11 csa elements on count, mode, chandef and mesh ttl.
  1515. All of them will be filled with if success only.
  1516. * Return: 0 on success, <0 on error and >0 if there is nothing to parse.
  1517. */
  1518. int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
  1519. struct ieee802_11_elems *elems,
  1520. enum nl80211_band current_band,
  1521. u32 sta_flags, u8 *bssid,
  1522. struct ieee80211_csa_ie *csa_ie);
  1523. /* Suspend/resume and hw reconfiguration */
  1524. int ieee80211_reconfig(struct ieee80211_local *local);
  1525. void ieee80211_stop_device(struct ieee80211_local *local);
  1526. int __ieee80211_suspend(struct ieee80211_hw *hw,
  1527. struct cfg80211_wowlan *wowlan);
  1528. static inline int __ieee80211_resume(struct ieee80211_hw *hw)
  1529. {
  1530. struct ieee80211_local *local = hw_to_local(hw);
  1531. WARN(test_bit(SCAN_HW_SCANNING, &local->scanning) &&
  1532. !test_bit(SCAN_COMPLETED, &local->scanning),
  1533. "%s: resume with hardware scan still in progress\n",
  1534. wiphy_name(hw->wiphy));
  1535. return ieee80211_reconfig(hw_to_local(hw));
  1536. }
  1537. /* utility functions/constants */
  1538. extern const void *const mac80211_wiphy_privid; /* for wiphy privid */
  1539. int ieee80211_frame_duration(enum nl80211_band band, size_t len,
  1540. int rate, int erp, int short_preamble,
  1541. int shift);
  1542. void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
  1543. bool bss_notify, bool enable_qos);
  1544. void ieee80211_xmit(struct ieee80211_sub_if_data *sdata,
  1545. struct sta_info *sta, struct sk_buff *skb);
  1546. void __ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata,
  1547. struct sk_buff *skb, int tid,
  1548. enum nl80211_band band);
  1549. static inline void
  1550. ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata,
  1551. struct sk_buff *skb, int tid,
  1552. enum nl80211_band band)
  1553. {
  1554. rcu_read_lock();
  1555. __ieee80211_tx_skb_tid_band(sdata, skb, tid, band);
  1556. rcu_read_unlock();
  1557. }
  1558. static inline void ieee80211_tx_skb_tid(struct ieee80211_sub_if_data *sdata,
  1559. struct sk_buff *skb, int tid)
  1560. {
  1561. struct ieee80211_chanctx_conf *chanctx_conf;
  1562. rcu_read_lock();
  1563. chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
  1564. if (WARN_ON(!chanctx_conf)) {
  1565. rcu_read_unlock();
  1566. kfree_skb(skb);
  1567. return;
  1568. }
  1569. __ieee80211_tx_skb_tid_band(sdata, skb, tid,
  1570. chanctx_conf->def.chan->band);
  1571. rcu_read_unlock();
  1572. }
  1573. static inline void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata,
  1574. struct sk_buff *skb)
  1575. {
  1576. /* Send all internal mgmt frames on VO. Accordingly set TID to 7. */
  1577. ieee80211_tx_skb_tid(sdata, skb, 7);
  1578. }
  1579. u32 ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action,
  1580. struct ieee802_11_elems *elems,
  1581. u64 filter, u32 crc);
  1582. static inline void ieee802_11_parse_elems(const u8 *start, size_t len,
  1583. bool action,
  1584. struct ieee802_11_elems *elems)
  1585. {
  1586. ieee802_11_parse_elems_crc(start, len, action, elems, 0, 0);
  1587. }
  1588. extern const int ieee802_1d_to_ac[8];
  1589. static inline int ieee80211_ac_from_tid(int tid)
  1590. {
  1591. return ieee802_1d_to_ac[tid & 7];
  1592. }
  1593. void ieee80211_dynamic_ps_enable_work(struct work_struct *work);
  1594. void ieee80211_dynamic_ps_disable_work(struct work_struct *work);
  1595. void ieee80211_dynamic_ps_timer(unsigned long data);
  1596. void ieee80211_send_nullfunc(struct ieee80211_local *local,
  1597. struct ieee80211_sub_if_data *sdata,
  1598. bool powersave);
  1599. void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata,
  1600. struct ieee80211_hdr *hdr);
  1601. void ieee80211_sta_tx_notify(struct ieee80211_sub_if_data *sdata,
  1602. struct ieee80211_hdr *hdr, bool ack, u16 tx_time);
  1603. void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw,
  1604. unsigned long queues,
  1605. enum queue_stop_reason reason,
  1606. bool refcounted);
  1607. void ieee80211_stop_vif_queues(struct ieee80211_local *local,
  1608. struct ieee80211_sub_if_data *sdata,
  1609. enum queue_stop_reason reason);
  1610. void ieee80211_wake_vif_queues(struct ieee80211_local *local,
  1611. struct ieee80211_sub_if_data *sdata,
  1612. enum queue_stop_reason reason);
  1613. void ieee80211_stop_queues_by_reason(struct ieee80211_hw *hw,
  1614. unsigned long queues,
  1615. enum queue_stop_reason reason,
  1616. bool refcounted);
  1617. void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue,
  1618. enum queue_stop_reason reason,
  1619. bool refcounted);
  1620. void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue,
  1621. enum queue_stop_reason reason,
  1622. bool refcounted);
  1623. void ieee80211_propagate_queue_wake(struct ieee80211_local *local, int queue);
  1624. void ieee80211_add_pending_skb(struct ieee80211_local *local,
  1625. struct sk_buff *skb);
  1626. void ieee80211_add_pending_skbs(struct ieee80211_local *local,
  1627. struct sk_buff_head *skbs);
  1628. void ieee80211_flush_queues(struct ieee80211_local *local,
  1629. struct ieee80211_sub_if_data *sdata, bool drop);
  1630. void __ieee80211_flush_queues(struct ieee80211_local *local,
  1631. struct ieee80211_sub_if_data *sdata,
  1632. unsigned int queues, bool drop);
  1633. static inline bool ieee80211_can_run_worker(struct ieee80211_local *local)
  1634. {
  1635. /*
  1636. * If quiescing is set, we are racing with __ieee80211_suspend.
  1637. * __ieee80211_suspend flushes the workers after setting quiescing,
  1638. * and we check quiescing / suspended before enqueing new workers.
  1639. * We should abort the worker to avoid the races below.
  1640. */
  1641. if (local->quiescing)
  1642. return false;
  1643. /*
  1644. * We might already be suspended if the following scenario occurs:
  1645. * __ieee80211_suspend Control path
  1646. *
  1647. * if (local->quiescing)
  1648. * return;
  1649. * local->quiescing = true;
  1650. * flush_workqueue();
  1651. * queue_work(...);
  1652. * local->suspended = true;
  1653. * local->quiescing = false;
  1654. * worker starts running...
  1655. */
  1656. if (local->suspended)
  1657. return false;
  1658. return true;
  1659. }
  1660. int ieee80211_txq_setup_flows(struct ieee80211_local *local);
  1661. void ieee80211_txq_teardown_flows(struct ieee80211_local *local);
  1662. void ieee80211_txq_init(struct ieee80211_sub_if_data *sdata,
  1663. struct sta_info *sta,
  1664. struct txq_info *txq, int tid);
  1665. void ieee80211_txq_purge(struct ieee80211_local *local,
  1666. struct txq_info *txqi);
  1667. void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
  1668. u16 transaction, u16 auth_alg, u16 status,
  1669. const u8 *extra, size_t extra_len, const u8 *bssid,
  1670. const u8 *da, const u8 *key, u8 key_len, u8 key_idx,
  1671. u32 tx_flags);
  1672. void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata,
  1673. const u8 *bssid, u16 stype, u16 reason,
  1674. bool send_frame, u8 *frame_buf);
  1675. int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
  1676. size_t buffer_len,
  1677. struct ieee80211_scan_ies *ie_desc,
  1678. const u8 *ie, size_t ie_len,
  1679. u8 bands_used, u32 *rate_masks,
  1680. struct cfg80211_chan_def *chandef);
  1681. struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
  1682. const u8 *src, const u8 *dst,
  1683. u32 ratemask,
  1684. struct ieee80211_channel *chan,
  1685. const u8 *ssid, size_t ssid_len,
  1686. const u8 *ie, size_t ie_len,
  1687. bool directed);
  1688. void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata,
  1689. const u8 *src, const u8 *dst,
  1690. const u8 *ssid, size_t ssid_len,
  1691. const u8 *ie, size_t ie_len,
  1692. u32 ratemask, bool directed, u32 tx_flags,
  1693. struct ieee80211_channel *channel, bool scan);
  1694. u32 ieee80211_sta_get_rates(struct ieee80211_sub_if_data *sdata,
  1695. struct ieee802_11_elems *elems,
  1696. enum nl80211_band band, u32 *basic_rates);
  1697. int __ieee80211_request_smps_mgd(struct ieee80211_sub_if_data *sdata,
  1698. enum ieee80211_smps_mode smps_mode);
  1699. int __ieee80211_request_smps_ap(struct ieee80211_sub_if_data *sdata,
  1700. enum ieee80211_smps_mode smps_mode);
  1701. void ieee80211_recalc_smps(struct ieee80211_sub_if_data *sdata);
  1702. void ieee80211_recalc_min_chandef(struct ieee80211_sub_if_data *sdata);
  1703. size_t ieee80211_ie_split_vendor(const u8 *ies, size_t ielen, size_t offset);
  1704. u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
  1705. u16 cap);
  1706. u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
  1707. const struct cfg80211_chan_def *chandef,
  1708. u16 prot_mode, bool rifs_mode);
  1709. u8 *ieee80211_ie_build_vht_cap(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap,
  1710. u32 cap);
  1711. u8 *ieee80211_ie_build_vht_oper(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap,
  1712. const struct cfg80211_chan_def *chandef);
  1713. int ieee80211_parse_bitrates(struct cfg80211_chan_def *chandef,
  1714. const struct ieee80211_supported_band *sband,
  1715. const u8 *srates, int srates_len, u32 *rates);
  1716. int ieee80211_add_srates_ie(struct ieee80211_sub_if_data *sdata,
  1717. struct sk_buff *skb, bool need_basic,
  1718. enum nl80211_band band);
  1719. int ieee80211_add_ext_srates_ie(struct ieee80211_sub_if_data *sdata,
  1720. struct sk_buff *skb, bool need_basic,
  1721. enum nl80211_band band);
  1722. u8 *ieee80211_add_wmm_info_ie(u8 *buf, u8 qosinfo);
  1723. /* channel management */
  1724. bool ieee80211_chandef_ht_oper(const struct ieee80211_ht_operation *ht_oper,
  1725. struct cfg80211_chan_def *chandef);
  1726. bool ieee80211_chandef_vht_oper(const struct ieee80211_vht_operation *oper,
  1727. struct cfg80211_chan_def *chandef);
  1728. u32 ieee80211_chandef_downgrade(struct cfg80211_chan_def *c);
  1729. int __must_check
  1730. ieee80211_vif_use_channel(struct ieee80211_sub_if_data *sdata,
  1731. const struct cfg80211_chan_def *chandef,
  1732. enum ieee80211_chanctx_mode mode);
  1733. int __must_check
  1734. ieee80211_vif_reserve_chanctx(struct ieee80211_sub_if_data *sdata,
  1735. const struct cfg80211_chan_def *chandef,
  1736. enum ieee80211_chanctx_mode mode,
  1737. bool radar_required);
  1738. int __must_check
  1739. ieee80211_vif_use_reserved_context(struct ieee80211_sub_if_data *sdata);
  1740. int ieee80211_vif_unreserve_chanctx(struct ieee80211_sub_if_data *sdata);
  1741. int __must_check
  1742. ieee80211_vif_change_bandwidth(struct ieee80211_sub_if_data *sdata,
  1743. const struct cfg80211_chan_def *chandef,
  1744. u32 *changed);
  1745. void ieee80211_vif_release_channel(struct ieee80211_sub_if_data *sdata);
  1746. void ieee80211_vif_vlan_copy_chanctx(struct ieee80211_sub_if_data *sdata);
  1747. void ieee80211_vif_copy_chanctx_to_vlans(struct ieee80211_sub_if_data *sdata,
  1748. bool clear);
  1749. int ieee80211_chanctx_refcount(struct ieee80211_local *local,
  1750. struct ieee80211_chanctx *ctx);
  1751. void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local,
  1752. struct ieee80211_chanctx *chanctx);
  1753. void ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local,
  1754. struct ieee80211_chanctx *ctx);
  1755. bool ieee80211_is_radar_required(struct ieee80211_local *local);
  1756. void ieee80211_dfs_cac_timer(unsigned long data);
  1757. void ieee80211_dfs_cac_timer_work(struct work_struct *work);
  1758. void ieee80211_dfs_cac_cancel(struct ieee80211_local *local);
  1759. void ieee80211_dfs_radar_detected_work(struct work_struct *work);
  1760. int ieee80211_send_action_csa(struct ieee80211_sub_if_data *sdata,
  1761. struct cfg80211_csa_settings *csa_settings);
  1762. bool ieee80211_cs_valid(const struct ieee80211_cipher_scheme *cs);
  1763. bool ieee80211_cs_list_valid(const struct ieee80211_cipher_scheme *cs, int n);
  1764. const struct ieee80211_cipher_scheme *
  1765. ieee80211_cs_get(struct ieee80211_local *local, u32 cipher,
  1766. enum nl80211_iftype iftype);
  1767. int ieee80211_cs_headroom(struct ieee80211_local *local,
  1768. struct cfg80211_crypto_settings *crypto,
  1769. enum nl80211_iftype iftype);
  1770. void ieee80211_recalc_dtim(struct ieee80211_local *local,
  1771. struct ieee80211_sub_if_data *sdata);
  1772. int ieee80211_check_combinations(struct ieee80211_sub_if_data *sdata,
  1773. const struct cfg80211_chan_def *chandef,
  1774. enum ieee80211_chanctx_mode chanmode,
  1775. u8 radar_detect);
  1776. int ieee80211_max_num_channels(struct ieee80211_local *local);
  1777. enum nl80211_chan_width ieee80211_get_sta_bw(struct ieee80211_sta *sta);
  1778. void ieee80211_recalc_chanctx_chantype(struct ieee80211_local *local,
  1779. struct ieee80211_chanctx *ctx);
  1780. /* TDLS */
  1781. int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
  1782. const u8 *peer, u8 action_code, u8 dialog_token,
  1783. u16 status_code, u32 peer_capability,
  1784. bool initiator, const u8 *extra_ies,
  1785. size_t extra_ies_len);
  1786. int ieee80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev,
  1787. const u8 *peer, enum nl80211_tdls_operation oper);
  1788. void ieee80211_tdls_peer_del_work(struct work_struct *wk);
  1789. int ieee80211_tdls_channel_switch(struct wiphy *wiphy, struct net_device *dev,
  1790. const u8 *addr, u8 oper_class,
  1791. struct cfg80211_chan_def *chandef);
  1792. void ieee80211_tdls_cancel_channel_switch(struct wiphy *wiphy,
  1793. struct net_device *dev,
  1794. const u8 *addr);
  1795. void ieee80211_teardown_tdls_peers(struct ieee80211_sub_if_data *sdata);
  1796. void ieee80211_tdls_chsw_work(struct work_struct *wk);
  1797. extern const struct ethtool_ops ieee80211_ethtool_ops;
  1798. #ifdef CONFIG_MAC80211_NOINLINE
  1799. #define debug_noinline noinline
  1800. #else
  1801. #define debug_noinline
  1802. #endif
  1803. #endif /* IEEE80211_I_H */