wlan_vdev_mlme.h 35 KB

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