wma.h 66 KB

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