4414 lines · 120.6 KB · C
RawDownload
/* SPDX-License-Identifier: GPL-2.0 *//* * Portions of this file * Copyright(c) 2016-2017 Intel Deutschland GmbH * Copyright (C) 2018, 2020-2026 Intel Corporation */#undef TRACE_SYSTEM#define TRACE_SYSTEM cfg80211 #if !defined(__RDEV_OPS_TRACE) || defined(TRACE_HEADER_MULTI_READ)#define __RDEV_OPS_TRACE #include <linux/tracepoint.h> #include <linux/rtnetlink.h>#include <linux/etherdevice.h>#include <net/cfg80211.h>#include "core.h" #define MAC_ENTRY(entry_mac) __array(u8, entry_mac, ETH_ALEN)#define MAC_ASSIGN(entry_mac, given_mac) do {			     \	if (given_mac)						     \		memcpy(__entry->entry_mac, given_mac, ETH_ALEN);     \	else							     \		eth_zero_addr(__entry->entry_mac);		     \	} while (0) #define MAXNAME		32#define WIPHY_ENTRY	__array(char, wiphy_name, 32)#define WIPHY_ASSIGN	strscpy(__entry->wiphy_name, wiphy_name(wiphy), MAXNAME)#define WIPHY_PR_FMT	"%s"#define WIPHY_PR_ARG	__entry->wiphy_name #define WDEV_ENTRY	__field(u32, id)#define WDEV_ASSIGN	(__entry->id) = (!IS_ERR_OR_NULL(wdev)	\					 ? wdev->identifier : 0)#define WDEV_PR_FMT	"wdev(%u)"#define WDEV_PR_ARG	(__entry->id) #define NETDEV_ENTRY	__array(char, name, IFNAMSIZ) \			__field(int, ifindex)#define NETDEV_ASSIGN					       \	do {						       \		memcpy(__entry->name, netdev->name, IFNAMSIZ); \		(__entry->ifindex) = (netdev->ifindex);	       \	} while (0)#define NETDEV_PR_FMT	"netdev:%s(%d)"#define NETDEV_PR_ARG	__entry->name, __entry->ifindex #define MESH_CFG_ENTRY __field(u16, dot11MeshRetryTimeout)		   \		       __field(u16, dot11MeshConfirmTimeout)		   \		       __field(u16, dot11MeshHoldingTimeout)		   \		       __field(u16, dot11MeshMaxPeerLinks)		   \		       __field(u8, dot11MeshMaxRetries)			   \		       __field(u8, dot11MeshTTL)			   \		       __field(u8, element_ttl)				   \		       __field(bool, auto_open_plinks)			   \		       __field(u32, dot11MeshNbrOffsetMaxNeighbor)	   \		       __field(u8, dot11MeshHWMPmaxPREQretries)		   \		       __field(u32, path_refresh_time)			   \		       __field(u32, dot11MeshHWMPactivePathTimeout)	   \		       __field(u16, min_discovery_timeout)		   \		       __field(u16, dot11MeshHWMPpreqMinInterval)	   \		       __field(u16, dot11MeshHWMPperrMinInterval)	   \		       __field(u16, dot11MeshHWMPnetDiameterTraversalTime) \		       __field(u8, dot11MeshHWMPRootMode)		   \		       __field(u16, dot11MeshHWMPRannInterval)		   \		       __field(bool, dot11MeshGateAnnouncementProtocol)	   \		       __field(bool, dot11MeshForwarding)		   \		       __field(s32, rssi_threshold)			   \		       __field(u16, ht_opmode)				   \		       __field(u32, dot11MeshHWMPactivePathToRootTimeout)  \		       __field(u16, dot11MeshHWMProotInterval)		   \		       __field(u16, dot11MeshHWMPconfirmationInterval)	   \		       __field(bool, dot11MeshNolearn)#define MESH_CFG_ASSIGN							      \	do {								      \		__entry->dot11MeshRetryTimeout = conf->dot11MeshRetryTimeout; \		__entry->dot11MeshConfirmTimeout =			      \				conf->dot11MeshConfirmTimeout;		      \		__entry->dot11MeshHoldingTimeout =			      \				conf->dot11MeshHoldingTimeout;		      \		__entry->dot11MeshMaxPeerLinks = conf->dot11MeshMaxPeerLinks; \		__entry->dot11MeshMaxRetries = conf->dot11MeshMaxRetries;     \		__entry->dot11MeshTTL = conf->dot11MeshTTL;		      \		__entry->element_ttl = conf->element_ttl;		      \		__entry->auto_open_plinks = conf->auto_open_plinks;	      \		__entry->dot11MeshNbrOffsetMaxNeighbor =		      \				conf->dot11MeshNbrOffsetMaxNeighbor;	      \		__entry->dot11MeshHWMPmaxPREQretries =			      \				conf->dot11MeshHWMPmaxPREQretries;	      \		__entry->path_refresh_time = conf->path_refresh_time;	      \		__entry->dot11MeshHWMPactivePathTimeout =		      \				conf->dot11MeshHWMPactivePathTimeout;	      \		__entry->min_discovery_timeout = conf->min_discovery_timeout; \		__entry->dot11MeshHWMPpreqMinInterval =			      \				conf->dot11MeshHWMPpreqMinInterval;	      \		__entry->dot11MeshHWMPperrMinInterval =			      \				conf->dot11MeshHWMPperrMinInterval;	      \		__entry->dot11MeshHWMPnetDiameterTraversalTime =	      \				conf->dot11MeshHWMPnetDiameterTraversalTime;  \		__entry->dot11MeshHWMPRootMode = conf->dot11MeshHWMPRootMode; \		__entry->dot11MeshHWMPRannInterval =			      \				conf->dot11MeshHWMPRannInterval;	      \		__entry->dot11MeshGateAnnouncementProtocol =		      \				conf->dot11MeshGateAnnouncementProtocol;      \		__entry->dot11MeshForwarding = conf->dot11MeshForwarding;     \		__entry->rssi_threshold = conf->rssi_threshold;		      \		__entry->ht_opmode = conf->ht_opmode;			      \		__entry->dot11MeshHWMPactivePathToRootTimeout =		      \				conf->dot11MeshHWMPactivePathToRootTimeout;   \		__entry->dot11MeshHWMProotInterval =			      \				conf->dot11MeshHWMProotInterval;	      \		__entry->dot11MeshHWMPconfirmationInterval =		      \				conf->dot11MeshHWMPconfirmationInterval;      \		__entry->dot11MeshNolearn = conf->dot11MeshNolearn;	      \	} while (0) #define CHAN_ENTRY __field(enum nl80211_band, band) \		   __field(u32, center_freq)		\		   __field(u16, freq_offset)#define CHAN_ASSIGN(chan)					  \	do {							  \		if (chan) {					  \			__entry->band = chan->band;		  \			__entry->center_freq = chan->center_freq; \			__entry->freq_offset = chan->freq_offset; \		} else {					  \			__entry->band = 0;			  \			__entry->center_freq = 0;		  \			__entry->freq_offset = 0;		  \		}						  \	} while (0)#define CHAN_PR_FMT "band: %d, freq: %u.%03u"#define CHAN_PR_ARG __entry->band, __entry->center_freq, __entry->freq_offset #define CHAN_DEF_ENTRY __field(enum nl80211_band, band)		\		       __field(u32, control_freq)			\		       __field(u32, freq_offset)			\		       __field(u32, width)				\		       __field(u32, center_freq1)			\		       __field(u32, freq1_offset)			\		       __field(u32, center_freq2)			\		       __field(u16, punctured)				\		       __field(u32, npca_pri_freq)			\		       __field(u16, npca_punctured)#define CHAN_DEF_ASSIGN(chandef)					\	do {								\		if ((chandef) && (chandef)->chan) {			\			__entry->band = (chandef)->chan->band;		\			__entry->control_freq =				\				(chandef)->chan->center_freq;		\			__entry->freq_offset =				\				(chandef)->chan->freq_offset;		\			__entry->width = (chandef)->width;		\			__entry->center_freq1 = (chandef)->center_freq1;\			__entry->freq1_offset = (chandef)->freq1_offset;\			__entry->center_freq2 = (chandef)->center_freq2;\			__entry->punctured = (chandef)->punctured;	\			__entry->npca_pri_freq =			\				(chandef)->npca_chan ?			\				(chandef)->npca_chan->center_freq : 0;	\			__entry->npca_punctured =			\				(chandef)->npca_punctured;		\		} else {						\			__entry->band = 0;				\			__entry->control_freq = 0;			\			__entry->freq_offset = 0;			\			__entry->width = 0;				\			__entry->center_freq1 = 0;			\			__entry->freq1_offset = 0;			\			__entry->center_freq2 = 0;			\			__entry->punctured = 0;				\			__entry->npca_pri_freq = 0;			\			__entry->npca_punctured = 0;			\		}							\	} while (0)#define CHAN_DEF_PR_FMT							\	"band: %d, control freq: %u.%03u, width: %d, cf1: %u.%03u, cf2: %u, punct: 0x%x, npca:%u, npca_punct:0x%x"#define CHAN_DEF_PR_ARG __entry->band, __entry->control_freq,		\			__entry->freq_offset, __entry->width,		\			__entry->center_freq1, __entry->freq1_offset,	\			__entry->center_freq2, __entry->punctured,	\			__entry->npca_pri_freq, __entry->npca_punctured #define FILS_AAD_ASSIGN(fa)						\	do {								\		if (fa) {						\			ether_addr_copy(__entry->macaddr, fa->macaddr);	\			__entry->kek_len = fa->kek_len;			\		} else {						\			eth_zero_addr(__entry->macaddr);		\			__entry->kek_len = 0;				\		}							\	} while (0)#define FILS_AAD_PR_FMT							\	"macaddr: %pM, kek_len: %d" #define SINFO_ENTRY __field(int, generation)	    \		    __field(u32, connected_time)    \		    __field(u32, inactive_time)	    \		    __field(u32, rx_bytes)	    \		    __field(u32, tx_bytes)	    \		    __field(u32, rx_packets)	    \		    __field(u32, tx_packets)	    \		    __field(u32, tx_retries)	    \		    __field(u32, tx_failed)	    \		    __field(u32, rx_dropped_misc)   \		    __field(u32, beacon_loss_count) \		    __field(u16, llid)		    \		    __field(u16, plid)		    \		    __field(u8, plink_state)#define SINFO_ASSIGN						       \	do {							       \		__entry->generation = sinfo->generation;	       \		__entry->connected_time = sinfo->connected_time;       \		__entry->inactive_time = sinfo->inactive_time;	       \		__entry->rx_bytes = sinfo->rx_bytes;		       \		__entry->tx_bytes = sinfo->tx_bytes;		       \		__entry->rx_packets = sinfo->rx_packets;	       \		__entry->tx_packets = sinfo->tx_packets;	       \		__entry->tx_retries = sinfo->tx_retries;	       \		__entry->tx_failed = sinfo->tx_failed;		       \		__entry->rx_dropped_misc = sinfo->rx_dropped_misc;     \		__entry->beacon_loss_count = sinfo->beacon_loss_count; \		__entry->llid = sinfo->llid;			       \		__entry->plid = sinfo->plid;			       \		__entry->plink_state = sinfo->plink_state;	       \	} while (0) #define BOOL_TO_STR(bo) (bo) ? "true" : "false" #define QOS_MAP_ENTRY __field(u8, num_des)			\		      __array(u8, dscp_exception,		\			      2 * IEEE80211_QOS_MAP_MAX_EX)	\		      __array(u8, up, IEEE80211_QOS_MAP_LEN_MIN)#define QOS_MAP_ASSIGN(qos_map)					\	do {							\		if ((qos_map)) {				\			__entry->num_des = (qos_map)->num_des;	\			memcpy(__entry->dscp_exception,		\			       &(qos_map)->dscp_exception,	\			       2 * IEEE80211_QOS_MAP_MAX_EX);	\			memcpy(__entry->up, &(qos_map)->up,	\			       IEEE80211_QOS_MAP_LEN_MIN);	\		} else {					\			__entry->num_des = 0;			\			memset(__entry->dscp_exception, 0,	\			       2 * IEEE80211_QOS_MAP_MAX_EX);	\			memset(__entry->up, 0,			\			       IEEE80211_QOS_MAP_LEN_MIN);	\		}						\	} while (0) /************************************************************* *			wiphy work traces		     * *************************************************************/ DECLARE_EVENT_CLASS(wiphy_work_event,	TP_PROTO(struct wiphy *wiphy, struct wiphy_work *work),	TP_ARGS(wiphy, work),	TP_STRUCT__entry(		WIPHY_ENTRY		__field(void *, instance)		__field(void *, func)	),	TP_fast_assign(		WIPHY_ASSIGN;		__entry->instance = work;		__entry->func = work ? work->func : NULL;	),	TP_printk(WIPHY_PR_FMT " instance=%p func=%pS",		  WIPHY_PR_ARG, __entry->instance, __entry->func)); DEFINE_EVENT(wiphy_work_event, wiphy_work_queue,	TP_PROTO(struct wiphy *wiphy, struct wiphy_work *work),	TP_ARGS(wiphy, work)); DEFINE_EVENT(wiphy_work_event, wiphy_work_run,	TP_PROTO(struct wiphy *wiphy, struct wiphy_work *work),	TP_ARGS(wiphy, work)); DEFINE_EVENT(wiphy_work_event, wiphy_work_cancel,	TP_PROTO(struct wiphy *wiphy, struct wiphy_work *work),	TP_ARGS(wiphy, work)); DEFINE_EVENT(wiphy_work_event, wiphy_work_flush,	TP_PROTO(struct wiphy *wiphy, struct wiphy_work *work),	TP_ARGS(wiphy, work)); TRACE_EVENT(wiphy_delayed_work_queue,	TP_PROTO(struct wiphy *wiphy, struct wiphy_work *work,		 unsigned long delay),	TP_ARGS(wiphy, work, delay),	TP_STRUCT__entry(		WIPHY_ENTRY		__field(void *, instance)		__field(void *, func)		__field(unsigned long, delay)	),	TP_fast_assign(		WIPHY_ASSIGN;		__entry->instance = work;		__entry->func = work->func;		__entry->delay = delay;	),	TP_printk(WIPHY_PR_FMT " instance=%p func=%pS delay=%ld",		  WIPHY_PR_ARG, __entry->instance, __entry->func,		  __entry->delay)); TRACE_EVENT(wiphy_hrtimer_work_queue,	TP_PROTO(struct wiphy *wiphy, struct wiphy_work *work,		 ktime_t delay),	TP_ARGS(wiphy, work, delay),	TP_STRUCT__entry(		WIPHY_ENTRY		__field(void *, instance)		__field(void *, func)		__field(ktime_t, delay)	),	TP_fast_assign(		WIPHY_ASSIGN;		__entry->instance = work;		__entry->func = work->func;		__entry->delay = delay;	),	TP_printk(WIPHY_PR_FMT " instance=%p func=%pS delay=%llu",		  WIPHY_PR_ARG, __entry->instance, __entry->func,		  __entry->delay)); TRACE_EVENT(wiphy_work_worker_start,	TP_PROTO(struct wiphy *wiphy),	TP_ARGS(wiphy),	TP_STRUCT__entry(		WIPHY_ENTRY	),	TP_fast_assign(		WIPHY_ASSIGN;	),	TP_printk(WIPHY_PR_FMT, WIPHY_PR_ARG)); /************************************************************* *			rdev->ops traces		     * *************************************************************/ TRACE_EVENT(rdev_suspend,	TP_PROTO(struct wiphy *wiphy, struct cfg80211_wowlan *wow),	TP_ARGS(wiphy, wow),	TP_STRUCT__entry(		WIPHY_ENTRY		__field(bool, any)		__field(bool, disconnect)		__field(bool, magic_pkt)		__field(bool, gtk_rekey_failure)		__field(bool, eap_identity_req)		__field(bool, four_way_handshake)		__field(bool, rfkill_release)		__field(bool, valid_wow)	),	TP_fast_assign(		WIPHY_ASSIGN;		if (wow) {			__entry->any = wow->any;			__entry->disconnect = wow->disconnect;			__entry->magic_pkt = wow->magic_pkt;			__entry->gtk_rekey_failure = wow->gtk_rekey_failure;			__entry->eap_identity_req = wow->eap_identity_req;			__entry->four_way_handshake = wow->four_way_handshake;			__entry->rfkill_release = wow->rfkill_release;			__entry->valid_wow = true;		} else {			__entry->valid_wow = false;		}	),	TP_printk(WIPHY_PR_FMT ", wow%s - any: %d, disconnect: %d, "		  "magic pkt: %d, gtk rekey failure: %d, eap identify req: %d, "		  "four way handshake: %d, rfkill release: %d.",		  WIPHY_PR_ARG, __entry->valid_wow ? "" : "(Not configured!)",		  __entry->any, __entry->disconnect, __entry->magic_pkt,		  __entry->gtk_rekey_failure, __entry->eap_identity_req,		  __entry->four_way_handshake, __entry->rfkill_release)); TRACE_EVENT(rdev_return_int,	TP_PROTO(struct wiphy *wiphy, int ret),	TP_ARGS(wiphy, ret),	TP_STRUCT__entry(		WIPHY_ENTRY		__field(int, ret)	),	TP_fast_assign(		WIPHY_ASSIGN;		__entry->ret = ret;	),	TP_printk(WIPHY_PR_FMT ", returned: %d", WIPHY_PR_ARG, __entry->ret)); TRACE_EVENT(rdev_scan,	TP_PROTO(struct wiphy *wiphy,		 struct cfg80211_scan_request_int *request),	TP_ARGS(wiphy, request),	TP_STRUCT__entry(		WIPHY_ENTRY	),	TP_fast_assign(		WIPHY_ASSIGN;	),	TP_printk(WIPHY_PR_FMT, WIPHY_PR_ARG)); DECLARE_EVENT_CLASS(wiphy_only_evt,	TP_PROTO(struct wiphy *wiphy),	TP_ARGS(wiphy),	TP_STRUCT__entry(		WIPHY_ENTRY	),	TP_fast_assign(		WIPHY_ASSIGN;	),	TP_printk(WIPHY_PR_FMT, WIPHY_PR_ARG)); DEFINE_EVENT(wiphy_only_evt, rdev_resume,	TP_PROTO(struct wiphy *wiphy),	TP_ARGS(wiphy)); DEFINE_EVENT(wiphy_only_evt, rdev_return_void,	TP_PROTO(struct wiphy *wiphy),	TP_ARGS(wiphy)); TRACE_EVENT(rdev_get_antenna,	TP_PROTO(struct wiphy *wiphy, int radio_idx),	TP_ARGS(wiphy, radio_idx),	TP_STRUCT__entry(		WIPHY_ENTRY		__field(int, radio_idx)	),	TP_fast_assign(		WIPHY_ASSIGN;		__entry->radio_idx = radio_idx;	),	TP_printk(WIPHY_PR_FMT ", radio_idx: %d",		  WIPHY_PR_ARG, __entry->radio_idx)); DEFINE_EVENT(wiphy_only_evt, rdev_rfkill_poll,	TP_PROTO(struct wiphy *wiphy),	TP_ARGS(wiphy)); DECLARE_EVENT_CLASS(wiphy_enabled_evt,	TP_PROTO(struct wiphy *wiphy, bool enabled),	TP_ARGS(wiphy, enabled),	TP_STRUCT__entry(		WIPHY_ENTRY		__field(bool, enabled)	),	TP_fast_assign(		WIPHY_ASSIGN;		__entry->enabled = enabled;	),	TP_printk(WIPHY_PR_FMT ", %senabled ",		  WIPHY_PR_ARG, __entry->enabled ? "" : "not ")); DEFINE_EVENT(wiphy_enabled_evt, rdev_set_wakeup,	TP_PROTO(struct wiphy *wiphy, bool enabled),	TP_ARGS(wiphy, enabled)); TRACE_EVENT(rdev_add_virtual_intf,	TP_PROTO(struct wiphy *wiphy, char *name, enum nl80211_iftype type),	TP_ARGS(wiphy, name, type),	TP_STRUCT__entry(		WIPHY_ENTRY		__string(vir_intf_name, name ? name : "<noname>")		__field(enum nl80211_iftype, type)	),	TP_fast_assign(		WIPHY_ASSIGN;		__assign_str(vir_intf_name);		__entry->type = type;	),	TP_printk(WIPHY_PR_FMT ", virtual intf name: %s, type: %d",		  WIPHY_PR_ARG, __get_str(vir_intf_name), __entry->type)); DECLARE_EVENT_CLASS(wiphy_wdev_evt,	TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),	TP_ARGS(wiphy, wdev),

Lines 1–500 of 4414.