wlan_vdev_mlme.h 37 KB

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