wlan_tdls_public_structs.h 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153
  1. /*
  2. * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * DOC: wlan_tdls_public_structs.h
  20. *
  21. * TDLS public structure definations
  22. */
  23. #ifndef _WLAN_TDLS_STRUCTS_H_
  24. #define _WLAN_TDLS_STRUCTS_H_
  25. #include <qdf_timer.h>
  26. #include <qdf_list.h>
  27. #include <qdf_mc_timer.h>
  28. #include <wlan_cmn.h>
  29. #include <wlan_cmn_ieee80211.h>
  30. #define WLAN_TDLS_STA_MAX_NUM 8
  31. #define WLAN_TDLS_STA_P_UAPSD_OFFCHAN_MAX_NUM 1
  32. #define WLAN_TDLS_PEER_LIST_SIZE 16
  33. #define WLAN_TDLS_CT_TABLE_SIZE 8
  34. #define WLAN_TDLS_PEER_SUB_LIST_SIZE 10
  35. #define WLAN_MAC_MAX_EXTN_CAP 8
  36. #define WLAN_MAC_MAX_SUPP_CHANNELS 100
  37. #define WLAN_MAC_WMI_MAX_SUPP_CHANNELS 128
  38. #define WLAN_MAX_SUPP_OPER_CLASSES 32
  39. #define WLAN_MAC_MAX_SUPP_RATES 32
  40. #define WLAN_CHANNEL_14 14
  41. #define ENABLE_CHANSWITCH 1
  42. #define DISABLE_CHANSWITCH 2
  43. #define WLAN_TDLS_PREFERRED_OFF_CHANNEL_NUM_MIN 1
  44. #define WLAN_TDLS_PREFERRED_OFF_CHANNEL_NUM_MAX 165
  45. #define WLAN_TDLS_PREFERRED_OFF_CHANNEL_NUM_DEF 36
  46. #define AC_PRIORITY_NUM 4
  47. /** Maximum time(ms) to wait for tdls add sta to complete **/
  48. #define WAIT_TIME_TDLS_ADD_STA 1500
  49. /** Maximum time(ms) to wait for tdls del sta to complete **/
  50. #define WAIT_TIME_TDLS_DEL_STA 1500
  51. /** Maximum time(ms) to wait for Link Establish Req to complete **/
  52. #define WAIT_TIME_TDLS_LINK_ESTABLISH_REQ 1500
  53. /** Maximum time(ms) to wait for tdls mgmt to complete **/
  54. #define WAIT_TIME_FOR_TDLS_MGMT 11000
  55. /** Maximum time(ms) to wait for tdls mgmt to complete **/
  56. #define WAIT_TIME_FOR_TDLS_USER_CMD 11000
  57. /** Maximum waittime for TDLS teardown links **/
  58. #define WAIT_TIME_FOR_TDLS_TEARDOWN_LINKS 10000
  59. /** Maximum waittime for TDLS antenna switch **/
  60. #define WAIT_TIME_FOR_TDLS_ANTENNA_SWITCH 1000
  61. #define TDLS_TEARDOWN_PEER_UNREACHABLE 25
  62. #define TDLS_TEARDOWN_PEER_UNSPEC_REASON 26
  63. #define INVALID_TDLS_PEER_ID 0xFF
  64. #define TDLS_STA_INDEX_CHECK(sta_id) \
  65. (((sta_id) >= 0) && ((sta_id) < 0xFF))
  66. /**
  67. * enum tdls_conc_cap - tdls concurrency support
  68. * @TDLS_SUPPORTED_ONLY_ON_STA: only support sta tdls
  69. * @TDLS_SUPPORTED_ONLY_ON_P2P_CLIENT: only support p2p client tdls
  70. */
  71. enum tdls_conc_cap {
  72. TDLS_SUPPORTED_ONLY_ON_STA = 0,
  73. TDLS_SUPPORTED_ONLY_ON_P2P_CLIENT,
  74. };
  75. /**
  76. * enum tdls_peer_capab - tdls capability type
  77. * @TDLS_CAP_NOT_SUPPORTED: tdls not supported
  78. * @TDLS_CAP_UNKNOWN: unknown capability
  79. * @TDLS_CAP_SUPPORTED: tdls capability supported
  80. */
  81. enum tdls_peer_capab {
  82. TDLS_CAP_NOT_SUPPORTED = -1,
  83. TDLS_CAP_UNKNOWN = 0,
  84. TDLS_CAP_SUPPORTED = 1,
  85. };
  86. /**
  87. * enum tdls_peer_state - tdls peer state
  88. * @TDLS_PEER_STATE_PEERING: tdls connection in progress
  89. * @TDLS_PEER_STATE_CONNCTED: tdls peer is connected
  90. * @TDLS_PEER_STATE_TEARDOWN: tdls peer is tear down
  91. * @TDLS_PEER_ADD_MAC_ADDR: add peer mac into connection table
  92. * @TDLS_PEER_REMOVE_MAC_ADDR: remove peer mac from connection table
  93. */
  94. enum tdls_peer_state {
  95. TDLS_PEER_STATE_PEERING,
  96. TDLS_PEER_STATE_CONNCTED,
  97. TDLS_PEER_STATE_TEARDOWN,
  98. TDLS_PEER_ADD_MAC_ADDR,
  99. TDLS_PEER_REMOVE_MAC_ADDR
  100. };
  101. /**
  102. * enum tdls_link_state - tdls link state
  103. * @TDLS_LINK_IDLE: tdls link idle
  104. * @TDLS_LINK_DISCOVERING: tdls link discovering
  105. * @TDLS_LINK_DISCOVERED: tdls link discovered
  106. * @TDLS_LINK_CONNECTING: tdls link connecting
  107. * @TDLS_LINK_CONNECTED: tdls link connected
  108. * @TDLS_LINK_TEARING: tdls link tearing
  109. */
  110. enum tdls_link_state {
  111. TDLS_LINK_IDLE = 0,
  112. TDLS_LINK_DISCOVERING,
  113. TDLS_LINK_DISCOVERED,
  114. TDLS_LINK_CONNECTING,
  115. TDLS_LINK_CONNECTED,
  116. TDLS_LINK_TEARING,
  117. };
  118. /**
  119. * enum tdls_link_state_reason - tdls link reason
  120. * @TDLS_LINK_SUCCESS: Success
  121. * @TDLS_LINK_UNSPECIFIED: Unspecified reason
  122. * @TDLS_LINK_NOT_SUPPORTED: Remote side doesn't support TDLS
  123. * @TDLS_LINK_UNSUPPORTED_BAND: Remote side doesn't support this band
  124. * @TDLS_LINK_NOT_BENEFICIAL: Going to AP is better than direct
  125. * @TDLS_LINK_DROPPED_BY_REMOTE: Remote side doesn't want it anymore
  126. */
  127. enum tdls_link_state_reason {
  128. TDLS_LINK_SUCCESS,
  129. TDLS_LINK_UNSPECIFIED = -1,
  130. TDLS_LINK_NOT_SUPPORTED = -2,
  131. TDLS_LINK_UNSUPPORTED_BAND = -3,
  132. TDLS_LINK_NOT_BENEFICIAL = -4,
  133. TDLS_LINK_DROPPED_BY_REMOTE = -5,
  134. };
  135. /**
  136. * enum tdls_feature_mode - TDLS support mode
  137. * @TDLS_SUPPORT_DISABLED: Disabled in ini or FW
  138. * @TDLS_SUPPORT_SUSPENDED: TDLS supported by ini and FW, but disabled
  139. * temporarily due to off-channel operations or due to other reasons
  140. * @TDLS_SUPPORT_EXP_TRIG_ONLY: Explicit trigger mode
  141. * @TDLS_SUPPORT_IMP_MODE: Implicit mode
  142. * @TDLS_SUPPORT_EXT_CONTROL: External control mode
  143. */
  144. enum tdls_feature_mode {
  145. TDLS_SUPPORT_DISABLED = 0,
  146. TDLS_SUPPORT_SUSPENDED,
  147. TDLS_SUPPORT_EXP_TRIG_ONLY,
  148. TDLS_SUPPORT_IMP_MODE,
  149. TDLS_SUPPORT_EXT_CONTROL,
  150. };
  151. /**
  152. * enum tdls_command_type - TDLS command type
  153. * @TDLS_CMD_TX_ACTION: send tdls action frame
  154. * @TDLS_CMD_ADD_STA: add tdls peer
  155. * @TDLS_CMD_CHANGE_STA: change tdls peer
  156. * @TDLS_CMD_ENABLE_LINK: enable tdls link
  157. * @TDLS_CMD_DISABLE_LINK: disable tdls link
  158. * @TDLS_CMD_CONFIG_FORCE_PEER: config external peer
  159. * @TDLS_CMD_REMOVE_FORCE_PEER: remove external peer
  160. * @TDLS_CMD_STATS_UPDATE: update tdls stats
  161. * @TDLS_CMD_CONFIG_UPDATE: config tdls
  162. * @TDLS_CMD_SCAN_DONE: scon done event
  163. * @TDLS_CMD_SET_RESPONDER: responder event
  164. * @TDLS_NOTIFY_STA_CONNECTION: notify sta connection
  165. * @TDLS_NOTIFY_STA_DISCONNECTION: notify sta disconnection
  166. * @TDLS_CMD_SET_TDLS_MODE: set the tdls mode
  167. * @TDLS_CMD_SESSION_INCREMENT: notify session increment
  168. * @TDLS_CMD_SESSION_DECREMENT: notify session decrement
  169. * @TDLS_CMD_TEARDOWN_LINKS: notify teardown
  170. * @TDLS_NOTIFY_RESET_ADAPTERS: notify adapter reset
  171. * @TDLS_CMD_GET_ALL_PEERS: get all the tdls peers from the list
  172. * @TDLS_CMD_ANTENNA_SWITCH: dynamic tdls antenna switch
  173. * @TDLS_CMD_SET_OFFCHANNEL: tdls offchannel
  174. * @TDLS_CMD_SET_OFFCHANMODE: tdls offchannel mode
  175. * @TDLS_CMD_SET_SECOFFCHANOFFSET: tdls secondary offchannel offset
  176. * @TDLS_DELETE_ALL_PEERS_INDICATION: tdls delete all peers indication
  177. */
  178. enum tdls_command_type {
  179. TDLS_CMD_TX_ACTION = 1,
  180. TDLS_CMD_ADD_STA,
  181. TDLS_CMD_CHANGE_STA,
  182. TDLS_CMD_ENABLE_LINK,
  183. TDLS_CMD_DISABLE_LINK,
  184. TDLS_CMD_CONFIG_FORCE_PEER,
  185. TDLS_CMD_REMOVE_FORCE_PEER,
  186. TDLS_CMD_STATS_UPDATE,
  187. TDLS_CMD_CONFIG_UPDATE,
  188. TDLS_CMD_SCAN_DONE,
  189. TDLS_CMD_SET_RESPONDER,
  190. TDLS_NOTIFY_STA_CONNECTION,
  191. TDLS_NOTIFY_STA_DISCONNECTION,
  192. TDLS_CMD_SET_TDLS_MODE,
  193. TDLS_CMD_SESSION_INCREMENT,
  194. TDLS_CMD_SESSION_DECREMENT,
  195. TDLS_CMD_TEARDOWN_LINKS,
  196. TDLS_NOTIFY_RESET_ADAPTERS,
  197. TDLS_CMD_GET_ALL_PEERS,
  198. TDLS_CMD_ANTENNA_SWITCH,
  199. TDLS_CMD_SET_OFFCHANNEL,
  200. TDLS_CMD_SET_OFFCHANMODE,
  201. TDLS_CMD_SET_SECOFFCHANOFFSET,
  202. TDLS_DELETE_ALL_PEERS_INDICATION
  203. };
  204. /**
  205. * enum tdls_event_type - TDLS event type
  206. * @TDLS_EVENT_VDEV_STATE_CHANGE: umac connect/disconnect event
  207. * @TDLS_EVENT_MGMT_TX_ACK_CNF: tx tdls frame ack event
  208. * @TDLS_EVENT_RX_MGMT: rx discovery response frame
  209. * @TDLS_EVENT_ADD_PEER: add peer or update peer
  210. * @TDLS_EVENT_DEL_PEER: delete peer
  211. * @TDLS_EVENT_DISCOVERY_REQ: dicovery request
  212. * @TDLS_EVENT_TEARDOWN_REQ: teardown request
  213. * @TDLS_EVENT_SETUP_REQ: setup request
  214. * @TDLS_EVENT_TEARDOWN_LINKS_DONE: teardown completion event
  215. * @TDLS_EVENT_USER_CMD: tdls user command
  216. * @TDLS_EVENT_ANTENNA_SWITCH: antenna switch event
  217. */
  218. enum tdls_event_type {
  219. TDLS_EVENT_VDEV_STATE_CHANGE = 0,
  220. TDLS_EVENT_MGMT_TX_ACK_CNF,
  221. TDLS_EVENT_RX_MGMT,
  222. TDLS_EVENT_ADD_PEER,
  223. TDLS_EVENT_DEL_PEER,
  224. TDLS_EVENT_DISCOVERY_REQ,
  225. TDLS_EVENT_TEARDOWN_REQ,
  226. TDLS_EVENT_SETUP_REQ,
  227. TDLS_EVENT_TEARDOWN_LINKS_DONE,
  228. TDLS_EVENT_USER_CMD,
  229. TDLS_EVENT_ANTENNA_SWITCH,
  230. };
  231. /**
  232. * enum tdls_state_t - tdls state
  233. * @QCA_WIFI_HAL_TDLS_DISABLED: TDLS is not enabled, or is disabled now
  234. * @QCA_WIFI_HAL_TDLS_ENABLED: TDLS is enabled, but not yet tried
  235. * @QCA_WIFI_HAL_TDLS_ESTABLISHED: Direct link is established
  236. * @QCA_WIFI_HAL_TDLS_ESTABLISHED_OFF_CHANNEL: Direct link established using MCC
  237. * @QCA_WIFI_HAL_TDLS_DROPPED: Direct link was established, but is now dropped
  238. * @QCA_WIFI_HAL_TDLS_FAILED: Direct link failed
  239. */
  240. enum tdls_state_t {
  241. QCA_WIFI_HAL_TDLS_S_DISABLED = 1,
  242. QCA_WIFI_HAL_TDLS_S_ENABLED,
  243. QCA_WIFI_HAL_TDLS_S_ESTABLISHED,
  244. QCA_WIFI_HAL_TDLS_S_ESTABLISHED_OFF_CHANNEL,
  245. QCA_WIFI_HAL_TDLS_S_DROPPED,
  246. QCA_WIFI_HAL_TDLS_S_FAILED,
  247. };
  248. /**
  249. * enum tdls_off_chan_mode - mode for WMI_TDLS_SET_OFFCHAN_MODE_CMDID
  250. * @TDLS_ENABLE_OFFCHANNEL: enable off channel
  251. * @TDLS_DISABLE_OFFCHANNEL: disable off channel
  252. */
  253. enum tdls_off_chan_mode {
  254. TDLS_ENABLE_OFFCHANNEL,
  255. TDLS_DISABLE_OFFCHANNEL
  256. };
  257. /**
  258. * enum tdls_event_msg_type - TDLS event message type
  259. * @TDLS_SHOULD_DISCOVER: should do discover for peer (based on tx bytes per
  260. * second > tx_discover threshold)
  261. * @TDLS_SHOULD_TEARDOWN: recommend teardown the link for peer due to tx bytes
  262. * per second below tx_teardown_threshold
  263. * @TDLS_PEER_DISCONNECTED: tdls peer disconnected
  264. * @TDLS_CONNECTION_TRACKER_NOTIFY: TDLS/BT role change notification for
  265. * connection tracker
  266. */
  267. enum tdls_event_msg_type {
  268. TDLS_SHOULD_DISCOVER = 0,
  269. TDLS_SHOULD_TEARDOWN,
  270. TDLS_PEER_DISCONNECTED,
  271. TDLS_CONNECTION_TRACKER_NOTIFY
  272. };
  273. /**
  274. * enum tdls_event_reason - TDLS event reason
  275. * @TDLS_TEARDOWN_TX: tdls teardown recommended due to low transmits
  276. * @TDLS_TEARDOWN_RSSI: tdls link tear down recommended due to poor RSSI
  277. * @TDLS_TEARDOWN_SCAN: tdls link tear down recommended due to offchannel scan
  278. * @TDLS_TEARDOWN_PTR_TIMEOUT: tdls peer disconnected due to PTR timeout
  279. * @TDLS_TEARDOWN_BAD_PTR: tdls peer disconnected due wrong PTR format
  280. * @TDLS_TEARDOWN_NO_RSP: tdls peer not responding
  281. * @TDLS_DISCONNECTED_PEER_DELETE: tdls peer disconnected due to peer deletion
  282. * @TDLS_PEER_ENTER_BUF_STA: tdls entered buffer STA role, TDLS connection
  283. * tracker needs to handle this
  284. * @TDLS_PEER_EXIT_BUF_STA: tdls exited buffer STA role, TDLS connection tracker
  285. * needs to handle this
  286. * @TDLS_ENTER_BT_BUSY: BT entered busy mode, TDLS connection tracker needs to
  287. * handle this
  288. * @TDLS_EXIT_BT_BUSY: BT exited busy mode, TDLS connection tracker needs to
  289. * handle this
  290. * @DLS_SCAN_STARTED: TDLS module received a scan start event, TDLS connection
  291. * tracker needs to handle this
  292. * @TDLS_SCAN_COMPLETED: TDLS module received a scan complete event, TDLS
  293. * connection tracker needs to handle this
  294. */
  295. enum tdls_event_reason {
  296. TDLS_TEARDOWN_TX,
  297. TDLS_TEARDOWN_RSSI,
  298. TDLS_TEARDOWN_SCAN,
  299. TDLS_TEARDOWN_PTR_TIMEOUT,
  300. TDLS_TEARDOWN_BAD_PTR,
  301. TDLS_TEARDOWN_NO_RSP,
  302. TDLS_DISCONNECTED_PEER_DELETE,
  303. TDLS_PEER_ENTER_BUF_STA,
  304. TDLS_PEER_EXIT_BUF_STA,
  305. TDLS_ENTER_BT_BUSY,
  306. TDLS_EXIT_BT_BUSY,
  307. TDLS_SCAN_STARTED,
  308. TDLS_SCAN_COMPLETED,
  309. };
  310. /**
  311. * enum tdls_disable_sources - TDLS disable sources
  312. * @TDLS_SET_MODE_SOURCE_USER: disable from user
  313. * @TDLS_SET_MODE_SOURCE_SCAN: disable during scan
  314. * @TDLS_SET_MODE_SOURCE_OFFCHANNEL: disable during offchannel
  315. * @TDLS_SET_MODE_SOURCE_BTC: disable during bluetooth
  316. * @TDLS_SET_MODE_SOURCE_P2P: disable during p2p
  317. */
  318. enum tdls_disable_sources {
  319. TDLS_SET_MODE_SOURCE_USER = 0,
  320. TDLS_SET_MODE_SOURCE_SCAN,
  321. TDLS_SET_MODE_SOURCE_OFFCHANNEL,
  322. TDLS_SET_MODE_SOURCE_BTC,
  323. TDLS_SET_MODE_SOURCE_P2P,
  324. };
  325. /**
  326. * struct tdls_osif_indication - tdls indication to os if layer
  327. * @vdev: vdev object
  328. * @reason: used with teardown indication
  329. * @peer_mac: MAC address of the TDLS peer
  330. */
  331. struct tdls_osif_indication {
  332. struct wlan_objmgr_vdev *vdev;
  333. uint16_t reason;
  334. uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
  335. QDF_STATUS status;
  336. };
  337. /**
  338. * struct tx_frame - tx frame
  339. * @buf: frame buffer
  340. * @buf_len: buffer length
  341. * @tx_timer: tx send timer
  342. */
  343. struct tx_frame {
  344. uint8_t *buf;
  345. size_t buf_len;
  346. qdf_timer_t tx_timer;
  347. };
  348. /**
  349. * enum tdls_feature_bit
  350. * @TDLS_FEATURE_OFF_CHANNEL: tdls off channel
  351. * @TDLS_FEATURE_WMM: tdls wmm
  352. * @TDLS_FEATURE_BUFFER_STA: tdls buffer sta
  353. * @TDLS_FEATURE_SLEEP_STA: tdls sleep sta feature
  354. * @TDLS_FEATURE_SCAN: tdls scan
  355. * @TDLS_FEATURE_ENABLE: tdls enabled
  356. * @TDLS_FEAUTRE_IMPLICIT_TRIGGER: tdls implicit trigger
  357. * @TDLS_FEATURE_EXTERNAL_CONTROL: tdls external control
  358. */
  359. enum tdls_feature_bit {
  360. TDLS_FEATURE_OFF_CHANNEL,
  361. TDLS_FEATURE_WMM,
  362. TDLS_FEATURE_BUFFER_STA,
  363. TDLS_FEATURE_SLEEP_STA,
  364. TDLS_FEATURE_SCAN,
  365. TDLS_FEATURE_ENABLE,
  366. TDLS_FEAUTRE_IMPLICIT_TRIGGER,
  367. TDLS_FEATURE_EXTERNAL_CONTROL
  368. };
  369. #define TDLS_IS_OFF_CHANNEL_ENABLED(flags) \
  370. CHECK_BIT(flags, TDLS_FEATURE_OFF_CHANNEL)
  371. #define TDLS_IS_WMM_ENABLED(flags) \
  372. CHECK_BIT(flags, TDLS_FEATURE_WMM)
  373. #define TDLS_IS_BUFFER_STA_ENABLED(flags) \
  374. CHECK_BIT(flags, TDLS_FEATURE_BUFFER_STA)
  375. #define TDLS_IS_SLEEP_STA_ENABLED(flags) \
  376. CHECK_BIT(flags, TDLS_FEATURE_SLEEP_STA)
  377. #define TDLS_IS_SCAN_ENABLED(flags) \
  378. CHECK_BIT(flags, TDLS_FEATURE_SCAN)
  379. #define TDLS_IS_ENABLED(flags) \
  380. CHECK_BIT(flags, TDLS_FEATURE_ENABLE)
  381. #define TDLS_IS_IMPLICIT_TRIG_ENABLED(flags) \
  382. CHECK_BIT(flags, TDLS_FEAUTRE_IMPLICIT_TRIGGER)
  383. #define TDLS_IS_EXTERNAL_CONTROL_ENABLED(flags) \
  384. CHECK_BIT(flags, TDLS_FEATURE_EXTERNAL_CONTROL)
  385. /**
  386. * struct tdls_user_config - TDLS user configuration
  387. * @tdls_tx_states_period: tdls tx states period
  388. * @tdls_tx_pkt_threshold: tdls tx packets threshold
  389. * @tdls_rx_pkt_threshold: tdls rx packets threshold
  390. * @tdls_max_discovery_attempt: tdls discovery max times
  391. * @tdls_idle_timeout: tdls idle timeout
  392. * @tdls_idle_pkt_threshold: tdls idle packets threshold
  393. * @tdls_rssi_trigger_threshold: tdls rssi trigger threshold
  394. * @tdls_rssi_teardown_threshold: tdls rssi tear down threshold
  395. * @tdls_rssi_delta: tdls rssi delta
  396. * @tdls_uapsd_mask: tdls uapsd mask
  397. * @tdls_uapsd_inactivity_time: tdls uapsd inactivity time
  398. * @tdls_uapsd_pti_window: tdls peer traffic indication window
  399. * @tdls_uapsd_ptr_timeout: tdls peer response timeout
  400. * @tdls_feature_flags: tdls feature flags
  401. * @tdls_pre_off_chan_num: tdls off channel number
  402. * @tdls_pre_off_chan_bw: tdls off channel bandwidth
  403. * @tdls_peer_kickout_threshold: sta kickout threshold for tdls peer
  404. * @delayed_trig_framint: delayed trigger frame interval
  405. * @tdls_vdev_nss_2g: tdls NSS setting for 2G band
  406. * @tdls_vdev_nss_5g: tdls NSS setting for 5G band
  407. * @tdls_buffer_sta_enable: tdls buffer station enable
  408. * @tdls_off_chan_enable: tdls off channel enable
  409. * @tdls_wmm_mode_enable: tdls wmm mode enable
  410. * @tdls_external_control: tdls external control enable
  411. * @tdls_implicit_trigger_enable: tdls implicit trigger enable
  412. * @tdls_scan_enable: tdls scan enable
  413. * @tdls_sleep_sta_enable: tdls sleep sta enable
  414. * @tdls_support_enable: tdls support enable
  415. */
  416. struct tdls_user_config {
  417. uint32_t tdls_tx_states_period;
  418. uint32_t tdls_tx_pkt_threshold;
  419. uint32_t tdls_rx_pkt_threshold;
  420. uint32_t tdls_max_discovery_attempt;
  421. uint32_t tdls_idle_timeout;
  422. uint32_t tdls_idle_pkt_threshold;
  423. int32_t tdls_rssi_trigger_threshold;
  424. int32_t tdls_rssi_teardown_threshold;
  425. uint32_t tdls_rssi_delta;
  426. uint32_t tdls_uapsd_mask;
  427. uint32_t tdls_uapsd_inactivity_time;
  428. uint32_t tdls_uapsd_pti_window;
  429. uint32_t tdls_uapsd_ptr_timeout;
  430. uint32_t tdls_feature_flags;
  431. uint32_t tdls_pre_off_chan_num;
  432. uint32_t tdls_pre_off_chan_bw;
  433. uint32_t tdls_peer_kickout_threshold;
  434. uint32_t delayed_trig_framint;
  435. uint8_t tdls_vdev_nss_2g;
  436. uint8_t tdls_vdev_nss_5g;
  437. bool tdls_buffer_sta_enable;
  438. bool tdls_off_chan_enable;
  439. bool tdls_wmm_mode_enable;
  440. bool tdls_external_control;
  441. bool tdls_implicit_trigger_enable;
  442. bool tdls_scan_enable;
  443. bool tdls_sleep_sta_enable;
  444. bool tdls_support_enable;
  445. };
  446. /**
  447. * struct tdls_config_params - tdls configure paramets
  448. * @tdls: tdls support mode
  449. * @tx_period_t: tdls tx stats period
  450. * @tx_packet_n: tdls tx packets number threshold
  451. * @discovery_tries_n: tdls max discovery attempt count
  452. * @idle_timeout_t: tdls idle time timeout
  453. * @idle_packet_n: tdls idle pkt threshold
  454. * @rssi_trigger_threshold: tdls rssi trigger threshold, checked before setup
  455. * @rssi_teardown_threshold: tdls rssi teardown threshold
  456. * @rssi_delta: rssi delta
  457. */
  458. struct tdls_config_params {
  459. uint32_t tdls;
  460. uint32_t tx_period_t;
  461. uint32_t tx_packet_n;
  462. uint32_t discovery_tries_n;
  463. uint32_t idle_timeout_t;
  464. uint32_t idle_packet_n;
  465. int32_t rssi_trigger_threshold;
  466. int32_t rssi_teardown_threshold;
  467. int32_t rssi_delta;
  468. };
  469. /**
  470. * struct tdls_tx_cnf: tdls tx ack
  471. * @vdev_id: vdev id
  472. * @action_cookie: frame cookie
  473. * @buf: frame buf
  474. * @buf_len: buffer length
  475. * @status: tx send status
  476. */
  477. struct tdls_tx_cnf {
  478. int vdev_id;
  479. uint64_t action_cookie;
  480. void *buf;
  481. size_t buf_len;
  482. int status;
  483. };
  484. /**
  485. * struct tdls_rx_mgmt_frame - rx mgmt frame structure
  486. * @frame_len: frame length
  487. * @rx_chan: rx channel
  488. * @vdev_id: vdev id
  489. * @frm_type: frame type
  490. * @rx_rssi: rx rssi
  491. * @buf: buffer address
  492. */
  493. struct tdls_rx_mgmt_frame {
  494. uint32_t frame_len;
  495. uint32_t rx_chan;
  496. uint32_t vdev_id;
  497. uint32_t frm_type;
  498. uint32_t rx_rssi;
  499. uint8_t buf[1];
  500. };
  501. /**
  502. * tdls_rx_callback() - Callback for rx mgmt frame
  503. * @user_data: user data associated to this rx mgmt frame.
  504. * @rx_frame: RX mgmt frame
  505. *
  506. * This callback will be used to give rx frames to hdd.
  507. *
  508. * Return: None
  509. */
  510. typedef void (*tdls_rx_callback)(void *user_data,
  511. struct tdls_rx_mgmt_frame *rx_frame);
  512. /**
  513. * tdls_wmm_check() - Callback for wmm info
  514. * @psoc: psoc object
  515. *
  516. * This callback will be used to check wmm information
  517. *
  518. * Return: true or false
  519. */
  520. typedef bool (*tdls_wmm_check)(struct wlan_objmgr_vdev **vdev);
  521. /* This callback is used to report state change of peer to wpa_supplicant */
  522. typedef int (*tdls_state_change_callback)(const uint8_t *mac,
  523. uint32_t opclass,
  524. uint32_t channel,
  525. uint32_t state,
  526. int32_t reason, void *ctx);
  527. /* This callback is used to report events to os_if layer */
  528. typedef void (*tdls_evt_callback) (void *data,
  529. enum tdls_event_type ev_type,
  530. struct tdls_osif_indication *event);
  531. /* This callback is used to register TDLS peer with the datapath */
  532. typedef QDF_STATUS (*tdls_register_peer_callback)(void *userdata,
  533. uint32_t vdev_id,
  534. const uint8_t *mac,
  535. uint16_t stat_id,
  536. uint8_t qos);
  537. /* This callback is used to deregister TDLS peer from the datapath */
  538. typedef QDF_STATUS (*tdls_deregister_peer_callback)(void *userdata,
  539. uint32_t vdev_id,
  540. uint8_t sta_id);
  541. /* This callback is used to update datapath vdev flags */
  542. typedef QDF_STATUS
  543. (*tdls_dp_vdev_update_flags_callback)(void *cbk_data,
  544. uint8_t sta_id,
  545. uint32_t vdev_param,
  546. bool is_link_up);
  547. /* This callback is to release vdev ref for tdls offchan param related msg */
  548. typedef void (*tdls_offchan_parms_callback)(struct wlan_objmgr_vdev *vdev);
  549. /**
  550. * struct tdls_start_params - tdls start params
  551. * @config: tdls user config
  552. * @tdls_send_mgmt_req: pass eWNI_SME_TDLS_SEND_MGMT_REQ value
  553. * @tdls_add_sta_req: pass eWNI_SME_TDLS_ADD_STA_REQ value
  554. * @tdls_del_sta_req: pass eWNI_SME_TDLS_DEL_STA_REQ value
  555. * @tdls_update_peer_state: pass WMA_UPDATE_TDLS_PEER_STATE value
  556. * @tdls_del_all_peers: pass eWNI_SME_DEL_ALL_TDLS_PEERS
  557. * @tdls_update_dp_vdev_flags: pass CDP_UPDATE_TDLS_FLAGS
  558. * @tdls_event_cb: tdls event callback
  559. * @tdls_evt_cb_data: tdls event data
  560. * @tdls_peer_context: userdata for register/deregister TDLS peer
  561. * @tdls_reg_peer: register tdls peer with datapath
  562. * @tdls_dereg_peer: deregister tdls peer from datapath
  563. * @tdls_dp_vdev_update: update vdev flags in datapath
  564. */
  565. struct tdls_start_params {
  566. struct tdls_user_config config;
  567. uint16_t tdls_send_mgmt_req;
  568. uint16_t tdls_add_sta_req;
  569. uint16_t tdls_del_sta_req;
  570. uint16_t tdls_update_peer_state;
  571. uint16_t tdls_del_all_peers;
  572. uint32_t tdls_update_dp_vdev_flags;
  573. tdls_rx_callback tdls_rx_cb;
  574. void *tdls_rx_cb_data;
  575. tdls_wmm_check tdls_wmm_cb;
  576. void *tdls_wmm_cb_data;
  577. tdls_evt_callback tdls_event_cb;
  578. void *tdls_evt_cb_data;
  579. void *tdls_peer_context;
  580. tdls_register_peer_callback tdls_reg_peer;
  581. tdls_deregister_peer_callback tdls_dereg_peer;
  582. tdls_dp_vdev_update_flags_callback tdls_dp_vdev_update;
  583. };
  584. /**
  585. * struct tdls_add_peer_params - add peer request parameter
  586. * @peer_addr: peer mac addr
  587. * @peer_type: peer type
  588. * @vdev_id: vdev id
  589. */
  590. struct tdls_add_peer_params {
  591. uint8_t peer_addr[QDF_MAC_ADDR_SIZE];
  592. uint32_t peer_type;
  593. uint32_t vdev_id;
  594. };
  595. /**
  596. * struct tdls_add_peer_request - peer add request
  597. * @vdev: vdev
  598. * @add_peer_req: add peer request parameters
  599. */
  600. struct tdls_add_peer_request {
  601. struct wlan_objmgr_vdev *vdev;
  602. struct tdls_add_peer_params add_peer_req;
  603. };
  604. /**
  605. * struct tdls_del_peer_params - delete peer request parameter
  606. * @peer_addr: peer mac addr
  607. * @peer_type: peer type
  608. * @vdev_id: vdev id
  609. */
  610. struct tdls_del_peer_params {
  611. const uint8_t *peer_addr;
  612. uint32_t peer_type;
  613. uint32_t vdev_id;
  614. };
  615. /**
  616. * struct tdls_del_peer_request - peer delete request
  617. * @vdev: vdev
  618. * @del_peer_req: delete peer request parameters
  619. */
  620. struct tdls_del_peer_request {
  621. struct wlan_objmgr_vdev *vdev;
  622. struct tdls_del_peer_params del_peer_req;
  623. };
  624. /**
  625. * struct vhgmcsinfo - VHT MCS information
  626. * @rx_mcs_map: RX MCS map 2 bits for each stream, total 8 streams
  627. * @rx_highest: Indicates highest long GI VHT PPDU data rate
  628. * STA can receive. Rate expressed in units of 1 Mbps.
  629. * If this field is 0 this value should not be used to
  630. * consider the highest RX data rate supported.
  631. * @tx_mcs_map: TX MCS map 2 bits for each stream, total 8 streams
  632. * @tx_highest: Indicates highest long GI VHT PPDU data rate
  633. * STA can transmit. Rate expressed in units of 1 Mbps.
  634. * If this field is 0 this value should not be used to
  635. * consider the highest TX data rate supported.
  636. */
  637. struct vhtmcsinfo {
  638. uint16_t rx_mcs_map;
  639. uint16_t rx_highest;
  640. uint16_t tx_mcs_map;
  641. uint16_t tx_highest;
  642. };
  643. /**
  644. * struct vhtcap - VHT capabilities
  645. *
  646. * This structure is the "VHT capabilities element" as
  647. * described in 802.11ac D3.0 8.4.2.160
  648. * @vht_cap_info: VHT capability info
  649. * @supp_mcs: VHT MCS supported rates
  650. */
  651. struct vhtcap {
  652. uint32_t vht_capinfo;
  653. struct vhtmcsinfo supp_mcs;
  654. };
  655. struct tdls_update_peer_params {
  656. uint8_t peer_addr[QDF_MAC_ADDR_SIZE];
  657. uint32_t peer_type;
  658. uint32_t vdev_id;
  659. uint16_t capability;
  660. uint8_t extn_capability[WLAN_MAC_MAX_EXTN_CAP];
  661. uint8_t supported_rates_len;
  662. uint8_t supported_rates[WLAN_MAC_MAX_SUPP_RATES];
  663. uint8_t htcap_present;
  664. struct htcap_cmn_ie ht_cap;
  665. uint8_t vhtcap_present;
  666. struct vhtcap vht_cap;
  667. uint8_t uapsd_queues;
  668. uint8_t max_sp;
  669. uint8_t supported_channels_len;
  670. uint8_t supported_channels[WLAN_MAC_MAX_SUPP_CHANNELS];
  671. uint8_t supported_oper_classes_len;
  672. uint8_t supported_oper_classes[WLAN_MAX_SUPP_OPER_CLASSES];
  673. bool is_qos_wmm_sta;
  674. };
  675. struct tdls_update_peer_request {
  676. struct wlan_objmgr_vdev *vdev;
  677. struct tdls_update_peer_params update_peer_req;
  678. };
  679. /**
  680. * struct tdls_oper_request - tdls operation request
  681. * @vdev: vdev object
  682. * @peer_addr: MAC address of the TDLS peer
  683. */
  684. struct tdls_oper_request {
  685. struct wlan_objmgr_vdev *vdev;
  686. uint8_t peer_addr[QDF_MAC_ADDR_SIZE];
  687. };
  688. /**
  689. * struct tdls_oper_config_force_peer_request - tdls enable force peer request
  690. * @vdev: vdev object
  691. * @peer_addr: MAC address of the TDLS peer
  692. * @chan: channel
  693. * @max_latency: maximum latency
  694. * @op_class: operation class
  695. * @min_bandwidth: minimal bandwidth
  696. * @callback: state change callback
  697. */
  698. struct tdls_oper_config_force_peer_request {
  699. struct wlan_objmgr_vdev *vdev;
  700. uint8_t peer_addr[QDF_MAC_ADDR_SIZE];
  701. uint32_t chan;
  702. uint32_t max_latency;
  703. uint32_t op_class;
  704. uint32_t min_bandwidth;
  705. tdls_state_change_callback callback;
  706. };
  707. /**
  708. * struct tdls_info - tdls info
  709. *
  710. * @vdev_id: vdev id
  711. * @tdls_state: tdls state
  712. * @notification_interval_ms: notification interval in ms
  713. * @tx_discovery_threshold: tx discovery threshold
  714. * @tx_teardown_threshold: tx teardown threshold
  715. * @rssi_teardown_threshold: rx teardown threshold
  716. * @rssi_delta: rssi delta
  717. * @tdls_options: tdls options
  718. * @peer_traffic_ind_window: peer traffic indication window
  719. * @peer_traffic_response_timeout: peer traffic response timeout
  720. * @puapsd_mask: puapsd mask
  721. * @puapsd_inactivity_time: puapsd inactivity time
  722. * @puapsd_rx_frame_threshold: puapsd rx frame threshold
  723. * @teardown_notification_ms: tdls teardown notification interval
  724. * @tdls_peer_kickout_threshold: tdls packets threshold
  725. * for peer kickout operation
  726. */
  727. struct tdls_info {
  728. uint32_t vdev_id;
  729. uint32_t tdls_state;
  730. uint32_t notification_interval_ms;
  731. uint32_t tx_discovery_threshold;
  732. uint32_t tx_teardown_threshold;
  733. int32_t rssi_teardown_threshold;
  734. int32_t rssi_delta;
  735. uint32_t tdls_options;
  736. uint32_t peer_traffic_ind_window;
  737. uint32_t peer_traffic_response_timeout;
  738. uint32_t puapsd_mask;
  739. uint32_t puapsd_inactivity_time;
  740. uint32_t puapsd_rx_frame_threshold;
  741. uint32_t teardown_notification_ms;
  742. uint32_t tdls_peer_kickout_threshold;
  743. };
  744. /**
  745. * struct tdls_ch_params - channel parameters
  746. * @chan_id: ID of the channel
  747. * @pwr: power level
  748. * @dfs_set: is dfs supported or not
  749. * @half_rate: is the channel operating at 10MHz
  750. * @quarter_rate: is the channel operating at 5MHz
  751. */
  752. struct tdls_ch_params {
  753. uint8_t chan_id;
  754. uint8_t pwr;
  755. bool dfs_set;
  756. bool half_rate;
  757. bool quarter_rate;
  758. };
  759. /**
  760. * struct tdls_peer_params - TDLS peer capablities parameters
  761. * @is_peer_responder: is peer responder or not
  762. * @peer_uapsd_queue: peer uapsd queue
  763. * @peer_max_sp: peer max SP value
  764. * @peer_buff_sta_support: peer buffer sta supported or not
  765. * @peer_off_chan_support: peer offchannel support
  766. * @peer_curr_operclass: peer current operating class
  767. * @self_curr_operclass: self current operating class
  768. * @peer_chanlen: peer channel length
  769. * @peer_chan: peer channel list
  770. * @peer_oper_classlen: peer operating class length
  771. * @peer_oper_class: peer operating class
  772. * @pref_off_channum: peer offchannel number
  773. * @pref_off_chan_bandwidth: peer offchannel bandwidth
  774. * @opclass_for_prefoffchan: operating class for offchannel
  775. */
  776. struct tdls_peer_params {
  777. uint8_t is_peer_responder;
  778. uint8_t peer_uapsd_queue;
  779. uint8_t peer_max_sp;
  780. uint8_t peer_buff_sta_support;
  781. uint8_t peer_off_chan_support;
  782. uint8_t peer_curr_operclass;
  783. uint8_t self_curr_operclass;
  784. uint8_t peer_chanlen;
  785. struct tdls_ch_params peer_chan[WLAN_MAC_WMI_MAX_SUPP_CHANNELS];
  786. uint8_t peer_oper_classlen;
  787. uint8_t peer_oper_class[WLAN_MAX_SUPP_OPER_CLASSES];
  788. uint8_t pref_off_channum;
  789. uint8_t pref_off_chan_bandwidth;
  790. uint8_t opclass_for_prefoffchan;
  791. };
  792. /**
  793. * struct tdls_peer_update_state - TDLS peer state parameters
  794. * @vdev_id: vdev id
  795. * @peer_macaddr: peer mac address
  796. * @peer_cap: peer capabality
  797. * @resp_reqd: response needed
  798. */
  799. struct tdls_peer_update_state {
  800. uint32_t vdev_id;
  801. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  802. uint32_t peer_state;
  803. struct tdls_peer_params peer_cap;
  804. bool resp_reqd;
  805. };
  806. /**
  807. * struct tdls_channel_switch_params - channel switch parameter structure
  808. * @vdev_id: vdev ID
  809. * @peer_mac_addr: Peer mac address
  810. * @tdls_off_ch_bw_offset: Target off-channel bandwitdh offset
  811. * @tdls_off_ch: Target Off Channel
  812. * @oper_class: Operating class for target channel
  813. * @is_responder: Responder or initiator
  814. */
  815. struct tdls_channel_switch_params {
  816. uint32_t vdev_id;
  817. uint8_t peer_mac_addr[QDF_MAC_ADDR_SIZE];
  818. uint16_t tdls_off_ch_bw_offset;
  819. uint8_t tdls_off_ch;
  820. uint8_t tdls_sw_mode;
  821. uint8_t oper_class;
  822. uint8_t is_responder;
  823. };
  824. /**
  825. * enum uapsd_access_cat - U-APSD Access Categories
  826. * @UAPSD_AC_BE: best effort
  827. * @UAPSD_AC_BK: back ground
  828. * @UAPSD_AC_VI: video
  829. * @UAPSD_AC_VO: voice
  830. */
  831. enum uapsd_access_cat {
  832. UAPSD_AC_BE,
  833. UAPSD_AC_BK,
  834. UAPSD_AC_VI,
  835. UAPSD_AC_VO
  836. };
  837. /**
  838. * enum tspec_dir_type - TSPEC Direction type
  839. * @TX_DIR: uplink
  840. * @RX_DIR: downlink
  841. * @BI_DIR: bidirectional
  842. */
  843. enum tspec_dir_type {
  844. TX_DIR = 0,
  845. RX_DIR = 1,
  846. BI_DIR = 2,
  847. };
  848. /**
  849. * struct sta_uapsd_params - uapsd auto trig params
  850. * @wmm_ac: WMM access category from 0 to 3
  851. * @user_priority: User priority to use in trigger frames
  852. * @service_interval: service interval
  853. * @suspend_interval: suspend interval
  854. * @delay_interval: delay interval
  855. */
  856. struct sta_uapsd_params {
  857. uint32_t wmm_ac;
  858. uint32_t user_priority;
  859. uint32_t service_interval;
  860. uint32_t suspend_interval;
  861. uint32_t delay_interval;
  862. };
  863. /**
  864. * struct sta_uapsd_trig_params - uapsd trigger parameter
  865. * @vdevid: vdev id
  866. * @peer_addr: peer address
  867. * @auto_triggerparam: trigger parameters
  868. * @num_ac: no of access category
  869. */
  870. struct sta_uapsd_trig_params {
  871. uint32_t vdevid;
  872. uint8_t peer_addr[QDF_MAC_ADDR_SIZE];
  873. struct sta_uapsd_params *auto_triggerparam;
  874. uint32_t num_ac;
  875. };
  876. /**
  877. * struct tdls_event_info - firmware tdls event
  878. * @vdev_id: vdev id
  879. * @peermac: peer mac address
  880. * @message_type: message type
  881. * @peer_reason: reason
  882. */
  883. struct tdls_event_info {
  884. uint8_t vdev_id;
  885. struct qdf_mac_addr peermac;
  886. uint16_t message_type;
  887. uint32_t peer_reason;
  888. };
  889. /**
  890. * struct tdls_event_notify - tdls event notify
  891. * @vdev: vdev object
  892. * @event: tdls event
  893. */
  894. struct tdls_event_notify {
  895. struct wlan_objmgr_vdev *vdev;
  896. struct tdls_event_info event;
  897. };
  898. /**
  899. * struct tdls_event_notify - tdls event notify
  900. * @peer_mac: peer's mac address
  901. * @frame_type: Type of TDLS mgmt frame to be sent
  902. * @dialog: dialog token used in the frame.
  903. * @status_code: status to be incuded in the frame
  904. * @responder: Tdls request type
  905. * @peer_capability: peer cpabilities
  906. * @len: length of additional Ies
  907. * @buf: additional IEs to be included
  908. */
  909. struct tdls_send_mgmt {
  910. struct qdf_mac_addr peer_mac;
  911. uint8_t frame_type;
  912. uint8_t dialog;
  913. uint16_t status_code;
  914. uint8_t responder;
  915. uint32_t peer_capability;
  916. uint8_t len;
  917. /* Variable length, do not add anything after this */
  918. uint8_t buf[];
  919. };
  920. /**
  921. * struct tdls_validate_action_req - tdls validate mgmt request
  922. * @vdev: vdev object
  923. * @action_code: action code
  924. * @peer_mac: peer mac address
  925. * @dialog_token: dialog code
  926. * @status_code: status code to add
  927. * @len: len of the frame
  928. * @responder: whether to respond or not
  929. * @max_sta_failed: mgmt failure reason
  930. */
  931. struct tdls_validate_action_req {
  932. struct wlan_objmgr_vdev *vdev;
  933. uint8_t action_code;
  934. uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
  935. uint8_t dialog_token;
  936. uint8_t status_code;
  937. size_t len;
  938. int responder;
  939. int max_sta_failed;
  940. };
  941. /**
  942. * struct tdls_get_all_peers - get all peers from the list
  943. * @vdev: vdev object
  944. * @buf: output string buffer to hold the peer info
  945. * @buf_len: the size of output string buffer
  946. */
  947. struct tdls_get_all_peers {
  948. struct wlan_objmgr_vdev *vdev;
  949. char *buf;
  950. int buf_len;
  951. };
  952. /**
  953. * struct tdls_send_action_frame_request - tdls send mgmt request
  954. * @vdev: vdev object
  955. * @chk_frame: frame validation structure
  956. * @session_id: session id
  957. * @vdev_id: vdev id
  958. * @cmd_buf: cmd buffer
  959. * @len: length of the frame
  960. * @use_default_ac: access category
  961. * @tdls_mgmt: tdls management
  962. */
  963. struct tdls_action_frame_request {
  964. struct wlan_objmgr_vdev *vdev;
  965. struct tdls_validate_action_req *chk_frame;
  966. uint8_t session_id;
  967. uint8_t vdev_id;
  968. const uint8_t *cmd_buf;
  969. uint8_t len;
  970. bool use_default_ac;
  971. /* Variable length, do not add anything after this */
  972. struct tdls_send_mgmt tdls_mgmt;
  973. };
  974. /**
  975. * struct tdls_set_responder_req - tdls set responder in peer
  976. * @vdev: vdev object
  977. * @peer_mac: peer mac address
  978. * @responder: whether to respond or not
  979. */
  980. struct tdls_set_responder_req {
  981. struct wlan_objmgr_vdev *vdev;
  982. uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
  983. uint8_t responder;
  984. };
  985. /**
  986. * struct tdls_sta_notify_params - STA connection notify info
  987. * @vdev: vdev object
  988. * @tdls_prohibited: peer mac addr
  989. * @tdls_chan_swit_prohibited: peer type
  990. * @lfr_roam: is trigger due to lfr
  991. * @session_id: session id
  992. */
  993. struct tdls_sta_notify_params {
  994. struct wlan_objmgr_vdev *vdev;
  995. bool tdls_prohibited;
  996. bool tdls_chan_swit_prohibited;
  997. bool lfr_roam;
  998. bool user_disconnect;
  999. uint8_t session_id;
  1000. };
  1001. /**
  1002. * struct tdls_delete_all_peers_params - TDLS set mode params
  1003. * @vdev: vdev object
  1004. */
  1005. struct tdls_delete_all_peers_params {
  1006. struct wlan_objmgr_vdev *vdev;
  1007. };
  1008. /**
  1009. * struct tdls_set_mode_params - TDLS set mode params
  1010. * @vdev: vdev object
  1011. * @tdls_mode: tdls mode to set
  1012. * @update_last: inform to update last tdls mode
  1013. * @source: mode change requester
  1014. */
  1015. struct tdls_set_mode_params {
  1016. struct wlan_objmgr_vdev *vdev;
  1017. enum tdls_feature_mode tdls_mode;
  1018. bool update_last;
  1019. enum tdls_disable_sources source;
  1020. };
  1021. /**
  1022. * struct tdls_del_all_tdls_peers - delete all tdls peers
  1023. * @msg_type: type of message
  1024. * @msg_len: length of message
  1025. * @bssid: bssid of peer device
  1026. */
  1027. struct tdls_del_all_tdls_peers {
  1028. uint16_t msg_type;
  1029. uint16_t msg_len;
  1030. struct qdf_mac_addr bssid;
  1031. };
  1032. /**
  1033. * struct tdls_antenna_switch_request - TDLS antenna switch request
  1034. * @vdev: vdev object
  1035. * @mode: antenna mode, 1x1 or 2x2
  1036. */
  1037. struct tdls_antenna_switch_request {
  1038. struct wlan_objmgr_vdev *vdev;
  1039. uint32_t mode;
  1040. };
  1041. /**
  1042. * struct tdls_set_offchannel - TDLS set offchannel
  1043. * @vdev: vdev object
  1044. * @offchannel: Updated tdls offchannel value.
  1045. * @callback: callback to release vdev ref.
  1046. */
  1047. struct tdls_set_offchannel {
  1048. struct wlan_objmgr_vdev *vdev;
  1049. uint16_t offchannel;
  1050. tdls_offchan_parms_callback callback;
  1051. };
  1052. /**
  1053. * struct tdls_set_offchan_mode - TDLS set offchannel mode
  1054. * @vdev: vdev object
  1055. * @offchan_mode: Updated tdls offchannel mode value.
  1056. * @callback: callback to release vdev ref.
  1057. */
  1058. struct tdls_set_offchanmode {
  1059. struct wlan_objmgr_vdev *vdev;
  1060. uint8_t offchan_mode;
  1061. tdls_offchan_parms_callback callback;
  1062. };
  1063. /**
  1064. * struct tdls_set_offchan_offset - TDLS set offchannel mode
  1065. * @vdev: vdev object
  1066. * @offchan_offset: Offchan offset value.
  1067. * @callback: callback to release vdev ref.
  1068. */
  1069. struct tdls_set_secoffchanneloffset {
  1070. struct wlan_objmgr_vdev *vdev;
  1071. int offchan_offset;
  1072. tdls_offchan_parms_callback callback;
  1073. };
  1074. #endif