wlan_tdls_public_structs.h 34 KB

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