diff options
author | Christian Lamparter <chunkeey@web.de> | 2009-03-24 22:12:49 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 16:54:36 -0400 |
commit | f13027af5cd567757c18b85776232e31a2ba55d4 (patch) | |
tree | 95fd54c24859572b1abc77bc70536ca33e376e4a | |
parent | dce072580e095d1fb7be59a1be30dc0e8307821b (diff) |
p54: add beacon filtering support
This patch adds beacon filtering support to p54.
Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/p54/p54.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/p54/p54common.c | 17 |
2 files changed, 14 insertions, 4 deletions
diff --git a/drivers/net/wireless/p54/p54.h b/drivers/net/wireless/p54/p54.h index 4499035359a6..d6354faaa2bc 100644 --- a/drivers/net/wireless/p54/p54.h +++ b/drivers/net/wireless/p54/p54.h | |||
@@ -134,6 +134,7 @@ struct p54_led_dev { | |||
134 | 134 | ||
135 | struct p54_common { | 135 | struct p54_common { |
136 | struct ieee80211_hw *hw; | 136 | struct ieee80211_hw *hw; |
137 | struct ieee80211_vif *vif; | ||
137 | void (*tx)(struct ieee80211_hw *dev, struct sk_buff *skb); | 138 | void (*tx)(struct ieee80211_hw *dev, struct sk_buff *skb); |
138 | int (*open)(struct ieee80211_hw *dev); | 139 | int (*open)(struct ieee80211_hw *dev); |
139 | void (*stop)(struct ieee80211_hw *dev); | 140 | void (*stop)(struct ieee80211_hw *dev); |
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index 696067e69ee4..cb490584cb8e 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c | |||
@@ -1044,6 +1044,7 @@ static void p54_rx_stats(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
1044 | 1044 | ||
1045 | static void p54_rx_trap(struct ieee80211_hw *dev, struct sk_buff *skb) | 1045 | static void p54_rx_trap(struct ieee80211_hw *dev, struct sk_buff *skb) |
1046 | { | 1046 | { |
1047 | struct p54_common *priv = dev->priv; | ||
1047 | struct p54_hdr *hdr = (struct p54_hdr *) skb->data; | 1048 | struct p54_hdr *hdr = (struct p54_hdr *) skb->data; |
1048 | struct p54_trap *trap = (struct p54_trap *) hdr->data; | 1049 | struct p54_trap *trap = (struct p54_trap *) hdr->data; |
1049 | u16 event = le16_to_cpu(trap->event); | 1050 | u16 event = le16_to_cpu(trap->event); |
@@ -1057,6 +1058,8 @@ static void p54_rx_trap(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
1057 | wiphy_name(dev->wiphy), freq); | 1058 | wiphy_name(dev->wiphy), freq); |
1058 | break; | 1059 | break; |
1059 | case P54_TRAP_NO_BEACON: | 1060 | case P54_TRAP_NO_BEACON: |
1061 | if (priv->vif) | ||
1062 | ieee80211_beacon_loss(priv->vif); | ||
1060 | break; | 1063 | break; |
1061 | case P54_TRAP_SCAN: | 1064 | case P54_TRAP_SCAN: |
1062 | break; | 1065 | break; |
@@ -1939,7 +1942,8 @@ static int p54_set_ps(struct ieee80211_hw *dev) | |||
1939 | int i; | 1942 | int i; |
1940 | 1943 | ||
1941 | if (dev->conf.flags & IEEE80211_CONF_PS) | 1944 | if (dev->conf.flags & IEEE80211_CONF_PS) |
1942 | mode = P54_PSM | P54_PSM_DTIM | P54_PSM_MCBC; | 1945 | mode = P54_PSM | P54_PSM_BEACON_TIMEOUT | P54_PSM_DTIM | |
1946 | P54_PSM_CHECKSUM | P54_PSM_MCBC; | ||
1943 | else | 1947 | else |
1944 | mode = P54_PSM_CAM; | 1948 | mode = P54_PSM_CAM; |
1945 | 1949 | ||
@@ -1957,9 +1961,10 @@ static int p54_set_ps(struct ieee80211_hw *dev) | |||
1957 | psm->intervals[i].periods = cpu_to_le16(1); | 1961 | psm->intervals[i].periods = cpu_to_le16(1); |
1958 | } | 1962 | } |
1959 | 1963 | ||
1960 | psm->beacon_rssi_skip_max = 60; | 1964 | psm->beacon_rssi_skip_max = 200; |
1961 | psm->rssi_delta_threshold = 0; | 1965 | psm->rssi_delta_threshold = 0; |
1962 | psm->nr = 0; | 1966 | psm->nr = 10; |
1967 | psm->exclude[0] = 0; | ||
1963 | 1968 | ||
1964 | priv->tx(dev, skb); | 1969 | priv->tx(dev, skb); |
1965 | 1970 | ||
@@ -2114,6 +2119,8 @@ static int p54_add_interface(struct ieee80211_hw *dev, | |||
2114 | return -EOPNOTSUPP; | 2119 | return -EOPNOTSUPP; |
2115 | } | 2120 | } |
2116 | 2121 | ||
2122 | priv->vif = conf->vif; | ||
2123 | |||
2117 | switch (conf->type) { | 2124 | switch (conf->type) { |
2118 | case NL80211_IFTYPE_STATION: | 2125 | case NL80211_IFTYPE_STATION: |
2119 | case NL80211_IFTYPE_ADHOC: | 2126 | case NL80211_IFTYPE_ADHOC: |
@@ -2138,6 +2145,7 @@ static void p54_remove_interface(struct ieee80211_hw *dev, | |||
2138 | struct p54_common *priv = dev->priv; | 2145 | struct p54_common *priv = dev->priv; |
2139 | 2146 | ||
2140 | mutex_lock(&priv->conf_mutex); | 2147 | mutex_lock(&priv->conf_mutex); |
2148 | priv->vif = NULL; | ||
2141 | if (priv->cached_beacon) | 2149 | if (priv->cached_beacon) |
2142 | p54_tx_cancel(dev, priv->cached_beacon); | 2150 | p54_tx_cancel(dev, priv->cached_beacon); |
2143 | priv->mode = NL80211_IFTYPE_MONITOR; | 2151 | priv->mode = NL80211_IFTYPE_MONITOR; |
@@ -2590,7 +2598,8 @@ struct ieee80211_hw *p54_init_common(size_t priv_data_len) | |||
2590 | skb_queue_head_init(&priv->tx_queue); | 2598 | skb_queue_head_init(&priv->tx_queue); |
2591 | dev->flags = IEEE80211_HW_RX_INCLUDES_FCS | | 2599 | dev->flags = IEEE80211_HW_RX_INCLUDES_FCS | |
2592 | IEEE80211_HW_SIGNAL_DBM | | 2600 | IEEE80211_HW_SIGNAL_DBM | |
2593 | IEEE80211_HW_NOISE_DBM; | 2601 | IEEE80211_HW_NOISE_DBM | |
2602 | IEEE80211_HW_BEACON_FILTER; | ||
2594 | 2603 | ||
2595 | dev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | | 2604 | dev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | |
2596 | BIT(NL80211_IFTYPE_ADHOC) | | 2605 | BIT(NL80211_IFTYPE_ADHOC) | |