cfg80211: pass a channel definition struct
[deliverable/linux.git] / net / wireless / trace.h
index 0ca71caf85fbbaedd1e7d2e28225aa2798dd8c38..1370d52b1393b2f8d0dab801180108aca504ae59 100644 (file)
@@ -26,7 +26,7 @@
 #define WIPHY_PR_ARG MAC_PR_ARG(wiphy_mac)
 
 #define WDEV_ENTRY __field(u32, id)
-#define WDEV_ASSIGN (__entry->id) = (wdev->identifier)
+#define WDEV_ASSIGN (__entry->id) = (wdev ? wdev->identifier : 0)
 #define WDEV_PR_FMT ", wdev id: %u"
 #define WDEV_PR_ARG (__entry->id)
 
 #define CHAN_PR_FMT ", band: %d, freq: %u"
 #define CHAN_PR_ARG __entry->band, __entry->center_freq
 
+#define CHAN_DEF_ENTRY __field(enum ieee80211_band, band)      \
+                      __field(u16, center_freq)                \
+                      __field(u32, channel_type)
+#define CHAN_DEF_ASSIGN(chandef)                                       \
+       do {                                                            \
+               if ((chandef) && (chandef)->chan) {                     \
+                       __entry->band = (chandef)->chan->band;          \
+                       __entry->center_freq =                          \
+                               (chandef)->chan->center_freq;           \
+                       __entry->channel_type = (chandef)->_type;       \
+               } else {                                                \
+                       __entry->band = 0;                              \
+                       __entry->center_freq = 0;                       \
+                       __entry->channel_type = 0;                      \
+               }                                                       \
+       } while (0)
+#define CHAN_DEF_PR_FMT ", band: %d, freq: %u, chantype: %d"
+#define CHAN_DEF_PR_ARG __entry->band, __entry->center_freq,           \
+                       __entry->channel_type
+
 #define SINFO_ENTRY __field(int, generation)       \
                    __field(u32, connected_time)    \
                    __field(u32, inactive_time)     \
@@ -260,11 +280,6 @@ DEFINE_EVENT(wiphy_only_evt, rdev_get_antenna,
        TP_ARGS(wiphy)
 );
 
