Search Linux Wireless

[PATCH 6/6] adm8211: Fix monitor mode

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

 



From: Michael Wu <flamingice@xxxxxxxxxxxx>

This patch makes adm8211 deal with a NULL mac addr in monitor mode and
fixes handling of FCS in monitor mode.

Signed-off-by: Michael Wu <flamingice@xxxxxxxxxxxx>
---

 drivers/net/wireless/adm8211.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index 872b032..be93ba0 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -316,6 +316,11 @@ static void adm8211_set_rx_mode(struct ieee80211_hw *dev,
 	ADM8211_CSR_WRITE(MAR1, mc_filter[1]);
 	ADM8211_CSR_READ(NAR);
 
+	if (flags & IFF_PROMISC)
+		dev->flags |= IEEE80211_HW_RX_INCLUDES_FCS;
+	else
+		dev->flags &= ~IEEE80211_HW_RX_INCLUDES_FCS;
+
 	ADM8211_RESTORE();
 }
 
@@ -476,11 +481,6 @@ static void adm8211_interrupt_rci(struct ieee80211_hw 
*dev)
 			rx_status.freq = adm8211_channels[priv->channel - 1].freq;
 			rx_status.phymode = MODE_IEEE80211B;
 
-			/* remove FCS */
-			/* TODO: remove this and set flag in ieee80211_hw instead? */
-			if (dev->flags & IFF_PROMISC)
-				skb_trim(skb, skb->len - FCS_LEN);
-
 			ieee80211_rx_irqsafe(dev, skb, &rx_status);
 		}
 
@@ -1255,6 +1255,9 @@ static void adm8211_hw_init(struct ieee80211_hw *dev)
 	/* Clear the missed-packet counter. */
 	ADM8211_CSR_READ(LPC);
 
+	if (!priv->mac_addr)
+		return;
+
 	/* set mac address */
 	ADM8211_CSR_WRITE(PAR0, *(u32 *)priv->mac_addr);
 	ADM8211_CSR_WRITE(PAR1, *(u16 *)&priv->mac_addr[4]);

-
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