cfg80211: add peer measurement with FTM initiator API
Subsystems (2)
Johannes Berg
maintainerPATCH v5 1/2 cfg80211: add peer measurement with FTM initiator API
From: Johannes Berg <[email protected]>
Add a new "peer measurement" API, that can be used to measure certain things related to a peer. Right now, only implement FTM (flight time measurement) over it, but the idea is that it'll be extensible to also support measuring the necessary things to calculate e.g. angle-of-arrival for WiGig.
The API is structured to have a generic list of peers and channels to measure with/on, and then for each of those a set of measurements (again, only FTM right now) to perform.
Results are sent to the requesting socket, including a final complete message.
Closing the controlling netlink socket will abort a running measurement.
---
v3:
- add a bit to report "final" for partial results
- remove list keeping etc. and just unicast out the results to the requester (big code reduction ...)
- also send complete message unicast, and as a result remove the multicast group
- separate out struct cfg80211_pmsr_ftm_request_peer from struct cfg80211_pmsr_request_peer
- document timeout == 0 if no timeout
- disallow setting timeout nl80211 attribute to 0, must not include attribute for no timeout
- make MAC address randomization optional
- change num bursts exponent default to 0 (1 burst, rather rather than the old default of 15==don't care)
v4:
- clarify NL80211_ATTR_TIMEOUT documentation
v5:
- remove unnecessary nl80211 multicast/family changes
- remove partial results bit/flag, final is sufficient
- add max_bursts_exponent, max_ftms_per_burst to capability
- rename "frames per burst" -> "FTMs per burst"
--- include/net/cfg80211.h | 261 ++++++++++++++++ include/uapi/linux/nl80211.h | 417 +++++++++++++++++++++++++ net/wireless/Makefile | 1 + net/wireless/core.c | 33 ++ net/wireless/core.h | 4 + net/wireless/nl80211.c | 192 ++++++++++-- net/wireless/nl80211.h | 28 ++ net/wireless/pmsr.c | 590 +++++++++++++++++++++++++++++++++++ net/wireless/rdev-ops.h | 25 ++ net/wireless/trace.h | 68 ++++ 10 files changed, 1600 insertions(+), 19 deletions(-) create mode 100644 net/wireless/pmsr.c
include/net/cfg80211.h +261 -0
@@ -2848,6 +2848,190 @@ struct cfg80211_ftm_responder_stats {u32 out_of_window_triggers_num; }; +/** +* struct cfg80211_pmsr_ftm_result - FTM result +* @failure_reason: if this measurement failed (PMSR status is +* %NL80211_PMSR_STATUS_FAILURE), this gives a more precise +* reason than just "failure" +* @burst_index: if reporting partial results, this is the index +* in [0 .. num_bursts-1] of the burst that's being reported +* @num_ftmr_attempts: number of FTM request frames transmitted +* @num_ftmr_successes: number of FTM request frames acked +* @busy_retry_time: if failure_reason is %NL80211_PMSR_FTM_FAILURE_PEER_BUSY, +* fill this to indicate in how many seconds a retry is deemed possible +* by the responder +* @num_bursts_exp: actual number of bursts exponent negotiated +* @burst_duration: actual burst duration negotiated +* @ftms_per_burst: actual frames per burst negotiated +* @lci_len: length of LCI information (if present) +* @civicloc_len: length of civic location information (if present) +* @lci: LCI data (may be %NULL) +* @civicloc: civic location data (may be %NULL) +* @rssi_avg: average RSSI over FTM action frames reported +* @rssi_spread: spread of the RSSI over FTM action frames reported +* @tx_rate: bitrate for transmitted FTM action frame response +* @rx_rate: bitrate of received FTM action frame +* @rtt_avg: average of RTTs measured (must have either this or @dist_avg) +* @rtt_variance: variance of RTTs measured (note that standard deviation is +* the square root of the variance) +* @rtt_spread: spread of the RTTs measured +* @dist_avg: average of distances (mm) measured +* (must have either this or @rtt_avg) +* @dist_variance: variance of distances measured (see also @rtt_variance) +* @dist_spread: spread of distances measured (see also @rtt_spread) +* @num_ftmr_attempts_valid: @num_ftmr_attempts is valid +* @num_ftmr_successes_valid: @num_ftmr_successes is valid +* @rssi_avg_valid: @rssi_avg is valid +* @rssi_spread_valid: @rssi_spread is valid +* @tx_rate_valid: @tx_rate is valid +* @rx_rate_valid: @rx_rate is valid +* @rtt_avg_valid: @rtt_avg is valid +* @rtt_variance_valid: @rtt_variance is valid +* @rtt_spread_valid: @rtt_spread is valid +* @dist_avg_valid: @dist_avg is valid +* @dist_variance_valid: @dist_variance is valid +* @dist_spread_valid: @dist_spread is valid +*/ +struct cfg80211_pmsr_ftm_result { +const u8 *lci; +const u8 *civicloc; +unsigned int lci_len; +unsigned int civicloc_len; +enum nl80211_peer_measurement_ftm_failure_reasons failure_reason; +u32 num_ftmr_attempts, num_ftmr_successes; +s16 burst_index; +u8 busy_retry_time; +u8 num_bursts_exp; +u8 burst_duration; +u8 ftms_per_burst; +s32 rssi_avg; +s32 rssi_spread; +struct rate_info tx_rate, rx_rate; +s64 rtt_avg; +s64 rtt_variance; +s64 rtt_spread; +s64 dist_avg; +s64 dist_variance; +s64 dist_spread; + +u16 num_ftmr_attempts_valid:1 , + num_ftmr_successes_valid:1 , + rssi_avg_valid:1 , + rssi_spread_valid:1 , + tx_rate_valid:1 , + rx_rate_valid:1 , + rtt_avg_valid:1 , + rtt_variance_valid:1 , + rtt_spread_valid:1 , + dist_avg_valid:1 , + dist_variance_valid:1 , + dist_spread_valid:1 ; +}; + +/** +* struct cfg80211_pmsr_result - peer measurement result +* @addr: address of the peer +* @host_time: host time (use ktime_get_boottime() adjust to the time when the +* measurement was made) +* @ap_tsf: AP's TSF at measurement time +* @status: status of the measurement +* @final: if reporting partial results, mark this as the last one; if not +* reporting partial results always set this flag +* @ap_tsf_valid: indicates the @ap_tsf value is valid +* @type: type of the measurement reported, note that we only support reporting +* one type at a time, but you can report multiple results separately and +* they're all aggregated for userspace. +*/ +struct cfg80211_pmsr_result { +u64 host_time, ap_tsf; +enum nl80211_peer_measurement_status status; + +u8 addr[ETH_ALEN ]; + +u8 final:1 , + ap_tsf_valid:1 ; + +enum nl80211_peer_measurement_type type; + +union { +struct cfg80211_pmsr_ftm_result ftm; + }; +}; + +/** +* struct cfg80211_pmsr_ftm_request_peer - FTM request data +* @requested: indicates FTM is requested +* @preamble: frame preamble to use +* @burst_period: burst period to use +* @asap: indicates to use ASAP mode +* @num_bursts_exp: number of bursts exponent +* @burst_duration: burst duration +* @ftms_per_burst: number of frames per burst +* @ftmr_retries: number of retries for FTM request +* @request_lci: request LCI information +* @request_civicloc: request civic location information +* +* See also nl80211 for the respective attribute documentation. +*/ +struct cfg80211_pmsr_ftm_request_peer { +enum nl80211_preamble preamble; +u16 burst_period; +bool requested; +bool asap; +u8 num_bursts_exp; +u8 burst_duration; +u8 ftms_per_burst; +u8 ftmr_retries; +bool request_lci; +bool request_civicloc; +}; + +/** +* struct cfg80211_pmsr_request_peer - peer data for a peer measurement request +* @addr: MAC address +* @chandef: channel to use +* @report_ap_tsf: report the associated AP's TSF +* @ftm: FTM data, see &struct cfg80211_pmsr_ftm_request_peer +*/ +struct cfg80211_pmsr_request_peer { +u8 addr[ETH_ALEN ]; +struct cfg80211_chan_def chandef; +bool report_ap_tsf; +struct cfg80211_pmsr_ftm_request_peer ftm; +}; + +/** +* struct cfg80211_pmsr_request - peer measurement request +* @cookie: cookie, set by cfg80211 +* @nl_portid: netlink portid - used by cfg80211 +* @drv_data: driver data for this request, if required for aborting, +* not otherwise freed or anything by cfg80211 +* @mac_addr: MAC address used for (randomised) request +* @mac_addr_mask: MAC address mask used for randomisation, bits that +* are 0 in the mask should be randomised, bits that are 1 should +* be taken from the @mac_addr +* @list: used by cfg80211 to hold on to the request +* @timeout: timeout (in milliseconds) for the whole operation, if +* zero it means there's no timeout +* @n_peers: number of peers to do measurements with +* @peers: per-peer measurement request data +*/ +struct cfg80211_pmsr_request { +u64 cookie; +void *drv_data; +u32 n_peers; +u32 nl_portid; + +u32 timeout; + +u8 mac_addr[ETH_ALEN ]__aligned(2) ; +u8 mac_addr_mask[ETH_ALEN ]__aligned(2) ; + +struct list_head list; + +struct cfg80211_pmsr_request_peer peers[]; +}; +/** * struct cfg80211_ops - backend description for wireless configuration *
@@ -3183,6 +3367,8 @@ struct cfg80211_ftm_responder_stats {* * @get_ftm_responder_stats: Retrieve FTM responder statistics, if available. * Statistics should be cumulative, currently no way to reset is provided. +* @start_pmsr: start peer measurement (e.g. FTM) +* @abort_pmsr: abort peer measurement */ struct cfg80211_ops {int (*suspend)(struct wiphy *wiphy,struct cfg80211_wowlan *wow);
@@ -3492,6 +3678,11 @@ struct cfg80211_ops {int (*get_ftm_responder_stats)(struct wiphy *wiphy,struct net_device *dev,struct cfg80211_ftm_responder_stats *ftm_stats); + +int (*start_pmsr)(struct wiphy *wiphy,struct wireless_dev *wdev, +struct cfg80211_pmsr_request *request); +void (*abort_pmsr)(struct wiphy *wiphy,struct wireless_dev *wdev, +struct cfg80211_pmsr_request *request); };/*
@@ -3863,6 +4054,40 @@ struct wiphy_iftype_ext_capab {u8 extended_capabilities_len; }; +/** +* struct cfg80211_pmsr_capabilities - cfg80211 peer measurement capabilities +* @max_peers: maximum number of peers in a single measurement +* @report_ap_tsf: can report assoc AP's TSF for radio resource measurement +* @randomize_mac_addr: can randomize MAC address for measurement +* @ftm.supported: FTM measurement is supported +* @ftm.asap: ASAP-mode is supported +* @ftm.non_asap: non-ASAP-mode is supported +* @ftm.request_lci: can request LCI data +* @ftm.request_civicloc: can request civic location data +* @ftm.preambles: bitmap of preambles supported (&enum nl80211_preamble) +* @ftm.bandwidths: bitmap of bandwidths supported (&enum nl80211_chan_width) +* @ftm.max_bursts_exponent: maximum burst exponent supported +* (set to 0 if not limited; note that setting this will necessarily +* forbid using the value 15 to let the responder pick) +* @ftm.max_ftms_per_burst: maximum FTMs per burst supported (set to 0 if +* not limited) +*/ +struct cfg80211_pmsr_capabilities { +unsigned int max_peers; +bool report_ap_tsf; +bool randomize_mac_addr; + +struct { +u32 preambles; +u32 bandwidths; +u8 max_bursts_exponent; +u8 max_ftms_per_burst; +bool supported; +bool asap, non_asap; +bool request_lci, request_civicloc; + } ftm; +}; +/** * struct wiphy - wireless hardware description * @reg_notifier: the driver's regulatory notification callback,
@@ -4027,6 +4252,8 @@ struct wiphy_iftype_ext_capab {* @txq_limit: configuration of internal TX queue frame limit * @txq_memory_limit: configuration internal TX queue memory limit * @txq_quantum: configuration of internal TX queue scheduler quantum +* +* @pmsr_capa: peer measurement capabilities */ struct wiphy {/* assign these fields before you register the wiphy */
@@ -4163,6 +4390,8 @@ struct wiphy {u32 txq_memory_limit;u32 txq_quantum; +const struct cfg80211_pmsr_capabilities *pmsr_capa; +char priv[0 ]__aligned(NETDEV_ALIGN) ; };
@@ -4365,6 +4594,9 @@ struct cfg80211_cqm_config;* @owner_nlportid: (private) owner socket port ID * @nl_owner_dead: (private) owner socket went away * @cqm_config: (private) nl80211 RSSI monitor state +* @pmsr_list: (private) peer measurement requests +* @pmsr_lock: (private) peer measurements requests/results lock +* @pmsr_free_wk: (private) peer measurements cleanup work */ struct wireless_dev {struct wiphy *wiphy;
@@ -4436,6 +4668,10 @@ struct wireless_dev {#endif struct cfg80211_cqm_config *cqm_config; + +struct list_head pmsr_list; +spinlock_t pmsr_lock; +struct work_struct pmsr_free_wk; };static inline u8 *wdev_address (struct wireless_dev *wdev)
@@ -6630,6 +6866,31 @@ int cfg80211_external_auth_request(struct net_device *netdev,struct cfg80211_external_auth_params *params, gfp_t gfp); +/** +* cfg80211_pmsr_report - report peer measurement result data +* @wdev: the wireless device reporting the measurement +* @req: the original measurement request +* @result: the result data +* @gfp: allocation flags +*/ +void cfg80211_pmsr_report (struct wireless_dev *wdev, +struct cfg80211_pmsr_request *req, +struct cfg80211_pmsr_result *result, +gfp_t gfp); + +/** +* cfg80211_pmsr_complete - report peer measurement completed +* @wdev: the wireless device reporting the measurement +* @req: the original measurement request +* @gfp: allocation flags +* +* Report that the entire measurement completed, after this +* the request pointer will no longer be valid. +*/ +void cfg80211_pmsr_complete (struct wireless_dev *wdev, +struct cfg80211_pmsr_request *req, +gfp_t gfp); +/* Logging, debugging and troubleshooting/diagnostic helpers. */ /* wiphy_printk helpers, similar to dev_printk */
include/uapi/linux/nl80211.h +417 -0
445 lines not on this page · raw message
net/wireless/Makefile +1 -0
@@ -12,6 +12,7 @@ obj-$(CONFIG_WEXT_PRIV) += wext-priv.o cfg80211-y += core.o sysfs.o radiotap.o util.o reg.o scan.o nl80211.o cfg80211-y += mlme.o ibss.o sme.o chan.o ethtool.o mesh.o ap.o trace.o ocb.o +cfg80211-y += pmsr.o cfg80211-$(CONFIG_OF) += of.o cfg80211-$(CONFIG_CFG80211_DEBUGFS) += debugfs.o cfg80211-$(CONFIG_CFG80211_WEXT) += wext-compat.o wext-sme.o
net/wireless/core.c +33 -0
@@ -664,6 +664,34 @@ int wiphy_register(struct wiphy *wiphy)return -EINVAL ;#endif +if (WARN_ON (wiphy->pmsr_capa && !wiphy->pmsr_capa->ftm.supported)) +return -EINVAL ; + +if (wiphy->pmsr_capa && wiphy->pmsr_capa->ftm.supported) { +if (WARN_ON (!wiphy->pmsr_capa->ftm.asap && + !wiphy->pmsr_capa->ftm.non_asap)) +return -EINVAL ; +if (WARN_ON (!wiphy->pmsr_capa->ftm.preambles || + !wiphy->pmsr_capa->ftm.bandwidths)) +return -EINVAL ; +if (WARN_ON (wiphy->pmsr_capa->ftm.preambles & + ~(BIT (NL80211_PREAMBLE_LEGACY ) | +BIT (NL80211_PREAMBLE_HT ) | +BIT (NL80211_PREAMBLE_VHT ) | +BIT (NL80211_PREAMBLE_DMG )))) +return -EINVAL ; +if (WARN_ON (wiphy->pmsr_capa->ftm.bandwidths & + ~(BIT (NL80211_CHAN_WIDTH_20_NOHT ) | +BIT (NL80211_CHAN_WIDTH_20 ) | +BIT (NL80211_CHAN_WIDTH_40 ) | +BIT (NL80211_CHAN_WIDTH_80 ) | +BIT (NL80211_CHAN_WIDTH_80P80 ) | +BIT (NL80211_CHAN_WIDTH_160 ) | +BIT (NL80211_CHAN_WIDTH_5 ) | +BIT (NL80211_CHAN_WIDTH_10 )))) +return -EINVAL ; + } +/* * if a wiphy has unsupported modes for regulatory channel enforcement, * opt-out of enforcement checking
@@ -1053,6 +1081,8 @@ static void __cfg80211_unregister_wdev(struct wireless_dev *wdev, bool sync)flush_work (&wdev->disconnect_wk);cfg80211_cqm_config_free (wdev); + +cfg80211_pmsr_free_wdev (wdev); }void cfg80211_unregister_wdev (struct wireless_dev *wdev)
@@ -1174,6 +1204,9 @@ void cfg80211_init_wdev(struct cfg80211_registered_device *rdev,spin_lock_init (&wdev->event_lock);INIT_LIST_HEAD (&wdev->mgmt_registrations);spin_lock_init (&wdev->mgmt_registrations_lock); +INIT_LIST_HEAD (&wdev->pmsr_list); +spin_lock_init (&wdev->pmsr_lock); +INIT_WORK (&wdev->pmsr_free_wk, cfg80211_pmsr_free_wk);/* * We get here also when the interface changes network namespaces,
net/wireless/core.h +4 -0
@@ -530,4 +530,8 @@ void cfg80211_stop_nan(struct cfg80211_registered_device *rdev,void cfg80211_cqm_config_free (struct wireless_dev *wdev); +void cfg80211_release_pmsr (struct wireless_dev *wdev,u32 portid); +void cfg80211_pmsr_free_wdev (struct wireless_dev *wdev); +void cfg80211_pmsr_free_wk (struct work_struct *work); +#endif /* __NET_WIRELESS_CORE_H */
net/wireless/nl80211.c +173 -19
264 lines not on this page · raw message
net/wireless/nl80211.h +28 -0
@@ -6,6 +6,30 @@int nl80211_init (void );void nl80211_exit (void ); + +extern const struct nla_policy nl80211_policy[NUM_NL80211_ATTR ]; + +void *nl80211hdr_put (struct sk_buff *skb,u32 portid,u32 seq, +int flags,u8 cmd); +bool nl80211_put_sta_rate (struct sk_buff *msg,struct rate_info *info, +int attr); + +static inline u64 wdev_id (struct wireless_dev *wdev) +{ +return (u64 )wdev->identifier | + ((u64 )wiphy_to_rdev (wdev->wiphy)->wiphy_idx <<32 ); +} + +int nl80211_prepare_wdev_dump (struct netlink_callback *cb, +struct cfg80211_registered_device **rdev, +struct wireless_dev **wdev); + +int nl80211_parse_chandef (struct cfg80211_registered_device *rdev, +struct genl_info *info, +struct cfg80211_chan_def *chandef); +int nl80211_parse_random_mac (struct nlattr **attrs, +u8 *mac_addr,u8 *mac_addr_mask); +void nl80211_notify_wiphy (struct cfg80211_registered_device *rdev,enum nl80211_commands cmd); void nl80211_notify_iface(struct cfg80211_registered_device *rdev,
@@ -95,4 +119,8 @@ void nl80211_send_ap_stopped(struct wireless_dev *wdev);void cfg80211_rdev_free_coalesce (struct cfg80211_registered_device *rdev); +/* peer measurement */ +int nl80211_pmsr_start (struct sk_buff *skb,struct genl_info *info); +int nl80211_pmsr_dump_results (struct sk_buff *skb,struct netlink_callback *cb); +#endif /* __NET_WIRELESS_NL80211_H */
net/wireless/pmsr.c new file +590 -0
590 lines not on this page · raw message
net/wireless/rdev-ops.h +25 -0
@@ -1247,4 +1247,29 @@ rdev_get_ftm_responder_stats(struct cfg80211_registered_device *rdev,return ret; } +static inline int +rdev_start_pmsr (struct cfg80211_registered_device *rdev, +struct wireless_dev *wdev, +struct cfg80211_pmsr_request *request) +{ +int ret = -EOPNOTSUPP ; + +trace_rdev_start_pmsr (&rdev->wiphy, wdev, request->cookie); +if (rdev->ops->start_pmsr) + ret = rdev->ops->start_pmsr (&rdev->wiphy, wdev, request); +trace_rdev_return_int (&rdev->wiphy, ret); +return ret; +} + +static inline void +rdev_abort_pmsr (struct cfg80211_registered_device *rdev, +struct wireless_dev *wdev, +struct cfg80211_pmsr_request *request) +{ +trace_rdev_abort_pmsr (&rdev->wiphy, wdev, request->cookie); +if (rdev->ops->abort_pmsr) + rdev->ops->abort_pmsr (&rdev->wiphy, wdev, request); +trace_rdev_return_void (&rdev->wiphy); +} +#endif /* __CFG80211_RDEV_OPS */
net/wireless/trace.h +68 -0
86 lines not on this page · raw message
Signature · 1 line
2.17.2
Johannes Berg
maintainerPATCH v5 2/2 mac80211: allow drivers to use peer measurement API
From: Johannes Berg <[email protected]>
There's nothing much for mac80211 to do, so only pass through the requests with minimal checks and tracing. The driver must call cfg80211's results APIs.
---
v4: first version - just takes the same number as the cfg80211 patch
v5: no changes
--- include/net/mac80211.h | 7 +++++++ net/mac80211/cfg.c | 22 ++++++++++++++++++++++ net/mac80211/driver-ops.h | 34 ++++++++++++++++++++++++++++++++++ net/mac80211/trace.h | 12 ++++++++++++ 4 files changed, 75 insertions(+)
include/net/mac80211.h +7 -0
@@ -3623,6 +3623,9 @@ enum ieee80211_reconfig_type {* skb is always a real frame, head may or may not be an A-MSDU. * @get_ftm_responder_stats: Retrieve FTM responder statistics, if available. * Statistics should be cumulative, currently no way to reset is provided. +* +* @start_pmsr: start peer measurement (e.g. FTM) (this call can sleep) +* @abort_pmsr: abort peer measurement (this call can sleep) */ struct ieee80211_ops { void (*tx)(struct ieee80211_hw *hw,
@@ -3911,6 +3914,10 @@ struct ieee80211_ops {int (*get_ftm_responder_stats)(struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct cfg80211_ftm_responder_stats *ftm_stats); +int (*start_pmsr)(struct ieee80211_hw *hw,struct ieee80211_vif *vif, +struct cfg80211_pmsr_request *request); +void (*abort_pmsr)(struct ieee80211_hw *hw,struct ieee80211_vif *vif, +struct cfg80211_pmsr_request *request); };/**
net/mac80211/cfg.c +22 -0
@@ -3849,6 +3849,26 @@ ieee80211_get_ftm_responder_stats(struct wiphy *wiphy,return drv_get_ftm_responder_stats (local, sdata, ftm_stats); } +static int +ieee80211_start_pmsr (struct wiphy *wiphy,struct wireless_dev *dev, +struct cfg80211_pmsr_request *request) +{ +struct ieee80211_local *local =wiphy_priv (wiphy); +struct ieee80211_sub_if_data *sdata =IEEE80211_WDEV_TO_SUB_IF (dev); + +return drv_start_pmsr (local, sdata, request); +} + +static void +ieee80211_abort_pmsr (struct wiphy *wiphy,struct wireless_dev *dev, +struct cfg80211_pmsr_request *request) +{ +struct ieee80211_local *local =wiphy_priv (wiphy); +struct ieee80211_sub_if_data *sdata =IEEE80211_WDEV_TO_SUB_IF (dev); + +return drv_abort_pmsr (local, sdata, request); +} +const struct cfg80211_ops mac80211_config_ops = { .add_virtual_intf = ieee80211_add_iface, .del_virtual_intf = ieee80211_del_iface,
@@ -3944,4 +3964,6 @@ const struct cfg80211_ops mac80211_config_ops = { .tx_control_port = ieee80211_tx_control_port, .get_txq_stats = ieee80211_get_txq_stats, .get_ftm_responder_stats = ieee80211_get_ftm_responder_stats, + .start_pmsr = ieee80211_start_pmsr, + .abort_pmsr = ieee80211_abort_pmsr, };
net/mac80211/driver-ops.h +34 -0
@@ -1199,6 +1199,40 @@ drv_get_ftm_responder_stats(struct ieee80211_local *local,return ret; } +static inline int drv_start_pmsr (struct ieee80211_local *local, +struct ieee80211_sub_if_data *sdata, +struct cfg80211_pmsr_request *request) +{ +int ret = -EOPNOTSUPP ; + +might_sleep (); +if (!check_sdata_in_driver (sdata)) +return -EIO ; + +trace_drv_start_pmsr (local, sdata); + +if (local->ops->start_pmsr) + ret = local->ops->start_pmsr (&local->hw, &sdata->vif, request); +trace_drv_return_int (local, ret); + +return ret; +} + +static inline void drv_abort_pmsr (struct ieee80211_local *local, +struct ieee80211_sub_if_data *sdata, +struct cfg80211_pmsr_request *request) +{ +trace_drv_abort_pmsr (local, sdata); + +might_sleep (); +if (!check_sdata_in_driver (sdata)) +return ; + +if (local->ops->abort_pmsr) + local->ops->abort_pmsr (&local->hw, &sdata->vif, request); +trace_drv_return_void (local); +} +static inline int drv_start_nan (struct ieee80211_local *local,struct ieee80211_sub_if_data *sdata,struct cfg80211_nan_conf *conf)
net/mac80211/trace.h +12 -0
@@ -1882,6 +1882,18 @@ TRACE_EVENT(drv_del_nan_func, ) ); +DEFINE_EVENT (local_sdata_evt, drv_start_pmsr, + TP_PROTO(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata), +TP_ARGS (local, sdata) +); + +DEFINE_EVENT (local_sdata_evt, drv_abort_pmsr, + TP_PROTO(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata), +TP_ARGS (local, sdata) +); +/* * Tracing for API calls that drivers call. */
Signature · 1 line
2.17.2