wma.h 62 KB

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