wlan_vdev_mlme.h 36 KB

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