driver-trace.h 26 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349
  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. #if !defined(CONFIG_MAC80211_DRIVER_API_TRACER) || defined(__CHECKER__)
  7. #undef TRACE_EVENT
  8. #define TRACE_EVENT(name, proto, ...) \
  9. static inline void trace_ ## name(proto) {}
  10. #undef DECLARE_EVENT_CLASS
  11. #define DECLARE_EVENT_CLASS(...)
  12. #undef DEFINE_EVENT
  13. #define DEFINE_EVENT(evt_class, name, proto, ...) \
  14. static inline void trace_ ## name(proto) {}
  15. #endif
  16. #undef TRACE_SYSTEM
  17. #define TRACE_SYSTEM mac80211
  18. #define MAXNAME 32
  19. #define LOCAL_ENTRY __array(char, wiphy_name, 32)
  20. #define LOCAL_ASSIGN strlcpy(__entry->wiphy_name, wiphy_name(local->hw.wiphy), MAXNAME)
  21. #define LOCAL_PR_FMT "%s"
  22. #define LOCAL_PR_ARG __entry->wiphy_name
  23. #define STA_ENTRY __array(char, sta_addr, ETH_ALEN)
  24. #define STA_ASSIGN (sta ? memcpy(__entry->sta_addr, sta->addr, ETH_ALEN) : memset(__entry->sta_addr, 0, ETH_ALEN))
  25. #define STA_PR_FMT " sta:%pM"
  26. #define STA_PR_ARG __entry->sta_addr
  27. #define VIF_ENTRY __field(enum nl80211_iftype, vif_type) __field(void *, sdata) \
  28. __field(bool, p2p) \
  29. __string(vif_name, sdata->dev ? sdata->dev->name : "<nodev>")
  30. #define VIF_ASSIGN __entry->vif_type = sdata->vif.type; __entry->sdata = sdata; \
  31. __entry->p2p = sdata->vif.p2p; \
  32. __assign_str(vif_name, sdata->dev ? sdata->dev->name : "<nodev>")
  33. #define VIF_PR_FMT " vif:%s(%d%s)"
  34. #define VIF_PR_ARG __get_str(vif_name), __entry->vif_type, __entry->p2p ? "/p2p" : ""
  35. /*
  36. * Tracing for driver callbacks.
  37. */
  38. DECLARE_EVENT_CLASS(local_only_evt,
  39. TP_PROTO(struct ieee80211_local *local),
  40. TP_ARGS(local),
  41. TP_STRUCT__entry(
  42. LOCAL_ENTRY
  43. ),
  44. TP_fast_assign(
  45. LOCAL_ASSIGN;
  46. ),
  47. TP_printk(LOCAL_PR_FMT, LOCAL_PR_ARG)
  48. );
  49. DECLARE_EVENT_CLASS(local_sdata_addr_evt,
  50. TP_PROTO(struct ieee80211_local *local,
  51. struct ieee80211_sub_if_data *sdata),
  52. TP_ARGS(local, sdata),
  53. TP_STRUCT__entry(
  54. LOCAL_ENTRY
  55. VIF_ENTRY
  56. __array(char, addr, 6)
  57. ),
  58. TP_fast_assign(
  59. LOCAL_ASSIGN;
  60. VIF_ASSIGN;
  61. memcpy(__entry->addr, sdata->vif.addr, 6);
  62. ),
  63. TP_printk(
  64. LOCAL_PR_FMT VIF_PR_FMT " addr:%pM",
  65. LOCAL_PR_ARG, VIF_PR_ARG, __entry->addr
  66. )
  67. );
  68. DECLARE_EVENT_CLASS(local_u32_evt,
  69. TP_PROTO(struct ieee80211_local *local, u32 value),
  70. TP_ARGS(local, value),
  71. TP_STRUCT__entry(
  72. LOCAL_ENTRY
  73. __field(u32, value)
  74. ),
  75. TP_fast_assign(
  76. LOCAL_ASSIGN;
  77. __entry->value = value;
  78. ),
  79. TP_printk(
  80. LOCAL_PR_FMT " value:%d",
  81. LOCAL_PR_ARG, __entry->value
  82. )
  83. );
  84. DECLARE_EVENT_CLASS(local_sdata_evt,
  85. TP_PROTO(struct ieee80211_local *local,
  86. struct ieee80211_sub_if_data *sdata),
  87. TP_ARGS(local, sdata),
  88. TP_STRUCT__entry(
  89. LOCAL_ENTRY
  90. VIF_ENTRY
  91. ),
  92. TP_fast_assign(
  93. LOCAL_ASSIGN;
  94. VIF_ASSIGN;
  95. ),
  96. TP_printk(
  97. LOCAL_PR_FMT VIF_PR_FMT,
  98. LOCAL_PR_ARG, VIF_PR_ARG
  99. )
  100. );
  101. DEFINE_EVENT(local_only_evt, drv_return_void,
  102. TP_PROTO(struct ieee80211_local *local),
  103. TP_ARGS(local)
  104. );
  105. TRACE_EVENT(drv_return_int,
  106. TP_PROTO(struct ieee80211_local *local, int ret),
  107. TP_ARGS(local, ret),
  108. TP_STRUCT__entry(
  109. LOCAL_ENTRY
  110. __field(int, ret)
  111. ),
  112. TP_fast_assign(
  113. LOCAL_ASSIGN;
  114. __entry->ret = ret;
  115. ),
  116. TP_printk(LOCAL_PR_FMT " - %d", LOCAL_PR_ARG, __entry->ret)
  117. );
  118. TRACE_EVENT(drv_return_bool,
  119. TP_PROTO(struct ieee80211_local *local, bool ret),
  120. TP_ARGS(local, ret),
  121. TP_STRUCT__entry(
  122. LOCAL_ENTRY
  123. __field(bool, ret)
  124. ),
  125. TP_fast_assign(
  126. LOCAL_ASSIGN;
  127. __entry->ret = ret;
  128. ),
  129. TP_printk(LOCAL_PR_FMT " - %s", LOCAL_PR_ARG, (__entry->ret) ?
  130. "true" : "false")
  131. );
  132. TRACE_EVENT(drv_return_u64,
  133. TP_PROTO(struct ieee80211_local *local, u64 ret),
  134. TP_ARGS(local, ret),
  135. TP_STRUCT__entry(
  136. LOCAL_ENTRY
  137. __field(u64, ret)
  138. ),
  139. TP_fast_assign(
  140. LOCAL_ASSIGN;
  141. __entry->ret = ret;
  142. ),
  143. TP_printk(LOCAL_PR_FMT " - %llu", LOCAL_PR_ARG, __entry->ret)
  144. );
  145. DEFINE_EVENT(local_only_evt, drv_start,
  146. TP_PROTO(struct ieee80211_local *local),
  147. TP_ARGS(local)
  148. );
  149. DEFINE_EVENT(local_only_evt, drv_suspend,
  150. TP_PROTO(struct ieee80211_local *local),
  151. TP_ARGS(local)
  152. );
  153. DEFINE_EVENT(local_only_evt, drv_resume,
  154. TP_PROTO(struct ieee80211_local *local),
  155. TP_ARGS(local)
  156. );
  157. DEFINE_EVENT(local_only_evt, drv_stop,
  158. TP_PROTO(struct ieee80211_local *local),
  159. TP_ARGS(local)
  160. );
  161. DEFINE_EVENT(local_sdata_addr_evt, drv_add_interface,
  162. TP_PROTO(struct ieee80211_local *local,
  163. struct ieee80211_sub_if_data *sdata),
  164. TP_ARGS(local, sdata)
  165. );
  166. TRACE_EVENT(drv_change_interface,
  167. TP_PROTO(struct ieee80211_local *local,
  168. struct ieee80211_sub_if_data *sdata,
  169. enum nl80211_iftype type, bool p2p),
  170. TP_ARGS(local, sdata, type, p2p),
  171. TP_STRUCT__entry(
  172. LOCAL_ENTRY
  173. VIF_ENTRY
  174. __field(u32, new_type)
  175. __field(bool, new_p2p)
  176. ),
  177. TP_fast_assign(
  178. LOCAL_ASSIGN;
  179. VIF_ASSIGN;
  180. __entry->new_type = type;
  181. __entry->new_p2p = p2p;
  182. ),
  183. TP_printk(
  184. LOCAL_PR_FMT VIF_PR_FMT " new type:%d%s",
  185. LOCAL_PR_ARG, VIF_PR_ARG, __entry->new_type,
  186. __entry->new_p2p ? "/p2p" : ""
  187. )
  188. );
  189. DEFINE_EVENT(local_sdata_addr_evt, drv_remove_interface,
  190. TP_PROTO(struct ieee80211_local *local,
  191. struct ieee80211_sub_if_data *sdata),
  192. TP_ARGS(local, sdata)
  193. );
  194. TRACE_EVENT(drv_config,
  195. TP_PROTO(struct ieee80211_local *local,
  196. u32 changed),
  197. TP_ARGS(local, changed),
  198. TP_STRUCT__entry(
  199. LOCAL_ENTRY
  200. __field(u32, changed)
  201. __field(u32, flags)
  202. __field(int, power_level)
  203. __field(int, dynamic_ps_timeout)
  204. __field(int, max_sleep_period)
  205. __field(u16, listen_interval)
  206. __field(u8, long_frame_max_tx_count)
  207. __field(u8, short_frame_max_tx_count)
  208. __field(int, center_freq)
  209. __field(int, channel_type)
  210. __field(int, smps)
  211. ),
  212. TP_fast_assign(
  213. LOCAL_ASSIGN;
  214. __entry->changed = changed;
  215. __entry->flags = local->hw.conf.flags;
  216. __entry->power_level = local->hw.conf.power_level;
  217. __entry->dynamic_ps_timeout = local->hw.conf.dynamic_ps_timeout;
  218. __entry->max_sleep_period = local->hw.conf.max_sleep_period;
  219. __entry->listen_interval = local->hw.conf.listen_interval;
  220. __entry->long_frame_max_tx_count = local->hw.conf.long_frame_max_tx_count;
  221. __entry->short_frame_max_tx_count = local->hw.conf.short_frame_max_tx_count;
  222. __entry->center_freq = local->hw.conf.channel->center_freq;
  223. __entry->channel_type = local->hw.conf.channel_type;
  224. __entry->smps = local->hw.conf.smps_mode;
  225. ),
  226. TP_printk(
  227. LOCAL_PR_FMT " ch:%#x freq:%d",
  228. LOCAL_PR_ARG, __entry->changed, __entry->center_freq
  229. )
  230. );
  231. TRACE_EVENT(drv_bss_info_changed,
  232. TP_PROTO(struct ieee80211_local *local,
  233. struct ieee80211_sub_if_data *sdata,
  234. struct ieee80211_bss_conf *info,
  235. u32 changed),
  236. TP_ARGS(local, sdata, info, changed),
  237. TP_STRUCT__entry(
  238. LOCAL_ENTRY
  239. VIF_ENTRY
  240. __field(bool, assoc)
  241. __field(u16, aid)
  242. __field(bool, cts)
  243. __field(bool, shortpre)
  244. __field(bool, shortslot)
  245. __field(u8, dtimper)
  246. __field(u16, bcnint)
  247. __field(u16, assoc_cap)
  248. __field(u64, timestamp)
  249. __field(u32, basic_rates)
  250. __field(u32, changed)
  251. __field(bool, enable_beacon)
  252. __field(u16, ht_operation_mode)
  253. ),
  254. TP_fast_assign(
  255. LOCAL_ASSIGN;
  256. VIF_ASSIGN;
  257. __entry->changed = changed;
  258. __entry->aid = info->aid;
  259. __entry->assoc = info->assoc;
  260. __entry->shortpre = info->use_short_preamble;
  261. __entry->cts = info->use_cts_prot;
  262. __entry->shortslot = info->use_short_slot;
  263. __entry->dtimper = info->dtim_period;
  264. __entry->bcnint = info->beacon_int;
  265. __entry->assoc_cap = info->assoc_capability;
  266. __entry->timestamp = info->timestamp;
  267. __entry->basic_rates = info->basic_rates;
  268. __entry->enable_beacon = info->enable_beacon;
  269. __entry->ht_operation_mode = info->ht_operation_mode;
  270. ),
  271. TP_printk(
  272. LOCAL_PR_FMT VIF_PR_FMT " changed:%#x",
  273. LOCAL_PR_ARG, VIF_PR_ARG, __entry->changed
  274. )
  275. );
  276. TRACE_EVENT(drv_prepare_multicast,
  277. TP_PROTO(struct ieee80211_local *local, int mc_count),
  278. TP_ARGS(local, mc_count),
  279. TP_STRUCT__entry(
  280. LOCAL_ENTRY
  281. __field(int, mc_count)
  282. ),
  283. TP_fast_assign(
  284. LOCAL_ASSIGN;
  285. __entry->mc_count = mc_count;
  286. ),
  287. TP_printk(
  288. LOCAL_PR_FMT " prepare mc (%d)",
  289. LOCAL_PR_ARG, __entry->mc_count
  290. )
  291. );
  292. TRACE_EVENT(drv_configure_filter,
  293. TP_PROTO(struct ieee80211_local *local,
  294. unsigned int changed_flags,
  295. unsigned int *total_flags,
  296. u64 multicast),
  297. TP_ARGS(local, changed_flags, total_flags, multicast),
  298. TP_STRUCT__entry(
  299. LOCAL_ENTRY
  300. __field(unsigned int, changed)
  301. __field(unsigned int, total)
  302. __field(u64, multicast)
  303. ),
  304. TP_fast_assign(
  305. LOCAL_ASSIGN;
  306. __entry->changed = changed_flags;
  307. __entry->total = *total_flags;
  308. __entry->multicast = multicast;
  309. ),
  310. TP_printk(
  311. LOCAL_PR_FMT " changed:%#x total:%#x",
  312. LOCAL_PR_ARG, __entry->changed, __entry->total
  313. )
  314. );
  315. TRACE_EVENT(drv_set_tim,
  316. TP_PROTO(struct ieee80211_local *local,
  317. struct ieee80211_sta *sta, bool set),
  318. TP_ARGS(local, sta, set),
  319. TP_STRUCT__entry(
  320. LOCAL_ENTRY
  321. STA_ENTRY
  322. __field(bool, set)
  323. ),
  324. TP_fast_assign(
  325. LOCAL_ASSIGN;
  326. STA_ASSIGN;
  327. __entry->set = set;
  328. ),
  329. TP_printk(
  330. LOCAL_PR_FMT STA_PR_FMT " set:%d",
  331. LOCAL_PR_ARG, STA_PR_FMT, __entry->set
  332. )
  333. );
  334. TRACE_EVENT(drv_set_key,
  335. TP_PROTO(struct ieee80211_local *local,
  336. enum set_key_cmd cmd, struct ieee80211_sub_if_data *sdata,
  337. struct ieee80211_sta *sta,
  338. struct ieee80211_key_conf *key),
  339. TP_ARGS(local, cmd, sdata, sta, key),
  340. TP_STRUCT__entry(
  341. LOCAL_ENTRY
  342. VIF_ENTRY
  343. STA_ENTRY
  344. __field(u32, cipher)
  345. __field(u8, hw_key_idx)
  346. __field(u8, flags)
  347. __field(s8, keyidx)
  348. ),
  349. TP_fast_assign(
  350. LOCAL_ASSIGN;
  351. VIF_ASSIGN;
  352. STA_ASSIGN;
  353. __entry->cipher = key->cipher;
  354. __entry->flags = key->flags;
  355. __entry->keyidx = key->keyidx;
  356. __entry->hw_key_idx = key->hw_key_idx;
  357. ),
  358. TP_printk(
  359. LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
  360. LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
  361. )
  362. );
  363. TRACE_EVENT(drv_update_tkip_key,
  364. TP_PROTO(struct ieee80211_local *local,
  365. struct ieee80211_sub_if_data *sdata,
  366. struct ieee80211_key_conf *conf,
  367. struct ieee80211_sta *sta, u32 iv32),
  368. TP_ARGS(local, sdata, conf, sta, iv32),
  369. TP_STRUCT__entry(
  370. LOCAL_ENTRY
  371. VIF_ENTRY
  372. STA_ENTRY
  373. __field(u32, iv32)
  374. ),
  375. TP_fast_assign(
  376. LOCAL_ASSIGN;
  377. VIF_ASSIGN;
  378. STA_ASSIGN;
  379. __entry->iv32 = iv32;
  380. ),
  381. TP_printk(
  382. LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " iv32:%#x",
  383. LOCAL_PR_ARG,VIF_PR_ARG,STA_PR_ARG, __entry->iv32
  384. )
  385. );
  386. DEFINE_EVENT(local_sdata_evt, drv_hw_scan,
  387. TP_PROTO(struct ieee80211_local *local,
  388. struct ieee80211_sub_if_data *sdata),
  389. TP_ARGS(local, sdata)
  390. );
  391. DEFINE_EVENT(local_sdata_evt, drv_sched_scan_start,
  392. TP_PROTO(struct ieee80211_local *local,
  393. struct ieee80211_sub_if_data *sdata),
  394. TP_ARGS(local, sdata)
  395. );
  396. DEFINE_EVENT(local_sdata_evt, drv_sched_scan_stop,
  397. TP_PROTO(struct ieee80211_local *local,
  398. struct ieee80211_sub_if_data *sdata),
  399. TP_ARGS(local, sdata)
  400. );
  401. DEFINE_EVENT(local_only_evt, drv_sw_scan_start,
  402. TP_PROTO(struct ieee80211_local *local),
  403. TP_ARGS(local)
  404. );
  405. DEFINE_EVENT(local_only_evt, drv_sw_scan_complete,
  406. TP_PROTO(struct ieee80211_local *local),
  407. TP_ARGS(local)
  408. );
  409. TRACE_EVENT(drv_get_stats,
  410. TP_PROTO(struct ieee80211_local *local,
  411. struct ieee80211_low_level_stats *stats,
  412. int ret),
  413. TP_ARGS(local, stats, ret),
  414. TP_STRUCT__entry(
  415. LOCAL_ENTRY
  416. __field(int, ret)
  417. __field(unsigned int, ackfail)
  418. __field(unsigned int, rtsfail)
  419. __field(unsigned int, fcserr)
  420. __field(unsigned int, rtssucc)
  421. ),
  422. TP_fast_assign(
  423. LOCAL_ASSIGN;
  424. __entry->ret = ret;
  425. __entry->ackfail = stats->dot11ACKFailureCount;
  426. __entry->rtsfail = stats->dot11RTSFailureCount;
  427. __entry->fcserr = stats->dot11FCSErrorCount;
  428. __entry->rtssucc = stats->dot11RTSSuccessCount;
  429. ),
  430. TP_printk(
  431. LOCAL_PR_FMT " ret:%d",
  432. LOCAL_PR_ARG, __entry->ret
  433. )
  434. );
  435. TRACE_EVENT(drv_get_tkip_seq,
  436. TP_PROTO(struct ieee80211_local *local,
  437. u8 hw_key_idx, u32 *iv32, u16 *iv16),
  438. TP_ARGS(local, hw_key_idx, iv32, iv16),
  439. TP_STRUCT__entry(
  440. LOCAL_ENTRY
  441. __field(u8, hw_key_idx)
  442. __field(u32, iv32)
  443. __field(u16, iv16)
  444. ),
  445. TP_fast_assign(
  446. LOCAL_ASSIGN;
  447. __entry->hw_key_idx = hw_key_idx;
  448. __entry->iv32 = *iv32;
  449. __entry->iv16 = *iv16;
  450. ),
  451. TP_printk(
  452. LOCAL_PR_FMT, LOCAL_PR_ARG
  453. )
  454. );
  455. DEFINE_EVENT(local_u32_evt, drv_set_frag_threshold,
  456. TP_PROTO(struct ieee80211_local *local, u32 value),
  457. TP_ARGS(local, value)
  458. );
  459. DEFINE_EVENT(local_u32_evt, drv_set_rts_threshold,
  460. TP_PROTO(struct ieee80211_local *local, u32 value),
  461. TP_ARGS(local, value)
  462. );
  463. TRACE_EVENT(drv_set_coverage_class,
  464. TP_PROTO(struct ieee80211_local *local, u8 value),
  465. TP_ARGS(local, value),
  466. TP_STRUCT__entry(
  467. LOCAL_ENTRY
  468. __field(u8, value)
  469. ),
  470. TP_fast_assign(
  471. LOCAL_ASSIGN;
  472. __entry->value = value;
  473. ),
  474. TP_printk(
  475. LOCAL_PR_FMT " value:%d",
  476. LOCAL_PR_ARG, __entry->value
  477. )
  478. );
  479. TRACE_EVENT(drv_sta_notify,
  480. TP_PROTO(struct ieee80211_local *local,
  481. struct ieee80211_sub_if_data *sdata,
  482. enum sta_notify_cmd cmd,
  483. struct ieee80211_sta *sta),
  484. TP_ARGS(local, sdata, cmd, sta),
  485. TP_STRUCT__entry(
  486. LOCAL_ENTRY
  487. VIF_ENTRY
  488. STA_ENTRY
  489. __field(u32, cmd)
  490. ),
  491. TP_fast_assign(
  492. LOCAL_ASSIGN;
  493. VIF_ASSIGN;
  494. STA_ASSIGN;
  495. __entry->cmd = cmd;
  496. ),
  497. TP_printk(
  498. LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " cmd:%d",
  499. LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->cmd
  500. )
  501. );
  502. TRACE_EVENT(drv_sta_add,
  503. TP_PROTO(struct ieee80211_local *local,
  504. struct ieee80211_sub_if_data *sdata,
  505. struct ieee80211_sta *sta),
  506. TP_ARGS(local, sdata, sta),
  507. TP_STRUCT__entry(
  508. LOCAL_ENTRY
  509. VIF_ENTRY
  510. STA_ENTRY
  511. ),
  512. TP_fast_assign(
  513. LOCAL_ASSIGN;
  514. VIF_ASSIGN;
  515. STA_ASSIGN;
  516. ),
  517. TP_printk(
  518. LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
  519. LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
  520. )
  521. );
  522. TRACE_EVENT(drv_sta_remove,
  523. TP_PROTO(struct ieee80211_local *local,
  524. struct ieee80211_sub_if_data *sdata,
  525. struct ieee80211_sta *sta),
  526. TP_ARGS(local, sdata, sta),
  527. TP_STRUCT__entry(
  528. LOCAL_ENTRY
  529. VIF_ENTRY
  530. STA_ENTRY
  531. ),
  532. TP_fast_assign(
  533. LOCAL_ASSIGN;
  534. VIF_ASSIGN;
  535. STA_ASSIGN;
  536. ),
  537. TP_printk(
  538. LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT,
  539. LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG
  540. )
  541. );
  542. TRACE_EVENT(drv_conf_tx,
  543. TP_PROTO(struct ieee80211_local *local, u16 queue,
  544. const struct ieee80211_tx_queue_params *params),
  545. TP_ARGS(local, queue, params),
  546. TP_STRUCT__entry(
  547. LOCAL_ENTRY
  548. __field(u16, queue)
  549. __field(u16, txop)
  550. __field(u16, cw_min)
  551. __field(u16, cw_max)
  552. __field(u8, aifs)
  553. ),
  554. TP_fast_assign(
  555. LOCAL_ASSIGN;
  556. __entry->queue = queue;
  557. __entry->txop = params->txop;
  558. __entry->cw_max = params->cw_max;
  559. __entry->cw_min = params->cw_min;
  560. __entry->aifs = params->aifs;
  561. ),
  562. TP_printk(
  563. LOCAL_PR_FMT " queue:%d",
  564. LOCAL_PR_ARG, __entry->queue
  565. )
  566. );
  567. DEFINE_EVENT(local_only_evt, drv_get_tsf,
  568. TP_PROTO(struct ieee80211_local *local),
  569. TP_ARGS(local)
  570. );
  571. TRACE_EVENT(drv_set_tsf,
  572. TP_PROTO(struct ieee80211_local *local, u64 tsf),
  573. TP_ARGS(local, tsf),
  574. TP_STRUCT__entry(
  575. LOCAL_ENTRY
  576. __field(u64, tsf)
  577. ),
  578. TP_fast_assign(
  579. LOCAL_ASSIGN;
  580. __entry->tsf = tsf;
  581. ),
  582. TP_printk(
  583. LOCAL_PR_FMT " tsf:%llu",
  584. LOCAL_PR_ARG, (unsigned long long)__entry->tsf
  585. )
  586. );
  587. DEFINE_EVENT(local_only_evt, drv_reset_tsf,
  588. TP_PROTO(struct ieee80211_local *local),
  589. TP_ARGS(local)
  590. );
  591. DEFINE_EVENT(local_only_evt, drv_tx_last_beacon,
  592. TP_PROTO(struct ieee80211_local *local),
  593. TP_ARGS(local)
  594. );
  595. TRACE_EVENT(drv_ampdu_action,
  596. TP_PROTO(struct ieee80211_local *local,
  597. struct ieee80211_sub_if_data *sdata,
  598. enum ieee80211_ampdu_mlme_action action,
  599. struct ieee80211_sta *sta, u16 tid,
  600. u16 *ssn, u8 buf_size),
  601. TP_ARGS(local, sdata, action, sta, tid, ssn, buf_size),
  602. TP_STRUCT__entry(
  603. LOCAL_ENTRY
  604. STA_ENTRY
  605. __field(u32, action)
  606. __field(u16, tid)
  607. __field(u16, ssn)
  608. __field(u8, buf_size)
  609. VIF_ENTRY
  610. ),
  611. TP_fast_assign(
  612. LOCAL_ASSIGN;
  613. VIF_ASSIGN;
  614. STA_ASSIGN;
  615. __entry->action = action;
  616. __entry->tid = tid;
  617. __entry->ssn = ssn ? *ssn : 0;
  618. __entry->buf_size = buf_size;
  619. ),
  620. TP_printk(
  621. LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " action:%d tid:%d buf:%d",
  622. LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->action,
  623. __entry->tid, __entry->buf_size
  624. )
  625. );
  626. TRACE_EVENT(drv_get_survey,
  627. TP_PROTO(struct ieee80211_local *local, int idx,
  628. struct survey_info *survey),
  629. TP_ARGS(local, idx, survey),
  630. TP_STRUCT__entry(
  631. LOCAL_ENTRY
  632. __field(int, idx)
  633. ),
  634. TP_fast_assign(
  635. LOCAL_ASSIGN;
  636. __entry->idx = idx;
  637. ),
  638. TP_printk(
  639. LOCAL_PR_FMT " idx:%d",
  640. LOCAL_PR_ARG, __entry->idx
  641. )
  642. );
  643. TRACE_EVENT(drv_flush,
  644. TP_PROTO(struct ieee80211_local *local, bool drop),
  645. TP_ARGS(local, drop),
  646. TP_STRUCT__entry(
  647. LOCAL_ENTRY
  648. __field(bool, drop)
  649. ),
  650. TP_fast_assign(
  651. LOCAL_ASSIGN;
  652. __entry->drop = drop;
  653. ),
  654. TP_printk(
  655. LOCAL_PR_FMT " drop:%d",
  656. LOCAL_PR_ARG, __entry->drop
  657. )
  658. );
  659. TRACE_EVENT(drv_channel_switch,
  660. TP_PROTO(struct ieee80211_local *local,
  661. struct ieee80211_channel_switch *ch_switch),
  662. TP_ARGS(local, ch_switch),
  663. TP_STRUCT__entry(
  664. LOCAL_ENTRY
  665. __field(u64, timestamp)
  666. __field(bool, block_tx)
  667. __field(u16, freq)
  668. __field(u8, count)
  669. ),
  670. TP_fast_assign(
  671. LOCAL_ASSIGN;
  672. __entry->timestamp = ch_switch->timestamp;
  673. __entry->block_tx = ch_switch->block_tx;
  674. __entry->freq = ch_switch->channel->center_freq;
  675. __entry->count = ch_switch->count;
  676. ),
  677. TP_printk(
  678. LOCAL_PR_FMT " new freq:%u count:%d",
  679. LOCAL_PR_ARG, __entry->freq, __entry->count
  680. )
  681. );
  682. TRACE_EVENT(drv_set_antenna,
  683. TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),
  684. TP_ARGS(local, tx_ant, rx_ant, ret),
  685. TP_STRUCT__entry(
  686. LOCAL_ENTRY
  687. __field(u32, tx_ant)
  688. __field(u32, rx_ant)
  689. __field(int, ret)
  690. ),
  691. TP_fast_assign(
  692. LOCAL_ASSIGN;
  693. __entry->tx_ant = tx_ant;
  694. __entry->rx_ant = rx_ant;
  695. __entry->ret = ret;
  696. ),
  697. TP_printk(
  698. LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
  699. LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
  700. )
  701. );
  702. TRACE_EVENT(drv_get_antenna,
  703. TP_PROTO(struct ieee80211_local *local, u32 tx_ant, u32 rx_ant, int ret),
  704. TP_ARGS(local, tx_ant, rx_ant, ret),
  705. TP_STRUCT__entry(
  706. LOCAL_ENTRY
  707. __field(u32, tx_ant)
  708. __field(u32, rx_ant)
  709. __field(int, ret)
  710. ),
  711. TP_fast_assign(
  712. LOCAL_ASSIGN;
  713. __entry->tx_ant = tx_ant;
  714. __entry->rx_ant = rx_ant;
  715. __entry->ret = ret;
  716. ),
  717. TP_printk(
  718. LOCAL_PR_FMT " tx_ant:%d rx_ant:%d ret:%d",
  719. LOCAL_PR_ARG, __entry->tx_ant, __entry->rx_ant, __entry->ret
  720. )
  721. );
  722. TRACE_EVENT(drv_remain_on_channel,
  723. TP_PROTO(struct ieee80211_local *local, struct ieee80211_channel *chan,
  724. enum nl80211_channel_type chantype, unsigned int duration),
  725. TP_ARGS(local, chan, chantype, duration),
  726. TP_STRUCT__entry(
  727. LOCAL_ENTRY
  728. __field(int, center_freq)
  729. __field(int, channel_type)
  730. __field(unsigned int, duration)
  731. ),
  732. TP_fast_assign(
  733. LOCAL_ASSIGN;
  734. __entry->center_freq = chan->center_freq;
  735. __entry->channel_type = chantype;
  736. __entry->duration = duration;
  737. ),
  738. TP_printk(
  739. LOCAL_PR_FMT " freq:%dMHz duration:%dms",
  740. LOCAL_PR_ARG, __entry->center_freq, __entry->duration
  741. )
  742. );
  743. DEFINE_EVENT(local_only_evt, drv_cancel_remain_on_channel,
  744. TP_PROTO(struct ieee80211_local *local),
  745. TP_ARGS(local)
  746. );
  747. TRACE_EVENT(drv_offchannel_tx,
  748. TP_PROTO(struct ieee80211_local *local, struct sk_buff *skb,
  749. struct ieee80211_channel *chan,
  750. enum nl80211_channel_type channel_type,
  751. unsigned int wait),
  752. TP_ARGS(local, skb, chan, channel_type, wait),
  753. TP_STRUCT__entry(
  754. LOCAL_ENTRY
  755. __field(int, center_freq)
  756. __field(int, channel_type)
  757. __field(unsigned int, wait)
  758. ),
  759. TP_fast_assign(
  760. LOCAL_ASSIGN;
  761. __entry->center_freq = chan->center_freq;
  762. __entry->channel_type = channel_type;
  763. __entry->wait = wait;
  764. ),
  765. TP_printk(
  766. LOCAL_PR_FMT " freq:%dMHz, wait:%dms",
  767. LOCAL_PR_ARG, __entry->center_freq, __entry->wait
  768. )
  769. );
  770. TRACE_EVENT(drv_set_ringparam,
  771. TP_PROTO(struct ieee80211_local *local, u32 tx, u32 rx),
  772. TP_ARGS(local, tx, rx),
  773. TP_STRUCT__entry(
  774. LOCAL_ENTRY
  775. __field(u32, tx)
  776. __field(u32, rx)
  777. ),
  778. TP_fast_assign(
  779. LOCAL_ASSIGN;
  780. __entry->tx = tx;
  781. __entry->rx = rx;
  782. ),
  783. TP_printk(
  784. LOCAL_PR_FMT " tx:%d rx %d",
  785. LOCAL_PR_ARG, __entry->tx, __entry->rx
  786. )
  787. );
  788. TRACE_EVENT(drv_get_ringparam,
  789. TP_PROTO(struct ieee80211_local *local, u32 *tx, u32 *tx_max,
  790. u32 *rx, u32 *rx_max),
  791. TP_ARGS(local, tx, tx_max, rx, rx_max),
  792. TP_STRUCT__entry(
  793. LOCAL_ENTRY
  794. __field(u32, tx)
  795. __field(u32, tx_max)
  796. __field(u32, rx)
  797. __field(u32, rx_max)
  798. ),
  799. TP_fast_assign(
  800. LOCAL_ASSIGN;
  801. __entry->tx = *tx;
  802. __entry->tx_max = *tx_max;
  803. __entry->rx = *rx;
  804. __entry->rx_max = *rx_max;
  805. ),
  806. TP_printk(
  807. LOCAL_PR_FMT " tx:%d tx_max %d rx %d rx_max %d",
  808. LOCAL_PR_ARG,
  809. __entry->tx, __entry->tx_max, __entry->rx, __entry->rx_max
  810. )
  811. );
  812. DEFINE_EVENT(local_only_evt, drv_tx_frames_pending,
  813. TP_PROTO(struct ieee80211_local *local),
  814. TP_ARGS(local)
  815. );
  816. DEFINE_EVENT(local_only_evt, drv_offchannel_tx_cancel_wait,
  817. TP_PROTO(struct ieee80211_local *local),
  818. TP_ARGS(local)
  819. );
  820. TRACE_EVENT(drv_set_bitrate_mask,
  821. TP_PROTO(struct ieee80211_local *local,
  822. struct ieee80211_sub_if_data *sdata,
  823. const struct cfg80211_bitrate_mask *mask),
  824. TP_ARGS(local, sdata, mask),
  825. TP_STRUCT__entry(
  826. LOCAL_ENTRY
  827. VIF_ENTRY
  828. __field(u32, legacy_2g)
  829. __field(u32, legacy_5g)
  830. ),
  831. TP_fast_assign(
  832. LOCAL_ASSIGN;
  833. VIF_ASSIGN;
  834. __entry->legacy_2g = mask->control[IEEE80211_BAND_2GHZ].legacy;
  835. __entry->legacy_5g = mask->control[IEEE80211_BAND_5GHZ].legacy;
  836. ),
  837. TP_printk(
  838. LOCAL_PR_FMT VIF_PR_FMT " 2G Mask:0x%x 5G Mask:0x%x",
  839. LOCAL_PR_ARG, VIF_PR_ARG, __entry->legacy_2g, __entry->legacy_5g
  840. )
  841. );
  842. /*
  843. * Tracing for API calls that drivers call.
  844. */
  845. TRACE_EVENT(api_start_tx_ba_session,
  846. TP_PROTO(struct ieee80211_sta *sta, u16 tid),
  847. TP_ARGS(sta, tid),
  848. TP_STRUCT__entry(
  849. STA_ENTRY
  850. __field(u16, tid)
  851. ),
  852. TP_fast_assign(
  853. STA_ASSIGN;
  854. __entry->tid = tid;
  855. ),
  856. TP_printk(
  857. STA_PR_FMT " tid:%d",
  858. STA_PR_ARG, __entry->tid
  859. )
  860. );
  861. TRACE_EVENT(api_start_tx_ba_cb,
  862. TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
  863. TP_ARGS(sdata, ra, tid),
  864. TP_STRUCT__entry(
  865. VIF_ENTRY
  866. __array(u8, ra, ETH_ALEN)
  867. __field(u16, tid)
  868. ),
  869. TP_fast_assign(
  870. VIF_ASSIGN;
  871. memcpy(__entry->ra, ra, ETH_ALEN);
  872. __entry->tid = tid;
  873. ),
  874. TP_printk(
  875. VIF_PR_FMT " ra:%pM tid:%d",
  876. VIF_PR_ARG, __entry->ra, __entry->tid
  877. )
  878. );
  879. TRACE_EVENT(api_stop_tx_ba_session,
  880. TP_PROTO(struct ieee80211_sta *sta, u16 tid),
  881. TP_ARGS(sta, tid),
  882. TP_STRUCT__entry(
  883. STA_ENTRY
  884. __field(u16, tid)
  885. ),
  886. TP_fast_assign(
  887. STA_ASSIGN;
  888. __entry->tid = tid;
  889. ),
  890. TP_printk(
  891. STA_PR_FMT " tid:%d",
  892. STA_PR_ARG, __entry->tid
  893. )
  894. );
  895. TRACE_EVENT(api_stop_tx_ba_cb,
  896. TP_PROTO(struct ieee80211_sub_if_data *sdata, const u8 *ra, u16 tid),
  897. TP_ARGS(sdata, ra, tid),
  898. TP_STRUCT__entry(
  899. VIF_ENTRY
  900. __array(u8, ra, ETH_ALEN)
  901. __field(u16, tid)
  902. ),
  903. TP_fast_assign(
  904. VIF_ASSIGN;
  905. memcpy(__entry->ra, ra, ETH_ALEN);
  906. __entry->tid = tid;
  907. ),
  908. TP_printk(
  909. VIF_PR_FMT " ra:%pM tid:%d",
  910. VIF_PR_ARG, __entry->ra, __entry->tid
  911. )
  912. );
  913. DEFINE_EVENT(local_only_evt, api_restart_hw,
  914. TP_PROTO(struct ieee80211_local *local),
  915. TP_ARGS(local)
  916. );
  917. TRACE_EVENT(api_beacon_loss,
  918. TP_PROTO(struct ieee80211_sub_if_data *sdata),
  919. TP_ARGS(sdata),
  920. TP_STRUCT__entry(
  921. VIF_ENTRY
  922. ),
  923. TP_fast_assign(
  924. VIF_ASSIGN;
  925. ),
  926. TP_printk(
  927. VIF_PR_FMT,
  928. VIF_PR_ARG
  929. )
  930. );
  931. TRACE_EVENT(api_connection_loss,
  932. TP_PROTO(struct ieee80211_sub_if_data *sdata),
  933. TP_ARGS(sdata),
  934. TP_STRUCT__entry(
  935. VIF_ENTRY
  936. ),
  937. TP_fast_assign(
  938. VIF_ASSIGN;
  939. ),
  940. TP_printk(
  941. VIF_PR_FMT,
  942. VIF_PR_ARG
  943. )
  944. );
  945. TRACE_EVENT(api_cqm_rssi_notify,
  946. TP_PROTO(struct ieee80211_sub_if_data *sdata,
  947. enum nl80211_cqm_rssi_threshold_event rssi_event),
  948. TP_ARGS(sdata, rssi_event),
  949. TP_STRUCT__entry(
  950. VIF_ENTRY
  951. __field(u32, rssi_event)
  952. ),
  953. TP_fast_assign(
  954. VIF_ASSIGN;
  955. __entry->rssi_event = rssi_event;
  956. ),
  957. TP_printk(
  958. VIF_PR_FMT " event:%d",
  959. VIF_PR_ARG, __entry->rssi_event
  960. )
  961. );
  962. TRACE_EVENT(api_scan_completed,
  963. TP_PROTO(struct ieee80211_local *local, bool aborted),
  964. TP_ARGS(local, aborted),
  965. TP_STRUCT__entry(
  966. LOCAL_ENTRY
  967. __field(bool, aborted)
  968. ),
  969. TP_fast_assign(
  970. LOCAL_ASSIGN;
  971. __entry->aborted = aborted;
  972. ),
  973. TP_printk(
  974. LOCAL_PR_FMT " aborted:%d",
  975. LOCAL_PR_ARG, __entry->aborted
  976. )
  977. );
  978. TRACE_EVENT(api_sched_scan_results,
  979. TP_PROTO(struct ieee80211_local *local),
  980. TP_ARGS(local),
  981. TP_STRUCT__entry(
  982. LOCAL_ENTRY
  983. ),
  984. TP_fast_assign(
  985. LOCAL_ASSIGN;
  986. ),
  987. TP_printk(
  988. LOCAL_PR_FMT, LOCAL_PR_ARG
  989. )
  990. );
  991. TRACE_EVENT(api_sched_scan_stopped,
  992. TP_PROTO(struct ieee80211_local *local),
  993. TP_ARGS(local),
  994. TP_STRUCT__entry(
  995. LOCAL_ENTRY
  996. ),
  997. TP_fast_assign(
  998. LOCAL_ASSIGN;
  999. ),
  1000. TP_printk(
  1001. LOCAL_PR_FMT, LOCAL_PR_ARG
  1002. )
  1003. );
  1004. TRACE_EVENT(api_sta_block_awake,
  1005. TP_PROTO(struct ieee80211_local *local,
  1006. struct ieee80211_sta *sta, bool block),
  1007. TP_ARGS(local, sta, block),
  1008. TP_STRUCT__entry(
  1009. LOCAL_ENTRY
  1010. STA_ENTRY
  1011. __field(bool, block)
  1012. ),
  1013. TP_fast_assign(
  1014. LOCAL_ASSIGN;
  1015. STA_ASSIGN;
  1016. __entry->block = block;
  1017. ),
  1018. TP_printk(
  1019. LOCAL_PR_FMT STA_PR_FMT " block:%d",
  1020. LOCAL_PR_ARG, STA_PR_FMT, __entry->block
  1021. )
  1022. );
  1023. TRACE_EVENT(api_chswitch_done,
  1024. TP_PROTO(struct ieee80211_sub_if_data *sdata, bool success),
  1025. TP_ARGS(sdata, success),
  1026. TP_STRUCT__entry(
  1027. VIF_ENTRY
  1028. __field(bool, success)
  1029. ),
  1030. TP_fast_assign(
  1031. VIF_ASSIGN;
  1032. __entry->success = success;
  1033. ),
  1034. TP_printk(
  1035. VIF_PR_FMT " success=%d",
  1036. VIF_PR_ARG, __entry->success
  1037. )
  1038. );
  1039. DEFINE_EVENT(local_only_evt, api_ready_on_channel,
  1040. TP_PROTO(struct ieee80211_local *local),
  1041. TP_ARGS(local)
  1042. );
  1043. DEFINE_EVENT(local_only_evt, api_remain_on_channel_expired,
  1044. TP_PROTO(struct ieee80211_local *local),
  1045. TP_ARGS(local)
  1046. );
  1047. /*
  1048. * Tracing for internal functions
  1049. * (which may also be called in response to driver calls)
  1050. */
  1051. TRACE_EVENT(wake_queue,
  1052. TP_PROTO(struct ieee80211_local *local, u16 queue,
  1053. enum queue_stop_reason reason),
  1054. TP_ARGS(local, queue, reason),
  1055. TP_STRUCT__entry(
  1056. LOCAL_ENTRY
  1057. __field(u16, queue)
  1058. __field(u32, reason)
  1059. ),
  1060. TP_fast_assign(
  1061. LOCAL_ASSIGN;
  1062. __entry->queue = queue;
  1063. __entry->reason = reason;
  1064. ),
  1065. TP_printk(
  1066. LOCAL_PR_FMT " queue:%d, reason:%d",
  1067. LOCAL_PR_ARG, __entry->queue, __entry->reason
  1068. )
  1069. );
  1070. TRACE_EVENT(stop_queue,
  1071. TP_PROTO(struct ieee80211_local *local, u16 queue,
  1072. enum queue_stop_reason reason),
  1073. TP_ARGS(local, queue, reason),
  1074. TP_STRUCT__entry(
  1075. LOCAL_ENTRY
  1076. __field(u16, queue)
  1077. __field(u32, reason)
  1078. ),
  1079. TP_fast_assign(
  1080. LOCAL_ASSIGN;
  1081. __entry->queue = queue;
  1082. __entry->reason = reason;
  1083. ),
  1084. TP_printk(
  1085. LOCAL_PR_FMT " queue:%d, reason:%d",
  1086. LOCAL_PR_ARG, __entry->queue, __entry->reason
  1087. )
  1088. );
  1089. #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
  1090. #undef TRACE_INCLUDE_PATH
  1091. #define TRACE_INCLUDE_PATH .
  1092. #undef TRACE_INCLUDE_FILE
  1093. #define TRACE_INCLUDE_FILE driver-trace
  1094. #include <trace/define_trace.h>