wlan_vdev_mlme.h 35 KB

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