wlan_vdev_mlme.h 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165
  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. */
  461. struct vdev_mlme_mbss_11ax {
  462. uint32_t profile_idx;
  463. uint32_t profile_num;
  464. uint32_t mbssid_flags;
  465. uint8_t vdevid_trans;
  466. unsigned long vdev_bmap;
  467. bool is_cmn_param;
  468. uint8_t trans_bssid[QDF_MAC_ADDR_SIZE];
  469. };
  470. /**
  471. * struct vdev_mlme_mgmt - vdev mlme mgmt related cfg
  472. * @generic: generic mgmt information
  473. * @ap: ap specific mgmt information
  474. * @sta: sta specific mgmt information
  475. * @inactivity_params: inactivity parameters
  476. * @rate_info: bandwidth rate information
  477. * @chainmask_info: Chainmask information
  478. * @powersave_info: Power save parameters
  479. * @beacon_info: beacon buffer information
  480. * @mbss_11ax: MBSS 11ax information
  481. */
  482. struct vdev_mlme_mgmt {
  483. struct vdev_mlme_mgmt_generic generic;
  484. struct vdev_mlme_mgmt_ap ap;
  485. struct vdev_mlme_mgmt_sta sta;
  486. struct vdev_mlme_inactivity_params inactivity_params;
  487. struct vdev_mlme_rate_info rate_info;
  488. struct vdev_mlme_chainmask_info chainmask_info;
  489. struct vdev_mlme_powersave_info powersave_info;
  490. struct vdev_mlme_beacon_info beacon_info;
  491. struct vdev_mlme_mbss_11ax mbss_11ax;
  492. };
  493. /**
  494. * enum beacon_update_op - Beacon update op type
  495. * @BEACON_INIT: Initialize beacon
  496. * @BEACON_REINIT: Re-initialize beacon
  497. * @BEACON_UPDATE: Update dynamic fields of beacon
  498. * @BEACON_CSA: Enable CSA IE
  499. * @BEACON_FREE: Beacon buffer free
  500. */
  501. enum beacon_update_op {
  502. BEACON_INIT,
  503. BEACON_REINIT,
  504. BEACON_UPDATE,
  505. BEACON_CSA,
  506. BEACON_FREE,
  507. };
  508. /**
  509. * enum vdev_cmd_type - Command type
  510. * @START_REQ: Start request
  511. * @RESTART_REQ: Restart request
  512. * @STOP_REQ: STOP request
  513. * @DELETE_REQ: DELETE request
  514. */
  515. enum vdev_cmd_type {
  516. START_REQ,
  517. RESTART_REQ,
  518. STOP_REQ,
  519. DELETE_REQ,
  520. };
  521. /**
  522. * enum vdev_start_resp_type - start respone type
  523. * @START_RESPONSE: Start response
  524. * @RESTART_RESPONSE: Restart response
  525. */
  526. enum vdev_start_resp_type {
  527. START_RESPONSE = 0,
  528. RESTART_RESPONSE,
  529. };
  530. /**
  531. * struct vdev_mlme_ops - VDEV MLME operation callbacks structure
  532. * @mlme_vdev_validate_basic_params: callback to validate VDEV basic params
  533. * @mlme_vdev_reset_proto_params: callback to Reset protocol params
  534. * @mlme_vdev_start_send: callback to initiate actions of VDEV
  535. * MLME start operation
  536. * @mlme_vdev_restart_send: callback to initiate actions of VDEV
  537. * MLME restart operation
  538. * @mlme_vdev_stop_start_send: callback to block start/restart VDEV
  539. * request command
  540. * @mlme_vdev_start_continue: callback to initiate operations on
  541. * LMAC/FW start response
  542. * @mlme_vdev_sta_conn_start: callback to initiate STA connection
  543. * @mlme_vdev_up_send: callback to initiate actions of VDEV
  544. * MLME up operation
  545. * @mlme_vdev_notify_up_complete: callback to notify VDEV MLME on moving
  546. * to UP state
  547. * @mlme_vdev_notify_roam_start: callback to initiate roaming
  548. * @mlme_vdev_update_beacon: callback to initiate beacon update
  549. * @mlme_vdev_disconnect_peers: callback to initiate disconnection of
  550. * peers
  551. * @mlme_vdev_dfs_cac_timer_stop: callback to stop the DFS CAC timer
  552. * @mlme_vdev_stop_send: callback to initiate actions of VDEV
  553. * MLME stop operation
  554. * @mlme_vdev_stop_continue: callback to initiate operations on
  555. * LMAC/FW stop response
  556. * @mlme_vdev_bss_peer_delete_continue: callback to initiate operations on BSS
  557. * peer delete completion
  558. * @mlme_vdev_down_send: callback to initiate actions of VDEV
  559. * MLME down operation
  560. * @mlme_vdev_notify_start_state_exit: callback to notify on vdev start
  561. * start state exit
  562. * @mlme_vdev_is_newchan_no_cac: callback to check CAC is required
  563. * @mlme_vdev_ext_peer_delete_all_rsp: callback to initiate actions for
  564. * vdev mlme peer delete all response
  565. * @mlme_vdev_dfs_cac_wait_notify: callback to notify about CAC state
  566. * @mlme_vdev_csa_complete: callback to indicate CSA complete
  567. * @mlme_vdev_sta_disconn_start: callback to initiate STA disconnection
  568. */
  569. struct vdev_mlme_ops {
  570. QDF_STATUS (*mlme_vdev_validate_basic_params)(
  571. struct vdev_mlme_obj *vdev_mlme,
  572. uint16_t event_data_len, void *event_data);
  573. QDF_STATUS (*mlme_vdev_reset_proto_params)(
  574. struct vdev_mlme_obj *vdev_mlme,
  575. uint16_t event_data_len, void *event_data);
  576. QDF_STATUS (*mlme_vdev_start_send)(
  577. struct vdev_mlme_obj *vdev_mlme,
  578. uint16_t event_data_len, void *event_data);
  579. QDF_STATUS (*mlme_vdev_restart_send)(
  580. struct vdev_mlme_obj *vdev_mlme,
  581. uint16_t event_data_len, void *event_data);
  582. QDF_STATUS (*mlme_vdev_stop_start_send)(
  583. struct vdev_mlme_obj *vdev_mlme,
  584. enum vdev_cmd_type type,
  585. uint16_t event_data_len, void *event_data);
  586. QDF_STATUS (*mlme_vdev_start_continue)(
  587. struct vdev_mlme_obj *vdev_mlme,
  588. uint16_t event_data_len, void *event_data);
  589. QDF_STATUS (*mlme_vdev_sta_conn_start)(
  590. struct vdev_mlme_obj *vdev_mlme,
  591. uint16_t event_data_len, void *event_data);
  592. QDF_STATUS (*mlme_vdev_start_req_failed)(
  593. struct vdev_mlme_obj *vdev_mlme,
  594. uint16_t event_data_len, void *event_data);
  595. QDF_STATUS (*mlme_vdev_up_send)(
  596. struct vdev_mlme_obj *vdev_mlme,
  597. uint16_t event_data_len, void *event_data);
  598. QDF_STATUS (*mlme_vdev_notify_up_complete)(
  599. struct vdev_mlme_obj *vdev_mlme,
  600. uint16_t event_data_len, void *event_data);
  601. QDF_STATUS (*mlme_vdev_notify_roam_start)(
  602. struct vdev_mlme_obj *vdev_mlme,
  603. uint16_t event_data_len, void *event_data);
  604. QDF_STATUS (*mlme_vdev_update_beacon)(
  605. struct vdev_mlme_obj *vdev_mlme,
  606. enum beacon_update_op op,
  607. uint16_t event_data_len, void *event_data);
  608. QDF_STATUS (*mlme_vdev_disconnect_peers)(
  609. struct vdev_mlme_obj *vdev_mlme,
  610. uint16_t event_data_len, void *event_data);
  611. QDF_STATUS (*mlme_vdev_dfs_cac_timer_stop)(
  612. struct vdev_mlme_obj *vdev_mlme,
  613. uint16_t event_data_len, void *event_data);
  614. QDF_STATUS (*mlme_vdev_stop_send)(
  615. struct vdev_mlme_obj *vdev_mlme,
  616. uint16_t event_data_len, void *event_data);
  617. QDF_STATUS (*mlme_vdev_stop_continue)(
  618. struct vdev_mlme_obj *vdev_mlme,
  619. uint16_t event_data_len, void *event_data);
  620. QDF_STATUS (*mlme_vdev_down_send)(
  621. struct vdev_mlme_obj *vdev_mlme,
  622. uint16_t event_data_len, void *event_data);
  623. QDF_STATUS (*mlme_vdev_notify_down_complete)(
  624. struct vdev_mlme_obj *vdev_mlme,
  625. uint16_t event_data_len, void *event_data);
  626. QDF_STATUS (*mlme_vdev_ext_stop_rsp)(
  627. struct vdev_mlme_obj *vdev_mlme,
  628. struct vdev_stop_response *rsp);
  629. QDF_STATUS (*mlme_vdev_ext_start_rsp)(
  630. struct vdev_mlme_obj *vdev_mlme,
  631. struct vdev_start_response *rsp);
  632. QDF_STATUS (*mlme_vdev_notify_start_state_exit)(
  633. struct vdev_mlme_obj *vdev_mlme);
  634. QDF_STATUS (*mlme_vdev_is_newchan_no_cac)(
  635. struct vdev_mlme_obj *vdev_mlme);
  636. QDF_STATUS (*mlme_vdev_ext_peer_delete_all_rsp)(
  637. struct vdev_mlme_obj *vdev_mlme,
  638. struct peer_delete_all_response *rsp);
  639. QDF_STATUS (*mlme_vdev_dfs_cac_wait_notify)(
  640. struct vdev_mlme_obj *vdev_mlme);
  641. QDF_STATUS (*mlme_vdev_csa_complete)(
  642. struct vdev_mlme_obj *vdev_mlme);
  643. QDF_STATUS (*mlme_vdev_sta_disconn_start)(
  644. struct vdev_mlme_obj *vdev_mlme,
  645. uint16_t event_data_len, void *event_data);
  646. };
  647. /**
  648. * struct vdev_mlme_obj - VDEV MLME component object
  649. * @proto: VDEV MLME proto substructure
  650. * @mgmt: VDEV MLME mgmt substructure
  651. * @sm_lock: VDEV SM lock
  652. * @vdev_cmd_lock: VDEV MLME command atomicity
  653. * @sm_hdl: VDEV SM handle
  654. * @cnx_mgr_ctx: connection manager context, valid for STA and P2P-CLI mode only
  655. * @vdev: Pointer to vdev objmgr
  656. * @ops: VDEV MLME callback table
  657. * @ext_vdev_ptr: VDEV MLME legacy pointer
  658. * @reg_tpc_obj: Regulatory transmit power info
  659. * @vdev_rt: VDEV response timer
  660. * @vdev_wakelock: vdev wakelock sub structure
  661. */
  662. struct vdev_mlme_obj {
  663. struct vdev_mlme_proto proto;
  664. struct vdev_mlme_mgmt mgmt;
  665. #ifdef VDEV_SM_LOCK_SUPPORT
  666. qdf_spinlock_t sm_lock;
  667. qdf_mutex_t vdev_cmd_lock;
  668. #endif
  669. struct wlan_sm *sm_hdl;
  670. union {
  671. struct cnx_mgr *cnx_mgr_ctx;
  672. };
  673. struct wlan_objmgr_vdev *vdev;
  674. struct vdev_mlme_ops *ops;
  675. mlme_vdev_ext_t *ext_vdev_ptr;
  676. struct reg_tpc_power_info reg_tpc_obj;
  677. };
  678. /**
  679. * wlan_vdev_mlme_set_ssid() - set ssid
  680. * @vdev: VDEV object
  681. * @ssid: SSID (input)
  682. * @ssid_len: Length of SSID
  683. *
  684. * API to set the SSID of VDEV
  685. *
  686. * Caller need to acquire lock with wlan_vdev_obj_lock()
  687. *
  688. * Return: SUCCESS, if update is done
  689. * FAILURE, if ssid length is > max ssid len
  690. */
  691. static inline QDF_STATUS wlan_vdev_mlme_set_ssid(
  692. struct wlan_objmgr_vdev *vdev,
  693. const uint8_t *ssid, uint8_t ssid_len)
  694. {
  695. struct vdev_mlme_obj *vdev_mlme;
  696. /* This API is invoked with lock acquired, do not add log prints */
  697. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  698. if (!vdev_mlme)
  699. return QDF_STATUS_E_FAILURE;
  700. if (ssid_len <= WLAN_SSID_MAX_LEN) {
  701. qdf_mem_copy(vdev_mlme->mgmt.generic.ssid, ssid, ssid_len);
  702. vdev_mlme->mgmt.generic.ssid_len = ssid_len;
  703. } else {
  704. vdev_mlme->mgmt.generic.ssid_len = 0;
  705. return QDF_STATUS_E_FAILURE;
  706. }
  707. return QDF_STATUS_SUCCESS;
  708. }
  709. /**
  710. * wlan_vdev_mlme_get_ssid() - get ssid
  711. * @vdev: VDEV object
  712. * @ssid: SSID
  713. * @ssid_len: Length of SSID
  714. *
  715. * API to get the SSID of VDEV, it updates the SSID and its length
  716. * in @ssid, @ssid_len respectively
  717. *
  718. * Caller need to acquire lock with wlan_vdev_obj_lock()
  719. *
  720. * Return: SUCCESS, if update is done
  721. * FAILURE, if ssid length is > max ssid len
  722. */
  723. static inline QDF_STATUS wlan_vdev_mlme_get_ssid(
  724. struct wlan_objmgr_vdev *vdev,
  725. uint8_t *ssid, uint8_t *ssid_len)
  726. {
  727. struct vdev_mlme_obj *vdev_mlme;
  728. /* This API is invoked with lock acquired, do not add log prints */
  729. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  730. if (!vdev_mlme)
  731. return QDF_STATUS_E_FAILURE;
  732. if (vdev_mlme->mgmt.generic.ssid_len > 0) {
  733. *ssid_len = vdev_mlme->mgmt.generic.ssid_len;
  734. qdf_mem_copy(ssid, vdev_mlme->mgmt.generic.ssid, *ssid_len);
  735. } else {
  736. *ssid_len = 0;
  737. return QDF_STATUS_E_FAILURE;
  738. }
  739. return QDF_STATUS_SUCCESS;
  740. }
  741. /**
  742. * wlan_vdev_mlme_set_nss() - set NSS
  743. * @vdev: VDEV object
  744. * @nss: nss configured by user
  745. *
  746. * API to set the Number of Spatial streams
  747. *
  748. * Return: void
  749. */
  750. static inline void wlan_vdev_mlme_set_nss(
  751. struct wlan_objmgr_vdev *vdev,
  752. uint8_t nss)
  753. {
  754. struct vdev_mlme_obj *vdev_mlme;
  755. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  756. if (!vdev_mlme)
  757. return;
  758. vdev_mlme->proto.generic.nss = nss;
  759. }
  760. /**
  761. * wlan_vdev_mlme_get_nss() - get NSS
  762. * @vdev: VDEV object
  763. *
  764. * API to get the Number of Spatial Streams
  765. *
  766. * Return:
  767. * @nss: nss value
  768. */
  769. static inline uint8_t wlan_vdev_mlme_get_nss(
  770. struct wlan_objmgr_vdev *vdev)
  771. {
  772. struct vdev_mlme_obj *vdev_mlme;
  773. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  774. if (!vdev_mlme)
  775. return 0;
  776. return vdev_mlme->proto.generic.nss;
  777. }
  778. /**
  779. * wlan_vdev_mlme_set_txchainmask() - set Tx chainmask
  780. * @vdev: VDEV object
  781. * @chainmask : chainmask either configured by user or max supported
  782. *
  783. * API to set the Tx chainmask
  784. *
  785. * Return: void
  786. */
  787. static inline void wlan_vdev_mlme_set_txchainmask(
  788. struct wlan_objmgr_vdev *vdev,
  789. uint8_t chainmask)
  790. {
  791. struct vdev_mlme_obj *vdev_mlme;
  792. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  793. if (!vdev_mlme)
  794. return;
  795. vdev_mlme->mgmt.chainmask_info.tx_chainmask = chainmask;
  796. }
  797. /**
  798. * wlan_vdev_mlme_get_txchainmask() - get Tx chainmask
  799. * @vdev: VDEV object
  800. *
  801. * API to get the Tx chainmask
  802. *
  803. * Return:
  804. * @chainmask : Tx chainmask either configured by user or max supported
  805. */
  806. static inline uint8_t wlan_vdev_mlme_get_txchainmask(
  807. struct wlan_objmgr_vdev *vdev)
  808. {
  809. struct vdev_mlme_obj *vdev_mlme;
  810. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  811. if (!vdev_mlme)
  812. return 0;
  813. return vdev_mlme->mgmt.chainmask_info.tx_chainmask;
  814. }
  815. /**
  816. * wlan_vdev_mlme_set_rxchainmask() - set Rx chainmask
  817. * @vdev: VDEV object
  818. * @chainmask : Rx chainmask either configured by user or max supported
  819. *
  820. * API to set the Rx chainmask
  821. *
  822. * Return: void
  823. */
  824. static inline void wlan_vdev_mlme_set_rxchainmask(
  825. struct wlan_objmgr_vdev *vdev,
  826. uint8_t chainmask)
  827. {
  828. struct vdev_mlme_obj *vdev_mlme;
  829. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  830. if (!vdev_mlme)
  831. return;
  832. vdev_mlme->mgmt.chainmask_info.rx_chainmask = chainmask;
  833. }
  834. /**
  835. * wlan_vdev_mlme_get_rxchainmask() - get Rx chainmask
  836. * @vdev: VDEV object
  837. *
  838. * API to get the Rx chainmask
  839. *
  840. * Return:
  841. * @chainmask : Rx chainmask either configured by user or max supported
  842. */
  843. static inline uint8_t wlan_vdev_mlme_get_rxchainmask(
  844. struct wlan_objmgr_vdev *vdev)
  845. {
  846. struct vdev_mlme_obj *vdev_mlme;
  847. /* This API is invoked with lock acquired, do not add log prints */
  848. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  849. if (!vdev_mlme)
  850. return 0;
  851. return vdev_mlme->mgmt.chainmask_info.rx_chainmask;
  852. }
  853. /**
  854. * wlan_vdev_mlme_set_txpower() - set tx power
  855. * @vdev: VDEV object
  856. * @txpow: tx power either configured by used or max allowed
  857. *
  858. * API to set the tx power
  859. *
  860. * Return: void
  861. */
  862. static inline void wlan_vdev_mlme_set_txpower(
  863. struct wlan_objmgr_vdev *vdev,
  864. uint8_t txpow)
  865. {
  866. struct vdev_mlme_obj *vdev_mlme;
  867. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  868. if (!vdev_mlme)
  869. return;
  870. vdev_mlme->mgmt.generic.tx_power = txpow;
  871. }
  872. /**
  873. * wlan_vdev_mlme_get_txpower() - get tx power
  874. * @vdev: VDEV object
  875. *
  876. * API to get the tx power
  877. *
  878. * Return:
  879. * @txpow: tx power either configured by used or max allowed
  880. */
  881. static inline uint8_t wlan_vdev_mlme_get_txpower(
  882. struct wlan_objmgr_vdev *vdev)
  883. {
  884. struct vdev_mlme_obj *vdev_mlme;
  885. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  886. if (!vdev_mlme)
  887. return 0;
  888. return vdev_mlme->mgmt.generic.tx_power;
  889. }
  890. /**
  891. * wlan_vdev_mlme_set_maxrate() - set max rate
  892. * @vdev: VDEV object
  893. * @maxrate: configured by used or based on configured mode
  894. *
  895. * API to set the max rate the vdev supports
  896. *
  897. * Return: void
  898. */
  899. static inline void wlan_vdev_mlme_set_maxrate(
  900. struct wlan_objmgr_vdev *vdev,
  901. uint32_t maxrate)
  902. {
  903. struct vdev_mlme_obj *vdev_mlme;
  904. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  905. if (!vdev_mlme)
  906. return;
  907. vdev_mlme->mgmt.rate_info.max_rate = maxrate;
  908. }
  909. /**
  910. * wlan_vdev_mlme_get_maxrate() - get max rate
  911. * @vdev: VDEV object
  912. *
  913. * API to get the max rate the vdev supports
  914. *
  915. * Return:
  916. * @maxrate: configured by used or based on configured mode
  917. */
  918. static inline uint32_t wlan_vdev_mlme_get_maxrate(
  919. struct wlan_objmgr_vdev *vdev)
  920. {
  921. struct vdev_mlme_obj *vdev_mlme;
  922. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  923. if (!vdev_mlme)
  924. return 0;
  925. return vdev_mlme->mgmt.rate_info.max_rate;
  926. }
  927. /**
  928. * wlan_vdev_mlme_set_txmgmtrate() - set txmgmtrate
  929. * @vdev: VDEV object
  930. * @txmgmtrate: Tx Mgmt rate
  931. *
  932. * API to set Mgmt Tx rate
  933. *
  934. * Return: void
  935. */
  936. static inline void wlan_vdev_mlme_set_txmgmtrate(
  937. struct wlan_objmgr_vdev *vdev,
  938. uint32_t txmgmtrate)
  939. {
  940. struct vdev_mlme_obj *vdev_mlme;
  941. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  942. if (!vdev_mlme)
  943. return;
  944. vdev_mlme->mgmt.rate_info.tx_mgmt_rate = txmgmtrate;
  945. }
  946. /**
  947. * wlan_vdev_mlme_get_txmgmtrate() - get txmgmtrate
  948. * @vdev: VDEV object
  949. *
  950. * API to get Mgmt Tx rate
  951. *
  952. * Return:
  953. * @txmgmtrate: Tx Mgmt rate
  954. */
  955. static inline uint32_t wlan_vdev_mlme_get_txmgmtrate(
  956. struct wlan_objmgr_vdev *vdev)
  957. {
  958. struct vdev_mlme_obj *vdev_mlme;
  959. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  960. if (!vdev_mlme)
  961. return 0;
  962. return vdev_mlme->mgmt.rate_info.tx_mgmt_rate;
  963. }
  964. /**
  965. * wlan_vdev_mlme_is_special_vdev() - check given vdev is a special vdev
  966. * @vdev: VDEV object
  967. *
  968. * API to check given vdev is a special vdev.
  969. *
  970. * Return: true if given vdev is special vdev, else false
  971. */
  972. static inline bool wlan_vdev_mlme_is_special_vdev(
  973. struct wlan_objmgr_vdev *vdev)
  974. {
  975. struct vdev_mlme_obj *vdev_mlme;
  976. if (!vdev)
  977. return false;
  978. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  979. if (!vdev_mlme)
  980. return false;
  981. return vdev_mlme->mgmt.generic.special_vdev_mode;
  982. }
  983. #ifdef WLAN_FEATURE_11AX
  984. /**
  985. * wlan_vdev_mlme_set_he_mcs_12_13_map() - set he mcs12/13 map
  986. * @vdev: VDEV object
  987. * @he_mcs_12_13_map: he mcs12/13 map from self&peer
  988. *
  989. * API to set he mcs 12/13 map
  990. *
  991. * Return: void
  992. */
  993. static inline void wlan_vdev_mlme_set_he_mcs_12_13_map(
  994. struct wlan_objmgr_vdev *vdev,
  995. uint16_t he_mcs_12_13_map)
  996. {
  997. struct vdev_mlme_obj *vdev_mlme;
  998. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  999. if (!vdev_mlme)
  1000. return;
  1001. vdev_mlme->mgmt.sta.he_mcs_12_13_map = he_mcs_12_13_map;
  1002. }
  1003. /**
  1004. * wlan_vdev_mlme_get_he_mcs_12_13_map() - get he mcs12/13 map
  1005. * @vdev: VDEV object
  1006. *
  1007. * API to get he mcs12/13 support capability
  1008. *
  1009. * Return:
  1010. * @he_mcs_12_13_map: he mcs12/13 map
  1011. */
  1012. static inline uint16_t wlan_vdev_mlme_get_he_mcs_12_13_map(
  1013. struct wlan_objmgr_vdev *vdev)
  1014. {
  1015. struct vdev_mlme_obj *vdev_mlme;
  1016. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1017. if (!vdev_mlme)
  1018. return 0;
  1019. return vdev_mlme->mgmt.sta.he_mcs_12_13_map;
  1020. }
  1021. #else
  1022. static inline void wlan_vdev_mlme_set_he_mcs_12_13_map(
  1023. struct wlan_objmgr_vdev *vdev,
  1024. uint16_t he_mcs_12_13_map)
  1025. {
  1026. }
  1027. static inline uint16_t wlan_vdev_mlme_get_he_mcs_12_13_map(
  1028. struct wlan_objmgr_vdev *vdev)
  1029. {
  1030. return 0;
  1031. }
  1032. #endif
  1033. /**
  1034. * wlan_vdev_mlme_set_aid_mgr() - set aid mgr
  1035. * @vdev: VDEV object
  1036. * @aid_mgr: AID mgr
  1037. *
  1038. * API to set AID mgr in VDEV MLME cmpt object
  1039. *
  1040. * Return: void
  1041. */
  1042. static inline void wlan_vdev_mlme_set_aid_mgr(
  1043. struct wlan_objmgr_vdev *vdev,
  1044. struct wlan_vdev_aid_mgr *aid_mgr)
  1045. {
  1046. struct vdev_mlme_obj *vdev_mlme;
  1047. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1048. if (!vdev_mlme)
  1049. return;
  1050. vdev_mlme->mgmt.ap.aid_mgr = aid_mgr;
  1051. }
  1052. /**
  1053. * wlan_vdev_mlme_get_aid_mgr() - get aid mgr
  1054. * @vdev: VDEV object
  1055. *
  1056. * API to get AID mgr in VDEV MLME cmpt object
  1057. *
  1058. * Return: aid_mgr
  1059. */
  1060. static inline struct wlan_vdev_aid_mgr *wlan_vdev_mlme_get_aid_mgr(
  1061. struct wlan_objmgr_vdev *vdev)
  1062. {
  1063. struct vdev_mlme_obj *vdev_mlme;
  1064. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1065. if (!vdev_mlme)
  1066. return NULL;
  1067. return vdev_mlme->mgmt.ap.aid_mgr;
  1068. }
  1069. #endif