diff options
author | Luis Carlos Cobo <luisca@cozybit.com> | 2007-08-02 13:16:55 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:50:13 -0400 |
commit | 965f8bbc6c92233600b176f4c80299f6766df9bd (patch) | |
tree | 85043fb97112a148d69171b744568fa78de2e05d /drivers/net/wireless/libertas/cmd.c | |
parent | 9483f03150cbfa1f706355b7f9d218d6086c6fce (diff) |
[PATCH] libertas: monitor mode support for OLPC firmware
Driver support for the monitor mode support that will be available in the next
OLPC 'bleeding edge' Marvell firmware release (most likely, 5.110.16.p2).
To activate monitor mode,
echo mode > /sys/class/net/{ethX,mshX}/device/libertas_rtap
where mode is the hex mask that specifies which frames to sniff (in short, 0x1
for data, 0x2 for all management but beacons, 0x4 for beacons). Any non zero
mode will activate the monitor mode, inhibiting transmission in ethX and mshX
interfaces and routing all the incoming traffic to a new rtapX interface that
will output the packets in 802.11+radiotap headers format.
Signed-off-by: Luis Carlos Cobo <luisca@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/cmd.c')
-rw-r--r-- | drivers/net/wireless/libertas/cmd.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index 517489a06063..cd3bddb243b1 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -565,6 +565,26 @@ static int wlan_cmd_802_11_rf_tx_power(wlan_private * priv, | |||
565 | return 0; | 565 | return 0; |
566 | } | 566 | } |
567 | 567 | ||
568 | static int wlan_cmd_802_11_monitor_mode(wlan_private * priv, | ||
569 | struct cmd_ds_command *cmd, | ||
570 | u16 cmd_action, void *pdata_buf) | ||
571 | { | ||
572 | struct cmd_ds_802_11_monitor_mode *monitor = &cmd->params.monitor; | ||
573 | |||
574 | cmd->command = cpu_to_le16(CMD_802_11_MONITOR_MODE); | ||
575 | cmd->size = | ||
576 | cpu_to_le16(sizeof(struct cmd_ds_802_11_monitor_mode) + | ||
577 | S_DS_GEN); | ||
578 | |||
579 | monitor->action = cpu_to_le16(cmd_action); | ||
580 | if (cmd_action == CMD_ACT_SET) { | ||
581 | monitor->mode = | ||
582 | cpu_to_le16((u16) (*(u32 *) pdata_buf)); | ||
583 | } | ||
584 | |||
585 | return 0; | ||
586 | } | ||
587 | |||
568 | static int wlan_cmd_802_11_rate_adapt_rateset(wlan_private * priv, | 588 | static int wlan_cmd_802_11_rate_adapt_rateset(wlan_private * priv, |
569 | struct cmd_ds_command *cmd, | 589 | struct cmd_ds_command *cmd, |
570 | u16 cmd_action) | 590 | u16 cmd_action) |
@@ -1239,6 +1259,11 @@ int libertas_prepare_and_send_command(wlan_private * priv, | |||
1239 | ret = wlan_cmd_mac_multicast_adr(priv, cmdptr, cmd_action); | 1259 | ret = wlan_cmd_mac_multicast_adr(priv, cmdptr, cmd_action); |
1240 | break; | 1260 | break; |
1241 | 1261 | ||
1262 | case CMD_802_11_MONITOR_MODE: | ||
1263 | ret = wlan_cmd_802_11_monitor_mode(priv, cmdptr, | ||
1264 | cmd_action, pdata_buf); | ||
1265 | break; | ||
1266 | |||
1242 | case CMD_802_11_AD_HOC_JOIN: | 1267 | case CMD_802_11_AD_HOC_JOIN: |
1243 | ret = libertas_cmd_80211_ad_hoc_join(priv, cmdptr, pdata_buf); | 1268 | ret = libertas_cmd_80211_ad_hoc_join(priv, cmdptr, pdata_buf); |
1244 | break; | 1269 | break; |