wlan_vdev_mlme.h 35 KB

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