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/tx.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/tx.c')
-rw-r--r-- | drivers/net/wireless/libertas/tx.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/libertas/tx.c b/drivers/net/wireless/libertas/tx.c index bb6e17506a41..fbec06c10dd7 100644 --- a/drivers/net/wireless/libertas/tx.c +++ b/drivers/net/wireless/libertas/tx.c | |||
@@ -86,7 +86,7 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb) | |||
86 | plocaltxpd->tx_packet_location = cpu_to_le32(sizeof(struct txpd)); | 86 | plocaltxpd->tx_packet_location = cpu_to_le32(sizeof(struct txpd)); |
87 | 87 | ||
88 | p802x_hdr = skb->data; | 88 | p802x_hdr = skb->data; |
89 | if (priv->adapter->radiomode == WLAN_RADIOMODE_RADIOTAP) { | 89 | if (priv->adapter->monitormode != WLAN_MONITOR_OFF) { |
90 | 90 | ||
91 | /* locate radiotap header */ | 91 | /* locate radiotap header */ |
92 | pradiotap_hdr = (struct tx_radiotap_hdr *)skb->data; | 92 | pradiotap_hdr = (struct tx_radiotap_hdr *)skb->data; |
@@ -106,7 +106,7 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb) | |||
106 | 106 | ||
107 | } | 107 | } |
108 | /* copy destination address from 802.3 or 802.11 header */ | 108 | /* copy destination address from 802.3 or 802.11 header */ |
109 | if (priv->adapter->linkmode == WLAN_LINKMODE_802_11) | 109 | if (priv->adapter->monitormode != WLAN_MONITOR_OFF) |
110 | memcpy(plocaltxpd->tx_dest_addr_high, p802x_hdr + 4, ETH_ALEN); | 110 | memcpy(plocaltxpd->tx_dest_addr_high, p802x_hdr + 4, ETH_ALEN); |
111 | else | 111 | else |
112 | memcpy(plocaltxpd->tx_dest_addr_high, p802x_hdr, ETH_ALEN); | 112 | memcpy(plocaltxpd->tx_dest_addr_high, p802x_hdr, ETH_ALEN); |
@@ -144,7 +144,7 @@ done: | |||
144 | priv->stats.tx_errors++; | 144 | priv->stats.tx_errors++; |
145 | } | 145 | } |
146 | 146 | ||
147 | if (!ret && priv->adapter->radiomode == WLAN_RADIOMODE_RADIOTAP) { | 147 | if (!ret && priv->adapter->monitormode != WLAN_MONITOR_OFF) { |
148 | /* Keep the skb to echo it back once Tx feedback is | 148 | /* Keep the skb to echo it back once Tx feedback is |
149 | received from FW */ | 149 | received from FW */ |
150 | skb_orphan(skb); | 150 | skb_orphan(skb); |
@@ -252,7 +252,7 @@ void libertas_send_tx_feedback(wlan_private * priv) | |||
252 | int txfail; | 252 | int txfail; |
253 | int try_count; | 253 | int try_count; |
254 | 254 | ||
255 | if (adapter->radiomode != WLAN_RADIOMODE_RADIOTAP || | 255 | if (adapter->monitormode == WLAN_MONITOR_OFF || |
256 | adapter->currenttxskb == NULL) | 256 | adapter->currenttxskb == NULL) |
257 | return; | 257 | return; |
258 | 258 | ||