wlan_tdls_public_structs.h 34 KB

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