diff options
author | David Spinadel <david.spinadel@intel.com> | 2013-07-31 11:06:22 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-08-12 08:11:42 -0400 |
commit | 52981cd79461e47fe683febfcbd3d380c72b1c6c (patch) | |
tree | a6d149e4d43930d57c81f7a2b00380b26a395307 | |
parent | fc73f11f5fa230f8c687d51b0fddb00433092ce0 (diff) |
mac80211: add vif to testmode cmd
Pass the wdev from cfg80211 on to the driver as the vif
if given and it's valid for the driver.
Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | drivers/net/wireless/mac80211_hwsim.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/testmode.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/testmode.h | 3 | ||||
-rw-r--r-- | include/net/mac80211.h | 7 | ||||
-rw-r--r-- | net/mac80211/cfg.c | 11 |
5 files changed, 19 insertions, 6 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 7b2a6229eedb..a0d2aacd5e09 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
@@ -1364,6 +1364,7 @@ static const struct nla_policy hwsim_testmode_policy[HWSIM_TM_ATTR_MAX + 1] = { | |||
1364 | static int hwsim_fops_ps_write(void *dat, u64 val); | 1364 | static int hwsim_fops_ps_write(void *dat, u64 val); |
1365 | 1365 | ||
1366 | static int mac80211_hwsim_testmode_cmd(struct ieee80211_hw *hw, | 1366 | static int mac80211_hwsim_testmode_cmd(struct ieee80211_hw *hw, |
1367 | struct ieee80211_vif *vif, | ||
1367 | void *data, int len) | 1368 | void *data, int len) |
1368 | { | 1369 | { |
1369 | struct mac80211_hwsim_data *hwsim = hw->priv; | 1370 | struct mac80211_hwsim_data *hwsim = hw->priv; |
diff --git a/drivers/net/wireless/ti/wlcore/testmode.c b/drivers/net/wireless/ti/wlcore/testmode.c index f3442762d884..527590f2adfb 100644 --- a/drivers/net/wireless/ti/wlcore/testmode.c +++ b/drivers/net/wireless/ti/wlcore/testmode.c | |||
@@ -356,7 +356,8 @@ out: | |||
356 | return ret; | 356 | return ret; |
357 | } | 357 | } |
358 | 358 | ||
359 | int wl1271_tm_cmd(struct ieee80211_hw *hw, void *data, int len) | 359 | int wl1271_tm_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
360 | void *data, int len) | ||
360 | { | 361 | { |
361 | struct wl1271 *wl = hw->priv; | 362 | struct wl1271 *wl = hw->priv; |
362 | struct nlattr *tb[WL1271_TM_ATTR_MAX + 1]; | 363 | struct nlattr *tb[WL1271_TM_ATTR_MAX + 1]; |
diff --git a/drivers/net/wireless/ti/wlcore/testmode.h b/drivers/net/wireless/ti/wlcore/testmode.h index 8071654259ea..61d8434d859a 100644 --- a/drivers/net/wireless/ti/wlcore/testmode.h +++ b/drivers/net/wireless/ti/wlcore/testmode.h | |||
@@ -26,6 +26,7 @@ | |||
26 | 26 | ||
27 | #include <net/mac80211.h> | 27 | #include <net/mac80211.h> |
28 | 28 | ||
29 | int wl1271_tm_cmd(struct ieee80211_hw *hw, void *data, int len); | 29 | int wl1271_tm_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
30 | void *data, int len); | ||
30 | 31 | ||
31 | #endif /* __WL1271_TESTMODE_H__ */ | 32 | #endif /* __WL1271_TESTMODE_H__ */ |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index b70c00111323..df93c77c97ab 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -2516,8 +2516,8 @@ enum ieee80211_roc_type { | |||
2516 | * in IEEE 802.11-2007 section 17.3.8.6 and modify ACK timeout | 2516 | * in IEEE 802.11-2007 section 17.3.8.6 and modify ACK timeout |
2517 | * accordingly. This callback is not required and may sleep. | 2517 | * accordingly. This callback is not required and may sleep. |
2518 | * | 2518 | * |
2519 | * @testmode_cmd: Implement a cfg80211 test mode command. | 2519 | * @testmode_cmd: Implement a cfg80211 test mode command. The passed @vif may |
2520 | * The callback can sleep. | 2520 | * be %NULL. The callback can sleep. |
2521 | * @testmode_dump: Implement a cfg80211 test mode dump. The callback can sleep. | 2521 | * @testmode_dump: Implement a cfg80211 test mode dump. The callback can sleep. |
2522 | * | 2522 | * |
2523 | * @flush: Flush all pending frames from the hardware queue, making sure | 2523 | * @flush: Flush all pending frames from the hardware queue, making sure |
@@ -2778,7 +2778,8 @@ struct ieee80211_ops { | |||
2778 | void (*rfkill_poll)(struct ieee80211_hw *hw); | 2778 | void (*rfkill_poll)(struct ieee80211_hw *hw); |
2779 | void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class); | 2779 | void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class); |
2780 | #ifdef CONFIG_NL80211_TESTMODE | 2780 | #ifdef CONFIG_NL80211_TESTMODE |
2781 | int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len); | 2781 | int (*testmode_cmd)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
2782 | void *data, int len); | ||
2782 | int (*testmode_dump)(struct ieee80211_hw *hw, struct sk_buff *skb, | 2783 | int (*testmode_dump)(struct ieee80211_hw *hw, struct sk_buff *skb, |
2783 | struct netlink_callback *cb, | 2784 | struct netlink_callback *cb, |
2784 | void *data, int len); | 2785 | void *data, int len); |
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index c77916ffe74c..7aa38ce0b524 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -2305,11 +2305,20 @@ static int ieee80211_testmode_cmd(struct wiphy *wiphy, | |||
2305 | void *data, int len) | 2305 | void *data, int len) |
2306 | { | 2306 | { |
2307 | struct ieee80211_local *local = wiphy_priv(wiphy); | 2307 | struct ieee80211_local *local = wiphy_priv(wiphy); |
2308 | struct ieee80211_vif *vif = NULL; | ||
2308 | 2309 | ||
2309 | if (!local->ops->testmode_cmd) | 2310 | if (!local->ops->testmode_cmd) |
2310 | return -EOPNOTSUPP; | 2311 | return -EOPNOTSUPP; |
2311 | 2312 | ||
2312 | return local->ops->testmode_cmd(&local->hw, data, len); | 2313 | if (wdev) { |
2314 | struct ieee80211_sub_if_data *sdata; | ||
2315 | |||
2316 | sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); | ||
2317 | if (sdata->flags & IEEE80211_SDATA_IN_DRIVER) | ||
2318 | vif = &sdata->vif; | ||
2319 | } | ||
2320 | |||
2321 | return local->ops->testmode_cmd(&local->hw, vif, data, len); | ||
2313 | } | 2322 | } |
2314 | 2323 | ||
2315 | static int ieee80211_testmode_dump(struct wiphy *wiphy, | 2324 | static int ieee80211_testmode_dump(struct wiphy *wiphy, |