wlan_vdev_mlme.h 37 KB

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