wlan_vdev_mlme.h 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930
  1. /*
  2. * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2023 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. #define WLAN_VDEV_MLME_SUBTYPE_MLO_BRIDGE 0x8
  49. /* vdev control flags (per bits) */
  50. #define WLAN_VDEV_MLME_FLAGS_NON_MBSSID_AP 0x00000001
  51. #define WLAN_VDEV_MLME_FLAGS_TRANSMIT_AP 0x00000002
  52. #define WLAN_VDEV_MLME_FLAGS_NON_TRANSMIT_AP 0x00000004
  53. #define WLAN_VDEV_MLME_FLAGS_EMA_MODE 0x00000008
  54. #define WLAN_VDEV_MLME_FLAGS_MBSS_CMN_PARAM 0x00000010
  55. /**
  56. * struct vdev_mlme_proto_generic - generic mlme proto structure
  57. * sent in frames
  58. * @dtim_period: frequency of data transmissions per beacon 1-255
  59. * @slot_time: slot time
  60. * @protection_mode: rts cts protection mode
  61. * @beacon_interval: beacon interval
  62. * @ldpc: low density parity check value
  63. * @nss: number of spatial stream
  64. * @nss_2g: 2.4GHz number of spatial stream
  65. * @nss_5g: 5GHz number of spatial stream
  66. * @tsfadjust: adjusted timer sync value
  67. */
  68. struct vdev_mlme_proto_generic {
  69. uint8_t dtim_period;
  70. uint32_t slot_time;
  71. uint32_t protection_mode;
  72. uint16_t beacon_interval;
  73. uint8_t ldpc;
  74. uint8_t nss;
  75. uint8_t nss_2g;
  76. uint8_t nss_5g;
  77. uint64_t tsfadjust;
  78. };
  79. /**
  80. * struct vdev_mlme_proto_ap - ap specific mlme protocol
  81. * @mapping_switch_time: Mapping switch time of T2LM
  82. */
  83. struct vdev_mlme_proto_ap {
  84. uint16_t mapping_switch_time;
  85. };
  86. /**
  87. * struct vdev_mlme_proto_sta - sta specific mlme protocol
  88. * @assoc_id: association id of station
  89. * @uapsd_cfg: uapsd configuration
  90. */
  91. struct vdev_mlme_proto_sta {
  92. uint16_t assoc_id;
  93. uint16_t uapsd_cfg;
  94. };
  95. /**
  96. * struct vdev_mlme_proto_bss_color - bss color cfg
  97. * @flags: proposed for future use cases, currently not used.
  98. * @evt_type: bss color collision event.
  99. * @current_bss_color: current bss color.
  100. * @detection_period_ms: scan interval for both AP and STA mode.
  101. * @scan_period_ms: scan period for passive scan to detect collision.
  102. * @free_slot_expiry_time_ms: FW to notify host at timer expiry after
  103. * which Host will disable the bss color.
  104. */
  105. struct vdev_mlme_proto_bss_color {
  106. uint32_t flags;
  107. uint8_t evt_type;
  108. uint32_t current_bss_color;
  109. uint32_t detection_period_ms;
  110. uint32_t scan_period_ms;
  111. uint32_t free_slot_expiry_time_ms;
  112. };
  113. /**
  114. * struct vdev_mlme_vht_info - vdev VHT information
  115. * @caps: vht capabilities
  116. * @subfer: su beam former capability
  117. * @subfee: su beam formee capability
  118. * @mubfer: mu beam former capability
  119. * @mubfee: mu beam formee capability
  120. * @implicit_bf: Implicit BF support
  121. * @sounding_dimension: Beamformer number of sounding dimension
  122. * @bfee_sts_cap: beam formee STA capability
  123. * @allow_vht: vht capability status
  124. */
  125. struct vdev_mlme_vht_info {
  126. uint32_t caps;
  127. uint8_t subfer;
  128. uint8_t mubfer;
  129. uint8_t subfee;
  130. uint8_t mubfee;
  131. uint8_t implicit_bf;
  132. uint8_t sounding_dimension;
  133. uint8_t bfee_sts_cap;
  134. bool allow_vht;
  135. };
  136. /**
  137. * struct vdev_mlme_ht_info - vdev HT information
  138. * @ht_caps: HT capabilities
  139. * @allow_ht: HT capability status
  140. */
  141. struct vdev_mlme_ht_info {
  142. uint32_t ht_caps;
  143. bool allow_ht;
  144. };
  145. /**
  146. * struct vdev_mlme_he_ops_info - vdev mlme HEOPS information
  147. * @he_ops: he ops
  148. */
  149. struct vdev_mlme_he_ops_info {
  150. uint32_t he_ops;
  151. };
  152. #ifdef WLAN_FEATURE_11BE
  153. /**
  154. * struct vdev_mlme_eht_caps_info - vdev mlme EHT capability information
  155. * @eht_maccap_epcspriaccess_support : EPCS Priority Access Supported
  156. * @eht_maccap_ehtomctrl_support : EHT OM Control Support
  157. * @eht_maccap_trigtxop_sharing_mode1: Triggered TXOP Sharing mode1 Support
  158. * @eht_maccap_trigtxop_sharing_mode2: Triggered TXOP Sharing mode2 Support
  159. * @eht_maccap_rtwt_support : Restricted TWT Support
  160. * @eht_maccap_scs_traffic_description : SCS Traffic Description Support
  161. * @eht_maccap_max_mpdu_len : Maximum MPDU Length
  162. * @eht_maccap_max_ampdu_len_exp_etn : Maximum A-MPDU Length Exponent Extension
  163. * @eht_maccap_trs_support : EHT TRS Support
  164. * @eht_maccap_txop_ret_supp_in_txop_mode2: TXOP Return Support In TXOP
  165. * Sharing Mode 2
  166. * @eht_phycap_reserved : Reserved
  167. * @eht_phycap_320mhzin6ghz : Support For 320 MHz In 6 GHz
  168. * @eht_phycap_242tonerubwlt20mhz : Support for 242-tone RU In BW Wider Than
  169. * 20 MHz
  170. * @eht_phycap_ndp4xehtltfand320nsgi : NDP With 4. EHT-LTF And 3.2 .s GI
  171. * @eht_phycap_partialbwulmu : Partial Bandwidth UL MU-MIMO
  172. * @eht_phycap_subfmr : SU Beamformer
  173. * @eht_phycap_subfme : SU Beamformee
  174. * @eht_phycap_bfmesslt80mhz : Beamformee SS (<= 80 MHz)
  175. * @eht_phycap_bfmess160mhz : Beamformee SS (= 160 MHz)
  176. * @eht_phycap_bfmess320mhz : Beamformee SS (= 320 MHz)
  177. * @eht_phycap_numsoundlt80mhz : Number Of Sounding Dimensions (<=80 MHz)
  178. * @eht_phycap_numsound160mhz : Number Of Sounding Dimensions (=160 MHz)
  179. * @eht_phycap_numsound320mhz : Number Of Sounding Dimensions (=320 MHz)
  180. * @eht_phycap_ng16sufb : Ng = 16 SU Feedback
  181. * @eht_phycap_ng16mufb : Ng = 16 MU Feedback
  182. * @eht_phycap_codbk42sufb : Codebook Size {4,2} SU Feedback
  183. * @eht_phycap_codbk75mufb : Codebook Size {4,2} MU Feedback
  184. * @eht_phycap_trigsubffb : Triggered SU Beamforming Feedback
  185. * @eht_phycap_trigmubfpartbwfb : Triggered MU Beamforming Partial B
  186. * Feedback
  187. * @eht_phycap_trigcqifb : Triggered CQI Feedback
  188. * @eht_phycap_partbwdlmumimo : Partial Bandwidth DL MU-MIMO
  189. * @eht_phycap_psrsr : PSR-Based SR Support
  190. * @eht_phycap_pwrbstfactor : Power Boost Factor Support
  191. * @eht_phycap_4xehtltfand800nsgi : EHT MU PPDU With 4xEHT-LTF And 0.8 .s GI
  192. * @eht_phycap_maxnc : Max Nc
  193. * @eht_phycap_nontrigcqifb : Non-Triggered CQI Feedback
  194. * @eht_phycap_tx1024and4096qamls242toneru : Tx 1024-QAM And 4096-QAM <
  195. * 242-tone RU Support
  196. * @eht_phycap_rx1024and4096qamls242toneru : Rx 1024-QAM And 4096-QAM <
  197. * 242-tone RU Support
  198. * @eht_phycap_ppethrespresent : PPE Thresholds Present
  199. * @eht_phycap_cmnnompktpad : Common Nominal Packet Padding
  200. * @eht_phycap_maxnumehtltf : Maximum Number Of Supported EHT-LTFs
  201. * @eht_phycap_supmcs15 : Support of MCS 15
  202. * @eht_phycap_ehtdupin6ghz : Support Of EHT DUP In 6 GHz
  203. * @eht_phycap_20mhzopstarxndpwiderbw : Support For 20 MHz Operating STA
  204. * Receiving NDP With Wider Bandwidth
  205. * @eht_phycap_nonofdmaulmumimolt80mhz : Non-OFDMA UL MU-MIMO (BW <= 80 MHz)
  206. * @eht_phycap_nonofdmaulmumimo160mhz : Non-OFDMA UL MU-MIMO (BW = 160 MHz)
  207. * @eht_phycap_nonofdmaulmumimo320mhz : Non-OFDMA UL MU-MIMO (BW = 320 MHz)
  208. * @eht_phycap_mubfmrlt80mhz : MU Beamformer (BW <= 80 MHz)
  209. * @eht_phycap_mubfmr160mhz : MU Beamformer (BW = 160 MHz)
  210. * @eht_phycap_mubfmr320mhz : MU Beamformer (BW = 320 MHz)
  211. * @eht_phycap_tb_sounding_feedback_rl:
  212. * @eht_phycap_rx1024qamwiderbwdlofdma:
  213. * @eht_phycap_rx4096qamwiderbwdlofdma:
  214. */
  215. struct vdev_mlme_eht_caps_info {
  216. uint32_t eht_maccap_epcspriaccess_support :1,
  217. eht_maccap_ehtomctrl_support :1,
  218. eht_maccap_trigtxop_sharing_mode1 :1,
  219. eht_maccap_trigtxop_sharing_mode2 :1,
  220. eht_maccap_rtwt_support :1,
  221. eht_maccap_scs_traffic_description :1,
  222. eht_maccap_max_mpdu_len :2,
  223. eht_maccap_max_ampdu_len_exp_etn :1,
  224. eht_maccap_trs_support :1,
  225. eht_maccap_txop_ret_supp_in_txop_mode2 :1;
  226. uint32_t eht_phycap_reserved :1,
  227. eht_phycap_320mhzin6ghz :1,
  228. eht_phycap_242tonerubwlt20mhz :1,
  229. eht_phycap_ndp4xehtltfand320nsgi :1,
  230. eht_phycap_partialbwulmu :1,
  231. eht_phycap_subfmr :1,
  232. eht_phycap_subfme :1,
  233. eht_phycap_bfmesslt80mhz :3,
  234. eht_phycap_bfmess160mhz :3,
  235. eht_phycap_bfmess320mhz :3,
  236. eht_phycap_numsoundlt80mhz :3,
  237. eht_phycap_numsound160mhz :3,
  238. eht_phycap_numsound320mhz :3,
  239. eht_phycap_ng16sufb :1,
  240. eht_phycap_ng16mufb :1,
  241. eht_phycap_codbk42sufb :1,
  242. eht_phycap_codbk75mufb :1,
  243. eht_phycap_trigsubffb :1,
  244. eht_phycap_trigmubfpartbwfb :1,
  245. eht_phycap_trigcqifb :1;
  246. uint32_t eht_phycap_partbwdlmumimo :1,
  247. eht_phycap_psrsr :1,
  248. eht_phycap_pwrbstfactor :1,
  249. eht_phycap_4xehtltfand800nsgi :1,
  250. eht_phycap_maxnc :4,
  251. eht_phycap_nontrigcqifb :1,
  252. eht_phycap_tx1024and4096qamls242toneru :1,
  253. eht_phycap_rx1024and4096qamls242toneru :1,
  254. eht_phycap_ppethrespresent :1,
  255. eht_phycap_cmnnompktpad :2,
  256. eht_phycap_maxnumehtltf :5,
  257. eht_phycap_supmcs15 :4,
  258. eht_phycap_ehtdupin6ghz :1,
  259. eht_phycap_20mhzopstarxndpwiderbw :1,
  260. eht_phycap_nonofdmaulmumimolt80mhz :1,
  261. eht_phycap_nonofdmaulmumimo160mhz :1,
  262. eht_phycap_nonofdmaulmumimo320mhz :1,
  263. eht_phycap_mubfmrlt80mhz :1,
  264. eht_phycap_mubfmr160mhz :1,
  265. eht_phycap_mubfmr320mhz :1,
  266. eht_phycap_tb_sounding_feedback_rl :1;
  267. uint32_t eht_phycap_rx1024qamwiderbwdlofdma :1,
  268. eht_phycap_rx4096qamwiderbwdlofdma :1;
  269. };
  270. /**
  271. * struct vdev_mlme_eht_ops_info - vdev mlme EHTOPS information
  272. * @eht_ops: eht ops
  273. */
  274. struct vdev_mlme_eht_ops_info {
  275. uint32_t eht_ops;
  276. };
  277. #endif
  278. /**
  279. * enum mlme_vdev_dot11_mode - Dot11 mode of the vdev
  280. * @MLME_VDEV_DOT11_MODE_AUTO: vdev uses mlme_dot11_mode
  281. * @MLME_VDEV_DOT11_MODE_11N: vdev supports 11N mode
  282. * @MLME_VDEV_DOT11_MODE_11AC: vdev supports 11AC mode
  283. * @MLME_VDEV_DOT11_MODE_11AX: vdev supports 11AX mode
  284. * @MLME_VDEV_DOT11_MODE_11BE: vdev supports 11BE mode
  285. */
  286. enum mlme_vdev_dot11_mode {
  287. MLME_VDEV_DOT11_MODE_AUTO,
  288. MLME_VDEV_DOT11_MODE_11N,
  289. MLME_VDEV_DOT11_MODE_11AC,
  290. MLME_VDEV_DOT11_MODE_11AX,
  291. MLME_VDEV_DOT11_MODE_11BE,
  292. };
  293. /**
  294. * struct vdev_mlme_proto - vdev protocol structure holding information
  295. * that is used in frames
  296. * @vdev_dot11_mode: supported dot11 mode
  297. * @generic: generic protocol information
  298. * @ap: ap specific protocol information
  299. * @sta: sta specific protocol information
  300. * @vht_info: vht information
  301. * @ht_info: ht capabilities information
  302. * @he_ops_info: he ops information
  303. * @eht_cap_info: EHT capability information
  304. * @eht_ops_info: EHT operation information
  305. * @bss_color: 11ax HE BSS Color information
  306. */
  307. struct vdev_mlme_proto {
  308. enum mlme_vdev_dot11_mode vdev_dot11_mode;
  309. struct vdev_mlme_proto_generic generic;
  310. struct vdev_mlme_proto_ap ap;
  311. struct vdev_mlme_proto_sta sta;
  312. struct vdev_mlme_vht_info vht_info;
  313. struct vdev_mlme_ht_info ht_info;
  314. struct vdev_mlme_he_ops_info he_ops_info;
  315. #ifdef WLAN_FEATURE_11BE
  316. struct vdev_mlme_eht_caps_info eht_cap_info;
  317. struct vdev_mlme_eht_ops_info eht_ops_info;
  318. #endif
  319. struct vdev_mlme_proto_bss_color bss_color;
  320. };
  321. /**
  322. * struct vdev_mlme_mgmt_generic - generic vdev mlme mgmt cfg
  323. * @rts_threshold: RTS threshold
  324. * @frag_threshold: Fragmentation threshold
  325. * @probe_delay: time in msec for delaying to send first probe request
  326. * @repeat_probe_time: probe request transmission time
  327. * @drop_unencry: drop unencrypted status
  328. * @tx_pwrlimit: Tx power limit
  329. * @tx_power: Tx power
  330. * @minpower: Min power
  331. * @maxpower: Max power
  332. * @maxregpower: max regulatory power
  333. * @antennamax: max antenna
  334. * @reg_class_id: reg domain class id
  335. * @ampdu: ampdu limit
  336. * @amsdu: amsdu limit
  337. * @ssid: service set identifier
  338. * @ssid_len: ssid length
  339. * @type: vdev type
  340. * @subtype: vdev subtype
  341. * @rx_decap_type: rx decap type
  342. * @tx_encap_type: tx encap type
  343. * @disable_hw_ack: disable ha ack flag
  344. * @bssid: bssid
  345. * @phy_mode: phy mode
  346. * @special_vdev_mode: indicates special vdev mode
  347. * @is_sap_go_moved_1st_on_csa: Indicates if STA receives
  348. * CSA to a DFS channel
  349. * @he_spr_sr_ctrl: Spatial reuse SR control
  350. * @he_spr_non_srg_pd_max_offset: Non-SRG PD max offset
  351. * @he_spr_srg_max_pd_offset: SRG PD max offset
  352. * @he_spr_srg_min_pd_offset: SRG PD min offset
  353. * @he_spr_enabled: Spatial reuse enabled or not
  354. * @he_spr_disabled_due_conc: spr disabled due to concurrency
  355. * @sr_prohibit_enabled:
  356. * @srg_bss_color: srg bss color
  357. * @srg_partial_bssid: srg partial bssid
  358. * @he_curr_non_srg_pd_threshold: current configured NON-SRG PD threshold
  359. * @he_curr_srg_pd_threshold: current configured SRG PD threshold
  360. * @is_pd_threshold_present: PD threshold is present in SR enable command or not
  361. */
  362. struct vdev_mlme_mgmt_generic {
  363. uint32_t rts_threshold;
  364. uint32_t frag_threshold;
  365. uint32_t probe_delay;
  366. uint32_t repeat_probe_time;
  367. uint32_t drop_unencry;
  368. uint32_t tx_pwrlimit;
  369. uint8_t tx_power;
  370. uint8_t minpower;
  371. uint8_t maxpower;
  372. uint8_t maxregpower;
  373. uint8_t antennamax;
  374. uint8_t reg_class_id;
  375. uint16_t ampdu;
  376. uint8_t amsdu;
  377. char ssid[WLAN_SSID_MAX_LEN + 1];
  378. uint8_t ssid_len;
  379. uint8_t type;
  380. uint8_t subtype;
  381. uint8_t rx_decap_type;
  382. uint8_t tx_encap_type;
  383. bool disable_hw_ack;
  384. uint8_t bssid[QDF_MAC_ADDR_SIZE];
  385. uint32_t phy_mode;
  386. bool special_vdev_mode;
  387. bool is_sap_go_moved_1st_on_csa;
  388. #ifdef WLAN_FEATURE_SR
  389. uint8_t he_spr_sr_ctrl;
  390. uint8_t he_spr_non_srg_pd_max_offset;
  391. uint8_t he_spr_srg_max_pd_offset;
  392. uint8_t he_spr_srg_min_pd_offset;
  393. bool he_spr_enabled;
  394. bool he_spr_disabled_due_conc;
  395. bool sr_prohibit_enabled;
  396. uint64_t srg_bss_color;
  397. uint64_t srg_partial_bssid;
  398. int32_t he_curr_non_srg_pd_threshold;
  399. int32_t he_curr_srg_pd_threshold;
  400. bool is_pd_threshold_present;
  401. #endif
  402. };
  403. /**
  404. * struct wlan_vdev_aid_mgr - AID manager
  405. * @aid_bitmap: AID bitmap array
  406. * @start_aid: start of AID index
  407. * @max_aid: Max allowed AID
  408. * @ref_cnt: to share AID across VDEVs for MBSSID
  409. */
  410. struct wlan_vdev_aid_mgr {
  411. qdf_bitmap(aid_bitmap, WLAN_UMAC_MAX_AID);
  412. uint16_t start_aid;
  413. uint16_t max_aid;
  414. qdf_atomic_t ref_cnt;
  415. };
  416. /**
  417. * struct vdev_mlme_mgmt_ap - ap specific vdev mlme mgmt cfg
  418. * @hidden_ssid: flag to indicate whether it is hidden ssid
  419. * @cac_duration_ms: cac duration in milliseconds
  420. * @aid_mgr: AID bitmap mgr
  421. * @max_chan_switch_time: Max channel switch time in milliseconds.
  422. * @last_bcn_ts_ms: Timestamp (in milliseconds) of the last beacon sent on the
  423. * CSA triggered channel.
  424. * @is_acs_mode: True if SAP is started in ACS mode
  425. */
  426. struct vdev_mlme_mgmt_ap {
  427. bool hidden_ssid;
  428. uint32_t cac_duration_ms;
  429. struct wlan_vdev_aid_mgr *aid_mgr;
  430. uint32_t max_chan_switch_time;
  431. unsigned long last_bcn_ts_ms;
  432. bool is_acs_mode;
  433. };
  434. /**
  435. * struct vdev_mlme_mgmt_sta - sta specific vdev mlme mgmt cfg
  436. * @he_mcs_12_13_map: map to indicate mcs12/13 caps of peer&dut
  437. */
  438. struct vdev_mlme_mgmt_sta {
  439. uint16_t he_mcs_12_13_map;
  440. };
  441. /**
  442. * struct vdev_mlme_inactivity_params - vdev mlme inactivity parameters
  443. * @bmiss_first_bcnt: bmiss first time
  444. * @bmiss_final_bcnt: bmiss final time
  445. * @keepalive_min_idle_inactive_time_secs: min time AP consider STA to be
  446. * inactive
  447. * @keepalive_max_idle_inactive_time_secs: max inactive idle time for AP to send
  448. * data-null
  449. * @keepalive_max_unresponsive_time_secs: max time to send WMI_STA_KICKOUT
  450. */
  451. struct vdev_mlme_inactivity_params {
  452. uint32_t bmiss_first_bcnt;
  453. uint32_t bmiss_final_bcnt;
  454. uint32_t keepalive_min_idle_inactive_time_secs;
  455. uint32_t keepalive_max_idle_inactive_time_secs;
  456. uint32_t keepalive_max_unresponsive_time_secs;
  457. };
  458. /**
  459. * enum vdev_ratemask_type - ratemask phy type
  460. * @WLAN_VDEV_RATEMASK_TYPE_CCK: phy type CCK
  461. * @WLAN_VDEV_RATEMASK_TYPE_HT: phy type ht
  462. * @WLAN_VDEV_RATEMASK_TYPE_VHT: phy type vht
  463. * @WLAN_VDEV_RATEMASK_TYPE_HE: phy type he
  464. * @WLAN_VDEV_RATEMASK_TYPE_EHT: phy type eht
  465. * @WLAN_VDEV_RATEMASK_TYPE_MAX: Maximum enumeration
  466. */
  467. enum vdev_ratemask_type {
  468. WLAN_VDEV_RATEMASK_TYPE_CCK,
  469. WLAN_VDEV_RATEMASK_TYPE_HT,
  470. WLAN_VDEV_RATEMASK_TYPE_VHT,
  471. WLAN_VDEV_RATEMASK_TYPE_HE,
  472. WLAN_VDEV_RATEMASK_TYPE_EHT,
  473. WLAN_VDEV_RATEMASK_TYPE_MAX,
  474. };
  475. /**
  476. * struct vdev_ratemask_params - vdev ratemask parameters
  477. * @type: ratemask phy type
  478. * @lower32: ratemask lower32 bitmask
  479. * @higher32: ratemask higher32 bitmask
  480. * @lower32_2: ratemask lower32_2 bitmask
  481. * @higher32_2: rtaemask higher32_2 bitmask
  482. */
  483. struct vdev_ratemask_params {
  484. uint32_t lower32;
  485. uint32_t higher32;
  486. uint32_t lower32_2;
  487. uint32_t higher32_2;
  488. };
  489. /**
  490. * struct vdev_mlme_rate_info - vdev mlme rate information
  491. * @rate_flags: dynamic bandwidth info
  492. * @per_band_tx_mgmt_rate: per band Tx mgmt rate
  493. * @max_rate: max bandwidth rate
  494. * @tx_mgmt_rate: Tx Mgmt rate
  495. * @bcn_tx_rate: beacon Tx rate
  496. * @bcn_tx_rate_code: beacon Tx rate code
  497. * @rtscts_tx_rate: RTS/CTS Tx rate
  498. * @ratemask_params: vdev ratemask params per phy type
  499. * @half_rate: Half rate
  500. * @quarter_rate: quarter rate
  501. */
  502. struct vdev_mlme_rate_info {
  503. uint32_t rate_flags;
  504. uint32_t per_band_tx_mgmt_rate;
  505. uint32_t max_rate;
  506. uint32_t tx_mgmt_rate;
  507. uint32_t bcn_tx_rate;
  508. #ifdef WLAN_BCN_RATECODE_ENABLE
  509. uint32_t bcn_tx_rate_code;
  510. #endif
  511. uint32_t rtscts_tx_rate;
  512. struct vdev_ratemask_params ratemask_params[
  513. WLAN_VDEV_RATEMASK_TYPE_MAX];
  514. bool half_rate;
  515. bool quarter_rate;
  516. };
  517. /**
  518. * struct vdev_mlme_chainmask_info - vdev mlme chainmask information
  519. * @tx_chainmask: Tx chainmask
  520. * @rx_chainmask: Rx Chainmask
  521. * @num_rx_chain: Num of bits set in Rx chain
  522. * @num_tx_chain: Num of bits set in Tx chain
  523. */
  524. struct vdev_mlme_chainmask_info {
  525. uint8_t tx_chainmask;
  526. uint8_t rx_chainmask;
  527. uint8_t num_rx_chain;
  528. uint8_t num_tx_chain;
  529. };
  530. /**
  531. * struct vdev_mlme_powersave_info - vdev mlme powersave information
  532. * @packet_powersave: packet powersave
  533. * @max_li_of_moddtim: max mod dtim
  534. * @dyndtim_cnt: dynamic dtim count
  535. * @listen_interval: listen interval
  536. * @moddtim_cnt: mod dtim count
  537. */
  538. struct vdev_mlme_powersave_info {
  539. uint32_t packet_powersave;
  540. uint32_t max_li_of_moddtim;
  541. uint32_t dyndtim_cnt;
  542. uint32_t listen_interval;
  543. uint32_t moddtim_cnt;
  544. };
  545. /**
  546. * struct vdev_mlme_beacon_info - vdev mlme beacon information
  547. * @beacon_buffer: buffer allocated for beacon frame
  548. * @beacon_offsets: beacon IE's offsets
  549. */
  550. struct vdev_mlme_beacon_info {
  551. qdf_nbuf_t beacon_buffer;
  552. void *beacon_offsets;
  553. };
  554. /**
  555. * struct vdev_mlme_mbss_11ax - mbss 11ax fields required for up cmd
  556. * @profile_idx: profile index of the connected non-trans ap (mbssid case).
  557. * 0 means invalid.
  558. * @profile_num: the total profile numbers of non-trans aps (mbssid case).
  559. * 0 means non-MBSS AP.
  560. * @mbssid_flags: MBSS IE flags indicating vdev type
  561. * @vdevid_trans: id of transmitting vdev for MBSS IE
  562. * @vdev_bmap: vdev bitmap of VAPs in MBSS group
  563. * @is_cmn_param: flag to check mbss common param
  564. * @trans_bssid: bssid of transmitted AP (MBSS IE case)
  565. * @non_trans_bssid: bssid of non transmitted AP (MBSS IE case)
  566. * @is_multi_mbssid: Flag to identify multi group mbssid support
  567. * @grp_id: Group id of current vdev
  568. */
  569. struct vdev_mlme_mbss_11ax {
  570. uint32_t profile_idx;
  571. uint32_t profile_num;
  572. uint32_t mbssid_flags;
  573. uint8_t vdevid_trans;
  574. unsigned long vdev_bmap;
  575. bool is_cmn_param;
  576. uint8_t trans_bssid[QDF_MAC_ADDR_SIZE];
  577. uint8_t non_trans_bssid[QDF_MAC_ADDR_SIZE];
  578. bool is_multi_mbssid;
  579. uint32_t grp_id;
  580. };
  581. /**
  582. * struct vdev_mlme_mgmt - vdev mlme mgmt related cfg
  583. * @generic: generic mgmt information
  584. * @ap: ap specific mgmt information
  585. * @sta: sta specific mgmt information
  586. * @inactivity_params: inactivity parameters
  587. * @rate_info: bandwidth rate information
  588. * @chainmask_info: Chainmask information
  589. * @powersave_info: Power save parameters
  590. * @beacon_info: beacon buffer information
  591. * @mbss_11ax: MBSS 11ax information
  592. */
  593. struct vdev_mlme_mgmt {
  594. struct vdev_mlme_mgmt_generic generic;
  595. struct vdev_mlme_mgmt_ap ap;
  596. struct vdev_mlme_mgmt_sta sta;
  597. struct vdev_mlme_inactivity_params inactivity_params;
  598. struct vdev_mlme_rate_info rate_info;
  599. struct vdev_mlme_chainmask_info chainmask_info;
  600. struct vdev_mlme_powersave_info powersave_info;
  601. struct vdev_mlme_beacon_info beacon_info;
  602. struct vdev_mlme_mbss_11ax mbss_11ax;
  603. };
  604. /**
  605. * enum beacon_update_op - Beacon update op type
  606. * @BEACON_INIT: Initialize beacon
  607. * @BEACON_REINIT: Re-initialize beacon
  608. * @BEACON_UPDATE: Update dynamic fields of beacon
  609. * @BEACON_CSA: Enable CSA IE
  610. * @BEACON_FREE: Beacon buffer free
  611. */
  612. enum beacon_update_op {
  613. BEACON_INIT,
  614. BEACON_REINIT,
  615. BEACON_UPDATE,
  616. BEACON_CSA,
  617. BEACON_FREE,
  618. };
  619. /**
  620. * enum vdev_cmd_type - Command type
  621. * @START_REQ: Start request
  622. * @RESTART_REQ: Restart request
  623. * @STOP_REQ: STOP request
  624. * @DELETE_REQ: DELETE request
  625. */
  626. enum vdev_cmd_type {
  627. START_REQ,
  628. RESTART_REQ,
  629. STOP_REQ,
  630. DELETE_REQ,
  631. };
  632. /**
  633. * enum vdev_start_resp_type - start respone type
  634. * @START_RESPONSE: Start response
  635. * @RESTART_RESPONSE: Restart response
  636. */
  637. enum vdev_start_resp_type {
  638. START_RESPONSE = 0,
  639. RESTART_RESPONSE,
  640. };
  641. /**
  642. * struct vdev_mlme_ops - VDEV MLME operation callbacks structure
  643. * @mlme_vdev_validate_basic_params: callback to validate VDEV basic params
  644. * @mlme_vdev_reset_proto_params: callback to Reset protocol params
  645. * @mlme_vdev_start_send: callback to initiate actions of VDEV
  646. * MLME start operation
  647. * @mlme_vdev_restart_send: callback to initiate actions of VDEV
  648. * MLME restart operation
  649. * @mlme_vdev_stop_start_send: callback to block start/restart VDEV
  650. * request command
  651. * @mlme_vdev_start_continue: callback to initiate operations on
  652. * LMAC/FW start response
  653. * @mlme_vdev_sta_conn_start: callback to initiate STA connection
  654. * @mlme_vdev_start_req_failed:
  655. * @mlme_vdev_up_send: callback to initiate actions of VDEV
  656. * MLME up operation
  657. * @mlme_vdev_notify_up_complete: callback to notify VDEV MLME on moving
  658. * to UP state
  659. * @mlme_vdev_notify_roam_start: callback to initiate roaming
  660. * @mlme_vdev_update_beacon: callback to initiate beacon update
  661. * @mlme_vdev_disconnect_peers: callback to initiate disconnection of
  662. * peers
  663. * @mlme_vdev_dfs_cac_timer_stop: callback to stop the DFS CAC timer
  664. * @mlme_vdev_stop_send: callback to initiate actions of VDEV
  665. * MLME stop operation
  666. * @mlme_vdev_stop_continue: callback to initiate operations on
  667. * LMAC/FW stop response
  668. * @mlme_vdev_bss_peer_delete_continue: callback to initiate operations on BSS
  669. * peer delete completion
  670. * @mlme_vdev_down_send: callback to initiate actions of VDEV
  671. * MLME down operation
  672. * @mlme_vdev_notify_down_complete:
  673. * @mlme_vdev_ext_stop_rsp:
  674. * @mlme_vdev_ext_start_rsp:
  675. * @mlme_vdev_notify_start_state_exit: callback to notify on vdev start
  676. * start state exit
  677. * @mlme_vdev_is_newchan_no_cac: callback to check CAC is required
  678. * @mlme_vdev_ext_peer_delete_all_rsp: callback to initiate actions for
  679. * vdev mlme peer delete all response
  680. * @mlme_vdev_dfs_cac_wait_notify: callback to notify about CAC state
  681. * @mlme_vdev_csa_complete: callback to indicate CSA complete
  682. * @mlme_vdev_sta_disconn_start: callback to initiate STA disconnection
  683. * @mlme_vdev_reconfig_notify: callback to notify ml reconfing link
  684. * delete start operation after receive
  685. * the first ml reconfig IE
  686. * @mlme_vdev_reconfig_timer_complete: callback to process ml reconfing
  687. * operation
  688. * @mlme_vdev_notify_mlo_sync_wait_entry:
  689. */
  690. struct vdev_mlme_ops {
  691. QDF_STATUS (*mlme_vdev_validate_basic_params)(
  692. struct vdev_mlme_obj *vdev_mlme,
  693. uint16_t event_data_len, void *event_data);
  694. QDF_STATUS (*mlme_vdev_reset_proto_params)(
  695. struct vdev_mlme_obj *vdev_mlme,
  696. uint16_t event_data_len, void *event_data);
  697. QDF_STATUS (*mlme_vdev_start_send)(
  698. struct vdev_mlme_obj *vdev_mlme,
  699. uint16_t event_data_len, void *event_data);
  700. QDF_STATUS (*mlme_vdev_restart_send)(
  701. struct vdev_mlme_obj *vdev_mlme,
  702. uint16_t event_data_len, void *event_data);
  703. QDF_STATUS (*mlme_vdev_stop_start_send)(
  704. struct vdev_mlme_obj *vdev_mlme,
  705. enum vdev_cmd_type type,
  706. uint16_t event_data_len, void *event_data);
  707. QDF_STATUS (*mlme_vdev_start_continue)(
  708. struct vdev_mlme_obj *vdev_mlme,
  709. uint16_t event_data_len, void *event_data);
  710. QDF_STATUS (*mlme_vdev_sta_conn_start)(
  711. struct vdev_mlme_obj *vdev_mlme,
  712. uint16_t event_data_len, void *event_data);
  713. QDF_STATUS (*mlme_vdev_start_req_failed)(
  714. struct vdev_mlme_obj *vdev_mlme,
  715. uint16_t event_data_len, void *event_data);
  716. QDF_STATUS (*mlme_vdev_up_send)(
  717. struct vdev_mlme_obj *vdev_mlme,
  718. uint16_t event_data_len, void *event_data);
  719. QDF_STATUS (*mlme_vdev_notify_up_complete)(
  720. struct vdev_mlme_obj *vdev_mlme,
  721. uint16_t event_data_len, void *event_data);
  722. QDF_STATUS (*mlme_vdev_notify_roam_start)(
  723. struct vdev_mlme_obj *vdev_mlme,
  724. uint16_t event_data_len, void *event_data);
  725. QDF_STATUS (*mlme_vdev_update_beacon)(
  726. struct vdev_mlme_obj *vdev_mlme,
  727. enum beacon_update_op op,
  728. uint16_t event_data_len, void *event_data);
  729. QDF_STATUS (*mlme_vdev_disconnect_peers)(
  730. struct vdev_mlme_obj *vdev_mlme,
  731. uint16_t event_data_len, void *event_data,
  732. bool discon_legacy_only);
  733. QDF_STATUS (*mlme_vdev_dfs_cac_timer_stop)(
  734. struct vdev_mlme_obj *vdev_mlme,
  735. uint16_t event_data_len, void *event_data);
  736. QDF_STATUS (*mlme_vdev_stop_send)(
  737. struct vdev_mlme_obj *vdev_mlme,
  738. uint16_t event_data_len, void *event_data);
  739. QDF_STATUS (*mlme_vdev_stop_continue)(
  740. struct vdev_mlme_obj *vdev_mlme,
  741. uint16_t event_data_len, void *event_data);
  742. QDF_STATUS (*mlme_vdev_down_send)(
  743. struct vdev_mlme_obj *vdev_mlme,
  744. uint16_t event_data_len, void *event_data);
  745. QDF_STATUS (*mlme_vdev_notify_down_complete)(
  746. struct vdev_mlme_obj *vdev_mlme,
  747. uint16_t event_data_len, void *event_data);
  748. QDF_STATUS (*mlme_vdev_ext_stop_rsp)(
  749. struct vdev_mlme_obj *vdev_mlme,
  750. struct vdev_stop_response *rsp);
  751. QDF_STATUS (*mlme_vdev_ext_start_rsp)(
  752. struct vdev_mlme_obj *vdev_mlme,
  753. struct vdev_start_response *rsp);
  754. QDF_STATUS (*mlme_vdev_notify_start_state_exit)(
  755. struct vdev_mlme_obj *vdev_mlme);
  756. QDF_STATUS (*mlme_vdev_is_newchan_no_cac)(
  757. struct vdev_mlme_obj *vdev_mlme);
  758. QDF_STATUS (*mlme_vdev_ext_peer_delete_all_rsp)(
  759. struct vdev_mlme_obj *vdev_mlme,
  760. struct peer_delete_all_response *rsp);
  761. QDF_STATUS (*mlme_vdev_dfs_cac_wait_notify)(
  762. struct vdev_mlme_obj *vdev_mlme);
  763. QDF_STATUS (*mlme_vdev_csa_complete)(
  764. struct vdev_mlme_obj *vdev_mlme);
  765. QDF_STATUS (*mlme_vdev_sta_disconn_start)(
  766. struct vdev_mlme_obj *vdev_mlme,
  767. uint16_t event_data_len, void *event_data);
  768. QDF_STATUS (*mlme_vdev_reconfig_notify)(
  769. struct vdev_mlme_obj *vdev_mlme,
  770. uint16_t *tbtt_count, uint16_t bcn_int);
  771. void (*mlme_vdev_reconfig_timer_complete)(
  772. struct vdev_mlme_obj *vdev_mlme);
  773. QDF_STATUS (*mlme_vdev_notify_mlo_sync_wait_entry)(
  774. struct vdev_mlme_obj *vdev_mlme);
  775. };
  776. /**
  777. * struct vdev_mlme_obj - VDEV MLME component object
  778. * @proto: VDEV MLME proto substructure
  779. * @mgmt: VDEV MLME mgmt substructure
  780. * @sm_lock: VDEV SM lock
  781. * @vdev_cmd_lock: VDEV MLME command atomicity
  782. * @sm_hdl: VDEV SM handle
  783. * @cnx_mgr_ctx: connection manager context, valid for STA and P2P-CLI mode only
  784. * @vdev: Pointer to vdev objmgr
  785. * @ops: VDEV MLME callback table
  786. * @ext_vdev_ptr: VDEV MLME legacy pointer
  787. * @reg_tpc_obj: Regulatory transmit power info
  788. * @ml_reconfig_timer: VDEV ml reconfig timer
  789. * @ml_reconfig_started: Flag to indicate reconfig status for vdev
  790. */
  791. struct vdev_mlme_obj {
  792. struct vdev_mlme_proto proto;
  793. struct vdev_mlme_mgmt mgmt;
  794. #ifdef VDEV_SM_LOCK_SUPPORT
  795. qdf_spinlock_t sm_lock;
  796. qdf_mutex_t vdev_cmd_lock;
  797. #endif
  798. struct wlan_sm *sm_hdl;
  799. union {
  800. struct cnx_mgr *cnx_mgr_ctx;
  801. };
  802. struct wlan_objmgr_vdev *vdev;
  803. struct vdev_mlme_ops *ops;
  804. mlme_vdev_ext_t *ext_vdev_ptr;
  805. struct reg_tpc_power_info reg_tpc_obj;
  806. qdf_timer_t ml_reconfig_timer;
  807. bool ml_reconfig_started;
  808. };
  809. /**
  810. * wlan_vdev_mlme_set_ssid() - set ssid
  811. * @vdev: VDEV object
  812. * @ssid: SSID (input)
  813. * @ssid_len: Length of SSID
  814. *
  815. * API to set the SSID of VDEV
  816. *
  817. * Caller need to acquire lock with wlan_vdev_obj_lock()
  818. *
  819. * Return: QDF_STATUS_SUCCESS, if update is done
  820. * QDF_STATUS error, if ssid length is > max ssid len
  821. */
  822. static inline QDF_STATUS wlan_vdev_mlme_set_ssid(
  823. struct wlan_objmgr_vdev *vdev,
  824. const uint8_t *ssid, uint8_t ssid_len)
  825. {
  826. struct vdev_mlme_obj *vdev_mlme;
  827. /* This API is invoked with lock acquired, do not add log prints */
  828. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  829. if (!vdev_mlme)
  830. return QDF_STATUS_E_FAILURE;
  831. if (ssid_len <= WLAN_SSID_MAX_LEN) {
  832. qdf_mem_copy(vdev_mlme->mgmt.generic.ssid, ssid, ssid_len);
  833. vdev_mlme->mgmt.generic.ssid_len = ssid_len;
  834. } else {
  835. vdev_mlme->mgmt.generic.ssid_len = 0;
  836. return QDF_STATUS_E_FAILURE;
  837. }
  838. return QDF_STATUS_SUCCESS;
  839. }
  840. /**
  841. * wlan_vdev_mlme_get_ssid() - get ssid
  842. * @vdev: VDEV object
  843. * @ssid: SSID
  844. * @ssid_len: Length of SSID
  845. *
  846. * API to get the SSID of VDEV, it updates the SSID and its length
  847. * in @ssid, @ssid_len respectively
  848. *
  849. * Caller need to acquire lock with wlan_vdev_obj_lock()
  850. *
  851. * Return: SUCCESS, if update is done
  852. * FAILURE, if ssid length is > max ssid len
  853. */
  854. static inline QDF_STATUS wlan_vdev_mlme_get_ssid(
  855. struct wlan_objmgr_vdev *vdev,
  856. uint8_t *ssid, uint8_t *ssid_len)
  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 QDF_STATUS_E_FAILURE;
  863. if (vdev_mlme->mgmt.generic.ssid_len > 0) {
  864. *ssid_len = vdev_mlme->mgmt.generic.ssid_len;
  865. qdf_mem_copy(ssid, vdev_mlme->mgmt.generic.ssid, *ssid_len);
  866. } else {
  867. *ssid_len = 0;
  868. return QDF_STATUS_E_FAILURE;
  869. }
  870. return QDF_STATUS_SUCCESS;
  871. }
  872. /**
  873. * wlan_vdev_mlme_set_nss() - set NSS
  874. * @vdev: VDEV object
  875. * @nss: nss configured by user
  876. *
  877. * API to set the Number of Spatial streams
  878. *
  879. * Return: void
  880. */
  881. static inline void wlan_vdev_mlme_set_nss(
  882. struct wlan_objmgr_vdev *vdev,
  883. uint8_t nss)
  884. {
  885. struct vdev_mlme_obj *vdev_mlme;
  886. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  887. if (!vdev_mlme)
  888. return;
  889. vdev_mlme->proto.generic.nss = nss;
  890. }
  891. /**
  892. * wlan_vdev_mlme_get_nss() - get NSS
  893. * @vdev: VDEV object
  894. *
  895. * API to get the Number of Spatial Streams
  896. *
  897. * Return: nss value
  898. */
  899. static inline uint8_t wlan_vdev_mlme_get_nss(
  900. struct wlan_objmgr_vdev *vdev)
  901. {
  902. struct vdev_mlme_obj *vdev_mlme;
  903. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  904. if (!vdev_mlme)
  905. return 0;
  906. return vdev_mlme->proto.generic.nss;
  907. }
  908. /**
  909. * wlan_vdev_mlme_set_txchainmask() - set Tx chainmask
  910. * @vdev: VDEV object
  911. * @chainmask : chainmask either configured by user or max supported
  912. *
  913. * API to set the Tx chainmask
  914. *
  915. * Return: void
  916. */
  917. static inline void wlan_vdev_mlme_set_txchainmask(
  918. struct wlan_objmgr_vdev *vdev,
  919. uint8_t chainmask)
  920. {
  921. struct vdev_mlme_obj *vdev_mlme;
  922. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  923. if (!vdev_mlme)
  924. return;
  925. vdev_mlme->mgmt.chainmask_info.tx_chainmask = chainmask;
  926. }
  927. /**
  928. * wlan_vdev_mlme_get_txchainmask() - get Tx chainmask
  929. * @vdev: VDEV object
  930. *
  931. * API to get the Tx chainmask
  932. *
  933. * Return: Tx chainmask either configured by user or max supported
  934. */
  935. static inline uint8_t wlan_vdev_mlme_get_txchainmask(
  936. struct wlan_objmgr_vdev *vdev)
  937. {
  938. struct vdev_mlme_obj *vdev_mlme;
  939. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  940. if (!vdev_mlme)
  941. return 0;
  942. return vdev_mlme->mgmt.chainmask_info.tx_chainmask;
  943. }
  944. /**
  945. * wlan_vdev_mlme_set_rxchainmask() - set Rx chainmask
  946. * @vdev: VDEV object
  947. * @chainmask : Rx chainmask either configured by user or max supported
  948. *
  949. * API to set the Rx chainmask
  950. *
  951. * Return: void
  952. */
  953. static inline void wlan_vdev_mlme_set_rxchainmask(
  954. struct wlan_objmgr_vdev *vdev,
  955. uint8_t chainmask)
  956. {
  957. struct vdev_mlme_obj *vdev_mlme;
  958. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  959. if (!vdev_mlme)
  960. return;
  961. vdev_mlme->mgmt.chainmask_info.rx_chainmask = chainmask;
  962. }
  963. /**
  964. * wlan_vdev_mlme_get_rxchainmask() - get Rx chainmask
  965. * @vdev: VDEV object
  966. *
  967. * API to get the Rx chainmask
  968. *
  969. * Return: Rx chainmask either configured by user or max supported
  970. */
  971. static inline uint8_t wlan_vdev_mlme_get_rxchainmask(
  972. struct wlan_objmgr_vdev *vdev)
  973. {
  974. struct vdev_mlme_obj *vdev_mlme;
  975. /* This API is invoked with lock acquired, do not add log prints */
  976. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  977. if (!vdev_mlme)
  978. return 0;
  979. return vdev_mlme->mgmt.chainmask_info.rx_chainmask;
  980. }
  981. /**
  982. * wlan_vdev_mlme_set_txpower() - set tx power
  983. * @vdev: VDEV object
  984. * @txpow: tx power either configured by used or max allowed
  985. *
  986. * API to set the tx power
  987. *
  988. * Return: void
  989. */
  990. static inline void wlan_vdev_mlme_set_txpower(
  991. struct wlan_objmgr_vdev *vdev,
  992. uint8_t txpow)
  993. {
  994. struct vdev_mlme_obj *vdev_mlme;
  995. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  996. if (!vdev_mlme)
  997. return;
  998. vdev_mlme->mgmt.generic.tx_power = txpow;
  999. }
  1000. /**
  1001. * wlan_vdev_mlme_get_txpower() - get tx power
  1002. * @vdev: VDEV object
  1003. *
  1004. * API to get the tx power
  1005. *
  1006. * Return: tx power either configured by used or max allowed
  1007. */
  1008. static inline uint8_t wlan_vdev_mlme_get_txpower(
  1009. struct wlan_objmgr_vdev *vdev)
  1010. {
  1011. struct vdev_mlme_obj *vdev_mlme;
  1012. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1013. if (!vdev_mlme)
  1014. return 0;
  1015. return vdev_mlme->mgmt.generic.tx_power;
  1016. }
  1017. /**
  1018. * wlan_vdev_mlme_set_maxrate() - set max rate
  1019. * @vdev: VDEV object
  1020. * @maxrate: configured by used or based on configured mode
  1021. *
  1022. * API to set the max rate the vdev supports
  1023. *
  1024. * Return: void
  1025. */
  1026. static inline void wlan_vdev_mlme_set_maxrate(
  1027. struct wlan_objmgr_vdev *vdev,
  1028. uint32_t maxrate)
  1029. {
  1030. struct vdev_mlme_obj *vdev_mlme;
  1031. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1032. if (!vdev_mlme)
  1033. return;
  1034. vdev_mlme->mgmt.rate_info.max_rate = maxrate;
  1035. }
  1036. /**
  1037. * wlan_vdev_mlme_get_maxrate() - get max rate
  1038. * @vdev: VDEV object
  1039. *
  1040. * API to get the max rate the vdev supports
  1041. *
  1042. * Return: configured by used or based on configured mode
  1043. */
  1044. static inline uint32_t wlan_vdev_mlme_get_maxrate(
  1045. struct wlan_objmgr_vdev *vdev)
  1046. {
  1047. struct vdev_mlme_obj *vdev_mlme;
  1048. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1049. if (!vdev_mlme)
  1050. return 0;
  1051. return vdev_mlme->mgmt.rate_info.max_rate;
  1052. }
  1053. /**
  1054. * wlan_vdev_mlme_set_txmgmtrate() - set txmgmtrate
  1055. * @vdev: VDEV object
  1056. * @txmgmtrate: Tx Mgmt rate
  1057. *
  1058. * API to set Mgmt Tx rate
  1059. *
  1060. * Return: void
  1061. */
  1062. static inline void wlan_vdev_mlme_set_txmgmtrate(
  1063. struct wlan_objmgr_vdev *vdev,
  1064. uint32_t txmgmtrate)
  1065. {
  1066. struct vdev_mlme_obj *vdev_mlme;
  1067. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1068. if (!vdev_mlme)
  1069. return;
  1070. vdev_mlme->mgmt.rate_info.tx_mgmt_rate = txmgmtrate;
  1071. }
  1072. /**
  1073. * wlan_vdev_mlme_get_txmgmtrate() - get txmgmtrate
  1074. * @vdev: VDEV object
  1075. *
  1076. * API to get Mgmt Tx rate
  1077. *
  1078. * Return: Tx Mgmt rate
  1079. */
  1080. static inline uint32_t wlan_vdev_mlme_get_txmgmtrate(
  1081. struct wlan_objmgr_vdev *vdev)
  1082. {
  1083. struct vdev_mlme_obj *vdev_mlme;
  1084. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1085. if (!vdev_mlme)
  1086. return 0;
  1087. return vdev_mlme->mgmt.rate_info.tx_mgmt_rate;
  1088. }
  1089. /**
  1090. * wlan_vdev_mlme_is_special_vdev() - check given vdev is a special vdev
  1091. * @vdev: VDEV object
  1092. *
  1093. * API to check given vdev is a special vdev.
  1094. *
  1095. * Return: true if given vdev is special vdev, else false
  1096. */
  1097. static inline bool wlan_vdev_mlme_is_special_vdev(
  1098. struct wlan_objmgr_vdev *vdev)
  1099. {
  1100. struct vdev_mlme_obj *vdev_mlme;
  1101. if (!vdev)
  1102. return false;
  1103. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1104. if (!vdev_mlme)
  1105. return false;
  1106. return vdev_mlme->mgmt.generic.special_vdev_mode;
  1107. }
  1108. /**
  1109. * wlan_vdev_mlme_is_sap_go_move_before_sta() - check if SAP / GO
  1110. * moved to new channel before STA's movement upon receiving CSA
  1111. *
  1112. * @vdev: VDEV object
  1113. *
  1114. * API to check in STA+SAP/GO SCC concurrency, whether SAP / GO moved before
  1115. * STA's movement on receiving CSA from peer AP to connected STA.
  1116. *
  1117. * Return: true if SAP / GO moved before STA else false
  1118. */
  1119. static inline
  1120. bool wlan_vdev_mlme_is_sap_go_move_before_sta(struct wlan_objmgr_vdev *vdev)
  1121. {
  1122. struct vdev_mlme_obj *vdev_mlme;
  1123. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1124. if (!vdev_mlme)
  1125. return false;
  1126. return vdev_mlme->mgmt.generic.is_sap_go_moved_1st_on_csa;
  1127. }
  1128. /**
  1129. * wlan_vdev_mlme_set_sap_go_move_before_sta() - Set flag if SAP / GO
  1130. * moves to new channel before STA's movement upon receiving CSA
  1131. *
  1132. * @vdev: VDEV object
  1133. * @sap_go_moved_before_sta: Flag to indicate True when SAP / GO
  1134. * moves before STA
  1135. *
  1136. * API to set True in STA+SAP/GO SCC concurrency, when SAP / GO moves before
  1137. * STA's movement on receiving CSA from peer AP to connected STA.
  1138. *
  1139. * Return: void
  1140. */
  1141. static inline
  1142. void wlan_vdev_mlme_set_sap_go_move_before_sta(struct wlan_objmgr_vdev *vdev,
  1143. bool sap_go_moved_before_sta)
  1144. {
  1145. struct vdev_mlme_obj *vdev_mlme;
  1146. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1147. if (!vdev_mlme)
  1148. return;
  1149. vdev_mlme->mgmt.generic.is_sap_go_moved_1st_on_csa =
  1150. sap_go_moved_before_sta;
  1151. }
  1152. #ifdef WLAN_FEATURE_11AX
  1153. /**
  1154. * wlan_vdev_mlme_set_he_mcs_12_13_map() - set he mcs12/13 map
  1155. * @vdev: VDEV object
  1156. * @he_mcs_12_13_map: he mcs12/13 map from self&peer
  1157. *
  1158. * API to set he mcs 12/13 map
  1159. *
  1160. * Return: void
  1161. */
  1162. static inline void wlan_vdev_mlme_set_he_mcs_12_13_map(
  1163. struct wlan_objmgr_vdev *vdev,
  1164. uint16_t he_mcs_12_13_map)
  1165. {
  1166. struct vdev_mlme_obj *vdev_mlme;
  1167. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1168. if (!vdev_mlme)
  1169. return;
  1170. vdev_mlme->mgmt.sta.he_mcs_12_13_map = he_mcs_12_13_map;
  1171. }
  1172. /**
  1173. * wlan_vdev_mlme_get_he_mcs_12_13_map() - get he mcs12/13 map
  1174. * @vdev: VDEV object
  1175. *
  1176. * API to get he mcs12/13 support capability
  1177. *
  1178. * Return: he mcs12/13 map
  1179. */
  1180. static inline uint16_t wlan_vdev_mlme_get_he_mcs_12_13_map(
  1181. struct wlan_objmgr_vdev *vdev)
  1182. {
  1183. struct vdev_mlme_obj *vdev_mlme;
  1184. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1185. if (!vdev_mlme)
  1186. return 0;
  1187. return vdev_mlme->mgmt.sta.he_mcs_12_13_map;
  1188. }
  1189. #ifdef WLAN_FEATURE_SR
  1190. /**
  1191. * wlan_vdev_mlme_get_sr_ctrl() - get spatial reuse SR control
  1192. * @vdev: VDEV object
  1193. *
  1194. * API to retrieve the spatial reuse SR control from VDEV
  1195. *
  1196. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1197. *
  1198. * Return: SR control
  1199. */
  1200. static inline uint8_t wlan_vdev_mlme_get_sr_ctrl(struct wlan_objmgr_vdev *vdev)
  1201. {
  1202. struct vdev_mlme_obj *vdev_mlme;
  1203. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1204. if (!vdev_mlme)
  1205. return 0;
  1206. return vdev_mlme->mgmt.generic.he_spr_sr_ctrl;
  1207. }
  1208. /**
  1209. * wlan_vdev_mlme_get_non_srg_pd_offset() - get spatial reuse non srg pd offset
  1210. * @vdev: VDEV object
  1211. *
  1212. * API to retrieve the spatial reuse pd offset from VDEV
  1213. *
  1214. * Return: max non srg pd offset
  1215. */
  1216. static inline uint8_t wlan_vdev_mlme_get_non_srg_pd_offset(
  1217. struct wlan_objmgr_vdev *vdev)
  1218. {
  1219. struct vdev_mlme_obj *vdev_mlme;
  1220. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1221. if (!vdev_mlme)
  1222. return 0;
  1223. return vdev_mlme->mgmt.generic.he_spr_non_srg_pd_max_offset;
  1224. }
  1225. /**
  1226. * wlan_vdev_mlme_get_he_spr_enabled() - spatial reuse enabled or not
  1227. * @vdev: VDEV object
  1228. *
  1229. * API to check whether the spatial reuse enabled or not
  1230. *
  1231. * Return: true if Spatial reuse enabled, false if not
  1232. */
  1233. static inline bool wlan_vdev_mlme_get_he_spr_enabled(
  1234. struct wlan_objmgr_vdev *vdev)
  1235. {
  1236. struct vdev_mlme_obj *vdev_mlme;
  1237. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1238. if (!vdev_mlme)
  1239. return false;
  1240. return vdev_mlme->mgmt.generic.he_spr_enabled;
  1241. }
  1242. /**
  1243. * wlan_vdev_mlme_is_sr_disable_due_conc() - spatial reuse disabled due
  1244. * to concurrency
  1245. * @vdev: VDEV object
  1246. *
  1247. * API to check whether the spatial reuse disabled due to concurrency or not
  1248. *
  1249. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1250. *
  1251. * Return:
  1252. * true/false: true if spatial reuse disabled due to concurrency else false
  1253. */
  1254. static inline
  1255. bool wlan_vdev_mlme_is_sr_disable_due_conc(struct wlan_objmgr_vdev *vdev)
  1256. {
  1257. struct vdev_mlme_obj *vdev_mlme;
  1258. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1259. if (!vdev_mlme)
  1260. return false;
  1261. return vdev_mlme->mgmt.generic.he_spr_disabled_due_conc;
  1262. }
  1263. /**
  1264. * wlan_vdev_mlme_is_sr_prohibit_en() - spatial reuse PD prohibit enabled
  1265. * / disabled (HE_SIGA_Val15_Allowed)
  1266. * @vdev: VDEV object
  1267. *
  1268. * API to check whether the spatial reuse PD prohibit is enabled / disabled
  1269. *
  1270. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1271. *
  1272. * Return: true/false: Spatial reuse PD prohibit enabled / disabled
  1273. */
  1274. static inline
  1275. bool wlan_vdev_mlme_is_sr_prohibit_en(struct wlan_objmgr_vdev *vdev)
  1276. {
  1277. struct vdev_mlme_obj *vdev_mlme;
  1278. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1279. if (!vdev_mlme)
  1280. return false;
  1281. return vdev_mlme->mgmt.generic.sr_prohibit_enabled;
  1282. }
  1283. /**
  1284. * wlan_vdev_mlme_set_sr_ctrl() - set spatial reuse SR control
  1285. * @vdev: VDEV object
  1286. * @sr_ctrl: value to set
  1287. *
  1288. * API to set the spatial reuse SR control
  1289. *
  1290. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1291. *
  1292. * Return: void
  1293. */
  1294. static inline void wlan_vdev_mlme_set_sr_ctrl(struct wlan_objmgr_vdev *vdev,
  1295. uint8_t sr_ctrl)
  1296. {
  1297. struct vdev_mlme_obj *vdev_mlme;
  1298. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1299. if (!vdev_mlme)
  1300. return;
  1301. vdev_mlme->mgmt.generic.he_spr_sr_ctrl = sr_ctrl;
  1302. }
  1303. /**
  1304. * wlan_vdev_mlme_set_non_srg_pd_offset() - set spatial reuse non srg
  1305. * pd max offset
  1306. * @vdev: VDEV object
  1307. * @non_srg_pd_max_offset: value to set
  1308. *
  1309. * API to set the spatial reuse pd max offset
  1310. *
  1311. * Return: void
  1312. */
  1313. static inline void
  1314. wlan_vdev_mlme_set_non_srg_pd_offset(struct wlan_objmgr_vdev *vdev,
  1315. uint8_t non_srg_pd_max_offset)
  1316. {
  1317. struct vdev_mlme_obj *vdev_mlme;
  1318. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1319. if (!vdev_mlme)
  1320. return;
  1321. vdev_mlme->mgmt.generic.he_spr_non_srg_pd_max_offset =
  1322. non_srg_pd_max_offset;
  1323. }
  1324. /**
  1325. * wlan_vdev_mlme_set_he_spr_enabled() - set spatial reuse enabled
  1326. * @vdev: VDEV object
  1327. * @enable_he_spr: value to set
  1328. *
  1329. * API to set the spatial reuse enabled
  1330. *
  1331. * Return: void
  1332. */
  1333. static inline void wlan_vdev_mlme_set_he_spr_enabled(
  1334. struct wlan_objmgr_vdev *vdev,
  1335. bool enable_he_spr)
  1336. {
  1337. struct vdev_mlme_obj *vdev_mlme;
  1338. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1339. if (!vdev_mlme)
  1340. return;
  1341. vdev_mlme->mgmt.generic.he_spr_enabled = enable_he_spr;
  1342. }
  1343. /**
  1344. * wlan_vdev_mlme_set_sr_disable_due_conc() - set spatial reuse disabled due
  1345. * to concurrency
  1346. * @vdev: VDEV object
  1347. * @he_spr_disabled_due_conc: value to set
  1348. *
  1349. * API to set the spatial reuse disabled due to concurrency
  1350. *
  1351. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1352. *
  1353. * Return: void
  1354. */
  1355. static inline
  1356. void wlan_vdev_mlme_set_sr_disable_due_conc(struct wlan_objmgr_vdev *vdev,
  1357. bool he_spr_disabled_due_conc)
  1358. {
  1359. struct vdev_mlme_obj *vdev_mlme;
  1360. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1361. if (!vdev_mlme)
  1362. return;
  1363. vdev_mlme->mgmt.generic.he_spr_disabled_due_conc =
  1364. he_spr_disabled_due_conc;
  1365. }
  1366. /**
  1367. * wlan_vdev_mlme_set_sr_prohibit_en() - set spatial reuse PD prohibit enabled
  1368. * / disabled (HE_SIGA_Val15_Allowed)
  1369. * @vdev: VDEV object
  1370. * @sr_prohibit_enabled: True / False - PD Prohibit enabled / disabled
  1371. *
  1372. * API to set spatial reuse PD prohibit enabled / disabled
  1373. *
  1374. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1375. *
  1376. * Return: void
  1377. */
  1378. static inline
  1379. void wlan_vdev_mlme_set_sr_prohibit_en(struct wlan_objmgr_vdev *vdev,
  1380. bool sr_prohibit_enabled)
  1381. {
  1382. struct vdev_mlme_obj *vdev_mlme;
  1383. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1384. if (!vdev_mlme)
  1385. return;
  1386. vdev_mlme->mgmt.generic.sr_prohibit_enabled = sr_prohibit_enabled;
  1387. }
  1388. /**
  1389. * wlan_vdev_mlme_set_srg_pd_offset() - set spatial reuse SRG pd max/min offset
  1390. * @vdev: VDEV object
  1391. * @srg_max_pd_offset: SRG max pd offset
  1392. * @srg_min_pd_offset: SRG min pd offset
  1393. *
  1394. * API to set the spatial reuse SRG pd min max offset
  1395. *
  1396. * Return: void
  1397. */
  1398. static inline
  1399. void wlan_vdev_mlme_set_srg_pd_offset(struct wlan_objmgr_vdev *vdev,
  1400. uint8_t srg_max_pd_offset,
  1401. uint8_t srg_min_pd_offset)
  1402. {
  1403. struct vdev_mlme_obj *vdev_mlme;
  1404. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1405. if (!vdev_mlme)
  1406. return;
  1407. vdev_mlme->mgmt.generic.he_spr_srg_max_pd_offset = srg_max_pd_offset;
  1408. vdev_mlme->mgmt.generic.he_spr_srg_min_pd_offset = srg_min_pd_offset;
  1409. }
  1410. /**
  1411. * wlan_vdev_mlme_get_srg_pd_offset() - get spatial reuse SRG pd min/max offset
  1412. * @vdev: VDEV object
  1413. * @srg_max_pd_offset: SRG max pd offset
  1414. * @srg_min_pd_offset: SRG min pd offset
  1415. *
  1416. * API to set the spatial reuse SRG pd min max offset
  1417. *
  1418. * Return: void
  1419. */
  1420. static inline
  1421. void wlan_vdev_mlme_get_srg_pd_offset(struct wlan_objmgr_vdev *vdev,
  1422. uint8_t *srg_max_pd_offset,
  1423. uint8_t *srg_min_pd_offset)
  1424. {
  1425. struct vdev_mlme_obj *vdev_mlme;
  1426. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1427. if (!vdev_mlme)
  1428. return;
  1429. *srg_max_pd_offset = vdev_mlme->mgmt.generic.he_spr_srg_max_pd_offset;
  1430. *srg_min_pd_offset = vdev_mlme->mgmt.generic.he_spr_srg_min_pd_offset;
  1431. }
  1432. /**
  1433. * wlan_vdev_mlme_set_srg_bss_color_bit_map() - set spatial reuse bss
  1434. * color bitmap
  1435. * @vdev: VDEV object
  1436. * @srg_bss_color: SRG BSS color bitmap
  1437. *
  1438. * API to set the spatial reuse bss color bit map
  1439. *
  1440. * Return: void
  1441. */
  1442. static inline
  1443. void wlan_vdev_mlme_set_srg_bss_color_bit_map(struct wlan_objmgr_vdev *vdev,
  1444. uint64_t srg_bss_color)
  1445. {
  1446. struct vdev_mlme_obj *vdev_mlme;
  1447. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1448. if (!vdev_mlme)
  1449. return;
  1450. vdev_mlme->mgmt.generic.srg_bss_color = srg_bss_color;
  1451. }
  1452. /**
  1453. * wlan_vdev_mlme_set_srg_partial_bssid_bit_map() - set spatial reuse
  1454. * srg partial bitmap
  1455. * @vdev: VDEV object
  1456. * @srg_partial_bssid: SRG partial BSSID bitmap
  1457. *
  1458. * API to set the spatial reuse partial bssid bitmap
  1459. *
  1460. * Return: void
  1461. */
  1462. static inline
  1463. void wlan_vdev_mlme_set_srg_partial_bssid_bit_map(struct wlan_objmgr_vdev *vdev,
  1464. uint64_t srg_partial_bssid)
  1465. {
  1466. struct vdev_mlme_obj *vdev_mlme;
  1467. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1468. if (!vdev_mlme)
  1469. return;
  1470. vdev_mlme->mgmt.generic.srg_partial_bssid = srg_partial_bssid;
  1471. }
  1472. /**
  1473. * wlan_vdev_mlme_get_srg_bss_color_bit_map() - get spatial reuse bss
  1474. * colorbitmap
  1475. * @vdev: VDEV object
  1476. * @srg_bss_color: SRG BSS color bitmap
  1477. *
  1478. * API to get the spatial reuse bss color bit map
  1479. *
  1480. * Return: void
  1481. */
  1482. static inline
  1483. void wlan_vdev_mlme_get_srg_bss_color_bit_map(struct wlan_objmgr_vdev *vdev,
  1484. uint64_t *srg_bss_color)
  1485. {
  1486. struct vdev_mlme_obj *vdev_mlme;
  1487. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1488. if (!vdev_mlme)
  1489. return;
  1490. *srg_bss_color = vdev_mlme->mgmt.generic.srg_bss_color;
  1491. }
  1492. /**
  1493. * wlan_vdev_mlme_get_srg_partial_bssid_bit_map() - get spatial reuse
  1494. * srg partial bitmap
  1495. * @vdev: VDEV object
  1496. * @srg_partial_bssid: SRG partial BSSID bitmap
  1497. *
  1498. * API to get the spatial reuse partial bssid bitmap
  1499. *
  1500. * Return: void
  1501. */
  1502. static inline void
  1503. wlan_vdev_mlme_get_srg_partial_bssid_bit_map(struct wlan_objmgr_vdev *vdev,
  1504. uint64_t *srg_partial_bssid)
  1505. {
  1506. struct vdev_mlme_obj *vdev_mlme;
  1507. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1508. if (!vdev_mlme)
  1509. return;
  1510. *srg_partial_bssid = vdev_mlme->mgmt.generic.srg_partial_bssid;
  1511. }
  1512. /**
  1513. * wlan_vdev_mlme_get_current_non_srg_pd_threshold() - get current non srg pd
  1514. * threshold
  1515. * @vdev: VDEV object
  1516. * @non_srg_pd_threshold: NON-SRG pd threshold
  1517. *
  1518. * API to get non srg pd threshold
  1519. *
  1520. * Return: void
  1521. */
  1522. static inline void
  1523. wlan_vdev_mlme_get_current_non_srg_pd_threshold(struct wlan_objmgr_vdev *vdev,
  1524. int32_t *non_srg_pd_threshold)
  1525. {
  1526. struct vdev_mlme_obj *vdev_mlme;
  1527. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1528. if (!vdev_mlme)
  1529. return;
  1530. *non_srg_pd_threshold =
  1531. vdev_mlme->mgmt.generic.he_curr_non_srg_pd_threshold;
  1532. }
  1533. /**
  1534. * wlan_vdev_mlme_get_current_srg_pd_threshold() - get current srg pd threshold
  1535. * @vdev: VDEV object
  1536. * @srg_pd_threshold: SRG pd threshold
  1537. *
  1538. * API to get srg pd threshold
  1539. *
  1540. * Return: void
  1541. */
  1542. static inline void
  1543. wlan_vdev_mlme_get_current_srg_pd_threshold(struct wlan_objmgr_vdev *vdev,
  1544. int32_t *srg_pd_threshold)
  1545. {
  1546. struct vdev_mlme_obj *vdev_mlme;
  1547. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1548. if (!vdev_mlme)
  1549. return;
  1550. *srg_pd_threshold =
  1551. vdev_mlme->mgmt.generic.he_curr_srg_pd_threshold;
  1552. }
  1553. /**
  1554. * wlan_vdev_mlme_set_current_non_srg_pd_threshold() - set current non srg pd
  1555. * threshold
  1556. * @vdev: VDEV object
  1557. * @non_srg_pd_threshold: NON-SRG pd threshold
  1558. *
  1559. * API to set non srg pd threshold
  1560. *
  1561. * Return: void
  1562. */
  1563. static inline void
  1564. wlan_vdev_mlme_set_current_non_srg_pd_threshold(struct wlan_objmgr_vdev *vdev,
  1565. int32_t non_srg_pd_threshold)
  1566. {
  1567. struct vdev_mlme_obj *vdev_mlme;
  1568. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1569. if (!vdev_mlme)
  1570. return;
  1571. vdev_mlme->mgmt.generic.he_curr_non_srg_pd_threshold =
  1572. non_srg_pd_threshold;
  1573. }
  1574. /**
  1575. * wlan_vdev_mlme_set_current_srg_pd_threshold() - set current srg pd threshold
  1576. * @vdev: VDEV object
  1577. * @srg_pd_threshold: SRG pd threshold
  1578. *
  1579. * API to set srg pd threshold
  1580. *
  1581. * Return: void
  1582. */
  1583. static inline void
  1584. wlan_vdev_mlme_set_current_srg_pd_threshold(struct wlan_objmgr_vdev *vdev,
  1585. int32_t srg_pd_threshold)
  1586. {
  1587. struct vdev_mlme_obj *vdev_mlme;
  1588. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1589. if (!vdev_mlme)
  1590. return;
  1591. vdev_mlme->mgmt.generic.he_curr_srg_pd_threshold =
  1592. srg_pd_threshold;
  1593. }
  1594. /**
  1595. * wlan_vdev_mlme_set_pd_threshold_present() - set is PD threshold
  1596. * present or not.
  1597. * @vdev: VDEV object
  1598. * @is_pd_threshold_present: is PD threshold present
  1599. *
  1600. * API to set pd threshold present flag
  1601. *
  1602. * Return: void
  1603. */
  1604. static inline void
  1605. wlan_vdev_mlme_set_pd_threshold_present(struct wlan_objmgr_vdev *vdev,
  1606. bool is_pd_threshold_present)
  1607. {
  1608. struct vdev_mlme_obj *vdev_mlme;
  1609. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1610. if (!vdev_mlme)
  1611. return;
  1612. vdev_mlme->mgmt.generic.is_pd_threshold_present =
  1613. is_pd_threshold_present;
  1614. }
  1615. /**
  1616. * wlan_vdev_mlme_get_pd_threshold_present() - get is PD threshold
  1617. * present or not.
  1618. * @vdev: VDEV object
  1619. * @is_pd_threshold_present: is PD threshold present
  1620. *
  1621. * API to get pd threshold present flag
  1622. *
  1623. * Return: void
  1624. */
  1625. static inline void
  1626. wlan_vdev_mlme_get_pd_threshold_present(struct wlan_objmgr_vdev *vdev,
  1627. bool *is_pd_threshold_present)
  1628. {
  1629. struct vdev_mlme_obj *vdev_mlme;
  1630. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1631. if (!vdev_mlme) {
  1632. *is_pd_threshold_present = false;
  1633. return;
  1634. }
  1635. *is_pd_threshold_present =
  1636. vdev_mlme->mgmt.generic.is_pd_threshold_present;
  1637. }
  1638. #else
  1639. static inline uint8_t wlan_vdev_mlme_get_sr_ctrl(struct wlan_objmgr_vdev *vdev)
  1640. {
  1641. return 0;
  1642. }
  1643. static inline uint8_t wlan_vdev_mlme_get_non_srg_pd_offset(
  1644. struct wlan_objmgr_vdev *vdev)
  1645. {
  1646. return 0;
  1647. }
  1648. static inline bool wlan_vdev_mlme_get_he_spr_enabled(
  1649. struct wlan_objmgr_vdev *vdev)
  1650. {
  1651. return 0;
  1652. }
  1653. static inline
  1654. bool wlan_vdev_mlme_is_sr_disable_due_conc(struct wlan_objmgr_vdev *vdev)
  1655. {
  1656. return false;
  1657. }
  1658. static inline
  1659. bool wlan_vdev_mlme_is_sr_prohibit_en(struct wlan_objmgr_vdev *vdev)
  1660. {
  1661. return false;
  1662. }
  1663. static inline void wlan_vdev_mlme_set_sr_ctrl(struct wlan_objmgr_vdev *vdev,
  1664. uint8_t sr_ctrl)
  1665. {
  1666. }
  1667. static inline void
  1668. wlan_vdev_mlme_set_non_srg_pd_offset(struct wlan_objmgr_vdev *vdev,
  1669. uint8_t non_srg_pd_max_offset)
  1670. {
  1671. }
  1672. static inline void wlan_vdev_mlme_set_he_spr_enabled(
  1673. struct wlan_objmgr_vdev *vdev,
  1674. bool enable_he_spr)
  1675. {
  1676. }
  1677. static inline
  1678. void wlan_vdev_mlme_set_sr_disable_due_conc(struct wlan_objmgr_vdev *vdev,
  1679. bool he_spr_disabled_due_conc)
  1680. {
  1681. }
  1682. static inline
  1683. void wlan_vdev_mlme_set_sr_prohibit_en(struct wlan_objmgr_vdev *vdev,
  1684. bool sr_prohibit_enabled)
  1685. {
  1686. }
  1687. #endif
  1688. #else
  1689. static inline void wlan_vdev_mlme_set_he_mcs_12_13_map(
  1690. struct wlan_objmgr_vdev *vdev,
  1691. uint16_t he_mcs_12_13_map)
  1692. {
  1693. }
  1694. static inline uint16_t wlan_vdev_mlme_get_he_mcs_12_13_map(
  1695. struct wlan_objmgr_vdev *vdev)
  1696. {
  1697. return 0;
  1698. }
  1699. #endif
  1700. /**
  1701. * wlan_vdev_mlme_set_aid_mgr() - set aid mgr
  1702. * @vdev: VDEV object
  1703. * @aid_mgr: AID mgr
  1704. *
  1705. * API to set AID mgr in VDEV MLME cmpt object
  1706. *
  1707. * Return: void
  1708. */
  1709. static inline void wlan_vdev_mlme_set_aid_mgr(
  1710. struct wlan_objmgr_vdev *vdev,
  1711. struct wlan_vdev_aid_mgr *aid_mgr)
  1712. {
  1713. struct vdev_mlme_obj *vdev_mlme;
  1714. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1715. if (!vdev_mlme)
  1716. return;
  1717. vdev_mlme->mgmt.ap.aid_mgr = aid_mgr;
  1718. }
  1719. /**
  1720. * wlan_vdev_mlme_get_aid_mgr() - get aid mgr
  1721. * @vdev: VDEV object
  1722. *
  1723. * API to get AID mgr in VDEV MLME cmpt object
  1724. *
  1725. * Return: aid_mgr
  1726. */
  1727. static inline struct wlan_vdev_aid_mgr *wlan_vdev_mlme_get_aid_mgr(
  1728. struct wlan_objmgr_vdev *vdev)
  1729. {
  1730. struct vdev_mlme_obj *vdev_mlme;
  1731. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1732. if (!vdev_mlme)
  1733. return NULL;
  1734. return vdev_mlme->mgmt.ap.aid_mgr;
  1735. }
  1736. #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
  1737. /**
  1738. * vdev_mgr_cdp_vdev_attach() - MLME API to attach CDP vdev
  1739. * @mlme_obj: pointer to vdev_mlme_obj
  1740. *
  1741. * Return: QDF_STATUS - Success or Failure
  1742. */
  1743. QDF_STATUS vdev_mgr_cdp_vdev_attach(struct vdev_mlme_obj *mlme_obj);
  1744. /**
  1745. * vdev_mgr_cdp_vdev_detach() - MLME API to detach CDP vdev
  1746. * @mlme_obj: pointer to vdev_mlme_obj
  1747. *
  1748. * Return: QDF_STATUS - Success or Failure
  1749. */
  1750. QDF_STATUS vdev_mgr_cdp_vdev_detach(struct vdev_mlme_obj *mlme_obj);
  1751. #endif
  1752. #endif