Search Linux Wireless

[PATCH 1/2] zd1211rw: Experimental change to add proper monitor support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Without this patch, monitor mode does not returns all frames. With this patch,
the performance are quite poor if we create a monitor interface. Note :
creating a monitor interface with the "cook" flag has no impact on performance.

Signed-off-by: Benoit Papillault <benoit.papillault@xxxxxxx>
---
 drivers/net/wireless/zd1211rw/zd_mac.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index 2d555cc..9cb6cbc 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -904,8 +904,26 @@ static int zd_op_config(struct ieee80211_hw *hw, u32 changed)
 {
 	struct zd_mac *mac = zd_hw_mac(hw);
 	struct ieee80211_conf *conf = &hw->conf;
+	int ret;
 
-	return zd_chip_set_channel(&mac->chip, conf->channel->hw_value);
+	if (changed & IEEE80211_CONF_CHANGE_MONITOR) {
+		/*
+		 * Warning : enabling this register kills RX & TX
+		 * performance
+		 */
+		u32 cr_sniffer = !!(conf->flags & IEEE80211_CONF_MONITOR);
+		ret = zd_iowrite32(&mac->chip, CR_SNIFFER_ON, cr_sniffer);
+		if (!ret)
+			return ret;
+	}
+
+	if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
+		ret = zd_chip_set_channel(&mac->chip, conf->channel->hw_value);
+		if (!ret)
+			return ret;
+	}
+
+	return 0;
 }
 
 static void zd_process_intr(struct work_struct *work)
-- 
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux