wlan_vdev_mlme.h 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103
  1. /*
  2. * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. /**
  17. * DOC: Define VDEV MLME structure and APIs
  18. */
  19. #ifndef _WLAN_VDEV_MLME_H_
  20. #define _WLAN_VDEV_MLME_H_
  21. #include <wlan_vdev_mgr_tgt_if_rx_defs.h>
  22. #include <wlan_objmgr_vdev_obj.h>
  23. #include <wlan_vdev_mlme_api.h>
  24. #include <wlan_ext_mlme_obj_types.h>
  25. struct vdev_mlme_obj;
  26. struct cnx_mgr;
  27. /* Requestor ID for multiple vdev restart */
  28. #define MULTIPLE_VDEV_RESTART_REQ_ID 0x1234
  29. /* values for vdev_type */
  30. #define WLAN_VDEV_MLME_TYPE_UNKNOWN 0x0
  31. #define WLAN_VDEV_MLME_TYPE_AP 0x1
  32. #define WLAN_VDEV_MLME_TYPE_STA 0x2
  33. #define WLAN_VDEV_MLME_TYPE_IBSS 0x3
  34. #define WLAN_VDEV_MLME_TYPE_MONITOR 0x4
  35. #define WLAN_VDEV_MLME_TYPE_NAN 0x5
  36. #define WLAN_VDEV_MLME_TYPE_OCB 0x6
  37. #define WLAN_VDEV_MLME_TYPE_NDI 0x7
  38. /* values for vdev_subtype */
  39. #define WLAN_VDEV_MLME_SUBTYPE_UNKNOWN 0x0
  40. #define WLAN_VDEV_MLME_SUBTYPE_P2P_DEVICE 0x1
  41. #define WLAN_VDEV_MLME_SUBTYPE_P2P_CLIENT 0x2
  42. #define WLAN_VDEV_MLME_SUBTYPE_P2P_GO 0x3
  43. #define WLAN_VDEV_MLME_SUBTYPE_PROXY_STA 0x4
  44. #define WLAN_VDEV_MLME_SUBTYPE_MESH 0x5
  45. #define WLAN_VDEV_MLME_SUBTYPE_MESH_11S 0x6
  46. #define WLAN_VDEV_MLME_SUBTYPE_SMART_MONITOR 0x7
  47. /* vdev control flags (per bits) */
  48. #define WLAN_VDEV_MLME_FLAGS_NON_MBSSID_AP 0x00000001
  49. #define WLAN_VDEV_MLME_FLAGS_TRANSMIT_AP 0x00000002
  50. #define WLAN_VDEV_MLME_FLAGS_NON_TRANSMIT_AP 0x00000004
  51. #define WLAN_VDEV_MLME_FLAGS_EMA_MODE 0x00000008
  52. /**
  53. * struct vdev_mlme_proto_generic - generic mlme proto structure
  54. * sent in frames
  55. * @dtim_period: frequency of data transmissions per beacon 1-255
  56. * @slot_time: slot time
  57. * @protection_mode: rts cts protection mode
  58. * @beacon_interval: beacon interval
  59. * @ldpc: low density parity check value
  60. * @nss: number of spatial stream
  61. * @nss_2g: 2.4GHz number of spatial stream
  62. * @nss_5g: 5GHz number of spatial stream
  63. * @tsfadjust: adjusted timer sync value
  64. */
  65. struct vdev_mlme_proto_generic {
  66. uint8_t dtim_period;
  67. uint32_t slot_time;
  68. uint32_t protection_mode;
  69. uint16_t beacon_interval;
  70. uint8_t ldpc;
  71. uint8_t nss;
  72. uint8_t nss_2g;
  73. uint8_t nss_5g;
  74. uint64_t tsfadjust;
  75. };
  76. /**
  77. * struct vdev_mlme_proto_ap - ap specific mlme protocol
  78. * @.
  79. */
  80. struct vdev_mlme_proto_ap {
  81. };
  82. /**
  83. * struct vdev_mlme_proto_sta - sta specific mlme protocol
  84. * @assoc_id: association id of station
  85. * @uapsd_cfg: uapsd configuration
  86. */
  87. struct vdev_mlme_proto_sta {
  88. uint16_t assoc_id;
  89. uint16_t uapsd_cfg;
  90. };
  91. /**
  92. * struct vdev_mlme_proto_bss_color - bss color cfg
  93. * @flags: proposed for future use cases, currently not used.
  94. * @evt_type: bss color collision event.
  95. * @current_bss_color: current bss color.
  96. * @detection_period_ms: scan interval for both AP and STA mode.
  97. * @scan_period_ms: scan period for passive scan to detect collision.
  98. * @free_slot_expiry_time_ms: FW to notify host at timer expiry after
  99. * which Host will disable the bss color.
  100. */
  101. struct vdev_mlme_proto_bss_color {
  102. uint32_t flags;
  103. uint8_t evt_type;
  104. uint32_t current_bss_color;
  105. uint32_t detection_period_ms;
  106. uint32_t scan_period_ms;
  107. uint32_t free_slot_expiry_time_ms;
  108. };
  109. /**
  110. * struct vdev_mlme_vht_info - vdev VHT information
  111. * @caps: vht capabilities
  112. * @subfer: su beam former capability
  113. * @subfee: su beam formee capability
  114. * @mubfer: mu beam former capability
  115. * @mubfee: mu beam formee capability
  116. * @implicit_bf: Implicit BF support
  117. * @sounding_dimension: Beamformer number of sounding dimension
  118. * @bfee_sts_cap: beam formee STA capability
  119. * @allow_vht: vht capability status
  120. */
  121. struct vdev_mlme_vht_info {
  122. uint32_t caps;
  123. uint8_t subfer;
  124. uint8_t mubfer;
  125. uint8_t subfee;
  126. uint8_t mubfee;
  127. uint8_t implicit_bf;
  128. uint8_t sounding_dimension;
  129. uint8_t bfee_sts_cap;
  130. bool allow_vht;
  131. };
  132. /**
  133. * struct vdev_mlme_ht_info - vdev HT information
  134. * @ht_caps: HT capabilities
  135. * @allow_ht: HT capability status
  136. */
  137. struct vdev_mlme_ht_info {
  138. uint32_t ht_caps;
  139. bool allow_ht;
  140. };
  141. /**
  142. * struct vdev_mlme_he_ops_info - vdev mlme HEOPS information
  143. * @he_ops: he ops
  144. */
  145. struct vdev_mlme_he_ops_info {
  146. uint32_t he_ops;
  147. };
  148. #ifdef WLAN_FEATURE_11BE
  149. /**
  150. * struct vdev_mlme_eht_caps_info - vdev mlme EHT capability information
  151. * @eht_maccap_nseppriaccess_support : NSEP Priority Access Supported
  152. * @eht_maccap_ehtomctrl_support : EHT OM Control Support
  153. * @eht_maccap_trigtxop_support : Triggered TXOP Sharing Support
  154. * @eht_phycap_reserved : Reserved
  155. * @eht_phycap_320mhzin6ghz : Support For 320 MHz In 6 GHz
  156. * @eht_phycap_242tonerubwlt20mhz : Support for 242-tone RU In BW Wider Than
  157. * 20 MHz
  158. * @eht_phycap_ndp4xehtltfand320nsgi : NDP With 4. EHT-LTF And 3.2 .s GI
  159. * @eht_phycap_partialbwulmu : Partial Bandwidth UL MU-MIMO
  160. * @eht_phycap_subfmr : SU Beamformer
  161. * @eht_phycap_subfme : SU Beamformee
  162. * @eht_phycap_bfmesslt80mhz : Beamformee SS (<= 80 MHz)
  163. * @eht_phycap_bfmess160mhz : Beamformee SS (= 160 MHz)
  164. * @eht_phycap_bfmess320mhz : Beamformee SS (= 320 MHz)
  165. * @eht_phycap_numsoundlt80mhz : Number Of Sounding Dimensions (<=80 MHz)
  166. * @eht_phycap_numsound160mhz : Number Of Sounding Dimensions (=160 MHz)
  167. * @eht_phycap_numsound320mhz : Number Of Sounding Dimensions (=320 MHz)
  168. * @eht_phycap_ng16sufb : Ng = 16 SU Feedback
  169. * @eht_phycap_ng16mufb : Ng = 16 MU Feedback
  170. * @eht_phycap_codbk42sufb : Codebook Size {4,2} SU Feedback
  171. * @eht_phycap_codbk75mufb : Codebook Size {4,2} MU Feedback
  172. * @eht_phycap_trigsubffb : Triggered SU Beamforming Feedback
  173. * @eht_phycap_trigmubfpartbwfb : Triggered MU Beamforming Partial B
  174. * Feedback
  175. * @eht_phycap_trigcqifb : Triggered CQI Feedback
  176. * @eht_phycap_partbwdlmumimo : Partial Bandwidth DL MU-MIMO
  177. * @eht_phycap_psrsr : PSR-Based SR Support
  178. * @eht_phycap_pwrbstfactor : Power Boost Factor Support
  179. * @eht_phycap_4xehtltfand800nsgi : EHT MU PPDU With 4xEHT-LTF And 0.8 .s GI
  180. * @eht_phycap_maxnc : Max Nc
  181. * @eht_phycap_nontrigcqifb : Non-Triggered CQI Feedback
  182. * @eht_phycap_tx1024and4096qamls242toneru : Tx 1024-QAM And 4096-QAM <
  183. * 242-tone RU Support
  184. * @eht_phycap_rx1024and4096qamls242toneru : Rx 1024-QAM And 4096-QAM <
  185. * 242-tone RU Support
  186. * @eht_phycap_ppethrespresent : PPE Thresholds Present
  187. * @eht_phycap_cmnnompktpad : Common Nominal Packet Padding
  188. * @eht_phycap_maxnumehtltf : Maximum Number Of Supported EHT-LTFs
  189. * @eht_phycap_supmcs15 : Support of MCS 15
  190. * @eht_phycap_ehtdupin6ghz : Support Of EHT DUP In 6 GHz
  191. * @eht_phycap_20mhzopstarxndpwiderbw : Support For 20 MHz Operating STA
  192. * Receiving NDP With Wider Bandwidth
  193. * @eht_phycap_nonofdmaulmumimolt80mhz : Non-OFDMA UL MU-MIMO (BW <= 80 MHz)
  194. * @eht_phycap_nonofdmaulmumimo160mhz : Non-OFDMA UL MU-MIMO (BW = 160 MHz)
  195. * @eht_phycap_nonofdmaulmumimo320mhz : Non-OFDMA UL MU-MIMO (BW = 320 MHz)
  196. * @eht_phycap_mubfmrlt80mhz : MU Beamformer (BW <= 80 MHz)
  197. * @eht_phycap_mubfmr160mhz : MU Beamformer (BW = 160 MHz)
  198. * @eht_phycap_mubfmr320mhz : MU Beamformer (BW = 320 MHz)
  199. */
  200. struct vdev_mlme_eht_caps_info {
  201. uint32_t eht_maccap_nseppriaccess_support :1,
  202. eht_maccap_ehtomctrl_support :1,
  203. eht_maccap_trigtxop_support :1;
  204. uint32_t eht_phycap_reserved :1,
  205. eht_phycap_320mhzin6ghz :1,
  206. eht_phycap_242tonerubwlt20mhz :1,
  207. eht_phycap_ndp4xehtltfand320nsgi :1,
  208. eht_phycap_partialbwulmu :1,
  209. eht_phycap_subfmr :1,
  210. eht_phycap_subfme :1,
  211. eht_phycap_bfmesslt80mhz :3,
  212. eht_phycap_bfmess160mhz :3,
  213. eht_phycap_bfmess320mhz :3,
  214. eht_phycap_numsoundlt80mhz :3,
  215. eht_phycap_numsound160mhz :3,
  216. eht_phycap_numsound320mhz :3,
  217. eht_phycap_ng16sufb :1,
  218. eht_phycap_ng16mufb :1,
  219. eht_phycap_codbk42sufb :1,
  220. eht_phycap_codbk75mufb :1,
  221. eht_phycap_trigsubffb :1,
  222. eht_phycap_trigmubfpartbwfb :1,
  223. eht_phycap_trigcqifb :1;
  224. uint32_t eht_phycap_partbwdlmumimo :1,
  225. eht_phycap_psrsr :1,
  226. eht_phycap_pwrbstfactor :1,
  227. eht_phycap_4xehtltfand800nsgi :1,
  228. eht_phycap_maxnc :4,
  229. eht_phycap_nontrigcqifb :1,
  230. eht_phycap_tx1024and4096qamls242toneru :1,
  231. eht_phycap_rx1024and4096qamls242toneru :1,
  232. eht_phycap_ppethrespresent :1,
  233. eht_phycap_cmnnompktpad :2,
  234. eht_phycap_maxnumehtltf :5,
  235. eht_phycap_supmcs15 :4,
  236. eht_phycap_ehtdupin6ghz :1,
  237. eht_phycap_20mhzopstarxndpwiderbw :1,
  238. eht_phycap_nonofdmaulmumimolt80mhz :1,
  239. eht_phycap_nonofdmaulmumimo160mhz :1,
  240. eht_phycap_nonofdmaulmumimo320mhz :1,
  241. eht_phycap_mubfmrlt80mhz :1,
  242. eht_phycap_mubfmr160mhz :1,
  243. eht_phycap_mubfmr320mhz :1;
  244. };
  245. /**
  246. * struct vdev_mlme_eht_ops_info - vdev mlme EHTOPS information
  247. * @eht_ops: eht ops
  248. */
  249. struct vdev_mlme_eht_ops_info {
  250. uint32_t eht_ops;
  251. };
  252. #endif
  253. /**
  254. * struct vdev_mlme_he_ops_info - vdev protocol structure holding information
  255. * that is used in frames
  256. * @generic: generic protocol information
  257. * @ap: ap specific protocol information
  258. * @sta: sta specific protocol information
  259. * @vht_info: vht information
  260. * @ht_info: ht capabilities information
  261. * @he_ops_info: he ops information
  262. * @eht_cap_info: EHT capability information
  263. * @eht_ops_info: EHT operation information
  264. * @bss_color: 11ax HE BSS Color information
  265. */
  266. struct vdev_mlme_proto {
  267. struct vdev_mlme_proto_generic generic;
  268. struct vdev_mlme_proto_ap ap;
  269. struct vdev_mlme_proto_sta sta;
  270. struct vdev_mlme_vht_info vht_info;
  271. struct vdev_mlme_ht_info ht_info;
  272. struct vdev_mlme_he_ops_info he_ops_info;
  273. #ifdef WLAN_FEATURE_11BE
  274. struct vdev_mlme_eht_caps_info eht_cap_info;
  275. struct vdev_mlme_eht_ops_info eht_ops_info;
  276. #endif
  277. struct vdev_mlme_proto_bss_color bss_color;
  278. };
  279. /**
  280. * struct vdev_mlme_mgmt_generic - generic vdev mlme mgmt cfg
  281. * @rts_threshold: RTS threshold
  282. * @frag_threshold: Fragmentation threshold
  283. * @probe_delay: time in msec for delaying to send first probe request
  284. * @repeat_probe_time: probe request transmission time
  285. * @drop_unencry: drop unencrypted status
  286. * @ tx_pwrlimit: Tx power limit
  287. * @tx_power: Tx power
  288. * @minpower: Min power
  289. * @maxpower: Max power
  290. * @maxregpower: max regulatory power
  291. * @antennamax: max antenna
  292. * @reg_class_id: reg domain class id
  293. * @ampdu: ampdu limit
  294. * @amsdu: amsdu limit
  295. * @ssid: service set identifier
  296. * @ssid_len: ssid length
  297. * @type: vdev type
  298. * @sub_type: vdev subtype
  299. * @rx_decap_type: rx decap type
  300. * @tx_encap_type: tx encap type
  301. * @disable_hw_ack: disable ha ack flag
  302. * @bssid: bssid
  303. * @phy_mode: phy mode
  304. * @special_vdev_mode: indicates special vdev mode
  305. */
  306. struct vdev_mlme_mgmt_generic {
  307. uint32_t rts_threshold;
  308. uint32_t frag_threshold;
  309. uint32_t probe_delay;
  310. uint32_t repeat_probe_time;
  311. uint32_t drop_unencry;
  312. uint32_t tx_pwrlimit;
  313. uint8_t tx_power;
  314. uint8_t minpower;
  315. uint8_t maxpower;
  316. uint8_t maxregpower;
  317. uint8_t antennamax;
  318. uint8_t reg_class_id;
  319. uint8_t ampdu;
  320. uint8_t amsdu;
  321. char ssid[WLAN_SSID_MAX_LEN + 1];
  322. uint8_t ssid_len;
  323. uint8_t type;
  324. uint8_t subtype;
  325. uint8_t rx_decap_type;
  326. uint8_t tx_encap_type;
  327. bool disable_hw_ack;
  328. uint8_t bssid[QDF_MAC_ADDR_SIZE];
  329. uint32_t phy_mode;
  330. bool special_vdev_mode;
  331. };
  332. /**
  333. * struct vdev_mlme_mgmt_ap - ap specific vdev mlme mgmt cfg
  334. * @hidden_ssid: flag to indicate whether it is hidden ssid
  335. * @cac_duration_ms: cac duration in millseconds
  336. */
  337. struct vdev_mlme_mgmt_ap {
  338. bool hidden_ssid;
  339. uint32_t cac_duration_ms;
  340. };
  341. /**
  342. * struct vdev_mlme_mgmt_sta - sta specific vdev mlme mgmt cfg
  343. * @he_mcs_12_13_map: map to indicate mcs12/13 caps of peer&dut
  344. */
  345. struct vdev_mlme_mgmt_sta {
  346. uint16_t he_mcs_12_13_map;
  347. };
  348. /**
  349. * struct vdev_mlme_inactivity_params - vdev mlme inactivity parameters
  350. * @bmiss_first_bcnt: bmiss first time
  351. * @bmiss_final_bcnt: bmiss final time
  352. * @keepalive_min_idle_inactive_time_secs: min time AP consider STA to be
  353. * inactive
  354. * @keepalive_max_idle_inactive_time_secs: max inactive idle time for AP to send
  355. * data-null
  356. * @keepalive_max_unresponsive_time_secs: max time to send WMI_STA_KICKOUT
  357. */
  358. struct vdev_mlme_inactivity_params {
  359. uint32_t bmiss_first_bcnt;
  360. uint32_t bmiss_final_bcnt;
  361. uint32_t keepalive_min_idle_inactive_time_secs;
  362. uint32_t keepalive_max_idle_inactive_time_secs;
  363. uint32_t keepalive_max_unresponsive_time_secs;
  364. };
  365. /**
  366. * struct vdev_mlme_rate_info - vdev mlme rate information
  367. * @rate_flags: dynamic bandwidth info
  368. * @per_band_tx_mgmt_rate: per band Tx mgmt rate
  369. * @max_rate: max bandwidth rate
  370. * @tx_mgmt_rate: Tx Mgmt rate
  371. * @bcn_tx_rate: beacon Tx rate
  372. * @bcn_tx_rate_code: beacon Tx rate code
  373. * @type: Type of ratemask configuration
  374. * @lower32: Lower 32 bits in the 1st 64-bit value
  375. * @higher32: Higher 32 bits in the 1st 64-bit value
  376. * @lower32_2: Lower 32 bits in the 2nd 64-bit value
  377. * @half_rate: Half rate
  378. * @quarter_rate: quarter rate
  379. */
  380. struct vdev_mlme_rate_info {
  381. uint32_t rate_flags;
  382. uint32_t per_band_tx_mgmt_rate;
  383. uint32_t max_rate;
  384. uint32_t tx_mgmt_rate;
  385. uint32_t bcn_tx_rate;
  386. #ifdef WLAN_BCN_RATECODE_ENABLE
  387. uint32_t bcn_tx_rate_code;
  388. #endif
  389. uint32_t rtscts_tx_rate;
  390. uint8_t type;
  391. uint32_t lower32;
  392. uint32_t higher32;
  393. uint32_t lower32_2;
  394. bool half_rate;
  395. bool quarter_rate;
  396. };
  397. /**
  398. * struct vdev_mlme_chainmask_info - vdev mlme chainmask information
  399. * @tx_chainmask: Tx chainmask
  400. * @rx_chainmask: Rx Chainmask
  401. * @num_rx_chain: Num of bits set in Rx chain
  402. * @num_tx_chain: Num of bits set in Tx chain
  403. */
  404. struct vdev_mlme_chainmask_info {
  405. uint8_t tx_chainmask;
  406. uint8_t rx_chainmask;
  407. uint8_t num_rx_chain;
  408. uint8_t num_tx_chain;
  409. };
  410. /**
  411. * struct vdev_mlme_powersave_info - vdev mlme powersave information
  412. * @packet_powersave: packet powersave
  413. * @max_li_of_moddtim: max mod dtim
  414. * @dyndtim_cnt: dynamic dtim count
  415. * @listen_interval: listen interval
  416. * @moddtim_cnt: mod dtim count
  417. */
  418. struct vdev_mlme_powersave_info {
  419. uint32_t packet_powersave;
  420. uint32_t max_li_of_moddtim;
  421. uint32_t dyndtim_cnt;
  422. uint32_t listen_interval;
  423. uint32_t moddtim_cnt;
  424. };
  425. /**
  426. * struct vdev_mlme_beacon_info - vdev mlme beacon information
  427. * @beacon_buffer: buffer allocated for beacon frame
  428. * @beacon_offsets: beacon IE's offsets
  429. */
  430. struct vdev_mlme_beacon_info {
  431. qdf_nbuf_t beacon_buffer;
  432. void *beacon_offsets;
  433. };
  434. /**
  435. * struct vdev_mlme_mbss_11ax - mbss 11ax fields required for up cmd
  436. * @profile_idx: profile index of the connected non-trans ap (mbssid case).
  437. * 0 means invalid.
  438. * @profile_num: the total profile numbers of non-trans aps (mbssid
  439. * case).
  440. * 0 means non-MBSS AP.
  441. * @mbssid-flags: MBSS IE flags indicating vdev type
  442. * @vdevid_trans: id of transmitting vdev for MBSS IE
  443. * @trans_bssid: bssid of transmitted AP (MBSS IE case)
  444. */
  445. struct vdev_mlme_mbss_11ax {
  446. uint32_t profile_idx;
  447. uint32_t profile_num;
  448. uint32_t mbssid_flags;
  449. uint8_t vdevid_trans;
  450. uint8_t trans_bssid[QDF_MAC_ADDR_SIZE];
  451. };
  452. /**
  453. * struct vdev_mlme_mgmt - vdev mlme mgmt related cfg
  454. * @generic: generic mgmt information
  455. * @ap: ap specific mgmt information
  456. * @sta: sta specific mgmt information
  457. * @inactivity_params: inactivity parameters
  458. * @rate_info: bandwidth rate information
  459. * @chainmask_info: Chainmask information
  460. * @powersave_info: Power save parameters
  461. * @beacon_info: beacon buffer information
  462. * @mbss_11ax: MBSS 11ax information
  463. */
  464. struct vdev_mlme_mgmt {
  465. struct vdev_mlme_mgmt_generic generic;
  466. struct vdev_mlme_mgmt_ap ap;
  467. struct vdev_mlme_mgmt_sta sta;
  468. struct vdev_mlme_inactivity_params inactivity_params;
  469. struct vdev_mlme_rate_info rate_info;
  470. struct vdev_mlme_chainmask_info chainmask_info;
  471. struct vdev_mlme_powersave_info powersave_info;
  472. struct vdev_mlme_beacon_info beacon_info;
  473. struct vdev_mlme_mbss_11ax mbss_11ax;
  474. };
  475. /**
  476. * enum beacon_update_op - Beacon update op type
  477. * @BEACON_INIT: Initialize beacon
  478. * @BEACON_REINIT: Re-initialize beacon
  479. * @BEACON_UPDATE: Update dynamic fields of beacon
  480. * @BEACON_CSA: Enable CSA IE
  481. * @BEACON_FREE: Beacon buffer free
  482. */
  483. enum beacon_update_op {
  484. BEACON_INIT,
  485. BEACON_REINIT,
  486. BEACON_UPDATE,
  487. BEACON_CSA,
  488. BEACON_FREE,
  489. };
  490. /**
  491. * enum vdev_cmd_type - Command type
  492. * @START_REQ: Start request
  493. * @RESTART_REQ: Restart request
  494. * @STOP_REQ: STOP request
  495. * @DELETE_REQ: DELETE request
  496. */
  497. enum vdev_cmd_type {
  498. START_REQ,
  499. RESTART_REQ,
  500. STOP_REQ,
  501. DELETE_REQ,
  502. };
  503. /**
  504. * enum vdev_start_resp_type - start respone type
  505. * @START_RESPONSE: Start response
  506. * @RESTART_RESPONSE: Restart response
  507. */
  508. enum vdev_start_resp_type {
  509. START_RESPONSE = 0,
  510. RESTART_RESPONSE,
  511. };
  512. /**
  513. * struct vdev_mlme_ops - VDEV MLME operation callbacks structure
  514. * @mlme_vdev_validate_basic_params: callback to validate VDEV basic params
  515. * @mlme_vdev_reset_proto_params: callback to Reset protocol params
  516. * @mlme_vdev_start_send: callback to initiate actions of VDEV
  517. * MLME start operation
  518. * @mlme_vdev_restart_send: callback to initiate actions of VDEV
  519. * MLME restart operation
  520. * @mlme_vdev_stop_start_send: callback to block start/restart VDEV
  521. * request command
  522. * @mlme_vdev_start_continue: callback to initiate operations on
  523. * LMAC/FW start response
  524. * @mlme_vdev_sta_conn_start: callback to initiate STA connection
  525. * @mlme_vdev_up_send: callback to initiate actions of VDEV
  526. * MLME up operation
  527. * @mlme_vdev_notify_up_complete: callback to notify VDEV MLME on moving
  528. * to UP state
  529. * @mlme_vdev_notify_roam_start: callback to initiate roaming
  530. * @mlme_vdev_update_beacon: callback to initiate beacon update
  531. * @mlme_vdev_disconnect_peers: callback to initiate disconnection of
  532. * peers
  533. * @mlme_vdev_dfs_cac_timer_stop: callback to stop the DFS CAC timer
  534. * @mlme_vdev_stop_send: callback to initiate actions of VDEV
  535. * MLME stop operation
  536. * @mlme_vdev_stop_continue: callback to initiate operations on
  537. * LMAC/FW stop response
  538. * @mlme_vdev_bss_peer_delete_continue: callback to initiate operations on BSS
  539. * peer delete completion
  540. * @mlme_vdev_down_send: callback to initiate actions of VDEV
  541. * MLME down operation
  542. * @mlme_vdev_notify_start_state_exit: callback to notify on vdev start
  543. * start state exit
  544. * @mlme_vdev_is_newchan_no_cac: callback to check CAC is required
  545. * @mlme_vdev_ext_peer_delete_all_rsp: callback to initiate actions for
  546. * vdev mlme peer delete all response
  547. * @mlme_vdev_dfs_cac_wait_notify: callback to notify about CAC state
  548. * @mlme_vdev_csa_complete: callback to indicate CSA complete
  549. * @mlme_vdev_sta_disconn_start: callback to initiate STA disconnection
  550. */
  551. struct vdev_mlme_ops {
  552. QDF_STATUS (*mlme_vdev_validate_basic_params)(
  553. struct vdev_mlme_obj *vdev_mlme,
  554. uint16_t event_data_len, void *event_data);
  555. QDF_STATUS (*mlme_vdev_reset_proto_params)(
  556. struct vdev_mlme_obj *vdev_mlme,
  557. uint16_t event_data_len, void *event_data);
  558. QDF_STATUS (*mlme_vdev_start_send)(
  559. struct vdev_mlme_obj *vdev_mlme,
  560. uint16_t event_data_len, void *event_data);
  561. QDF_STATUS (*mlme_vdev_restart_send)(
  562. struct vdev_mlme_obj *vdev_mlme,
  563. uint16_t event_data_len, void *event_data);
  564. QDF_STATUS (*mlme_vdev_stop_start_send)(
  565. struct vdev_mlme_obj *vdev_mlme,
  566. enum vdev_cmd_type type,
  567. uint16_t event_data_len, void *event_data);
  568. QDF_STATUS (*mlme_vdev_start_continue)(
  569. struct vdev_mlme_obj *vdev_mlme,
  570. uint16_t event_data_len, void *event_data);
  571. QDF_STATUS (*mlme_vdev_sta_conn_start)(
  572. struct vdev_mlme_obj *vdev_mlme,
  573. uint16_t event_data_len, void *event_data);
  574. QDF_STATUS (*mlme_vdev_start_req_failed)(
  575. struct vdev_mlme_obj *vdev_mlme,
  576. uint16_t event_data_len, void *event_data);
  577. QDF_STATUS (*mlme_vdev_up_send)(
  578. struct vdev_mlme_obj *vdev_mlme,
  579. uint16_t event_data_len, void *event_data);
  580. QDF_STATUS (*mlme_vdev_notify_up_complete)(
  581. struct vdev_mlme_obj *vdev_mlme,
  582. uint16_t event_data_len, void *event_data);
  583. QDF_STATUS (*mlme_vdev_notify_roam_start)(
  584. struct vdev_mlme_obj *vdev_mlme,
  585. uint16_t event_data_len, void *event_data);
  586. QDF_STATUS (*mlme_vdev_update_beacon)(
  587. struct vdev_mlme_obj *vdev_mlme,
  588. enum beacon_update_op op,
  589. uint16_t event_data_len, void *event_data);
  590. QDF_STATUS (*mlme_vdev_disconnect_peers)(
  591. struct vdev_mlme_obj *vdev_mlme,
  592. uint16_t event_data_len, void *event_data);
  593. QDF_STATUS (*mlme_vdev_dfs_cac_timer_stop)(
  594. struct vdev_mlme_obj *vdev_mlme,
  595. uint16_t event_data_len, void *event_data);
  596. QDF_STATUS (*mlme_vdev_stop_send)(
  597. struct vdev_mlme_obj *vdev_mlme,
  598. uint16_t event_data_len, void *event_data);
  599. QDF_STATUS (*mlme_vdev_stop_continue)(
  600. struct vdev_mlme_obj *vdev_mlme,
  601. uint16_t event_data_len, void *event_data);
  602. QDF_STATUS (*mlme_vdev_down_send)(
  603. struct vdev_mlme_obj *vdev_mlme,
  604. uint16_t event_data_len, void *event_data);
  605. QDF_STATUS (*mlme_vdev_notify_down_complete)(
  606. struct vdev_mlme_obj *vdev_mlme,
  607. uint16_t event_data_len, void *event_data);
  608. QDF_STATUS (*mlme_vdev_ext_stop_rsp)(
  609. struct vdev_mlme_obj *vdev_mlme,
  610. struct vdev_stop_response *rsp);
  611. QDF_STATUS (*mlme_vdev_ext_start_rsp)(
  612. struct vdev_mlme_obj *vdev_mlme,
  613. struct vdev_start_response *rsp);
  614. QDF_STATUS (*mlme_vdev_notify_start_state_exit)(
  615. struct vdev_mlme_obj *vdev_mlme);
  616. QDF_STATUS (*mlme_vdev_is_newchan_no_cac)(
  617. struct vdev_mlme_obj *vdev_mlme);
  618. QDF_STATUS (*mlme_vdev_ext_peer_delete_all_rsp)(
  619. struct vdev_mlme_obj *vdev_mlme,
  620. struct peer_delete_all_response *rsp);
  621. QDF_STATUS (*mlme_vdev_dfs_cac_wait_notify)(
  622. struct vdev_mlme_obj *vdev_mlme);
  623. QDF_STATUS (*mlme_vdev_csa_complete)(
  624. struct vdev_mlme_obj *vdev_mlme);
  625. QDF_STATUS (*mlme_vdev_sta_disconn_start)(
  626. struct vdev_mlme_obj *vdev_mlme,
  627. uint16_t event_data_len, void *event_data);
  628. };
  629. /**
  630. * struct vdev_mlme_obj - VDEV MLME component object
  631. * @proto: VDEV MLME proto substructure
  632. * @mgmt: VDEV MLME mgmt substructure
  633. * @sm_lock: VDEV SM lock
  634. * @vdev_cmd_lock: VDEV MLME command atomicity
  635. * @sm_hdl: VDEV SM handle
  636. * @cnx_mgr_ctx: connection manager context, valid for STA and P2P-CLI mode only
  637. * @vdev: Pointer to vdev objmgr
  638. * @ops: VDEV MLME callback table
  639. * @ext_vdev_ptr: VDEV MLME legacy pointer
  640. * @reg_tpc_obj: Regulatory transmit power info
  641. * @vdev_rt: VDEV response timer
  642. * @vdev_wakelock: vdev wakelock sub structure
  643. */
  644. struct vdev_mlme_obj {
  645. struct vdev_mlme_proto proto;
  646. struct vdev_mlme_mgmt mgmt;
  647. #ifdef VDEV_SM_LOCK_SUPPORT
  648. qdf_spinlock_t sm_lock;
  649. qdf_mutex_t vdev_cmd_lock;
  650. #endif
  651. struct wlan_sm *sm_hdl;
  652. union {
  653. struct cnx_mgr *cnx_mgr_ctx;
  654. };
  655. struct wlan_objmgr_vdev *vdev;
  656. struct vdev_mlme_ops *ops;
  657. mlme_vdev_ext_t *ext_vdev_ptr;
  658. struct reg_tpc_power_info reg_tpc_obj;
  659. };
  660. /**
  661. * wlan_vdev_mlme_set_ssid() - set ssid
  662. * @vdev: VDEV object
  663. * @ssid: SSID (input)
  664. * @ssid_len: Length of SSID
  665. *
  666. * API to set the SSID of VDEV
  667. *
  668. * Caller need to acquire lock with wlan_vdev_obj_lock()
  669. *
  670. * Return: SUCCESS, if update is done
  671. * FAILURE, if ssid length is > max ssid len
  672. */
  673. static inline QDF_STATUS wlan_vdev_mlme_set_ssid(
  674. struct wlan_objmgr_vdev *vdev,
  675. const uint8_t *ssid, uint8_t ssid_len)
  676. {
  677. struct vdev_mlme_obj *vdev_mlme;
  678. /* This API is invoked with lock acquired, do not add log prints */
  679. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  680. if (!vdev_mlme)
  681. return QDF_STATUS_E_FAILURE;
  682. if (ssid_len <= WLAN_SSID_MAX_LEN) {
  683. qdf_mem_copy(vdev_mlme->mgmt.generic.ssid, ssid, ssid_len);
  684. vdev_mlme->mgmt.generic.ssid_len = ssid_len;
  685. } else {
  686. vdev_mlme->mgmt.generic.ssid_len = 0;
  687. return QDF_STATUS_E_FAILURE;
  688. }
  689. return QDF_STATUS_SUCCESS;
  690. }
  691. /**
  692. * wlan_vdev_mlme_get_ssid() - get ssid
  693. * @vdev: VDEV object
  694. * @ssid: SSID
  695. * @ssid_len: Length of SSID
  696. *
  697. * API to get the SSID of VDEV, it updates the SSID and its length
  698. * in @ssid, @ssid_len respectively
  699. *
  700. * Caller need to acquire lock with wlan_vdev_obj_lock()
  701. *
  702. * Return: SUCCESS, if update is done
  703. * FAILURE, if ssid length is > max ssid len
  704. */
  705. static inline QDF_STATUS wlan_vdev_mlme_get_ssid(
  706. struct wlan_objmgr_vdev *vdev,
  707. uint8_t *ssid, uint8_t *ssid_len)
  708. {
  709. struct vdev_mlme_obj *vdev_mlme;
  710. /* This API is invoked with lock acquired, do not add log prints */
  711. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  712. if (!vdev_mlme)
  713. return QDF_STATUS_E_FAILURE;
  714. if (vdev_mlme->mgmt.generic.ssid_len > 0) {
  715. *ssid_len = vdev_mlme->mgmt.generic.ssid_len;
  716. qdf_mem_copy(ssid, vdev_mlme->mgmt.generic.ssid, *ssid_len);
  717. } else {
  718. *ssid_len = 0;
  719. return QDF_STATUS_E_FAILURE;
  720. }
  721. return QDF_STATUS_SUCCESS;
  722. }
  723. /**
  724. * wlan_vdev_mlme_set_nss() - set NSS
  725. * @vdev: VDEV object
  726. * @nss: nss configured by user
  727. *
  728. * API to set the Number of Spatial streams
  729. *
  730. * Return: void
  731. */
  732. static inline void wlan_vdev_mlme_set_nss(
  733. struct wlan_objmgr_vdev *vdev,
  734. uint8_t nss)
  735. {
  736. struct vdev_mlme_obj *vdev_mlme;
  737. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  738. if (!vdev_mlme)
  739. return;
  740. vdev_mlme->proto.generic.nss = nss;
  741. }
  742. /**
  743. * wlan_vdev_mlme_get_nss() - get NSS
  744. * @vdev: VDEV object
  745. *
  746. * API to get the Number of Spatial Streams
  747. *
  748. * Return:
  749. * @nss: nss value
  750. */
  751. static inline uint8_t wlan_vdev_mlme_get_nss(
  752. struct wlan_objmgr_vdev *vdev)
  753. {
  754. struct vdev_mlme_obj *vdev_mlme;
  755. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  756. if (!vdev_mlme)
  757. return 0;
  758. return vdev_mlme->proto.generic.nss;
  759. }
  760. /**
  761. * wlan_vdev_mlme_set_txchainmask() - set Tx chainmask
  762. * @vdev: VDEV object
  763. * @chainmask : chainmask either configured by user or max supported
  764. *
  765. * API to set the Tx chainmask
  766. *
  767. * Return: void
  768. */
  769. static inline void wlan_vdev_mlme_set_txchainmask(
  770. struct wlan_objmgr_vdev *vdev,
  771. uint8_t chainmask)
  772. {
  773. struct vdev_mlme_obj *vdev_mlme;
  774. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  775. if (!vdev_mlme)
  776. return;
  777. vdev_mlme->mgmt.chainmask_info.tx_chainmask = chainmask;
  778. }
  779. /**
  780. * wlan_vdev_mlme_get_txchainmask() - get Tx chainmask
  781. * @vdev: VDEV object
  782. *
  783. * API to get the Tx chainmask
  784. *
  785. * Return:
  786. * @chainmask : Tx chainmask either configured by user or max supported
  787. */
  788. static inline uint8_t wlan_vdev_mlme_get_txchainmask(
  789. struct wlan_objmgr_vdev *vdev)
  790. {
  791. struct vdev_mlme_obj *vdev_mlme;
  792. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  793. if (!vdev_mlme)
  794. return 0;
  795. return vdev_mlme->mgmt.chainmask_info.tx_chainmask;
  796. }
  797. /**
  798. * wlan_vdev_mlme_set_rxchainmask() - set Rx chainmask
  799. * @vdev: VDEV object
  800. * @chainmask : Rx chainmask either configured by user or max supported
  801. *
  802. * API to set the Rx chainmask
  803. *
  804. * Return: void
  805. */
  806. static inline void wlan_vdev_mlme_set_rxchainmask(
  807. struct wlan_objmgr_vdev *vdev,
  808. uint8_t chainmask)
  809. {
  810. struct vdev_mlme_obj *vdev_mlme;
  811. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  812. if (!vdev_mlme)
  813. return;
  814. vdev_mlme->mgmt.chainmask_info.rx_chainmask = chainmask;
  815. }
  816. /**
  817. * wlan_vdev_mlme_get_rxchainmask() - get Rx chainmask
  818. * @vdev: VDEV object
  819. *
  820. * API to get the Rx chainmask
  821. *
  822. * Return:
  823. * @chainmask : Rx chainmask either configured by user or max supported
  824. */
  825. static inline uint8_t wlan_vdev_mlme_get_rxchainmask(
  826. struct wlan_objmgr_vdev *vdev)
  827. {
  828. struct vdev_mlme_obj *vdev_mlme;
  829. /* This API is invoked with lock acquired, do not add log prints */
  830. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  831. if (!vdev_mlme)
  832. return 0;
  833. return vdev_mlme->mgmt.chainmask_info.rx_chainmask;
  834. }
  835. /**
  836. * wlan_vdev_mlme_set_txpower() - set tx power
  837. * @vdev: VDEV object
  838. * @txpow: tx power either configured by used or max allowed
  839. *
  840. * API to set the tx power
  841. *
  842. * Return: void
  843. */
  844. static inline void wlan_vdev_mlme_set_txpower(
  845. struct wlan_objmgr_vdev *vdev,
  846. uint8_t txpow)
  847. {
  848. struct vdev_mlme_obj *vdev_mlme;
  849. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  850. if (!vdev_mlme)
  851. return;
  852. vdev_mlme->mgmt.generic.tx_power = txpow;
  853. }
  854. /**
  855. * wlan_vdev_mlme_get_txpower() - get tx power
  856. * @vdev: VDEV object
  857. *
  858. * API to get the tx power
  859. *
  860. * Return:
  861. * @txpow: tx power either configured by used or max allowed
  862. */
  863. static inline uint8_t wlan_vdev_mlme_get_txpower(
  864. struct wlan_objmgr_vdev *vdev)
  865. {
  866. struct vdev_mlme_obj *vdev_mlme;
  867. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  868. if (!vdev_mlme)
  869. return 0;
  870. return vdev_mlme->mgmt.generic.tx_power;
  871. }
  872. /**
  873. * wlan_vdev_mlme_set_maxrate() - set max rate
  874. * @vdev: VDEV object
  875. * @maxrate: configured by used or based on configured mode
  876. *
  877. * API to set the max rate the vdev supports
  878. *
  879. * Return: void
  880. */
  881. static inline void wlan_vdev_mlme_set_maxrate(
  882. struct wlan_objmgr_vdev *vdev,
  883. uint32_t maxrate)
  884. {
  885. struct vdev_mlme_obj *vdev_mlme;
  886. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  887. if (!vdev_mlme)
  888. return;
  889. vdev_mlme->mgmt.rate_info.max_rate = maxrate;
  890. }
  891. /**
  892. * wlan_vdev_mlme_get_maxrate() - get max rate
  893. * @vdev: VDEV object
  894. *
  895. * API to get the max rate the vdev supports
  896. *
  897. * Return:
  898. * @maxrate: configured by used or based on configured mode
  899. */
  900. static inline uint32_t wlan_vdev_mlme_get_maxrate(
  901. struct wlan_objmgr_vdev *vdev)
  902. {
  903. struct vdev_mlme_obj *vdev_mlme;
  904. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  905. if (!vdev_mlme)
  906. return 0;
  907. return vdev_mlme->mgmt.rate_info.max_rate;
  908. }
  909. /**
  910. * wlan_vdev_mlme_set_txmgmtrate() - set txmgmtrate
  911. * @vdev: VDEV object
  912. * @txmgmtrate: Tx Mgmt rate
  913. *
  914. * API to set Mgmt Tx rate
  915. *
  916. * Return: void
  917. */
  918. static inline void wlan_vdev_mlme_set_txmgmtrate(
  919. struct wlan_objmgr_vdev *vdev,
  920. uint32_t txmgmtrate)
  921. {
  922. struct vdev_mlme_obj *vdev_mlme;
  923. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  924. if (!vdev_mlme)
  925. return;
  926. vdev_mlme->mgmt.rate_info.tx_mgmt_rate = txmgmtrate;
  927. }
  928. /**
  929. * wlan_vdev_mlme_get_txmgmtrate() - get txmgmtrate
  930. * @vdev: VDEV object
  931. *
  932. * API to get Mgmt Tx rate
  933. *
  934. * Return:
  935. * @txmgmtrate: Tx Mgmt rate
  936. */
  937. static inline uint32_t wlan_vdev_mlme_get_txmgmtrate(
  938. struct wlan_objmgr_vdev *vdev)
  939. {
  940. struct vdev_mlme_obj *vdev_mlme;
  941. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  942. if (!vdev_mlme)
  943. return 0;
  944. return vdev_mlme->mgmt.rate_info.tx_mgmt_rate;
  945. }
  946. /**
  947. * wlan_vdev_mlme_is_special_vdev() - check given vdev is a special vdev
  948. * @vdev: VDEV object
  949. *
  950. * API to check given vdev is a special vdev.
  951. *
  952. * Return: true if given vdev is special vdev, else false
  953. */
  954. static inline bool wlan_vdev_mlme_is_special_vdev(
  955. struct wlan_objmgr_vdev *vdev)
  956. {
  957. struct vdev_mlme_obj *vdev_mlme;
  958. if (!vdev)
  959. return false;
  960. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  961. if (!vdev_mlme)
  962. return false;
  963. return vdev_mlme->mgmt.generic.special_vdev_mode;
  964. }
  965. #ifdef WLAN_FEATURE_11AX
  966. /**
  967. * wlan_vdev_mlme_set_he_mcs_12_13_map() - set he mcs12/13 map
  968. * @vdev: VDEV object
  969. * @he_mcs_12_13_map: he mcs12/13 map from self&peer
  970. *
  971. * API to set he mcs 12/13 map
  972. *
  973. * Return: void
  974. */
  975. static inline void wlan_vdev_mlme_set_he_mcs_12_13_map(
  976. struct wlan_objmgr_vdev *vdev,
  977. uint16_t he_mcs_12_13_map)
  978. {
  979. struct vdev_mlme_obj *vdev_mlme;
  980. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  981. if (!vdev_mlme)
  982. return;
  983. vdev_mlme->mgmt.sta.he_mcs_12_13_map = he_mcs_12_13_map;
  984. }
  985. /**
  986. * wlan_vdev_mlme_get_he_mcs_12_13_map() - get he mcs12/13 map
  987. * @vdev: VDEV object
  988. *
  989. * API to get he mcs12/13 support capability
  990. *
  991. * Return:
  992. * @he_mcs_12_13_map: he mcs12/13 map
  993. */
  994. static inline uint16_t wlan_vdev_mlme_get_he_mcs_12_13_map(
  995. struct wlan_objmgr_vdev *vdev)
  996. {
  997. struct vdev_mlme_obj *vdev_mlme;
  998. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  999. if (!vdev_mlme)
  1000. return 0;
  1001. return vdev_mlme->mgmt.sta.he_mcs_12_13_map;
  1002. }
  1003. #else
  1004. static inline void wlan_vdev_mlme_set_he_mcs_12_13_map(
  1005. struct wlan_objmgr_vdev *vdev,
  1006. uint16_t he_mcs_12_13_map)
  1007. {
  1008. }
  1009. static inline uint16_t wlan_vdev_mlme_get_he_mcs_12_13_map(
  1010. struct wlan_objmgr_vdev *vdev)
  1011. {
  1012. return 0;
  1013. }
  1014. #endif
  1015. #endif