-DEFINE_EVENT(wiphy_only_evt, rdev_get_tx_power,
-       TP_PROTO(struct wiphy *wiphy),
-       TP_ARGS(wiphy)
-);
-
 DEFINE_EVENT(wiphy_only_evt, rdev_rfkill_poll,
        TP_PROTO(struct wiphy *wiphy),
        TP_ARGS(wiphy)
@@ -438,7 +453,7 @@ TRACE_EVENT(rdev_start_ap,
        TP_STRUCT__entry(
                WIPHY_ENTRY
                NETDEV_ENTRY
-               CHAN_ENTRY
+               CHAN_DEF_ENTRY
                __field(int, beacon_interval)
                __field(int, dtim_period)
                __array(char, ssid, IEEE80211_MAX_SSID_LEN + 1)
@@ -451,7 +466,7 @@ TRACE_EVENT(rdev_start_ap,
        TP_fast_assign(
                WIPHY_ASSIGN;
                NETDEV_ASSIGN;
-               CHAN_ASSIGN(settings->channel);
+               CHAN_DEF_ASSIGN(&settings->chandef);
                __entry->beacon_interval = settings->beacon_interval;
                __entry->dtim_period = settings->dtim_period;
                __entry->hidden_ssid = settings->hidden_ssid;
@@ -463,10 +478,10 @@ TRACE_EVENT(rdev_start_ap,
                memcpy(__entry->ssid, settings->ssid, settings->ssid_len);
        ),
        TP_printk(WIPHY_PR_FMT NETDEV_PR_FMT ", AP settings - ssid: %s, "
-                 CHAN_PR_FMT ", beacon interval: %d, dtim period: %d, "
+                 CHAN_DEF_PR_FMT ", beacon interval: %d, dtim period: %d, "
                  "hidden ssid: %d, wpa versions: %u, privacy: %s, "
                  "auth type: %d, inactivity timeout: %d",
-                 WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->ssid, CHAN_PR_ARG,
+                 WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->ssid, CHAN_DEF_PR_ARG,
                  __entry->beacon_interval, __entry->dtim_period,
                  __entry->hidden_ssid, __entry->wpa_ver,
                  BOOL_TO_STR(__entry->privacy), __entry->auth_type,
@@ -938,21 +953,19 @@ TRACE_EVENT(rdev_libertas_set_mesh_channel,
 );
 
 TRACE_EVENT(rdev_set_monitor_channel,
-       TP_PROTO(struct wiphy *wiphy, struct ieee80211_channel *chan,
-                enum nl80211_channel_type chan_type),
-       TP_ARGS(wiphy, chan, chan_type),
+       TP_PROTO(struct wiphy *wiphy,
+                struct cfg80211_chan_def *chandef),
+       TP_ARGS(wiphy, chandef),
        TP_STRUCT__entry(
                WIPHY_ENTRY
-               CHAN_ENTRY
-               __field(enum nl80211_channel_type, chan_type)
+               CHAN_DEF_ENTRY
        ),
        TP_fast_assign(
                WIPHY_ASSIGN;
-               CHAN_ASSIGN(chan);
-               __entry->chan_type = chan_type;
+               CHAN_DEF_ASSIGN(chandef);
        ),
-       TP_printk(WIPHY_PR_FMT CHAN_PR_FMT ", channel type : %d",
-                 WIPHY_PR_ARG, CHAN_PR_ARG, __entry->chan_type)
+       TP_printk(WIPHY_PR_FMT CHAN_DEF_PR_FMT,
+                 WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
 );
 
 TRACE_EVENT(rdev_auth,
@@ -1230,22 +1243,29 @@ TRACE_EVENT(rdev_set_wiphy_params,
                  WIPHY_PR_ARG, __entry->changed)
 );
 
+DEFINE_EVENT(wiphy_wdev_evt, rdev_get_tx_power,
+       TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
+       TP_ARGS(wiphy, wdev)
+);
+
 TRACE_EVENT(rdev_set_tx_power,
-       TP_PROTO(struct wiphy *wiphy, enum nl80211_tx_power_setting type,
-                int mbm),
-       TP_ARGS(wiphy, type, mbm),
+       TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
+                enum nl80211_tx_power_setting type, int mbm),
+       TP_ARGS(wiphy, wdev, type, mbm),
        TP_STRUCT__entry(
                WIPHY_ENTRY
+               WDEV_ENTRY
                __field(enum nl80211_tx_power_setting, type)
                __field(int, mbm)
        ),
        TP_fast_assign(
                WIPHY_ASSIGN;
+               WDEV_ASSIGN;
                __entry->type = type;
                __entry->mbm = mbm;
        ),
-       TP_printk(WIPHY_PR_FMT ", type: %d, mbm: %d",
-                 WIPHY_PR_ARG, __entry->type, __entry->mbm)
+       TP_printk(WIPHY_PR_FMT WDEV_PR_FMT ", type: %d, mbm: %d",
+                 WIPHY_PR_ARG, WDEV_PR_ARG,__entry->type, __entry->mbm)
 );
 
 TRACE_EVENT(rdev_return_int_int,
@@ -1571,25 +1591,22 @@ DEFINE_EVENT(rdev_pmksa, rdev_del_pmksa,
 TRACE_EVENT(rdev_remain_on_channel,
        TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
                 struct ieee80211_channel *chan,
-                enum nl80211_channel_type channel_type, unsigned int duration),
-       TP_ARGS(wiphy, wdev, chan, channel_type, duration),
+                unsigned int duration),
+       TP_ARGS(wiphy, wdev, chan, duration),
        TP_STRUCT__entry(
                WIPHY_ENTRY
                WDEV_ENTRY
                CHAN_ENTRY
-               __field(enum nl80211_channel_type, channel_type)
                __field(unsigned int, duration)
        ),
        TP_fast_assign(
                WIPHY_ASSIGN;
                WDEV_ASSIGN;
                CHAN_ASSIGN(chan);
-               __entry->channel_type = channel_type;
                __entry->duration = duration;
        ),
-       TP_printk(WIPHY_PR_FMT WDEV_PR_FMT CHAN_PR_FMT ", channel type: %d, duration: %u",
-                 WIPHY_PR_ARG, WDEV_PR_ARG, CHAN_PR_ARG, __entry->channel_type,
-                 __entry->duration)
+       TP_printk(WIPHY_PR_FMT WDEV_PR_FMT CHAN_PR_FMT ", duration: %u",
+                 WIPHY_PR_ARG, WDEV_PR_ARG, CHAN_PR_ARG, __entry->duration)
 );
 
 TRACE_EVENT(rdev_return_int_cookie,
@@ -1629,18 +1646,13 @@ TRACE_EVENT(rdev_cancel_remain_on_channel,
 TRACE_EVENT(rdev_mgmt_tx,
        TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
                 struct ieee80211_channel *chan, bool offchan,
-                enum nl80211_channel_type channel_type,
-                bool channel_type_valid, unsigned int wait, bool no_cck,
-                bool dont_wait_for_ack),
-       TP_ARGS(wiphy, wdev, chan, offchan, channel_type, channel_type_valid,
-               wait, no_cck, dont_wait_for_ack),
+                unsigned int wait, bool no_cck, bool dont_wait_for_ack),
+       TP_ARGS(wiphy, wdev, chan, offchan, wait, no_cck, dont_wait_for_ack),
        TP_STRUCT__entry(
                WIPHY_ENTRY
                WDEV_ENTRY
                CHAN_ENTRY
                __field(bool, offchan)
-               __field(enum nl80211_channel_type, channel_type)
-               __field(bool, channel_type_valid)
                __field(unsigned int, wait)
                __field(bool, no_cck)
                __field(bool, dont_wait_for_ack)
@@ -1650,18 +1662,14 @@ TRACE_EVENT(rdev_mgmt_tx,
                WDEV_ASSIGN;
                CHAN_ASSIGN(chan);
                __entry->offchan = offchan;
-               __entry->channel_type = channel_type;
-               __entry->channel_type_valid = channel_type_valid;
                __entry->wait = wait;
                __entry->no_cck = no_cck;
                __entry->dont_wait_for_ack = dont_wait_for_ack;
        ),
-       TP_printk(WIPHY_PR_FMT WDEV_PR_FMT CHAN_PR_FMT ", offchan: %s, "
-                 "channel type: %d, channel type valid: %s, wait: %u, "
-                 "no cck: %s, dont wait for ack: %s",
+       TP_printk(WIPHY_PR_FMT WDEV_PR_FMT CHAN_PR_FMT ", offchan: %s,"
+                 " wait: %u, no cck: %s, dont wait for ack: %s",
                  WIPHY_PR_ARG, WDEV_PR_ARG, CHAN_PR_ARG,
-                 BOOL_TO_STR(__entry->offchan), __entry->channel_type,
-                 BOOL_TO_STR(__entry->channel_type_valid), __entry->wait,
+                 BOOL_TO_STR(__entry->offchan), __entry->wait,
                  BOOL_TO_STR(__entry->no_cck),
                  BOOL_TO_STR(__entry->dont_wait_for_ack))
 );
@@ -1723,22 +1731,25 @@ DEFINE_EVENT(wiphy_wdev_evt, rdev_get_channel,
        TP_ARGS(wiphy, wdev)
 );
 
-TRACE_EVENT(rdev_return_channel,
-       TP_PROTO(struct wiphy *wiphy, struct ieee80211_channel *chan,
-                enum nl80211_channel_type type),
-       TP_ARGS(wiphy, chan, type),
+TRACE_EVENT(rdev_return_chandef,
+       TP_PROTO(struct wiphy *wiphy, int ret,
+                struct cfg80211_chan_def *chandef),
+       TP_ARGS(wiphy, ret, chandef),
        TP_STRUCT__entry(
                WIPHY_ENTRY
-               CHAN_ENTRY
-               __field(enum nl80211_channel_type, type)
+               __field(int, ret)
+               CHAN_DEF_ENTRY
        ),
        TP_fast_assign(
                WIPHY_ASSIGN;
-               CHAN_ASSIGN(chan);
-               __entry->type = type;
+               if (ret == 0)
+                       CHAN_DEF_ASSIGN(chandef);
+               else
+                       CHAN_DEF_ASSIGN((struct cfg80211_chan_def *)NULL);
+               __entry->ret = ret;
        ),
-       TP_printk(WIPHY_PR_FMT CHAN_PR_FMT ", channel type: %d",
-                 WIPHY_PR_ARG, CHAN_PR_ARG, __entry->type)
+       TP_printk(WIPHY_PR_FMT CHAN_DEF_PR_FMT ", ret: %d",
+                 WIPHY_PR_ARG, CHAN_DEF_PR_ARG, __entry->ret)
 );
 
 DEFINE_EVENT(wiphy_wdev_evt, rdev_start_p2p_device,
@@ -1892,47 +1903,41 @@ TRACE_EVENT(cfg80211_michael_mic_failure,
 TRACE_EVENT(cfg80211_ready_on_channel,
        TP_PROTO(struct wireless_dev *wdev, u64 cookie,
                 struct ieee80211_channel *chan,
-                enum nl80211_channel_type channel_type, unsigned int duration),
-       TP_ARGS(wdev, cookie, chan, channel_type, duration),
+                unsigned int duration),
+       TP_ARGS(wdev, cookie, chan, duration),
        TP_STRUCT__entry(
                WDEV_ENTRY
                __field(u64, cookie)
                CHAN_ENTRY
-               __field(enum nl80211_channel_type, channel_type)
                __field(unsigned int, duration)
        ),
        TP_fast_assign(
                WDEV_ASSIGN;
                __entry->cookie = cookie;
                CHAN_ASSIGN(chan);
-               __entry->channel_type = channel_type;
                __entry->duration = duration;
        ),
-       TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT ", channel type: %d, duration: %u",
+       TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT ", duration: %u",
                  WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG,
-                 __entry->channel_type, __entry->duration)
+                 __entry->duration)
 );
 
 TRACE_EVENT(cfg80211_ready_on_channel_expired,
        TP_PROTO(struct wireless_dev *wdev, u64 cookie,
-                struct ieee80211_channel *chan,
-                enum nl80211_channel_type channel_type),
-       TP_ARGS(wdev, cookie, chan, channel_type),
+                struct ieee80211_channel *chan),
+       TP_ARGS(wdev, cookie, chan),
        TP_STRUCT__entry(
                WDEV_ENTRY
                __field(u64, cookie)
                CHAN_ENTRY
-               __field(enum nl80211_channel_type, channel_type)
        ),
        TP_fast_assign(
                WDEV_ASSIGN;
                __entry->cookie = cookie;
                CHAN_ASSIGN(chan);
-               __entry->channel_type = channel_type;
        ),
-       TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT ", channel type: %d",
-                 WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG,
-                 __entry->channel_type)
+       TP_printk(WDEV_PR_FMT ", cookie: %llu, " CHAN_PR_FMT,
+                 WDEV_PR_ARG, __entry->cookie, CHAN_PR_ARG)
 );
 
 TRACE_EVENT(cfg80211_new_sta,
@@ -2008,40 +2013,35 @@ TRACE_EVENT(cfg80211_cqm_rssi_notify,
                  NETDEV_PR_ARG, __entry->rssi_event)
 );
 
-TRACE_EVENT(cfg80211_can_beacon_sec_chan,
-       TP_PROTO(struct wiphy *wiphy, struct ieee80211_channel *channel,
-                enum nl80211_channel_type channel_type),
-       TP_ARGS(wiphy, channel, channel_type),
+TRACE_EVENT(cfg80211_reg_can_beacon,
+       TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef),
+       TP_ARGS(wiphy, chandef),
        TP_STRUCT__entry(
                WIPHY_ENTRY
-               CHAN_ENTRY
-               __field(enum nl80211_channel_type, channel_type)
+               CHAN_DEF_ENTRY
        ),
        TP_fast_assign(
                WIPHY_ASSIGN;
-               CHAN_ASSIGN(channel);
-               __entry->channel_type = channel_type;
+               CHAN_DEF_ASSIGN(chandef);
        ),
-       TP_printk(WIPHY_PR_FMT CHAN_PR_FMT ", channel_type: %d",
-                 WIPHY_PR_ARG, CHAN_PR_ARG, __entry->channel_type)
+       TP_printk(WIPHY_PR_FMT CHAN_DEF_PR_FMT,
+                 WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
 );
 
 TRACE_EVENT(cfg80211_ch_switch_notify,
-       TP_PROTO(struct net_device *netdev, int freq,
-                enum nl80211_channel_type type),
-       TP_ARGS(netdev, freq, type),
+       TP_PROTO(struct net_device *netdev,
+                struct cfg80211_chan_def *chandef),
+       TP_ARGS(netdev, chandef),
        TP_STRUCT__entry(
                NETDEV_ENTRY
-               __field(int, freq)
-               __field(enum nl80211_channel_type, type)
+               CHAN_DEF_ENTRY
        ),
        TP_fast_assign(
                NETDEV_ASSIGN;
-               __entry->freq = freq;
-               __entry->type = type;
+               CHAN_DEF_ASSIGN(chandef);
        ),
-       TP_printk(NETDEV_PR_FMT ", freq: %d, type: %d", NETDEV_PR_ARG,
-                 __entry->freq, __entry->type)
+       TP_printk(NETDEV_PR_FMT CHAN_DEF_PR_FMT,
+                 NETDEV_PR_ARG, CHAN_DEF_PR_ARG)
 );
 
 DECLARE_EVENT_CLASS(cfg80211_rx_evt,
@@ -2155,6 +2155,29 @@ TRACE_EVENT(cfg80211_report_obss_beacon,
                  WIPHY_PR_ARG, __entry->freq, __entry->sig_dbm)
 );
 
+TRACE_EVENT(cfg80211_tdls_oper_request,
+       TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *peer,
+                enum nl80211_tdls_operation oper, u16 reason_code),
+       TP_ARGS(wiphy, netdev, peer, oper, reason_code),
+       TP_STRUCT__entry(
+               WIPHY_ENTRY
+               NETDEV_ENTRY
+               MAC_ENTRY(peer)
+               __field(enum nl80211_tdls_operation, oper)
+               __field(u16, reason_code)
+       ),
+       TP_fast_assign(
+               WIPHY_ASSIGN;
+               NETDEV_ASSIGN;
+               MAC_ASSIGN(peer, peer);
+               __entry->oper = oper;
+               __entry->reason_code = reason_code;
+       ),
+       TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", peer: " MAC_PR_FMT ", oper: %d, reason_code %u",
+                 WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(peer), __entry->oper,
+                 __entry->reason_code)
+       );
+
 TRACE_EVENT(cfg80211_scan_done,
        TP_PROTO(struct cfg80211_scan_request *request, bool aborted),
        TP_ARGS(request, aborted),
This page took 0.042008 seconds and 5 git commands to generate.