wlan_vdev_mlme.h 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384
  1. /*
  2. * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. /**
  17. * DOC: Define VDEV MLME structure and APIs
  18. */
  19. #ifndef _WLAN_VDEV_MLME_H_
  20. #define _WLAN_VDEV_MLME_H_
  21. #include <wlan_vdev_mgr_tgt_if_rx_defs.h>
  22. #include <wlan_objmgr_vdev_obj.h>
  23. #include <wlan_vdev_mlme_api.h>
  24. #include <wlan_ext_mlme_obj_types.h>
  25. struct vdev_mlme_obj;
  26. /* Requestor ID for multiple vdev restart */
  27. #define MULTIPLE_VDEV_RESTART_REQ_ID 0x1234
  28. /* values for vdev_type */
  29. #define WLAN_VDEV_MLME_TYPE_AP 0x1
  30. #define WLAN_VDEV_MLME_TYPE_STA 0x2
  31. #define WLAN_VDEV_MLME_TYPE_IBSS 0x3
  32. #define WLAN_VDEV_MLME_TYPE_MONITOR 0x4
  33. #define WLAN_VDEV_MLME_TYPE_NAN 0x5
  34. #define WLAN_VDEV_MLME_TYPE_OCB 0x6
  35. #define WLAN_VDEV_MLME_TYPE_NDI 0x7
  36. /* values for vdev_subtype */
  37. #define WLAN_VDEV_MLME_SUBTYPE_P2P_DEVICE 0x1
  38. #define WLAN_VDEV_MLME_SUBTYPE_P2P_CLIENT 0x2
  39. #define WLAN_VDEV_MLME_SUBTYPE_P2P_GO 0x3
  40. #define WLAN_VDEV_MLME_SUBTYPE_PROXY_STA 0x4
  41. #define WLAN_VDEV_MLME_SUBTYPE_MESH 0x5
  42. #define WLAN_VDEV_MLME_SUBTYPE_MESH_11S 0x6
  43. #define WLAN_VDEV_MLME_SUBTYPE_SMART_MONITOR 0x7
  44. /* vdev control flags (per bits) */
  45. #define WLAN_VDEV_MLME_FLAGS_NON_MBSSID_AP 0x00000001
  46. #define WLAN_VDEV_MLME_FLAGS_TRANSMIT_AP 0x00000002
  47. #define WLAN_VDEV_MLME_FLAGS_NON_TRANSMIT_AP 0x00000004
  48. /**
  49. * struct vdev_mlme_proto_generic - generic mlme proto structure
  50. * sent in frames
  51. * @dtim_period: frequency of data transmissions per beacon 1-255
  52. * @slot_time: slot time
  53. * @protection_mode: rts cts protection mode
  54. * @beacon_interval: beacon interval
  55. * @ldpc: low density parity check value
  56. * @nss: number of spatial stream
  57. * @nss_2g: 2.4GHz number of spatial stream
  58. * @nss_5g: 5GHz number of spatial stream
  59. * @tsfadjust: adjusted timer sync value
  60. */
  61. struct vdev_mlme_proto_generic {
  62. uint8_t dtim_period;
  63. uint32_t slot_time;
  64. uint32_t protection_mode;
  65. uint16_t beacon_interval;
  66. uint8_t ldpc;
  67. uint8_t nss;
  68. uint8_t nss_2g;
  69. uint8_t nss_5g;
  70. uint64_t tsfadjust;
  71. };
  72. /**
  73. * struct vdev_mlme_proto_ap - ap specific mlme protocol
  74. * @.
  75. */
  76. struct vdev_mlme_proto_ap {
  77. };
  78. /**
  79. * struct vdev_mlme_proto_sta - sta specific mlme protocol
  80. * @assoc_id: association id of station
  81. * @uapsd_cfg: uapsd configuration
  82. */
  83. struct vdev_mlme_proto_sta {
  84. uint16_t assoc_id;
  85. uint16_t uapsd_cfg;
  86. };
  87. /**
  88. * struct vdev_mlme_proto_bss_color - bss color cfg
  89. * @flags: proposed for future use cases, currently not used.
  90. * @evt_type: bss color collision event.
  91. * @current_bss_color: current bss color.
  92. * @detection_period_ms: scan interval for both AP and STA mode.
  93. * @scan_period_ms: scan period for passive scan to detect collision.
  94. * @free_slot_expiry_time_ms: FW to notify host at timer expiry after
  95. * which Host will disable the bss color.
  96. */
  97. struct vdev_mlme_proto_bss_color {
  98. uint32_t flags;
  99. uint8_t evt_type;
  100. uint32_t current_bss_color;
  101. uint32_t detection_period_ms;
  102. uint32_t scan_period_ms;
  103. uint32_t free_slot_expiry_time_ms;
  104. };
  105. /**
  106. * struct vdev_mlme_vht_info - vdev VHT information
  107. * @caps: vht capabilities
  108. * @subfer: su beam former capability
  109. * @subfee: su beam formee capability
  110. * @mubfer: mu beam former capability
  111. * @mubfee: mu beam formee capability
  112. * @implicit_bf: Implicit BF support
  113. * @sounding_dimension: Beamformer number of sounding dimension
  114. * @bfee_sts_cap: beam formee STA capability
  115. * @allow_vht: vht capability status
  116. */
  117. struct vdev_mlme_vht_info {
  118. uint32_t caps;
  119. uint8_t subfer;
  120. uint8_t mubfer;
  121. uint8_t subfee;
  122. uint8_t mubfee;
  123. uint8_t implicit_bf;
  124. uint8_t sounding_dimension;
  125. uint8_t bfee_sts_cap;
  126. bool allow_vht;
  127. };
  128. /**
  129. * struct vdev_mlme_ht_info - vdev HT information
  130. * @ht_caps: HT capabilities
  131. * @allow_ht: HT capability status
  132. */
  133. struct vdev_mlme_ht_info {
  134. uint32_t ht_caps;
  135. bool allow_ht;
  136. };
  137. /**
  138. * struct vdev_mlme_he_ops_info - vdev mlme HEOPS information
  139. * @he_ops: he ops
  140. */
  141. struct vdev_mlme_he_ops_info {
  142. uint32_t he_ops;
  143. };
  144. /**
  145. * struct vdev_mlme_he_ops_info - vdev protocol structure holding information
  146. * that is used in frames
  147. * @generic: generic protocol information
  148. * @ap: ap specific protocol information
  149. * @sta: sta specific protocol information
  150. * @vht_info: vht information
  151. * @ht_info: ht capabilities information
  152. * @he_ops_info: he ops information
  153. * @bss_color: 11ax HE BSS Color information
  154. */
  155. struct vdev_mlme_proto {
  156. struct vdev_mlme_proto_generic generic;
  157. struct vdev_mlme_proto_ap ap;
  158. struct vdev_mlme_proto_sta sta;
  159. struct vdev_mlme_vht_info vht_info;
  160. struct vdev_mlme_ht_info ht_info;
  161. struct vdev_mlme_he_ops_info he_ops_info;
  162. struct vdev_mlme_proto_bss_color bss_color;
  163. };
  164. /**
  165. * struct vdev_mlme_mgmt_generic - generic vdev mlme mgmt cfg
  166. * @rts_threshold: RTS threshold
  167. * @frag_threshold: Fragmentation threshold
  168. * @probe_delay: time in msec for delaying to send first probe request
  169. * @repeat_probe_time: probe request transmission time
  170. * @drop_unencry: drop unencrypted status
  171. * @ tx_pwrlimit: Tx power limit
  172. * @tx_power: Tx power
  173. * @minpower: Min power
  174. * @maxpower: Max power
  175. * @maxregpower: max regulatory power
  176. * @antennamax: max antenna
  177. * @reg_class_id: reg domain class id
  178. * @ampdu: ampdu limit
  179. * @amsdu: amsdu limit
  180. * @ssid: service set identifier
  181. * @ssid_len: ssid length
  182. * @type: vdev type
  183. * @sub_type: vdev subtype
  184. * @rx_decap_type: rx decap type
  185. * @tx_decap_type: tx decap type
  186. * @disable_hw_ack: disable ha ack flag
  187. * @bssid: bssid
  188. * @phy_mode: phy mode
  189. */
  190. struct vdev_mlme_mgmt_generic {
  191. uint32_t rts_threshold;
  192. uint32_t frag_threshold;
  193. uint32_t probe_delay;
  194. uint32_t repeat_probe_time;
  195. uint32_t drop_unencry;
  196. uint32_t tx_pwrlimit;
  197. uint8_t tx_power;
  198. uint8_t minpower;
  199. uint8_t maxpower;
  200. uint8_t maxregpower;
  201. uint8_t antennamax;
  202. uint8_t reg_class_id;
  203. uint8_t ampdu;
  204. uint8_t amsdu;
  205. char ssid[WLAN_SSID_MAX_LEN + 1];
  206. uint8_t ssid_len;
  207. uint8_t type;
  208. uint8_t subtype;
  209. uint8_t rx_decap_type;
  210. uint8_t tx_decap_type;
  211. bool disable_hw_ack;
  212. uint8_t bssid[QDF_MAC_ADDR_SIZE];
  213. uint32_t phy_mode;
  214. };
  215. /**
  216. * struct vdev_mlme_mgmt_ap - ap specific vdev mlme mgmt cfg
  217. * @.
  218. */
  219. struct vdev_mlme_mgmt_ap {
  220. };
  221. /**
  222. * struct vdev_mlme_mgmt_sta - sta specific vdev mlme mgmt cfg
  223. * @.
  224. */
  225. struct vdev_mlme_mgmt_sta {
  226. };
  227. /**
  228. * struct vdev_mlme_inactivity_params - vdev mlme inactivity parameters
  229. * @bmiss_first_bcnt: bmiss first time
  230. * @bmiss_final_bcnt: bmiss final time
  231. * @keepalive_min_idle_inactive_time_secs: min time AP consider STA to be
  232. * inactive
  233. * @keepalive_max_idle_inactive_time_secs: max inactive idle time for AP to send
  234. * data-null
  235. * @keepalive_max_unresponsive_time_secs: max time to send WMI_STA_KICKOUT
  236. */
  237. struct vdev_mlme_inactivity_params {
  238. uint32_t bmiss_first_bcnt;
  239. uint32_t bmiss_final_bcnt;
  240. uint32_t keepalive_min_idle_inactive_time_secs;
  241. uint32_t keepalive_max_idle_inactive_time_secs;
  242. uint32_t keepalive_max_unresponsive_time_secs;
  243. };
  244. /**
  245. * struct vdev_mlme_rate_info - vdev mlme rate information
  246. * @rate_flags: dynamic bandwidth info
  247. * @per_band_tx_mgmt_rate: per band Tx mgmt rate
  248. * @max_rate: max bandwidth rate
  249. * @tx_mgmt_rate: Tx Mgmt rate
  250. * @bcn_tx_rate: beacon Tx rate
  251. * @type: Type of ratemask configuration
  252. * @lower32: Lower 32 bits in the 1st 64-bit value
  253. * @higher32: Higher 32 bits in the 1st 64-bit value
  254. * @lower32_2: Lower 32 bits in the 2nd 64-bit value
  255. * @half_rate: Half rate
  256. * @quarter_rate: quarter rate
  257. */
  258. struct vdev_mlme_rate_info {
  259. uint32_t rate_flags;
  260. uint32_t per_band_tx_mgmt_rate;
  261. uint32_t max_rate;
  262. uint32_t tx_mgmt_rate;
  263. uint32_t bcn_tx_rate;
  264. uint8_t type;
  265. uint32_t lower32;
  266. uint32_t higher32;
  267. uint32_t lower32_2;
  268. bool half_rate;
  269. bool quarter_rate;
  270. };
  271. /**
  272. * struct vdev_mlme_chainmask_info - vdev mlme chainmask information
  273. * @tx_chainmask: Tx chainmask
  274. * @rx_chainmask: Rx Chainmask
  275. * @num_rx_chain: Num of bits set in Rx chain
  276. * @num_tx_chain: Num of bits set in Tx chain
  277. */
  278. struct vdev_mlme_chainmask_info {
  279. uint8_t tx_chainmask;
  280. uint8_t rx_chainmask;
  281. uint8_t num_rx_chain;
  282. uint8_t num_tx_chain;
  283. };
  284. /**
  285. * struct vdev_mlme_powersave_info - vdev mlme powersave information
  286. * @packet_powersave: packet powersave
  287. * @max_li_of_moddtim: max mod dtim
  288. * @dyndtim_cnt: dynamic dtim count
  289. * @listen_interval: listen interval
  290. * @moddtim_cnt: mod dtim count
  291. */
  292. struct vdev_mlme_powersave_info {
  293. uint32_t packet_powersave;
  294. uint32_t max_li_of_moddtim;
  295. uint32_t dyndtim_cnt;
  296. uint32_t listen_interval;
  297. uint32_t moddtim_cnt;
  298. };
  299. /**
  300. * struct vdev_mlme_beacon_info - vdev mlme beacon information
  301. * @beacon_buffer: buffer allocated for beacon frame
  302. * @beacon_offsets: beacon IE's offsets
  303. */
  304. struct vdev_mlme_beacon_info {
  305. qdf_nbuf_t beacon_buffer;
  306. void *beacon_offsets;
  307. };
  308. /**
  309. * struct vdev_mlme_mbss_11ax - mbss 11ax fields required for up cmd
  310. * @profile_idx: profile index of the connected non-trans ap (mbssid case).
  311. * 0 means invalid.
  312. * @profile_num: the total profile numbers of non-trans aps (mbssid
  313. * case).
  314. * 0 means non-MBSS AP.
  315. * @mbssid-flags: MBSS IE flags indicating vdev type
  316. * @vdevid_trans: id of transmitting vdev for MBSS IE
  317. * @trans_bssid: bssid of transmitted AP (MBSS IE case)
  318. */
  319. struct vdev_mlme_mbss_11ax {
  320. uint32_t profile_idx;
  321. uint32_t profile_num;
  322. uint32_t mbssid_flags;
  323. uint8_t vdevid_trans;
  324. uint8_t trans_bssid[QDF_MAC_ADDR_SIZE];
  325. };
  326. /**
  327. * struct vdev_mlme_mgmt - vdev mlme mgmt related cfg
  328. * @generic: generic mgmt information
  329. * @ap: ap specific mgmt information
  330. * @sta: sta specific mgmt information
  331. * @inactivity_params: inactivity parameters
  332. * @rate_info: bandwidth rate information
  333. * @chainmask_info: Chainmask information
  334. * @powersave_info: Power save parameters
  335. * @beacon_info: beacon buffer information
  336. * @mbss_11ax: MBSS 11ax information
  337. */
  338. struct vdev_mlme_mgmt {
  339. struct vdev_mlme_mgmt_generic generic;
  340. struct vdev_mlme_mgmt_ap ap;
  341. struct vdev_mlme_mgmt_sta sta;
  342. struct vdev_mlme_inactivity_params inactivity_params;
  343. struct vdev_mlme_rate_info rate_info;
  344. struct vdev_mlme_chainmask_info chainmask_info;
  345. struct vdev_mlme_powersave_info powersave_info;
  346. struct vdev_mlme_beacon_info beacon_info;
  347. struct vdev_mlme_mbss_11ax mbss_11ax;
  348. };
  349. /**
  350. * enum beacon_update_op - Beacon update op type
  351. * @BEACON_INIT: Initialize beacon
  352. * @BEACON_REINIT: Re-initialize beacon
  353. * @BEACON_UPDATE: Update dynamic fields of beacon
  354. * @BEACON_CSA: Enable CSA IE
  355. * @BEACON_FREE: Beacon buffer free
  356. */
  357. enum beacon_update_op {
  358. BEACON_INIT,
  359. BEACON_REINIT,
  360. BEACON_UPDATE,
  361. BEACON_CSA,
  362. BEACON_FREE,
  363. };
  364. /**
  365. * enum vdev_cmd_type - Command type
  366. * @START_REQ: Start request
  367. * @RESTART_REQ: Restart request
  368. * @STOP_REQ: STOP request
  369. * @DELETE_REQ: DELETE request
  370. */
  371. enum vdev_cmd_type {
  372. START_REQ,
  373. RESTART_REQ,
  374. STOP_REQ,
  375. DELETE_REQ,
  376. };
  377. /**
  378. * enum vdev_start_resp_type - start respone type
  379. * @START_RESPONSE: Start response
  380. * @RESTART_RESPONSE: Restart response
  381. */
  382. enum vdev_start_resp_type {
  383. START_RESPONSE = 0,
  384. RESTART_RESPONSE,
  385. };
  386. /**
  387. * struct vdev_mlme_ops - VDEV MLME operation callbacks structure
  388. * @mlme_vdev_validate_basic_params: callback to validate VDEV basic params
  389. * @mlme_vdev_reset_proto_params: callback to Reset protocol params
  390. * @mlme_vdev_start_send: callback to initiate actions of VDEV
  391. * MLME start operation
  392. * @mlme_vdev_restart_send: callback to initiate actions of VDEV
  393. * MLME restart operation
  394. * @mlme_vdev_stop_start_send: callback to block start/restart VDEV
  395. * request command
  396. * @mlme_vdev_start_continue: callback to initiate operations on
  397. * LMAC/FW start response
  398. * @mlme_vdev_up_send: callback to initiate actions of VDEV
  399. * MLME up operation
  400. * @mlme_vdev_notify_up_complete: callback to notify VDEV MLME on moving
  401. * to UP state
  402. * @mlme_vdev_notify_roam_start: callback to initiate roaming
  403. * @mlme_vdev_update_beacon: callback to initiate beacon update
  404. * @mlme_vdev_disconnect_peers: callback to initiate disconnection of
  405. * peers
  406. * @mlme_vdev_dfs_cac_timer_stop: callback to stop the DFS CAC timer
  407. * @mlme_vdev_stop_send: callback to initiate actions of VDEV
  408. * MLME stop operation
  409. * @mlme_vdev_stop_continue: callback to initiate operations on
  410. * LMAC/FW stop response
  411. * @mlme_vdev_bss_peer_delete_continue: callback to initiate operations on BSS
  412. * peer delete completion
  413. * @mlme_vdev_down_send: callback to initiate actions of VDEV
  414. * MLME down operation
  415. * @mlme_vdev_notify_start_state_exit: callback to notify on vdev start
  416. * start state exit
  417. * @mlme_vdev_is_newchan_no_cac: callback to check CAC is required
  418. * @mlme_vdev_ext_peer_delete_all_rsp: callback to initiate actions for
  419. * vdev mlme peer delete all response
  420. */
  421. struct vdev_mlme_ops {
  422. QDF_STATUS (*mlme_vdev_validate_basic_params)(
  423. struct vdev_mlme_obj *vdev_mlme,
  424. uint16_t event_data_len, void *event_data);
  425. QDF_STATUS (*mlme_vdev_reset_proto_params)(
  426. struct vdev_mlme_obj *vdev_mlme,
  427. uint16_t event_data_len, void *event_data);
  428. QDF_STATUS (*mlme_vdev_start_send)(
  429. struct vdev_mlme_obj *vdev_mlme,
  430. uint16_t event_data_len, void *event_data);
  431. QDF_STATUS (*mlme_vdev_restart_send)(
  432. struct vdev_mlme_obj *vdev_mlme,
  433. uint16_t event_data_len, void *event_data);
  434. QDF_STATUS (*mlme_vdev_stop_start_send)(
  435. struct vdev_mlme_obj *vdev_mlme,
  436. enum vdev_cmd_type type,
  437. uint16_t event_data_len, void *event_data);
  438. QDF_STATUS (*mlme_vdev_start_continue)(
  439. struct vdev_mlme_obj *vdev_mlme,
  440. uint16_t event_data_len, void *event_data);
  441. QDF_STATUS (*mlme_vdev_sta_conn_start)(
  442. struct vdev_mlme_obj *vdev_mlme,
  443. uint16_t event_data_len, void *event_data);
  444. QDF_STATUS (*mlme_vdev_start_req_failed)(
  445. struct vdev_mlme_obj *vdev_mlme,
  446. uint16_t event_data_len, void *event_data);
  447. QDF_STATUS (*mlme_vdev_up_send)(
  448. struct vdev_mlme_obj *vdev_mlme,
  449. uint16_t event_data_len, void *event_data);
  450. QDF_STATUS (*mlme_vdev_notify_up_complete)(
  451. struct vdev_mlme_obj *vdev_mlme,
  452. uint16_t event_data_len, void *event_data);
  453. QDF_STATUS (*mlme_vdev_notify_roam_start)(
  454. struct vdev_mlme_obj *vdev_mlme,
  455. uint16_t event_data_len, void *event_data);
  456. QDF_STATUS (*mlme_vdev_update_beacon)(
  457. struct vdev_mlme_obj *vdev_mlme,
  458. enum beacon_update_op op,
  459. uint16_t event_data_len, void *event_data);
  460. QDF_STATUS (*mlme_vdev_disconnect_peers)(
  461. struct vdev_mlme_obj *vdev_mlme,
  462. uint16_t event_data_len, void *event_data);
  463. QDF_STATUS (*mlme_vdev_dfs_cac_timer_stop)(
  464. struct vdev_mlme_obj *vdev_mlme,
  465. uint16_t event_data_len, void *event_data);
  466. QDF_STATUS (*mlme_vdev_stop_send)(
  467. struct vdev_mlme_obj *vdev_mlme,
  468. uint16_t event_data_len, void *event_data);
  469. QDF_STATUS (*mlme_vdev_stop_continue)(
  470. struct vdev_mlme_obj *vdev_mlme,
  471. uint16_t event_data_len, void *event_data);
  472. QDF_STATUS (*mlme_vdev_down_send)(
  473. struct vdev_mlme_obj *vdev_mlme,
  474. uint16_t event_data_len, void *event_data);
  475. QDF_STATUS (*mlme_vdev_notify_down_complete)(
  476. struct vdev_mlme_obj *vdev_mlme,
  477. uint16_t event_data_len, void *event_data);
  478. QDF_STATUS (*mlme_vdev_ext_delete_rsp)(
  479. struct vdev_mlme_obj *vdev_mlme,
  480. struct vdev_delete_response *rsp);
  481. QDF_STATUS (*mlme_vdev_ext_stop_rsp)(
  482. struct vdev_mlme_obj *vdev_mlme,
  483. struct vdev_stop_response *rsp);
  484. QDF_STATUS (*mlme_vdev_ext_start_rsp)(
  485. struct vdev_mlme_obj *vdev_mlme,
  486. struct vdev_start_response *rsp);
  487. QDF_STATUS (*mlme_vdev_notify_start_state_exit)(
  488. struct vdev_mlme_obj *vdev_mlme);
  489. QDF_STATUS (*mlme_vdev_is_newchan_no_cac)(
  490. struct vdev_mlme_obj *vdev_mlme);
  491. QDF_STATUS (*mlme_vdev_ext_peer_delete_all_rsp)(
  492. struct vdev_mlme_obj *vdev_mlme,
  493. struct peer_delete_all_response *rsp);
  494. };
  495. #ifdef FEATURE_VDEV_RSP_WAKELOCK
  496. /**
  497. * struct wlan_vdev_wakelock - vdev wake lock sub structure
  498. * @start_wakelock: wakelock for vdev start
  499. * @stop_wakelock: wakelock for vdev stop
  500. * @delete_wakelock: wakelock for vdev delete
  501. * @wmi_cmd_rsp_runtime_lock: run time lock
  502. */
  503. struct vdev_mlme_wakelock {
  504. qdf_wake_lock_t start_wakelock;
  505. qdf_wake_lock_t stop_wakelock;
  506. qdf_wake_lock_t delete_wakelock;
  507. qdf_runtime_lock_t wmi_cmd_rsp_runtime_lock;
  508. };
  509. #endif
  510. /**
  511. * struct vdev_mlme_obj - VDEV MLME component object
  512. * @proto: VDEV MLME proto substructure
  513. * @mgmt: VDEV MLME mgmt substructure
  514. * @sm_lock: VDEV SM lock
  515. * @vdev_cmd_lock: VDEV MLME command atomicity
  516. * @sm_hdl: VDEV SM handle
  517. * @vdev: Pointer to vdev objmgr
  518. * @ops: VDEV MLME callback table
  519. * @ext_vdev_ptr: VDEV MLME legacy pointer
  520. * @vdev_rt: VDEV response timer
  521. * @vdev_wakelock: vdev wakelock sub structure
  522. */
  523. struct vdev_mlme_obj {
  524. struct vdev_mlme_proto proto;
  525. struct vdev_mlme_mgmt mgmt;
  526. #ifdef VDEV_SM_LOCK_SUPPORT
  527. qdf_spinlock_t sm_lock;
  528. qdf_mutex_t vdev_cmd_lock;
  529. #endif
  530. struct wlan_sm *sm_hdl;
  531. struct wlan_objmgr_vdev *vdev;
  532. struct vdev_mlme_ops *ops;
  533. mlme_vdev_ext_t *ext_vdev_ptr;
  534. struct vdev_response_timer vdev_rt;
  535. #ifdef FEATURE_VDEV_RSP_WAKELOCK
  536. struct vdev_mlme_wakelock vdev_wakelock;
  537. #endif
  538. };
  539. /**
  540. * mlme_vdev_validate_basic_params - Validate basic params
  541. * @vdev_mlme_obj: VDEV MLME comp object
  542. * @event_data_len: data size
  543. * @event_data: event data
  544. *
  545. * API validate MLME VDEV basic parameters
  546. *
  547. * Return: SUCCESS on successful validation
  548. * FAILURE, if any parameter is not initialized
  549. */
  550. static inline QDF_STATUS mlme_vdev_validate_basic_params(
  551. struct vdev_mlme_obj *vdev_mlme,
  552. uint16_t event_data_len, void *event_data)
  553. {
  554. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  555. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_validate_basic_params)
  556. ret = vdev_mlme->ops->mlme_vdev_validate_basic_params(
  557. vdev_mlme, event_data_len, event_data);
  558. return ret;
  559. }
  560. /**
  561. * mlme_vdev_reset_proto_params - Reset VDEV protocol params
  562. * @vdev_mlme_obj: VDEV MLME comp object
  563. * @event_data_len: data size
  564. * @event_data: event data
  565. *
  566. * API resets the protocol params fo vdev
  567. *
  568. * Return: SUCCESS on successful reset
  569. * FAILURE, if it fails due to any
  570. */
  571. static inline QDF_STATUS mlme_vdev_reset_proto_params(
  572. struct vdev_mlme_obj *vdev_mlme,
  573. uint16_t event_data_len, void *event_data)
  574. {
  575. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  576. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_reset_proto_params)
  577. ret = vdev_mlme->ops->mlme_vdev_reset_proto_params(
  578. vdev_mlme, event_data_len, event_data);
  579. return ret;
  580. }
  581. /**
  582. * mlme_vdev_start_send - Invokes VDEV start operation
  583. * @vdev_mlme_obj: VDEV MLME comp object
  584. * @event_data_len: data size
  585. * @event_data: event data
  586. *
  587. * API invokes VDEV start operation
  588. *
  589. * Return: SUCCESS on successful completion of start operation
  590. * FAILURE, if it fails due to any
  591. */
  592. static inline QDF_STATUS mlme_vdev_start_send(
  593. struct vdev_mlme_obj *vdev_mlme,
  594. uint16_t event_data_len, void *event_data)
  595. {
  596. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  597. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_start_send)
  598. ret = vdev_mlme->ops->mlme_vdev_start_send(
  599. vdev_mlme, event_data_len, event_data);
  600. return ret;
  601. }
  602. /**
  603. * mlme_vdev_restart_send - Invokes VDEV restart operation
  604. * @vdev_mlme_obj: VDEV MLME comp object
  605. * @event_data_len: data size
  606. * @event_data: event data
  607. *
  608. * API invokes VDEV restart operation
  609. *
  610. * Return: SUCCESS on successful completion of restart operation
  611. * FAILURE, if it fails due to any
  612. */
  613. static inline QDF_STATUS mlme_vdev_restart_send(
  614. struct vdev_mlme_obj *vdev_mlme,
  615. uint16_t event_data_len, void *event_data)
  616. {
  617. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  618. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_restart_send)
  619. ret = vdev_mlme->ops->mlme_vdev_restart_send(
  620. vdev_mlme, event_data_len, event_data);
  621. return ret;
  622. }
  623. /**
  624. * mlme_vdev_stop_start_send - Invoke block VDEV restart operation
  625. * @vdev_mlme_obj: VDEV MLME comp object
  626. * @restart: restart req/start req
  627. * @event_data_len: data size
  628. * @event_data: event data
  629. *
  630. * API invokes stops pending VDEV restart operation
  631. *
  632. * Return: SUCCESS alsways
  633. */
  634. static inline QDF_STATUS mlme_vdev_stop_start_send(
  635. struct vdev_mlme_obj *vdev_mlme,
  636. uint8_t restart,
  637. uint16_t event_data_len, void *event_data)
  638. {
  639. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  640. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_stop_start_send)
  641. ret = vdev_mlme->ops->mlme_vdev_stop_start_send(
  642. vdev_mlme, restart, event_data_len, event_data);
  643. return ret;
  644. }
  645. /**
  646. * mlme_vdev_start_continue - VDEV start response handling
  647. * @vdev_mlme_obj: VDEV MLME comp object
  648. * @event_data_len: data size
  649. * @event_data: event data
  650. *
  651. * API invokes VDEV start response actions
  652. *
  653. * Return: SUCCESS on successful completion of start response operation
  654. * FAILURE, if it fails due to any
  655. */
  656. static inline QDF_STATUS mlme_vdev_start_continue(
  657. struct vdev_mlme_obj *vdev_mlme,
  658. uint16_t event_data_len, void *event_data)
  659. {
  660. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  661. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_start_continue)
  662. ret = vdev_mlme->ops->mlme_vdev_start_continue(
  663. vdev_mlme, event_data_len, event_data);
  664. return ret;
  665. }
  666. /**
  667. * mlme_vdev_start_req_failed - Invoke Station VDEV connection, if it pause
  668. * @vdev_mlme_obj: VDEV MLME comp object
  669. * @event_data_len: data size
  670. * @event_data: event data
  671. *
  672. * API invokes on START fail response
  673. *
  674. * Return: SUCCESS on successful invocation of callback
  675. * FAILURE, if it fails due to any
  676. */
  677. static inline QDF_STATUS mlme_vdev_start_req_failed(
  678. struct vdev_mlme_obj *vdev_mlme,
  679. uint16_t event_data_len, void *event_data)
  680. {
  681. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  682. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_start_req_failed)
  683. ret = vdev_mlme->ops->mlme_vdev_start_req_failed(
  684. vdev_mlme, event_data_len, event_data);
  685. return ret;
  686. }
  687. /**
  688. * mlme_vdev_sta_conn_start - Invoke Station VDEV connection, if it pause
  689. * @vdev_mlme_obj: VDEV MLME comp object
  690. * @event_data_len: data size
  691. * @event_data: event data
  692. *
  693. * API invokes connection SM to start station connection
  694. *
  695. * Return: SUCCESS on successful invocation of connection sm
  696. * FAILURE, if it fails due to any
  697. */
  698. static inline QDF_STATUS mlme_vdev_sta_conn_start(
  699. struct vdev_mlme_obj *vdev_mlme,
  700. uint16_t event_data_len, void *event_data)
  701. {
  702. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  703. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_sta_conn_start)
  704. ret = vdev_mlme->ops->mlme_vdev_sta_conn_start(
  705. vdev_mlme, event_data_len, event_data);
  706. return ret;
  707. }
  708. /**
  709. * mlme_vdev_up_send - VDEV up operation
  710. * @vdev_mlme_obj: VDEV MLME comp object
  711. * @event_data_len: data size
  712. * @event_data: event data
  713. *
  714. * API invokes VDEV up operations
  715. *
  716. * Return: SUCCESS on successful completion of up operation
  717. * FAILURE, if it fails due to any
  718. */
  719. static inline QDF_STATUS mlme_vdev_up_send(
  720. struct vdev_mlme_obj *vdev_mlme,
  721. uint16_t event_data_len, void *event_data)
  722. {
  723. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  724. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_up_send)
  725. ret = vdev_mlme->ops->mlme_vdev_up_send(
  726. vdev_mlme, event_data_len, event_data);
  727. return ret;
  728. }
  729. /**
  730. * mlme_vdev_notify_up_complete - VDEV up state transition notification
  731. * @vdev_mlme_obj: VDEV MLME comp object
  732. * @event_data_len: data size
  733. * @event_data: event data
  734. *
  735. * API notifies MLME on moving to UP state
  736. *
  737. * Return: SUCCESS on successful completion of up notification
  738. * FAILURE, if it fails due to any
  739. */
  740. static inline
  741. QDF_STATUS mlme_vdev_notify_up_complete(struct vdev_mlme_obj *vdev_mlme,
  742. uint16_t event_data_len,
  743. void *event_data)
  744. {
  745. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  746. if (vdev_mlme->ops && vdev_mlme->ops->mlme_vdev_notify_up_complete)
  747. ret = vdev_mlme->ops->mlme_vdev_notify_up_complete(
  748. vdev_mlme, event_data_len, event_data);
  749. return ret;
  750. }
  751. /**
  752. * mlme_vdev_notify_roam_start - VDEV Roaming notification
  753. * @vdev_mlme_obj: VDEV MLME comp object
  754. * @event_len: data size
  755. * @event_data: event data
  756. *
  757. * API notifies MLME on roaming
  758. *
  759. * Return: SUCCESS on successful completion of up notification
  760. * FAILURE, if it fails due to any
  761. */
  762. static inline
  763. QDF_STATUS mlme_vdev_notify_roam_start(struct vdev_mlme_obj *vdev_mlme,
  764. uint16_t event_len, void *event_data)
  765. {
  766. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  767. if (vdev_mlme->ops && vdev_mlme->ops->mlme_vdev_notify_roam_start)
  768. ret = vdev_mlme->ops->mlme_vdev_notify_roam_start(vdev_mlme,
  769. event_len,
  770. event_data);
  771. return ret;
  772. }
  773. /**
  774. * mlme_vdev_update_beacon - Updates beacon
  775. * @vdev_mlme_obj: VDEV MLME comp object
  776. * @op: beacon update type
  777. * @event_data_len: data size
  778. * @event_data: event data
  779. *
  780. * API updates/allocates/frees the beacon
  781. *
  782. * Return: SUCCESS on successful update of beacon
  783. * FAILURE, if it fails due to any
  784. */
  785. static inline
  786. QDF_STATUS mlme_vdev_update_beacon(struct vdev_mlme_obj *vdev_mlme,
  787. enum beacon_update_op op,
  788. uint16_t event_data_len, void *event_data)
  789. {
  790. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  791. if (vdev_mlme->ops && vdev_mlme->ops->mlme_vdev_update_beacon)
  792. ret = vdev_mlme->ops->mlme_vdev_update_beacon(vdev_mlme, op,
  793. event_data_len, event_data);
  794. return ret;
  795. }
  796. /**
  797. * mlme_vdev_disconnect_peers - Disconnect peers
  798. * @vdev_mlme_obj: VDEV MLME comp object
  799. * @event_data_len: data size
  800. * @event_data: event data
  801. *
  802. * API trigger stations disconnection with AP VDEV or AP disconnection with STA
  803. * VDEV
  804. *
  805. * Return: SUCCESS on successful invocation of station disconnection
  806. * FAILURE, if it fails due to any
  807. */
  808. static inline QDF_STATUS mlme_vdev_disconnect_peers(
  809. struct vdev_mlme_obj *vdev_mlme,
  810. uint16_t event_data_len, void *event_data)
  811. {
  812. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  813. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_disconnect_peers)
  814. ret = vdev_mlme->ops->mlme_vdev_disconnect_peers(
  815. vdev_mlme, event_data_len, event_data);
  816. return ret;
  817. }
  818. /**
  819. * mlme_vdev_dfs_cac_timer_stop - Stop CAC timer
  820. * @vdev_mlme_obj: VDEV MLME comp object
  821. * @event_data_len: data size
  822. * @event_data: event data
  823. *
  824. * API stops the CAC timer through DFS API
  825. *
  826. * Return: SUCCESS on successful CAC timer stop
  827. * FAILURE, if it fails due to any
  828. */
  829. static inline QDF_STATUS mlme_vdev_dfs_cac_timer_stop(
  830. struct vdev_mlme_obj *vdev_mlme,
  831. uint16_t event_data_len, void *event_data)
  832. {
  833. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  834. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_dfs_cac_timer_stop)
  835. ret = vdev_mlme->ops->mlme_vdev_dfs_cac_timer_stop(
  836. vdev_mlme, event_data_len, event_data);
  837. return ret;
  838. }
  839. /**
  840. * mlme_vdev_stop_send - Invokes VDEV stop operation
  841. * @vdev_mlme_obj: VDEV MLME comp object
  842. * @event_data_len: data size
  843. * @event_data: event data
  844. *
  845. * API invokes VDEV stop operation
  846. *
  847. * Return: SUCCESS on successful completion of stop operation
  848. * FAILURE, if it fails due to any
  849. */
  850. static inline QDF_STATUS mlme_vdev_stop_send(
  851. struct vdev_mlme_obj *vdev_mlme,
  852. uint16_t event_data_len, void *event_data)
  853. {
  854. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  855. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_stop_send)
  856. ret = vdev_mlme->ops->mlme_vdev_stop_send(
  857. vdev_mlme, event_data_len, event_data);
  858. return ret;
  859. }
  860. /**
  861. * mlme_vdev_stop_continue - VDEV stop response handling
  862. * @vdev_mlme_obj: VDEV MLME comp object
  863. * @event_data_len: data size
  864. * @event_data: event data
  865. *
  866. * API invokes VDEV stop response actions
  867. *
  868. * Return: SUCCESS on successful completion of stop response operation
  869. * FAILURE, if it fails due to any
  870. */
  871. static inline QDF_STATUS mlme_vdev_stop_continue(
  872. struct vdev_mlme_obj *vdev_mlme,
  873. uint16_t event_data_len, void *event_data)
  874. {
  875. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  876. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_stop_continue)
  877. ret = vdev_mlme->ops->mlme_vdev_stop_continue(vdev_mlme,
  878. event_data_len,
  879. event_data);
  880. return ret;
  881. }
  882. /**
  883. * mlme_vdev_down_send - VDEV down operation
  884. * @vdev_mlme_obj: VDEV MLME comp object
  885. * @event_data_len: data size
  886. * @event_data: event data
  887. *
  888. * API invokes VDEV down operation
  889. *
  890. * Return: SUCCESS on successful completion of VDEV down operation
  891. * FAILURE, if it fails due to any
  892. */
  893. static inline QDF_STATUS mlme_vdev_down_send(
  894. struct vdev_mlme_obj *vdev_mlme,
  895. uint16_t event_data_len, void *event_data)
  896. {
  897. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  898. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_down_send)
  899. ret = vdev_mlme->ops->mlme_vdev_down_send(
  900. vdev_mlme, event_data_len, event_data);
  901. return ret;
  902. }
  903. /**
  904. * mlme_vdev_notify_down_complete - VDEV init state transition notification
  905. * @vdev_mlme_obj: VDEV MLME comp object
  906. * @event_data_len: data size
  907. * @event_data: event data
  908. *
  909. * API notifies MLME on moving to INIT state
  910. *
  911. * Return: SUCCESS on successful completion of down notification
  912. * FAILURE, if it fails due to any
  913. */
  914. static inline QDF_STATUS mlme_vdev_notify_down_complete(
  915. struct vdev_mlme_obj *vdev_mlme,
  916. uint16_t event_data_len, void *event_data)
  917. {
  918. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  919. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_notify_down_complete)
  920. ret = vdev_mlme->ops->mlme_vdev_notify_down_complete(
  921. vdev_mlme, event_data_len, event_data);
  922. return ret;
  923. }
  924. /**
  925. * mlme_vdev_notify_start_state_exit - VDEV SM start state exit notification
  926. * @vdev_mlme_obj: VDEV MLME comp object
  927. *
  928. * API notifies on start state exit
  929. *
  930. * Return: SUCCESS on successful completion of notification
  931. * FAILURE, if it fails due to any
  932. */
  933. static inline QDF_STATUS mlme_vdev_notify_start_state_exit(
  934. struct vdev_mlme_obj *vdev_mlme)
  935. {
  936. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  937. if ((vdev_mlme->ops) &&
  938. vdev_mlme->ops->mlme_vdev_notify_start_state_exit)
  939. ret = vdev_mlme->ops->mlme_vdev_notify_start_state_exit(
  940. vdev_mlme);
  941. return ret;
  942. }
  943. /**
  944. * mlme_vdev_is_newchan_no_cac - Checks new channel requires CAC
  945. * @vdev_mlme_obj: VDEV MLME comp object
  946. *
  947. * API checks whether Channel needs CAC period,
  948. * if yes, it moves to SUSPEND_RESTART to disconnect stations before
  949. * sending RESTART to FW, otherwise, it moves to RESTART_PROGRESS substate
  950. *
  951. * Return: SUCCESS to move to RESTART_PROGRESS substate
  952. * FAILURE, move to SUSPEND_RESTART state
  953. */
  954. static inline QDF_STATUS mlme_vdev_is_newchan_no_cac(
  955. struct vdev_mlme_obj *vdev_mlme)
  956. {
  957. QDF_STATUS ret = QDF_STATUS_SUCCESS;
  958. if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_is_newchan_no_cac)
  959. ret = vdev_mlme->ops->mlme_vdev_is_newchan_no_cac(vdev_mlme);
  960. return ret;
  961. }
  962. #ifdef CMN_VDEV_MGR_TGT_IF_ENABLE
  963. /**
  964. * wlan_vdev_mlme_set_ssid() - set ssid
  965. * @vdev: VDEV object
  966. * @ssid: SSID (input)
  967. * @ssid_len: Length of SSID
  968. *
  969. * API to set the SSID of VDEV
  970. *
  971. * Caller need to acquire lock with wlan_vdev_obj_lock()
  972. *
  973. * Return: SUCCESS, if update is done
  974. * FAILURE, if ssid length is > max ssid len
  975. */
  976. static inline QDF_STATUS wlan_vdev_mlme_set_ssid(
  977. struct wlan_objmgr_vdev *vdev,
  978. const uint8_t *ssid, uint8_t ssid_len)
  979. {
  980. struct vdev_mlme_obj *vdev_mlme;
  981. /* This API is invoked with lock acquired, do not add log prints */
  982. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  983. if (!vdev_mlme)
  984. return QDF_STATUS_E_FAILURE;
  985. if (ssid_len <= WLAN_SSID_MAX_LEN) {
  986. qdf_mem_copy(vdev_mlme->mgmt.generic.ssid, ssid, ssid_len);
  987. vdev_mlme->mgmt.generic.ssid_len = ssid_len;
  988. } else {
  989. vdev_mlme->mgmt.generic.ssid_len = 0;
  990. return QDF_STATUS_E_FAILURE;
  991. }
  992. return QDF_STATUS_SUCCESS;
  993. }
  994. /**
  995. * wlan_vdev_mlme_get_ssid() - get ssid
  996. * @vdev: VDEV object
  997. * @ssid: SSID
  998. * @ssid_len: Length of SSID
  999. *
  1000. * API to get the SSID of VDEV, it updates the SSID and its length
  1001. * in @ssid, @ssid_len respectively
  1002. *
  1003. * Caller need to acquire lock with wlan_vdev_obj_lock()
  1004. *
  1005. * Return: SUCCESS, if update is done
  1006. * FAILURE, if ssid length is > max ssid len
  1007. */
  1008. static inline QDF_STATUS wlan_vdev_mlme_get_ssid(
  1009. struct wlan_objmgr_vdev *vdev,
  1010. uint8_t *ssid, uint8_t *ssid_len)
  1011. {
  1012. struct vdev_mlme_obj *vdev_mlme;
  1013. /* This API is invoked with lock acquired, do not add log prints */
  1014. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1015. if (!vdev_mlme)
  1016. return QDF_STATUS_E_FAILURE;
  1017. if (vdev_mlme->mgmt.generic.ssid_len > 0) {
  1018. *ssid_len = vdev_mlme->mgmt.generic.ssid_len;
  1019. qdf_mem_copy(ssid, vdev_mlme->mgmt.generic.ssid, *ssid_len);
  1020. } else {
  1021. *ssid_len = 0;
  1022. return QDF_STATUS_E_FAILURE;
  1023. }
  1024. return QDF_STATUS_SUCCESS;
  1025. }
  1026. /**
  1027. * wlan_vdev_mlme_set_nss() - set NSS
  1028. * @vdev: VDEV object
  1029. * @nss: nss configured by user
  1030. *
  1031. * API to set the Number of Spatial streams
  1032. *
  1033. * Return: void
  1034. */
  1035. static inline void wlan_vdev_mlme_set_nss(
  1036. struct wlan_objmgr_vdev *vdev,
  1037. uint8_t nss)
  1038. {
  1039. struct vdev_mlme_obj *vdev_mlme;
  1040. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1041. if (!vdev_mlme)
  1042. return;
  1043. vdev_mlme->proto.generic.nss = nss;
  1044. }
  1045. /**
  1046. * wlan_vdev_mlme_get_nss() - get NSS
  1047. * @vdev: VDEV object
  1048. *
  1049. * API to get the Number of Spatial Streams
  1050. *
  1051. * Return:
  1052. * @nss: nss value
  1053. */
  1054. static inline uint8_t wlan_vdev_mlme_get_nss(
  1055. struct wlan_objmgr_vdev *vdev)
  1056. {
  1057. struct vdev_mlme_obj *vdev_mlme;
  1058. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1059. if (!vdev_mlme)
  1060. return 0;
  1061. return vdev_mlme->proto.generic.nss;
  1062. }
  1063. /**
  1064. * wlan_vdev_mlme_set_txchainmask() - set Tx chainmask
  1065. * @vdev: VDEV object
  1066. * @chainmask : chainmask either configured by user or max supported
  1067. *
  1068. * API to set the Tx chainmask
  1069. *
  1070. * Return: void
  1071. */
  1072. static inline void wlan_vdev_mlme_set_txchainmask(
  1073. struct wlan_objmgr_vdev *vdev,
  1074. uint8_t chainmask)
  1075. {
  1076. struct vdev_mlme_obj *vdev_mlme;
  1077. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1078. if (!vdev_mlme)
  1079. return;
  1080. vdev_mlme->mgmt.chainmask_info.tx_chainmask = chainmask;
  1081. }
  1082. /**
  1083. * wlan_vdev_mlme_get_txchainmask() - get Tx chainmask
  1084. * @vdev: VDEV object
  1085. *
  1086. * API to get the Tx chainmask
  1087. *
  1088. * Return:
  1089. * @chainmask : Tx chainmask either configured by user or max supported
  1090. */
  1091. static inline uint8_t wlan_vdev_mlme_get_txchainmask(
  1092. struct wlan_objmgr_vdev *vdev)
  1093. {
  1094. struct vdev_mlme_obj *vdev_mlme;
  1095. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1096. if (!vdev_mlme)
  1097. return 0;
  1098. return vdev_mlme->mgmt.chainmask_info.tx_chainmask;
  1099. }
  1100. /**
  1101. * wlan_vdev_mlme_set_rxchainmask() - set Rx chainmask
  1102. * @vdev: VDEV object
  1103. * @chainmask : Rx chainmask either configured by user or max supported
  1104. *
  1105. * API to set the Rx chainmask
  1106. *
  1107. * Return: void
  1108. */
  1109. static inline void wlan_vdev_mlme_set_rxchainmask(
  1110. struct wlan_objmgr_vdev *vdev,
  1111. uint8_t chainmask)
  1112. {
  1113. struct vdev_mlme_obj *vdev_mlme;
  1114. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1115. if (!vdev_mlme)
  1116. return;
  1117. vdev_mlme->mgmt.chainmask_info.rx_chainmask = chainmask;
  1118. }
  1119. /**
  1120. * wlan_vdev_mlme_get_rxchainmask() - get Rx chainmask
  1121. * @vdev: VDEV object
  1122. *
  1123. * API to get the Rx chainmask
  1124. *
  1125. * Return:
  1126. * @chainmask : Rx chainmask either configured by user or max supported
  1127. */
  1128. static inline uint8_t wlan_vdev_mlme_get_rxchainmask(
  1129. struct wlan_objmgr_vdev *vdev)
  1130. {
  1131. struct vdev_mlme_obj *vdev_mlme;
  1132. /* This API is invoked with lock acquired, do not add log prints */
  1133. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1134. if (!vdev_mlme)
  1135. return 0;
  1136. return vdev_mlme->mgmt.chainmask_info.rx_chainmask;
  1137. }
  1138. /**
  1139. * wlan_vdev_mlme_set_txpower() - set tx power
  1140. * @vdev: VDEV object
  1141. * @txpow: tx power either configured by used or max allowed
  1142. *
  1143. * API to set the tx power
  1144. *
  1145. * Return: void
  1146. */
  1147. static inline void wlan_vdev_mlme_set_txpower(
  1148. struct wlan_objmgr_vdev *vdev,
  1149. uint8_t txpow)
  1150. {
  1151. struct vdev_mlme_obj *vdev_mlme;
  1152. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1153. if (!vdev_mlme)
  1154. return;
  1155. vdev_mlme->mgmt.generic.tx_power = txpow;
  1156. }
  1157. /**
  1158. * wlan_vdev_mlme_get_txpower() - get tx power
  1159. * @vdev: VDEV object
  1160. *
  1161. * API to get the tx power
  1162. *
  1163. * Return:
  1164. * @txpow: tx power either configured by used or max allowed
  1165. */
  1166. static inline uint8_t wlan_vdev_mlme_get_txpower(
  1167. struct wlan_objmgr_vdev *vdev)
  1168. {
  1169. struct vdev_mlme_obj *vdev_mlme;
  1170. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1171. if (!vdev_mlme)
  1172. return 0;
  1173. return vdev_mlme->mgmt.generic.tx_power;
  1174. }
  1175. /**
  1176. * wlan_vdev_mlme_set_maxrate() - set max rate
  1177. * @vdev: VDEV object
  1178. * @maxrate: configured by used or based on configured mode
  1179. *
  1180. * API to set the max rate the vdev supports
  1181. *
  1182. * Return: void
  1183. */
  1184. static inline void wlan_vdev_mlme_set_maxrate(
  1185. struct wlan_objmgr_vdev *vdev,
  1186. uint32_t maxrate)
  1187. {
  1188. struct vdev_mlme_obj *vdev_mlme;
  1189. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1190. if (!vdev_mlme)
  1191. return;
  1192. vdev_mlme->mgmt.rate_info.max_rate = maxrate;
  1193. }
  1194. /**
  1195. * wlan_vdev_mlme_get_maxrate() - get max rate
  1196. * @vdev: VDEV object
  1197. *
  1198. * API to get the max rate the vdev supports
  1199. *
  1200. * Return:
  1201. * @maxrate: configured by used or based on configured mode
  1202. */
  1203. static inline uint32_t wlan_vdev_mlme_get_maxrate(
  1204. struct wlan_objmgr_vdev *vdev)
  1205. {
  1206. struct vdev_mlme_obj *vdev_mlme;
  1207. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1208. if (!vdev_mlme)
  1209. return 0;
  1210. return vdev_mlme->mgmt.rate_info.max_rate;
  1211. }
  1212. /**
  1213. * wlan_vdev_mlme_set_txmgmtrate() - set txmgmtrate
  1214. * @vdev: VDEV object
  1215. * @txmgmtrate: Tx Mgmt rate
  1216. *
  1217. * API to set Mgmt Tx rate
  1218. *
  1219. * Return: void
  1220. */
  1221. static inline void wlan_vdev_mlme_set_txmgmtrate(
  1222. struct wlan_objmgr_vdev *vdev,
  1223. uint32_t txmgmtrate)
  1224. {
  1225. struct vdev_mlme_obj *vdev_mlme;
  1226. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1227. if (!vdev_mlme)
  1228. return;
  1229. vdev_mlme->mgmt.rate_info.tx_mgmt_rate = txmgmtrate;
  1230. }
  1231. /**
  1232. * wlan_vdev_mlme_get_txmgmtrate() - get txmgmtrate
  1233. * @vdev: VDEV object
  1234. *
  1235. * API to get Mgmt Tx rate
  1236. *
  1237. * Return:
  1238. * @txmgmtrate: Tx Mgmt rate
  1239. */
  1240. static inline uint32_t wlan_vdev_mlme_get_txmgmtrate(
  1241. struct wlan_objmgr_vdev *vdev)
  1242. {
  1243. struct vdev_mlme_obj *vdev_mlme;
  1244. vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
  1245. if (!vdev_mlme)
  1246. return 0;
  1247. return vdev_mlme->mgmt.rate_info.tx_mgmt_rate;
  1248. }
  1249. #endif /* CMN_VDEV_MGR_TGT_IF_ENABLE */
  1250. #endif