trace.h 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409
  1. #if !defined(__MAC80211_DRIVER_TRACE) || defined(TRACE_HEADER_MULTI_READ)
  2. #define __MAC80211_DRIVER_TRACE
  3. #include <linux/tracepoint.h>
  4. #include <net/mac80211.h>
  5. #include "ieee80211_i.h"
  6. #undef TRACE_SYSTEM
  7. #define TRACE_SYSTEM mac80211
  8. #define MAXNAME 32
  9. #define LOCAL_ENTRY __array(char, wiphy_name, 32)
  10. #define LOCAL_ASSIGN strlcpy(__entry->wiphy_name, wiphy_name(local->hw.wiphy), MAXNAME)
  11. #define LOCAL_PR_FMT "%s"
  12. #define LOCAL_PR_ARG __entry->wiphy_name
  13. #define STA_ENTRY __array(char, sta_addr, ETH_ALEN)
  14. #define STA_ASSIGN (sta ? memcpy(__entry->sta_addr, sta->addr, ETH_ALEN) : memset(__entry->sta_addr, 0, ETH_ALEN))
  15. #define STA_NAMED_ASSIGN(s) memcpy(__entry->sta_addr, (s)->addr, ETH_ALEN)
  16. #define STA_PR_FMT " sta:%pM"
  17. #define STA_PR_ARG __entry->sta_addr
  18. #define VIF_ENTRY __field(enum nl80211_iftype, vif_type) __field(void *, sdata) \
  19. __field(bool, p2p) \
  20. __string(vif_name, sdata->name)
  21. #define VIF_ASSIGN __entry->vif_type = sdata->vif.type; __entry->sdata = sdata; \
  22. __entry->p2p = sdata->vif.p2p; \
  23. __assign_str(vif_name, sdata->name)
  24. #define VIF_PR_FMT " vif:%s(%d%s)"
  25. #define VIF_PR_ARG __get_str(vif_name), __entry->vif_type, __entry->p2p ? "/p2p" : ""
  26. #define CHANDEF_ENTRY __field(u32, control_freq) \
  27. __field(u32, chan_width) \
  28. __field(u32, center_freq1) \
  29. __field(u32, center_freq2)
  30. #define CHANDEF_ASSIGN(c) \
  31. __entry->control_freq = (c) ? ((c)->chan ? (c)->chan->center_freq : 0) : 0; \
  32. __entry->chan_width = (c) ? (c)->width : 0; \
  33. __entry->center_freq1 = (c) ? (c)->center_freq1 : 0; \
  34. __entry->center_freq2 = (c) ? (c)->center_freq2 : 0;
  35. #define CHANDEF_PR_FMT " control:%d MHz width:%d center: %d/%d MHz"
  36. #define CHANDEF_PR_ARG __entry->control_freq, __entry->chan_width, \
  37. __entry->center_freq1, __entry->center_freq2
  38. #define MIN_CHANDEF_ENTRY \
  39. __field(u32, min_control_freq) \
  40. __field(u32, min_chan_width) \
  41. __field(u32, min_center_freq1) \
  42. __field(u32, min_center_freq2)
  43. #define MIN_CHANDEF_ASSIGN(c) \
  44. __entry->min_control_freq = (c)->chan ? (c)->chan->center_freq : 0; \
  45. __entry->min_chan_width = (c)->width; \
  46. __entry->min_center_freq1 = (c)->center_freq1; \
  47. __entry->min_center_freq2 = (c)->center_freq2;
  48. #define MIN_CHANDEF_PR_FMT " min_control:%d MHz min_width:%d min_center: %d/%d MHz"
  49. #define MIN_CHANDEF_PR_ARG __entry->min_control_freq, __entry->min_chan_width, \
  50. __entry->min_center_freq1, __entry->min_center_freq2
  51. #define CHANCTX_ENTRY CHANDEF_ENTRY \
  52. MIN_CHANDEF_ENTRY \
  53. __field(u8, rx_chains_static) \
  54. __field(u8, rx_chains_dynamic)
  55. #define CHANCTX_ASSIGN CHANDEF_ASSIGN(&ctx->conf.def) \
  56. MIN_CHANDEF_ASSIGN(&ctx->conf.min_def) \
  57. __entry->rx_chains_static = ctx->conf.rx_chains_static; \
  58. __entry->rx_chains_dynamic = ctx->conf.rx_chains_dynamic
  59. #define CHANCTX_PR_FMT CHANDEF_PR_FMT MIN_CHANDEF_PR_FMT " chains:%d/%d"
  60. #define CHANCTX_PR_ARG CHANDEF_PR_ARG, MIN_CHANDEF_PR_ARG, \
  61. __entry->rx_chains_static, __entry->rx_chains_dynamic
  62. #define KEY_ENTRY __field(u32, cipher) \
  63. __field(u8, hw_key_idx) \
  64. __field(u8, flags) \
  65. __field(s8, keyidx)
  66. #define KEY_ASSIGN(k) __entry->cipher = (k)->cipher; \
  67. __entry->flags = (k)->flags; \
  68. __entry->keyidx = (k)->keyidx; \
  69. __entry->hw_key_idx = (k)->hw_key_idx;
  70. #define KEY_PR_FMT " cipher:0x%x, flags=%#x, keyidx=%d, hw_key_idx=%d"
  71. #define KEY_PR_ARG __entry->cipher, __entry->flags, __entry->keyidx, __entry->hw_key_idx
  72. /*
  73. * Tracing for driver callbacks.
  74. */
  75. DECLARE_EVENT_CLASS(local_only_evt,
  76. TP_PROTO(struct ieee80211_local *local),
  77. TP_ARGS(local),
  78. TP_STRUCT__entry(
  79. LOCAL_ENTRY
  80. ),
  81. TP_fast_assign(
  82. LOCAL_ASSIGN;
  83. ),
  84. TP_printk(LOCAL_PR_FMT, LOCAL_PR_ARG)
  85. );
  86. DECLARE_EVENT_CLASS(local_sdata_addr_evt,
  87. TP_PROTO(struct ieee80211_local *local,
  88. struct ieee80211_sub_if_data *sdata),
  89. TP_ARGS(local, sdata),
  90. TP_STRUCT__entry(
  91. LOCAL_ENTRY
  92. VIF_ENTRY
  93. __array(char, addr, ETH_ALEN)
  94. ),
  95. TP_fast_assign(
  96. LOCAL_ASSIGN;
  97. VIF_ASSIGN;
  98. memcpy(__entry->addr, sdata->vif.addr, ETH_ALEN);
  99. ),
  100. TP_printk(
  101. LOCAL_PR_FMT VIF_PR_FMT " addr:%pM",
  102. LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr
  103. )
  104. );
  105. DECLARE_EVENT_CLASS(local_u32_evt,
  106. TP_PROTO(struct ieee80211_local *local, u32 value),
  107. TP_ARGS(local, value),
  108. TP_STRUCT__entry(
  109. LOCAL_ENTRY
  110. __field(u32, value)
  111. ),
  112. TP_fast_assign(
  113. LOCAL_ASSIGN;
  114. __entry->value = value;
  115. ),
  116. TP_printk(
  117. LOCAL_PR_FMT " value:%d",
  118. LOCAL_PR_ARG, __entry->value
  119. )
  120. );
  121. DECLARE_EVENT_CLASS(local_sdata_evt,
  122. TP_PROTO(struct ieee80211_local *local,
  123. struct ieee80211_sub_if_data *sdata),
  124. TP_ARGS(local, sdata),
  125. TP_STRUCT__entry(
  126. LOCAL_ENTRY
  127. VIF_ENTRY
  128. ),
  129. TP_fast_assign(
  130. LOCAL_ASSIGN;
  131. VIF_ASSIGN;
  132. ),
  133. TP_printk(
  134. LOCAL_PR_FMT VIF_PR_FMT,
  135. LOCAL_PR_ARG, VIF_PR_ARG
  136. )
  137. );
  138. DEFINE_EVENT(local_only_evt, drv_return_void,
  139. TP_PROTO(struct ieee80211_local *local),
  140. TP_ARGS(local)
  141. );
  142. TRACE_EVENT(drv_return_int,
  143. TP_PROTO(struct ieee80211_local *local, int ret),
  144. TP_ARGS(local, ret),
  145. TP_STRUCT__entry(
  146. LOCAL_ENTRY
  147. __field(int, ret)
  148. ),
  149. TP_fast_assign(
  150. LOCAL_ASSIGN;
  151. __entry->ret = ret;
  152. ),
  153. TP_printk(LOCAL_PR_FMT " - %d", LOCAL_PR_ARG, __entry->ret)
  154. );
  155. TRACE_EVENT(drv_return_bool,
  156. TP_PROTO(struct ieee80211_local *local, bool ret),
  157. TP_ARGS(local, ret),
  158. TP_STRUCT__entry(
  159. LOCAL_ENTRY
  160. __field(bool, ret)
  161. ),
  162. TP_fast_assign(
  163. LOCAL_ASSIGN;
  164. __entry->ret = ret;
  165. ),
  166. TP_printk(LOCAL_PR_FMT " - %s", LOCAL_PR_ARG, (__entry->ret) ?
  167. "true" : "false")
  168. );
  169. TRACE_EVENT(drv_return_u32,
  170. TP_PROTO(struct ieee80211_local *local, u32 ret),
  171. TP_ARGS(local, ret),
  172. TP_STRUCT__entry(
  173. LOCAL_ENTRY
  174. __field(u32, ret)
  175. ),
  176. TP_fast_assign(
  177. LOCAL_ASSIGN;
  178. __entry->ret = ret;
  179. ),
  180. TP_printk(LOCAL_PR_FMT " - %u", LOCAL_PR_ARG, __entry->ret)
  181. );
  182. TRACE_EVENT(drv_return_u64,
  183. TP_PROTO(struct ieee80211_local *local, u64 ret),
  184. TP_ARGS(local, ret),
  185. TP_STRUCT__entry(
  186. LOCAL_ENTRY
  187. __field(u64, ret)
  188. ),
  189. TP_fast_assign(
  190. LOCAL_ASSIGN;
  191. __entry->ret = ret;
  192. ),
  193. TP_printk(LOCAL_PR_FMT " - %llu", LOCAL_PR_ARG, __entry->ret)
  194. );
  195. DEFINE_EVENT(local_only_evt, drv_start,
  196. TP_PROTO(struct ieee80211_local *local),
  197. TP_ARGS(local)
  198. );
  199. DEFINE_EVENT(local_u32_evt, drv_get_et_strings,
  200. TP_PROTO(struct ieee80211_local *local, u32 sset),
  201. TP_ARGS(local, sset)
  202. );
  203. DEFINE_EVENT(local_u32_evt, drv_get_et_sset_count,
  204. TP_PROTO(struct ieee80211_local *local, u32 sset),
  205. TP_ARGS(local, sset)
  206. );
  207. DEFINE_EVENT(local_only_evt, drv_get_et_stats,
  208. TP_PROTO(struct ieee80211_local *local),
  209. TP_ARGS(local)
  210. );
  211. DEFINE_EVENT(local_only_evt, drv_suspend,
  212. TP_PROTO(struct ieee80211_local *local),
  213. TP_ARGS(local)
  214. );
  215. DEFINE_EVENT(local_only_evt, drv_resume,
  216. TP_PROTO(struct ieee80211_local *local),
  217. TP_ARGS(local)
  218. );
  219. TRACE_EVENT(drv_set_wakeup,
  220. TP_PROTO(struct ieee80211_local *local, bool enabled),
  221. TP_ARGS(local, enabled),
  222. TP_STRUCT__entry(
  223. LOCAL_ENTRY
  224. __field(bool, enabled)
  225. ),
  226. TP_fast_assign(
  227. LOCAL_ASSIGN;
  228. __entry->enabled = enabled;
  229. ),
  230. TP_printk(LOCAL_PR_FMT " enabled:%d", LOCAL_PR_ARG, __entry->enabled)
  231. );
  232. DEFINE_EVENT(local_only_evt, drv_stop,
  233. TP_PROTO(struct ieee80211_local *local),
  234. TP_ARGS(local)
  235. );
  236. DEFINE_EVENT(local_sdata_addr_evt, drv_add_interface,
  237. TP_PROTO(struct ieee80211_local *local,
  238. struct ieee80211_sub_if_data *sdata),
  239. TP_ARGS(local, sdata)
  240. );
  241. TRACE_EVENT(drv_change_interface,
  242. TP_PROTO(struct ieee80211_local *local,
  243. struct ieee80211_sub_if_data *sdata,
  244. enum nl80211_iftype type, bool p2p),
  245. TP_ARGS(local, sdata, type, p2p),
  246. TP_STRUCT__entry(
  247. LOCAL_ENTRY
  248. VIF_ENTRY
  249. __field(u32, new_type)
  250. __field(bool, new_p2p)
  251. ),
  252. TP_fast_assign(
  253. LOCAL_ASSIGN;
  254. VIF_ASSIGN;
  255. __entry->new_type = type;
  256. __entry->new_p2p = p2p;
  257. ),
  258. TP_printk(
  259. LOCAL_PR_FMT VIF_PR_FMT " new type:%d%s",
  260. LOCAL_PR_ARG, VIF_PR_ARG, __entry->new_type,
  261. __entry->new_p2p ? "/p2p" : ""
  262. )
  263. );
  264. DEFINE_EVENT(local_sdata_addr_evt, drv_remove_interface,
  265. TP_PROTO(struct ieee80211_local *local,
  266. struct ieee80211_sub_if_data *sdata),
  267. TP_ARGS(local, sdata)
  268. );
  269. TRACE_EVENT(drv_config,
  270. TP_PROTO(struct ieee80211_local *local,
  271. u32 changed),
  272. TP_ARGS(local, changed),
  273. TP_STRUCT__entry(
  274. LOCAL_ENTRY
  275. __field(u32, changed)
  276. __field(u32, flags)
  277. __field(int, power_level)
  278. __field(int, dynamic_ps_timeout)
  279. __field(u16, listen_interval)
  280. __field(u8, long_frame_max_tx_count)
  281. __field(u8, short_frame_max_tx_count)
  282. CHANDEF_ENTRY
  283. __field(int, smps)
  284. ),
  285. TP_fast_assign(
  286. LOCAL_ASSIGN;
  287. __entry->changed = changed;
  288. __entry->flags = local->hw.conf.flags;
  289. __entry->power_level = local->hw.conf.power_level;
  290. __entry->dynamic_ps_timeout = local->hw.conf.dynamic_ps_timeout;
  291. __entry->listen_interval = local->hw.conf.listen_interval;
  292. __entry->long_frame_max_tx_count =
  293. local->hw.conf.long_frame_max_tx_count;
  294. __entry->short_frame_max_tx_count =
  295. local->hw.conf.short_frame_max_tx_count;
  296. CHANDEF_ASSIGN(&local->hw.conf.chandef)
  297. __entry->smps = local->hw.conf.smps_mode;
  298. ),
  299. TP_printk(
  300. LOCAL_PR_FMT " ch:%#x" CHANDEF_PR_FMT,
  301. LOCAL_PR_ARG, __entry->changed, CHANDEF_PR_ARG
  302. )
  303. );
  304. TRACE_EVENT(drv_bss_info_changed,
  305. TP_PROTO(struct ieee80211_local *local,
  306. struct ieee80211_sub_if_data *sdata,
  307. struct ieee80211_bss_conf *info,
  308. u32 changed),
  309. TP_ARGS(local, sdata, info, changed),
  310. TP_STRUCT__entry(
  311. LOCAL_ENTRY
  312. VIF_ENTRY
  313. __field(u32, changed)
  314. __field(bool, assoc)
  315. __field(bool, ibss_joined)
  316. __field(bool, ibss_creator)
  317. __field(u16, aid)
  318. __field(bool, cts)
  319. __field(bool, shortpre)
  320. __field(bool, shortslot)
  321. __field(bool, enable_beacon)
  322. __field(u8, dtimper)
  323. __field(u16, bcnint)
  324. __field(u16, assoc_cap)
  325. __field(u64, sync_tsf)
  326. __field(u32, sync_device_ts)
  327. __field(u8, sync_dtim_count)
  328. __field(u32, basic_rates)
  329. __array(int, mcast_rate, IEEE80211_NUM_BANDS)
  330. __field(u16, ht_operation_mode)
  331. __field(s32, cqm_rssi_thold);
  332. __field(s32, cqm_rssi_hyst);
  333. __field(u32, channel_width);
  334. __field(u32, channel_cfreq1);
  335. __dynamic_array(u32, arp_addr_list,
  336. info->arp_addr_cnt > IEEE80211_BSS_ARP_ADDR_LIST_LEN ?
  337. IEEE80211_BSS_ARP_ADDR_LIST_LEN :
  338. info->arp_addr_cnt);
  339. __field(int, arp_addr_cnt);
  340. __field(bool, qos);
  341. __field(bool, idle);
  342. __field(bool, ps);
  343. __dynamic_array(u8, ssid, info->ssid_len);
  344. __field(bool, hidden_ssid);
  345. __field(int, txpower)
  346. __field(u8, p2p_oppps_ctwindow)
  347. ),
  348. TP_fast_assign(
  349. LOCAL_ASSIGN;
  350. VIF_ASSIGN;
  351. __entry->changed = changed;
  352. __entry->aid = info->aid;
  353. __entry->assoc = info->assoc;
  354. __entry->ibss_joined = info->ibss_joined;
  355. __entry->ibss_creator = info->ibss_creator;
  356. __entry->shortpre = info->use_short_preamble;
  357. __entry->cts = info->use_cts_prot;
  358. __entry->shortslot = info->use_short_slot;
  359. __entry->enable_beacon = info->enable_beacon;
  360. __entry->dtimper = info->dtim_period;
  361. __entry->bcnint = info->beacon_int;
  362. __entry->assoc_cap = info->assoc_capability;
  363. __entry->sync_tsf = info->sync_tsf;
  364. __entry->sync_device_ts = info->sync_device_ts;
  365. __entry->sync_dtim_count = info->sync_dtim_count;
  366. __entry->basic_rates = info->basic_rates;
  367. memcpy(__entry->mcast_rate, info->mcast_rate,
  368. sizeof(__entry->mcast_rate));
  369. __entry->ht_operation_mode = info->ht_operation_mode;
  370. __entry->cqm_rssi_thold = info->cqm_rssi_thold;
  371. __entry->cqm_rssi_hyst = info->cqm_rssi_hyst;
  372. __entry->channel_width = info->chandef.width;
  373. __entry->channel_cfreq1 = info->chandef.center_freq1;
  374. __entry->arp_addr_cnt = info->arp_addr_cnt;
  375. memcpy(__get_dynamic_array(arp_addr_list), info->arp_addr_list,
  376. sizeof(u32) * (info->arp_addr_cnt > IEEE80211_BSS_ARP_ADDR_LIST_LEN ?
  377. IEEE80211_BSS_ARP_ADDR_LIST_LEN :
  378. info->arp_addr_cnt));
  379. __entry->qos = info->qos;
  380. __entry->idle = info->idle;
  381. __entry->ps = info->ps;
  382. memcpy(__get_dynamic_array(ssid), info->ssid, info->ssid_len);
  383. __entry->hidden_ssid = info->hidden_ssid;
  384. __entry->txpower = info->txpower;
  385. __entry->p2p_oppps_ctwindow = info->p2p_noa_attr.oppps_ctwindow;
  386. ),
  387. TP_printk(
  388. LOCAL_PR_FMT VIF_PR_FMT " changed:%#x",
  389. LOCAL_PR_ARG, VIF_PR_ARG, __entry->changed
  390. )
  391. );
  392. TRACE_EVENT(drv_prepare_multicast,
  393. TP_PROTO(struct ieee80211_local *local, int mc_count),
  394. TP_ARGS(local, mc_count),
  395. TP_STRUCT__entry(
  396. LOCAL_ENTRY
  397. __field(int, mc_count)
  398. ),
  399. TP_fast_assign(
  400. LOCAL_ASSIGN;
  401. __entry->mc_count = mc_count;
  402. ),
  403. TP_printk(
  404. LOCAL_PR_FMT " prepare mc (%d)",
  405. LOCAL_PR_ARG, __entry->mc_count
  406. )
  407. );
  408. TRACE_EVENT(drv_configure_filter,
  409. TP_PROTO(struct ieee80211_local *local,
  410. unsigned int changed_flags,
  411. unsigned int *total_flags,
  412. u64 multicast),
  413. TP_ARGS(local, changed_flags, total_flags, multicast),
  414. TP_STRUCT__entry(
  415. LOCAL_ENTRY
  416. __field(unsigned int, changed)
  417. __field(unsigned int, total)
  418. __field(u64, multicast)
  419. ),
  420. TP_fast_assign(
  421. LOCAL_ASSIGN;
  422. __entry->changed = changed_flags;
  423. __entry->total = *total_flags;
  424. __entry->multicast = multicast;
  425. ),
  426. TP_printk(
  427. LOCAL_PR_FMT " changed:%#x total:%#x",
  428. LOCAL_PR_ARG, __entry->changed, __entry->total
  429. )
  430. );
  431. TRACE_EVENT(drv_config_iface_filter,
  432. TP_PROTO(struct ieee80211_local *local,
  433. struct ieee80211_sub_if_data *sdata,
  434. unsigned int filter_flags,
  435. unsigned int changed_flags),
  436. TP_ARGS(local, sdata, filter_flags, changed_flags),
  437. TP_STRUCT__entry(
  438. LOCAL_ENTRY
  439. VIF_ENTRY
  440. __field(unsigned int, filter_flags)
  441. __field(unsigned int, changed_flags)
  442. ),
  443. TP_fast_assign(
  444. LOCAL_ASSIGN;
  445. VIF_ASSIGN;
  446. __entry->filter_flags = filter_flags;
  447. __entry->changed_flags = changed_flags;
  448. ),
  449. TP_printk(
  450. LOCAL_PR_FMT VIF_PR_FMT
  451. " filter_flags: %#x changed_flags: %#x",
  452. LOCAL_PR_ARG, VIF_PR_ARG, __entry->filter_flags,
  453. __entry->changed_flags
  454. )
  455. );
  456. TRACE_EVENT(drv_set_tim,
  457. TP_PROTO(struct ieee80211_local *local,
  458. struct ieee80211_sta *sta, bool set),
  459. TP_ARGS(local, sta, set),
  460. TP_STRUCT__entry(
  461. LOCAL_ENTRY
  462. STA_ENTRY
  463. __field(bool, set)
  464. ),
  465. TP_fast_assign(
  466. LOCAL_ASSIGN;
  467. STA_ASSIGN;
  468. __entry->set = set;
  469. ),
  470. TP_printk(
  471. LOCAL_PR_FMT STA_PR_FMT " set:%d",
  472. LOCAL_PR_ARG, STA_PR_ARG, __entry->set
  473. )
  474. );
  475. TRACE_EVENT(drv_set_key,
  476. TP_PROTO(struct ieee80211_local *local,
  477. enum set_key_cmd cmd, struct ieee80211_sub_if_data *sdata,
  478. struct ieee80211_sta *sta,
  479. struct ieee80211_key_conf *key),
  480. TP_ARGS(local, cmd, sdata, sta, key),
  481. TP_STRUCT__entry(
  482. LOCAL_ENTRY
  483. VIF_ENTRY
  484. STA_ENTRY
  485. KEY_ENTRY
  486. ),
  487. TP_fast_assign(
  488. LOCAL_ASSIGN;
  489. VIF_ASSIGN;
  490. STA_ASSIGN;
  491. KEY_ASSIGN(key);
  492. ),
  493. TP_printk(
  494. LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT KEY_PR_FMT,
  495. LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, KEY_PR_ARG
  496. )
  497. );
  498. TRACE_EVENT(drv_update_tkip_key,
  499. TP_PROTO(struct ieee80211_local *local,
  500. struct ieee80211_sub_if_data *sdata,
  501. struct ieee80211_key_conf *conf,
  502. struct ieee80211_sta *sta, u32 iv32),
  503. TP_ARGS(local, sdata, conf, sta, iv32),
  504. TP_STRUCT__entry(
  505. LOCAL_ENTRY
  506. VIF_ENTRY
  507. STA_ENTRY
  508. __field(u32, iv32)
  509. ),
  510. TP_fast_assign(
  511. LOCAL_ASSIGN;
  512. VIF_ASSIGN;
  513. STA_ASSIGN;
  514. __entry->iv32 = iv32;
  515. ),
  516. TP_printk(
  517. LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " iv32:%#x",
  518. LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->iv32
  519. )
  520. );
  521. DEFINE_EVENT(local_sdata_evt, drv_hw_scan,
  522. TP_PROTO(struct ieee80211_local *local,
  523. struct ieee80211_sub_if_data *sdata),
  524. TP_ARGS(local, sdata)
  525. );
  526. DEFINE_EVENT(local_sdata_evt, drv_cancel_hw_scan,
  527. TP_PROTO(struct ieee80211_local *local,
  528. struct ieee80211_sub_if_data *sdata),
  529. TP_ARGS(local, sdata)
  530. );
  531. DEFINE_EVENT(local_sdata_evt, drv_sched_scan_start,
  532. TP_PROTO(struct ieee80211_local *local,
  533. struct ieee80211_sub_if_data *sdata),
  534. TP_ARGS(local, sdata)
  535. );
  536. DEFINE_EVENT(local_sdata_evt, drv_sched_scan_stop,
  537. TP_PROTO(struct ieee80211_local *local,
  538. struct ieee80211_sub_if_data *sdata),
  539. TP_ARGS(local, sdata)
  540. );
  541. TRACE_EVENT(drv_sw_scan_start,
  542. TP_PROTO(struct ieee80211_local *local,
  543. struct ieee80211_sub_if_data *sdata,
  544. const u8 *mac_addr),
  545. TP_ARGS(local, sdata, mac_addr),
  546. TP_STRUCT__entry(
  547. LOCAL_ENTRY
  548. VIF_ENTRY
  549. __array(char, mac_addr, ETH_ALEN)
  550. ),
  551. TP_fast_assign(
  552. LOCAL_ASSIGN;
  553. VIF_ASSIGN;
  554. memcpy(__entry->mac_addr, mac_addr, ETH_ALEN);
  555. ),
  556. TP_printk(LOCAL_PR_FMT ", " VIF_PR_FMT ", addr:%pM",
  557. LOCAL_PR_ARG, VIF_PR_ARG, __entry->mac_addr)
  558. );
  559. DEFINE_EVENT(local_sdata_evt, drv_sw_scan_complete,
  560. TP_PROTO(struct ieee80211_local *local,
  561. struct ieee80211_sub_if_data *sdata),
  562. TP_ARGS(local, sdata)
  563. );
  564. TRACE_EVENT(drv_get_stats,
  565. TP_PROTO(struct ieee80211_local *local,
  566. struct ieee80211_low_level_stats *stats,
  567. int ret),
  568. TP_ARGS(local, stats, ret),
  569. TP_STRUCT__entry(
  570. LOCAL_ENTRY
  571. __field(int, ret)
  572. __field(unsigned int, ackfail)
  573. __field(unsigned int, rtsfail)
  574. __field(unsigned int, fcserr)
  575. __field(unsigned int, rtssucc)
  576. ),
  577. TP_fast_assign(
  578. LOCAL_ASSIGN;
  579. __entry->ret = ret;
  580. __entry->ackfail = stats->dot11ACKFailureCount;
  581. __entry->rtsfail = stats->dot11RTSFailureCount;
  582. __entry->fcserr = stats->dot11FCSErrorCount;
  583. __entry->rtssucc = stats->dot11RTSSuccessCount;
  584. ),
  585. TP_printk(
  586. LOCAL_PR_FMT " ret:%d",
  587. LOCAL_PR_ARG, __entry->ret
  588. )
  589. );
  590. TRACE_EVENT(drv_get_key_seq,
  591. TP_PROTO(struct ieee80211_local *local,
  592. struct ieee80211_key_conf *key),
  593. TP_ARGS(local, key),
  594. TP_STRUCT__entry(
  595. LOCAL_ENTRY
  596. KEY_ENTRY
  597. ),
  598. TP_fast_assign(
  599. LOCAL_ASSIGN;
  600. KEY_ASSIGN(key);
  601. ),
  602. TP_printk(
  603. LOCAL_PR_FMT KEY_PR_FMT,
  604. LOCAL_PR_ARG, KEY_PR_ARG
  605. )
  606. );
  607. DEFINE_EVENT(local_u32_evt, drv_set_frag_threshold,
  608. TP_PROTO(struct ieee80211_local *local, u32 value),
  609. TP_ARGS(local, value)
  610. );
  611. DEFINE_EVENT(local_u32_evt, drv_set_rts_threshold,
  612. TP_PROTO(struct ieee80211_local *local, u32 value),
  613. TP_ARGS(local, value)
  614. );
  615. TRACE_EVENT(drv_set_coverage_class,
  616. TP_PROTO(struct ieee80211_local *local, s16 value),
  617. TP_ARGS(local, value),
  618. TP_STRUCT__entry(
  619. LOCAL_ENTRY
  620. __field(s16, value)
  621. ),
  622. TP_fast_assign(
  623. LOCAL_ASSIGN;
  624. __entry->value = value;
  625. ),
  626. TP_printk(
  627. LOCAL_PR_FMT " value:%d",
  628. LOCAL_PR_ARG, __entry->value
  629. )
  630. );
  631. TRACE_EVENT(drv_sta_notify,
  632. TP_PROTO(struct ieee80211_local *local,
  633. struct ieee80211_sub_if_data *sdata,
  634. enum sta_notify_cmd cmd,
  635. struct ieee80211_sta *sta),
  636. TP_ARGS(local, sdata, cmd, sta),
  637. TP_STRUCT__entry(
  638. LOCAL_ENTRY
  639. VIF_ENTRY
  640. STA_ENTRY
  641. __field(u32, cmd)
  642. ),
  643. TP_fast_assign(
  644. LOCAL_ASSIGN;
  645. VIF_ASSIGN;
  646. STA_ASSIGN;
  647. __entry->cmd = cmd;
  648. ),
  649. TP_printk(
  650. LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " cmd:%d",
  651. LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->cmd
  652. )
  653. );
  654. TRACE_EVENT(drv_sta_state,
  655. TP_PROTO(struct ieee80211_local *local,
  656. struct ieee80211_sub_if_data *sdata,
  657. struct ieee80211_sta *sta,
  658. enum ieee80211_sta_state old_state,
  659. enum ieee80211_sta_state new_state),
  660. TP_ARGS(local, sdata, sta, old_state, new_state),
  661. TP_STRUCT__entry(
  662. LOCAL_ENTRY
  663. VIF_ENTRY
  664. STA_ENTRY
  665. __field(u32, old_state)
  666. __field(u32, new_state)
  667. ),
  668. TP_fast_assign(
  669. LOCAL_ASSIGN;
  670. VIF_ASSIGN;
  671. STA_ASSIGN;
  672. __entry->old_state = old_state;
  673. __entry->new_state = new_state;
  674. ),
  675. TP_printk(
  676. LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " state: %d->%d",
  677. LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG,
  678. __entry->old_state, __entry->new_state
  679. )
  680. );
  681. TRACE_EVENT(drv_sta_rc_update,
  682. TP_PROTO(struct ieee80211_local *local,
  683. struct ieee80211_sub_if_data *sdata,
  684. struct ieee80211_sta *sta,
  685. u32 changed),
  686. TP_ARGS(local, sdata, sta, changed),
  687. TP_STRUCT__entry(
  688. LOCAL_ENTRY
  689. VIF_ENTRY
  690. STA_ENTRY
  691. __field(u32, changed)
  692. ),
  693. TP_fast_assign(
  694. LOCAL_ASSIGN;
  695. VIF_ASSIGN;
  696. STA_ASSIGN;
  697. __entry->changed = changed;
  698. ),
  699. TP_printk(
  700. LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " changed: 0x%x",
  701. LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->changed
  702. )
  703. );
  704. DECLARE_EVENT_CLASS(sta_event,
  705. TP_PROTO(struct ieee80211_local *local,
  706. struct ieee80211_sub_if_data *sdata,
  707. struct ieee80211_sta *sta),
  708. TP_ARGS(local, sdata, sta),
  709. TP_STRUCT__entry(
  710. LOCAL_ENTRY
  711. VIF_ENTRY
  712. STA_ENTRY
  713. ),
  714. TP_fast_assign(
  715. LOCAL_ASSIGN;
  716. VIF_ASSIGN;
  717. STA_ASSIGN;
  718. ),
  719. TP_printk(
  720. LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
  721. LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
  722. )
  723. );
  724. DEFINE_EVENT(sta_event, drv_sta_statistics,
  725. TP_PROTO(struct ieee80211_local *local,
  726. struct ieee80211_sub_if_data *sdata,
  727. struct ieee80211_sta *sta),
  728. TP_ARGS(local, sdata, sta)
  729. );
  730. DEFINE_EVENT(sta_event, drv_sta_add,
  731. TP_PROTO(struct ieee80211_local *local,
  732. struct ieee80211_sub_if_data *sdata,
  733. struct ieee80211_sta *sta),
  734. TP_ARGS(local, sdata, sta)
  735. );
  736. DEFINE_EVENT(sta_event, drv_sta_remove,
  737. TP_PROTO(struct ieee80211_local *local,
  738. struct ieee80211_sub_if_data *sdata,
  739. struct ieee80211_sta *sta),
  740. TP_ARGS(local, sdata, sta)
  741. );
  742. DEFINE_EVENT(sta_event, drv_sta_pre_rcu_remove,
  743. TP_PROTO(struct ieee80211_local *local,
  744. struct ieee80211_sub_if_data *sdata,
  745. struct ieee80211_sta *sta),
  746. TP_ARGS(local, sdata, sta)
  747. );
  748. DEFINE_EVENT(sta_event, drv_sta_rate_tbl_update,
  749. TP_PROTO(struct ieee80211_local *local,
  750. struct ieee80211_sub_if_data *sdata,
  751. struct ieee80211_sta *sta),
  752. TP_ARGS(local, sdata, sta)
  753. );
  754. TRACE_EVENT(drv_conf_tx,
  755. TP_PROTO(struct ieee80211_local *local,
  756. struct ieee80211_sub_if_data *sdata,
  757. u16 ac, const struct ieee80211_tx_queue_params *params),
  758. TP_ARGS(local, sdata, ac, params),
  759. TP_STRUCT__entry(
  760. LOCAL_ENTRY
  761. VIF_ENTRY
  762. __field(u16, ac)
  763. __field(u16, txop)
  764. __field(u16, cw_min)
  765. __field(u16, cw_max)
  766. __field(u8, aifs)
  767. __field(bool, uapsd)
  768. ),
  769. TP_fast_assign(
  770. LOCAL_ASSIGN;
  771. VIF_ASSIGN;
  772. __entry->ac = ac;
  773. __entry->txop = params->txop;
  774. __entry->cw_max = params->cw_max;
  775. __entry->cw_min = params->cw_min;
  776. __entry->aifs = params->aifs;
  777. __entry->uapsd = params->uapsd;
  778. ),
  779. TP_printk(
  780. LOCAL_PR_FMT VIF_PR_FMT " AC:%d",
  781. LOCAL_PR_ARG, VIF_PR_ARG, __entry->ac
  782. )
  783. );
  784. DEFINE_EVENT(local_sdata_evt, drv_get_tsf,
  785. TP_PROTO(struct ieee80211_local *local,
  786. struct ieee80211_sub_if_data *sdata),
  787. TP_ARGS(local, sdata)
  788. );
  789. TRACE_EVENT(drv_set_tsf,
  790. TP_PROTO(struct ieee80211_local *local,
  791. struct ieee80211_sub_if_data *sdata,
  792. u64 tsf),
  793. TP_ARGS(local, sdata, tsf),
  794. TP_STRUCT__entry(
  795. LOCAL_ENTRY
  796. VIF_ENTRY
  797. __field(u64, tsf)
  798. ),
  799. TP_fast_assign(
  800. LOCAL_ASSIGN;
  801. VIF_ASSIGN;
  802. __entry->tsf = tsf;
  803. ),
  804. TP_printk(
  805. LOCAL_PR_FMT VIF_PR_FMT " tsf:%llu",
  806. LOCAL_PR_ARG, VIF_PR_ARG, (unsigned long long)__entry->tsf
  807. )
  808. );
  809. DEFINE_EVENT(local_sdata_evt, drv_reset_tsf,
  810. TP_PROTO(struct ieee80211_local *local,
  811. struct ieee80211_sub_if_data *sdata),
  812. TP_ARGS(local, sdata)
  813. );
  814. DEFINE_EVENT(local_only_evt, drv_tx_last_beacon,
  815. TP_PROTO(struct ieee80211_local *local),
  816. TP_ARGS(local)
  817. );
  818. TRACE_EVENT(drv_ampdu_action,
  819. TP_PROTO(struct ieee80211_local *local,
  820. struct ieee80211_sub_if_data *sdata,
  821. enum ieee80211_ampdu_mlme_action action,
  822. struct ieee80211_sta *sta, u16 tid,
  823. u16 *ssn, u8 buf_size, bool amsdu),
  824. TP_ARGS(local, sdata, action, sta, tid, ssn, buf_size, amsdu),
  825. TP_STRUCT__entry(
  826. LOCAL_ENTRY
  827. STA_ENTRY
  828. __field(u32, action)
  829. __field(u16, tid)
  830. __field(u16, ssn)
  831. __field(u8, buf_size)
  832. __field(bool, amsdu)
  833. VIF_ENTRY
  834. ),
  835. TP_fast_assign(
  836. LOCAL_ASSIGN;
  837. VIF_ASSIGN;
  838. STA_ASSIGN;
  839. __entry->action = action;
  840. __entry->tid = tid;
  841. __entry->ssn = ssn ? *ssn : 0;
  842. __entry->buf_size = buf_size;
  843. __entry->amsdu = amsdu;
  844. ),
  845. TP_printk(
  846. LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " action:%d tid:%d buf:%d amsdu:%d",
  847. LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->action,
  848. __entry->tid, __entry->buf_size, __entry->amsdu
  849. )
  850. );
  851. TRACE_EVENT(drv_get_survey,
  852. TP_PROTO(struct ieee80211_local *local, int idx,
  853. struct survey_info *survey),
  854. TP_ARGS(local, idx, survey),
  855. TP_STRUCT__entry(
  856. LOCAL_ENTRY
  857. __field(int, idx)
  858. ),
  859. TP_fast_assign(
  860. LOCAL_ASSIGN;
  861. __entry->idx = idx;
  862. ),
  863. TP_printk(
  864. LOCAL_PR_FMT " idx:%d",
  865. LOCAL_PR_ARG, __entry->idx
  866. )
  867. );
  868. TRACE_EVENT(drv_flush,
  869. TP_PROTO(struct ieee80211_local *local,
  870. u32 queues, bool drop),
  871. TP_ARGS(local, queues, drop),
  872. TP_STRUCT__entry(
  873. LOCAL_ENTRY
  874. __field(bool, drop)
  875. __field(u32, queues)
  876. ),
  877. TP_fast_assign(
  878. LOCAL_ASSIGN;
  879. __entry->drop = drop;
  880. __entry->queues = queues;
  881. ),
  882. TP_printk(
  883. LOCAL_PR_FMT " queues:0x%x drop:%d",
  884. LOCAL_PR_ARG, __entry->queues, __entry->drop
  885. )
  886. );
  887. TRACE_EVENT(drv_channel_switch,
  888. TP_PROTO(struct ieee80211_local *local,
  889. struct ieee80211_sub_if_data *sdata,
  890. struct ieee80211_channel_switch *ch_switch),
  891. TP_ARGS(local, sdata, ch_switch),
  892. TP_STRUCT__entry(
  893. LOCAL_ENTRY
  894. VIF_ENTRY
  895. CHANDEF_ENTRY
  896. __field(u64, timestamp)
  897. __field(u32, device_timestamp)
  898. __field(bool, block_tx)
  899. __field(u8, count)
  900. ),
  901. TP_fast_assign(
  902. LOCAL_ASSIGN;
  903. VIF_ASSIGN;
  904. CHANDEF_ASSIGN(&ch_switch->chandef)
  905. __entry->timestamp = ch_switch->timestamp;
  906. __entry->device_timestamp = ch_switch->device_timestamp;
  907. __entry->block_tx = ch_switch->block_tx;
  908. __entry->count = ch_switch->count;
  909. ),
  910. TP_printk(
  911. LOCAL_PR_FMT VIF_PR_FMT " new " CHANDEF_PR_FMT " count:%d",
  912. LOCAL_PR_ARG, VIF_PR_ARG, CHANDEF_PR_ARG, __entry->count
  913. )
  914. );
  915. TRACE_EVENT(drv_set_antenna,
  916. TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),
  917. TP_ARGS(local, tx_ant, rx_ant, ret),
  918. TP_STRUCT__entry(
  919. LOCAL_ENTRY
  920. __field(u32, tx_ant)
  921. __field(u32, rx_ant)
  922. __field(int, ret)
  923. ),
  924. TP_fast_assign(
  925. LOCAL_ASSIGN;
  926. __entry->tx_ant = tx_ant;
  927. __entry->rx_ant = rx_ant;
  928. __entry->ret = ret;
  929. ),
  930. TP_printk(
  931. LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
  932. LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
  933. )
  934. );
  935. TRACE_EVENT(drv_get_antenna,
  936. TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),
  937. TP_ARGS(local, tx_ant, rx_ant, ret),
  938. TP_STRUCT__entry(
  939. LOCAL_ENTRY
  940. __field(u32, tx_ant)
  941. __field(u32, rx_ant)
  942. __field(int, ret)
  943. ),
  944. TP_fast_assign(
  945. LOCAL_ASSIGN;
  946. __entry->tx_ant = tx_ant;
  947. __entry->rx_ant = rx_ant;
  948. __entry->ret = ret;
  949. ),
  950. TP_printk(
  951. LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
  952. LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
  953. )
  954. );
  955. TRACE_EVENT(drv_remain_on_channel,
  956. TP_PROTO(struct ieee80211_local *local,
  957. struct ieee80211_sub_if_data *sdata,
  958. struct ieee80211_channel *chan,
  959. unsigned int duration,
  960. enum ieee80211_roc_type type),
  961. TP_ARGS(local, sdata, chan, duration, type),
  962. TP_STRUCT__entry(
  963. LOCAL_ENTRY
  964. VIF_ENTRY
  965. __field(int, center_freq)
  966. __field(unsigned int, duration)
  967. __field(u32, type)
  968. ),
  969. TP_fast_assign(
  970. LOCAL_ASSIGN;
  971. VIF_ASSIGN;
  972. __entry->center_freq = chan->center_freq;
  973. __entry->duration = duration;
  974. __entry->type = type;
  975. ),
  976. TP_printk(
  977. LOCAL_PR_FMT VIF_PR_FMT " freq:%dMHz duration:%dms type=%d",
  978. LOCAL_PR_ARG, VIF_PR_ARG,
  979. __entry->center_freq, __entry->duration, __entry->type
  980. )
  981. );
  982. DEFINE_EVENT(local_only_evt, drv_cancel_remain_on_channel,
  983. TP_PROTO(struct ieee80211_local *local),
  984. TP_ARGS(local)
  985. );
  986. TRACE_EVENT(drv_set_ringparam,
  987. TP_PROTO(struct ieee80211_local *local, u32 tx, u32 rx),
  988. TP_ARGS(local, tx, rx),
  989. TP_STRUCT__entry(
  990. LOCAL_ENTRY
  991. __field(u32, tx)
  992. __field(u32, rx)
  993. ),
  994. TP_fast_assign(
  995. LOCAL_ASSIGN;
  996. __entry->tx = tx;
  997. __entry->rx = rx;
  998. ),
  999. TP_printk(
  1000. LOCAL_PR_FMT " tx:%d rx %d",
  1001. LOCAL_PR_ARG, __entry->tx, __entry->rx
  1002. )
  1003. );
  1004. TRACE_EVENT(drv_get_ringparam,
  1005. TP_PROTO(struct ieee80211_local *local, u32 *tx, u32 *tx_max,
  1006. u32 *rx, u32 *rx_max),
  1007. TP_ARGS(local, tx, tx_max, rx, rx_max),
  1008. TP_STRUCT__entry(
  1009. LOCAL_ENTRY
  1010. __field(u32, tx)
  1011. __field(u32, tx_max)
  1012. __field(u32, rx)
  1013. __field(u32, rx_max)
  1014. ),
  1015. TP_fast_assign(
  1016. LOCAL_ASSIGN;
  1017. __entry->tx = *tx;
  1018. __entry->tx_max = *tx_max;
  1019. __entry->rx = *rx;
  1020. __entry->rx_max = *rx_max;
  1021. ),
  1022. TP_printk(
  1023. LOCAL_PR_FMT " tx:%d tx_max %d rx %d rx_max %d",
  1024. LOCAL_PR_ARG,
  1025. __entry->tx, __entry->tx_max, __entry->rx, __entry->rx_max
  1026. )
  1027. );
  1028. DEFINE_EVENT(local_only_evt, drv_tx_frames_pending,
  1029. TP_PROTO(struct ieee80211_local *local),
  1030. TP_ARGS(local)
  1031. );
  1032. DEFINE_EVENT(local_only_evt, drv_offchannel_tx_cancel_wait,
  1033. TP_PROTO(struct ieee80211_local *local),
  1034. TP_ARGS(local)
  1035. );
  1036. TRACE_EVENT(drv_set_bitrate_mask,
  1037. TP_PROTO(struct ieee80211_local *local,
  1038. struct ieee80211_sub_if_data *sdata,
  1039. const struct cfg80211_bitrate_mask *mask),
  1040. TP_ARGS(local, sdata, mask),
  1041. TP_STRUCT__entry(
  1042. LOCAL_ENTRY
  1043. VIF_ENTRY
  1044. __field(u32, legacy_2g)
  1045. __field(u32, legacy_5g)
  1046. ),
  1047. TP_fast_assign(
  1048. LOCAL_ASSIGN;
  1049. VIF_ASSIGN;
  1050. __entry->legacy_2g = mask->control[IEEE80211_BAND_2GHZ].legacy;
  1051. __entry->legacy_5g = mask->control[IEEE80211_BAND_5GHZ].legacy;
  1052. ),
  1053. TP_printk(
  1054. LOCAL_PR_FMT VIF_PR_FMT " 2G Mask:0x%x 5G Mask:0x%x",
  1055. LOCAL_PR_ARG, VIF_PR_ARG, __entry->legacy_2g, __entry->legacy_5g
  1056. )
  1057. );
  1058. TRACE_EVENT(drv_set_rekey_data,
  1059. TP_PROTO(struct ieee80211_local *local,
  1060. struct ieee80211_sub_if_data *sdata,
  1061. struct cfg80211_gtk_rekey_data *data),
  1062. TP_ARGS(local, sdata, data),
  1063. TP_STRUCT__entry(
  1064. LOCAL_ENTRY
  1065. VIF_ENTRY
  1066. __array(u8, kek, NL80211_KEK_LEN)
  1067. __array(u8, kck, NL80211_KCK_LEN)
  1068. __array(u8, replay_ctr, NL80211_REPLAY_CTR_LEN)
  1069. ),
  1070. TP_fast_assign(
  1071. LOCAL_ASSIGN;
  1072. VIF_ASSIGN;
  1073. memcpy(__entry->kek, data->kek, NL80211_KEK_LEN);
  1074. memcpy(__entry->kck, data->kck, NL80211_KCK_LEN);
  1075. memcpy(__entry->replay_ctr, data->replay_ctr,
  1076. NL80211_REPLAY_CTR_LEN);
  1077. ),
  1078. TP_printk(LOCAL_PR_FMT VIF_PR_FMT,
  1079. LOCAL_PR_ARG, VIF_PR_ARG)
  1080. );
  1081. TRACE_EVENT(drv_event_callback,
  1082. TP_PROTO(struct ieee80211_local *local,
  1083. struct ieee80211_sub_if_data *sdata,
  1084. const struct ieee80211_event *_event),
  1085. TP_ARGS(local, sdata, _event),
  1086. TP_STRUCT__entry(
  1087. LOCAL_ENTRY
  1088. VIF_ENTRY
  1089. __field(u32, type)
  1090. ),
  1091. TP_fast_assign(
  1092. LOCAL_ASSIGN;
  1093. VIF_ASSIGN;
  1094. __entry->type = _event->type;
  1095. ),
  1096. TP_printk(
  1097. LOCAL_PR_FMT VIF_PR_FMT " event:%d",
  1098. LOCAL_PR_ARG, VIF_PR_ARG, __entry->type
  1099. )
  1100. );
  1101. DECLARE_EVENT_CLASS(release_evt,
  1102. TP_PROTO(struct ieee80211_local *local,
  1103. struct ieee80211_sta *sta,
  1104. u16 tids, int num_frames,
  1105. enum ieee80211_frame_release_type reason,
  1106. bool more_data),
  1107. TP_ARGS(local, sta, tids, num_frames, reason, more_data),
  1108. TP_STRUCT__entry(
  1109. LOCAL_ENTRY
  1110. STA_ENTRY
  1111. __field(u16, tids)
  1112. __field(int, num_frames)
  1113. __field(int, reason)
  1114. __field(bool, more_data)
  1115. ),
  1116. TP_fast_assign(
  1117. LOCAL_ASSIGN;
  1118. STA_ASSIGN;
  1119. __entry->tids = tids;
  1120. __entry->num_frames = num_frames;
  1121. __entry->reason = reason;
  1122. __entry->more_data = more_data;
  1123. ),
  1124. TP_printk(
  1125. LOCAL_PR_FMT STA_PR_FMT
  1126. " TIDs:0x%.4x frames:%d reason:%d more:%d",
  1127. LOCAL_PR_ARG, STA_PR_ARG, __entry->tids, __entry->num_frames,
  1128. __entry->reason, __entry->more_data
  1129. )
  1130. );
  1131. DEFINE_EVENT(release_evt, drv_release_buffered_frames,
  1132. TP_PROTO(struct ieee80211_local *local,
  1133. struct ieee80211_sta *sta,
  1134. u16 tids, int num_frames,
  1135. enum ieee80211_frame_release_type reason,
  1136. bool more_data),
  1137. TP_ARGS(local, sta, tids, num_frames, reason, more_data)
  1138. );
  1139. DEFINE_EVENT(release_evt, drv_allow_buffered_frames,
  1140. TP_PROTO(struct ieee80211_local *local,
  1141. struct ieee80211_sta *sta,
  1142. u16 tids, int num_frames,
  1143. enum ieee80211_frame_release_type reason,
  1144. bool more_data),
  1145. TP_ARGS(local, sta, tids, num_frames, reason, more_data)
  1146. );
  1147. DEFINE_EVENT(local_sdata_evt, drv_mgd_prepare_tx,
  1148. TP_PROTO(struct ieee80211_local *local,
  1149. struct ieee80211_sub_if_data *sdata),
  1150. TP_ARGS(local, sdata)
  1151. );
  1152. DEFINE_EVENT(local_sdata_evt, drv_mgd_protect_tdls_discover,
  1153. TP_PROTO(struct ieee80211_local *local,
  1154. struct ieee80211_sub_if_data *sdata),
  1155. TP_ARGS(local, sdata)
  1156. );
  1157. DECLARE_EVENT_CLASS(local_chanctx,
  1158. TP_PROTO(struct ieee80211_local *local,
  1159. struct ieee80211_chanctx *ctx),
  1160. TP_ARGS(local, ctx),
  1161. TP_STRUCT__entry(
  1162. LOCAL_ENTRY
  1163. CHANCTX_ENTRY
  1164. ),
  1165. TP_fast_assign(
  1166. LOCAL_ASSIGN;
  1167. CHANCTX_ASSIGN;
  1168. ),
  1169. TP_printk(
  1170. LOCAL_PR_FMT CHANCTX_PR_FMT,
  1171. LOCAL_PR_ARG, CHANCTX_PR_ARG
  1172. )
  1173. );
  1174. DEFINE_EVENT(local_chanctx, drv_add_chanctx,
  1175. TP_PROTO(struct ieee80211_local *local,
  1176. struct ieee80211_chanctx *ctx),
  1177. TP_ARGS(local, ctx)
  1178. );
  1179. DEFINE_EVENT(local_chanctx, drv_remove_chanctx,
  1180. TP_PROTO(struct ieee80211_local *local,
  1181. struct ieee80211_chanctx *ctx),
  1182. TP_ARGS(local, ctx)
  1183. );
  1184. TRACE_EVENT(drv_change_chanctx,
  1185. TP_PROTO(struct ieee80211_local *local,
  1186. struct ieee80211_chanctx *ctx,
  1187. u32 changed),
  1188. TP_ARGS(local, ctx, changed),
  1189. TP_STRUCT__entry(
  1190. LOCAL_ENTRY
  1191. CHANCTX_ENTRY
  1192. __field(u32, changed)
  1193. ),
  1194. TP_fast_assign(
  1195. LOCAL_ASSIGN;
  1196. CHANCTX_ASSIGN;
  1197. __entry->changed = changed;
  1198. ),
  1199. TP_printk(
  1200. LOCAL_PR_FMT CHANCTX_PR_FMT " changed:%#x",
  1201. LOCAL_PR_ARG, CHANCTX_PR_ARG, __entry->changed
  1202. )
  1203. );
  1204. #if !defined(__TRACE_VIF_ENTRY)
  1205. #define __TRACE_VIF_ENTRY
  1206. struct trace_vif_entry {
  1207. enum nl80211_iftype vif_type;
  1208. bool p2p;
  1209. char vif_name[IFNAMSIZ];
  1210. } __packed;
  1211. struct trace_chandef_entry {
  1212. u32 control_freq;
  1213. u32 chan_width;
  1214. u32 center_freq1;
  1215. u32 center_freq2;
  1216. } __packed;
  1217. struct trace_switch_entry {
  1218. struct trace_vif_entry vif;
  1219. struct trace_chandef_entry old_chandef;
  1220. struct trace_chandef_entry new_chandef;
  1221. } __packed;
  1222. #define SWITCH_ENTRY_ASSIGN(to, from) local_vifs[i].to = vifs[i].from
  1223. #endif
  1224. TRACE_EVENT(drv_switch_vif_chanctx,
  1225. TP_PROTO(struct ieee80211_local *local,
  1226. struct ieee80211_vif_chanctx_switch *vifs,
  1227. int n_vifs, enum ieee80211_chanctx_switch_mode mode),
  1228. TP_ARGS(local, vifs, n_vifs, mode),
  1229. TP_STRUCT__entry(
  1230. LOCAL_ENTRY
  1231. __field(int, n_vifs)
  1232. __field(u32, mode)
  1233. __dynamic_array(u8, vifs,
  1234. sizeof(struct trace_switch_entry) * n_vifs)
  1235. ),
  1236. TP_fast_assign(
  1237. LOCAL_ASSIGN;
  1238. __entry->n_vifs = n_vifs;
  1239. __entry->mode = mode;
  1240. {
  1241. struct trace_switch_entry *local_vifs =
  1242. __get_dynamic_array(vifs);
  1243. int i;
  1244. for (i = 0; i < n_vifs; i++) {
  1245. struct ieee80211_sub_if_data *sdata;
  1246. sdata = container_of(vifs[i].vif,
  1247. struct ieee80211_sub_if_data,
  1248. vif);
  1249. SWITCH_ENTRY_ASSIGN(vif.vif_type, vif->type);
  1250. SWITCH_ENTRY_ASSIGN(vif.p2p, vif->p2p);
  1251. strncpy(local_vifs[i].vif.vif_name,
  1252. sdata->name,
  1253. sizeof(local_vifs[i].vif.vif_name));
  1254. SWITCH_ENTRY_ASSIGN(old_chandef.control_freq,
  1255. old_ctx->def.chan->center_freq);
  1256. SWITCH_ENTRY_ASSIGN(old_chandef.chan_width,
  1257. old_ctx->def.width);
  1258. SWITCH_ENTRY_ASSIGN(old_chandef.center_freq1,
  1259. old_ctx->def.center_freq1);
  1260. SWITCH_ENTRY_ASSIGN(old_chandef.center_freq2,
  1261. old_ctx->def.center_freq2);
  1262. SWITCH_ENTRY_ASSIGN(new_chandef.control_freq,
  1263. new_ctx->def.chan->center_freq);
  1264. SWITCH_ENTRY_ASSIGN(new_chandef.chan_width,
  1265. new_ctx->def.width);
  1266. SWITCH_ENTRY_ASSIGN(new_chandef.center_freq1,
  1267. new_ctx->def.center_freq1);
  1268. SWITCH_ENTRY_ASSIGN(new_chandef.center_freq2,
  1269. new_ctx->def.center_freq2);
  1270. }
  1271. }
  1272. ),
  1273. TP_printk(
  1274. LOCAL_PR_FMT " n_vifs:%d mode:%d",
  1275. LOCAL_PR_ARG, __entry->n_vifs, __entry->mode
  1276. )
  1277. );
  1278. DECLARE_EVENT_CLASS(local_sdata_chanctx,
  1279. TP_PROTO(struct ieee80211_local *local,
  1280. struct ieee80211_sub_if_data *sdata,
  1281. struct ieee80211_chanctx *ctx),
  1282. TP_ARGS(local, sdata, ctx),
  1283. TP_STRUCT__entry(
  1284. LOCAL_ENTRY
  1285. VIF_ENTRY
  1286. CHANCTX_ENTRY
  1287. ),
  1288. TP_fast_assign(
  1289. LOCAL_ASSIGN;
  1290. VIF_ASSIGN;
  1291. CHANCTX_ASSIGN;
  1292. ),
  1293. TP_printk(
  1294. LOCAL_PR_FMT VIF_PR_FMT CHANCTX_PR_FMT,
  1295. LOCAL_PR_ARG, VIF_PR_ARG, CHANCTX_PR_ARG
  1296. )
  1297. );
  1298. DEFINE_EVENT(local_sdata_chanctx, drv_assign_vif_chanctx,
  1299. TP_PROTO(struct ieee80211_local *local,
  1300. struct ieee80211_sub_if_data *sdata,
  1301. struct ieee80211_chanctx *ctx),
  1302. TP_ARGS(local, sdata, ctx)
  1303. );
  1304. DEFINE_EVENT(local_sdata_chanctx, drv_unassign_vif_chanctx,
  1305. TP_PROTO(struct ieee80211_local *local,
  1306. struct ieee80211_sub_if_data *sdata,
  1307. struct ieee80211_chanctx *ctx),
  1308. TP_ARGS(local, sdata, ctx)
  1309. );
  1310. TRACE_EVENT(drv_start_ap,
  1311. TP_PROTO(struct ieee80211_local *local,
  1312. struct ieee80211_sub_if_data *sdata,
  1313. struct ieee80211_bss_conf *info),
  1314. TP_ARGS(local, sdata, info),
  1315. TP_STRUCT__entry(
  1316. LOCAL_ENTRY
  1317. VIF_ENTRY
  1318. __field(u8, dtimper)
  1319. __field(u16, bcnint)
  1320. __dynamic_array(u8, ssid, info->ssid_len);
  1321. __field(bool, hidden_ssid);
  1322. ),
  1323. TP_fast_assign(
  1324. LOCAL_ASSIGN;
  1325. VIF_ASSIGN;
  1326. __entry->dtimper = info->dtim_period;
  1327. __entry->bcnint = info->beacon_int;
  1328. memcpy(__get_dynamic_array(ssid), info->ssid, info->ssid_len);
  1329. __entry->hidden_ssid = info->hidden_ssid;
  1330. ),
  1331. TP_printk(
  1332. LOCAL_PR_FMT VIF_PR_FMT,
  1333. LOCAL_PR_ARG, VIF_PR_ARG
  1334. )
  1335. );
  1336. DEFINE_EVENT(local_sdata_evt, drv_stop_ap,
  1337. TP_PROTO(struct ieee80211_local *local,
  1338. struct ieee80211_sub_if_data *sdata),
  1339. TP_ARGS(local, sdata)
  1340. );
  1341. TRACE_EVENT(drv_reconfig_complete,
  1342. TP_PROTO(struct ieee80211_local *local,
  1343. enum ieee80211_reconfig_type reconfig_type),
  1344. TP_ARGS(local, reconfig_type),
  1345. TP_STRUCT__entry(
  1346. LOCAL_ENTRY
  1347. __field(u8, reconfig_type)
  1348. ),
  1349. TP_fast_assign(
  1350. LOCAL_ASSIGN;
  1351. __entry->reconfig_type = reconfig_type;
  1352. ),
  1353. TP_printk(
  1354. LOCAL_PR_FMT " reconfig_type:%d",
  1355. LOCAL_PR_ARG, __entry->reconfig_type
  1356. )
  1357. );
  1358. #if IS_ENABLED(CONFIG_IPV6)
  1359. DEFINE_EVENT(local_sdata_evt, drv_ipv6_addr_change,
  1360. TP_PROTO(struct ieee80211_local *local,
  1361. struct ieee80211_sub_if_data *sdata),
  1362. TP_ARGS(local, sdata)
  1363. );
  1364. #endif
  1365. TRACE_EVENT(drv_join_ibss,
  1366. TP_PROTO(struct ieee80211_local *local,
  1367. struct ieee80211_sub_if_data *sdata,
  1368. struct ieee80211_bss_conf *info),
  1369. TP_ARGS(local, sdata, info),
  1370. TP_STRUCT__entry(
  1371. LOCAL_ENTRY
  1372. VIF_ENTRY
  1373. __field(u8, dtimper)
  1374. __field(u16, bcnint)
  1375. __dynamic_array(u8, ssid, info->ssid_len);
  1376. ),
  1377. TP_fast_assign(
  1378. LOCAL_ASSIGN;
  1379. VIF_ASSIGN;
  1380. __entry->dtimper = info->dtim_period;
  1381. __entry->bcnint = info->beacon_int;
  1382. memcpy(__get_dynamic_array(ssid), info->ssid, info->ssid_len);
  1383. ),
  1384. TP_printk(
  1385. LOCAL_PR_FMT VIF_PR_FMT,
  1386. LOCAL_PR_ARG, VIF_PR_ARG
  1387. )
  1388. );
  1389. DEFINE_EVENT(local_sdata_evt, drv_leave_ibss,
  1390. TP_PROTO(struct ieee80211_local *local,
  1391. struct ieee80211_sub_if_data *sdata),
  1392. TP_ARGS(local, sdata)
  1393. );
  1394. TRACE_EVENT(drv_get_expected_throughput,
  1395. TP_PROTO(struct ieee80211_sta *sta),
  1396. TP_ARGS(sta),
  1397. TP_STRUCT__entry(
  1398. STA_ENTRY
  1399. ),
  1400. TP_fast_assign(
  1401. STA_ASSIGN;
  1402. ),
  1403. TP_printk(
  1404. STA_PR_FMT, STA_PR_ARG
  1405. )
  1406. );
  1407. /*
  1408. * Tracing for API calls that drivers call.
  1409. */
  1410. TRACE_EVENT(api_start_tx_ba_session,
  1411. TP_PROTO(struct ieee80211_sta *sta, u16 tid),
  1412. TP_ARGS(sta, tid),
  1413. TP_STRUCT__entry(
  1414. STA_ENTRY
  1415. __field(u16, tid)
  1416. ),
  1417. TP_fast_assign(
  1418. STA_ASSIGN;
  1419. __entry->tid = tid;
  1420. ),
  1421. TP_printk(
  1422. STA_PR_FMT " tid:%d",
  1423. STA_PR_ARG, __entry->tid
  1424. )
  1425. );
  1426. TRACE_EVENT(api_start_tx_ba_cb,
  1427. TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
  1428. TP_ARGS(sdata, ra, tid),
  1429. TP_STRUCT__entry(
  1430. VIF_ENTRY
  1431. __array(u8, ra, ETH_ALEN)
  1432. __field(u16, tid)
  1433. ),
  1434. TP_fast_assign(
  1435. VIF_ASSIGN;
  1436. memcpy(__entry->ra, ra, ETH_ALEN);
  1437. __entry->tid = tid;
  1438. ),
  1439. TP_printk(
  1440. VIF_PR_FMT " ra:%pM tid:%d",
  1441. VIF_PR_ARG, __entry->ra, __entry->tid
  1442. )
  1443. );
  1444. TRACE_EVENT(api_stop_tx_ba_session,
  1445. TP_PROTO(struct ieee80211_sta *sta, u16 tid),
  1446. TP_ARGS(sta, tid),
  1447. TP_STRUCT__entry(
  1448. STA_ENTRY
  1449. __field(u16, tid)
  1450. ),
  1451. TP_fast_assign(
  1452. STA_ASSIGN;
  1453. __entry->tid = tid;
  1454. ),
  1455. TP_printk(
  1456. STA_PR_FMT " tid:%d",
  1457. STA_PR_ARG, __entry->tid
  1458. )
  1459. );
  1460. TRACE_EVENT(api_stop_tx_ba_cb,
  1461. TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
  1462. TP_ARGS(sdata, ra, tid),
  1463. TP_STRUCT__entry(
  1464. VIF_ENTRY
  1465. __array(u8, ra, ETH_ALEN)
  1466. __field(u16, tid)
  1467. ),
  1468. TP_fast_assign(
  1469. VIF_ASSIGN;
  1470. memcpy(__entry->ra, ra, ETH_ALEN);
  1471. __entry->tid = tid;
  1472. ),
  1473. TP_printk(
  1474. VIF_PR_FMT " ra:%pM tid:%d",
  1475. VIF_PR_ARG, __entry->ra, __entry->tid
  1476. )
  1477. );
  1478. DEFINE_EVENT(local_only_evt, api_restart_hw,
  1479. TP_PROTO(struct ieee80211_local *local),
  1480. TP_ARGS(local)
  1481. );
  1482. TRACE_EVENT(api_beacon_loss,
  1483. TP_PROTO(struct ieee80211_sub_if_data *sdata),
  1484. TP_ARGS(sdata),
  1485. TP_STRUCT__entry(
  1486. VIF_ENTRY
  1487. ),
  1488. TP_fast_assign(
  1489. VIF_ASSIGN;
  1490. ),
  1491. TP_printk(
  1492. VIF_PR_FMT,
  1493. VIF_PR_ARG
  1494. )
  1495. );
  1496. TRACE_EVENT(api_connection_loss,
  1497. TP_PROTO(struct ieee80211_sub_if_data *sdata),
  1498. TP_ARGS(sdata),
  1499. TP_STRUCT__entry(
  1500. VIF_ENTRY
  1501. ),
  1502. TP_fast_assign(
  1503. VIF_ASSIGN;
  1504. ),
  1505. TP_printk(
  1506. VIF_PR_FMT,
  1507. VIF_PR_ARG
  1508. )
  1509. );
  1510. TRACE_EVENT(api_cqm_rssi_notify,
  1511. TP_PROTO(struct ieee80211_sub_if_data *sdata,
  1512. enum nl80211_cqm_rssi_threshold_event rssi_event),
  1513. TP_ARGS(sdata, rssi_event),
  1514. TP_STRUCT__entry(
  1515. VIF_ENTRY
  1516. __field(u32, rssi_event)
  1517. ),
  1518. TP_fast_assign(
  1519. VIF_ASSIGN;
  1520. __entry->rssi_event = rssi_event;
  1521. ),
  1522. TP_printk(
  1523. VIF_PR_FMT " event:%d",
  1524. VIF_PR_ARG, __entry->rssi_event
  1525. )
  1526. );
  1527. DEFINE_EVENT(local_sdata_evt, api_cqm_beacon_loss_notify,
  1528. TP_PROTO(struct ieee80211_local *local,
  1529. struct ieee80211_sub_if_data *sdata),
  1530. TP_ARGS(local, sdata)
  1531. );
  1532. TRACE_EVENT(api_scan_completed,
  1533. TP_PROTO(struct ieee80211_local *local, bool aborted),
  1534. TP_ARGS(local, aborted),
  1535. TP_STRUCT__entry(
  1536. LOCAL_ENTRY
  1537. __field(bool, aborted)
  1538. ),
  1539. TP_fast_assign(
  1540. LOCAL_ASSIGN;
  1541. __entry->aborted = aborted;
  1542. ),
  1543. TP_printk(
  1544. LOCAL_PR_FMT " aborted:%d",
  1545. LOCAL_PR_ARG, __entry->aborted
  1546. )
  1547. );
  1548. TRACE_EVENT(api_sched_scan_results,
  1549. TP_PROTO(struct ieee80211_local *local),
  1550. TP_ARGS(local),
  1551. TP_STRUCT__entry(
  1552. LOCAL_ENTRY
  1553. ),
  1554. TP_fast_assign(
  1555. LOCAL_ASSIGN;
  1556. ),
  1557. TP_printk(
  1558. LOCAL_PR_FMT, LOCAL_PR_ARG
  1559. )
  1560. );
  1561. TRACE_EVENT(api_sched_scan_stopped,
  1562. TP_PROTO(struct ieee80211_local *local),
  1563. TP_ARGS(local),
  1564. TP_STRUCT__entry(
  1565. LOCAL_ENTRY
  1566. ),
  1567. TP_fast_assign(
  1568. LOCAL_ASSIGN;
  1569. ),
  1570. TP_printk(
  1571. LOCAL_PR_FMT, LOCAL_PR_ARG
  1572. )
  1573. );
  1574. TRACE_EVENT(api_sta_block_awake,
  1575. TP_PROTO(struct ieee80211_local *local,
  1576. struct ieee80211_sta *sta, bool block),
  1577. TP_ARGS(local, sta, block),
  1578. TP_STRUCT__entry(
  1579. LOCAL_ENTRY
  1580. STA_ENTRY
  1581. __field(bool, block)
  1582. ),
  1583. TP_fast_assign(
  1584. LOCAL_ASSIGN;
  1585. STA_ASSIGN;
  1586. __entry->block = block;
  1587. ),
  1588. TP_printk(
  1589. LOCAL_PR_FMT STA_PR_FMT " block:%d",
  1590. LOCAL_PR_ARG, STA_PR_ARG, __entry->block
  1591. )
  1592. );
  1593. TRACE_EVENT(api_chswitch_done,
  1594. TP_PROTO(struct ieee80211_sub_if_data *sdata, bool success),
  1595. TP_ARGS(sdata, success),
  1596. TP_STRUCT__entry(
  1597. VIF_ENTRY
  1598. __field(bool, success)
  1599. ),
  1600. TP_fast_assign(
  1601. VIF_ASSIGN;
  1602. __entry->success = success;
  1603. ),
  1604. TP_printk(
  1605. VIF_PR_FMT " success=%d",
  1606. VIF_PR_ARG, __entry->success
  1607. )
  1608. );
  1609. DEFINE_EVENT(local_only_evt, api_ready_on_channel,
  1610. TP_PROTO(struct ieee80211_local *local),
  1611. TP_ARGS(local)
  1612. );
  1613. DEFINE_EVENT(local_only_evt, api_remain_on_channel_expired,
  1614. TP_PROTO(struct ieee80211_local *local),
  1615. TP_ARGS(local)
  1616. );
  1617. TRACE_EVENT(api_gtk_rekey_notify,
  1618. TP_PROTO(struct ieee80211_sub_if_data *sdata,
  1619. const u8 *bssid, const u8 *replay_ctr),
  1620. TP_ARGS(sdata, bssid, replay_ctr),
  1621. TP_STRUCT__entry(
  1622. VIF_ENTRY
  1623. __array(u8, bssid, ETH_ALEN)
  1624. __array(u8, replay_ctr, NL80211_REPLAY_CTR_LEN)
  1625. ),
  1626. TP_fast_assign(
  1627. VIF_ASSIGN;
  1628. memcpy(__entry->bssid, bssid, ETH_ALEN);
  1629. memcpy(__entry->replay_ctr, replay_ctr, NL80211_REPLAY_CTR_LEN);
  1630. ),
  1631. TP_printk(VIF_PR_FMT, VIF_PR_ARG)
  1632. );
  1633. TRACE_EVENT(api_enable_rssi_reports,
  1634. TP_PROTO(struct ieee80211_sub_if_data *sdata,
  1635. int rssi_min_thold, int rssi_max_thold),
  1636. TP_ARGS(sdata, rssi_min_thold, rssi_max_thold),
  1637. TP_STRUCT__entry(
  1638. VIF_ENTRY
  1639. __field(int, rssi_min_thold)
  1640. __field(int, rssi_max_thold)
  1641. ),
  1642. TP_fast_assign(
  1643. VIF_ASSIGN;
  1644. __entry->rssi_min_thold = rssi_min_thold;
  1645. __entry->rssi_max_thold = rssi_max_thold;
  1646. ),
  1647. TP_printk(
  1648. VIF_PR_FMT " rssi_min_thold =%d, rssi_max_thold = %d",
  1649. VIF_PR_ARG, __entry->rssi_min_thold, __entry->rssi_max_thold
  1650. )
  1651. );
  1652. TRACE_EVENT(api_eosp,
  1653. TP_PROTO(struct ieee80211_local *local,
  1654. struct ieee80211_sta *sta),
  1655. TP_ARGS(local, sta),
  1656. TP_STRUCT__entry(
  1657. LOCAL_ENTRY
  1658. STA_ENTRY
  1659. ),
  1660. TP_fast_assign(
  1661. LOCAL_ASSIGN;
  1662. STA_ASSIGN;
  1663. ),
  1664. TP_printk(
  1665. LOCAL_PR_FMT STA_PR_FMT,
  1666. LOCAL_PR_ARG, STA_PR_ARG
  1667. )
  1668. );
  1669. TRACE_EVENT(api_send_eosp_nullfunc,
  1670. TP_PROTO(struct ieee80211_local *local,
  1671. struct ieee80211_sta *sta,
  1672. u8 tid),
  1673. TP_ARGS(local, sta, tid),
  1674. TP_STRUCT__entry(
  1675. LOCAL_ENTRY
  1676. STA_ENTRY
  1677. __field(u8, tid)
  1678. ),
  1679. TP_fast_assign(
  1680. LOCAL_ASSIGN;
  1681. STA_ASSIGN;
  1682. __entry->tid = tid;
  1683. ),
  1684. TP_printk(
  1685. LOCAL_PR_FMT STA_PR_FMT " tid:%d",
  1686. LOCAL_PR_ARG, STA_PR_ARG, __entry->tid
  1687. )
  1688. );
  1689. TRACE_EVENT(api_sta_set_buffered,
  1690. TP_PROTO(struct ieee80211_local *local,
  1691. struct ieee80211_sta *sta,
  1692. u8 tid, bool buffered),
  1693. TP_ARGS(local, sta, tid, buffered),
  1694. TP_STRUCT__entry(
  1695. LOCAL_ENTRY
  1696. STA_ENTRY
  1697. __field(u8, tid)
  1698. __field(bool, buffered)
  1699. ),
  1700. TP_fast_assign(
  1701. LOCAL_ASSIGN;
  1702. STA_ASSIGN;
  1703. __entry->tid = tid;
  1704. __entry->buffered = buffered;
  1705. ),
  1706. TP_printk(
  1707. LOCAL_PR_FMT STA_PR_FMT " tid:%d buffered:%d",
  1708. LOCAL_PR_ARG, STA_PR_ARG, __entry->tid, __entry->buffered
  1709. )
  1710. );
  1711. /*
  1712. * Tracing for internal functions
  1713. * (which may also be called in response to driver calls)
  1714. */
  1715. TRACE_EVENT(wake_queue,
  1716. TP_PROTO(struct ieee80211_local *local, u16 queue,
  1717. enum queue_stop_reason reason),
  1718. TP_ARGS(local, queue, reason),
  1719. TP_STRUCT__entry(
  1720. LOCAL_ENTRY
  1721. __field(u16, queue)
  1722. __field(u32, reason)
  1723. ),
  1724. TP_fast_assign(
  1725. LOCAL_ASSIGN;
  1726. __entry->queue = queue;
  1727. __entry->reason = reason;
  1728. ),
  1729. TP_printk(
  1730. LOCAL_PR_FMT " queue:%d, reason:%d",
  1731. LOCAL_PR_ARG, __entry->queue, __entry->reason
  1732. )
  1733. );
  1734. TRACE_EVENT(stop_queue,
  1735. TP_PROTO(struct ieee80211_local *local, u16 queue,
  1736. enum queue_stop_reason reason),
  1737. TP_ARGS(local, queue, reason),
  1738. TP_STRUCT__entry(
  1739. LOCAL_ENTRY
  1740. __field(u16, queue)
  1741. __field(u32, reason)
  1742. ),
  1743. TP_fast_assign(
  1744. LOCAL_ASSIGN;
  1745. __entry->queue = queue;
  1746. __entry->reason = reason;
  1747. ),
  1748. TP_printk(
  1749. LOCAL_PR_FMT " queue:%d, reason:%d",
  1750. LOCAL_PR_ARG, __entry->queue, __entry->reason
  1751. )
  1752. );
  1753. TRACE_EVENT(drv_set_default_unicast_key,
  1754. TP_PROTO(struct ieee80211_local *local,
  1755. struct ieee80211_sub_if_data *sdata,
  1756. int key_idx),
  1757. TP_ARGS(local, sdata, key_idx),
  1758. TP_STRUCT__entry(
  1759. LOCAL_ENTRY
  1760. VIF_ENTRY
  1761. __field(int, key_idx)
  1762. ),
  1763. TP_fast_assign(
  1764. LOCAL_ASSIGN;
  1765. VIF_ASSIGN;
  1766. __entry->key_idx = key_idx;
  1767. ),
  1768. TP_printk(LOCAL_PR_FMT VIF_PR_FMT " key_idx:%d",
  1769. LOCAL_PR_ARG, VIF_PR_ARG, __entry->key_idx)
  1770. );
  1771. TRACE_EVENT(api_radar_detected,
  1772. TP_PROTO(struct ieee80211_local *local),
  1773. TP_ARGS(local),
  1774. TP_STRUCT__entry(
  1775. LOCAL_ENTRY
  1776. ),
  1777. TP_fast_assign(
  1778. LOCAL_ASSIGN;
  1779. ),
  1780. TP_printk(
  1781. LOCAL_PR_FMT " radar detected",
  1782. LOCAL_PR_ARG
  1783. )
  1784. );
  1785. TRACE_EVENT(drv_channel_switch_beacon,
  1786. TP_PROTO(struct ieee80211_local *local,
  1787. struct ieee80211_sub_if_data *sdata,
  1788. struct cfg80211_chan_def *chandef),
  1789. TP_ARGS(local, sdata, chandef),
  1790. TP_STRUCT__entry(
  1791. LOCAL_ENTRY
  1792. VIF_ENTRY
  1793. CHANDEF_ENTRY
  1794. ),
  1795. TP_fast_assign(
  1796. LOCAL_ASSIGN;
  1797. VIF_ASSIGN;
  1798. CHANDEF_ASSIGN(chandef);
  1799. ),
  1800. TP_printk(
  1801. LOCAL_PR_FMT VIF_PR_FMT " channel switch to " CHANDEF_PR_FMT,
  1802. LOCAL_PR_ARG, VIF_PR_ARG, CHANDEF_PR_ARG
  1803. )
  1804. );
  1805. TRACE_EVENT(drv_pre_channel_switch,
  1806. TP_PROTO(struct ieee80211_local *local,
  1807. struct ieee80211_sub_if_data *sdata,
  1808. struct ieee80211_channel_switch *ch_switch),
  1809. TP_ARGS(local, sdata, ch_switch),
  1810. TP_STRUCT__entry(
  1811. LOCAL_ENTRY
  1812. VIF_ENTRY
  1813. CHANDEF_ENTRY
  1814. __field(u64, timestamp)
  1815. __field(u32, device_timestamp)
  1816. __field(bool, block_tx)
  1817. __field(u8, count)
  1818. ),
  1819. TP_fast_assign(
  1820. LOCAL_ASSIGN;
  1821. VIF_ASSIGN;
  1822. CHANDEF_ASSIGN(&ch_switch->chandef)
  1823. __entry->timestamp = ch_switch->timestamp;
  1824. __entry->device_timestamp = ch_switch->device_timestamp;
  1825. __entry->block_tx = ch_switch->block_tx;
  1826. __entry->count = ch_switch->count;
  1827. ),
  1828. TP_printk(
  1829. LOCAL_PR_FMT VIF_PR_FMT " prepare channel switch to "
  1830. CHANDEF_PR_FMT " count:%d block_tx:%d timestamp:%llu",
  1831. LOCAL_PR_ARG, VIF_PR_ARG, CHANDEF_PR_ARG, __entry->count,
  1832. __entry->block_tx, __entry->timestamp
  1833. )
  1834. );
  1835. DEFINE_EVENT(local_sdata_evt, drv_post_channel_switch,
  1836. TP_PROTO(struct ieee80211_local *local,
  1837. struct ieee80211_sub_if_data *sdata),
  1838. TP_ARGS(local, sdata)
  1839. );
  1840. TRACE_EVENT(drv_get_txpower,
  1841. TP_PROTO(struct ieee80211_local *local,
  1842. struct ieee80211_sub_if_data *sdata,
  1843. int dbm, int ret),
  1844. TP_ARGS(local, sdata, dbm, ret),
  1845. TP_STRUCT__entry(
  1846. LOCAL_ENTRY
  1847. VIF_ENTRY
  1848. __field(int, dbm)
  1849. __field(int, ret)
  1850. ),
  1851. TP_fast_assign(
  1852. LOCAL_ASSIGN;
  1853. VIF_ASSIGN;
  1854. __entry->dbm = dbm;
  1855. __entry->ret = ret;
  1856. ),
  1857. TP_printk(
  1858. LOCAL_PR_FMT VIF_PR_FMT " dbm:%d ret:%d",
  1859. LOCAL_PR_ARG, VIF_PR_ARG, __entry->dbm, __entry->ret
  1860. )
  1861. );
  1862. TRACE_EVENT(drv_tdls_channel_switch,
  1863. TP_PROTO(struct ieee80211_local *local,
  1864. struct ieee80211_sub_if_data *sdata,
  1865. struct ieee80211_sta *sta, u8 oper_class,
  1866. struct cfg80211_chan_def *chandef),
  1867. TP_ARGS(local, sdata, sta, oper_class, chandef),
  1868. TP_STRUCT__entry(
  1869. LOCAL_ENTRY
  1870. VIF_ENTRY
  1871. STA_ENTRY
  1872. __field(u8, oper_class)
  1873. CHANDEF_ENTRY
  1874. ),
  1875. TP_fast_assign(
  1876. LOCAL_ASSIGN;
  1877. VIF_ASSIGN;
  1878. STA_ASSIGN;
  1879. __entry->oper_class = oper_class;
  1880. CHANDEF_ASSIGN(chandef)
  1881. ),
  1882. TP_printk(
  1883. LOCAL_PR_FMT VIF_PR_FMT " tdls channel switch to"
  1884. CHANDEF_PR_FMT " oper_class:%d " STA_PR_FMT,
  1885. LOCAL_PR_ARG, VIF_PR_ARG, CHANDEF_PR_ARG, __entry->oper_class,
  1886. STA_PR_ARG
  1887. )
  1888. );
  1889. TRACE_EVENT(drv_tdls_cancel_channel_switch,
  1890. TP_PROTO(struct ieee80211_local *local,
  1891. struct ieee80211_sub_if_data *sdata,
  1892. struct ieee80211_sta *sta),
  1893. TP_ARGS(local, sdata, sta),
  1894. TP_STRUCT__entry(
  1895. LOCAL_ENTRY
  1896. VIF_ENTRY
  1897. STA_ENTRY
  1898. ),
  1899. TP_fast_assign(
  1900. LOCAL_ASSIGN;
  1901. VIF_ASSIGN;
  1902. STA_ASSIGN;
  1903. ),
  1904. TP_printk(
  1905. LOCAL_PR_FMT VIF_PR_FMT
  1906. " tdls cancel channel switch with " STA_PR_FMT,
  1907. LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
  1908. )
  1909. );
  1910. TRACE_EVENT(drv_tdls_recv_channel_switch,
  1911. TP_PROTO(struct ieee80211_local *local,
  1912. struct ieee80211_sub_if_data *sdata,
  1913. struct ieee80211_tdls_ch_sw_params *params),
  1914. TP_ARGS(local, sdata, params),
  1915. TP_STRUCT__entry(
  1916. LOCAL_ENTRY
  1917. VIF_ENTRY
  1918. __field(u8, action_code)
  1919. STA_ENTRY
  1920. CHANDEF_ENTRY
  1921. __field(u32, status)
  1922. __field(bool, peer_initiator)
  1923. __field(u32, timestamp)
  1924. __field(u16, switch_time)
  1925. __field(u16, switch_timeout)
  1926. ),
  1927. TP_fast_assign(
  1928. LOCAL_ASSIGN;
  1929. VIF_ASSIGN;
  1930. STA_NAMED_ASSIGN(params->sta);
  1931. CHANDEF_ASSIGN(params->chandef)
  1932. __entry->peer_initiator = params->sta->tdls_initiator;
  1933. __entry->action_code = params->action_code;
  1934. __entry->status = params->status;
  1935. __entry->timestamp = params->timestamp;
  1936. __entry->switch_time = params->switch_time;
  1937. __entry->switch_timeout = params->switch_timeout;
  1938. ),
  1939. TP_printk(
  1940. LOCAL_PR_FMT VIF_PR_FMT " received tdls channel switch packet"
  1941. " action:%d status:%d time:%d switch time:%d switch"
  1942. " timeout:%d initiator: %d chan:" CHANDEF_PR_FMT STA_PR_FMT,
  1943. LOCAL_PR_ARG, VIF_PR_ARG, __entry->action_code, __entry->status,
  1944. __entry->timestamp, __entry->switch_time,
  1945. __entry->switch_timeout, __entry->peer_initiator,
  1946. CHANDEF_PR_ARG, STA_PR_ARG
  1947. )
  1948. );
  1949. TRACE_EVENT(drv_wake_tx_queue,
  1950. TP_PROTO(struct ieee80211_local *local,
  1951. struct ieee80211_sub_if_data *sdata,
  1952. struct txq_info *txq),
  1953. TP_ARGS(local, sdata, txq),
  1954. TP_STRUCT__entry(
  1955. LOCAL_ENTRY
  1956. VIF_ENTRY
  1957. STA_ENTRY
  1958. __field(u8, ac)
  1959. __field(u8, tid)
  1960. ),
  1961. TP_fast_assign(
  1962. struct ieee80211_sta *sta = txq->txq.sta;
  1963. LOCAL_ASSIGN;
  1964. VIF_ASSIGN;
  1965. STA_ASSIGN;
  1966. __entry->ac = txq->txq.ac;
  1967. __entry->tid = txq->txq.tid;
  1968. ),
  1969. TP_printk(
  1970. LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " ac:%d tid:%d",
  1971. LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->ac, __entry->tid
  1972. )
  1973. );
  1974. #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
  1975. #undef TRACE_INCLUDE_PATH
  1976. #define TRACE_INCLUDE_PATH .
  1977. #undef TRACE_INCLUDE_FILE
  1978. #define TRACE_INCLUDE_FILE trace
  1979. #include <trace/define_trace.h>