trace.h 49 KB

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