wlan_vdev_mlme.h 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222
  1. /*
  2. * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 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_epcspriaccess_support : EPCS 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_epcspriaccess_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. eht_phycap_tb_sounding_feedback_rl :1;
  247. uint32_t eht_phycap_rx1024qamwiderbwdlofdma :1,
  248. eht_phycap_rx4096qamwiderbwdlofdma :1;
  249. };
  250. /**
  251. * struct vdev_mlme_eht_ops_info - vdev mlme EHTOPS information
  252. * @eht_ops: eht ops
  253. */
  254. struct vdev_mlme_eht_ops_info {
  255. uint32_t eht_ops;
  256. };
  257. #endif
  258. /**
  259. * struct vdev_mlme_he_ops_info - vdev protocol structure holding information
  260. * that is used in frames
  261. * @generic: generic protocol information
  262. * @ap: ap specific protocol information
  263. * @sta: sta specific protocol information
  264. * @vht_info: vht information
  265. * @ht_info: ht capabilities information
  266. * @he_ops_info: he ops information
  267. * @eht_cap_info: EHT capability information
  268. * @eht_ops_info: EHT operation information
  269. * @bss_color: 11ax HE BSS Color information
  270. */
  271. struct vdev_mlme_proto {
  272. struct vdev_mlme_proto_generic generic;
  273. struct vdev_mlme_proto_ap ap;
  274. struct vdev_mlme_proto_sta sta;
  275. struct vdev_mlme_vht_info vht_info;
  276. struct vdev_mlme_ht_info ht_info;
  277. struct vdev_mlme_he_ops_info he_ops_info;
  278. #ifdef WLAN_FEATURE_11BE
  279. struct vdev_mlme_eht_caps_info eht_cap_info;
  280. struct vdev_mlme_eht_ops_info eht_ops_info;
  281. #endif
  282. struct vdev_mlme_proto_bss_color bss_color;
  283. };
  284. /**
  285. * struct vdev_mlme_mgmt_generic - generic vdev mlme mgmt cfg
  286. * @rts_threshold: RTS threshold
  287. * @frag_threshold: Fragmentation threshold
  288. * @probe_delay: time in msec for delaying to send first probe request
  289. * @repeat_probe_time: probe request transmission time
  290. * @drop_unencry: drop unencrypted status
  291. * @ tx_pwrlimit: Tx power limit
  292. * @tx_power: Tx power
  293. * @minpower: Min power
  294. * @maxpower: Max power
  295. * @maxregpower: max regulatory power
  296. * @antennamax: max antenna
  297. * @reg_class_id: reg domain class id
  298. * @ampdu: ampdu limit
  299. * @amsdu: amsdu limit
  300. * @ssid: service set identifier
  301. * @ssid_len: ssid length
  302. * @type: vdev type
  303. * @sub_type: vdev subtype
  304. * @rx_decap_type: rx decap type
  305. * @tx_encap_type: tx encap type
  306. * @disable_hw_ack: disable ha ack flag
  307. * @bssid: bssid
  308. * @phy_mode: phy mode
  309. * @special_vdev_mode: indicates special vdev mode
  310. */
  311. struct vdev_mlme_mgmt_generic {
  312. uint32_t rts_threshold;
  313. uint32_t frag_threshold;
  314. uint32_t probe_delay;
  315. uint32_t repeat_probe_time;
  316. uint32_t drop_unencry;
  317. uint32_t tx_pwrlimit;
  318. uint8_t tx_power;
  319. uint8_t minpower;
  320. uint8_t maxpower;
  321. uint8_t maxregpower;
  322. uint8_t antennamax;
  323. uint8_t reg_class_id;
  324. uint8_t ampdu;
  325. uint8_t amsdu;
  326. char ssid[WLAN_SSID_MAX_LEN + 1];
  327. uint8_t ssid_len;
  328. uint8_t type;
  329. uint8_t subtype;
  330. uint8_t rx_decap_type;
  331. uint8_t tx_encap_type;
  332. bool disable_hw_ack;
  333. uint8_t bssid[QDF_MAC_ADDR_SIZE];
  334. uint32_t phy_mode;
  335. bool special_vdev_mode;
  336. };
  337. /*
  338. * struct wlan_vdev_aid_mgr – AID manager
  339. * @aid_bitmap: AID bitmap array
  340. * @start_aid: start of AID index
  341. * @max_aid: Max allowed AID
  342. * @ref_cnt: to share AID across VDEVs for MBSSID
  343. */
  344. struct wlan_vdev_aid_mgr {
  345. qdf_bitmap(aid_bitmap, WLAN_UMAC_MAX_AID);
  346. uint16_t start_aid;
  347. uint16_t max_aid;
  348. qdf_atomic_t ref_cnt;
  349. };
  350. /**
  351. * struct vdev_mlme_mgmt_ap - ap specific vdev mlme mgmt cfg
  352. * @hidden_ssid: flag to indicate whether it is hidden ssid
  353. * @cac_duration_ms: cac duration in millseconds
  354. * @aid_mgr: AID bitmap mgr
  355. * @max_chan_switch_time: Max channel switch time in milliseconds.
  356. * @last_bcn_ts_ms: Timestamp (in milliseconds) of the last beacon sent on the
  357. * CSA triggered channel.
  358. */
  359. struct vdev_mlme_mgmt_ap {
  360. bool hidden_ssid;
  361. uint32_t cac_duration_ms;
  362. struct wlan_vdev_aid_mgr *aid_mgr;
  363. uint32_t max_chan_switch_time;
  364. unsigned long last_bcn_ts_ms;
  365. };
  366. /**
  367. * struct vdev_mlme_mgmt_sta - sta specific vdev mlme mgmt cfg
  368. * @he_mcs_12_13_map: map to indicate mcs12/13 caps of peer&dut
  369. */
  370. struct vdev_mlme_mgmt_sta {
  371. uint16_t he_mcs_12_13_map;
  372. };
  373. /**
  374. * struct vdev_mlme_inactivity_params - vdev mlme inactivity parameters
  375. * @bmiss_first_bcnt: bmiss first time
  376. * @bmiss_final_bcnt: bmiss final time
  377. * @keepalive_min_idle_inactive_time_secs: min time AP consider STA to be
  378. * inactive
  379. * @keepalive_max_idle_inactive_time_secs: max inactive idle time for AP to send
  380. * data-null
  381. * @keepalive_max_unresponsive_time_secs: max time to send WMI_STA_KICKOUT
  382. */
  383. struct vdev_mlme_inactivity_params {
  384. uint32_t bmiss_first_bcnt;
  385. uint32_t bmiss_final_bcnt;
  386. uint32_t keepalive_min_idle_inactive_time_secs;
  387. uint32_t keepalive_max_idle_inactive_time_secs;
  388. uint32_t keepalive_max_unresponsive_time_secs;
  389. };
  390. /**
  391. * enum vdev_ratemask_type - ratemask phy type
  392. * @WLAN_VDEV_RATEMASK_TYPE_CCK: phy type CCK
  393. * @WLAN_VDEV_RATEMASK_TYPE_HT: phy type ht
  394. * @WLAN_VDEV_RATEMASK_TYPE_VHT: phy type vht
  395. * WLAN_VDEV_RATEMASK_TYPE_HE: phy type he
  396. */
  397. enum vdev_ratemask_type {
  398. WLAN_VDEV_RATEMASK_TYPE_CCK,
  399. WLAN_VDEV_RATEMASK_TYPE_HT,
  400. WLAN_VDEV_RATEMASK_TYPE_VHT,
  401. WLAN_VDEV_RATEMASK_TYPE_HE,
  402. WLAN_VDEV_RATEMASK_TYPE_MAX,
  403. };
  404. /**
  405. * struct vdev_ratemask_params - vdev ratemask parameters
  406. * @type: ratemask phy type
  407. * @lower32: ratemask lower32 bitmask
  408. * @higher32: ratemask higher32 bitmask
  409. * @lower32_2: ratemask lower32_2 bitmask
  410. * @higher32_2: rtaemask higher32_2 bitmask
  411. */
  412. struct vdev_ratemask_params {
  413. uint32_t lower32;
  414. uint32_t higher32;
  415. uint32_t lower32_2;
  416. uint32_t higher32_2;
  417. };
  418. /**
  419. * struct vdev_mlme_rate_info - vdev mlme rate information
  420. * @rate_flags: dynamic bandwidth info
  421. * @per_band_tx_mgmt_rate: per band Tx mgmt rate
  422. * @max_rate: max bandwidth rate
  423. * @tx_mgmt_rate: Tx Mgmt rate
  424. * @bcn_tx_rate: beacon Tx rate
  425. * @bcn_tx_rate_code: beacon Tx rate code
  426. * @ratemask_params: vdev ratemask params per phy type
  427. * @half_rate: Half rate
  428. * @quarter_rate: quarter rate
  429. */
  430. struct vdev_mlme_rate_info {
  431. uint32_t rate_flags;
  432. uint32_t per_band_tx_mgmt_rate;
  433. uint32_t max_rate;
  434. uint32_t tx_mgmt_rate;
  435. uint32_t bcn_tx_rate;
  436. #ifdef WLAN_BCN_RATECODE_ENABLE
  437. uint32_t bcn_tx_rate_code;
  438. #endif
  439. uint32_t rtscts_tx_rate;
  440. struct vdev_ratemask_params ratemask_params[
  441. WLAN_VDEV_RATEMASK_TYPE_MAX];
  442. bool half_rate;
  443. bool quarter_rate;
  444. };
  445. /**
  446. * struct vdev_mlme_chainmask_info - vdev mlme chainmask information
  447. * @tx_chainmask: Tx chainmask
  448. * @rx_chainmask: Rx Chainmask
  449. * @num_rx_chain: Num of bits set in Rx chain
  450. * @num_tx_chain: Num of bits set in Tx chain
  451. */
  452. struct vdev_mlme_chainmask_info {
  453. uint8_t tx_chainmask;
  454. uint8_t rx_chainmask;
  455. uint8_t num_rx_chain;
  456. uint8_t num_tx_chain;
  457. };
  458. /**
  459. * struct vdev_mlme_powersave_info - vdev mlme powersave information
  460. * @packet_powersave: packet powersave
  461. * @max_li_of_moddtim: max mod dtim
  462. * @dyndtim_cnt: dynamic dtim count
  463. * @listen_interval: listen interval
  464. * @moddtim_cnt: mod dtim count
  465. */
  466. struct vdev_mlme_powersave_info {
  467. uint32_t packet_powersave;
  468. uint32_t max_li_of_moddtim;
  469. uint32_t dyndtim_cnt;
  470. uint32_t listen_interval;
  471. uint32_t moddtim_cnt;
  472. };
  473. /**
  474. * struct vdev_mlme_beacon_info - vdev mlme beacon information
  475. * @beacon_buffer: buffer allocated for beacon frame
  476. * @beacon_offsets: beacon IE's offsets
  477. */
  478. struct vdev_mlme_beacon_info {
  479. qdf_nbuf_t beacon_buffer;
  480. void *beacon_offsets;
  481. };
  482. /**
  483. * struct vdev_mlme_mbss_11ax - mbss 11ax fields required for up cmd
  484. * @profile_idx: profile index of the connected non-trans ap (mbssid case).
  485. * 0 means invalid.
  486. * @profile_num: the total profile numbers of non-trans aps (mbssid
  487. * case).
  488. * 0 means non-MBSS AP.
  489. * @mbssid-flags: MBSS IE flags indicating vdev type
  490. * @vdevid_trans: id of transmitting vdev for MBSS IE
  491. * @vdev_bmap: vdev bitmap of VAPs in MBSS group
  492. * @is_cmn_param: flag to check mbss common param
  493. * @trans_bssid: bssid of transmitted AP (MBSS IE case)
  494. * @is_multi_mbssid: Flag to identify multi group mbssid support
  495. * @grp_id: Group id of current vdev
  496. */
  497. struct vdev_mlme_mbss_11ax {
  498. uint32_t profile_idx;
  499. uint32_t profile_num;
  500. uint32_t mbssid_flags;
  501. uint8_t vdevid_trans;
  502. unsigned long vdev_bmap;
  503. bool is_cmn_param;
  504. uint8_t trans_bssid[QDF_MAC_ADDR_SIZE];
  505. bool is_multi_mbssid;
  506. uint32_t grp_id;
  507. };
  508. /**
  509. * struct vdev_mlme_mgmt - vdev mlme mgmt related cfg
  510. * @generic: generic mgmt information
  511. * @ap: ap specific mgmt information
  512. * @sta: sta specific mgmt information
  513. * @inactivity_params: inactivity parameters
  514. * @rate_info: bandwidth rate information
  515. * @chainmask_info: Chainmask information
  516. * @powersave_info: Power save parameters
  517. * @beacon_info: beacon buffer information
  518. * @mbss_11ax: MBSS 11ax information
  519. */
  520. struct vdev_mlme_mgmt {
  521. struct vdev_mlme_mgmt_generic generic;
  522. struct vdev_mlme_mgmt_ap ap;
  523. struct vdev_mlme_mgmt_sta sta;
  524. struct vdev_mlme_inactivity_params inactivity_params;
  525. struct vdev_mlme_rate_info rate_info;
  526. struct vdev_mlme_chainmask_info chainmask_info;
  527. struct vdev_mlme_powersave_info powersave_info;
  528. struct vdev_mlme_beacon_info beacon_info;
  529. struct vdev_mlme_mbss_11ax mbss_11ax;
  530. };
  531. /**
  532. * enum beacon_update_op - Beacon update op type
  533. * @BEACON_INIT: Initialize beacon
  534. * @BEACON_REINIT: Re-initialize beacon
  535. * @BEACON_UPDATE: Update dynamic fields of beacon
  536. * @BEACON_CSA: Enable CSA IE
  537. * @BEACON_FREE: Beacon buffer free
  538. */
  539. enum beacon_update_op {
  540. BEACON_INIT,
  541. BEACON_REINIT,
  542. BEACON_UPDATE,
  543. BEACON_CSA,
  544. BEACON_FREE,
  545. };
  546. /**
  547. * enum vdev_cmd_type - Command type
  548. * @START_REQ: Start request
  549. * @RESTART_REQ: Restart request
  550. * @STOP_REQ: STOP request
  551. * @DELETE_REQ: DELETE request
  552. */
  553. enum vdev_cmd_type {
  554. START_REQ,
  555. RESTART_REQ,
  556. STOP_REQ,
  557. DELETE_REQ,
  558. };
  559. /**
  560. * enum vdev_start_resp_type - start respone type
  561. * @START_RESPONSE: Start response
  562. * @RESTART_RESPONSE: Restart response
  563. */
  564. enum vdev_start_resp_type {
  565. START_RESPONSE = 0,
  566. RESTART_RESPONSE,
  567. };
  568. /**
  569. * struct vdev_mlme_ops - VDEV MLME operation callbacks structure
  570. * @mlme_vdev_validate_basic_params: callback to validate VDEV basic params
  571. * @mlme_vdev_reset_proto_params: callback to Reset protocol params
  572. * @mlme_vdev_start_send: callback to initiate actions of VDEV
  573. * MLME start operation
  574. * @mlme_vdev_restart_send: callback to initiate actions of VDEV
  575. * MLME restart operation
  576. * @mlme_vdev_stop_start_send: callback to block start/restart VDEV
  577. * request command
  578. * @mlme_vdev_start_continue: callback to initiate operations on
  579. * LMAC/FW start response
  580. * @mlme_vdev_sta_conn_start: callback to initiate STA connection
  581. * @mlme_vdev_up_send: callback to initiate actions of VDEV
  582. * MLME up operation
  583. * @mlme_vdev_notify_up_complete: callback to notify VDEV MLME on moving
  584. * to UP state
  585. * @mlme_vdev_notify_roam_start: callback to initiate roaming
  586. * @mlme_vdev_update_beacon: callback to initiate beacon update
  587. * @mlme_vdev_disconnect_peers: callback to initiate disconnection of
  588. * peers
  589. * @mlme_vdev_dfs_cac_timer_stop: callback to stop the DFS CAC timer
  590. * @mlme_vdev_stop_send: callback to initiate actions of VDEV
  591. * MLME stop operation
  592. * @mlme_vdev_stop_continue: callback to initiate operations on
  593. * LMAC/FW stop response
  594. * @mlme_vdev_bss_peer_delete_continue: callback to initiate operations on BSS
  595. * peer delete completion
  596. * @mlme_vdev_down_send: callback to initiate actions of VDEV
  597. * MLME down operation
  598. * @mlme_vdev_notify_start_state_exit: callback to notify on vdev start
  599. * start state exit
  600. * @mlme_vdev_is_newchan_no_cac: callback to check CAC is required
  601. * @mlme_vdev_ext_peer_delete_all_rsp: callback to initiate actions for
  602. * vdev mlme peer delete all response
  603. * @mlme_vdev_dfs_cac_wait_notify: callback to notify about CAC state
  604. * @mlme_vdev_csa_complete: callback to indicate CSA complete
  605. * @mlme_vdev_sta_disconn_start: callback to initiate STA disconnection
  606. */
  607. struct vdev_mlme_ops {
  608. QDF_STATUS (*mlme_vdev_validate_basic_params)(
  609. struct vdev_mlme_obj *vdev_mlme,
  610. uint16_t event_data_len, void *event_data);
  611. QDF_STATUS (*mlme_vdev_reset_proto_params)(
  612. struct vdev_mlme_obj *vdev_mlme,
  613. uint16_t event_data_len, void *event_data);
  614. QDF_STATUS (*mlme_vdev_start_send)(
  615. struct vdev_mlme_obj *vdev_mlme,
  616. uint16_t event_data_len, void *event_data);
  617. QDF_STATUS (*mlme_vdev_restart_send)(
  618. struct vdev_mlme_obj *vdev_mlme,
  619. uint16_t event_data_len, void *event_data);
  620. QDF_STATUS (*mlme_vdev_stop_start_send)(
  621. struct vdev_mlme_obj *vdev_mlme,
  622. enum vdev_cmd_type type,
  623. uint16_t event_data_len, void *event_data);
  624. QDF_STATUS (*mlme_vdev_start_continue)(
  625. struct vdev_mlme_obj *vdev_mlme,
  626. uint16_t event_data_len, void *event_data);
  627. QDF_STATUS (*mlme_vdev_sta_conn_start)(
  628. struct vdev_mlme_obj *vdev_mlme,
  629. uint16_t event_data_len, void *event_data);
  630. QDF_STATUS (*mlme_vdev_start_req_failed)(
  631. struct vdev_mlme_obj *vdev_mlme,
  632. uint16_t event_data_len, void *event_data);
  633. QDF_STATUS (*mlme_vdev_up_send)(
  634. struct vdev_mlme_obj *vdev_mlme,
  635. uint16_t event_data_len, void *event_data);
  636. QDF_STATUS (*mlme_vdev_notify_up_complete)(
  637. struct vdev_mlme_obj *vdev_mlme,
  638. uint16_t event_data_len, void *event_data);
  639. QDF_STATUS (*mlme_vdev_notify_roam_start)(
  640. struct vdev_mlme_obj *vdev_mlme,
  641. uint16_t event_data_len, void *event_data);
  642. QDF_STATUS (*mlme_vdev_update_beacon)(
  643. struct vdev_mlme_obj *vdev_mlme,
  644. enum beacon_update_op op,
  645. uint16_t event_data_len, void *event_data);
  646. QDF_STATUS (*mlme_vdev_disconnect_peers)(
  647. struct vdev_mlme_obj *vdev_mlme,
  648. uint16_t event_data_len, void *event_data);
  649. QDF_STATUS (*mlme_vdev_dfs_cac_timer_stop)(
  650. struct vdev_mlme_obj *vdev_mlme,
  651. uint16_t event_data_len, void *event_data);
  652. QDF_STATUS (*mlme_vdev_stop_send)(
  653. struct vdev_mlme_obj *vdev_mlme,
  654. uint16_t event_data_len, void *event_data);
  655. QDF_STATUS (*mlme_vdev_stop_continue)(
  656. struct vdev_mlme_obj *vdev_mlme,
  657. uint16_t event_data_len, void *event_data);
  658. QDF_STATUS (*mlme_vdev_down_send)(
  659. struct vdev_mlme_obj *vdev_mlme,
  660. uint16_t event_data_len, void *event_data);
  661. QDF_STATUS (*mlme_vdev_notify_down_complete)(
  662. struct vdev_mlme_obj *vdev_mlme,
  663. uint16_t event_data_len, void *event_data);
  664. QDF_STATUS (*mlme_vdev_ext_stop_rsp)(
  665. struct vdev_mlme_obj *vdev_mlme,
  666. struct vdev_stop_response *rsp);
  667. QDF_STATUS (*mlme_vdev_ext_start_rsp)(
  668. struct vdev_mlme_obj *vdev_mlme,
  669. struct vdev_start_response *rsp);
  670. QDF_STATUS (*mlme_vdev_notify_start_state_exit)(
  671. struct vdev_mlme_obj *vdev_mlme);
  672. QDF_STATUS (*mlme_vdev_is_newchan_no_cac)(
  673. struct vdev_mlme_obj *vdev_mlme);
  674. QDF_STATUS (*mlme_vdev_ext_peer_delete_all_rsp)(
  675. struct vdev_mlme_obj *vdev_mlme,
  676. struct peer_delete_all_response *rsp);
  677. QDF_STATUS (*mlme_vdev_dfs_cac_wait_notify)(
  678. struct vdev_mlme_obj *vdev_mlme);
  679. QDF_STATUS (*mlme_vdev_csa_complete)(
  680. struct vdev_mlme_obj *vdev_mlme);
  681. QDF_STATUS (*mlme_vdev_sta_disconn_start)(
  682. struct vdev_mlme_obj *vdev_mlme,
  683. uint16_t event_data_len, void *event_data);
  684. };
  685. /**
  686. * struct vdev_mlme_obj - VDEV MLME component object
  687. * @proto: VDEV MLME proto substructure
  688. * @mgmt: VDEV MLME mgmt substructure
  689. * @sm_lock: VDEV SM lock
  690. * @vdev_cmd_lock: VDEV MLME command atomicity
  691. * @sm_hdl: VDEV SM handle
  692. * @cnx_mgr_ctx: connection manager context, valid for STA and P2P-CLI mode only
  693. * @vdev: Pointer to vdev objmgr
  694. * @ops: VDEV MLME callback table
  695. * @ext_vdev_ptr: VDEV MLME legacy pointer
  696. * @reg_tpc_obj: Regulatory transmit power info
  697. * @vdev_rt: VDEV response timer
  698. * @vdev_wakelock: vdev wakelock sub structure
  699. */
  700. struct vdev_mlme_obj {
  701. struct vdev_mlme_proto proto;
  702. struct vdev_mlme_mgmt mgmt;
  703. #ifdef VDEV_SM_LOCK_SUPPORT
  704. qdf_spinlock_t sm_lock;
  705. qdf_mutex_t vdev_cmd_lock;
  706. #endif
  707. struct wlan_sm *sm_hdl;
  708. union {
  709. struct cnx_mgr *cnx_mgr_ctx;
  710. };
  711. struct wlan_objmgr_vdev *vdev;
  712. struct vdev_mlme_ops *ops;
  713. mlme_vdev_ext_t *ext_vdev_ptr;
  714. struct reg_tpc_power_info reg_tpc_obj;
  715. };
  716. /**
  717. * wlan_vdev_mlme_set_ssid() - set ssid
  718. * @vdev: VDEV object
  719. * @ssid: SSID (input)
  720. * @ssid_len: Length of SSID
  721. *
  722. * API to set the SSID of VDEV
  723. *
  724. * Caller need to acquire lock with wlan_vdev_obj_lock()
  725. *
  726. * Return: SUCCESS, if update is done
  727. * FAILURE, if ssid length is > max ssid len
  728. */
  729. static inline QDF_STATUS wlan_vdev_mlme_set_ssid(
  730. struct wlan_objmgr_vdev *vdev,
  731. const uint8_t *ssid, uint8_t ssid_len)
  732. {
  733. struct vdev_mlme_obj *vdev_mlme;
  734. /* This API is invoked with lock acquired, do not add log prints */
  735. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  736. if (!vdev_mlme)
  737. return QDF_STATUS_E_FAILURE;
  738. if (ssid_len <= WLAN_SSID_MAX_LEN) {
  739. qdf_mem_copy(vdev_mlme->mgmt.generic.ssid, ssid, ssid_len);
  740. vdev_mlme->mgmt.generic.ssid_len = ssid_len;
  741. } else {
  742. vdev_mlme->mgmt.generic.ssid_len = 0;
  743. return QDF_STATUS_E_FAILURE;
  744. }
  745. return QDF_STATUS_SUCCESS;
  746. }
  747. /**
  748. * wlan_vdev_mlme_get_ssid() - get ssid
  749. * @vdev: VDEV object
  750. * @ssid: SSID
  751. * @ssid_len: Length of SSID
  752. *
  753. * API to get the SSID of VDEV, it updates the SSID and its length
  754. * in @ssid, @ssid_len respectively
  755. *
  756. * Caller need to acquire lock with wlan_vdev_obj_lock()
  757. *
  758. * Return: SUCCESS, if update is done
  759. * FAILURE, if ssid length is > max ssid len
  760. */
  761. static inline QDF_STATUS wlan_vdev_mlme_get_ssid(
  762. struct wlan_objmgr_vdev *vdev,
  763. uint8_t *ssid, uint8_t *ssid_len)
  764. {
  765. struct vdev_mlme_obj *vdev_mlme;
  766. /* This API is invoked with lock acquired, do not add log prints */
  767. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  768. if (!vdev_mlme)
  769. return QDF_STATUS_E_FAILURE;
  770. if (vdev_mlme->mgmt.generic.ssid_len > 0) {
  771. *ssid_len = vdev_mlme->mgmt.generic.ssid_len;
  772. qdf_mem_copy(ssid, vdev_mlme->mgmt.generic.ssid, *ssid_len);
  773. } else {
  774. *ssid_len = 0;
  775. return QDF_STATUS_E_FAILURE;
  776. }
  777. return QDF_STATUS_SUCCESS;
  778. }
  779. /**
  780. * wlan_vdev_mlme_set_nss() - set NSS
  781. * @vdev: VDEV object
  782. * @nss: nss configured by user
  783. *
  784. * API to set the Number of Spatial streams
  785. *
  786. * Return: void
  787. */
  788. static inline void wlan_vdev_mlme_set_nss(
  789. struct wlan_objmgr_vdev *vdev,
  790. uint8_t nss)
  791. {
  792. struct vdev_mlme_obj *vdev_mlme;
  793. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  794. if (!vdev_mlme)
  795. return;
  796. vdev_mlme->proto.generic.nss = nss;
  797. }
  798. /**
  799. * wlan_vdev_mlme_get_nss() - get NSS
  800. * @vdev: VDEV object
  801. *
  802. * API to get the Number of Spatial Streams
  803. *
  804. * Return:
  805. * @nss: nss value
  806. */
  807. static inline uint8_t wlan_vdev_mlme_get_nss(
  808. struct wlan_objmgr_vdev *vdev)
  809. {
  810. struct vdev_mlme_obj *vdev_mlme;
  811. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  812. if (!vdev_mlme)
  813. return 0;
  814. return vdev_mlme->proto.generic.nss;
  815. }
  816. /**
  817. * wlan_vdev_mlme_set_txchainmask() - set Tx chainmask
  818. * @vdev: VDEV object
  819. * @chainmask : chainmask either configured by user or max supported
  820. *
  821. * API to set the Tx chainmask
  822. *
  823. * Return: void
  824. */
  825. static inline void wlan_vdev_mlme_set_txchainmask(
  826. struct wlan_objmgr_vdev *vdev,
  827. uint8_t chainmask)
  828. {
  829. struct vdev_mlme_obj *vdev_mlme;
  830. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  831. if (!vdev_mlme)
  832. return;
  833. vdev_mlme->mgmt.chainmask_info.tx_chainmask = chainmask;
  834. }
  835. /**
  836. * wlan_vdev_mlme_get_txchainmask() - get Tx chainmask
  837. * @vdev: VDEV object
  838. *
  839. * API to get the Tx chainmask
  840. *
  841. * Return:
  842. * @chainmask : Tx chainmask either configured by user or max supported
  843. */
  844. static inline uint8_t wlan_vdev_mlme_get_txchainmask(
  845. struct wlan_objmgr_vdev *vdev)
  846. {
  847. struct vdev_mlme_obj *vdev_mlme;
  848. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  849. if (!vdev_mlme)
  850. return 0;
  851. return vdev_mlme->mgmt.chainmask_info.tx_chainmask;
  852. }
  853. /**
  854. * wlan_vdev_mlme_set_rxchainmask() - set Rx chainmask
  855. * @vdev: VDEV object
  856. * @chainmask : Rx chainmask either configured by user or max supported
  857. *
  858. * API to set the Rx chainmask
  859. *
  860. * Return: void
  861. */
  862. static inline void wlan_vdev_mlme_set_rxchainmask(
  863. struct wlan_objmgr_vdev *vdev,
  864. uint8_t chainmask)
  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.chainmask_info.rx_chainmask = chainmask;
  871. }
  872. /**
  873. * wlan_vdev_mlme_get_rxchainmask() - get Rx chainmask
  874. * @vdev: VDEV object
  875. *
  876. * API to get the Rx chainmask
  877. *
  878. * Return:
  879. * @chainmask : Rx chainmask either configured by user or max supported
  880. */
  881. static inline uint8_t wlan_vdev_mlme_get_rxchainmask(
  882. struct wlan_objmgr_vdev *vdev)
  883. {
  884. struct vdev_mlme_obj *vdev_mlme;
  885. /* This API is invoked with lock acquired, do not add log prints */
  886. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  887. if (!vdev_mlme)
  888. return 0;
  889. return vdev_mlme->mgmt.chainmask_info.rx_chainmask;
  890. }
  891. /**
  892. * wlan_vdev_mlme_set_txpower() - set tx power
  893. * @vdev: VDEV object
  894. * @txpow: tx power either configured by used or max allowed
  895. *
  896. * API to set the tx power
  897. *
  898. * Return: void
  899. */
  900. static inline void wlan_vdev_mlme_set_txpower(
  901. struct wlan_objmgr_vdev *vdev,
  902. uint8_t txpow)
  903. {
  904. struct vdev_mlme_obj *vdev_mlme;
  905. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  906. if (!vdev_mlme)
  907. return;
  908. vdev_mlme->mgmt.generic.tx_power = txpow;
  909. }
  910. /**
  911. * wlan_vdev_mlme_get_txpower() - get tx power
  912. * @vdev: VDEV object
  913. *
  914. * API to get the tx power
  915. *
  916. * Return:
  917. * @txpow: tx power either configured by used or max allowed
  918. */
  919. static inline uint8_t wlan_vdev_mlme_get_txpower(
  920. struct wlan_objmgr_vdev *vdev)
  921. {
  922. struct vdev_mlme_obj *vdev_mlme;
  923. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  924. if (!vdev_mlme)
  925. return 0;
  926. return vdev_mlme->mgmt.generic.tx_power;
  927. }
  928. /**
  929. * wlan_vdev_mlme_set_maxrate() - set max rate
  930. * @vdev: VDEV object
  931. * @maxrate: configured by used or based on configured mode
  932. *
  933. * API to set the max rate the vdev supports
  934. *
  935. * Return: void
  936. */
  937. static inline void wlan_vdev_mlme_set_maxrate(
  938. struct wlan_objmgr_vdev *vdev,
  939. uint32_t maxrate)
  940. {
  941. struct vdev_mlme_obj *vdev_mlme;
  942. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  943. if (!vdev_mlme)
  944. return;
  945. vdev_mlme->mgmt.rate_info.max_rate = maxrate;
  946. }
  947. /**
  948. * wlan_vdev_mlme_get_maxrate() - get max rate
  949. * @vdev: VDEV object
  950. *
  951. * API to get the max rate the vdev supports
  952. *
  953. * Return:
  954. * @maxrate: configured by used or based on configured mode
  955. */
  956. static inline uint32_t wlan_vdev_mlme_get_maxrate(
  957. struct wlan_objmgr_vdev *vdev)
  958. {
  959. struct vdev_mlme_obj *vdev_mlme;
  960. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  961. if (!vdev_mlme)
  962. return 0;
  963. return vdev_mlme->mgmt.rate_info.max_rate;
  964. }
  965. /**
  966. * wlan_vdev_mlme_set_txmgmtrate() - set txmgmtrate
  967. * @vdev: VDEV object
  968. * @txmgmtrate: Tx Mgmt rate
  969. *
  970. * API to set Mgmt Tx rate
  971. *
  972. * Return: void
  973. */
  974. static inline void wlan_vdev_mlme_set_txmgmtrate(
  975. struct wlan_objmgr_vdev *vdev,
  976. uint32_t txmgmtrate)
  977. {
  978. struct vdev_mlme_obj *vdev_mlme;
  979. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  980. if (!vdev_mlme)
  981. return;
  982. vdev_mlme->mgmt.rate_info.tx_mgmt_rate = txmgmtrate;
  983. }
  984. /**
  985. * wlan_vdev_mlme_get_txmgmtrate() - get txmgmtrate
  986. * @vdev: VDEV object
  987. *
  988. * API to get Mgmt Tx rate
  989. *
  990. * Return:
  991. * @txmgmtrate: Tx Mgmt rate
  992. */
  993. static inline uint32_t wlan_vdev_mlme_get_txmgmtrate(
  994. struct wlan_objmgr_vdev *vdev)
  995. {
  996. struct vdev_mlme_obj *vdev_mlme;
  997. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  998. if (!vdev_mlme)
  999. return 0;
  1000. return vdev_mlme->mgmt.rate_info.tx_mgmt_rate;
  1001. }
  1002. /**
  1003. * wlan_vdev_mlme_is_special_vdev() - check given vdev is a special vdev
  1004. * @vdev: VDEV object
  1005. *
  1006. * API to check given vdev is a special vdev.
  1007. *
  1008. * Return: true if given vdev is special vdev, else false
  1009. */
  1010. static inline bool wlan_vdev_mlme_is_special_vdev(
  1011. struct wlan_objmgr_vdev *vdev)
  1012. {
  1013. struct vdev_mlme_obj *vdev_mlme;
  1014. if (!vdev)
  1015. return false;
  1016. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1017. if (!vdev_mlme)
  1018. return false;
  1019. return vdev_mlme->mgmt.generic.special_vdev_mode;
  1020. }
  1021. #ifdef WLAN_FEATURE_11AX
  1022. /**
  1023. * wlan_vdev_mlme_set_he_mcs_12_13_map() - set he mcs12/13 map
  1024. * @vdev: VDEV object
  1025. * @he_mcs_12_13_map: he mcs12/13 map from self&peer
  1026. *
  1027. * API to set he mcs 12/13 map
  1028. *
  1029. * Return: void
  1030. */
  1031. static inline void wlan_vdev_mlme_set_he_mcs_12_13_map(
  1032. struct wlan_objmgr_vdev *vdev,
  1033. uint16_t he_mcs_12_13_map)
  1034. {
  1035. struct vdev_mlme_obj *vdev_mlme;
  1036. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1037. if (!vdev_mlme)
  1038. return;
  1039. vdev_mlme->mgmt.sta.he_mcs_12_13_map = he_mcs_12_13_map;
  1040. }
  1041. /**
  1042. * wlan_vdev_mlme_get_he_mcs_12_13_map() - get he mcs12/13 map
  1043. * @vdev: VDEV object
  1044. *
  1045. * API to get he mcs12/13 support capability
  1046. *
  1047. * Return:
  1048. * @he_mcs_12_13_map: he mcs12/13 map
  1049. */
  1050. static inline uint16_t wlan_vdev_mlme_get_he_mcs_12_13_map(
  1051. struct wlan_objmgr_vdev *vdev)
  1052. {
  1053. struct vdev_mlme_obj *vdev_mlme;
  1054. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1055. if (!vdev_mlme)
  1056. return 0;
  1057. return vdev_mlme->mgmt.sta.he_mcs_12_13_map;
  1058. }
  1059. #else
  1060. static inline void wlan_vdev_mlme_set_he_mcs_12_13_map(
  1061. struct wlan_objmgr_vdev *vdev,
  1062. uint16_t he_mcs_12_13_map)
  1063. {
  1064. }
  1065. static inline uint16_t wlan_vdev_mlme_get_he_mcs_12_13_map(
  1066. struct wlan_objmgr_vdev *vdev)
  1067. {
  1068. return 0;
  1069. }
  1070. #endif
  1071. /**
  1072. * wlan_vdev_mlme_set_aid_mgr() - set aid mgr
  1073. * @vdev: VDEV object
  1074. * @aid_mgr: AID mgr
  1075. *
  1076. * API to set AID mgr in VDEV MLME cmpt object
  1077. *
  1078. * Return: void
  1079. */
  1080. static inline void wlan_vdev_mlme_set_aid_mgr(
  1081. struct wlan_objmgr_vdev *vdev,
  1082. struct wlan_vdev_aid_mgr *aid_mgr)
  1083. {
  1084. struct vdev_mlme_obj *vdev_mlme;
  1085. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1086. if (!vdev_mlme)
  1087. return;
  1088. vdev_mlme->mgmt.ap.aid_mgr = aid_mgr;
  1089. }
  1090. /**
  1091. * wlan_vdev_mlme_get_aid_mgr() - get aid mgr
  1092. * @vdev: VDEV object
  1093. *
  1094. * API to get AID mgr in VDEV MLME cmpt object
  1095. *
  1096. * Return: aid_mgr
  1097. */
  1098. static inline struct wlan_vdev_aid_mgr *wlan_vdev_mlme_get_aid_mgr(
  1099. struct wlan_objmgr_vdev *vdev)
  1100. {
  1101. struct vdev_mlme_obj *vdev_mlme;
  1102. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1103. if (!vdev_mlme)
  1104. return NULL;
  1105. return vdev_mlme->mgmt.ap.aid_mgr;
  1106. }
  1107. #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
  1108. /**
  1109. * vdev_mgr_cdp_vdev_attach() - MLME API to attach CDP vdev
  1110. * @mlme_obj: pointer to vdev_mlme_obj
  1111. *
  1112. * Return: QDF_STATUS - Success or Failure
  1113. */
  1114. QDF_STATUS vdev_mgr_cdp_vdev_attach(struct vdev_mlme_obj *mlme_obj);
  1115. /**
  1116. * vdev_mgr_cdp_vdev_detach() - MLME API to detach CDP vdev
  1117. * @mlme_obj: pointer to vdev_mlme_obj
  1118. *
  1119. * Return: QDF_STATUS - Success or Failure
  1120. */
  1121. QDF_STATUS vdev_mgr_cdp_vdev_detach(struct vdev_mlme_obj *mlme_obj);
  1122. #endif
  1123. #endif