wma.h 74 KB

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