aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/trace.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-11-08 15:25:48 -0500
committerJohannes Berg <johannes.berg@intel.com>2012-11-26 06:42:58 -0500
commit683b6d3b31a51956ea540df00abb0b78894924c1 (patch)
tree558e0f316b56368ab259755cb4eeaeb40331853d /net/wireless/trace.h
parentfe4b31810c06cc6518fb193efb9b3c3289b55832 (diff)
cfg80211: pass a channel definition struct
Instead of passing a channel pointer and channel type to all functions and driver methods, pass a new channel definition struct. Right now, this struct contains just the control channel and channel type, but for VHT this will change. Also, add a small inline cfg80211_get_chandef_type() so that drivers don't need to use the _type field of the new structure all the time, which will change. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/trace.h')
-rw-r--r--net/wireless/trace.h100
1 files changed, 58 insertions, 42 deletions
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index ed10833f9a3a..1370d52b1393 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -126,6 +126,26 @@
126#define CHAN_PR_FMT ", band: %d, freq: %u" 126#define CHAN_PR_FMT ", band: %d, freq: %u"
127#define CHAN_PR_ARG __entry->band, __entry->center_freq 127#define CHAN_PR_ARG __entry->band, __entry->center_freq
128 128
129#define CHAN_DEF_ENTRY __field(enum ieee80211_band, band) \
130 __field(u16, center_freq) \
131 __field(u32, channel_type)
132#define CHAN_DEF_ASSIGN(chandef) \
133 do { \
134 if ((chandef) && (chandef)->chan) { \
135 __entry->band = (chandef)->chan->band; \
136 __entry->center_freq = \
137 (chandef)->chan->center_freq; \
138 __entry->channel_type = (chandef)->_type; \
139 } else { \
140 __entry->band = 0; \
141 __entry->center_freq = 0; \
142 __entry->channel_type = 0; \
143 } \
144 } while (0)
145#define CHAN_DEF_PR_FMT ", band: %d, freq: %u, chantype: %d"
146#define CHAN_DEF_PR_ARG __entry->band, __entry->center_freq, \
147 __entry->channel_type
148
129#define SINFO_ENTRY __field(int, generation) \ 149#define SINFO_ENTRY __field(int, generation) \
130 __field(u32, connected_time) \ 150 __field(u32, connected_time) \
131 __field(u32, inactive_time) \ 151 __field(u32, inactive_time) \
@@ -433,7 +453,7 @@ TRACE_EVENT(rdev_start_ap,
433 TP_STRUCT__entry( 453 TP_STRUCT__entry(
434 WIPHY_ENTRY 454 WIPHY_ENTRY
435 NETDEV_ENTRY 455 NETDEV_ENTRY
436 CHAN_ENTRY 456 CHAN_DEF_ENTRY
437 __field(int, beacon_interval) 457 __field(int, beacon_interval)
438 __field(int, dtim_period) 458 __field(int, dtim_period)
439 __array(char, ssid, IEEE80211_MAX_SSID_LEN + 1) 459 __array(char, ssid, IEEE80211_MAX_SSID_LEN + 1)
@@ -446,7 +466,7 @@ TRACE_EVENT(rdev_start_ap,
446 TP_fast_assign( 466 TP_fast_assign(
447 WIPHY_ASSIGN; 467 WIPHY_ASSIGN;
448 NETDEV_ASSIGN; 468 NETDEV_ASSIGN;
449 CHAN_ASSIGN(settings->channel); 469 CHAN_DEF_ASSIGN(&settings->chandef);
450 __entry->beacon_interval = settings->beacon_interval; 470 __entry->beacon_interval = settings->beacon_interval;
451 __entry->dtim_period = settings->dtim_period; 471 __entry->dtim_period = settings->dtim_period;
452 __entry->hidden_ssid = settings->hidden_ssid; 472 __entry->hidden_ssid = settings->hidden_ssid;
@@ -458,10 +478,10 @@ TRACE_EVENT(rdev_start_ap,
458 memcpy(__entry->ssid, settings->ssid, settings->ssid_len); 478 memcpy(__entry->ssid, settings->ssid, settings->ssid_len);
459 ), 479 ),
460 TP_printk(WIPHY_PR_FMT NETDEV_PR_FMT ", AP settings - ssid: %s, " 480 TP_printk(WIPHY_PR_FMT NETDEV_PR_FMT ", AP settings - ssid: %s, "
461 CHAN_PR_FMT ", beacon interval: %d, dtim period: %d, " 481 CHAN_DEF_PR_FMT ", beacon interval: %d, dtim period: %d, "
462 "hidden ssid: %d, wpa versions: %u, privacy: %s, " 482 "hidden ssid: %d, wpa versions: %u, privacy: %s, "
463 "auth type: %d, inactivity timeout: %d", 483 "auth type: %d, inactivity timeout: %d",
464 WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->ssid, CHAN_PR_ARG, 484 WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->ssid, CHAN_DEF_PR_ARG,
465 __entry->beacon_interval, __entry->dtim_period, 485 __entry->beacon_interval, __entry->dtim_period,
466 __entry->hidden_ssid, __entry->wpa_ver, 486 __entry->hidden_ssid, __entry->wpa_ver,
467 BOOL_TO_STR(__entry->privacy), __entry->auth_type, 487 BOOL_TO_STR(__entry->privacy), __entry->auth_type,
@@ -933,21 +953,19 @@ TRACE_EVENT(rdev_libertas_set_mesh_channel,
933); 953);
934 954
935TRACE_EVENT(rdev_set_monitor_channel, 955TRACE_EVENT(rdev_set_monitor_channel,
936 TP_PROTO(struct wiphy *wiphy, struct ieee80211_channel *chan, 956 TP_PROTO(struct wiphy *wiphy,
937 enum nl80211_channel_type chan_type), 957 struct cfg80211_chan_def *chandef),
938 TP_ARGS(wiphy, chan, chan_type), 958 TP_ARGS(wiphy, chandef),
939 TP_STRUCT__entry( 959 TP_STRUCT__entry(
940 WIPHY_ENTRY 960 WIPHY_ENTRY
941 CHAN_ENTRY 961 CHAN_DEF_ENTRY
942 __field(enum nl80211_channel_type, chan_type)
943 ), 962 ),
944 TP_fast_assign( 963 TP_fast_assign(
945 WIPHY_ASSIGN; 964 WIPHY_ASSIGN;
946 CHAN_ASSIGN(chan); 965 CHAN_DEF_ASSIGN(chandef);
947 __entry->chan_type = chan_type;
948 ), 966 ),
949 TP_printk(WIPHY_PR_FMT CHAN_PR_FMT ", channel type : %d", 967 TP_printk(WIPHY_PR_FMT CHAN_DEF_PR_FMT,
950 WIPHY_PR_ARG, CHAN_PR_ARG, __entry->chan_type) 968 WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
951); 969);
952 970
953TRACE_EVENT(rdev_auth, 971TRACE_EVENT(rdev_auth,
@@ -1713,22 +1731,25 @@ DEFINE_EVENT(wiphy_wdev_evt, rdev_get_channel,
1713 TP_ARGS(wiphy, wdev) 1731 TP_ARGS(wiphy, wdev)
1714); 1732);
1715 1733
1716TRACE_EVENT(rdev_return_channel, 1734TRACE_EVENT(rdev_return_chandef,
1717 TP_PROTO(struct wiphy *wiphy, struct ieee80211_channel *chan, 1735 TP_PROTO(struct wiphy *wiphy, int ret,
1718 enum nl80211_channel_type type), 1736 struct cfg80211_chan_def *chandef),
1719 TP_ARGS(wiphy, chan, type), 1737 TP_ARGS(wiphy, ret, chandef),
1720 TP_STRUCT__entry( 1738 TP_STRUCT__entry(
1721 WIPHY_ENTRY 1739 WIPHY_ENTRY
1722 CHAN_ENTRY 1740 __field(int, ret)
1723 __field(enum nl80211_channel_type, type) 1741 CHAN_DEF_ENTRY
1724 ), 1742 ),
1725 TP_fast_assign( 1743 TP_fast_assign(
1726 WIPHY_ASSIGN; 1744 WIPHY_ASSIGN;
1727 CHAN_ASSIGN(chan); 1745 if (ret == 0)
1728 __entry->type = type; 1746 CHAN_DEF_ASSIGN(chandef);
1747 else
1748 CHAN_DEF_ASSIGN((struct cfg80211_chan_def *)NULL);
1749 __entry->ret = ret;
1729 ), 1750 ),
1730 TP_printk(WIPHY_PR_FMT CHAN_PR_FMT ", channel type: %d", 1751 TP_printk(WIPHY_PR_FMT CHAN_DEF_PR_FMT ", ret: %d",
1731 WIPHY_PR_ARG, CHAN_PR_ARG, __entry->type) 1752 WIPHY_PR_ARG, CHAN_DEF_PR_ARG, __entry->ret)
1732); 1753);
1733 1754
1734DEFINE_EVENT(wiphy_wdev_evt, rdev_start_p2p_device, 1755DEFINE_EVENT(wiphy_wdev_evt, rdev_start_p2p_device,
@@ -1992,40 +2013,35 @@ TRACE_EVENT(cfg80211_cqm_rssi_notify,
1992 NETDEV_PR_ARG, __entry->rssi_event) 2013 NETDEV_PR_ARG, __entry->rssi_event)
1993); 2014);
1994 2015
1995TRACE_EVENT(cfg80211_can_beacon_sec_chan, 2016TRACE_EVENT(cfg80211_reg_can_beacon,
1996 TP_PROTO(struct wiphy *wiphy, struct ieee80211_channel *channel, 2017 TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef),
1997 enum nl80211_channel_type channel_type), 2018 TP_ARGS(wiphy, chandef),
1998 TP_ARGS(wiphy, channel, channel_type),
1999 TP_STRUCT__entry( 2019 TP_STRUCT__entry(
2000 WIPHY_ENTRY 2020 WIPHY_ENTRY
2001 CHAN_ENTRY 2021 CHAN_DEF_ENTRY
2002 __field(enum nl80211_channel_type, channel_type)
2003 ), 2022 ),
2004 TP_fast_assign( 2023 TP_fast_assign(
2005 WIPHY_ASSIGN; 2024 WIPHY_ASSIGN;
2006 CHAN_ASSIGN(channel); 2025 CHAN_DEF_ASSIGN(chandef);
2007 __entry->channel_type = channel_type;
2008 ), 2026 ),
2009 TP_printk(WIPHY_PR_FMT CHAN_PR_FMT ", channel_type: %d", 2027 TP_printk(WIPHY_PR_FMT CHAN_DEF_PR_FMT,
2010 WIPHY_PR_ARG, CHAN_PR_ARG, __entry->channel_type) 2028 WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
2011); 2029);
2012 2030
2013TRACE_EVENT(cfg80211_ch_switch_notify, 2031TRACE_EVENT(cfg80211_ch_switch_notify,
2014 TP_PROTO(struct net_device *netdev, int freq, 2032 TP_PROTO(struct net_device *netdev,
2015 enum nl80211_channel_type type), 2033 struct cfg80211_chan_def *chandef),
2016 TP_ARGS(netdev, freq, type), 2034 TP_ARGS(netdev, chandef),
2017 TP_STRUCT__entry( 2035 TP_STRUCT__entry(
2018 NETDEV_ENTRY 2036 NETDEV_ENTRY
2019 __field(int, freq) 2037 CHAN_DEF_ENTRY
2020 __field(enum nl80211_channel_type, type)
2021 ), 2038 ),
2022 TP_fast_assign( 2039 TP_fast_assign(
2023 NETDEV_ASSIGN; 2040 NETDEV_ASSIGN;
2024 __entry->freq = freq; 2041 CHAN_DEF_ASSIGN(chandef);
2025 __entry->type = type;
2026 ), 2042 ),
2027 TP_printk(NETDEV_PR_FMT ", freq: %d, type: %d", NETDEV_PR_ARG, 2043 TP_printk(NETDEV_PR_FMT CHAN_DEF_PR_FMT,
2028 __entry->freq, __entry->type) 2044 NETDEV_PR_ARG, CHAN_DEF_PR_ARG)
2029); 2045);
2030 2046
2031DECLARE_EVENT_CLASS(cfg80211_rx_evt, 2047DECLARE_EVENT_CLASS(cfg80211_rx_evt,