aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@web.de>2008-09-05 20:56:12 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-09-11 15:53:31 -0400
commit78d57eb2b666617dd75aac0f1a420238004a98b3 (patch)
tree4512f759f401db6e53d4f9f2850882970b5e7572 /drivers
parenta0db663ff192e21ebb703f962308675f22fb38a8 (diff)
p54: add more rx filters
This patch adds new filters settings to make the card more useful in monitor mode. Signed-off-by: Christian Lamparter <chunkeey@web.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/p54/p54.h1
-rw-r--r--drivers/net/wireless/p54/p54common.c26
2 files changed, 24 insertions, 3 deletions
diff --git a/drivers/net/wireless/p54/p54.h b/drivers/net/wireless/p54/p54.h
index 36b8e584c6cf..ea72b65428ec 100644
--- a/drivers/net/wireless/p54/p54.h
+++ b/drivers/net/wireless/p54/p54.h
@@ -80,6 +80,7 @@ struct p54_common {
80 struct pda_channel_output_limit *output_limit; 80 struct pda_channel_output_limit *output_limit;
81 unsigned int output_limit_len; 81 unsigned int output_limit_len;
82 struct pda_pa_curve_data *curve_data; 82 struct pda_pa_curve_data *curve_data;
83 unsigned int filter_flags;
83 u16 rxhw; 84 u16 rxhw;
84 u8 version; 85 u8 version;
85 u8 rx_antenna; 86 u8 rx_antenna;
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c
index 526d3a282b7a..300f97b1bfe4 100644
--- a/drivers/net/wireless/p54/p54common.c
+++ b/drivers/net/wireless/p54/p54common.c
@@ -433,6 +433,13 @@ static int p54_rx_data(struct ieee80211_hw *dev, struct sk_buff *skb)
433 size_t header_len = sizeof(*hdr); 433 size_t header_len = sizeof(*hdr);
434 u32 tsf32; 434 u32 tsf32;
435 435
436 if (!(hdr->magic & cpu_to_le16(0x0001))) {
437 if (priv->filter_flags & FIF_FCSFAIL)
438 rx_status.flag |= RX_FLAG_FAILED_FCS_CRC;
439 else
440 return 0;
441 }
442
436 rx_status.signal = hdr->rssi; 443 rx_status.signal = hdr->rssi;
437 /* XX correct? */ 444 /* XX correct? */
438 rx_status.qual = (100 * hdr->rssi) / 127; 445 rx_status.qual = (100 * hdr->rssi) / 127;
@@ -1127,13 +1134,26 @@ static void p54_configure_filter(struct ieee80211_hw *dev,
1127{ 1134{
1128 struct p54_common *priv = dev->priv; 1135 struct p54_common *priv = dev->priv;
1129 1136
1130 *total_flags &= FIF_BCN_PRBRESP_PROMISC; 1137 *total_flags &= FIF_BCN_PRBRESP_PROMISC |
1138 FIF_PROMISC_IN_BSS |
1139 FIF_FCSFAIL;
1140
1141 priv->filter_flags = *total_flags;
1131 1142
1132 if (changed_flags & FIF_BCN_PRBRESP_PROMISC) { 1143 if (changed_flags & FIF_BCN_PRBRESP_PROMISC) {
1133 if (*total_flags & FIF_BCN_PRBRESP_PROMISC) 1144 if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
1134 p54_set_filter(dev, 0, NULL); 1145 p54_set_filter(dev, priv->filter_type, NULL);
1146 else
1147 p54_set_filter(dev, priv->filter_type, priv->bssid);
1148 }
1149
1150 if (changed_flags & FIF_PROMISC_IN_BSS) {
1151 if (*total_flags & FIF_PROMISC_IN_BSS)
1152 p54_set_filter(dev, priv->filter_type |
1153 cpu_to_le16(0x8), NULL);
1135 else 1154 else
1136 p54_set_filter(dev, 0, priv->bssid); 1155 p54_set_filter(dev, priv->filter_type &
1156 ~cpu_to_le16(0x8), priv->bssid);
1137 } 1157 }
1138} 1158}
1139 1159