wma.h 69 KB

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