wma.h 74 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361
  1. /*
  2. * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. #ifndef WMA_H
  27. #define WMA_H
  28. #include "a_types.h"
  29. #include "qdf_types.h"
  30. #include "osapi_linux.h"
  31. #include "htc_packet.h"
  32. #include "i_qdf_event.h"
  33. #include "wmi_services.h"
  34. #include "wmi_unified.h"
  35. #include "wmi_version.h"
  36. #include "qdf_types.h"
  37. #include "cfg_api.h"
  38. #include "qdf_status.h"
  39. #include "cds_sched.h"
  40. #include "sir_mac_prot_def.h"
  41. #include "wma_types.h"
  42. #include <linux/workqueue.h>
  43. #include "utils_api.h"
  44. #include "lim_types.h"
  45. #include "wmi_unified_api.h"
  46. #include "cdp_txrx_cmn.h"
  47. #include "dbglog.h"
  48. #include "cds_ieee80211_common.h"
  49. #include "wlan_objmgr_psoc_obj.h"
  50. #include <cdp_txrx_handle.h>
  51. /* Platform specific configuration for max. no. of fragments */
  52. #define QCA_OL_11AC_TX_MAX_FRAGS 2
  53. /* Private */
  54. #define WMA_READY_EVENTID_TIMEOUT 6000
  55. #define WMA_SERVICE_READY_EXT_TIMEOUT 6000
  56. #define WMA_TGT_SUSPEND_COMPLETE_TIMEOUT 6000
  57. #define WMA_WAKE_LOCK_TIMEOUT 1000
  58. #define WMA_RESUME_TIMEOUT 25000
  59. #define MAX_MEM_CHUNKS 32
  60. #define WMA_CRASH_INJECT_TIMEOUT 5000
  61. /* MAC ID to PDEV ID mapping is as given below
  62. * MAC_ID PDEV_ID
  63. * 0 1
  64. * 1 2
  65. * SOC Level WMI_PDEV_ID_SOC
  66. */
  67. #define WMA_MAC_TO_PDEV_MAP(x) ((x) + (1))
  68. #define WMA_PDEV_TO_MAC_MAP(x) ((x) - (1))
  69. /* In prima 12 HW stations are supported including BCAST STA(staId 0)
  70. * and SELF STA(staId 1) so total ASSOC stations which can connect to Prima
  71. * SoftAP = 12 - 1(Self STa) - 1(Bcast Sta) = 10 Stations.
  72. */
  73. #ifdef WLAN_SOFTAP_VSTA_FEATURE
  74. #define WMA_MAX_SUPPORTED_STAS 38
  75. #else
  76. #define WMA_MAX_SUPPORTED_STAS 12
  77. #endif
  78. #define WMA_MAX_SUPPORTED_BSS 5
  79. #define FRAGMENT_SIZE 3072
  80. #define WMA_INVALID_VDEV_ID 0xFF
  81. #define MAX_MEM_CHUNKS 32
  82. #define WMA_MAX_VDEV_SIZE 20
  83. #define WMA_VDEV_TBL_ENTRY_ADD 1
  84. #define WMA_VDEV_TBL_ENTRY_DEL 0
  85. /* 11A/G channel boundary */
  86. #define WMA_11A_CHANNEL_BEGIN 34
  87. #define WMA_11A_CHANNEL_END 165
  88. #define WMA_11G_CHANNEL_BEGIN 1
  89. #define WMA_11G_CHANNEL_END 14
  90. #define WMA_11P_CHANNEL_BEGIN (170)
  91. #define WMA_11P_CHANNEL_END (184)
  92. #define WMA_LOGD(args ...) \
  93. QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, ## args)
  94. #define WMA_LOGI(args ...) \
  95. QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_INFO, ## args)
  96. #define WMA_LOGW(args ...) \
  97. QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_WARN, ## args)
  98. #define WMA_LOGE(args ...) \
  99. QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_ERROR, ## args)
  100. #define WMA_LOGP(args ...) \
  101. QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_FATAL, ## args)
  102. #define WMA_DEBUG_ALWAYS
  103. #ifdef WMA_DEBUG_ALWAYS
  104. #define WMA_LOGA(args ...) \
  105. QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_FATAL, ## args)
  106. #else
  107. #define WMA_LOGA(args ...)
  108. #endif
  109. #define ALIGNED_WORD_SIZE 4
  110. #define WLAN_HAL_MSG_TYPE_MAX_ENUM_SIZE 0x7FFF
  111. #define WMA_WILDCARD_PDEV_ID 0x0
  112. /* Prefix used by scan req ids generated on the host */
  113. #define WMA_HOST_SCAN_REQID_PREFIX 0xA000
  114. /* Prefix used by roam scan req ids generated on the host */
  115. #define WMA_HOST_ROAM_SCAN_REQID_PREFIX 0xA800
  116. /* Prefix used by scan requestor id on host */
  117. #define WMA_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000
  118. #define WMA_HW_DEF_SCAN_MAX_DURATION 30000 /* 30 secs */
  119. /* Max offchannel duration */
  120. #define WMA_BURST_SCAN_MAX_NUM_OFFCHANNELS (3)
  121. #define WMA_SCAN_NPROBES_DEFAULT (2)
  122. #define WMA_SCAN_IDLE_TIME_DEFAULT (25)
  123. #define WMA_P2P_SCAN_MAX_BURST_DURATION (180)
  124. #define WMA_CTS_DURATION_MS_MAX (32)
  125. #define WMA_GO_MIN_ACTIVE_SCAN_BURST_DURATION (40)
  126. #define WMA_GO_MAX_ACTIVE_SCAN_BURST_DURATION (120)
  127. #define WMA_DWELL_TIME_PASSIVE_DEFAULT (110)
  128. #define WMA_DWELL_TIME_PROBE_TIME_MAP_SIZE (11)
  129. #define WMA_3PORT_CONC_SCAN_MAX_BURST_DURATION (25)
  130. #define WMA_SEC_TO_USEC (1000000)
  131. #define BEACON_TX_BUFFER_SIZE (512)
  132. /* WMA_ETHER_TYPE_OFFSET = sa(6) + da(6) */
  133. #define WMA_ETHER_TYPE_OFFSET (6 + 6)
  134. /* WMA_ICMP_V6_HEADER_OFFSET = sa(6) + da(6) + eth_type(2) + icmp_v6_hdr(6)*/
  135. #define WMA_ICMP_V6_HEADER_OFFSET (6 + 6 + 2 + 6)
  136. /* WMA_ICMP_V6_TYPE_OFFSET = sa(6) + da(6) + eth_type(2) + 40 */
  137. #define WMA_ICMP_V6_TYPE_OFFSET (6 + 6 + 2 + 40)
  138. /* WMA_IPV4_PROTOCOL = sa(6) + da(6) + eth_type(2) + 9 */
  139. #define WMA_IPV4_PROTOCOL (6 + 6 + 2 + 9)
  140. #define WMA_ICMP_V6_HEADER_TYPE (0x3A)
  141. #define WMA_ICMP_V6_RA_TYPE (0x86)
  142. #define WMA_ICMP_V6_NS_TYPE (0x87)
  143. #define WMA_ICMP_V6_NA_TYPE (0x88)
  144. #define WMA_BCAST_MAC_ADDR (0xFF)
  145. #define WMA_MCAST_IPV4_MAC_ADDR (0x01)
  146. #define WMA_MCAST_IPV6_MAC_ADDR (0x33)
  147. #define WMA_ICMP_PROTOCOL (0x01)
  148. #define WMA_IS_EAPOL_GET_MIN_LEN 14
  149. #define WMA_EAPOL_SUBTYPE_GET_MIN_LEN 21
  150. #define WMA_EAPOL_INFO_GET_MIN_LEN 23
  151. #define WMA_IS_DHCP_GET_MIN_LEN 38
  152. #define WMA_DHCP_SUBTYPE_GET_MIN_LEN 0x11D
  153. #define WMA_DHCP_INFO_GET_MIN_LEN 50
  154. #define WMA_IS_ARP_GET_MIN_LEN 14
  155. #define WMA_ARP_SUBTYPE_GET_MIN_LEN 22
  156. #define WMA_IPV4_PROTO_GET_MIN_LEN 24
  157. #define WMA_IPV4_PKT_INFO_GET_MIN_LEN 42
  158. #define WMA_ICMP_SUBTYPE_GET_MIN_LEN 35
  159. #define WMA_IPV6_PROTO_GET_MIN_LEN 21
  160. #define WMA_IPV6_PKT_INFO_GET_MIN_LEN 62
  161. #define WMA_ICMPV6_SUBTYPE_GET_MIN_LEN 55
  162. /**
  163. * ds_mode: distribution system mode
  164. * @IEEE80211_NO_DS: NO DS at either side
  165. * @IEEE80211_TO_DS: DS at receiver side
  166. * @IEEE80211_FROM_DS: DS at sender side
  167. * @IEEE80211_DS_TO_DS: DS at both sender and revceiver side
  168. */
  169. enum ds_mode {
  170. IEEE80211_NO_DS,
  171. IEEE80211_TO_DS,
  172. IEEE80211_FROM_DS,
  173. IEEE80211_DS_TO_DS
  174. };
  175. /* Roaming default values
  176. * All time and period values are in milliseconds.
  177. * All rssi values are in dB except for WMA_NOISE_FLOOR_DBM_DEFAULT.
  178. */
  179. #define WMA_ROAM_SCAN_CHANNEL_SWITCH_TIME (4)
  180. #define WMA_NOISE_FLOOR_DBM_DEFAULT (-96)
  181. #define WMA_ROAM_RSSI_DIFF_DEFAULT (5)
  182. #define WMA_ROAM_DWELL_TIME_ACTIVE_DEFAULT (100)
  183. #define WMA_ROAM_DWELL_TIME_PASSIVE_DEFAULT (110)
  184. #define WMA_ROAM_MIN_REST_TIME_DEFAULT (50)
  185. #define WMA_ROAM_MAX_REST_TIME_DEFAULT (500)
  186. #define WMA_ROAM_LOW_RSSI_TRIGGER_DEFAULT (20)
  187. #define WMA_ROAM_LOW_RSSI_TRIGGER_VERYLOW (10)
  188. #define WMA_ROAM_BEACON_WEIGHT_DEFAULT (14)
  189. #define WMA_ROAM_OPP_SCAN_PERIOD_DEFAULT (120000)
  190. #define WMA_ROAM_OPP_SCAN_AGING_PERIOD_DEFAULT (WMA_ROAM_OPP_SCAN_PERIOD_DEFAULT * 5)
  191. #define WMA_ROAM_BMISS_FIRST_BCNT_DEFAULT (10)
  192. #define WMA_ROAM_BMISS_FINAL_BCNT_DEFAULT (10)
  193. #define WMA_ROAM_BMISS_FIRST_BCNT_DEFAULT_P2P (15)
  194. #define WMA_ROAM_BMISS_FINAL_BCNT_DEFAULT_P2P (45)
  195. #define WMA_INVALID_KEY_IDX 0xff
  196. #define WMA_DFS_RADAR_FOUND 1
  197. #define WMA_MAX_RF_CHAINS(x) ((1 << x) - 1)
  198. #define WMA_MIN_RF_CHAINS (1)
  199. #ifdef FEATURE_WLAN_EXTSCAN
  200. #define WMA_MAX_EXTSCAN_MSG_SIZE 1536
  201. #define WMA_EXTSCAN_REST_TIME 100
  202. #define WMA_EXTSCAN_MAX_SCAN_TIME 50000
  203. #define WMA_EXTSCAN_BURST_DURATION 150
  204. #endif
  205. #define WMA_BCN_BUF_MAX_SIZE 2500
  206. #define WMA_NOA_IE_SIZE(num_desc) (2 + (13 * (num_desc)))
  207. #define WMA_MAX_NOA_DESCRIPTORS 4
  208. #define WMA_TIM_SUPPORTED_PVB_LENGTH ((HAL_NUM_STA / 8) + 1)
  209. #define WMA_WOW_PTRN_MASK_VALID 0xFF
  210. #define WMA_NUM_BITS_IN_BYTE 8
  211. #define WMA_AP_WOW_DEFAULT_PTRN_MAX 4
  212. #define WMA_STA_WOW_DEFAULT_PTRN_MAX 5
  213. #define WMA_BSS_STATUS_STARTED 0x1
  214. #define WMA_BSS_STATUS_STOPPED 0x2
  215. #define WMA_TARGET_REQ_TYPE_VDEV_START 0x1
  216. #define WMA_TARGET_REQ_TYPE_VDEV_STOP 0x2
  217. #define WMA_TARGET_REQ_TYPE_VDEV_DEL 0x3
  218. #define WMA_PEER_ASSOC_CNF_START 0x01
  219. #define WMA_PEER_ASSOC_TIMEOUT (6000) /* 6 seconds */
  220. #define WMA_DELETE_STA_RSP_START 0x02
  221. #define WMA_DELETE_STA_TIMEOUT (6000) /* 6 seconds */
  222. #define WMA_DEL_P2P_SELF_STA_RSP_START 0x03
  223. #define WMA_VDEV_START_REQUEST_TIMEOUT (6000) /* 6 seconds */
  224. #define WMA_VDEV_STOP_REQUEST_TIMEOUT (6000) /* 6 seconds */
  225. #define WMA_TGT_INVALID_SNR 0x127
  226. #define WMA_TX_Q_RECHECK_TIMER_WAIT 2 /* 2 ms */
  227. #define WMA_TX_Q_RECHECK_TIMER_MAX_WAIT 20 /* 20 ms */
  228. #define WMA_MAX_NUM_ARGS 8
  229. #define WMA_SMPS_MASK_LOWER_16BITS 0xFF
  230. #define WMA_SMPS_MASK_UPPER_3BITS 0x7
  231. #define WMA_SMPS_PARAM_VALUE_S 29
  232. #define WMA_MAX_SCAN_ID 0x00FF
  233. /*
  234. * Setting the Tx Comp Timeout to 1 secs.
  235. * TODO: Need to Revist the Timing
  236. */
  237. #define WMA_TX_FRAME_COMPLETE_TIMEOUT 1000
  238. #define WMA_TX_FRAME_BUFFER_NO_FREE 0
  239. #define WMA_TX_FRAME_BUFFER_FREE 1
  240. /* Default InActivity Time is 200 ms */
  241. #define POWERSAVE_DEFAULT_INACTIVITY_TIME 200
  242. /* Default Listen Interval */
  243. #define POWERSAVE_DEFAULT_LISTEN_INTERVAL 1
  244. /*
  245. * TODO: Add WMI_CMD_ID_MAX as part of WMI_CMD_ID
  246. * instead of assigning it to the last valid wmi
  247. * cmd+1 to avoid updating this when a command is
  248. * added/deleted.
  249. */
  250. #define WMI_CMDID_MAX (WMI_TXBF_CMDID + 1)
  251. #define WMA_NLO_FREQ_THRESH 1000 /* in MHz */
  252. #define WMA_SEC_TO_MSEC(sec) (sec * 1000) /* sec to msec */
  253. #define WMA_MSEC_TO_USEC(msec) (msec * 1000) /* msec to usec */
  254. /* Default rssi threshold defined in CFG80211 */
  255. #define WMA_RSSI_THOLD_DEFAULT -300
  256. #ifdef FEATURE_WLAN_SCAN_PNO
  257. #define WMA_PNO_MATCH_WAKE_LOCK_TIMEOUT (5 * 1000) /* in msec */
  258. #define WMA_PNO_SCAN_COMPLETE_WAKE_LOCK_TIMEOUT (2 * 1000) /* in msec */
  259. #endif
  260. #define WMA_AUTH_REQ_RECV_WAKE_LOCK_TIMEOUT (5 * 1000) /* in msec */
  261. #define WMA_ASSOC_REQ_RECV_WAKE_LOCK_DURATION (5 * 1000) /* in msec */
  262. #define WMA_DEAUTH_RECV_WAKE_LOCK_DURATION (5 * 1000) /* in msec */
  263. #define WMA_DISASSOC_RECV_WAKE_LOCK_DURATION (5 * 1000) /* in msec */
  264. #define WMA_ROAM_HO_WAKE_LOCK_DURATION (500) /* in msec */
  265. #ifdef FEATURE_WLAN_AUTO_SHUTDOWN
  266. #define WMA_AUTO_SHUTDOWN_WAKE_LOCK_DURATION (5 * 1000) /* in msec */
  267. #endif
  268. #define WMA_BMISS_EVENT_WAKE_LOCK_DURATION (4 * 1000) /* in msec */
  269. #define WMA_FW_RSP_EVENT_WAKE_LOCK_DURATION (3 * 1000) /* in msec */
  270. #define WMA_TXMIC_LEN 8
  271. #define WMA_RXMIC_LEN 8
  272. /*
  273. * Length = (2 octets for Index and CTWin/Opp PS) and
  274. * (13 octets for each NOA Descriptors)
  275. */
  276. #define WMA_P2P_NOA_IE_OPP_PS_SET (0x80)
  277. #define WMA_P2P_NOA_IE_CTWIN_MASK (0x7F)
  278. #define WMA_P2P_IE_ID 0xdd
  279. #define WMA_P2P_WFA_OUI { 0x50, 0x6f, 0x9a }
  280. #define WMA_P2P_WFA_VER 0x09 /* ver 1.0 */
  281. #define WMA_WSC_OUI { 0x00, 0x50, 0xF2 } /* Microsoft WSC OUI byte */
  282. /* P2P Sub element defintions (according to table 5 of Wifi's P2P spec) */
  283. #define WMA_P2P_SUB_ELEMENT_STATUS 0
  284. #define WMA_P2P_SUB_ELEMENT_MINOR_REASON 1
  285. #define WMA_P2P_SUB_ELEMENT_CAPABILITY 2
  286. #define WMA_P2P_SUB_ELEMENT_DEVICE_ID 3
  287. #define WMA_P2P_SUB_ELEMENT_GO_INTENT 4
  288. #define WMA_P2P_SUB_ELEMENT_CONFIGURATION_TIMEOUT 5
  289. #define WMA_P2P_SUB_ELEMENT_LISTEN_CHANNEL 6
  290. #define WMA_P2P_SUB_ELEMENT_GROUP_BSSID 7
  291. #define WMA_P2P_SUB_ELEMENT_EXTENDED_LISTEN_TIMING 8
  292. #define WMA_P2P_SUB_ELEMENT_INTENDED_INTERFACE_ADDR 9
  293. #define WMA_P2P_SUB_ELEMENT_MANAGEABILITY 10
  294. #define WMA_P2P_SUB_ELEMENT_CHANNEL_LIST 11
  295. #define WMA_P2P_SUB_ELEMENT_NOA 12
  296. #define WMA_P2P_SUB_ELEMENT_DEVICE_INFO 13
  297. #define WMA_P2P_SUB_ELEMENT_GROUP_INFO 14
  298. #define WMA_P2P_SUB_ELEMENT_GROUP_ID 15
  299. #define WMA_P2P_SUB_ELEMENT_INTERFACE 16
  300. #define WMA_P2P_SUB_ELEMENT_OP_CHANNEL 17
  301. #define WMA_P2P_SUB_ELEMENT_INVITATION_FLAGS 18
  302. #define WMA_P2P_SUB_ELEMENT_VENDOR 221
  303. /* Macros for handling unaligned memory accesses */
  304. #define P2PIE_PUT_LE16(a, val) \
  305. do { \
  306. (a)[1] = ((u16) (val)) >> 8; \
  307. (a)[0] = ((u16) (val)) & 0xff; \
  308. } while (0)
  309. #define P2PIE_PUT_LE32(a, val) \
  310. do { \
  311. (a)[3] = (u8) ((((u32) (val)) >> 24) & 0xff); \
  312. (a)[2] = (u8) ((((u32) (val)) >> 16) & 0xff); \
  313. (a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \
  314. (a)[0] = (u8) (((u32) (val)) & 0xff); \
  315. } while (0)
  316. #define WMA_DEFAULT_MAX_PSPOLL_BEFORE_WAKE 1
  317. #define WMA_DEFAULT_QPOWER_MAX_PSPOLL_BEFORE_WAKE 1
  318. #define WMA_DEFAULT_QPOWER_TX_WAKE_THRESHOLD 2
  319. #define WMA_DEFAULT_SIFS_BURST_DURATION 8160
  320. #define WMA_VHT_PPS_PAID_MATCH 1
  321. #define WMA_VHT_PPS_GID_MATCH 2
  322. #define WMA_VHT_PPS_DELIM_CRC_FAIL 3
  323. #define WMA_DFS_MAX_20M_SUB_CH 8
  324. #define WMA_80MHZ_START_CENTER_CH_DIFF 6
  325. #define WMA_160MHZ_START_CENTER_CH_DIFF 14
  326. #define WMA_NEXT_20MHZ_START_CH_DIFF 4
  327. #define WMA_DEFAULT_HW_MODE_INDEX 0xFFFF
  328. #define TWO_THIRD (2/3)
  329. /**
  330. * WMA hardware mode list bit-mask definitions.
  331. * Bits 4:0, 31:29 are unused.
  332. *
  333. * The below definitions are added corresponding to WMI DBS HW mode
  334. * list to make it independent of firmware changes for WMI definitions.
  335. * Currently these definitions have dependency with BIT positions of
  336. * the existing WMI macros. Thus, if the BIT positions are changed for
  337. * WMI macros, then these macros' BIT definitions are also need to be
  338. * changed.
  339. */
  340. #define WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS (28)
  341. #define WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS (24)
  342. #define WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS (20)
  343. #define WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS (16)
  344. #define WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS (12)
  345. #define WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS (8)
  346. #define WMA_HW_MODE_DBS_MODE_BITPOS (7)
  347. #define WMA_HW_MODE_AGILE_DFS_MODE_BITPOS (6)
  348. #define WMA_HW_MODE_SBS_MODE_BITPOS (5)
  349. #define WMA_HW_MODE_MAC0_TX_STREAMS_MASK \
  350. (0xf << WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS)
  351. #define WMA_HW_MODE_MAC0_RX_STREAMS_MASK \
  352. (0xf << WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS)
  353. #define WMA_HW_MODE_MAC1_TX_STREAMS_MASK \
  354. (0xf << WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS)
  355. #define WMA_HW_MODE_MAC1_RX_STREAMS_MASK \
  356. (0xf << WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS)
  357. #define WMA_HW_MODE_MAC0_BANDWIDTH_MASK \
  358. (0xf << WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS)
  359. #define WMA_HW_MODE_MAC1_BANDWIDTH_MASK \
  360. (0xf << WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS)
  361. #define WMA_HW_MODE_DBS_MODE_MASK \
  362. (0x1 << WMA_HW_MODE_DBS_MODE_BITPOS)
  363. #define WMA_HW_MODE_AGILE_DFS_MODE_MASK \
  364. (0x1 << WMA_HW_MODE_AGILE_DFS_MODE_BITPOS)
  365. #define WMA_HW_MODE_SBS_MODE_MASK \
  366. (0x1 << WMA_HW_MODE_SBS_MODE_BITPOS)
  367. #define WMA_HW_MODE_MAC0_TX_STREAMS_SET(hw_mode, value) \
  368. WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS, 4, value)
  369. #define WMA_HW_MODE_MAC0_RX_STREAMS_SET(hw_mode, value) \
  370. WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS, 4, value)
  371. #define WMA_HW_MODE_MAC1_TX_STREAMS_SET(hw_mode, value) \
  372. WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS, 4, value)
  373. #define WMA_HW_MODE_MAC1_RX_STREAMS_SET(hw_mode, value) \
  374. WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS, 4, value)
  375. #define WMA_HW_MODE_MAC0_BANDWIDTH_SET(hw_mode, value) \
  376. WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS, 4, value)
  377. #define WMA_HW_MODE_MAC1_BANDWIDTH_SET(hw_mode, value) \
  378. WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS, 4, value)
  379. #define WMA_HW_MODE_DBS_MODE_SET(hw_mode, value) \
  380. WMI_SET_BITS(hw_mode, WMA_HW_MODE_DBS_MODE_BITPOS, 1, value)
  381. #define WMA_HW_MODE_AGILE_DFS_SET(hw_mode, value) \
  382. WMI_SET_BITS(hw_mode, WMA_HW_MODE_AGILE_DFS_MODE_BITPOS, 1, value)
  383. #define WMA_HW_MODE_SBS_MODE_SET(hw_mode, value) \
  384. WMI_SET_BITS(hw_mode, WMA_HW_MODE_SBS_MODE_BITPOS, 1, value)
  385. #define WMA_HW_MODE_MAC0_TX_STREAMS_GET(hw_mode) \
  386. ((hw_mode & WMA_HW_MODE_MAC0_TX_STREAMS_MASK) >> \
  387. WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS)
  388. #define WMA_HW_MODE_MAC0_RX_STREAMS_GET(hw_mode) \
  389. ((hw_mode & WMA_HW_MODE_MAC0_RX_STREAMS_MASK) >> \
  390. WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS)
  391. #define WMA_HW_MODE_MAC1_TX_STREAMS_GET(hw_mode) \
  392. ((hw_mode & WMA_HW_MODE_MAC1_TX_STREAMS_MASK) >> \
  393. WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS)
  394. #define WMA_HW_MODE_MAC1_RX_STREAMS_GET(hw_mode) \
  395. ((hw_mode & WMA_HW_MODE_MAC1_RX_STREAMS_MASK) >> \
  396. WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS)
  397. #define WMA_HW_MODE_MAC0_BANDWIDTH_GET(hw_mode) \
  398. ((hw_mode & WMA_HW_MODE_MAC0_BANDWIDTH_MASK) >> \
  399. WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS)
  400. #define WMA_HW_MODE_MAC1_BANDWIDTH_GET(hw_mode) \
  401. ((hw_mode & WMA_HW_MODE_MAC1_BANDWIDTH_MASK) >> \
  402. WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS)
  403. #define WMA_HW_MODE_DBS_MODE_GET(hw_mode) \
  404. ((hw_mode & WMA_HW_MODE_DBS_MODE_MASK) >> \
  405. WMA_HW_MODE_DBS_MODE_BITPOS)
  406. #define WMA_HW_MODE_AGILE_DFS_GET(hw_mode) \
  407. ((hw_mode & WMA_HW_MODE_AGILE_DFS_MODE_MASK) >> \
  408. WMA_HW_MODE_AGILE_DFS_MODE_BITPOS)
  409. #define WMA_HW_MODE_SBS_MODE_GET(hw_mode) \
  410. ((hw_mode & WMA_HW_MODE_SBS_MODE_MASK) >> \
  411. WMA_HW_MODE_SBS_MODE_BITPOS)
  412. #define WMA_SCAN_END_EVENT (WMI_SCAN_EVENT_COMPLETED | \
  413. WMI_SCAN_EVENT_DEQUEUED | \
  414. WMI_SCAN_EVENT_START_FAILED)
  415. /**
  416. * struct probeTime_dwellTime - probe time, dwell time map
  417. * @dwell_time: dwell time
  418. * @probe_time: repeat probe time
  419. */
  420. typedef struct probeTime_dwellTime {
  421. uint8_t dwell_time;
  422. uint8_t probe_time;
  423. } t_probeTime_dwellTime;
  424. static const t_probeTime_dwellTime
  425. probe_time_dwell_time_map[WMA_DWELL_TIME_PROBE_TIME_MAP_SIZE] = {
  426. {28, 11}, /* 0 SSID */
  427. {28, 20}, /* 1 SSID */
  428. {28, 20}, /* 2 SSID */
  429. {28, 20}, /* 3 SSID */
  430. {28, 20}, /* 4 SSID */
  431. {28, 20}, /* 5 SSID */
  432. {28, 20}, /* 6 SSID */
  433. {28, 11}, /* 7 SSID */
  434. {28, 11}, /* 8 SSID */
  435. {28, 11}, /* 9 SSID */
  436. {28, 8} /* 10 SSID */
  437. };
  438. typedef void (*txFailIndCallback)(uint8_t *peer_mac, uint8_t seqNo);
  439. typedef void (*tp_wma_packetdump_cb)(qdf_nbuf_t netbuf,
  440. uint8_t status, uint8_t vdev_id, uint8_t type);
  441. /**
  442. * enum t_wma_drv_type - wma driver type
  443. * @WMA_DRIVER_TYPE_PRODUCTION: production driver type
  444. * @WMA_DRIVER_TYPE_MFG: manufacture driver type
  445. * @WMA_DRIVER_TYPE_INVALID: invalid driver type
  446. */
  447. typedef enum {
  448. WMA_DRIVER_TYPE_PRODUCTION = 0,
  449. WMA_DRIVER_TYPE_MFG = 1,
  450. WMA_DRIVER_TYPE_INVALID = 0x7FFFFFFF
  451. } t_wma_drv_type;
  452. #ifdef FEATURE_WLAN_TDLS
  453. /**
  454. * enum t_wma_tdls_mode - TDLS mode
  455. * @WMA_TDLS_SUPPORT_NOT_ENABLED: tdls is disable
  456. * @WMA_TDLS_SUPPORT_DISABLED: suppress implicit trigger and not respond to peer
  457. * @WMA_TDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY: suppress implicit trigger,
  458. * but respond to the peer
  459. * @WMA_TDLS_SUPPORT_ENABLED: implicit trigger
  460. * @WMA_TDLS_SUPPORT_ACTIVE_EXTERNAL_CONTROL: External control means
  461. * implicit trigger but only to a peer mac configured by user space.
  462. */
  463. typedef enum {
  464. WMA_TDLS_SUPPORT_NOT_ENABLED = 0,
  465. WMA_TDLS_SUPPORT_DISABLED,
  466. WMA_TDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY,
  467. WMA_TDLS_SUPPORT_ENABLED,
  468. WMA_TDLS_SUPPORT_ACTIVE_EXTERNAL_CONTROL,
  469. } t_wma_tdls_mode;
  470. /**
  471. * enum wma_tdls_peer_notification - TDLS events
  472. * @WMA_TDLS_SHOULD_DISCOVER: tdls discovery recommended for peer (always based
  473. * on tx bytes per second > tx_discover threshold
  474. * NB: notification will be re-sent after
  475. * discovery_request_interval_ms
  476. * @WMA_TDLS_SHOULD_TEARDOWN: tdls link tear down recommended for peer
  477. * due to tx bytes per second below
  478. * tx_teardown_threshold
  479. * NB: this notification sent once
  480. * @WMA_TDLS_PEER_DISCONNECTED: tx peer TDLS link tear down complete
  481. */
  482. enum wma_tdls_peer_notification {
  483. WMA_TDLS_SHOULD_DISCOVER,
  484. WMA_TDLS_SHOULD_TEARDOWN,
  485. WMA_TDLS_PEER_DISCONNECTED,
  486. };
  487. /**
  488. * enum wma_tdls_peer_reason - TDLS peer reason
  489. * @WMA_TDLS_TEARDOWN_REASON_TX: tdls teardown recommended due to low transmits
  490. * @WMA_TDLS_TEARDOWN_REASON_RATE: tdls tear down recommended due to
  491. * packet rates < AP rates
  492. * @WMA_TDLS_TEARDOWN_REASON_RSSI: tdls link tear down recommended
  493. * due to poor RSSI
  494. * @WMA_TDLS_TEARDOWN_REASON_SCAN: tdls link tear down recommended
  495. * due to offchannel scan
  496. * @WMA_TDLS_DISCONNECTED_REASON_PEER_DELETE: tdls peer disconnected
  497. * due to peer deletion
  498. */
  499. enum wma_tdls_peer_reason {
  500. WMA_TDLS_TEARDOWN_REASON_TX,
  501. WMA_TDLS_TEARDOWN_REASON_RATE,
  502. WMA_TDLS_TEARDOWN_REASON_RSSI,
  503. WMA_TDLS_TEARDOWN_REASON_SCAN,
  504. WMA_TDLS_DISCONNECTED_REASON_PEER_DELETE,
  505. };
  506. #endif /* FEATURE_WLAN_TDLS */
  507. /**
  508. * enum wma_rx_exec_ctx - wma rx execution context
  509. * @WMA_RX_WORK_CTX: work queue context execution
  510. * @WMA_RX_TASKLET_CTX: tasklet context execution
  511. * @WMA_RX_SERIALIZER_CTX: MC thread context execution
  512. *
  513. */
  514. enum wma_rx_exec_ctx {
  515. WMA_RX_WORK_CTX,
  516. WMA_RX_TASKLET_CTX,
  517. WMA_RX_SERIALIZER_CTX
  518. };
  519. /**
  520. * enum wma_phy_idx
  521. * @PHY1: to notify caller that PHY1 specific param needed
  522. * @PHY2: to notify caller that PHY2 specific param needed
  523. * @PHY1_PHY2: to notify caller that both PHY's param needed
  524. * Note: Firmware sends phy map in terms of bitmask, so enum
  525. * also needs to be defined that way.
  526. *
  527. * For example, 0x3 = 0011 = BIT0 corresponds to one phy and
  528. * BIT1 coresponds to another phy. There is no direct relation between
  529. * each bit to particular PHY (ex. PHYA or PHYB).
  530. *
  531. * In simple terms, 3 means referring both PHYs & 1 or 2 means
  532. * referring to either PHYA or PHYB.
  533. */
  534. enum wma_phy_idx {
  535. PHY1 = 0x1, /* 0x1 */
  536. PHY2, /* 0x2 */
  537. PHY1_PHY2, /* 0x3 */
  538. };
  539. /**
  540. * struct wma_mem_chunk - memory chunks
  541. * @vaddr: virtual address
  542. * @paddr: physical address
  543. * @memctx: dma mapped memory
  544. * @len: length of data
  545. * @req_id: request id
  546. *
  547. * memory chunck allocated by Host to be managed by FW
  548. * used only for low latency interfaces like pcie
  549. */
  550. struct wma_mem_chunk {
  551. uint32_t *vaddr;
  552. uint32_t paddr;
  553. qdf_dma_mem_context(memctx);
  554. uint32_t len;
  555. uint32_t req_id;
  556. };
  557. /**
  558. * struct p2p_scan_param - p2p scan listen parameters
  559. * @scan_id: scan id
  560. * @p2p_scan_type: p2p scan type
  561. */
  562. struct p2p_scan_param {
  563. uint32_t scan_id;
  564. tSirP2pScanType p2p_scan_type;
  565. };
  566. /**
  567. * struct scan_param - scan parameters
  568. * @scan_id: scan id
  569. * @scan_requestor_id: scan requestor id
  570. * @p2p_scan_type: p2p scan type
  571. */
  572. struct scan_param {
  573. uint32_t scan_id;
  574. uint32_t scan_requestor_id;
  575. tSirP2pScanType p2p_scan_type;
  576. uint32_t chan_freq;
  577. };
  578. /**
  579. * struct beacon_info - structure to store beacon template
  580. * @buf: skb ptr
  581. * @len: length
  582. * @dma_mapped: is it dma mapped or not
  583. * @tim_ie_offset: TIM IE offset
  584. * @dtim_count: DTIM count
  585. * @seq_no: sequence no
  586. * @noa_sub_ie: NOA sub IE
  587. * @noa_sub_ie_len: NOA sub IE length
  588. * @noa_ie: NOA IE
  589. * @p2p_ie_offset: p2p IE offset
  590. * @lock: lock
  591. */
  592. struct beacon_info {
  593. qdf_nbuf_t buf;
  594. uint32_t len;
  595. uint8_t dma_mapped;
  596. uint32_t tim_ie_offset;
  597. uint8_t dtim_count;
  598. uint16_t seq_no;
  599. uint8_t noa_sub_ie[2 + WMA_NOA_IE_SIZE(WMA_MAX_NOA_DESCRIPTORS)];
  600. uint16_t noa_sub_ie_len;
  601. uint8_t *noa_ie;
  602. uint16_t p2p_ie_offset;
  603. qdf_spinlock_t lock;
  604. };
  605. /**
  606. * struct beacon_tim_ie - structure to store TIM IE of beacon
  607. * @tim_ie: tim ie
  608. * @tim_len: tim ie length
  609. * @dtim_count: dtim count
  610. * @dtim_period: dtim period
  611. * @tim_bitctl: tim bit control
  612. * @tim_bitmap: tim bitmap
  613. */
  614. struct beacon_tim_ie {
  615. uint8_t tim_ie;
  616. uint8_t tim_len;
  617. uint8_t dtim_count;
  618. uint8_t dtim_period;
  619. uint8_t tim_bitctl;
  620. uint8_t tim_bitmap[1];
  621. } __ATTRIB_PACK;
  622. /**
  623. * struct pps - packet power save parameter
  624. * @paid_match_enable: paid match enable
  625. * @gid_match_enable: gid match enable
  626. * @tim_clear: time clear
  627. * @dtim_clear: dtim clear
  628. * @eof_delim: eof delim
  629. * @mac_match: mac match
  630. * @delim_fail: delim fail
  631. * @nsts_zero: nsts zero
  632. * @rssi_chk: RSSI check
  633. * @ebt_5g: ebt 5GHz
  634. */
  635. struct pps {
  636. bool paid_match_enable;
  637. bool gid_match_enable;
  638. bool tim_clear;
  639. bool dtim_clear;
  640. bool eof_delim;
  641. bool mac_match;
  642. bool delim_fail;
  643. bool nsts_zero;
  644. bool rssi_chk;
  645. bool ebt_5g;
  646. };
  647. /**
  648. * struct qpower_params - qpower related parameters
  649. * @max_ps_poll_cnt: max ps poll count
  650. * @max_tx_before_wake: max tx before wake
  651. * @spec_ps_poll_wake_interval: ps poll wake interval
  652. * @max_spec_nodata_ps_poll: no data ps poll
  653. */
  654. struct qpower_params {
  655. uint32_t max_ps_poll_cnt;
  656. uint32_t max_tx_before_wake;
  657. uint32_t spec_ps_poll_wake_interval;
  658. uint32_t max_spec_nodata_ps_poll;
  659. };
  660. /**
  661. * struct gtx_config_t - GTX config
  662. * @gtxRTMask: for HT and VHT rate masks
  663. * @gtxUsrcfg: host request for GTX mask
  664. * @gtxPERThreshold: PER Threshold (default: 10%)
  665. * @gtxPERMargin: PER margin (default: 2%)
  666. * @gtxTPCstep: TCP step (default: 1)
  667. * @gtxTPCMin: TCP min (default: 5)
  668. * @gtxBWMask: BW mask (20/40/80/160 Mhz)
  669. */
  670. typedef struct {
  671. uint32_t gtxRTMask[2];
  672. uint32_t gtxUsrcfg;
  673. uint32_t gtxPERThreshold;
  674. uint32_t gtxPERMargin;
  675. uint32_t gtxTPCstep;
  676. uint32_t gtxTPCMin;
  677. uint32_t gtxBWMask;
  678. } gtx_config_t;
  679. /**
  680. * struct pdev_cli_config_t - store pdev parameters
  681. * @ani_enable: ANI is enabled/disable on target
  682. * @ani_poll_len: store ANI polling period
  683. * @ani_listen_len: store ANI listening period
  684. * @ani_ofdm_level: store ANI OFDM immunity level
  685. * @ani_cck_level: store ANI CCK immunity level
  686. * @cwmenable: Dynamic bw is enable/disable in fw
  687. * @txchainmask: tx chain mask
  688. * @rxchainmask: rx chain mask
  689. * @txpow2g: tx power limit for 2GHz
  690. * @txpow5g: tx power limit for 5GHz
  691. * @burst_enable: is burst enable/disable
  692. * @burst_dur: burst duration
  693. *
  694. * This structure stores pdev parameters.
  695. * Some of these parameters are set in fw and some
  696. * parameters are only maintained in host.
  697. */
  698. typedef struct {
  699. uint32_t ani_enable;
  700. uint32_t ani_poll_len;
  701. uint32_t ani_listen_len;
  702. uint32_t ani_ofdm_level;
  703. uint32_t ani_cck_level;
  704. uint32_t cwmenable;
  705. uint32_t cts_cbw;
  706. uint32_t txchainmask;
  707. uint32_t rxchainmask;
  708. uint32_t txpow2g;
  709. uint32_t txpow5g;
  710. uint32_t burst_enable;
  711. uint32_t burst_dur;
  712. } pdev_cli_config_t;
  713. /**
  714. * struct vdev_cli_config_t - store vdev parameters
  715. * @nss: nss width
  716. * @ldpc: is ldpc is enable/disable
  717. * @tx_stbc: TX STBC is enable/disable
  718. * @rx_stbc: RX STBC is enable/disable
  719. * @shortgi: short gi is enable/disable
  720. * @rtscts_en: RTS/CTS is enable/disable
  721. * @chwidth: channel width
  722. * @tx_rate: tx rate
  723. * @ampdu: ampdu size
  724. * @amsdu: amsdu size
  725. * @erx_adjust: enable/disable early rx enable
  726. * @erx_bmiss_num: target bmiss number per sample
  727. * @erx_bmiss_cycle: sample cycle
  728. * @erx_slop_step: slop_step value
  729. * @erx_init_slop: init slop
  730. * @erx_adj_pause: pause adjust enable/disable
  731. * @erx_dri_sample: enable/disable drift sample
  732. * @pps_params: packet power save parameters
  733. * @qpower_params: qpower parameters
  734. * @gtx_info: GTX offload info
  735. *
  736. * This structure stores vdev parameters.
  737. * Some of these parameters are set in fw and some
  738. * parameters are only maintained in host.
  739. */
  740. typedef struct {
  741. uint32_t nss;
  742. uint32_t ldpc;
  743. uint32_t tx_stbc;
  744. uint32_t rx_stbc;
  745. uint32_t shortgi;
  746. uint32_t rtscts_en;
  747. uint32_t chwidth;
  748. uint32_t tx_rate;
  749. uint32_t ampdu;
  750. uint32_t amsdu;
  751. uint32_t erx_adjust;
  752. uint32_t erx_bmiss_num;
  753. uint32_t erx_bmiss_cycle;
  754. uint32_t erx_slop_step;
  755. uint32_t erx_init_slop;
  756. uint32_t erx_adj_pause;
  757. uint32_t erx_dri_sample;
  758. struct pps pps_params;
  759. struct qpower_params qpower_params;
  760. gtx_config_t gtx_info;
  761. } vdev_cli_config_t;
  762. /**
  763. * struct wma_version_info - Store wmi version info
  764. * @major: wmi major version
  765. * @minor: wmi minor version
  766. * @revision: wmi revision number
  767. */
  768. struct wma_version_info {
  769. u_int32_t major;
  770. u_int32_t minor;
  771. u_int32_t revision;
  772. };
  773. /**
  774. * struct wma_wow - store wow patterns
  775. * @magic_ptrn_enable: magic pattern enable/disable
  776. * @wow_enable: wow enable/disable
  777. * @wow_enable_cmd_sent: is wow enable command sent to fw
  778. * @deauth_enable: is deauth wakeup enable/disable
  779. * @disassoc_enable: is disassoc wakeup enable/disable
  780. * @bmiss_enable: is bmiss wakeup enable/disable
  781. * @gtk_pdev_enable: is GTK based wakeup enable/disable
  782. * @gtk_err_enable: is GTK error wakeup enable/disable
  783. * @lphb_cache: lphb cache
  784. *
  785. * This structure stores wow patterns and
  786. * wow related parameters in host.
  787. */
  788. struct wma_wow {
  789. bool magic_ptrn_enable;
  790. bool wow_enable;
  791. bool wow_enable_cmd_sent;
  792. bool deauth_enable;
  793. bool disassoc_enable;
  794. bool bmiss_enable;
  795. bool gtk_err_enable[WMA_MAX_SUPPORTED_BSS];
  796. #ifdef FEATURE_WLAN_LPHB
  797. /* currently supports only vdev 0.
  798. * cache has two entries: one for TCP and one for UDP.
  799. */
  800. tSirLPHBReq lphb_cache[2];
  801. #endif
  802. };
  803. #ifdef WLAN_FEATURE_11W
  804. #define CMAC_IPN_LEN (6)
  805. #define WMA_IGTK_KEY_INDEX_4 (4)
  806. #define WMA_IGTK_KEY_INDEX_5 (5)
  807. /**
  808. * struct wma_igtk_ipn_t - GTK IPN info
  809. * @ipn: IPN info
  810. */
  811. typedef struct {
  812. uint8_t ipn[CMAC_IPN_LEN];
  813. } wma_igtk_ipn_t;
  814. /**
  815. * struct wma_igtk_key_t - GTK key
  816. * @key_length: key length
  817. * @key: key
  818. * @key_id: key id
  819. */
  820. typedef struct {
  821. uint16_t key_length;
  822. uint8_t key[CSR_AES_KEY_LEN];
  823. /* IPN is maintained per iGTK keyID
  824. * 0th index for iGTK keyID = 4;
  825. * 1st index for iGTK KeyID = 5
  826. */
  827. wma_igtk_ipn_t key_id[2];
  828. } wma_igtk_key_t;
  829. #endif
  830. /**
  831. * struct vdev_restart_params_t - vdev restart parameters
  832. * @vdev_id: vdev id
  833. * @ssid: ssid
  834. * @flags: flags
  835. * @requestor_id: requestor id
  836. * @chan: channel
  837. * @hidden_ssid_restart_in_progress: hidden ssid restart flag
  838. * @ssidHidden: is ssid hidden or not
  839. */
  840. typedef struct {
  841. A_UINT32 vdev_id;
  842. wmi_ssid ssid;
  843. A_UINT32 flags;
  844. A_UINT32 requestor_id;
  845. A_UINT32 disable_hw_ack;
  846. wmi_channel chan;
  847. qdf_atomic_t hidden_ssid_restart_in_progress;
  848. uint8_t ssidHidden;
  849. } vdev_restart_params_t;
  850. /**
  851. * struct wma_txrx_node - txrx node
  852. * @addr: mac address
  853. * @bssid: bssid
  854. * @handle: wma handle
  855. * @beacon: beacon info
  856. * @vdev_restart_params: vdev restart parameters
  857. * @config: per vdev config parameters
  858. * @scan_info: scan info
  859. * @type: type
  860. * @sub_type: sub type
  861. * @nlo_match_evt_received: is nlo match event received or not
  862. * @pno_in_progress: is pno in progress or not
  863. * @plm_in_progress: is plm in progress or not
  864. * @ptrn_match_enable: is pattern match is enable or not
  865. * @num_wow_default_patterns: number of default wow patterns configured for vdev
  866. * @num_wow_user_patterns: number of user wow patterns configured for vdev
  867. * @conn_state: connection state
  868. * @beaconInterval: beacon interval
  869. * @llbCoexist: 11b coexist
  870. * @shortSlotTimeSupported: is short slot time supported or not
  871. * @dtimPeriod: DTIM period
  872. * @chanmode: channel mode
  873. * @vht_capable: VHT capablity flag
  874. * @ht_capable: HT capablity flag
  875. * @mhz: channel frequency in KHz
  876. * @chan_width: channel bandwidth
  877. * @vdev_up: is vdev up or not
  878. * @tsfadjust: TSF adjust
  879. * @addBssStaContext: add bss context
  880. * @aid: association id
  881. * @rmfEnabled: Robust Management Frame (RMF) enabled/disabled
  882. * @key: GTK key
  883. * @uapsd_cached_val: uapsd cached value
  884. * @stats_rsp: stats response
  885. * @fw_stats_set: fw stats value
  886. * @del_staself_req: delete sta self request
  887. * @bss_status: bss status
  888. * @rate_flags: rate flags
  889. * @nss: nss value
  890. * @is_channel_switch: is channel switch
  891. * @pause_bitmap: pause bitmap
  892. * @tx_power: tx power in dbm
  893. * @max_tx_power: max tx power in dbm
  894. * @nwType: network type (802.11a/b/g/n/ac)
  895. * @staKeyParams: sta key parameters
  896. * @ps_enabled: is powersave enable/disable
  897. * @dtim_policy: DTIM policy
  898. * @peer_count: peer count
  899. * @roam_synch_in_progress: flag is in progress or not
  900. * @plink_status_req: link status request
  901. * @psnr_req: snr request
  902. * @delay_before_vdev_stop: delay
  903. * @tx_streams: number of tx streams can be used by the vdev
  904. * @rx_streams: number of rx streams can be used by the vdev
  905. * @chain_mask: chain mask can be used by the vdev
  906. * @mac_id: the mac on which vdev is on
  907. * @wep_default_key_idx: wep default index for group key
  908. * @arp_offload_req: cached arp offload request
  909. * @ns_offload_req: cached ns offload request
  910. * @wow_stats: stat counters for WoW related events
  911. * It stores parameters per vdev in wma.
  912. */
  913. struct wma_txrx_node {
  914. uint8_t addr[IEEE80211_ADDR_LEN];
  915. uint8_t bssid[IEEE80211_ADDR_LEN];
  916. struct cdp_vdev *handle;
  917. struct beacon_info *beacon;
  918. vdev_restart_params_t vdev_restart_params;
  919. vdev_cli_config_t config;
  920. struct scan_param scan_info;
  921. uint32_t type;
  922. uint32_t sub_type;
  923. #ifdef FEATURE_WLAN_SCAN_PNO
  924. bool nlo_match_evt_received;
  925. bool pno_in_progress;
  926. #endif
  927. #ifdef FEATURE_WLAN_ESE
  928. bool plm_in_progress;
  929. #endif
  930. bool ptrn_match_enable;
  931. uint8_t num_wow_default_patterns;
  932. uint8_t num_wow_user_patterns;
  933. bool conn_state;
  934. tSirMacBeaconInterval beaconInterval;
  935. uint8_t llbCoexist;
  936. uint8_t shortSlotTimeSupported;
  937. uint8_t dtimPeriod;
  938. WLAN_PHY_MODE chanmode;
  939. uint8_t vht_capable;
  940. uint8_t ht_capable;
  941. A_UINT32 mhz;
  942. enum phy_ch_width chan_width;
  943. bool vdev_active;
  944. uint64_t tsfadjust;
  945. void *addBssStaContext;
  946. uint8_t aid;
  947. uint8_t rmfEnabled;
  948. #ifdef WLAN_FEATURE_11W
  949. wma_igtk_key_t key;
  950. #endif /* WLAN_FEATURE_11W */
  951. uint32_t uapsd_cached_val;
  952. tAniGetPEStatsRsp *stats_rsp;
  953. uint8_t fw_stats_set;
  954. void *del_staself_req;
  955. qdf_atomic_t bss_status;
  956. uint8_t rate_flags;
  957. uint8_t nss;
  958. bool is_channel_switch;
  959. uint16_t pause_bitmap;
  960. int8_t tx_power;
  961. int8_t max_tx_power;
  962. uint32_t nwType;
  963. void *staKeyParams;
  964. uint32_t dtim_policy;
  965. uint32_t peer_count;
  966. bool roam_synch_in_progress;
  967. void *plink_status_req;
  968. void *psnr_req;
  969. uint8_t delay_before_vdev_stop;
  970. #ifdef FEATURE_WLAN_EXTSCAN
  971. bool extscan_in_progress;
  972. #endif
  973. uint32_t alt_modulated_dtim;
  974. bool alt_modulated_dtim_enabled;
  975. uint32_t tx_streams;
  976. uint32_t rx_streams;
  977. uint32_t chain_mask;
  978. uint32_t mac_id;
  979. bool roaming_in_progress;
  980. int32_t roam_synch_delay;
  981. uint8_t nss_2g;
  982. uint8_t nss_5g;
  983. bool p2p_lo_in_progress;
  984. uint8_t wep_default_key_idx;
  985. tSirHostOffloadReq arp_offload_req;
  986. tSirHostOffloadReq ns_offload_req;
  987. bool is_vdev_valid;
  988. struct sir_vdev_wow_stats wow_stats;
  989. };
  990. #if defined(QCA_WIFI_FTM)
  991. #define MAX_UTF_EVENT_LENGTH 2048
  992. #define MAX_WMI_UTF_LEN 252
  993. /**
  994. * struct SEG_HDR_INFO_STRUCT - header info
  995. * @len: length
  996. * @msgref: message refrence
  997. * @segmentInfo: segment info
  998. * @pad: padding
  999. */
  1000. typedef struct {
  1001. A_UINT32 len;
  1002. A_UINT32 msgref;
  1003. A_UINT32 segmentInfo;
  1004. A_UINT32 pad;
  1005. } SEG_HDR_INFO_STRUCT;
  1006. /**
  1007. * struct utf_event_info - UTF event info
  1008. * @data: data ptr
  1009. * @length: length
  1010. * @offset: offset
  1011. * @currentSeq: curent squence
  1012. * @expectedSeq: expected sequence
  1013. */
  1014. struct utf_event_info {
  1015. uint8_t *data;
  1016. uint32_t length;
  1017. qdf_size_t offset;
  1018. uint8_t currentSeq;
  1019. uint8_t expectedSeq;
  1020. };
  1021. #endif
  1022. /**
  1023. * struct scan_timer_info - scan timer info
  1024. * @vdev_id: vdev id
  1025. * @scan_id: scan id
  1026. */
  1027. typedef struct {
  1028. uint8_t vdev_id;
  1029. uint32_t scan_id;
  1030. } scan_timer_info;
  1031. /**
  1032. * struct ibss_power_save_params - IBSS power save parameters
  1033. * @atimWindowLength: ATIM window length
  1034. * @isPowerSaveAllowed: is power save allowed
  1035. * @isPowerCollapseAllowed: is power collapsed allowed
  1036. * @isAwakeonTxRxEnabled: is awake on tx/rx enabled
  1037. * @inactivityCount: inactivity count
  1038. * @txSPEndInactivityTime: tx SP end inactivity time
  1039. * @ibssPsWarmupTime: IBSS power save warm up time
  1040. * @ibssPs1RxChainInAtimEnable: IBSS power save rx chain in ATIM enable
  1041. */
  1042. typedef struct {
  1043. uint32_t atimWindowLength;
  1044. uint32_t isPowerSaveAllowed;
  1045. uint32_t isPowerCollapseAllowed;
  1046. uint32_t isAwakeonTxRxEnabled;
  1047. uint32_t inactivityCount;
  1048. uint32_t txSPEndInactivityTime;
  1049. uint32_t ibssPsWarmupTime;
  1050. uint32_t ibssPs1RxChainInAtimEnable;
  1051. } ibss_power_save_params;
  1052. /**
  1053. * struct dbs_hw_mode_info - WLAN_DBS_HW_MODES_TLV Format
  1054. * @tlv_header: TLV header, TLV tag and len; tag equals WMITLV_TAG_ARRAY_UINT32
  1055. * @hw_mode_list: WLAN_DBS_HW_MODE_LIST entries
  1056. */
  1057. struct dbs_hw_mode_info {
  1058. uint32_t tlv_header;
  1059. uint32_t *hw_mode_list;
  1060. };
  1061. /**
  1062. * struct mac_ss_bw_info - hw_mode_list PHY/MAC params for each MAC
  1063. * @mac_tx_stream: Max TX stream
  1064. * @mac_rx_stream: Max RX stream
  1065. * @mac_bw: Max bandwidth
  1066. */
  1067. struct mac_ss_bw_info {
  1068. uint32_t mac_tx_stream;
  1069. uint32_t mac_rx_stream;
  1070. uint32_t mac_bw;
  1071. };
  1072. /**
  1073. * struct dual_mac_config - Dual MAC configurations
  1074. * @prev_scan_config: Previous scan configuration
  1075. * @prev_fw_mode_config: Previous FW mode configuration
  1076. * @cur_scan_config: Current scan configuration
  1077. * @cur_fw_mode_config: Current FW mode configuration
  1078. * @req_scan_config: Requested scan configuration
  1079. * @req_fw_mode_config: Requested FW mode configuration
  1080. */
  1081. struct dual_mac_config {
  1082. uint32_t prev_scan_config;
  1083. uint32_t prev_fw_mode_config;
  1084. uint32_t cur_scan_config;
  1085. uint32_t cur_fw_mode_config;
  1086. uint32_t req_scan_config;
  1087. uint32_t req_fw_mode_config;
  1088. };
  1089. /**
  1090. * struct wma_ini_config - Structure to hold wma ini configuration
  1091. * @max_no_of_peers: Max Number of supported
  1092. *
  1093. * Placeholder for WMA ini parameters.
  1094. */
  1095. struct wma_ini_config {
  1096. uint8_t max_no_of_peers;
  1097. };
  1098. /**
  1099. * struct wmi_valid_channels - Channel details part of WMI_SCAN_CHAN_LIST_CMDID
  1100. * @num_channels: Number of channels
  1101. * @channel_list: Channel list
  1102. */
  1103. struct wma_valid_channels {
  1104. uint8_t num_channels;
  1105. uint8_t channel_list[MAX_NUM_CHAN];
  1106. };
  1107. /**
  1108. * struct hw_mode_idx_to_mac_cap_idx - map between hw_mode to capabilities
  1109. * @num_of_macs: number of macs/PHYs for given hw_mode through hw_mode_id
  1110. * @mac_cap_idx: index of the mac/PHY for given hw_mode through hw_mode_id
  1111. * @hw_mode_id: given hw_mode id
  1112. */
  1113. struct hw_mode_idx_to_mac_cap_idx {
  1114. uint8_t num_of_macs;
  1115. uint8_t mac_cap_idx;
  1116. uint8_t hw_mode_id;
  1117. };
  1118. /**
  1119. * struct extended_caps - new extended caps given by firmware
  1120. * @num_hw_modes: number of hardware modes for current SOC
  1121. * @each_hw_mode_cap: hw mode id to phy id mapping
  1122. * @each_phy_cap_per_hwmode: PHY's caps for each hw mode
  1123. * @num_phy_for_hal_reg_cap: number of phy for hal reg cap
  1124. * @hw_mode_to_mac_cap_map: map between hw_mode to capabilities
  1125. */
  1126. struct extended_caps {
  1127. WMI_SOC_MAC_PHY_HW_MODE_CAPS num_hw_modes;
  1128. WMI_HW_MODE_CAPABILITIES *each_hw_mode_cap;
  1129. WMI_MAC_PHY_CAPABILITIES *each_phy_cap_per_hwmode;
  1130. WMI_SOC_HAL_REG_CAPABILITIES num_phy_for_hal_reg_cap;
  1131. WMI_HAL_REG_CAPABILITIES_EXT *each_phy_hal_reg_cap;
  1132. struct hw_mode_idx_to_mac_cap_idx *hw_mode_to_mac_cap_map;
  1133. };
  1134. /**
  1135. * struct t_wma_handle - wma context
  1136. * @wmi_handle: wmi handle
  1137. * @htc_handle: htc handle
  1138. * @cds_context: cds handle
  1139. * @mac_context: mac context
  1140. * @psoc: psoc context
  1141. * @wma_ready_event: wma rx ready event
  1142. * @wma_resume_event: wma resume event
  1143. * @target_suspend: target suspend event
  1144. * @recovery_event: wma FW recovery event
  1145. * @max_station: max stations
  1146. * @max_bssid: max bssid
  1147. * @driver_type: driver type
  1148. * @myaddr: current mac address
  1149. * @hwaddr: mac address from EEPROM
  1150. * @target_abi_vers: target firmware version
  1151. * @final_abi_vers: The final ABI version to be used for communicating
  1152. * @target_fw_version: Target f/w build version
  1153. * @target_fw_vers_ext: Target f/w build version sub id
  1154. * @lpss_support: LPSS feature is supported in target or not
  1155. * @egap_support: Enhanced Green AP support flag
  1156. * @wmi_ready: wmi status flag
  1157. * @wlan_init_status: wlan init status
  1158. * @qdf_dev: qdf device
  1159. * @phy_capability: PHY Capability from Target
  1160. * @max_frag_entry: Max number of Fragment entry
  1161. * @wmi_service_bitmap: wmi services bitmap received from Target
  1162. * @wlan_resource_config: resource config
  1163. * @frameTransRequired: frame transmission required
  1164. * @wmaGlobalSystemRole: global system role
  1165. * @tx_frm_download_comp_cb: Tx Frame Compl Cb registered by umac
  1166. * @tx_frm_download_comp_event: Event to wait for tx download completion
  1167. * @tx_queue_empty_event: wait for tx queue to get flushed
  1168. * @umac_ota_ack_cb: Ack Complete Callback registered by umac
  1169. * @umac_data_ota_ack_cb: ack complete callback
  1170. * @last_umac_data_ota_timestamp: timestamp when OTA of last umac data was done
  1171. * @last_umac_data_nbuf: cache nbuf ptr for the last umac data buf
  1172. * @needShutdown: is shutdown needed or not
  1173. * @num_mem_chunks: number of memory chunk
  1174. * @mem_chunks: memory chunks
  1175. * @tgt_cfg_update_cb: configuration update callback
  1176. * @dfs_radar_indication_cb: Callback to indicate radar to HDD
  1177. * @reg_cap: regulatory capablities
  1178. * @scan_id: scan id
  1179. * @interfaces: txrx nodes(per vdev)
  1180. * @pdevconfig: pdev related configrations
  1181. * @vdev_resp_queue: vdev response queue
  1182. * @vdev_respq_lock: vdev response queue lock
  1183. * @ht_cap_info: HT capablity info
  1184. * @vht_cap_info: VHT capablity info
  1185. * @vht_supp_mcs: VHT supported MCS
  1186. * @num_rf_chains: number of RF chains
  1187. * @utf_event_info: UTF event information
  1188. * @is_fw_assert: is fw asserted
  1189. * @wow: wow related patterns & parameters
  1190. * @no_of_suspend_ind: number of suspend indications
  1191. * @no_of_resume_ind: number of resume indications
  1192. * @mArpInfo: arp info
  1193. * @powersave_mode: power save mode
  1194. * @ptrn_match_enable_all_vdev: is pattern match is enable/disable
  1195. * @pGetRssiReq: get RSSI request
  1196. * @thermal_mgmt_info: Thermal mitigation related info
  1197. * @roam_offload_enabled: is roam offload enable/disable
  1198. * @ol_ini_info: store ini status of arp offload, ns offload
  1199. * @ssdp: ssdp flag
  1200. * @enable_mc_list : To Check if Multicast list filtering is enabled in FW
  1201. * @ibss_started: is IBSS started or not
  1202. * @ibsskey_info: IBSS key info
  1203. * @dfs_ic: DFS umac interface information
  1204. * @hddTxFailCb: tx fail indication callback
  1205. * @pno_wake_lock: PNO wake lock
  1206. * @extscan_wake_lock: extscan wake lock
  1207. * @wow_wake_lock: wow wake lock
  1208. * @wow_nack: wow negative ack flag
  1209. * @ap_client_cnt: ap client count
  1210. * @is_wow_bus_suspended: is wow bus suspended flag
  1211. * @wma_scan_comp_timer: scan completion timer
  1212. * @dfs_phyerr_filter_offload: dfs phy error filter is offloaded or not
  1213. * @suitable_ap_hb_failure: better ap found
  1214. * @suitable_ap_hb_failure_rssi: record the RSSI when suitable_ap_hb_failure
  1215. * for later usage to report RSSI at beacon miss scenario
  1216. * @wma_ibss_power_save_params: IBSS Power Save config Parameters
  1217. * @IsRArateLimitEnabled: RA rate limiti s enabled or not
  1218. * @RArateLimitInterval: RA rate limit interval
  1219. * @is_lpass_enabled: Flag to indicate if LPASS feature is enabled or not
  1220. * @is_nan_enabled: Flag to indicate if NaN feature is enabled or not
  1221. * @staMaxLIModDtim: station max listen interval
  1222. * @staModDtim: station mode DTIM
  1223. * @staDynamicDtim: station dynamic DTIM
  1224. * @enable_mhf_offload: is MHF offload enable/disable
  1225. * @last_mhf_entries_timestamp: timestamp when last entries where set
  1226. * @dfs_pri_multiplier: DFS multiplier
  1227. * @hw_bd_id: hardware board id
  1228. * @hw_bd_info: hardware board info
  1229. * @in_d0wow: D0WOW is enable/disable
  1230. * @miracast_value: miracast value
  1231. * @log_completion_timer: log completion timer
  1232. * @num_dbs_hw_modes: Number of HW modes supported by the FW
  1233. * @dbs_mode: DBS HW mode list
  1234. * @old_hw_mode_index: Previous configured HW mode index
  1235. * @new_hw_mode_index: Current configured HW mode index
  1236. * @extended_caps phy_caps: extended caps per hw mode
  1237. * @peer_authorized_cb: peer authorized hdd callback
  1238. * @ocb_callback: callback to OCB commands
  1239. * @ocb_resp: response to OCB commands
  1240. * @wow_pno_match_wake_up_count: PNO match wake up count
  1241. * @wow_pno_complete_wake_up_count: PNO complete wake up count
  1242. * @wow_gscan_wake_up_count: Gscan wake up count
  1243. * @wow_low_rssi_wake_up_count: Low rssi wake up count
  1244. * @wow_rssi_breach_wake_up_count: RSSI breach wake up count
  1245. * @wow_ucast_wake_up_count: WoW unicast packet wake up count
  1246. * @wow_bcast_wake_up_count: WoW brodcast packet wake up count
  1247. * @wow_ipv4_mcast_wake_up_count: WoW IPV4 mcast packet wake up count
  1248. * @wow_ipv6_mcast_wake_up_count: WoW IPV6 mcast packet wake up count
  1249. * @wow_ipv6_mcast_ra_stats: WoW IPV6 mcast RA packet wake up count
  1250. * @wow_ipv6_mcast_ns_stats: WoW IPV6 mcast NS packet wake up count
  1251. * @wow_ipv6_mcast_na_stats: WoW IPV6 mcast NA packet wake up count
  1252. * @wow_icmpv4_count: WoW ipv4 icmp packet wake up count
  1253. * @wow_icmpv6_count: WoW ipv6 icmp packet wake up count
  1254. * @dual_mac_cfg: Dual mac configuration params for scan and fw mode
  1255. *
  1256. * @max_scan: maximum scan requests than can be queued
  1257. * This structure is global wma context
  1258. * It contains global wma module parameters and
  1259. * handle of other modules.
  1260. * @saved_wmi_init_cmd: Saved WMI INIT command
  1261. * @bool bpf_packet_filter_enable: BPF filter enabled or not
  1262. * @service_ready_ext_evt: Wait event for service ready ext
  1263. * @wmi_cmd_rsp_wake_lock: wmi command response wake lock
  1264. * @wmi_cmd_rsp_runtime_lock: wmi command response bus lock
  1265. * @saved_chan: saved channel list sent as part of WMI_SCAN_CHAN_LIST_CMDID
  1266. */
  1267. typedef struct {
  1268. void *wmi_handle;
  1269. void *htc_handle;
  1270. void *cds_context;
  1271. void *mac_context;
  1272. struct wlan_objmgr_psoc *psoc;
  1273. qdf_event_t wma_ready_event;
  1274. qdf_event_t wma_resume_event;
  1275. qdf_event_t target_suspend;
  1276. qdf_event_t runtime_suspend;
  1277. qdf_event_t recovery_event;
  1278. uint16_t max_station;
  1279. uint16_t max_bssid;
  1280. t_wma_drv_type driver_type;
  1281. uint8_t myaddr[IEEE80211_ADDR_LEN];
  1282. uint8_t hwaddr[IEEE80211_ADDR_LEN];
  1283. wmi_abi_version target_abi_vers;
  1284. wmi_abi_version final_abi_vers;
  1285. uint32_t target_fw_version;
  1286. uint32_t target_fw_vers_ext;
  1287. #ifdef WLAN_FEATURE_LPSS
  1288. uint8_t lpss_support;
  1289. #endif
  1290. uint8_t ap_arpns_support;
  1291. #ifdef FEATURE_GREEN_AP
  1292. bool egap_support;
  1293. #endif
  1294. bool wmi_ready;
  1295. uint32_t wlan_init_status;
  1296. qdf_device_t qdf_dev;
  1297. uint32_t phy_capability;
  1298. uint32_t max_frag_entry;
  1299. uint32_t wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
  1300. wmi_resource_config wlan_resource_config;
  1301. uint32_t frameTransRequired;
  1302. tBssSystemRole wmaGlobalSystemRole;
  1303. wma_tx_dwnld_comp_callback tx_frm_download_comp_cb;
  1304. qdf_event_t tx_frm_download_comp_event;
  1305. /*
  1306. * Dummy event to wait for draining MSDUs left in hardware tx
  1307. * queue and before requesting VDEV_STOP. Nobody will set this
  1308. * and wait will timeout, and code will poll the pending tx
  1309. * descriptors number to be zero.
  1310. */
  1311. qdf_event_t tx_queue_empty_event;
  1312. wma_tx_ota_comp_callback umac_ota_ack_cb[SIR_MAC_MGMT_RESERVED15];
  1313. wma_tx_ota_comp_callback umac_data_ota_ack_cb;
  1314. unsigned long last_umac_data_ota_timestamp;
  1315. qdf_nbuf_t last_umac_data_nbuf;
  1316. bool needShutdown;
  1317. uint32_t num_mem_chunks;
  1318. struct wmi_host_mem_chunk mem_chunks[MAX_MEM_CHUNKS];
  1319. wma_tgt_cfg_cb tgt_cfg_update_cb;
  1320. wma_dfs_radar_indication_cb dfs_radar_indication_cb;
  1321. HAL_REG_CAPABILITIES reg_cap;
  1322. uint32_t scan_id;
  1323. struct wma_txrx_node *interfaces;
  1324. pdev_cli_config_t pdevconfig;
  1325. qdf_list_t vdev_resp_queue;
  1326. qdf_spinlock_t vdev_respq_lock;
  1327. qdf_list_t wma_hold_req_queue;
  1328. qdf_spinlock_t wma_hold_req_q_lock;
  1329. uint32_t ht_cap_info;
  1330. uint32_t vht_cap_info;
  1331. uint32_t vht_supp_mcs;
  1332. uint32_t num_rf_chains;
  1333. #if defined(QCA_WIFI_FTM)
  1334. struct utf_event_info utf_event_info;
  1335. #endif
  1336. uint8_t is_fw_assert;
  1337. struct wma_wow wow;
  1338. uint8_t no_of_suspend_ind;
  1339. uint8_t no_of_resume_ind;
  1340. /* Have a back up of arp info to send along
  1341. * with ns info suppose if ns also enabled
  1342. */
  1343. tSirHostOffloadReq mArpInfo;
  1344. struct wma_tx_ack_work_ctx *ack_work_ctx;
  1345. uint8_t powersave_mode;
  1346. bool ptrn_match_enable_all_vdev;
  1347. void *pGetRssiReq;
  1348. t_thermal_mgmt thermal_mgmt_info;
  1349. bool roam_offload_enabled;
  1350. /* Here ol_ini_info is used to store ini
  1351. * status of arp offload, ns offload
  1352. * and others. Currently 1st bit is used
  1353. * for arp off load and 2nd bit for ns
  1354. * offload currently, rest bits are unused
  1355. */
  1356. uint8_t ol_ini_info;
  1357. bool ssdp;
  1358. bool enable_mc_list;
  1359. uint8_t ibss_started;
  1360. tSetBssKeyParams ibsskey_info;
  1361. struct ieee80211com *dfs_ic;
  1362. txFailIndCallback hddTxFailCb;
  1363. #ifdef FEATURE_WLAN_SCAN_PNO
  1364. qdf_wake_lock_t pno_wake_lock;
  1365. #endif
  1366. #ifdef FEATURE_WLAN_EXTSCAN
  1367. qdf_wake_lock_t extscan_wake_lock;
  1368. #endif
  1369. qdf_wake_lock_t wow_wake_lock;
  1370. int wow_nack;
  1371. bool wow_initial_wake_up;
  1372. qdf_atomic_t is_wow_bus_suspended;
  1373. qdf_mc_timer_t wma_scan_comp_timer;
  1374. uint8_t dfs_phyerr_filter_offload;
  1375. bool suitable_ap_hb_failure;
  1376. uint32_t suitable_ap_hb_failure_rssi;
  1377. ibss_power_save_params wma_ibss_power_save_params;
  1378. #ifdef FEATURE_WLAN_RA_FILTERING
  1379. bool IsRArateLimitEnabled;
  1380. uint16_t RArateLimitInterval;
  1381. #endif
  1382. #ifdef WLAN_FEATURE_LPSS
  1383. bool is_lpass_enabled;
  1384. #endif
  1385. #ifdef WLAN_FEATURE_NAN
  1386. bool is_nan_enabled;
  1387. #endif
  1388. uint8_t staMaxLIModDtim;
  1389. uint8_t staModDtim;
  1390. uint8_t staDynamicDtim;
  1391. uint8_t enable_mhf_offload;
  1392. unsigned long last_mhf_entries_timestamp;
  1393. int32_t dfs_pri_multiplier;
  1394. uint32_t hw_bd_id;
  1395. uint32_t hw_bd_info[HW_BD_INFO_SIZE];
  1396. uint32_t miracast_value;
  1397. qdf_mc_timer_t log_completion_timer;
  1398. uint32_t num_dbs_hw_modes;
  1399. struct dbs_hw_mode_info hw_mode;
  1400. uint32_t old_hw_mode_index;
  1401. uint32_t new_hw_mode_index;
  1402. struct extended_caps phy_caps;
  1403. qdf_atomic_t scan_id_counter;
  1404. qdf_atomic_t num_pending_scans;
  1405. wma_peer_authorized_fp peer_authorized_cb;
  1406. uint32_t wow_unspecified_wake_count;
  1407. /* OCB request contexts */
  1408. struct sir_ocb_config *ocb_config_req;
  1409. struct dual_mac_config dual_mac_cfg;
  1410. uint8_t max_scan;
  1411. uint16_t self_gen_frm_pwr;
  1412. bool tx_chain_mask_cck;
  1413. /* Going with a timer instead of wait event because on receiving the
  1414. * service ready event, we will be waiting on the MC thread for the
  1415. * service extended ready event which is also processed in MC thread.
  1416. * This leads to MC thread being stuck. Alternative was to process
  1417. * these events in tasklet/workqueue context. But, this leads to
  1418. * race conditions when the events are processed in two different
  1419. * context. So, processing ready event and extended ready event in
  1420. * the serialized MC thread context with a timer.
  1421. */
  1422. qdf_mc_timer_t service_ready_ext_timer;
  1423. void (*csr_roam_synch_cb)(tpAniSirGlobal mac,
  1424. roam_offload_synch_ind *roam_synch_data,
  1425. tpSirBssDescription bss_desc_ptr,
  1426. enum sir_roam_op_code reason);
  1427. QDF_STATUS (*pe_roam_synch_cb)(tpAniSirGlobal mac,
  1428. roam_offload_synch_ind *roam_synch_data,
  1429. tpSirBssDescription bss_desc_ptr);
  1430. qdf_wake_lock_t wmi_cmd_rsp_wake_lock;
  1431. qdf_runtime_lock_t wmi_cmd_rsp_runtime_lock;
  1432. qdf_runtime_lock_t wma_runtime_resume_lock;
  1433. uint32_t fine_time_measurement_cap;
  1434. bool bpf_enabled;
  1435. bool bpf_packet_filter_enable;
  1436. struct wma_ini_config ini_config;
  1437. struct wma_valid_channels saved_chan;
  1438. /* NAN datapath support enabled in firmware */
  1439. bool nan_datapath_enabled;
  1440. QDF_STATUS (*pe_ndp_event_handler)(tpAniSirGlobal mac_ctx,
  1441. struct scheduler_msg *msg);
  1442. bool fw_timeout_crash;
  1443. bool sub_20_support;
  1444. tp_wma_packetdump_cb wma_mgmt_tx_packetdump_cb;
  1445. tp_wma_packetdump_cb wma_mgmt_rx_packetdump_cb;
  1446. tSirLLStatsResults *link_stats_results;
  1447. } t_wma_handle, *tp_wma_handle;
  1448. /**
  1449. * struct wma_target_cap - target capabality
  1450. * @wmi_service_bitmap: wmi services bitmap
  1451. * @wlan_resource_config: resource config
  1452. */
  1453. struct wma_target_cap {
  1454. /* wmi services bitmap received from Target */
  1455. uint32_t wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
  1456. /* default resource config,the os shim can overwrite it */
  1457. wmi_resource_config wlan_resource_config;
  1458. };
  1459. /**
  1460. * struct t_wma_start_req - wma start request parameters
  1461. * @pConfigBuffer: config buffer
  1462. * @usConfigBufferLen: Length of the config buffer above
  1463. * @driver_type: Production or FTM driver
  1464. * @pUserData: user data
  1465. * @pIndUserData: indication function pointer to send to UMAC
  1466. *
  1467. * The shared memory between WDI and HAL is 4K so maximum data can be
  1468. * transferred from WDI to HAL is 4K
  1469. */
  1470. typedef struct {
  1471. void *pConfigBuffer;
  1472. uint16_t usConfigBufferLen;
  1473. t_wma_drv_type driver_type;
  1474. void *pUserData;
  1475. void *pIndUserData;
  1476. } t_wma_start_req;
  1477. /* Enumeration for Version */
  1478. typedef enum {
  1479. WLAN_HAL_MSG_VERSION0 = 0,
  1480. WLAN_HAL_MSG_VERSION1 = 1,
  1481. WLAN_HAL_MSG_WCNSS_CTRL_VERSION = 0x7FFF, /*define as 2 bytes data */
  1482. WLAN_HAL_MSG_VERSION_MAX_FIELD = WLAN_HAL_MSG_WCNSS_CTRL_VERSION
  1483. } tHalHostMsgVersion;
  1484. /**
  1485. * struct sHalMacStartParameter - mac start request parameters
  1486. * @driverType: driver type (production/FTM)
  1487. * @uConfigBufferLen: length of config buffer
  1488. */
  1489. typedef struct qdf_packed sHalMacStartParameter {
  1490. tDriverType driverType;
  1491. uint32_t uConfigBufferLen;
  1492. /* Following this there is a TLV formatted buffer of length
  1493. * "uConfigBufferLen" bytes containing all config values.
  1494. * The TLV is expected to be formatted like this:
  1495. * 0 15 31 31+CFG_LEN-1 length-1
  1496. * | CFG_ID | CFG_LEN | CFG_BODY | CFG_ID |......|
  1497. */
  1498. } tHalMacStartParameter, *tpHalMacStartParameter;
  1499. extern void cds_wma_complete_cback(void *p_cds_context);
  1500. extern void wma_send_regdomain_info_to_fw(uint32_t reg_dmn, uint16_t regdmn2G,
  1501. uint16_t regdmn5G, int8_t ctl2G,
  1502. int8_t ctl5G);
  1503. /**
  1504. * enum frame_index - Frame index
  1505. * @GENERIC_NODOWNLD_NOACK_COMP_INDEX: Frame index for no download comp no ack
  1506. * @GENERIC_DOWNLD_COMP_NOACK_COMP_INDEX: Frame index for download comp no ack
  1507. * @GENERIC_DOWNLD_COMP_ACK_COMP_INDEX: Frame index for download comp and ack
  1508. * @GENERIC_NODOWLOAD_ACK_COMP_INDEX: Frame index for no download comp and ack
  1509. * @FRAME_INDEX_MAX: maximum frame index
  1510. */
  1511. enum frame_index {
  1512. GENERIC_NODOWNLD_NOACK_COMP_INDEX,
  1513. GENERIC_DOWNLD_COMP_NOACK_COMP_INDEX,
  1514. GENERIC_DOWNLD_COMP_ACK_COMP_INDEX,
  1515. GENERIC_NODOWLOAD_ACK_COMP_INDEX,
  1516. FRAME_INDEX_MAX
  1517. };
  1518. /**
  1519. * struct wma_tx_ack_work_ctx - tx ack work context
  1520. * @wma_handle: wma handle
  1521. * @sub_type: sub type
  1522. * @status: status
  1523. * @ack_cmp_work: work structure
  1524. */
  1525. struct wma_tx_ack_work_ctx {
  1526. tp_wma_handle wma_handle;
  1527. uint16_t sub_type;
  1528. int32_t status;
  1529. qdf_work_t ack_cmp_work;
  1530. };
  1531. /**
  1532. * struct wma_target_req - target request parameters
  1533. * @event_timeout: event timeout
  1534. * @node: list
  1535. * @user_data: user data
  1536. * @msg_type: message type
  1537. * @vdev_id: vdev id
  1538. * @type: type
  1539. */
  1540. struct wma_target_req {
  1541. qdf_mc_timer_t event_timeout;
  1542. qdf_list_node_t node;
  1543. void *user_data;
  1544. uint32_t msg_type;
  1545. uint8_t vdev_id;
  1546. uint8_t type;
  1547. };
  1548. /**
  1549. * struct wma_vdev_start_req - vdev start request parameters
  1550. * @beacon_intval: beacon interval
  1551. * @dtim_period: dtim period
  1552. * @max_txpow: max tx power
  1553. * @chan_offset: channel offset
  1554. * @is_dfs: is dfs supported or not
  1555. * @vdev_id: vdev id
  1556. * @chan: channel
  1557. * @oper_mode: operating mode
  1558. * @ssid: ssid
  1559. * @hidden_ssid: hidden ssid
  1560. * @pmf_enabled: is pmf enabled or not
  1561. * @vht_capable: VHT capabality
  1562. * @ht_capable: HT capabality
  1563. * @dfs_pri_multiplier: DFS multiplier
  1564. * @dot11_mode: 802.11 mode
  1565. * @is_half_rate: is the channel operating at 10MHz
  1566. * @is_quarter_rate: is the channel operating at 5MHz
  1567. * @preferred_tx_streams: policy manager indicates the preferred
  1568. * number of transmit streams
  1569. * @preferred_rx_streams: policy manager indicates the preferred
  1570. * number of receive streams
  1571. */
  1572. struct wma_vdev_start_req {
  1573. uint32_t beacon_intval;
  1574. uint32_t dtim_period;
  1575. int32_t max_txpow;
  1576. enum phy_ch_width chan_width;
  1577. bool is_dfs;
  1578. uint8_t vdev_id;
  1579. uint8_t chan;
  1580. uint8_t oper_mode;
  1581. tSirMacSSid ssid;
  1582. uint8_t hidden_ssid;
  1583. uint8_t pmf_enabled;
  1584. uint8_t vht_capable;
  1585. uint8_t ch_center_freq_seg0;
  1586. uint8_t ch_center_freq_seg1;
  1587. uint8_t ht_capable;
  1588. int32_t dfs_pri_multiplier;
  1589. uint8_t dot11_mode;
  1590. bool is_half_rate;
  1591. bool is_quarter_rate;
  1592. uint32_t preferred_tx_streams;
  1593. uint32_t preferred_rx_streams;
  1594. uint8_t beacon_tx_rate;
  1595. };
  1596. /**
  1597. * struct wma_set_key_params - set key parameters
  1598. * @vdev_id: vdev id
  1599. * @def_key_idx: used to see if we have to read the key from cfg
  1600. * @key_len: key length
  1601. * @peer_mac: peer mac address
  1602. * @singl_tid_rc: 1=Single TID based Replay Count, 0=Per TID based RC
  1603. * @key_type: key type
  1604. * @key_idx: key index
  1605. * @unicast: unicast flag
  1606. * @key_data: key data
  1607. */
  1608. struct wma_set_key_params {
  1609. uint8_t vdev_id;
  1610. /* def_key_idx can be used to see if we have to read the key from cfg */
  1611. uint32_t def_key_idx;
  1612. uint16_t key_len;
  1613. uint8_t peer_mac[IEEE80211_ADDR_LEN];
  1614. uint8_t singl_tid_rc;
  1615. enum eAniEdType key_type;
  1616. uint32_t key_idx;
  1617. bool unicast;
  1618. uint8_t key_data[SIR_MAC_MAX_KEY_LENGTH];
  1619. };
  1620. /**
  1621. * struct t_thermal_cmd_params - thermal command parameters
  1622. * @minTemp: minimum temprature
  1623. * @maxTemp: maximum temprature
  1624. * @thermalEnable: thermal enable
  1625. */
  1626. typedef struct {
  1627. uint16_t minTemp;
  1628. uint16_t maxTemp;
  1629. uint8_t thermalEnable;
  1630. } t_thermal_cmd_params, *tp_thermal_cmd_params;
  1631. /**
  1632. * enum wma_cfg_cmd_id - wma cmd ids
  1633. * @WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID: txrx firmware stats enable command
  1634. * @WMA_VDEV_TXRX_FWSTATS_RESET_CMDID: txrx firmware stats reset command
  1635. * @WMA_VDEV_MCC_SET_TIME_LATENCY: set MCC latency time
  1636. * @WMA_VDEV_MCC_SET_TIME_QUOTA: set MCC time quota
  1637. * @WMA_VDEV_IBSS_SET_ATIM_WINDOW_SIZE: set IBSS ATIM window size
  1638. * @WMA_VDEV_IBSS_SET_POWER_SAVE_ALLOWED: set IBSS enable power save
  1639. * @WMA_VDEV_IBSS_SET_POWER_COLLAPSE_ALLOWED: set IBSS power collapse enable
  1640. * @WMA_VDEV_IBSS_SET_AWAKE_ON_TX_RX: awake IBSS on TX/RX
  1641. * @WMA_VDEV_IBSS_SET_INACTIVITY_TIME: set IBSS inactivity time
  1642. * @WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME: set IBSS TXSP
  1643. * @WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS: set IBSS power save warmup time
  1644. * @WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW: set IBSS power save ATIM
  1645. * @WMA_VDEV_DFS_CONTROL_CMDID: DFS control command
  1646. * @WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID: get IPA microcontroller fw stats
  1647. *
  1648. * wma command ids for configuration request which
  1649. * does not involve sending a wmi command.
  1650. */
  1651. enum wma_cfg_cmd_id {
  1652. WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID = WMI_CMDID_MAX,
  1653. WMA_VDEV_TXRX_FWSTATS_RESET_CMDID,
  1654. WMA_VDEV_MCC_SET_TIME_LATENCY,
  1655. WMA_VDEV_MCC_SET_TIME_QUOTA,
  1656. WMA_VDEV_IBSS_SET_ATIM_WINDOW_SIZE,
  1657. WMA_VDEV_IBSS_SET_POWER_SAVE_ALLOWED,
  1658. WMA_VDEV_IBSS_SET_POWER_COLLAPSE_ALLOWED,
  1659. WMA_VDEV_IBSS_SET_AWAKE_ON_TX_RX,
  1660. WMA_VDEV_IBSS_SET_INACTIVITY_TIME,
  1661. WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME,
  1662. WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS,
  1663. WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW,
  1664. WMA_VDEV_DFS_CONTROL_CMDID,
  1665. WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID,
  1666. WMA_CMD_ID_MAX
  1667. };
  1668. /**
  1669. * struct wma_trigger_uapsd_params - trigger uapsd parameters
  1670. * @wmm_ac: wmm access catagory
  1671. * @user_priority: user priority
  1672. * @service_interval: service interval
  1673. * @suspend_interval: suspend interval
  1674. * @delay_interval: delay interval
  1675. */
  1676. typedef struct wma_trigger_uapsd_params {
  1677. uint32_t wmm_ac;
  1678. uint32_t user_priority;
  1679. uint32_t service_interval;
  1680. uint32_t suspend_interval;
  1681. uint32_t delay_interval;
  1682. } t_wma_trigger_uapsd_params, *tp_wma_trigger_uapsd_params;
  1683. /**
  1684. * enum uapsd_peer_param_max_sp - U-APSD maximum service period of peer station
  1685. * @UAPSD_MAX_SP_LEN_UNLIMITED: unlimited max service period
  1686. * @UAPSD_MAX_SP_LEN_2: max service period = 2
  1687. * @UAPSD_MAX_SP_LEN_4: max service period = 4
  1688. * @UAPSD_MAX_SP_LEN_6: max service period = 6
  1689. */
  1690. enum uapsd_peer_param_max_sp {
  1691. UAPSD_MAX_SP_LEN_UNLIMITED = 0,
  1692. UAPSD_MAX_SP_LEN_2 = 2,
  1693. UAPSD_MAX_SP_LEN_4 = 4,
  1694. UAPSD_MAX_SP_LEN_6 = 6
  1695. };
  1696. /**
  1697. * enum uapsd_peer_param_enabled_ac - U-APSD Enabled AC's of peer station
  1698. * @UAPSD_VO_ENABLED: enable uapsd for voice
  1699. * @UAPSD_VI_ENABLED: enable uapsd for video
  1700. * @UAPSD_BK_ENABLED: enable uapsd for background
  1701. * @UAPSD_BE_ENABLED: enable uapsd for best effort
  1702. */
  1703. enum uapsd_peer_param_enabled_ac {
  1704. UAPSD_VO_ENABLED = 0x01,
  1705. UAPSD_VI_ENABLED = 0x02,
  1706. UAPSD_BK_ENABLED = 0x04,
  1707. UAPSD_BE_ENABLED = 0x08
  1708. };
  1709. /**
  1710. * enum profile_id_t - Firmware profiling index
  1711. * @PROF_CPU_IDLE: cpu idle profile
  1712. * @PROF_PPDU_PROC: ppdu processing profile
  1713. * @PROF_PPDU_POST: ppdu post profile
  1714. * @PROF_HTT_TX_INPUT: htt tx input profile
  1715. * @PROF_MSDU_ENQ: msdu enqueue profile
  1716. * @PROF_PPDU_POST_HAL: ppdu post profile
  1717. * @PROF_COMPUTE_TX_TIME: tx time profile
  1718. * @PROF_MAX_ID: max profile index
  1719. */
  1720. enum profile_id_t {
  1721. PROF_CPU_IDLE,
  1722. PROF_PPDU_PROC,
  1723. PROF_PPDU_POST,
  1724. PROF_HTT_TX_INPUT,
  1725. PROF_MSDU_ENQ,
  1726. PROF_PPDU_POST_HAL,
  1727. PROF_COMPUTE_TX_TIME,
  1728. PROF_MAX_ID,
  1729. };
  1730. /**
  1731. * struct p2p_ie - P2P IE structural definition.
  1732. * @p2p_id: p2p id
  1733. * @p2p_len: p2p length
  1734. * @p2p_oui: p2p OUI
  1735. * @p2p_oui_type: p2p OUI type
  1736. */
  1737. struct p2p_ie {
  1738. uint8_t p2p_id;
  1739. uint8_t p2p_len;
  1740. uint8_t p2p_oui[3];
  1741. uint8_t p2p_oui_type;
  1742. } __packed;
  1743. /**
  1744. * struct p2p_noa_descriptor - noa descriptor
  1745. * @type_count: 255: continuous schedule, 0: reserved
  1746. * @duration: Absent period duration in micro seconds
  1747. * @interval: Absent period interval in micro seconds
  1748. * @start_time: 32 bit tsf time when in starts
  1749. */
  1750. struct p2p_noa_descriptor {
  1751. uint8_t type_count;
  1752. uint32_t duration;
  1753. uint32_t interval;
  1754. uint32_t start_time;
  1755. } __packed;
  1756. /**
  1757. * struct p2p_sub_element_noa - p2p noa element
  1758. * @p2p_sub_id: p2p sub id
  1759. * @p2p_sub_len: p2p sub length
  1760. * @index: identifies instance of NOA su element
  1761. * @oppPS: oppPS state of the AP
  1762. * @ctwindow: ctwindow in TUs
  1763. * @num_descriptors: number of NOA descriptors
  1764. * @noa_descriptors: noa descriptors
  1765. */
  1766. struct p2p_sub_element_noa {
  1767. uint8_t p2p_sub_id;
  1768. uint8_t p2p_sub_len;
  1769. uint8_t index; /* identifies instance of NOA su element */
  1770. uint8_t oppPS:1, /* oppPS state of the AP */
  1771. ctwindow:7; /* ctwindow in TUs */
  1772. uint8_t num_descriptors; /* number of NOA descriptors */
  1773. struct p2p_noa_descriptor noa_descriptors[WMA_MAX_NOA_DESCRIPTORS];
  1774. };
  1775. /**
  1776. * struct wma_decap_info_t - decapsulation info
  1777. * @hdr: header
  1778. * @hdr_len: header length
  1779. */
  1780. struct wma_decap_info_t {
  1781. uint8_t hdr[sizeof(struct ieee80211_qosframe_addr4)];
  1782. int32_t hdr_len;
  1783. };
  1784. /**
  1785. * enum packet_power_save - packet power save params
  1786. * @WMI_VDEV_PPS_PAID_MATCH: paid match param
  1787. * @WMI_VDEV_PPS_GID_MATCH: gid match param
  1788. * @WMI_VDEV_PPS_EARLY_TIM_CLEAR: early tim clear param
  1789. * @WMI_VDEV_PPS_EARLY_DTIM_CLEAR: early dtim clear param
  1790. * @WMI_VDEV_PPS_EOF_PAD_DELIM: eof pad delim param
  1791. * @WMI_VDEV_PPS_MACADDR_MISMATCH: macaddr mismatch param
  1792. * @WMI_VDEV_PPS_DELIM_CRC_FAIL: delim CRC fail param
  1793. * @WMI_VDEV_PPS_GID_NSTS_ZERO: gid nsts zero param
  1794. * @WMI_VDEV_PPS_RSSI_CHECK: RSSI check param
  1795. * @WMI_VDEV_PPS_5G_EBT: 5G ebt param
  1796. */
  1797. typedef enum {
  1798. WMI_VDEV_PPS_PAID_MATCH = 0,
  1799. WMI_VDEV_PPS_GID_MATCH = 1,
  1800. WMI_VDEV_PPS_EARLY_TIM_CLEAR = 2,
  1801. WMI_VDEV_PPS_EARLY_DTIM_CLEAR = 3,
  1802. WMI_VDEV_PPS_EOF_PAD_DELIM = 4,
  1803. WMI_VDEV_PPS_MACADDR_MISMATCH = 5,
  1804. WMI_VDEV_PPS_DELIM_CRC_FAIL = 6,
  1805. WMI_VDEV_PPS_GID_NSTS_ZERO = 7,
  1806. WMI_VDEV_PPS_RSSI_CHECK = 8,
  1807. WMI_VDEV_VHT_SET_GID_MGMT = 9,
  1808. WMI_VDEV_PPS_5G_EBT = 10
  1809. } packet_power_save;
  1810. /**
  1811. * enum green_tx_param - green tx parameters
  1812. * @WMI_VDEV_PARAM_GTX_HT_MCS: ht mcs param
  1813. * @WMI_VDEV_PARAM_GTX_VHT_MCS: vht mcs param
  1814. * @WMI_VDEV_PARAM_GTX_USR_CFG: user cfg param
  1815. * @WMI_VDEV_PARAM_GTX_THRE: thre param
  1816. * @WMI_VDEV_PARAM_GTX_MARGIN: green tx margin param
  1817. * @WMI_VDEV_PARAM_GTX_STEP: green tx step param
  1818. * @WMI_VDEV_PARAM_GTX_MINTPC: mintpc param
  1819. * @WMI_VDEV_PARAM_GTX_BW_MASK: bandwidth mask
  1820. */
  1821. typedef enum {
  1822. WMI_VDEV_PARAM_GTX_HT_MCS,
  1823. WMI_VDEV_PARAM_GTX_VHT_MCS,
  1824. WMI_VDEV_PARAM_GTX_USR_CFG,
  1825. WMI_VDEV_PARAM_GTX_THRE,
  1826. WMI_VDEV_PARAM_GTX_MARGIN,
  1827. WMI_VDEV_PARAM_GTX_STEP,
  1828. WMI_VDEV_PARAM_GTX_MINTPC,
  1829. WMI_VDEV_PARAM_GTX_BW_MASK,
  1830. } green_tx_param;
  1831. #ifdef FEATURE_WLAN_TDLS
  1832. /**
  1833. * struct wma_tdls_params - TDLS parameters
  1834. * @vdev_id: vdev id
  1835. * @tdls_state: TDLS state
  1836. * @notification_interval_ms: notification inerval
  1837. * @tx_discovery_threshold: tx discovery threshold
  1838. * @tx_teardown_threshold: tx teardown threashold
  1839. * @rssi_teardown_threshold: RSSI teardown threshold
  1840. * @rssi_delta: RSSI delta
  1841. * @tdls_options: TDLS options
  1842. * @peer_traffic_ind_window: raffic indication window
  1843. * @peer_traffic_response_timeout: traffic response timeout
  1844. * @puapsd_mask: uapsd mask
  1845. * @puapsd_inactivity_time: uapsd inactivity time
  1846. * @puapsd_rx_frame_threshold: uapsd rx frame threshold
  1847. * @teardown_notification_ms: tdls teardown notification interval
  1848. * @tdls_peer_kickout_threshold: tdls packet threshold for
  1849. * peer kickout operation
  1850. */
  1851. typedef struct wma_tdls_params {
  1852. uint32_t vdev_id;
  1853. uint32_t tdls_state;
  1854. uint32_t notification_interval_ms;
  1855. uint32_t tx_discovery_threshold;
  1856. uint32_t tx_teardown_threshold;
  1857. int32_t rssi_teardown_threshold;
  1858. int32_t rssi_delta;
  1859. uint32_t tdls_options;
  1860. uint32_t peer_traffic_ind_window;
  1861. uint32_t peer_traffic_response_timeout;
  1862. uint32_t puapsd_mask;
  1863. uint32_t puapsd_inactivity_time;
  1864. uint32_t puapsd_rx_frame_threshold;
  1865. uint32_t teardown_notification_ms;
  1866. uint32_t tdls_peer_kickout_threshold;
  1867. } t_wma_tdls_params;
  1868. /**
  1869. * struct wma_tdls_peer_event - TDLS peer event
  1870. * @vdev_id: vdev id
  1871. * @peer_macaddr: peer MAC address
  1872. * @peer_status: TDLS peer status
  1873. * @peer_reason: TDLS peer reason
  1874. */
  1875. typedef struct {
  1876. A_UINT32 vdev_id;
  1877. wmi_mac_addr peer_macaddr;
  1878. A_UINT32 peer_status;
  1879. A_UINT32 peer_reason;
  1880. } wma_tdls_peer_event;
  1881. #endif /* FEATURE_WLAN_TDLS */
  1882. /**
  1883. * struct wma_dfs_radar_channel_list - dfs radar channel list
  1884. * @nchannels: nuber of channels
  1885. * @channels: Channel number including bonded channels on which
  1886. * radar is present
  1887. */
  1888. struct wma_dfs_radar_channel_list {
  1889. A_UINT32 nchannels;
  1890. uint8_t channels[WMA_DFS_MAX_20M_SUB_CH];
  1891. };
  1892. /**
  1893. * struct wma_dfs_radar_indication - Structure to indicate RADAR
  1894. * @vdev_id: vdev id
  1895. * @chan_list: Channel list on which RADAR is detected
  1896. * @dfs_radar_status: Flag to Indicate RADAR presence on the current channel
  1897. * @use_nol: Flag to indicate use NOL
  1898. */
  1899. struct wma_dfs_radar_indication {
  1900. A_UINT32 vdev_id;
  1901. struct wma_dfs_radar_channel_list chan_list;
  1902. uint32_t dfs_radar_status;
  1903. int use_nol;
  1904. };
  1905. /**
  1906. * enum uapsd_ac - U-APSD Access Categories
  1907. * @UAPSD_BE: best effort
  1908. * @UAPSD_BK: back ground
  1909. * @UAPSD_VI: video
  1910. * @UAPSD_VO: voice
  1911. */
  1912. enum uapsd_ac {
  1913. UAPSD_BE,
  1914. UAPSD_BK,
  1915. UAPSD_VI,
  1916. UAPSD_VO
  1917. };
  1918. QDF_STATUS wma_disable_uapsd_per_ac(tp_wma_handle wma_handle,
  1919. uint32_t vdev_id, enum uapsd_ac ac);
  1920. /**
  1921. * enum uapsd_up - U-APSD User Priorities
  1922. * @UAPSD_UP_BE: best effort
  1923. * @UAPSD_UP_BK: back ground
  1924. * @UAPSD_UP_RESV: reserve
  1925. * @UAPSD_UP_EE: Excellent Effort
  1926. * @UAPSD_UP_CL: Critical Applications
  1927. * @UAPSD_UP_VI: video
  1928. * @UAPSD_UP_VO: voice
  1929. * @UAPSD_UP_NC: Network Control
  1930. */
  1931. enum uapsd_up {
  1932. UAPSD_UP_BE,
  1933. UAPSD_UP_BK,
  1934. UAPSD_UP_RESV,
  1935. UAPSD_UP_EE,
  1936. UAPSD_UP_CL,
  1937. UAPSD_UP_VI,
  1938. UAPSD_UP_VO,
  1939. UAPSD_UP_NC,
  1940. UAPSD_UP_MAX
  1941. };
  1942. /**
  1943. * struct wma_unit_test_cmd - unit test command parameters
  1944. * @vdev_id: vdev id
  1945. * @module_id: module id
  1946. * @num_args: number of arguments
  1947. * @args: arguments
  1948. */
  1949. typedef struct wma_unit_test_cmd {
  1950. uint32_t vdev_id;
  1951. WLAN_MODULE_ID module_id;
  1952. uint32_t num_args;
  1953. uint32_t args[WMA_MAX_NUM_ARGS];
  1954. } t_wma_unit_test_cmd;
  1955. /**
  1956. * struct wma_roam_invoke_cmd - roam invoke command
  1957. * @vdev_id: vdev id
  1958. * @bssid: mac address
  1959. * @channel: channel
  1960. * @frame_len: frame length, includs mac header, fixed params and ies
  1961. * @frame_buf: buffer contaning probe response or beacon
  1962. */
  1963. struct wma_roam_invoke_cmd {
  1964. uint32_t vdev_id;
  1965. uint8_t bssid[IEEE80211_ADDR_LEN];
  1966. uint32_t channel;
  1967. uint32_t frame_len;
  1968. uint8_t *frame_buf;
  1969. };
  1970. /**
  1971. * struct wma_process_fw_event_params - fw event parameters
  1972. * @wmi_handle: wmi handle
  1973. * @evt_buf: event buffer
  1974. */
  1975. typedef struct {
  1976. void *wmi_handle;
  1977. void *evt_buf;
  1978. } wma_process_fw_event_params;
  1979. int wma_process_fw_event_handler(void *ctx, void *ev, uint8_t rx_ctx);
  1980. A_UINT32 e_csr_auth_type_to_rsn_authmode(eCsrAuthType authtype,
  1981. eCsrEncryptionType encr);
  1982. A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
  1983. /*
  1984. * WMA-DFS Hooks
  1985. */
  1986. int ol_if_dfs_attach(struct ieee80211com *ic, void *ptr, void *radar_info);
  1987. uint64_t ol_if_get_tsf64(struct ieee80211com *ic);
  1988. int ol_if_dfs_disable(struct ieee80211com *ic);
  1989. struct dfs_ieee80211_channel *ieee80211_find_channel(struct ieee80211com *ic,
  1990. int freq, uint32_t flags);
  1991. int ol_if_dfs_enable(struct ieee80211com *ic, int *is_fastclk, void *pe);
  1992. uint32_t ieee80211_ieee2mhz(uint32_t chan, uint32_t flags);
  1993. int ol_if_dfs_get_ext_busy(struct ieee80211com *ic);
  1994. int ol_if_dfs_get_mib_cycle_counts_pct(struct ieee80211com *ic,
  1995. uint32_t *rxc_pcnt, uint32_t *rxf_pcnt,
  1996. uint32_t *txf_pcnt);
  1997. uint16_t ol_if_dfs_usenol(struct ieee80211com *ic);
  1998. void ieee80211_mark_dfs(struct ieee80211com *ic,
  1999. struct dfs_ieee80211_channel *ichan);
  2000. int wma_dfs_indicate_radar(struct ieee80211com *ic,
  2001. struct dfs_ieee80211_channel *ichan);
  2002. QDF_STATUS wma_trigger_uapsd_params(tp_wma_handle wma_handle, uint32_t vdev_id,
  2003. tp_wma_trigger_uapsd_params
  2004. trigger_uapsd_params);
  2005. /* added to get average snr for both data and beacon */
  2006. QDF_STATUS wma_send_snr_request(tp_wma_handle wma_handle, void *pGetRssiReq);
  2007. QDF_STATUS wma_update_vdev_tbl(tp_wma_handle wma_handle, uint8_t vdev_id,
  2008. void *tx_rx_vdev_handle,
  2009. uint8_t *mac, uint32_t vdev_type, bool add_del);
  2010. void wma_send_flush_logs_to_fw(tp_wma_handle wma_handle);
  2011. void wma_log_completion_timeout(void *data);
  2012. QDF_STATUS wma_set_rssi_monitoring(tp_wma_handle wma,
  2013. struct rssi_monitor_req *req);
  2014. QDF_STATUS wma_send_pdev_set_pcl_cmd(tp_wma_handle wma_handle,
  2015. struct wmi_pcl_chan_weights *msg);
  2016. QDF_STATUS wma_send_pdev_set_hw_mode_cmd(tp_wma_handle wma_handle,
  2017. struct sir_hw_mode *msg);
  2018. QDF_STATUS wma_get_scan_id(uint32_t *scan_id);
  2019. QDF_STATUS wma_send_pdev_set_dual_mac_config(tp_wma_handle wma_handle,
  2020. struct sir_dual_mac_config *msg);
  2021. QDF_STATUS wma_send_pdev_set_antenna_mode(tp_wma_handle wma_handle,
  2022. struct sir_antenna_mode_param *msg);
  2023. QDF_STATUS wma_crash_inject(tp_wma_handle wma_handle, uint32_t type,
  2024. uint32_t delay_time_ms);
  2025. struct wma_target_req *wma_fill_vdev_req(tp_wma_handle wma,
  2026. uint8_t vdev_id,
  2027. uint32_t msg_type, uint8_t type,
  2028. void *params, uint32_t timeout);
  2029. struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma,
  2030. uint8_t vdev_id, uint32_t msg_type,
  2031. uint8_t type, void *params,
  2032. uint32_t timeout);
  2033. QDF_STATUS wma_vdev_start(tp_wma_handle wma,
  2034. struct wma_vdev_start_req *req, bool isRestart);
  2035. void wma_remove_vdev_req(tp_wma_handle wma, uint8_t vdev_id,
  2036. uint8_t type);
  2037. int wma_mgmt_tx_completion_handler(void *handle, uint8_t *cmpl_event_params,
  2038. uint32_t len);
  2039. int wma_mgmt_tx_bundle_completion_handler(void *handle,
  2040. uint8_t *cmpl_event_params, uint32_t len);
  2041. void wma_set_dfs_region(tp_wma_handle wma, enum dfs_region dfs_region);
  2042. uint32_t wma_get_vht_ch_width(void);
  2043. QDF_STATUS
  2044. wma_config_debug_module_cmd(wmi_unified_t wmi_handle, A_UINT32 param,
  2045. A_UINT32 val, A_UINT32 *module_id_bitmap,
  2046. A_UINT32 bitmap_len);
  2047. #ifdef FEATURE_LFR_SUBNET_DETECTION
  2048. QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
  2049. struct gateway_param_update_req *req);
  2050. #else
  2051. static inline QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
  2052. struct gateway_param_update_req *req)
  2053. {
  2054. return QDF_STATUS_SUCCESS;
  2055. }
  2056. #endif /* FEATURE_LFR_SUBNET_DETECTION */
  2057. #if defined(FEATURE_LRO)
  2058. QDF_STATUS wma_lro_config_cmd(tp_wma_handle wma_handle,
  2059. struct wma_lro_config_cmd_t *wma_lro_cmd);
  2060. #else
  2061. static inline QDF_STATUS wma_lro_config_cmd(tp_wma_handle wma_handle,
  2062. struct wma_lro_config_cmd_t *wma_lro_cmd)
  2063. {
  2064. return QDF_STATUS_SUCCESS;
  2065. }
  2066. #endif
  2067. bool wma_is_current_hwmode_dbs(void);
  2068. void
  2069. wma_indicate_err(enum ol_rx_err_type err_type,
  2070. struct ol_error_info *err_info);
  2071. QDF_STATUS wma_ht40_stop_obss_scan(tp_wma_handle wma_handle,
  2072. int32_t vdev_id);
  2073. void wma_process_fw_test_cmd(WMA_HANDLE handle,
  2074. struct set_fwtest_params *wma_fwtest);
  2075. QDF_STATUS wma_send_ht40_obss_scanind(tp_wma_handle wma,
  2076. struct obss_ht40_scanind *req);
  2077. int wma_get_bpf_caps_event_handler(void *handle,
  2078. u_int8_t *cmd_param_info,
  2079. u_int32_t len);
  2080. uint32_t wma_get_num_of_setbits_from_bitmask(uint32_t mask);
  2081. QDF_STATUS wma_get_bpf_capabilities(tp_wma_handle wma);
  2082. QDF_STATUS wma_set_bpf_instructions(tp_wma_handle wma,
  2083. struct sir_bpf_set_offload *bpf_set_offload);
  2084. void wma_process_set_pdev_ie_req(tp_wma_handle wma,
  2085. struct set_ie_param *ie_params);
  2086. void wma_process_set_pdev_ht_ie_req(tp_wma_handle wma,
  2087. struct set_ie_param *ie_params);
  2088. void wma_process_set_pdev_vht_ie_req(tp_wma_handle wma,
  2089. struct set_ie_param *ie_params);
  2090. void wma_remove_peer(tp_wma_handle wma, u_int8_t *bssid,
  2091. u_int8_t vdev_id, void *peer,
  2092. bool roam_synch_in_progress);
  2093. QDF_STATUS wma_create_peer(tp_wma_handle wma, struct cdp_pdev *pdev,
  2094. struct cdp_vdev *vdev, u8 peer_addr[6],
  2095. u_int32_t peer_type, u_int8_t vdev_id,
  2096. bool roam_synch_in_progress);
  2097. struct wma_ini_config *wma_get_ini_handle(tp_wma_handle wma_handle);
  2098. WLAN_PHY_MODE wma_chan_phy_mode(u8 chan, enum phy_ch_width chan_width,
  2099. u8 dot11_mode);
  2100. #ifdef FEATURE_OEM_DATA_SUPPORT
  2101. QDF_STATUS wma_start_oem_data_req(tp_wma_handle wma_handle,
  2102. struct oem_data_req *oem_req);
  2103. #endif
  2104. QDF_STATUS wma_enable_disable_caevent_ind(tp_wma_handle wma_handle,
  2105. uint8_t val);
  2106. void wma_register_packetdump_callback(
  2107. tp_wma_packetdump_cb wma_mgmt_tx_packetdump_cb,
  2108. tp_wma_packetdump_cb wma_mgmt_rx_packetdump_cb);
  2109. void wma_deregister_packetdump_callback(void);
  2110. void wma_update_sta_inactivity_timeout(tp_wma_handle wma,
  2111. struct sme_sta_inactivity_timeout *sta_inactivity_timer);
  2112. void wma_peer_set_default_routing(void *scn_handle, uint8_t *peer_macaddr,
  2113. uint8_t vdev_id, bool hash_based, uint8_t ring_num);
  2114. int wma_peer_rx_reorder_queue_setup(void *scn_handle,
  2115. uint8_t vdev_id, uint8_t *peer_macaddr, qdf_dma_addr_t hw_qdesc,
  2116. int tid, uint16_t queue_no);
  2117. int wma_peer_rx_reorder_queue_remove(void *scn_handle,
  2118. uint8_t vdev_id, uint8_t *peer_macaddr, uint32_t peer_tid_bitmap);
  2119. /**
  2120. * wma_form_rx_packet() - form rx cds packet
  2121. * @buf: buffer
  2122. * @mgmt_rx_params: mgmt rx params
  2123. * @rx_pkt: cds packet
  2124. *
  2125. * This functions forms a cds packet from the rx mgmt frame received.
  2126. *
  2127. * Return: 0 for success or error code
  2128. */
  2129. int wma_form_rx_packet(qdf_nbuf_t buf,
  2130. struct mgmt_rx_event_params *mgmt_rx_params,
  2131. cds_pkt_t *rx_pkt);
  2132. /**
  2133. * wma_mgmt_unified_cmd_send() - send the mgmt tx packet
  2134. * @vdev: objmgr vdev
  2135. * @buf: buffer
  2136. * @desc_id: desc id
  2137. * @mgmt_tx_params: mgmt rx params
  2138. *
  2139. * This functions sends mgmt tx packet to WMI layer.
  2140. *
  2141. * Return: 0 for success or error code
  2142. */
  2143. QDF_STATUS wma_mgmt_unified_cmd_send(struct wlan_objmgr_vdev *vdev,
  2144. qdf_nbuf_t buf, uint32_t desc_id,
  2145. void *mgmt_tx_params);
  2146. /**
  2147. * wma_chan_info_event_handler() - chan info event handler
  2148. * @handle: wma handle
  2149. * @event_buf: event handler data
  2150. * @len: length of @event_buf
  2151. *
  2152. * this function will handle the WMI_CHAN_INFO_EVENTID
  2153. *
  2154. * Return: int
  2155. */
  2156. int wma_chan_info_event_handler(void *handle, uint8_t *event_buf,
  2157. uint32_t len);
  2158. /**
  2159. * wma_vdev_set_mlme_state() - Set vdev mlme state
  2160. * @wma: wma handle
  2161. * @vdev_id: the Id of the vdev to configure
  2162. * @state: vdev state
  2163. *
  2164. * Return: None
  2165. */
  2166. static inline
  2167. void wma_vdev_set_mlme_state(tp_wma_handle wma, uint8_t vdev_id,
  2168. enum wlan_vdev_state state)
  2169. {
  2170. struct wlan_objmgr_vdev *vdev;
  2171. if (!wma) {
  2172. WMA_LOGE("%s: WMA context is invald!", __func__);
  2173. return;
  2174. }
  2175. vdev = wlan_objmgr_get_vdev_by_id_from_psoc(wma->psoc, vdev_id,
  2176. WLAN_LEGACY_WMA_ID);
  2177. if (vdev) {
  2178. wlan_vdev_obj_lock(vdev);
  2179. wlan_vdev_mlme_set_state(vdev, state);
  2180. wlan_vdev_obj_unlock(vdev);
  2181. wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_WMA_ID);
  2182. }
  2183. }
  2184. #endif