Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc73f11f authored by David Spinadel's avatar David Spinadel Committed by Johannes Berg
Browse files

cfg80211: add wdev to testmode cmd



To allow drivers to implement per-interface testmode operations
more easily, pass a wdev pointer if any identification for one
was given from userspace. Clean up the code a bit while at it.

Signed-off-by: default avatarDavid Spinadel <david.spinadel@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent af61a165
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -66,7 +66,8 @@ void ath6kl_tm_rx_event(struct ath6kl *ar, void *buf, size_t buf_len)
	ath6kl_warn("nla_put failed on testmode rx skb!\n");
}

int ath6kl_tm_cmd(struct wiphy *wiphy, void *data, int len)
int ath6kl_tm_cmd(struct wiphy *wiphy, struct wireless_dev *wdev,
		  void *data, int len)
{
	struct ath6kl *ar = wiphy_priv(wiphy);
	struct nlattr *tb[ATH6KL_TM_ATTR_MAX + 1];
+5 −2
Original line number Diff line number Diff line
@@ -20,7 +20,8 @@
#ifdef CONFIG_NL80211_TESTMODE

void ath6kl_tm_rx_event(struct ath6kl *ar, void *buf, size_t buf_len);
int ath6kl_tm_cmd(struct wiphy *wiphy, void *data, int len);
int ath6kl_tm_cmd(struct wiphy *wiphy, struct wireless_dev *wdev,
		  void *data, int len);

#else

@@ -29,7 +30,9 @@ static inline void ath6kl_tm_rx_event(struct ath6kl *ar, void *buf,
{
}

static inline int ath6kl_tm_cmd(struct wiphy *wiphy, void *data, int len)
static inline int ath6kl_tm_cmd(struct wiphy *wiphy,
				struct wireless_dev *wdev,
				void *data, int len)
{
	return 0;
}
+3 −1
Original line number Diff line number Diff line
@@ -3152,7 +3152,9 @@ static int brcmf_cfg80211_sched_scan_stop(struct wiphy *wiphy,
}

#ifdef CONFIG_NL80211_TESTMODE
static int brcmf_cfg80211_testmode(struct wiphy *wiphy, void *data, int len)
static int brcmf_cfg80211_testmode(struct wiphy *wiphy,
				   struct wireless_dev *wdev,
				   void *data, int len)
{
	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
	struct net_device *ndev = cfg_to_ndev(cfg);
+3 −2
Original line number Diff line number Diff line
@@ -2081,7 +2081,7 @@ struct cfg80211_update_ft_ies_params {
 * @mgmt_tx_cancel_wait: Cancel the wait time from transmitting a management
 *	frame on another channel
 *
 * @testmode_cmd: run a test mode command
 * @testmode_cmd: run a test mode command; @wdev may be %NULL
 * @testmode_dump: Implement a test mode dump. The cb->args[2] and up may be
 *	used by the function, but 0 and 1 must not be touched. Additionally,
 *	return error codes other than -ENOBUFS and -ENOENT will terminate the
@@ -2290,7 +2290,8 @@ struct cfg80211_ops {
	void	(*rfkill_poll)(struct wiphy *wiphy);

#ifdef CONFIG_NL80211_TESTMODE
	int	(*testmode_cmd)(struct wiphy *wiphy, void *data, int len);
	int	(*testmode_cmd)(struct wiphy *wiphy, struct wireless_dev *wdev,
				void *data, int len);
	int	(*testmode_dump)(struct wiphy *wiphy, struct sk_buff *skb,
				 struct netlink_callback *cb,
				 void *data, int len);
+3 −1
Original line number Diff line number Diff line
@@ -2300,7 +2300,9 @@ static void ieee80211_rfkill_poll(struct wiphy *wiphy)
}

#ifdef CONFIG_NL80211_TESTMODE
static int ieee80211_testmode_cmd(struct wiphy *wiphy, void *data, int len)
static int ieee80211_testmode_cmd(struct wiphy *wiphy,
				  struct wireless_dev *wdev,
				  void *data, int len)
{
	struct ieee80211_local *local = wiphy_priv(wiphy);

Loading