wma.h 76 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577
  1. /*
  2. * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. #ifndef WMA_H
  19. #define WMA_H
  20. #include "a_types.h"
  21. #include "qdf_types.h"
  22. #include "osapi_linux.h"
  23. #include "htc_packet.h"
  24. #include "i_qdf_event.h"
  25. #include "wmi_services.h"
  26. #include "wmi_unified.h"
  27. #include "wmi_version.h"
  28. #include "qdf_types.h"
  29. #include "cfg_api.h"
  30. #include "qdf_status.h"
  31. #include "cds_sched.h"
  32. #include "cds_config.h"
  33. #include "sir_mac_prot_def.h"
  34. #include "wma_types.h"
  35. #include <linux/workqueue.h>
  36. #include "utils_api.h"
  37. #include "lim_types.h"
  38. #include "wmi_unified_api.h"
  39. #include "cdp_txrx_cmn.h"
  40. #include "dbglog.h"
  41. #include "cds_ieee80211_common.h"
  42. #include "wlan_objmgr_psoc_obj.h"
  43. #include <cdp_txrx_handle.h>
  44. #include <wlan_policy_mgr_api.h>
  45. /* Platform specific configuration for max. no. of fragments */
  46. #define QCA_OL_11AC_TX_MAX_FRAGS 2
  47. /* Private */
  48. #define WMA_READY_EVENTID_TIMEOUT 6000
  49. #define WMA_SERVICE_READY_EXT_TIMEOUT 6000
  50. #define NAN_CLUSTER_ID_BYTES 4
  51. #define WMA_CRASH_INJECT_TIMEOUT 5000
  52. /* MAC ID to PDEV ID mapping is as given below
  53. * MAC_ID PDEV_ID
  54. * 0 1
  55. * 1 2
  56. * SOC Level WMI_PDEV_ID_SOC
  57. */
  58. #define WMA_MAC_TO_PDEV_MAP(x) ((x) + (1))
  59. #define WMA_PDEV_TO_MAC_MAP(x) ((x) - (1))
  60. #define WMA_MAX_SUPPORTED_BSS SIR_MAX_SUPPORTED_BSS
  61. #define WMA_MAX_MGMT_MPDU_LEN 2000
  62. #define MAX_PRINT_FAILURE_CNT 50
  63. #define WMA_INVALID_VDEV_ID 0xFF
  64. /* Deprecated logging macros, to be removed. Please do not use in new code */
  65. #define WMA_LOGD(params ...) \
  66. QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_WMA, params)
  67. #define WMA_LOGI(params ...) \
  68. QDF_TRACE_INFO_NO_FL(QDF_MODULE_ID_WMA, params)
  69. #define WMA_LOGW(params ...) \
  70. QDF_TRACE_WARN_NO_FL(QDF_MODULE_ID_WMA, params)
  71. #define WMA_LOGE(params ...) \
  72. QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_WMA, params)
  73. #define WMA_LOGP(params ...) \
  74. QDF_TRACE_FATAL_NO_FL(QDF_MODULE_ID_WMA, params)
  75. #define wma_alert(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_WMA, params)
  76. #define wma_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_WMA, params)
  77. #define wma_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_WMA, params)
  78. #define wma_info(params...) QDF_TRACE_INFO(QDF_MODULE_ID_WMA, params)
  79. #define wma_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_WMA, params)
  80. #define wma_nofl_alert(params...) \
  81. QDF_TRACE_FATAL_NO_FL(QDF_MODULE_ID_WMA, params)
  82. #define wma_nofl_err(params...) \
  83. QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_WMA, params)
  84. #define wma_nofl_warn(params...) \
  85. QDF_TRACE_WARN_NO_FL(QDF_MODULE_ID_WMA, params)
  86. #define wma_nofl_info(params...) \
  87. QDF_TRACE_INFO_NO_FL(QDF_MODULE_ID_WMA, params)
  88. #define wma_nofl_debug(params...) \
  89. QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_WMA, params)
  90. #define WMA_DEBUG_ALWAYS
  91. #ifdef WMA_DEBUG_ALWAYS
  92. #define WMA_LOGA(params ...) \
  93. QDF_TRACE_FATAL_NO_FL(QDF_MODULE_ID_WMA, params)
  94. #else
  95. #define WMA_LOGA(params ...)
  96. #endif
  97. #define WMA_WILDCARD_PDEV_ID 0x0
  98. #define WMA_HW_DEF_SCAN_MAX_DURATION 30000 /* 30 secs */
  99. #define WMA_SCAN_NPROBES_DEFAULT (2)
  100. #define WMA_BCAST_MAC_ADDR (0xFF)
  101. #define WMA_MCAST_IPV4_MAC_ADDR (0x01)
  102. #define WMA_MCAST_IPV6_MAC_ADDR (0x33)
  103. #define WMA_ICMP_PROTOCOL (0x01)
  104. #define WMA_IS_EAPOL_GET_MIN_LEN 14
  105. #define WMA_EAPOL_SUBTYPE_GET_MIN_LEN 21
  106. #define WMA_EAPOL_INFO_GET_MIN_LEN 23
  107. #define WMA_IS_DHCP_GET_MIN_LEN 38
  108. #define WMA_DHCP_SUBTYPE_GET_MIN_LEN 0x11D
  109. #define WMA_DHCP_INFO_GET_MIN_LEN 50
  110. #define WMA_IS_ARP_GET_MIN_LEN 14
  111. #define WMA_ARP_SUBTYPE_GET_MIN_LEN 22
  112. #define WMA_IPV4_PROTO_GET_MIN_LEN 24
  113. #define WMA_IPV4_PKT_INFO_GET_MIN_LEN 42
  114. #define WMA_ICMP_SUBTYPE_GET_MIN_LEN 35
  115. #define WMA_IPV6_PROTO_GET_MIN_LEN 21
  116. #define WMA_IPV6_PKT_INFO_GET_MIN_LEN 62
  117. #define WMA_ICMPV6_SUBTYPE_GET_MIN_LEN 55
  118. /* Beacon tx rate */
  119. #define WMA_BEACON_TX_RATE_1_M 10
  120. #define WMA_BEACON_TX_RATE_2_M 20
  121. #define WMA_BEACON_TX_RATE_5_5_M 55
  122. #define WMA_BEACON_TX_RATE_11_M 110
  123. #define WMA_BEACON_TX_RATE_6_M 60
  124. #define WMA_BEACON_TX_RATE_9_M 90
  125. #define WMA_BEACON_TX_RATE_12_M 120
  126. #define WMA_BEACON_TX_RATE_18_M 180
  127. #define WMA_BEACON_TX_RATE_24_M 240
  128. #define WMA_BEACON_TX_RATE_36_M 360
  129. #define WMA_BEACON_TX_RATE_48_M 480
  130. #define WMA_BEACON_TX_RATE_54_M 540
  131. /**
  132. * ds_mode: distribution system mode
  133. * @IEEE80211_NO_DS: NO DS at either side
  134. * @IEEE80211_TO_DS: DS at receiver side
  135. * @IEEE80211_FROM_DS: DS at sender side
  136. * @IEEE80211_DS_TO_DS: DS at both sender and revceiver side
  137. */
  138. enum ds_mode {
  139. IEEE80211_NO_DS,
  140. IEEE80211_TO_DS,
  141. IEEE80211_FROM_DS,
  142. IEEE80211_DS_TO_DS
  143. };
  144. /* Roaming default values
  145. * All time and period values are in milliseconds.
  146. * All rssi values are in dB except for WMA_NOISE_FLOOR_DBM_DEFAULT.
  147. */
  148. #define WMA_ROAM_SCAN_CHANNEL_SWITCH_TIME (4)
  149. #define WMA_NOISE_FLOOR_DBM_DEFAULT (-96)
  150. #define WMA_ROAM_RSSI_DIFF_DEFAULT (5)
  151. #define WMA_ROAM_DWELL_TIME_ACTIVE_DEFAULT (100)
  152. #define WMA_ROAM_DWELL_TIME_PASSIVE_DEFAULT (110)
  153. #define WMA_ROAM_MIN_REST_TIME_DEFAULT (50)
  154. #define WMA_ROAM_MAX_REST_TIME_DEFAULT (500)
  155. #define WMA_INVALID_KEY_IDX 0xff
  156. #define WMA_MAX_RF_CHAINS(x) ((1 << x) - 1)
  157. #define WMA_MIN_RF_CHAINS (1)
  158. #define WMA_MAX_NSS (2)
  159. #ifdef FEATURE_WLAN_EXTSCAN
  160. #define WMA_MAX_EXTSCAN_MSG_SIZE 1536
  161. #define WMA_EXTSCAN_REST_TIME 100
  162. #define WMA_EXTSCAN_MAX_SCAN_TIME 50000
  163. #define WMA_EXTSCAN_BURST_DURATION 150
  164. #endif
  165. #define WMA_CHAN_START_RESP 0
  166. #define WMA_CHAN_END_RESP 1
  167. #define WMA_BCN_BUF_MAX_SIZE 512
  168. #define WMA_NOA_IE_SIZE(num_desc) (2 + (13 * (num_desc)))
  169. #define WMA_MAX_NOA_DESCRIPTORS 4
  170. #define WMA_TIM_SUPPORTED_PVB_LENGTH ((HAL_NUM_STA / 8) + 1)
  171. #define WMA_WOW_PTRN_MASK_VALID 0xFF
  172. #define WMA_NUM_BITS_IN_BYTE 8
  173. #define WMA_AP_WOW_DEFAULT_PTRN_MAX 4
  174. #define WMA_BSS_STATUS_STARTED 0x1
  175. #define WMA_BSS_STATUS_STOPPED 0x2
  176. #define WMA_TARGET_REQ_TYPE_VDEV_START 0x1
  177. #define WMA_TARGET_REQ_TYPE_VDEV_STOP 0x2
  178. #define WMA_TARGET_REQ_TYPE_VDEV_DEL 0x3
  179. #define WMA_PEER_ASSOC_CNF_START 0x01
  180. #define WMA_PEER_ASSOC_TIMEOUT (6000) /* 6 seconds */
  181. #define WMA_DELETE_STA_RSP_START 0x02
  182. #define WMA_DELETE_STA_TIMEOUT (6000) /* 6 seconds */
  183. #define WMA_DEL_P2P_SELF_STA_RSP_START 0x03
  184. #define WMA_SET_LINK_PEER_RSP 0x04
  185. #define WMA_DELETE_PEER_RSP 0x05
  186. #define WMA_PDEV_SET_HW_MODE_RESP 0x06
  187. #ifdef CONFIG_SLUB_DEBUG_ON
  188. #define SLUB_DEBUG_FACTOR (2)
  189. #else
  190. #define SLUB_DEBUG_FACTOR (1)
  191. #endif
  192. /* FW response timeout values in milli seconds */
  193. #define WMA_VDEV_START_REQUEST_TIMEOUT (6000) * (SLUB_DEBUG_FACTOR)
  194. #define WMA_VDEV_STOP_REQUEST_TIMEOUT (6000) * (SLUB_DEBUG_FACTOR)
  195. #define WMA_VDEV_HW_MODE_REQUEST_TIMEOUT (6000) * (SLUB_DEBUG_FACTOR)
  196. #define WMA_VDEV_PLCY_MGR_CMD_TIMEOUT (6000) * (SLUB_DEBUG_FACTOR)
  197. #define WMA_VDEV_SET_KEY_WAKELOCK_TIMEOUT WAKELOCK_DURATION_RECOMMENDED
  198. #define WMA_TGT_INVALID_SNR (0)
  199. #define WMA_TGT_IS_VALID_SNR(x) ((x) >= 0 && (x) < WMA_TGT_MAX_SNR)
  200. #define WMA_TGT_IS_INVALID_SNR(x) (!WMA_TGT_IS_VALID_SNR(x))
  201. #define WMA_TX_Q_RECHECK_TIMER_WAIT 2 /* 2 ms */
  202. #define WMA_TX_Q_RECHECK_TIMER_MAX_WAIT 20 /* 20 ms */
  203. #define WMA_MAX_NUM_ARGS 8
  204. #define WMA_SMPS_MASK_LOWER_16BITS 0xFF
  205. #define WMA_SMPS_MASK_UPPER_3BITS 0x7
  206. #define WMA_SMPS_PARAM_VALUE_S 29
  207. /*
  208. * Setting the Tx Comp Timeout to 1 secs.
  209. * TODO: Need to Revist the Timing
  210. */
  211. #define WMA_TX_FRAME_COMPLETE_TIMEOUT 1000
  212. #define WMA_TX_FRAME_BUFFER_NO_FREE 0
  213. #define WMA_TX_FRAME_BUFFER_FREE 1
  214. /* Default InActivity Time is 200 ms */
  215. #define POWERSAVE_DEFAULT_INACTIVITY_TIME 200
  216. /* Default WOW InActivity Time is 50 ms */
  217. #define WOW_POWERSAVE_DEFAULT_INACTIVITY_TIME 50
  218. /* Default Listen Interval */
  219. #define POWERSAVE_DEFAULT_LISTEN_INTERVAL 1
  220. /*
  221. * TODO: Add WMI_CMD_ID_MAX as part of WMI_CMD_ID
  222. * instead of assigning it to the last valid wmi
  223. * cmd+1 to avoid updating this when a command is
  224. * added/deleted.
  225. */
  226. #define WMI_CMDID_MAX (WMI_TXBF_CMDID + 1)
  227. #define WMA_NLO_FREQ_THRESH 1000 /* in MHz */
  228. #define WMA_SEC_TO_MSEC(sec) (sec * 1000) /* sec to msec */
  229. #define WMA_MSEC_TO_USEC(msec) (msec * 1000) /* msec to usec */
  230. /* Default rssi threshold defined in CFG80211 */
  231. #define WMA_RSSI_THOLD_DEFAULT -300
  232. #define WMA_AUTH_REQ_RECV_WAKE_LOCK_TIMEOUT WAKELOCK_DURATION_RECOMMENDED
  233. #define WMA_ASSOC_REQ_RECV_WAKE_LOCK_DURATION WAKELOCK_DURATION_RECOMMENDED
  234. #define WMA_DEAUTH_RECV_WAKE_LOCK_DURATION WAKELOCK_DURATION_RECOMMENDED
  235. #define WMA_DISASSOC_RECV_WAKE_LOCK_DURATION WAKELOCK_DURATION_RECOMMENDED
  236. #define WMA_ROAM_HO_WAKE_LOCK_DURATION (500) /* in msec */
  237. #ifdef FEATURE_WLAN_AUTO_SHUTDOWN
  238. #define WMA_AUTO_SHUTDOWN_WAKE_LOCK_DURATION WAKELOCK_DURATION_RECOMMENDED
  239. #endif
  240. #define WMA_BMISS_EVENT_WAKE_LOCK_DURATION WAKELOCK_DURATION_RECOMMENDED
  241. #define WMA_FW_RSP_EVENT_WAKE_LOCK_DURATION WAKELOCK_DURATION_MAX
  242. #define WMA_TXMIC_LEN 8
  243. #define WMA_RXMIC_LEN 8
  244. #define WMA_IV_KEY_LEN 16
  245. /*
  246. * Length = (2 octets for Index and CTWin/Opp PS) and
  247. * (13 octets for each NOA Descriptors)
  248. */
  249. #define WMA_P2P_NOA_IE_OPP_PS_SET (0x80)
  250. #define WMA_P2P_NOA_IE_CTWIN_MASK (0x7F)
  251. #define WMA_P2P_IE_ID 0xdd
  252. #define WMA_P2P_WFA_OUI { 0x50, 0x6f, 0x9a }
  253. #define WMA_P2P_WFA_VER 0x09 /* ver 1.0 */
  254. #define WMA_WSC_OUI { 0x00, 0x50, 0xF2 } /* Microsoft WSC OUI byte */
  255. /* P2P Sub element definitions (according to table 5 of Wifi's P2P spec) */
  256. #define WMA_P2P_SUB_ELEMENT_STATUS 0
  257. #define WMA_P2P_SUB_ELEMENT_MINOR_REASON 1
  258. #define WMA_P2P_SUB_ELEMENT_CAPABILITY 2
  259. #define WMA_P2P_SUB_ELEMENT_DEVICE_ID 3
  260. #define WMA_P2P_SUB_ELEMENT_GO_INTENT 4
  261. #define WMA_P2P_SUB_ELEMENT_CONFIGURATION_TIMEOUT 5
  262. #define WMA_P2P_SUB_ELEMENT_LISTEN_CHANNEL 6
  263. #define WMA_P2P_SUB_ELEMENT_GROUP_BSSID 7
  264. #define WMA_P2P_SUB_ELEMENT_EXTENDED_LISTEN_TIMING 8
  265. #define WMA_P2P_SUB_ELEMENT_INTENDED_INTERFACE_ADDR 9
  266. #define WMA_P2P_SUB_ELEMENT_MANAGEABILITY 10
  267. #define WMA_P2P_SUB_ELEMENT_CHANNEL_LIST 11
  268. #define WMA_P2P_SUB_ELEMENT_NOA 12
  269. #define WMA_P2P_SUB_ELEMENT_DEVICE_INFO 13
  270. #define WMA_P2P_SUB_ELEMENT_GROUP_INFO 14
  271. #define WMA_P2P_SUB_ELEMENT_GROUP_ID 15
  272. #define WMA_P2P_SUB_ELEMENT_INTERFACE 16
  273. #define WMA_P2P_SUB_ELEMENT_OP_CHANNEL 17
  274. #define WMA_P2P_SUB_ELEMENT_INVITATION_FLAGS 18
  275. #define WMA_P2P_SUB_ELEMENT_VENDOR 221
  276. /* Macros for handling unaligned memory accesses */
  277. #define P2PIE_PUT_LE16(a, val) \
  278. do { \
  279. (a)[1] = ((u16) (val)) >> 8; \
  280. (a)[0] = ((u16) (val)) & 0xff; \
  281. } while (0)
  282. #define P2PIE_PUT_LE32(a, val) \
  283. do { \
  284. (a)[3] = (u8) ((((u32) (val)) >> 24) & 0xff); \
  285. (a)[2] = (u8) ((((u32) (val)) >> 16) & 0xff); \
  286. (a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \
  287. (a)[0] = (u8) (((u32) (val)) & 0xff); \
  288. } while (0)
  289. #define WMA_DEFAULT_MAX_PSPOLL_BEFORE_WAKE 1
  290. #define WMA_DEFAULT_QPOWER_MAX_PSPOLL_BEFORE_WAKE 1
  291. #define WMA_DEFAULT_QPOWER_TX_WAKE_THRESHOLD 2
  292. #define WMA_VHT_PPS_PAID_MATCH 1
  293. #define WMA_VHT_PPS_GID_MATCH 2
  294. #define WMA_VHT_PPS_DELIM_CRC_FAIL 3
  295. #define WMA_DEFAULT_HW_MODE_INDEX 0xFFFF
  296. #define TWO_THIRD (2/3)
  297. /**
  298. * WMA hardware mode list bit-mask definitions.
  299. * Bits 4:0, 31:29 are unused.
  300. *
  301. * The below definitions are added corresponding to WMI DBS HW mode
  302. * list to make it independent of firmware changes for WMI definitions.
  303. * Currently these definitions have dependency with BIT positions of
  304. * the existing WMI macros. Thus, if the BIT positions are changed for
  305. * WMI macros, then these macros' BIT definitions are also need to be
  306. * changed.
  307. */
  308. #define WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS (28)
  309. #define WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS (24)
  310. #define WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS (20)
  311. #define WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS (16)
  312. #define WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS (12)
  313. #define WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS (8)
  314. #define WMA_HW_MODE_DBS_MODE_BITPOS (7)
  315. #define WMA_HW_MODE_AGILE_DFS_MODE_BITPOS (6)
  316. #define WMA_HW_MODE_SBS_MODE_BITPOS (5)
  317. #define WMA_HW_MODE_MAC0_TX_STREAMS_MASK \
  318. (0xf << WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS)
  319. #define WMA_HW_MODE_MAC0_RX_STREAMS_MASK \
  320. (0xf << WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS)
  321. #define WMA_HW_MODE_MAC1_TX_STREAMS_MASK \
  322. (0xf << WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS)
  323. #define WMA_HW_MODE_MAC1_RX_STREAMS_MASK \
  324. (0xf << WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS)
  325. #define WMA_HW_MODE_MAC0_BANDWIDTH_MASK \
  326. (0xf << WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS)
  327. #define WMA_HW_MODE_MAC1_BANDWIDTH_MASK \
  328. (0xf << WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS)
  329. #define WMA_HW_MODE_DBS_MODE_MASK \
  330. (0x1 << WMA_HW_MODE_DBS_MODE_BITPOS)
  331. #define WMA_HW_MODE_AGILE_DFS_MODE_MASK \
  332. (0x1 << WMA_HW_MODE_AGILE_DFS_MODE_BITPOS)
  333. #define WMA_HW_MODE_SBS_MODE_MASK \
  334. (0x1 << WMA_HW_MODE_SBS_MODE_BITPOS)
  335. #define WMA_HW_MODE_MAC0_TX_STREAMS_SET(hw_mode, value) \
  336. WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS, 4, value)
  337. #define WMA_HW_MODE_MAC0_RX_STREAMS_SET(hw_mode, value) \
  338. WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS, 4, value)
  339. #define WMA_HW_MODE_MAC1_TX_STREAMS_SET(hw_mode, value) \
  340. WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS, 4, value)
  341. #define WMA_HW_MODE_MAC1_RX_STREAMS_SET(hw_mode, value) \
  342. WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS, 4, value)
  343. #define WMA_HW_MODE_MAC0_BANDWIDTH_SET(hw_mode, value) \
  344. WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS, 4, value)
  345. #define WMA_HW_MODE_MAC1_BANDWIDTH_SET(hw_mode, value) \
  346. WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS, 4, value)
  347. #define WMA_HW_MODE_DBS_MODE_SET(hw_mode, value) \
  348. WMI_SET_BITS(hw_mode, WMA_HW_MODE_DBS_MODE_BITPOS, 1, value)
  349. #define WMA_HW_MODE_AGILE_DFS_SET(hw_mode, value) \
  350. WMI_SET_BITS(hw_mode, WMA_HW_MODE_AGILE_DFS_MODE_BITPOS, 1, value)
  351. #define WMA_HW_MODE_SBS_MODE_SET(hw_mode, value) \
  352. WMI_SET_BITS(hw_mode, WMA_HW_MODE_SBS_MODE_BITPOS, 1, value)
  353. #define WMA_HW_MODE_MAC0_TX_STREAMS_GET(hw_mode) \
  354. ((hw_mode & WMA_HW_MODE_MAC0_TX_STREAMS_MASK) >> \
  355. WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS)
  356. #define WMA_HW_MODE_MAC0_RX_STREAMS_GET(hw_mode) \
  357. ((hw_mode & WMA_HW_MODE_MAC0_RX_STREAMS_MASK) >> \
  358. WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS)
  359. #define WMA_HW_MODE_MAC1_TX_STREAMS_GET(hw_mode) \
  360. ((hw_mode & WMA_HW_MODE_MAC1_TX_STREAMS_MASK) >> \
  361. WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS)
  362. #define WMA_HW_MODE_MAC1_RX_STREAMS_GET(hw_mode) \
  363. ((hw_mode & WMA_HW_MODE_MAC1_RX_STREAMS_MASK) >> \
  364. WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS)
  365. #define WMA_HW_MODE_MAC0_BANDWIDTH_GET(hw_mode) \
  366. ((hw_mode & WMA_HW_MODE_MAC0_BANDWIDTH_MASK) >> \
  367. WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS)
  368. #define WMA_HW_MODE_MAC1_BANDWIDTH_GET(hw_mode) \
  369. ((hw_mode & WMA_HW_MODE_MAC1_BANDWIDTH_MASK) >> \
  370. WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS)
  371. #define WMA_HW_MODE_DBS_MODE_GET(hw_mode) \
  372. ((hw_mode & WMA_HW_MODE_DBS_MODE_MASK) >> \
  373. WMA_HW_MODE_DBS_MODE_BITPOS)
  374. #define WMA_HW_MODE_AGILE_DFS_GET(hw_mode) \
  375. ((hw_mode & WMA_HW_MODE_AGILE_DFS_MODE_MASK) >> \
  376. WMA_HW_MODE_AGILE_DFS_MODE_BITPOS)
  377. #define WMA_HW_MODE_SBS_MODE_GET(hw_mode) \
  378. ((hw_mode & WMA_HW_MODE_SBS_MODE_MASK) >> \
  379. WMA_HW_MODE_SBS_MODE_BITPOS)
  380. /*
  381. * PROBE_REQ_TX_DELAY
  382. * param to specify probe request Tx delay for scans triggered on this VDEV
  383. */
  384. #define PROBE_REQ_TX_DELAY 10
  385. /* PROBE_REQ_TX_TIME_GAP
  386. * param to specify the time gap between each set of probe request transmission.
  387. * The number of probe requests in each set depends on the ssid_list and,
  388. * bssid_list in the scan request. This parameter will get applied only,
  389. * for the scans triggered on this VDEV.
  390. */
  391. #define PROBE_REQ_TX_TIME_GAP 20
  392. typedef void (*txFailIndCallback)(uint8_t *peer_mac, uint8_t seqNo);
  393. typedef void (*tp_wma_packetdump_cb)(qdf_nbuf_t netbuf,
  394. uint8_t status, uint8_t vdev_id, uint8_t type);
  395. /**
  396. * enum wma_rx_exec_ctx - wma rx execution context
  397. * @WMA_RX_WORK_CTX: work queue context execution
  398. * @WMA_RX_TASKLET_CTX: tasklet context execution
  399. * @WMA_RX_SERIALIZER_CTX: MC thread context execution
  400. *
  401. */
  402. enum wma_rx_exec_ctx {
  403. WMA_RX_WORK_CTX,
  404. WMA_RX_TASKLET_CTX,
  405. WMA_RX_SERIALIZER_CTX
  406. };
  407. /**
  408. * struct beacon_info - structure to store beacon template
  409. * @buf: skb ptr
  410. * @len: length
  411. * @dma_mapped: is it dma mapped or not
  412. * @tim_ie_offset: TIM IE offset
  413. * @dtim_count: DTIM count
  414. * @seq_no: sequence no
  415. * @noa_sub_ie: NOA sub IE
  416. * @noa_sub_ie_len: NOA sub IE length
  417. * @noa_ie: NOA IE
  418. * @p2p_ie_offset: p2p IE offset
  419. * @lock: lock
  420. */
  421. struct beacon_info {
  422. qdf_nbuf_t buf;
  423. uint32_t len;
  424. uint8_t dma_mapped;
  425. uint32_t tim_ie_offset;
  426. uint8_t dtim_count;
  427. uint16_t seq_no;
  428. uint8_t noa_sub_ie[2 + WMA_NOA_IE_SIZE(WMA_MAX_NOA_DESCRIPTORS)];
  429. uint16_t noa_sub_ie_len;
  430. uint8_t *noa_ie;
  431. uint16_t p2p_ie_offset;
  432. qdf_spinlock_t lock;
  433. };
  434. /**
  435. * struct beacon_tim_ie - structure to store TIM IE of beacon
  436. * @tim_ie: tim ie
  437. * @tim_len: tim ie length
  438. * @dtim_count: dtim count
  439. * @dtim_period: dtim period
  440. * @tim_bitctl: tim bit control
  441. * @tim_bitmap: tim bitmap
  442. */
  443. struct beacon_tim_ie {
  444. uint8_t tim_ie;
  445. uint8_t tim_len;
  446. uint8_t dtim_count;
  447. uint8_t dtim_period;
  448. uint8_t tim_bitctl;
  449. uint8_t tim_bitmap[1];
  450. } __ATTRIB_PACK;
  451. /**
  452. * struct pps - packet power save parameter
  453. * @paid_match_enable: paid match enable
  454. * @gid_match_enable: gid match enable
  455. * @tim_clear: time clear
  456. * @dtim_clear: dtim clear
  457. * @eof_delim: eof delim
  458. * @mac_match: mac match
  459. * @delim_fail: delim fail
  460. * @nsts_zero: nsts zero
  461. * @rssi_chk: RSSI check
  462. * @ebt_5g: ebt 5GHz
  463. */
  464. struct pps {
  465. bool paid_match_enable;
  466. bool gid_match_enable;
  467. bool tim_clear;
  468. bool dtim_clear;
  469. bool eof_delim;
  470. bool mac_match;
  471. bool delim_fail;
  472. bool nsts_zero;
  473. bool rssi_chk;
  474. bool ebt_5g;
  475. };
  476. /**
  477. * struct qpower_params - qpower related parameters
  478. * @max_ps_poll_cnt: max ps poll count
  479. * @max_tx_before_wake: max tx before wake
  480. * @spec_ps_poll_wake_interval: ps poll wake interval
  481. * @max_spec_nodata_ps_poll: no data ps poll
  482. */
  483. struct qpower_params {
  484. uint32_t max_ps_poll_cnt;
  485. uint32_t max_tx_before_wake;
  486. uint32_t spec_ps_poll_wake_interval;
  487. uint32_t max_spec_nodata_ps_poll;
  488. };
  489. /**
  490. * struct gtx_config_t - GTX config
  491. * @gtxRTMask: for HT and VHT rate masks
  492. * @gtxUsrcfg: host request for GTX mask
  493. * @gtxPERThreshold: PER Threshold (default: 10%)
  494. * @gtxPERMargin: PER margin (default: 2%)
  495. * @gtxTPCstep: TCP step (default: 1)
  496. * @gtxTPCMin: TCP min (default: 5)
  497. * @gtxBWMask: BW mask (20/40/80/160 Mhz)
  498. */
  499. typedef struct {
  500. uint32_t gtxRTMask[2];
  501. uint32_t gtxUsrcfg;
  502. uint32_t gtxPERThreshold;
  503. uint32_t gtxPERMargin;
  504. uint32_t gtxTPCstep;
  505. uint32_t gtxTPCMin;
  506. uint32_t gtxBWMask;
  507. } gtx_config_t;
  508. /**
  509. * struct pdev_cli_config_t - store pdev parameters
  510. * @ani_enable: ANI is enabled/disable on target
  511. * @ani_poll_len: store ANI polling period
  512. * @ani_listen_len: store ANI listening period
  513. * @ani_ofdm_level: store ANI OFDM immunity level
  514. * @ani_cck_level: store ANI CCK immunity level
  515. * @cwmenable: Dynamic bw is enable/disable in fw
  516. * @txchainmask: tx chain mask
  517. * @rxchainmask: rx chain mask
  518. * @txpow2g: tx power limit for 2GHz
  519. * @txpow5g: tx power limit for 5GHz
  520. *
  521. * This structure stores pdev parameters.
  522. * Some of these parameters are set in fw and some
  523. * parameters are only maintained in host.
  524. */
  525. typedef struct {
  526. uint32_t ani_enable;
  527. uint32_t ani_poll_len;
  528. uint32_t ani_listen_len;
  529. uint32_t ani_ofdm_level;
  530. uint32_t ani_cck_level;
  531. uint32_t cwmenable;
  532. uint32_t cts_cbw;
  533. uint32_t txchainmask;
  534. uint32_t rxchainmask;
  535. uint32_t txpow2g;
  536. uint32_t txpow5g;
  537. } pdev_cli_config_t;
  538. /**
  539. * struct vdev_cli_config_t - store vdev parameters
  540. * @nss: nss width
  541. * @ldpc: is ldpc is enable/disable
  542. * @tx_stbc: TX STBC is enable/disable
  543. * @rx_stbc: RX STBC is enable/disable
  544. * @shortgi: short gi is enable/disable
  545. * @rtscts_en: RTS/CTS is enable/disable
  546. * @chwidth: channel width
  547. * @tx_rate: tx rate
  548. * @ampdu: ampdu size
  549. * @amsdu: amsdu size
  550. * @erx_adjust: enable/disable early rx enable
  551. * @erx_bmiss_num: target bmiss number per sample
  552. * @erx_bmiss_cycle: sample cycle
  553. * @erx_slop_step: slop_step value
  554. * @erx_init_slop: init slop
  555. * @erx_adj_pause: pause adjust enable/disable
  556. * @erx_dri_sample: enable/disable drift sample
  557. * @pps_params: packet power save parameters
  558. * @qpower_params: qpower parameters
  559. * @gtx_info: GTX offload info
  560. * @dcm: DCM enable/disable
  561. * @range_ext: HE range extension enable/disable
  562. *
  563. * This structure stores vdev parameters.
  564. * Some of these parameters are set in fw and some
  565. * parameters are only maintained in host.
  566. */
  567. typedef struct {
  568. uint32_t nss;
  569. uint32_t ldpc;
  570. uint32_t tx_stbc;
  571. uint32_t rx_stbc;
  572. uint32_t shortgi;
  573. uint32_t rtscts_en;
  574. uint32_t chwidth;
  575. uint32_t tx_rate;
  576. uint32_t ampdu;
  577. uint32_t amsdu;
  578. uint32_t erx_adjust;
  579. uint32_t erx_bmiss_num;
  580. uint32_t erx_bmiss_cycle;
  581. uint32_t erx_slop_step;
  582. uint32_t erx_init_slop;
  583. uint32_t erx_adj_pause;
  584. uint32_t erx_dri_sample;
  585. struct pps pps_params;
  586. struct qpower_params qpower_params;
  587. gtx_config_t gtx_info;
  588. #ifdef WLAN_FEATURE_11AX
  589. uint8_t dcm;
  590. uint8_t range_ext;
  591. #endif
  592. } vdev_cli_config_t;
  593. /**
  594. * struct wma_version_info - Store wmi version info
  595. * @major: wmi major version
  596. * @minor: wmi minor version
  597. * @revision: wmi revision number
  598. */
  599. struct wma_version_info {
  600. u_int32_t major;
  601. u_int32_t minor;
  602. u_int32_t revision;
  603. };
  604. /**
  605. * struct wma_wow - store wow patterns
  606. * @magic_ptrn_enable: magic pattern enable/disable
  607. * @wow_enable: wow enable/disable
  608. * @wow_enable_cmd_sent: is wow enable command sent to fw
  609. * @deauth_enable: is deauth wakeup enable/disable
  610. * @disassoc_enable: is disassoc wakeup enable/disable
  611. * @gtk_pdev_enable: is GTK based wakeup enable/disable
  612. * @gtk_err_enable: is GTK error wakeup enable/disable
  613. * @lphb_cache: lphb cache
  614. *
  615. * This structure stores wow patterns and
  616. * wow related parameters in host.
  617. */
  618. struct wma_wow {
  619. bool magic_ptrn_enable;
  620. bool wow_enable;
  621. bool wow_enable_cmd_sent;
  622. bool deauth_enable;
  623. bool disassoc_enable;
  624. bool gtk_err_enable[WMA_MAX_SUPPORTED_BSS];
  625. };
  626. #ifdef WLAN_FEATURE_11W
  627. #define CMAC_IPN_LEN (6)
  628. #define WMA_IGTK_KEY_INDEX_4 (4)
  629. #define WMA_IGTK_KEY_INDEX_5 (5)
  630. /**
  631. * struct wma_igtk_ipn_t - GTK IPN info
  632. * @ipn: IPN info
  633. */
  634. typedef struct {
  635. uint8_t ipn[CMAC_IPN_LEN];
  636. } wma_igtk_ipn_t;
  637. /**
  638. * struct wma_igtk_key_t - GTK key
  639. * @key_length: key length
  640. * @key: key
  641. * @key_id: key id
  642. * @key_cipher: key type
  643. */
  644. typedef struct {
  645. uint16_t key_length;
  646. uint8_t key[CSR_AES_GMAC_256_KEY_LEN];
  647. /* IPN is maintained per iGTK keyID
  648. * 0th index for iGTK keyID = 4;
  649. * 1st index for iGTK KeyID = 5
  650. */
  651. wma_igtk_ipn_t key_id[2];
  652. uint32_t key_cipher;
  653. } wma_igtk_key_t;
  654. #endif
  655. /**
  656. * struct vdev_restart_params_t - vdev restart parameters
  657. * @vdev_id: vdev id
  658. * @ssid: ssid
  659. * @flags: flags
  660. * @requestor_id: requestor id
  661. * @chan: channel
  662. * @hidden_ssid_restart_in_progress: hidden ssid restart flag
  663. * @ssidHidden: is ssid hidden or not
  664. */
  665. typedef struct {
  666. A_UINT32 vdev_id;
  667. wmi_ssid ssid;
  668. A_UINT32 flags;
  669. A_UINT32 requestor_id;
  670. A_UINT32 disable_hw_ack;
  671. wmi_channel chan;
  672. #ifndef CONFIG_VDEV_SM
  673. qdf_atomic_t hidden_ssid_restart_in_progress;
  674. #endif
  675. uint8_t ssidHidden;
  676. } vdev_restart_params_t;
  677. struct roam_synch_frame_ind {
  678. uint32_t bcn_probe_rsp_len;
  679. uint8_t *bcn_probe_rsp;
  680. uint8_t is_beacon;
  681. uint32_t reassoc_req_len;
  682. uint8_t *reassoc_req;
  683. uint32_t reassoc_rsp_len;
  684. uint8_t *reassoc_rsp;
  685. };
  686. /**
  687. * struct wma_txrx_node - txrx node
  688. * @vdev: pointer to vdev object
  689. * @addr: mac address
  690. * @bssid: bssid
  691. * @handle: wma handle
  692. * @beacon: beacon info
  693. * @vdev_restart_params: vdev restart parameters
  694. * @config: per vdev config parameters
  695. * @scan_info: scan info
  696. * @type: type
  697. * @sub_type: sub type
  698. * @nlo_match_evt_received: is nlo match event received or not
  699. * @pno_in_progress: is pno in progress or not
  700. * @plm_in_progress: is plm in progress or not
  701. * @ptrn_match_enable: is pattern match is enable or not
  702. * @num_wow_default_patterns: number of default wow patterns configured for vdev
  703. * @num_wow_user_patterns: number of user wow patterns configured for vdev
  704. * @conn_state: connection state
  705. * @beaconInterval: beacon interval
  706. * @llbCoexist: 11b coexist
  707. * @shortSlotTimeSupported: is short slot time supported or not
  708. * @dtimPeriod: DTIM period
  709. * @chanmode: channel mode
  710. * @vht_capable: VHT capablity flag
  711. * @ht_capable: HT capablity flag
  712. * @mhz: channel frequency in KHz
  713. * @chan_width: channel bandwidth
  714. * @vdev_up: is vdev up or not
  715. * @tsfadjust: TSF adjust
  716. * @addBssStaContext: add bss context
  717. * @aid: association id
  718. * @rmfEnabled: Robust Management Frame (RMF) enabled/disabled
  719. * @key: GTK key
  720. * @uapsd_cached_val: uapsd cached value
  721. * @stats_rsp: stats response
  722. * @fw_stats_set: fw stats value
  723. * @del_staself_req: delete sta self request
  724. * @bss_status: bss status
  725. * @rate_flags: rate flags
  726. * @nss: nss value
  727. * @is_channel_switch: is channel switch
  728. * @pause_bitmap: pause bitmap
  729. * @tx_power: tx power in dbm
  730. * @max_tx_power: max tx power in dbm
  731. * @nwType: network type (802.11a/b/g/n/ac)
  732. * @staKeyParams: sta key parameters
  733. * @ps_enabled: is powersave enable/disable
  734. * @peer_count: peer count
  735. * @roam_synch_in_progress: flag is in progress or not
  736. * @plink_status_req: link status request
  737. * @psnr_req: snr request
  738. * @delay_before_vdev_stop: delay
  739. * @tx_streams: number of tx streams can be used by the vdev
  740. * @rx_streams: number of rx streams can be used by the vdev
  741. * @chain_mask: chain mask can be used by the vdev
  742. * @mac_id: the mac on which vdev is on
  743. * @wep_default_key_idx: wep default index for group key
  744. * @arp_offload_req: cached arp offload request
  745. * @ns_offload_req: cached ns offload request
  746. * @wow_stats: stat counters for WoW related events
  747. * @rcpi_req: rcpi request
  748. * @in_bmps: Whether bmps for this interface has been enabled
  749. * @vdev_start_wakelock: wakelock to protect vdev start op with firmware
  750. * @vdev_stop_wakelock: wakelock to protect vdev stop op with firmware
  751. * @vdev_set_key_wakelock: wakelock to protect vdev set key op with firmware
  752. * @channel: channel
  753. * @roam_scan_stats_req: cached roam scan stats request
  754. *
  755. * It stores parameters per vdev in wma.
  756. */
  757. struct wma_txrx_node {
  758. struct wlan_objmgr_vdev *vdev;
  759. uint8_t addr[IEEE80211_ADDR_LEN];
  760. uint8_t bssid[IEEE80211_ADDR_LEN];
  761. struct cdp_vdev *handle;
  762. struct beacon_info *beacon;
  763. vdev_restart_params_t vdev_restart_params;
  764. vdev_cli_config_t config;
  765. uint32_t type;
  766. uint32_t sub_type;
  767. #ifdef FEATURE_WLAN_ESE
  768. bool plm_in_progress;
  769. #endif
  770. bool ptrn_match_enable;
  771. uint8_t num_wow_default_patterns;
  772. uint8_t num_wow_user_patterns;
  773. bool conn_state;
  774. tSirMacBeaconInterval beaconInterval;
  775. uint8_t llbCoexist;
  776. uint8_t shortSlotTimeSupported;
  777. uint8_t dtimPeriod;
  778. WMI_HOST_WLAN_PHY_MODE chanmode;
  779. uint8_t vht_capable;
  780. uint8_t ht_capable;
  781. A_UINT32 mhz;
  782. enum phy_ch_width chan_width;
  783. bool vdev_active;
  784. uint64_t tsfadjust;
  785. void *addBssStaContext;
  786. uint8_t aid;
  787. uint8_t rmfEnabled;
  788. #ifdef WLAN_FEATURE_11W
  789. wma_igtk_key_t key;
  790. uint32_t ucast_key_cipher;
  791. #endif /* WLAN_FEATURE_11W */
  792. uint32_t uapsd_cached_val;
  793. tAniGetPEStatsRsp *stats_rsp;
  794. uint8_t fw_stats_set;
  795. void *del_staself_req;
  796. bool is_del_sta_defered;
  797. qdf_atomic_t bss_status;
  798. uint8_t rate_flags;
  799. uint8_t nss;
  800. #ifndef CONFIG_VDEV_SM
  801. bool is_channel_switch;
  802. #endif
  803. uint16_t pause_bitmap;
  804. int8_t tx_power;
  805. int8_t max_tx_power;
  806. uint32_t nwType;
  807. void *staKeyParams;
  808. uint32_t peer_count;
  809. bool roam_synch_in_progress;
  810. void *plink_status_req;
  811. void *psnr_req;
  812. uint8_t delay_before_vdev_stop;
  813. #ifdef FEATURE_WLAN_EXTSCAN
  814. bool extscan_in_progress;
  815. #endif
  816. uint32_t tx_streams;
  817. uint32_t rx_streams;
  818. uint32_t chain_mask;
  819. uint32_t mac_id;
  820. bool roaming_in_progress;
  821. int32_t roam_synch_delay;
  822. uint8_t nss_2g;
  823. uint8_t nss_5g;
  824. bool p2p_lo_in_progress;
  825. uint8_t wep_default_key_idx;
  826. tSirHostOffloadReq arp_offload_req;
  827. tSirHostOffloadReq ns_offload_req;
  828. #ifndef QCA_SUPPORT_CP_STATS
  829. struct sir_vdev_wow_stats wow_stats;
  830. #endif
  831. struct sme_rcpi_req *rcpi_req;
  832. #ifdef WLAN_FEATURE_11AX
  833. bool he_capable;
  834. uint32_t he_ops;
  835. #endif
  836. bool in_bmps;
  837. struct beacon_filter_param beacon_filter;
  838. bool beacon_filter_enabled;
  839. qdf_wake_lock_t vdev_start_wakelock;
  840. qdf_wake_lock_t vdev_stop_wakelock;
  841. qdf_wake_lock_t vdev_set_key_wakelock;
  842. struct roam_synch_frame_ind roam_synch_frame_ind;
  843. bool is_waiting_for_key;
  844. uint8_t channel;
  845. struct sir_roam_scan_stats *roam_scan_stats_req;
  846. };
  847. /**
  848. * struct ibss_power_save_params - IBSS power save parameters
  849. * @atimWindowLength: ATIM window length
  850. * @isPowerSaveAllowed: is power save allowed
  851. * @isPowerCollapseAllowed: is power collapsed allowed
  852. * @isAwakeonTxRxEnabled: is awake on tx/rx enabled
  853. * @inactivityCount: inactivity count
  854. * @txSPEndInactivityTime: tx SP end inactivity time
  855. * @ibssPsWarmupTime: IBSS power save warm up time
  856. * @ibssPs1RxChainInAtimEnable: IBSS power save rx chain in ATIM enable
  857. */
  858. typedef struct {
  859. uint32_t atimWindowLength;
  860. uint32_t isPowerSaveAllowed;
  861. uint32_t isPowerCollapseAllowed;
  862. uint32_t isAwakeonTxRxEnabled;
  863. uint32_t inactivityCount;
  864. uint32_t txSPEndInactivityTime;
  865. uint32_t ibssPsWarmupTime;
  866. uint32_t ibssPs1RxChainInAtimEnable;
  867. } ibss_power_save_params;
  868. /**
  869. * struct mac_ss_bw_info - hw_mode_list PHY/MAC params for each MAC
  870. * @mac_tx_stream: Max TX stream
  871. * @mac_rx_stream: Max RX stream
  872. * @mac_bw: Max bandwidth
  873. */
  874. struct mac_ss_bw_info {
  875. uint32_t mac_tx_stream;
  876. uint32_t mac_rx_stream;
  877. uint32_t mac_bw;
  878. };
  879. /**
  880. * struct wma_ini_config - Structure to hold wma ini configuration
  881. * @max_no_of_peers: Max Number of supported
  882. *
  883. * Placeholder for WMA ini parameters.
  884. */
  885. struct wma_ini_config {
  886. uint8_t max_no_of_peers;
  887. };
  888. /**
  889. * struct wmi_valid_channels - Channel details part of WMI_SCAN_CHAN_LIST_CMDID
  890. * @num_channels: Number of channels
  891. * @channel_list: Channel list
  892. */
  893. struct wma_valid_channels {
  894. uint8_t num_channels;
  895. uint8_t channel_list[MAX_NUM_CHAN];
  896. };
  897. /**
  898. * struct t_wma_handle - wma context
  899. * @wmi_handle: wmi handle
  900. * @cds_context: cds handle
  901. * @mac_context: mac context
  902. * @psoc: psoc context
  903. * @pdev: physical device global object
  904. * @wma_resume_event: wma resume event
  905. * @target_suspend: target suspend event
  906. * @recovery_event: wma FW recovery event
  907. * @max_station: max stations
  908. * @max_bssid: max bssid
  909. * @myaddr: current mac address
  910. * @hwaddr: mac address from EEPROM
  911. * @lpss_support: LPSS feature is supported in target or not
  912. * @wmi_ready: wmi status flag
  913. * @wlan_init_status: wlan init status
  914. * @qdf_dev: qdf device
  915. * @wmi_service_bitmap: wmi services bitmap received from Target
  916. * @wmi_service_ext_bitmap: extended wmi services bitmap received from Target
  917. * @tx_frm_download_comp_cb: Tx Frame Compl Cb registered by umac
  918. * @tx_frm_download_comp_event: Event to wait for tx download completion
  919. * @tx_queue_empty_event: Dummy event to wait for draining MSDUs left
  920. * in hardware tx queue and before requesting VDEV_STOP. Nobody will
  921. * set this and wait will timeout, and code will poll the pending tx
  922. * descriptors number to be zero.
  923. * @umac_ota_ack_cb: Ack Complete Callback registered by umac
  924. * @umac_data_ota_ack_cb: ack complete callback
  925. * @last_umac_data_ota_timestamp: timestamp when OTA of last umac data
  926. * was done
  927. * @last_umac_data_nbuf: cache nbuf ptr for the last umac data buf
  928. * @needShutdown: is shutdown needed or not
  929. * @tgt_cfg_update_cb: configuration update callback
  930. * @reg_cap: regulatory capablities
  931. * @scan_id: scan id
  932. * @interfaces: txrx nodes(per vdev)
  933. * @pdevconfig: pdev related configrations
  934. * @vdev_resp_queue: vdev response queue
  935. * @vdev_respq_lock: vdev response queue lock
  936. * @wma_hold_req_queue: Queue use to serialize requests to firmware
  937. * @wma_hold_req_q_lock: Mutex for @wma_hold_req_queue
  938. * @vht_supp_mcs: VHT supported MCS
  939. * @is_fw_assert: is fw asserted
  940. * @wow: wow related patterns & parameters
  941. * @no_of_suspend_ind: number of suspend indications
  942. * @no_of_resume_ind: number of resume indications
  943. * @ack_work_ctx: Context for deferred processing of TX ACK
  944. * @powersave_mode: power save mode
  945. * @ptrn_match_enable_all_vdev: is pattern match is enable/disable
  946. * @pGetRssiReq: get RSSI request
  947. * @get_one_peer_info: When a "get peer info" request is active, is
  948. * the request for a single peer?
  949. * @get_sta_peer_info: Is a "get peer info" request active?
  950. * @peer_macaddr: When @get_one_peer_info is true, the peer's mac address
  951. * @thermal_mgmt_info: Thermal mitigation related info
  952. * @roam_offload_enabled: is roam offload enable/disable
  953. * @ssdp: ssdp flag
  954. * @enable_mc_list: To Check if Multicast list filtering is enabled in FW
  955. * @ibss_started: is IBSS started or not
  956. * @ibsskey_info: IBSS key info
  957. * @hddTxFailCb: tx fail indication callback
  958. * @extscan_wake_lock: extscan wake lock
  959. * @wow_wake_lock: wow wake lock
  960. * @wow_auth_req_wl: wow wake lock for auth req
  961. * @wow_assoc_req_wl: wow wake lock for assoc req
  962. * @wow_deauth_rec_wl: wow wake lock for deauth req
  963. * @wow_disassoc_rec_wl: wow wake lock for disassoc req
  964. * @wow_ap_assoc_lost_wl: wow wake lock for assoc lost req
  965. * @wow_auto_shutdown_wl: wow wake lock for shutdown req
  966. * @roam_ho_wl: wake lock for roam handoff req
  967. * @wow_nack: wow negative ack flag
  968. * @is_wow_bus_suspended: is wow bus suspended flag
  969. * @wma_scan_comp_timer: scan completion timer
  970. * @suitable_ap_hb_failure: better ap found
  971. * @suitable_ap_hb_failure_rssi: RSSI when suitable_ap_hb_failure
  972. * triggered for later usage to report RSSI at beacon miss scenario
  973. * @wma_ibss_power_save_params: IBSS Power Save config Parameters
  974. * @IsRArateLimitEnabled: RA rate limiti s enabled or not
  975. * @RArateLimitInterval: RA rate limit interval
  976. * @is_lpass_enabled: Flag to indicate if LPASS feature is enabled or not
  977. * @is_nan_enabled: Flag to indicate if NaN feature is enabled or not
  978. * @staMaxLIModDtim: station max listen interval
  979. * @staModDtim: station mode DTIM
  980. * @staDynamicDtim: station dynamic DTIM
  981. * @enable_mhf_offload: is MHF offload enable/disable
  982. * @last_mhf_entries_timestamp: timestamp when last entries where set
  983. * @hw_bd_id: hardware board id
  984. * @hw_bd_info: hardware board info
  985. * @miracast_value: miracast value
  986. * @log_completion_timer: log completion timer
  987. * @num_dbs_hw_modes: Number of HW modes supported by the FW
  988. * @hw_mode: DBS HW mode list
  989. * @old_hw_mode_index: Previous configured HW mode index
  990. * @new_hw_mode_index: Current configured HW mode index
  991. * @peer_authorized_cb: peer authorized hdd callback
  992. * @wow_unspecified_wake_count: Number of wake events which did not
  993. * correspond to known wake events. Note that known wake events are
  994. * tracked on a per-vdev basis via the struct sir_vdev_wow_stats
  995. * wow_stats in struct wma_txrx_node
  996. * @ocb_config_req: OCB request context
  997. * @max_scan: maximum scan requests than can be queued
  998. * @self_gen_frm_pwr: Self-generated frame power
  999. * @tx_chain_mask_cck: Is the CCK tx chain mask enabled
  1000. * @service_ready_ext_timer: Timer for service ready extended. Note
  1001. * this is a a timer instead of wait event because on receiving the
  1002. * service ready event, we will be waiting on the MC thread for the
  1003. * service extended ready event which is also processed in MC
  1004. * thread. This leads to MC thread being stuck. Alternative was to
  1005. * process these events in tasklet/workqueue context. But, this
  1006. * leads to race conditions when the events are processed in two
  1007. * different context. So, processing ready event and extended ready
  1008. * event in the serialized MC thread context with a timer.
  1009. * @csr_roam_synch_cb: CSR callback for firmware Roam Sync events
  1010. * @pe_roam_synch_cb: pe callback for firmware Roam Sync events
  1011. * @wmi_cmd_rsp_wake_lock: wmi command response wake lock
  1012. * @wmi_cmd_rsp_runtime_lock: wmi command response bus lock
  1013. * @active_uc_apf_mode: Setting that determines how APF is applied in
  1014. * active mode for uc packets
  1015. * @active_mc_bc_apf_mode: Setting that determines how APF is applied in
  1016. * active mode for MC/BC packets
  1017. * @ini_config: Initial configuration from upper layer
  1018. * @saved_chan: saved channel list sent as part of
  1019. * WMI_SCAN_CHAN_LIST_CMDID
  1020. * @nan_datapath_enabled: Is NAN datapath support enabled in firmware?
  1021. * @pe_ndp_event_handler: Handler function for NAN Data Path events
  1022. * @fw_timeout_crash: Should firmware be reset upon response timeout?
  1023. * @sub_20_support: Does target support sub-20MHz bandwidth (aka
  1024. * half-rate and quarter-rate)?
  1025. * @is_dfs_offloaded: Is dfs and cac timer offloaded?
  1026. * @wma_mgmt_tx_packetdump_cb: Callback function for TX packet dump
  1027. * @wma_mgmt_rx_packetdump_cb: Callback function for RX packet dump
  1028. * @rcpi_enabled: Is RCPI enabled?
  1029. * @link_stats_results: Structure for handing link stats from firmware
  1030. * @tx_fail_cnt: Number of TX failures
  1031. * @he_cap: 802.11ax capabilities
  1032. * @bandcapability: band capability configured through ini
  1033. * @tx_bfee_8ss_enabled: Is Tx Beamformee support for 8x8 enabled?
  1034. * @in_imps: Is device in Idle Mode Power Save?
  1035. * @ito_repeat_count: Indicates ito repeated count
  1036. * @wma_fw_time_sync_timer: timer used for firmware time sync
  1037. * @critical_events_in_flight: number of suspend-preventing events
  1038. * in flight
  1039. *
  1040. * This structure is the global wma context. It contains global wma
  1041. * module parameters and handles of other modules.
  1042. */
  1043. typedef struct {
  1044. void *wmi_handle;
  1045. void *cds_context;
  1046. void *mac_context;
  1047. struct wlan_objmgr_psoc *psoc;
  1048. struct wlan_objmgr_pdev *pdev;
  1049. qdf_event_t wma_resume_event;
  1050. qdf_event_t target_suspend;
  1051. qdf_event_t runtime_suspend;
  1052. qdf_event_t recovery_event;
  1053. uint16_t max_station;
  1054. uint16_t max_bssid;
  1055. uint8_t myaddr[IEEE80211_ADDR_LEN];
  1056. uint8_t hwaddr[IEEE80211_ADDR_LEN];
  1057. #ifdef WLAN_FEATURE_LPSS
  1058. uint8_t lpss_support;
  1059. #endif
  1060. uint8_t ap_arpns_support;
  1061. bool wmi_ready;
  1062. uint32_t wlan_init_status;
  1063. qdf_device_t qdf_dev;
  1064. uint32_t wmi_service_bitmap[WMI_SERVICE_BM_SIZE];
  1065. uint32_t wmi_service_ext_bitmap[WMI_SERVICE_SEGMENT_BM_SIZE32];
  1066. wma_tx_dwnld_comp_callback tx_frm_download_comp_cb;
  1067. qdf_event_t tx_frm_download_comp_event;
  1068. qdf_event_t tx_queue_empty_event;
  1069. wma_tx_ota_comp_callback
  1070. umac_ota_ack_cb[SIR_MAC_MGMT_RESERVED15];
  1071. wma_tx_ota_comp_callback umac_data_ota_ack_cb;
  1072. unsigned long last_umac_data_ota_timestamp;
  1073. qdf_nbuf_t last_umac_data_nbuf;
  1074. bool needShutdown;
  1075. wma_tgt_cfg_cb tgt_cfg_update_cb;
  1076. HAL_REG_CAPABILITIES reg_cap;
  1077. uint32_t scan_id;
  1078. struct wma_txrx_node *interfaces;
  1079. pdev_cli_config_t pdevconfig;
  1080. qdf_list_t vdev_resp_queue;
  1081. qdf_spinlock_t vdev_respq_lock;
  1082. qdf_list_t wma_hold_req_queue;
  1083. qdf_spinlock_t wma_hold_req_q_lock;
  1084. uint32_t vht_supp_mcs;
  1085. uint8_t is_fw_assert;
  1086. struct wma_wow wow;
  1087. uint8_t no_of_suspend_ind;
  1088. uint8_t no_of_resume_ind;
  1089. struct wma_tx_ack_work_ctx *ack_work_ctx;
  1090. uint8_t powersave_mode;
  1091. bool ptrn_match_enable_all_vdev;
  1092. void *pGetRssiReq;
  1093. bool get_one_peer_info;
  1094. bool get_sta_peer_info;
  1095. struct qdf_mac_addr peer_macaddr;
  1096. t_thermal_mgmt thermal_mgmt_info;
  1097. bool roam_offload_enabled;
  1098. bool ssdp;
  1099. bool enable_mc_list;
  1100. uint8_t ibss_started;
  1101. tSetBssKeyParams ibsskey_info;
  1102. txFailIndCallback hddTxFailCb;
  1103. #ifdef FEATURE_WLAN_EXTSCAN
  1104. qdf_wake_lock_t extscan_wake_lock;
  1105. #endif
  1106. qdf_wake_lock_t wow_wake_lock;
  1107. qdf_wake_lock_t wow_auth_req_wl;
  1108. qdf_wake_lock_t wow_assoc_req_wl;
  1109. qdf_wake_lock_t wow_deauth_rec_wl;
  1110. qdf_wake_lock_t wow_disassoc_rec_wl;
  1111. qdf_wake_lock_t wow_ap_assoc_lost_wl;
  1112. qdf_wake_lock_t wow_auto_shutdown_wl;
  1113. qdf_wake_lock_t roam_ho_wl;
  1114. int wow_nack;
  1115. qdf_atomic_t is_wow_bus_suspended;
  1116. qdf_mc_timer_t wma_scan_comp_timer;
  1117. bool suitable_ap_hb_failure;
  1118. uint32_t suitable_ap_hb_failure_rssi;
  1119. ibss_power_save_params wma_ibss_power_save_params;
  1120. #ifdef FEATURE_WLAN_RA_FILTERING
  1121. bool IsRArateLimitEnabled;
  1122. uint16_t RArateLimitInterval;
  1123. #endif
  1124. #ifdef WLAN_FEATURE_LPSS
  1125. bool is_lpass_enabled;
  1126. #endif
  1127. #ifdef WLAN_FEATURE_NAN
  1128. bool is_nan_enabled;
  1129. #endif
  1130. uint8_t staMaxLIModDtim;
  1131. uint8_t staModDtim;
  1132. uint8_t staDynamicDtim;
  1133. uint8_t enable_mhf_offload;
  1134. unsigned long last_mhf_entries_timestamp;
  1135. uint32_t hw_bd_id;
  1136. uint32_t hw_bd_info[HW_BD_INFO_SIZE];
  1137. uint32_t miracast_value;
  1138. qdf_mc_timer_t log_completion_timer;
  1139. uint32_t num_dbs_hw_modes;
  1140. struct dbs_hw_mode_info hw_mode;
  1141. uint32_t old_hw_mode_index;
  1142. uint32_t new_hw_mode_index;
  1143. wma_peer_authorized_fp peer_authorized_cb;
  1144. uint32_t wow_unspecified_wake_count;
  1145. struct sir_ocb_config *ocb_config_req;
  1146. uint8_t max_scan;
  1147. uint16_t self_gen_frm_pwr;
  1148. bool tx_chain_mask_cck;
  1149. qdf_mc_timer_t service_ready_ext_timer;
  1150. QDF_STATUS (*csr_roam_synch_cb)(tpAniSirGlobal mac,
  1151. roam_offload_synch_ind *roam_synch_data,
  1152. tpSirBssDescription bss_desc_ptr,
  1153. enum sir_roam_op_code reason);
  1154. QDF_STATUS (*pe_roam_synch_cb)(tpAniSirGlobal mac,
  1155. roam_offload_synch_ind *roam_synch_data,
  1156. tpSirBssDescription bss_desc_ptr,
  1157. enum sir_roam_op_code reason);
  1158. qdf_wake_lock_t wmi_cmd_rsp_wake_lock;
  1159. qdf_runtime_lock_t wmi_cmd_rsp_runtime_lock;
  1160. enum active_apf_mode active_uc_apf_mode;
  1161. enum active_apf_mode active_mc_bc_apf_mode;
  1162. struct wma_ini_config ini_config;
  1163. struct wma_valid_channels saved_chan;
  1164. bool nan_datapath_enabled;
  1165. QDF_STATUS (*pe_ndp_event_handler)(tpAniSirGlobal mac_ctx,
  1166. struct scheduler_msg *msg);
  1167. bool fw_timeout_crash;
  1168. bool sub_20_support;
  1169. bool is_dfs_offloaded;
  1170. tp_wma_packetdump_cb wma_mgmt_tx_packetdump_cb;
  1171. tp_wma_packetdump_cb wma_mgmt_rx_packetdump_cb;
  1172. bool rcpi_enabled;
  1173. tSirLLStatsResults *link_stats_results;
  1174. uint64_t tx_fail_cnt;
  1175. #ifdef WLAN_FEATURE_11AX
  1176. struct he_capability he_cap;
  1177. #endif
  1178. uint8_t bandcapability;
  1179. bool tx_bfee_8ss_enabled;
  1180. bool in_imps;
  1181. uint8_t ito_repeat_count;
  1182. qdf_mc_timer_t wma_fw_time_sync_timer;
  1183. qdf_atomic_t critical_events_in_flight;
  1184. } t_wma_handle, *tp_wma_handle;
  1185. extern void cds_wma_complete_cback(void);
  1186. extern void wma_send_regdomain_info_to_fw(uint32_t reg_dmn, uint16_t regdmn2G,
  1187. uint16_t regdmn5G, uint8_t ctl2G,
  1188. uint8_t ctl5G);
  1189. /**
  1190. * enum frame_index - Frame index
  1191. * @GENERIC_NODOWNLD_NOACK_COMP_INDEX: Frame index for no download comp no ack
  1192. * @GENERIC_DOWNLD_COMP_NOACK_COMP_INDEX: Frame index for download comp no ack
  1193. * @GENERIC_DOWNLD_COMP_ACK_COMP_INDEX: Frame index for download comp and ack
  1194. * @GENERIC_NODOWLOAD_ACK_COMP_INDEX: Frame index for no download comp and ack
  1195. * @FRAME_INDEX_MAX: maximum frame index
  1196. */
  1197. enum frame_index {
  1198. GENERIC_NODOWNLD_NOACK_COMP_INDEX,
  1199. GENERIC_DOWNLD_COMP_NOACK_COMP_INDEX,
  1200. GENERIC_DOWNLD_COMP_ACK_COMP_INDEX,
  1201. GENERIC_NODOWLOAD_ACK_COMP_INDEX,
  1202. FRAME_INDEX_MAX
  1203. };
  1204. /**
  1205. * struct wma_tx_ack_work_ctx - tx ack work context
  1206. * @wma_handle: wma handle
  1207. * @sub_type: sub type
  1208. * @status: status
  1209. * @ack_cmp_work: work structure
  1210. */
  1211. struct wma_tx_ack_work_ctx {
  1212. tp_wma_handle wma_handle;
  1213. uint16_t sub_type;
  1214. int32_t status;
  1215. qdf_work_t ack_cmp_work;
  1216. };
  1217. /**
  1218. * struct wma_target_req - target request parameters
  1219. * @event_timeout: event timeout
  1220. * @node: list
  1221. * @user_data: user data
  1222. * @msg_type: message type
  1223. * @vdev_id: vdev id
  1224. * @type: type
  1225. */
  1226. struct wma_target_req {
  1227. qdf_mc_timer_t event_timeout;
  1228. qdf_list_node_t node;
  1229. void *user_data;
  1230. uint32_t msg_type;
  1231. uint8_t vdev_id;
  1232. uint8_t type;
  1233. };
  1234. /**
  1235. * struct wma_vdev_start_req - vdev start request parameters
  1236. * @beacon_intval: beacon interval
  1237. * @dtim_period: dtim period
  1238. * @max_txpow: max tx power
  1239. * @chan_offset: channel offset
  1240. * @is_dfs: is dfs supported or not
  1241. * @vdev_id: vdev id
  1242. * @chan: channel
  1243. * @oper_mode: operating mode
  1244. * @ssid: ssid
  1245. * @hidden_ssid: hidden ssid
  1246. * @pmf_enabled: is pmf enabled or not
  1247. * @vht_capable: VHT capabality
  1248. * @ht_capable: HT capabality
  1249. * @dot11_mode: 802.11 mode
  1250. * @is_half_rate: is the channel operating at 10MHz
  1251. * @is_quarter_rate: is the channel operating at 5MHz
  1252. * @preferred_tx_streams: policy manager indicates the preferred
  1253. * number of transmit streams
  1254. * @preferred_rx_streams: policy manager indicates the preferred
  1255. * number of receive streams
  1256. * @beacon_tx_rate: beacon tx rate
  1257. * @he_capable: HE capability
  1258. * @he_ops: HE operation
  1259. * @cac_duration_ms: cac duration in milliseconds
  1260. * @dfs_regdomain: dfs region
  1261. */
  1262. struct wma_vdev_start_req {
  1263. uint32_t beacon_intval;
  1264. uint32_t dtim_period;
  1265. int32_t max_txpow;
  1266. enum phy_ch_width chan_width;
  1267. bool is_dfs;
  1268. uint8_t vdev_id;
  1269. uint8_t chan;
  1270. uint8_t oper_mode;
  1271. tSirMacSSid ssid;
  1272. uint8_t hidden_ssid;
  1273. uint8_t pmf_enabled;
  1274. uint8_t vht_capable;
  1275. uint8_t ch_center_freq_seg0;
  1276. uint8_t ch_center_freq_seg1;
  1277. uint8_t ht_capable;
  1278. uint8_t dot11_mode;
  1279. bool is_half_rate;
  1280. bool is_quarter_rate;
  1281. uint32_t preferred_tx_streams;
  1282. uint32_t preferred_rx_streams;
  1283. uint16_t beacon_tx_rate;
  1284. #ifdef WLAN_FEATURE_11AX
  1285. bool he_capable;
  1286. uint32_t he_ops;
  1287. #endif
  1288. uint32_t cac_duration_ms;
  1289. uint32_t dfs_regdomain;
  1290. };
  1291. /**
  1292. * struct wma_set_key_params - set key parameters
  1293. * @vdev_id: vdev id
  1294. * @def_key_idx: used to see if we have to read the key from cfg
  1295. * @key_len: key length
  1296. * @peer_mac: peer mac address
  1297. * @singl_tid_rc: 1=Single TID based Replay Count, 0=Per TID based RC
  1298. * @key_type: key type
  1299. * @key_idx: key index
  1300. * @unicast: unicast flag
  1301. * @key_data: key data
  1302. */
  1303. struct wma_set_key_params {
  1304. uint8_t vdev_id;
  1305. /* def_key_idx can be used to see if we have to read the key from cfg */
  1306. uint32_t def_key_idx;
  1307. uint16_t key_len;
  1308. uint8_t peer_mac[IEEE80211_ADDR_LEN];
  1309. uint8_t singl_tid_rc;
  1310. enum eAniEdType key_type;
  1311. uint32_t key_idx;
  1312. bool unicast;
  1313. uint8_t key_data[SIR_MAC_MAX_KEY_LENGTH];
  1314. uint8_t key_rsc[SIR_MAC_MAX_KEY_RSC_LEN];
  1315. };
  1316. /**
  1317. * struct t_thermal_cmd_params - thermal command parameters
  1318. * @minTemp: minimum temprature
  1319. * @maxTemp: maximum temprature
  1320. * @thermalEnable: thermal enable
  1321. */
  1322. typedef struct {
  1323. uint16_t minTemp;
  1324. uint16_t maxTemp;
  1325. uint8_t thermalEnable;
  1326. } t_thermal_cmd_params, *tp_thermal_cmd_params;
  1327. /**
  1328. * enum wma_cfg_cmd_id - wma cmd ids
  1329. * @WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID: txrx firmware stats enable command
  1330. * @WMA_VDEV_TXRX_FWSTATS_RESET_CMDID: txrx firmware stats reset command
  1331. * @WMA_VDEV_MCC_SET_TIME_LATENCY: set MCC latency time
  1332. * @WMA_VDEV_MCC_SET_TIME_QUOTA: set MCC time quota
  1333. * @WMA_VDEV_IBSS_SET_ATIM_WINDOW_SIZE: set IBSS ATIM window size
  1334. * @WMA_VDEV_IBSS_SET_POWER_SAVE_ALLOWED: set IBSS enable power save
  1335. * @WMA_VDEV_IBSS_SET_POWER_COLLAPSE_ALLOWED: set IBSS power collapse enable
  1336. * @WMA_VDEV_IBSS_SET_AWAKE_ON_TX_RX: awake IBSS on TX/RX
  1337. * @WMA_VDEV_IBSS_SET_INACTIVITY_TIME: set IBSS inactivity time
  1338. * @WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME: set IBSS TXSP
  1339. * @WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS: set IBSS power save warmup time
  1340. * @WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW: set IBSS power save ATIM
  1341. * @WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID: get IPA microcontroller fw stats
  1342. * @WMA_VDEV_TXRX_GET_IPA_UC_SHARING_STATS_CMDID: get IPA uC wifi-sharing stats
  1343. * @WMA_VDEV_TXRX_SET_IPA_UC_QUOTA_CMDID: set IPA uC quota limit
  1344. *
  1345. * wma command ids for configuration request which
  1346. * does not involve sending a wmi command.
  1347. */
  1348. enum wma_cfg_cmd_id {
  1349. WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID = WMI_CMDID_MAX,
  1350. WMA_VDEV_TXRX_FWSTATS_RESET_CMDID,
  1351. WMA_VDEV_MCC_SET_TIME_LATENCY,
  1352. WMA_VDEV_MCC_SET_TIME_QUOTA,
  1353. WMA_VDEV_IBSS_SET_ATIM_WINDOW_SIZE,
  1354. WMA_VDEV_IBSS_SET_POWER_SAVE_ALLOWED,
  1355. WMA_VDEV_IBSS_SET_POWER_COLLAPSE_ALLOWED,
  1356. WMA_VDEV_IBSS_SET_AWAKE_ON_TX_RX,
  1357. WMA_VDEV_IBSS_SET_INACTIVITY_TIME,
  1358. WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME,
  1359. WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS,
  1360. WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW,
  1361. WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID,
  1362. WMA_VDEV_TXRX_GET_IPA_UC_SHARING_STATS_CMDID,
  1363. WMA_VDEV_TXRX_SET_IPA_UC_QUOTA_CMDID,
  1364. WMA_CMD_ID_MAX
  1365. };
  1366. /**
  1367. * struct wma_trigger_uapsd_params - trigger uapsd parameters
  1368. * @wmm_ac: wmm access category
  1369. * @user_priority: user priority
  1370. * @service_interval: service interval
  1371. * @suspend_interval: suspend interval
  1372. * @delay_interval: delay interval
  1373. */
  1374. typedef struct wma_trigger_uapsd_params {
  1375. uint32_t wmm_ac;
  1376. uint32_t user_priority;
  1377. uint32_t service_interval;
  1378. uint32_t suspend_interval;
  1379. uint32_t delay_interval;
  1380. } t_wma_trigger_uapsd_params, *tp_wma_trigger_uapsd_params;
  1381. /**
  1382. * enum uapsd_peer_param_max_sp - U-APSD maximum service period of peer station
  1383. * @UAPSD_MAX_SP_LEN_UNLIMITED: unlimited max service period
  1384. * @UAPSD_MAX_SP_LEN_2: max service period = 2
  1385. * @UAPSD_MAX_SP_LEN_4: max service period = 4
  1386. * @UAPSD_MAX_SP_LEN_6: max service period = 6
  1387. */
  1388. enum uapsd_peer_param_max_sp {
  1389. UAPSD_MAX_SP_LEN_UNLIMITED = 0,
  1390. UAPSD_MAX_SP_LEN_2 = 2,
  1391. UAPSD_MAX_SP_LEN_4 = 4,
  1392. UAPSD_MAX_SP_LEN_6 = 6
  1393. };
  1394. /**
  1395. * enum uapsd_peer_param_enabled_ac - U-APSD Enabled AC's of peer station
  1396. * @UAPSD_VO_ENABLED: enable uapsd for voice
  1397. * @UAPSD_VI_ENABLED: enable uapsd for video
  1398. * @UAPSD_BK_ENABLED: enable uapsd for background
  1399. * @UAPSD_BE_ENABLED: enable uapsd for best effort
  1400. */
  1401. enum uapsd_peer_param_enabled_ac {
  1402. UAPSD_VO_ENABLED = 0x01,
  1403. UAPSD_VI_ENABLED = 0x02,
  1404. UAPSD_BK_ENABLED = 0x04,
  1405. UAPSD_BE_ENABLED = 0x08
  1406. };
  1407. /**
  1408. * enum profile_id_t - Firmware profiling index
  1409. * @PROF_CPU_IDLE: cpu idle profile
  1410. * @PROF_PPDU_PROC: ppdu processing profile
  1411. * @PROF_PPDU_POST: ppdu post profile
  1412. * @PROF_HTT_TX_INPUT: htt tx input profile
  1413. * @PROF_MSDU_ENQ: msdu enqueue profile
  1414. * @PROF_PPDU_POST_HAL: ppdu post profile
  1415. * @PROF_COMPUTE_TX_TIME: tx time profile
  1416. * @PROF_MAX_ID: max profile index
  1417. */
  1418. enum profile_id_t {
  1419. PROF_CPU_IDLE,
  1420. PROF_PPDU_PROC,
  1421. PROF_PPDU_POST,
  1422. PROF_HTT_TX_INPUT,
  1423. PROF_MSDU_ENQ,
  1424. PROF_PPDU_POST_HAL,
  1425. PROF_COMPUTE_TX_TIME,
  1426. PROF_MAX_ID,
  1427. };
  1428. /**
  1429. * struct p2p_ie - P2P IE structural definition.
  1430. * @p2p_id: p2p id
  1431. * @p2p_len: p2p length
  1432. * @p2p_oui: p2p OUI
  1433. * @p2p_oui_type: p2p OUI type
  1434. */
  1435. struct p2p_ie {
  1436. uint8_t p2p_id;
  1437. uint8_t p2p_len;
  1438. uint8_t p2p_oui[3];
  1439. uint8_t p2p_oui_type;
  1440. } __packed;
  1441. /**
  1442. * struct p2p_noa_descriptor - noa descriptor
  1443. * @type_count: 255: continuous schedule, 0: reserved
  1444. * @duration: Absent period duration in micro seconds
  1445. * @interval: Absent period interval in micro seconds
  1446. * @start_time: 32 bit tsf time when in starts
  1447. */
  1448. struct p2p_noa_descriptor {
  1449. uint8_t type_count;
  1450. uint32_t duration;
  1451. uint32_t interval;
  1452. uint32_t start_time;
  1453. } __packed;
  1454. /**
  1455. * struct p2p_sub_element_noa - p2p noa element
  1456. * @p2p_sub_id: p2p sub id
  1457. * @p2p_sub_len: p2p sub length
  1458. * @index: identifies instance of NOA su element
  1459. * @oppPS: oppPS state of the AP
  1460. * @ctwindow: ctwindow in TUs
  1461. * @num_descriptors: number of NOA descriptors
  1462. * @noa_descriptors: noa descriptors
  1463. */
  1464. struct p2p_sub_element_noa {
  1465. uint8_t p2p_sub_id;
  1466. uint8_t p2p_sub_len;
  1467. uint8_t index; /* identifies instance of NOA su element */
  1468. uint8_t oppPS:1, /* oppPS state of the AP */
  1469. ctwindow:7; /* ctwindow in TUs */
  1470. uint8_t num_descriptors; /* number of NOA descriptors */
  1471. struct p2p_noa_descriptor noa_descriptors[WMA_MAX_NOA_DESCRIPTORS];
  1472. };
  1473. /**
  1474. * struct wma_decap_info_t - decapsulation info
  1475. * @hdr: header
  1476. * @hdr_len: header length
  1477. */
  1478. struct wma_decap_info_t {
  1479. uint8_t hdr[sizeof(struct ieee80211_qosframe_addr4)];
  1480. int32_t hdr_len;
  1481. };
  1482. /**
  1483. * enum packet_power_save - packet power save params
  1484. * @WMI_VDEV_PPS_PAID_MATCH: paid match param
  1485. * @WMI_VDEV_PPS_GID_MATCH: gid match param
  1486. * @WMI_VDEV_PPS_EARLY_TIM_CLEAR: early tim clear param
  1487. * @WMI_VDEV_PPS_EARLY_DTIM_CLEAR: early dtim clear param
  1488. * @WMI_VDEV_PPS_EOF_PAD_DELIM: eof pad delim param
  1489. * @WMI_VDEV_PPS_MACADDR_MISMATCH: macaddr mismatch param
  1490. * @WMI_VDEV_PPS_DELIM_CRC_FAIL: delim CRC fail param
  1491. * @WMI_VDEV_PPS_GID_NSTS_ZERO: gid nsts zero param
  1492. * @WMI_VDEV_PPS_RSSI_CHECK: RSSI check param
  1493. * @WMI_VDEV_PPS_5G_EBT: 5G ebt param
  1494. */
  1495. typedef enum {
  1496. WMI_VDEV_PPS_PAID_MATCH = 0,
  1497. WMI_VDEV_PPS_GID_MATCH = 1,
  1498. WMI_VDEV_PPS_EARLY_TIM_CLEAR = 2,
  1499. WMI_VDEV_PPS_EARLY_DTIM_CLEAR = 3,
  1500. WMI_VDEV_PPS_EOF_PAD_DELIM = 4,
  1501. WMI_VDEV_PPS_MACADDR_MISMATCH = 5,
  1502. WMI_VDEV_PPS_DELIM_CRC_FAIL = 6,
  1503. WMI_VDEV_PPS_GID_NSTS_ZERO = 7,
  1504. WMI_VDEV_PPS_RSSI_CHECK = 8,
  1505. WMI_VDEV_VHT_SET_GID_MGMT = 9,
  1506. WMI_VDEV_PPS_5G_EBT = 10
  1507. } packet_power_save;
  1508. /**
  1509. * enum green_tx_param - green tx parameters
  1510. * @WMI_VDEV_PARAM_GTX_HT_MCS: ht mcs param
  1511. * @WMI_VDEV_PARAM_GTX_VHT_MCS: vht mcs param
  1512. * @WMI_VDEV_PARAM_GTX_USR_CFG: user cfg param
  1513. * @WMI_VDEV_PARAM_GTX_THRE: thre param
  1514. * @WMI_VDEV_PARAM_GTX_MARGIN: green tx margin param
  1515. * @WMI_VDEV_PARAM_GTX_STEP: green tx step param
  1516. * @WMI_VDEV_PARAM_GTX_MINTPC: mintpc param
  1517. * @WMI_VDEV_PARAM_GTX_BW_MASK: bandwidth mask
  1518. */
  1519. typedef enum {
  1520. WMI_VDEV_PARAM_GTX_HT_MCS,
  1521. WMI_VDEV_PARAM_GTX_VHT_MCS,
  1522. WMI_VDEV_PARAM_GTX_USR_CFG,
  1523. WMI_VDEV_PARAM_GTX_THRE,
  1524. WMI_VDEV_PARAM_GTX_MARGIN,
  1525. WMI_VDEV_PARAM_GTX_STEP,
  1526. WMI_VDEV_PARAM_GTX_MINTPC,
  1527. WMI_VDEV_PARAM_GTX_BW_MASK,
  1528. } green_tx_param;
  1529. /**
  1530. * enum uapsd_ac - U-APSD Access Categories
  1531. * @UAPSD_BE: best effort
  1532. * @UAPSD_BK: back ground
  1533. * @UAPSD_VI: video
  1534. * @UAPSD_VO: voice
  1535. */
  1536. enum uapsd_ac {
  1537. UAPSD_BE,
  1538. UAPSD_BK,
  1539. UAPSD_VI,
  1540. UAPSD_VO
  1541. };
  1542. QDF_STATUS wma_disable_uapsd_per_ac(tp_wma_handle wma_handle,
  1543. uint32_t vdev_id, enum uapsd_ac ac);
  1544. /**
  1545. * enum uapsd_up - U-APSD User Priorities
  1546. * @UAPSD_UP_BE: best effort
  1547. * @UAPSD_UP_BK: back ground
  1548. * @UAPSD_UP_RESV: reserve
  1549. * @UAPSD_UP_EE: Excellent Effort
  1550. * @UAPSD_UP_CL: Critical Applications
  1551. * @UAPSD_UP_VI: video
  1552. * @UAPSD_UP_VO: voice
  1553. * @UAPSD_UP_NC: Network Control
  1554. */
  1555. enum uapsd_up {
  1556. UAPSD_UP_BE,
  1557. UAPSD_UP_BK,
  1558. UAPSD_UP_RESV,
  1559. UAPSD_UP_EE,
  1560. UAPSD_UP_CL,
  1561. UAPSD_UP_VI,
  1562. UAPSD_UP_VO,
  1563. UAPSD_UP_NC,
  1564. UAPSD_UP_MAX
  1565. };
  1566. /**
  1567. * struct wma_roam_invoke_cmd - roam invoke command
  1568. * @vdev_id: vdev id
  1569. * @bssid: mac address
  1570. * @channel: channel
  1571. * @frame_len: frame length, includs mac header, fixed params and ies
  1572. * @frame_buf: buffer contaning probe response or beacon
  1573. * @is_same_bssid: flag to indicate if roaming is requested for same bssid
  1574. */
  1575. struct wma_roam_invoke_cmd {
  1576. uint32_t vdev_id;
  1577. uint8_t bssid[IEEE80211_ADDR_LEN];
  1578. uint32_t channel;
  1579. uint32_t frame_len;
  1580. uint8_t *frame_buf;
  1581. uint8_t is_same_bssid;
  1582. };
  1583. /**
  1584. * struct wma_process_fw_event_params - fw event parameters
  1585. * @wmi_handle: wmi handle
  1586. * @evt_buf: event buffer
  1587. */
  1588. typedef struct {
  1589. void *wmi_handle;
  1590. void *evt_buf;
  1591. } wma_process_fw_event_params;
  1592. int wma_process_fw_event_handler(void *ctx, void *ev, uint8_t rx_ctx);
  1593. A_UINT32 e_csr_auth_type_to_rsn_authmode(eCsrAuthType authtype,
  1594. eCsrEncryptionType encr);
  1595. A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
  1596. QDF_STATUS wma_trigger_uapsd_params(tp_wma_handle wma_handle, uint32_t vdev_id,
  1597. tp_wma_trigger_uapsd_params
  1598. trigger_uapsd_params);
  1599. /* added to get average snr for both data and beacon */
  1600. QDF_STATUS wma_send_snr_request(tp_wma_handle wma_handle, void *pGetRssiReq);
  1601. QDF_STATUS wma_update_vdev_tbl(tp_wma_handle wma_handle, uint8_t vdev_id,
  1602. void *tx_rx_vdev_handle,
  1603. uint8_t *mac, uint32_t vdev_type, bool add_del);
  1604. void wma_send_flush_logs_to_fw(tp_wma_handle wma_handle);
  1605. void wma_log_completion_timeout(void *data);
  1606. #ifdef FEATURE_RSSI_MONITOR
  1607. QDF_STATUS wma_set_rssi_monitoring(tp_wma_handle wma,
  1608. struct rssi_monitor_req *req);
  1609. #else /* FEATURE_RSSI_MONITOR */
  1610. static inline
  1611. QDF_STATUS wma_set_rssi_monitoring(tp_wma_handle wma,
  1612. struct rssi_monitor_req *req)
  1613. {
  1614. return QDF_STATUS_SUCCESS;
  1615. }
  1616. #endif /* FEATURE_RSSI_MONITOR */
  1617. QDF_STATUS wma_send_pdev_set_pcl_cmd(tp_wma_handle wma_handle,
  1618. struct set_pcl_req *msg);
  1619. QDF_STATUS wma_send_pdev_set_hw_mode_cmd(tp_wma_handle wma_handle,
  1620. struct policy_mgr_hw_mode *msg);
  1621. QDF_STATUS wma_send_pdev_set_dual_mac_config(tp_wma_handle wma_handle,
  1622. struct policy_mgr_dual_mac_config *msg);
  1623. QDF_STATUS wma_send_pdev_set_antenna_mode(tp_wma_handle wma_handle,
  1624. struct sir_antenna_mode_param *msg);
  1625. struct wma_target_req *wma_fill_vdev_req(tp_wma_handle wma,
  1626. uint8_t vdev_id,
  1627. uint32_t msg_type, uint8_t type,
  1628. void *params, uint32_t timeout);
  1629. struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma,
  1630. uint8_t vdev_id, uint32_t msg_type,
  1631. uint8_t type, void *params,
  1632. uint32_t timeout);
  1633. QDF_STATUS wma_vdev_start(tp_wma_handle wma,
  1634. struct wma_vdev_start_req *req, bool isRestart);
  1635. void wma_remove_vdev_req(tp_wma_handle wma, uint8_t vdev_id,
  1636. uint8_t type);
  1637. int wma_mgmt_tx_completion_handler(void *handle, uint8_t *cmpl_event_params,
  1638. uint32_t len);
  1639. int wma_mgmt_tx_bundle_completion_handler(void *handle,
  1640. uint8_t *cmpl_event_params, uint32_t len);
  1641. uint32_t wma_get_vht_ch_width(void);
  1642. QDF_STATUS
  1643. wma_config_debug_module_cmd(wmi_unified_t wmi_handle, A_UINT32 param,
  1644. A_UINT32 val, A_UINT32 *module_id_bitmap,
  1645. A_UINT32 bitmap_len);
  1646. #ifdef FEATURE_LFR_SUBNET_DETECTION
  1647. QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
  1648. struct gateway_param_update_req *req);
  1649. #else
  1650. static inline QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
  1651. struct gateway_param_update_req *req)
  1652. {
  1653. return QDF_STATUS_SUCCESS;
  1654. }
  1655. #endif /* FEATURE_LFR_SUBNET_DETECTION */
  1656. QDF_STATUS wma_lro_config_cmd(void *handle,
  1657. struct cdp_lro_hash_config *wma_lro_cmd);
  1658. void
  1659. wma_indicate_err(enum ol_rx_err_type err_type,
  1660. struct ol_error_info *err_info);
  1661. /**
  1662. * wma_rx_mic_error_ind() - indicate mic error to the protocol stack
  1663. * @scn_handle: pdev handle from osif layer
  1664. * @vdev_id: vdev id
  1665. * @wh: pointer to ieee80211_frame structure
  1666. *
  1667. * This function indicates TKIP MIC errors encountered in the RX data path
  1668. * to the protocol stack
  1669. *
  1670. * Return: none
  1671. */
  1672. void wma_rx_mic_error_ind(void *scn_handle, uint16_t vdev_id, void *wh);
  1673. QDF_STATUS wma_ht40_stop_obss_scan(tp_wma_handle wma_handle,
  1674. int32_t vdev_id);
  1675. void wma_process_fw_test_cmd(WMA_HANDLE handle,
  1676. struct set_fwtest_params *wma_fwtest);
  1677. QDF_STATUS wma_send_ht40_obss_scanind(tp_wma_handle wma,
  1678. struct obss_ht40_scanind *req);
  1679. uint32_t wma_get_num_of_setbits_from_bitmask(uint32_t mask);
  1680. #ifdef FEATURE_WLAN_APF
  1681. /**
  1682. * wma_get_apf_caps_event_handler() - Event handler for get apf capability
  1683. * @handle: WMA global handle
  1684. * @cmd_param_info: command event data
  1685. * @len: Length of @cmd_param_info
  1686. *
  1687. * Return: 0 on Success or Errno on failure
  1688. */
  1689. int wma_get_apf_caps_event_handler(void *handle,
  1690. u_int8_t *cmd_param_info,
  1691. u_int32_t len);
  1692. /**
  1693. * wma_get_apf_capabilities - Send get apf capability to firmware
  1694. * @wma_handle: wma handle
  1695. *
  1696. * Return: QDF_STATUS enumeration.
  1697. */
  1698. QDF_STATUS wma_get_apf_capabilities(tp_wma_handle wma);
  1699. /**
  1700. * wma_set_apf_instructions - Set apf instructions to firmware
  1701. * @wma: wma handle
  1702. * @apf_set_offload: APF offload information to set to firmware
  1703. *
  1704. * Return: QDF_STATUS enumeration
  1705. */
  1706. QDF_STATUS
  1707. wma_set_apf_instructions(tp_wma_handle wma,
  1708. struct sir_apf_set_offload *apf_set_offload);
  1709. /**
  1710. * wma_send_apf_enable_cmd - Send apf enable/disable cmd
  1711. * @wma_handle: wma handle
  1712. * @vdev_id: vdev id
  1713. * @apf_enable: true: Enable APF Int., false: Disable APF Int.
  1714. *
  1715. * Return: QDF_STATUS enumeration.
  1716. */
  1717. QDF_STATUS wma_send_apf_enable_cmd(WMA_HANDLE handle, uint8_t vdev_id,
  1718. bool apf_enable);
  1719. /**
  1720. * wma_send_apf_write_work_memory_cmd - Command to write into the apf work
  1721. * memory
  1722. * @wma_handle: wma handle
  1723. * @write_params: APF parameters for the write operation
  1724. *
  1725. * Return: QDF_STATUS enumeration.
  1726. */
  1727. QDF_STATUS
  1728. wma_send_apf_write_work_memory_cmd(WMA_HANDLE handle,
  1729. struct wmi_apf_write_memory_params
  1730. *write_params);
  1731. /**
  1732. * wma_send_apf_read_work_memory_cmd - Command to get part of apf work memory
  1733. * @wma_handle: wma handle
  1734. * @callback: HDD callback to receive apf get mem event
  1735. * @context: Context for the HDD callback
  1736. * @read_params: APF parameters for the get operation
  1737. *
  1738. * Return: QDF_STATUS enumeration.
  1739. */
  1740. QDF_STATUS
  1741. wma_send_apf_read_work_memory_cmd(WMA_HANDLE handle,
  1742. struct wmi_apf_read_memory_params
  1743. *read_params);
  1744. /**
  1745. * wma_apf_read_work_memory_event_handler - Event handler for get apf mem
  1746. * operation
  1747. * @handle: wma handle
  1748. * @evt_buf: Buffer pointer to the event
  1749. * @len: Length of the event buffer
  1750. *
  1751. * Return: status.
  1752. */
  1753. int wma_apf_read_work_memory_event_handler(void *handle, uint8_t *evt_buf,
  1754. uint32_t len);
  1755. #else /* FEATURE_WLAN_APF */
  1756. static inline QDF_STATUS wma_get_apf_capabilities(tp_wma_handle wma)
  1757. {
  1758. return QDF_STATUS_SUCCESS;
  1759. }
  1760. static inline QDF_STATUS
  1761. wma_set_apf_instructions(tp_wma_handle wma,
  1762. struct sir_apf_set_offload *apf_set_offload)
  1763. {
  1764. return QDF_STATUS_SUCCESS;
  1765. }
  1766. #endif /* FEATURE_WLAN_APF */
  1767. void wma_process_set_pdev_ie_req(tp_wma_handle wma,
  1768. struct set_ie_param *ie_params);
  1769. void wma_process_set_pdev_ht_ie_req(tp_wma_handle wma,
  1770. struct set_ie_param *ie_params);
  1771. void wma_process_set_pdev_vht_ie_req(tp_wma_handle wma,
  1772. struct set_ie_param *ie_params);
  1773. void wma_remove_peer(tp_wma_handle wma, u_int8_t *bssid,
  1774. u_int8_t vdev_id, void *peer,
  1775. bool roam_synch_in_progress);
  1776. QDF_STATUS wma_create_peer(tp_wma_handle wma, struct cdp_pdev *pdev,
  1777. struct cdp_vdev *vdev, u8 peer_addr[6],
  1778. u_int32_t peer_type, u_int8_t vdev_id,
  1779. bool roam_synch_in_progress);
  1780. /**
  1781. * wma_get_cca_stats() - send request to fw to get CCA
  1782. * @wmi_hdl: wma handle
  1783. * @vdev_id: vdev id
  1784. *
  1785. * Return: QDF status
  1786. */
  1787. QDF_STATUS wma_get_cca_stats(tp_wma_handle wma_handle,
  1788. uint8_t vdev_id);
  1789. struct wma_ini_config *wma_get_ini_handle(tp_wma_handle wma_handle);
  1790. WLAN_PHY_MODE wma_chan_phy_mode(u8 chan, enum phy_ch_width chan_width,
  1791. u8 dot11_mode);
  1792. #ifdef FEATURE_OEM_DATA_SUPPORT
  1793. QDF_STATUS wma_start_oem_data_req(tp_wma_handle wma_handle,
  1794. struct oem_data_req *oem_req);
  1795. #endif
  1796. QDF_STATUS wma_enable_disable_caevent_ind(tp_wma_handle wma_handle,
  1797. uint8_t val);
  1798. void wma_register_packetdump_callback(
  1799. tp_wma_packetdump_cb wma_mgmt_tx_packetdump_cb,
  1800. tp_wma_packetdump_cb wma_mgmt_rx_packetdump_cb);
  1801. void wma_deregister_packetdump_callback(void);
  1802. void wma_update_sta_inactivity_timeout(tp_wma_handle wma,
  1803. struct sme_sta_inactivity_timeout *sta_inactivity_timer);
  1804. /**
  1805. * wma_form_rx_packet() - form rx cds packet
  1806. * @buf: buffer
  1807. * @mgmt_rx_params: mgmt rx params
  1808. * @rx_pkt: cds packet
  1809. *
  1810. * This functions forms a cds packet from the rx mgmt frame received.
  1811. *
  1812. * Return: 0 for success or error code
  1813. */
  1814. int wma_form_rx_packet(qdf_nbuf_t buf,
  1815. struct mgmt_rx_event_params *mgmt_rx_params,
  1816. cds_pkt_t *rx_pkt);
  1817. /**
  1818. * wma_mgmt_unified_cmd_send() - send the mgmt tx packet
  1819. * @vdev: objmgr vdev
  1820. * @buf: buffer
  1821. * @desc_id: desc id
  1822. * @mgmt_tx_params: mgmt rx params
  1823. *
  1824. * This functions sends mgmt tx packet to WMI layer.
  1825. *
  1826. * Return: 0 for success or error code
  1827. */
  1828. QDF_STATUS wma_mgmt_unified_cmd_send(struct wlan_objmgr_vdev *vdev,
  1829. qdf_nbuf_t buf, uint32_t desc_id,
  1830. void *mgmt_tx_params);
  1831. /**
  1832. * wma_mgmt_nbuf_unmap_cb() - dma unmap for pending mgmt pkts
  1833. * @pdev: objmgr pdev
  1834. * @buf: buffer
  1835. *
  1836. * This function does the dma unmap of the pending mgmt packet cleanup
  1837. *
  1838. * Return: None
  1839. */
  1840. void wma_mgmt_nbuf_unmap_cb(struct wlan_objmgr_pdev *pdev,
  1841. qdf_nbuf_t buf);
  1842. /**
  1843. * wma_chan_info_event_handler() - chan info event handler
  1844. * @handle: wma handle
  1845. * @event_buf: event handler data
  1846. * @len: length of @event_buf
  1847. *
  1848. * this function will handle the WMI_CHAN_INFO_EVENTID
  1849. *
  1850. * Return: int
  1851. */
  1852. int wma_chan_info_event_handler(void *handle, uint8_t *event_buf,
  1853. uint32_t len);
  1854. #ifndef CONFIG_VDEV_SM
  1855. /**
  1856. * wma_vdev_set_mlme_state() - Set vdev mlme state
  1857. * @wma: wma handle
  1858. * @vdev_id: the Id of the vdev to configure
  1859. * @state: vdev state
  1860. *
  1861. * Return: None
  1862. */
  1863. static inline
  1864. void wma_vdev_set_mlme_state(tp_wma_handle wma, uint8_t vdev_id,
  1865. enum wlan_vdev_state state)
  1866. {
  1867. struct wlan_objmgr_vdev *vdev;
  1868. if (!wma) {
  1869. WMA_LOGE("%s: WMA context is invald!", __func__);
  1870. return;
  1871. }
  1872. vdev = wlan_objmgr_get_vdev_by_id_from_psoc(wma->psoc, vdev_id,
  1873. WLAN_LEGACY_WMA_ID);
  1874. if (vdev) {
  1875. wlan_vdev_obj_lock(vdev);
  1876. wlan_vdev_mlme_set_state(vdev, state);
  1877. wlan_vdev_obj_unlock(vdev);
  1878. wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_WMA_ID);
  1879. }
  1880. }
  1881. #endif
  1882. /**
  1883. * wma_update_vdev_pause_bitmap() - update vdev pause bitmap
  1884. * @vdev_id: the Id of the vdev to configure
  1885. * @value: value pause bitmap value
  1886. *
  1887. * Return: None
  1888. */
  1889. static inline
  1890. void wma_vdev_update_pause_bitmap(uint8_t vdev_id, uint16_t value)
  1891. {
  1892. tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
  1893. struct wma_txrx_node *iface;
  1894. if (!wma) {
  1895. WMA_LOGE("%s: WMA context is invald!", __func__);
  1896. return;
  1897. }
  1898. if (vdev_id >= wma->max_bssid) {
  1899. WMA_LOGE("%s: Invalid vdev_id: %d", __func__, vdev_id);
  1900. return;
  1901. }
  1902. iface = &wma->interfaces[vdev_id];
  1903. if (!iface) {
  1904. WMA_LOGE("%s: Failed to get iface: NULL",
  1905. __func__);
  1906. return;
  1907. }
  1908. if (!iface->handle) {
  1909. WMA_LOGE("%s: Failed to get iface handle: NULL",
  1910. __func__);
  1911. return;
  1912. }
  1913. iface->pause_bitmap = value;
  1914. }
  1915. /**
  1916. * wma_vdev_get_pause_bitmap() - Get vdev pause bitmap
  1917. * @vdev_id: the Id of the vdev to configure
  1918. *
  1919. * Return: Vdev pause bitmap value else 0 on error
  1920. */
  1921. static inline
  1922. uint16_t wma_vdev_get_pause_bitmap(uint8_t vdev_id)
  1923. {
  1924. tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
  1925. struct wma_txrx_node *iface;
  1926. if (!wma) {
  1927. WMA_LOGE("%s: WMA context is invald!", __func__);
  1928. return 0;
  1929. }
  1930. iface = &wma->interfaces[vdev_id];
  1931. if (!iface) {
  1932. WMA_LOGE("%s: Failed to get iface: NULL",
  1933. __func__);
  1934. return 0;
  1935. }
  1936. if (!iface->handle) {
  1937. WMA_LOGE("%s: Failed to get iface handle: NULL",
  1938. __func__);
  1939. return 0;
  1940. }
  1941. return iface->pause_bitmap;
  1942. }
  1943. /**
  1944. * wma_vdev_get_dp_handle() - Get vdev datapth handle
  1945. * @vdev_id: the Id of the vdev to configure
  1946. *
  1947. * Return: Vdev datapath handle else NULL on error
  1948. */
  1949. static inline
  1950. struct cdp_vdev *wma_vdev_get_vdev_dp_handle(uint8_t vdev_id)
  1951. {
  1952. tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
  1953. struct wma_txrx_node *iface;
  1954. if (!wma) {
  1955. WMA_LOGE("%s: WMA context is invald!", __func__);
  1956. return NULL;
  1957. }
  1958. if (vdev_id >= wma->max_bssid)
  1959. return NULL;
  1960. iface = &wma->interfaces[vdev_id];
  1961. if (!iface) {
  1962. WMA_LOGE("%s: Failed to get iface: NULL",
  1963. __func__);
  1964. return NULL;
  1965. }
  1966. return iface->handle;
  1967. }
  1968. /**
  1969. * wma_vdev_is_device_in_low_pwr_mode - is device in power save mode
  1970. * @vdev_id: the Id of the vdev to configure
  1971. *
  1972. * Return: true if device is in low power mode else false
  1973. */
  1974. static inline bool wma_vdev_is_device_in_low_pwr_mode(uint8_t vdev_id)
  1975. {
  1976. tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
  1977. struct wma_txrx_node *iface;
  1978. if (!wma) {
  1979. WMA_LOGE("%s: WMA context is invald!", __func__);
  1980. return 0;
  1981. }
  1982. iface = &wma->interfaces[vdev_id];
  1983. if (!iface) {
  1984. WMA_LOGE("%s: Failed to get iface: NULL",
  1985. __func__);
  1986. return 0;
  1987. }
  1988. if (!iface->handle) {
  1989. WMA_LOGE("%s: Failed to get iface handle:NULL",
  1990. __func__);
  1991. return 0;
  1992. }
  1993. return iface->in_bmps || wma->in_imps;
  1994. }
  1995. /**
  1996. * wma_vdev_get_cfg_int - Get cfg integer value
  1997. * @cfg_id: cfg item number
  1998. * @value: fill the out value
  1999. *
  2000. * Note caller must verify return status before using value
  2001. *
  2002. * Return: QDF_STATUS_SUCCESS when got item from cfg else QDF_STATUS_E_FAILURE
  2003. */
  2004. static inline
  2005. QDF_STATUS wma_vdev_get_cfg_int(int cfg_id, int *value)
  2006. {
  2007. struct sAniSirGlobal *mac = cds_get_context(QDF_MODULE_ID_PE);
  2008. *value = 0;
  2009. if (!mac)
  2010. return QDF_STATUS_E_FAILURE;
  2011. return wlan_cfg_get_int(mac, cfg_id, value);
  2012. }
  2013. /**
  2014. * wma_vdev_get_dtim_period - Get dtim period value from mlme
  2015. * @vdev_id: vdev index number
  2016. * @value: pointer to the value to fill out
  2017. *
  2018. * Note caller must verify return status before using value
  2019. *
  2020. * Return: QDF_STATUS_SUCCESS when fetched a valid value from cfg else
  2021. * QDF_STATUS_E_FAILURE
  2022. */
  2023. static inline
  2024. QDF_STATUS wma_vdev_get_dtim_period(uint8_t vdev_id, uint8_t *value)
  2025. {
  2026. tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
  2027. struct wma_txrx_node *iface;
  2028. /* set value to zero */
  2029. *value = 0;
  2030. if (!wma)
  2031. return QDF_STATUS_E_FAILURE;
  2032. iface = &wma->interfaces[vdev_id];
  2033. if (!iface || !iface->handle)
  2034. return QDF_STATUS_E_FAILURE;
  2035. *value = iface->dtimPeriod;
  2036. return QDF_STATUS_SUCCESS;
  2037. }
  2038. /**
  2039. * wma_vdev_get_beacon_interval - Get beacon interval from mlme
  2040. * @vdev_id: vdev index number
  2041. * @value: pointer to the value to fill out
  2042. *
  2043. * Note caller must verify return status before using value
  2044. *
  2045. * Return: QDF_STATUS_SUCCESS when fetched a valid value from cfg else
  2046. * QDF_STATUS_E_FAILURE
  2047. */
  2048. static inline
  2049. QDF_STATUS wma_vdev_get_beacon_interval(uint8_t vdev_id, uint16_t *value)
  2050. {
  2051. tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
  2052. struct wma_txrx_node *iface;
  2053. /* set value to zero */
  2054. *value = 0;
  2055. if (!wma)
  2056. return QDF_STATUS_E_FAILURE;
  2057. iface = &wma->interfaces[vdev_id];
  2058. if (!iface || !iface->handle)
  2059. return QDF_STATUS_E_FAILURE;
  2060. *value = iface->beaconInterval;
  2061. return QDF_STATUS_SUCCESS;
  2062. }
  2063. /**
  2064. * wma_vdev_set_pause_bit() - Set a bit in vdev pause bitmap
  2065. * @vdev_id: the Id of the vdev to configure
  2066. * @bit_pos: set bit position in pause bitmap
  2067. *
  2068. * Return: None
  2069. */
  2070. static inline
  2071. void wma_vdev_set_pause_bit(uint8_t vdev_id, wmi_tx_pause_type bit_pos)
  2072. {
  2073. tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
  2074. struct wma_txrx_node *iface;
  2075. if (!wma) {
  2076. WMA_LOGE("%s: WMA context is invald!", __func__);
  2077. return;
  2078. }
  2079. iface = &wma->interfaces[vdev_id];
  2080. if (!iface) {
  2081. WMA_LOGE("%s: Failed to get iface: NULL",
  2082. __func__);
  2083. return;
  2084. }
  2085. if (!iface->handle) {
  2086. WMA_LOGE("%s: Failed to get iface handle: NULL",
  2087. __func__);
  2088. return;
  2089. }
  2090. iface->pause_bitmap |= (1 << bit_pos);
  2091. }
  2092. /**
  2093. * wma_vdev_clear_pause_bit() - Clear a bit from vdev pause bitmap
  2094. * @vdev_id: the Id of the vdev to configure
  2095. * @bit_pos: set bit position in pause bitmap
  2096. *
  2097. * Return: None
  2098. */
  2099. static inline
  2100. void wma_vdev_clear_pause_bit(uint8_t vdev_id, wmi_tx_pause_type bit_pos)
  2101. {
  2102. tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
  2103. struct wma_txrx_node *iface;
  2104. if (!wma) {
  2105. WMA_LOGE("%s: WMA context is invald!", __func__);
  2106. return;
  2107. }
  2108. iface = &wma->interfaces[vdev_id];
  2109. if (!iface) {
  2110. WMA_LOGE("%s: Failed to get iface: NULL",
  2111. __func__);
  2112. return;
  2113. }
  2114. if (!iface->handle) {
  2115. WMA_LOGE("%s: Failed to get iface handle: NULL",
  2116. __func__);
  2117. return;
  2118. }
  2119. iface->pause_bitmap &= ~(1 << bit_pos);
  2120. }
  2121. /**
  2122. * wma_process_roaming_config() - process roam request
  2123. * @wma_handle: wma handle
  2124. * @roam_req: roam request parameters
  2125. *
  2126. * Main routine to handle ROAM commands coming from CSR module.
  2127. *
  2128. * Return: QDF status
  2129. */
  2130. QDF_STATUS wma_process_roaming_config(tp_wma_handle wma_handle,
  2131. tSirRoamOffloadScanReq *roam_req);
  2132. #ifdef WMI_INTERFACE_EVENT_LOGGING
  2133. static inline void wma_print_wmi_cmd_log(uint32_t count,
  2134. qdf_abstract_print *print,
  2135. void *print_priv)
  2136. {
  2137. t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
  2138. if (wma) {
  2139. print(print_priv, "Command Log (count %u)", count);
  2140. wmi_print_cmd_log(wma->wmi_handle, count, print, print_priv);
  2141. }
  2142. }
  2143. static inline void wma_print_wmi_cmd_tx_cmp_log(uint32_t count,
  2144. qdf_abstract_print *print,
  2145. void *print_priv)
  2146. {
  2147. t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
  2148. if (wma) {
  2149. print(print_priv, "Command Tx Complete Log (count %u)", count);
  2150. wmi_print_cmd_tx_cmp_log(wma->wmi_handle, count, print,
  2151. print_priv);
  2152. }
  2153. }
  2154. static inline void wma_print_wmi_mgmt_cmd_log(uint32_t count,
  2155. qdf_abstract_print *print,
  2156. void *print_priv)
  2157. {
  2158. t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
  2159. if (wma) {
  2160. print(print_priv, "Management Command Log (count %u)", count);
  2161. wmi_print_mgmt_cmd_log(wma->wmi_handle, count, print,
  2162. print_priv);
  2163. }
  2164. }
  2165. static inline void wma_print_wmi_mgmt_cmd_tx_cmp_log(uint32_t count,
  2166. qdf_abstract_print *print,
  2167. void *print_priv)
  2168. {
  2169. t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
  2170. if (wma) {
  2171. print(print_priv,
  2172. "Management Command Tx Complete Log (count %u)", count);
  2173. wmi_print_mgmt_cmd_tx_cmp_log(wma->wmi_handle, count, print,
  2174. print_priv);
  2175. }
  2176. }
  2177. static inline void wma_print_wmi_event_log(uint32_t count,
  2178. qdf_abstract_print *print,
  2179. void *print_priv)
  2180. {
  2181. t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
  2182. if (wma) {
  2183. print(print_priv, "Event Log (count %u)", count);
  2184. wmi_print_event_log(wma->wmi_handle, count, print, print_priv);
  2185. }
  2186. }
  2187. static inline void wma_print_wmi_rx_event_log(uint32_t count,
  2188. qdf_abstract_print *print,
  2189. void *print_priv)
  2190. {
  2191. t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
  2192. if (wma) {
  2193. print(print_priv, "Rx Event Log (count %u)", count);
  2194. wmi_print_rx_event_log(wma->wmi_handle, count, print,
  2195. print_priv);
  2196. }
  2197. }
  2198. static inline void wma_print_wmi_mgmt_event_log(uint32_t count,
  2199. qdf_abstract_print *print,
  2200. void *print_priv)
  2201. {
  2202. t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
  2203. if (wma) {
  2204. print(print_priv, "Management Event Log (count %u)", count);
  2205. wmi_print_mgmt_event_log(wma->wmi_handle, count, print,
  2206. print_priv);
  2207. }
  2208. }
  2209. #else
  2210. static inline void wma_print_wmi_cmd_log(uint32_t count,
  2211. qdf_abstract_print *print,
  2212. void *print_priv)
  2213. {
  2214. }
  2215. static inline void wma_print_wmi_cmd_tx_cmp_log(uint32_t count,
  2216. qdf_abstract_print *print,
  2217. void *print_priv)
  2218. {
  2219. }
  2220. static inline void wma_print_wmi_mgmt_cmd_log(uint32_t count,
  2221. qdf_abstract_print *print,
  2222. void *print_priv)
  2223. {
  2224. }
  2225. static inline void wma_print_wmi_mgmt_cmd_tx_cmp_log(uint32_t count,
  2226. qdf_abstract_print *print,
  2227. void *print_priv)
  2228. {
  2229. }
  2230. static inline void wma_print_wmi_event_log(uint32_t count,
  2231. qdf_abstract_print *print,
  2232. void *print_priv)
  2233. {
  2234. }
  2235. static inline void wma_print_wmi_rx_event_log(uint32_t count,
  2236. qdf_abstract_print *print,
  2237. void *print_priv)
  2238. {
  2239. }
  2240. static inline void wma_print_wmi_mgmt_event_log(uint32_t count,
  2241. qdf_abstract_print *print,
  2242. void *print_priv)
  2243. {
  2244. }
  2245. #endif /* WMI_INTERFACE_EVENT_LOGGING */
  2246. /**
  2247. * wma_ipa_uc_stat_request() - set ipa config parameters
  2248. * @privcmd: private command
  2249. *
  2250. * Return: None
  2251. */
  2252. void wma_ipa_uc_stat_request(wma_cli_set_cmd_t *privcmd);
  2253. /**
  2254. * wma_set_rx_reorder_timeout_val() - set rx recorder timeout value
  2255. * @wma_handle: pointer to wma handle
  2256. * @reorder_timeout: rx reorder timeout value
  2257. *
  2258. * Return: VOS_STATUS_SUCCESS for success or error code.
  2259. */
  2260. QDF_STATUS wma_set_rx_reorder_timeout_val(tp_wma_handle wma_handle,
  2261. struct sir_set_rx_reorder_timeout_val *reorder_timeout);
  2262. /**
  2263. * wma_set_rx_blocksize() - set rx blocksize
  2264. * @wma_handle: pointer to wma handle
  2265. * @peer_rx_blocksize: rx blocksize for peer mac
  2266. *
  2267. * Return: QDF_STATUS_SUCCESS for success or error code.
  2268. */
  2269. QDF_STATUS wma_set_rx_blocksize(tp_wma_handle wma_handle,
  2270. struct sir_peer_set_rx_blocksize *peer_rx_blocksize);
  2271. /**
  2272. * wma_configure_smps_params() - Configures the smps parameters to set
  2273. * @vdev_id: Virtual device for the command
  2274. * @param_id: SMPS parameter ID
  2275. * @param_val: Value to be set for the parameter
  2276. * Return: QDF_STATUS_SUCCESS or non-zero on failure
  2277. */
  2278. QDF_STATUS wma_configure_smps_params(uint32_t vdev_id, uint32_t param_id,
  2279. uint32_t param_val);
  2280. /*
  2281. * wma_chip_power_save_failure_detected_handler() - chip pwr save fail detected
  2282. * event handler
  2283. * @handle: wma handle
  2284. * @cmd_param_info: event handler data
  2285. * @len: length of @cmd_param_info
  2286. *
  2287. * Return: QDF_STATUS_SUCCESS on success; error code otherwise
  2288. */
  2289. int wma_chip_power_save_failure_detected_handler(void *handle,
  2290. uint8_t *cmd_param_info,
  2291. uint32_t len);
  2292. /**
  2293. * wma_get_chain_rssi() - send wmi cmd to get chain rssi
  2294. * @wma_handle: wma handler
  2295. * @req_params: requset params
  2296. *
  2297. * Return: Return QDF_STATUS
  2298. */
  2299. QDF_STATUS wma_get_chain_rssi(tp_wma_handle wma_handle,
  2300. struct get_chain_rssi_req_params *req_params);
  2301. /**
  2302. * wma_config_bmiss_bcnt_params() - set bmiss config parameters
  2303. * @vdev_id: virtual device for the command
  2304. * @first_cnt: bmiss first value
  2305. * @final_cnt: bmiss final value
  2306. *
  2307. * Return: QDF_STATUS_SUCCESS or non-zero on failure
  2308. */
  2309. QDF_STATUS wma_config_bmiss_bcnt_params(uint32_t vdev_id, uint32_t first_cnt,
  2310. uint32_t final_cnt);
  2311. /**
  2312. * wma_check_and_set_wake_timer(): checks all interfaces and if any interface
  2313. * has install_key pending, sets timer pattern in fw to wake up host after
  2314. * specified time has elapsed.
  2315. * @time: time after which host wants to be awaken.
  2316. *
  2317. * Return: None
  2318. */
  2319. void wma_check_and_set_wake_timer(uint32_t time);
  2320. /**
  2321. * wma_rx_invalid_peer_ind(): the callback for DP to notify WMA layer
  2322. * invalid peer data is received, this function will send message to
  2323. * lim module.
  2324. * @vdev_id: virtual device ID
  2325. * @wh: Pointer to 802.11 frame header
  2326. *
  2327. * Return: 0 for success or non-zero on failure
  2328. */
  2329. uint8_t wma_rx_invalid_peer_ind(uint8_t vdev_id, void *wh);
  2330. #endif