diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-07-01 15:26:51 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-10 15:01:50 -0400 |
commit | aff89a9b9084931e51b89d8f3ee3c547bea6c422 (patch) | |
tree | 592c1dfa2ef994a1b3e117b3d7bc1cc7b7bde637 /net/mac80211/cfg.c | |
parent | 5121ea0481f9cea1dfd958f18d7b4ac78778cd40 (diff) |
cfg80211: introduce nl80211 testmode command
This introduces a new NL80211_CMD_TESTMODE for testing
and calibration use with nl80211. There's no multiplexing
like like iwpriv had, and the command is not available by
default, it needs to be explicitly enabled in Kconfig and
shouldn't be enabled in most kernels.
The command requires a wiphy index or interface index to
identify the device to operate on, and the new TESTDATA
attribute. There also is API for sending replies to the
command, and testmode multicast messages (on a testmode
multicast group).
I've also updated mac80211 to be able to pass through the
command to the driver, since it itself doesn't implement
the testmode command.
Additionally, to give people an idea of how to use the
command, I've added a little code to hwsim that makes use
of the new command to set the powersave mode, this is
currently done via debugfs and should remain there, and
the testmode command only serves as an example of how to
use this best -- with nested netlink attributes in the
TESTDATA attribute. A hwsim testmode tool can be found at
http://git.sipsolutions.net/hwsim.git/. This tool is BSD
licensed so people can easily use it as a basis for their
own internal fabrication and validation tools.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index eb93eb6a9cc7..c34c1a41019a 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -1376,6 +1376,18 @@ static void ieee80211_rfkill_poll(struct wiphy *wiphy) | |||
1376 | drv_rfkill_poll(local); | 1376 | drv_rfkill_poll(local); |
1377 | } | 1377 | } |
1378 | 1378 | ||
1379 | #ifdef CONFIG_NL80211_TESTMODE | ||
1380 | int ieee80211_testmode_cmd(struct wiphy *wiphy, void *data, int len) | ||
1381 | { | ||
1382 | struct ieee80211_local *local = wiphy_priv(wiphy); | ||
1383 | |||
1384 | if (!local->ops->testmode_cmd) | ||
1385 | return -EOPNOTSUPP; | ||
1386 | |||
1387 | return local->ops->testmode_cmd(&local->hw, data, len); | ||
1388 | } | ||
1389 | #endif | ||
1390 | |||
1379 | struct cfg80211_ops mac80211_config_ops = { | 1391 | struct cfg80211_ops mac80211_config_ops = { |
1380 | .add_virtual_intf = ieee80211_add_iface, | 1392 | .add_virtual_intf = ieee80211_add_iface, |
1381 | .del_virtual_intf = ieee80211_del_iface, | 1393 | .del_virtual_intf = ieee80211_del_iface, |
@@ -1418,4 +1430,5 @@ struct cfg80211_ops mac80211_config_ops = { | |||
1418 | .set_tx_power = ieee80211_set_tx_power, | 1430 | .set_tx_power = ieee80211_set_tx_power, |
1419 | .get_tx_power = ieee80211_get_tx_power, | 1431 | .get_tx_power = ieee80211_get_tx_power, |
1420 | .rfkill_poll = ieee80211_rfkill_poll, | 1432 | .rfkill_poll = ieee80211_rfkill_poll, |
1433 | CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) | ||
1421 | }; | 1434 | }; |