From: Kalle Valo <kalle.valo@iki.fi>
To: linux-wireless@vger.kernel.org
Cc: Pavel Roskin <proski@gnu.org>
Subject: [PATCH 06/12] Add support for monitor mode
Date: Sun, 10 Feb 2008 17:00:34 +0200 [thread overview]
Message-ID: <20080210150034.17592.71617.stgit@tikku> (raw)
In-Reply-To: <20080210145733.17592.61729.stgit@tikku>
Signed-off-by: Kalle Valo <kalle.valo@iki.fi>
---
drivers/net/wireless/at76_usb.c | 28 ++++++++++++++++++++++++++--
drivers/net/wireless/at76_usb.h | 2 ++
2 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/at76_usb.c b/drivers/net/wireless/at76_usb.c
index 6e8a001..0d26086 100644
--- a/drivers/net/wireless/at76_usb.c
+++ b/drivers/net/wireless/at76_usb.c
@@ -19,7 +19,6 @@
* Some iw_handler code was taken from airo.c, (C) 1999 Benjamin Reed
*
* TODO for the mac80211 port:
- * o monitor mode
* o adhoc support
* o hardware wep encryption
* o RTS/CTS support
@@ -5296,6 +5295,8 @@ static int at76_mac80211_start(struct ieee80211_hw *hw)
at76_startup_device(priv);
+ at76_start_monitor(priv);
+
error:
mutex_unlock(&priv->mtx);
@@ -5487,6 +5488,8 @@ static int at76_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
if (is_valid_ether_addr(priv->bssid))
at76_join(priv);
+ else
+ at76_start_monitor(priv);
mutex_unlock(&priv->mtx);
@@ -5519,16 +5522,37 @@ static int at76_config_interface(struct ieee80211_hw *hw,
return 0;
}
+/* must be atomic */
static void at76_configure_filter(struct ieee80211_hw *hw,
unsigned int changed_flags,
unsigned int *total_flags, int mc_count,
struct dev_addr_list *mc_list)
{
+ struct at76_mac80211_priv *m_priv = hw->priv;
+ struct at76_priv *priv = m_priv->at76_priv;
+ int flags;
+
at76_dbg(DBG_MAC80211, "%s(): changed_flags=0x%08x "
"total_flags=0x%08x mc_count=%d",
__func__, changed_flags, *total_flags, mc_count);
- *total_flags = 0;
+ flags = changed_flags & AT76_SUPPORTED_FILTERS;
+ *total_flags = AT76_SUPPORTED_FILTERS;
+
+ /* FIXME: access to priv->promisc should be protected with
+ * priv->mtx, but it's impossible because this function needs to be
+ * atomic */
+
+ if (flags && !priv->promisc) {
+ /* mac80211 wants us to enable promiscuous mode */
+ priv->promisc = 1;
+ } else if (!flags && priv->promisc) {
+ /* we need to disable promiscuous mode */
+ priv->promisc = 0;
+ } else
+ return;
+
+ queue_work(hw->workqueue, &priv->work_set_promisc);
}
static const struct ieee80211_ops at76_ops = {
diff --git a/drivers/net/wireless/at76_usb.h b/drivers/net/wireless/at76_usb.h
index 555a948..baa85a5 100644
--- a/drivers/net/wireless/at76_usb.h
+++ b/drivers/net/wireless/at76_usb.h
@@ -577,6 +577,8 @@ struct at76_rx_radiotap {
s8 rt_noise;
};
+#define AT76_SUPPORTED_FILTERS FIF_PROMISC_IN_BSS
+
#define AT76_RX_RADIOTAP_PRESENT \
((1 << IEEE80211_RADIOTAP_TSFT) | \
(1 << IEEE80211_RADIOTAP_FLAGS) | \
next prev parent reply other threads:[~2008-02-10 15:11 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-10 14:59 [PATCH 00/12] at76_usb mac80211 port Kalle Valo
2008-02-10 14:59 ` [PATCH 01/12] Use net/mac80211.h instead of net/ieee80211.h Kalle Valo
2008-02-10 15:00 ` [PATCH 02/12] Add at76_dbg_dump() macro Kalle Valo
2008-02-10 15:00 ` [PATCH 03/12] Convert DBG_TX levels to use at76_dbg_dump() Kalle Valo
2008-02-10 15:00 ` [PATCH 04/12] Add DBG_CMD for debugging firmware commands Kalle Valo
2008-02-10 15:00 ` [PATCH 05/12] at76_usb: add mac80211 support Kalle Valo
2008-02-10 15:00 ` Kalle Valo [this message]
2008-02-10 15:49 ` [PATCH 06/12] Add support for monitor mode Michael Buesch
2008-02-10 15:52 ` Michael Buesch
2008-03-09 16:10 ` Kalle Valo
2008-03-09 17:39 ` Michael Buesch
2008-02-10 15:00 ` [PATCH 07/12] Add support for WEP Kalle Valo
2008-02-10 15:00 ` [PATCH 08/12] Remove support the legacy stack Kalle Valo
2008-02-10 15:00 ` [PATCH 09/12] Use wiphy_name everywhere where needed Kalle Valo
2008-02-10 15:01 ` [PATCH 10/12] Allocate struct at76_priv using ieee80211_alloc_hw() Kalle Valo
2008-02-10 15:01 ` [PATCH 11/12] Prepare for struct net_device removal Kalle Valo
2008-02-10 15:01 ` [PATCH 12/12] Remove struct net_device Kalle Valo
2008-02-11 5:05 ` [PATCH 00/12] at76_usb mac80211 port Pavel Roskin
2008-02-11 5:17 ` Pavel Roskin
2008-03-09 16:43 ` Kalle Valo
2008-03-10 1:00 ` Pavel Roskin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080210150034.17592.71617.stgit@tikku \
--to=kalle.valo@iki.fi \
--cc=linux-wireless@vger.kernel.org \
--cc=proski@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.