Skip to content

Commit

Permalink
p54: add beacon filtering support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christian Lamparter authored and John W. Linville committed Apr 22, 2009
1 parent dce0725 commit f13027a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions drivers/net/wireless/p54/p54.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ struct p54_led_dev {

struct p54_common {
struct ieee80211_hw *hw;
struct ieee80211_vif *vif;
void (*tx)(struct ieee80211_hw *dev, struct sk_buff *skb);
int (*open)(struct ieee80211_hw *dev);
void (*stop)(struct ieee80211_hw *dev);
Expand Down
17 changes: 13 additions & 4 deletions drivers/net/wireless/p54/p54common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,7 @@ static void p54_rx_stats(struct ieee80211_hw *dev, struct sk_buff *skb)

static void p54_rx_trap(struct ieee80211_hw *dev, struct sk_buff *skb)
{
struct p54_common *priv = dev->priv;
struct p54_hdr *hdr = (struct p54_hdr *) skb->data;
struct p54_trap *trap = (struct p54_trap *) hdr->data;
u16 event = le16_to_cpu(trap->event);
Expand All @@ -1057,6 +1058,8 @@ static void p54_rx_trap(struct ieee80211_hw *dev, struct sk_buff *skb)
wiphy_name(dev->wiphy), freq);
break;
case P54_TRAP_NO_BEACON:
if (priv->vif)
ieee80211_beacon_loss(priv->vif);
break;
case P54_TRAP_SCAN:
break;
Expand Down Expand Up @@ -1939,7 +1942,8 @@ static int p54_set_ps(struct ieee80211_hw *dev)
int i;

if (dev->conf.flags & IEEE80211_CONF_PS)
mode = P54_PSM | P54_PSM_DTIM | P54_PSM_MCBC;
mode = P54_PSM | P54_PSM_BEACON_TIMEOUT | P54_PSM_DTIM |
P54_PSM_CHECKSUM | P54_PSM_MCBC;
else
mode = P54_PSM_CAM;

Expand All @@ -1957,9 +1961,10 @@ static int p54_set_ps(struct ieee80211_hw *dev)
psm->intervals[i].periods = cpu_to_le16(1);
}

psm->beacon_rssi_skip_max = 60;
psm->beacon_rssi_skip_max = 200;
psm->rssi_delta_threshold = 0;
psm->nr = 0;
psm->nr = 10;
psm->exclude[0] = 0;

priv->tx(dev, skb);

Expand Down Expand Up @@ -2114,6 +2119,8 @@ static int p54_add_interface(struct ieee80211_hw *dev,
return -EOPNOTSUPP;
}

priv->vif = conf->vif;

switch (conf->type) {
case NL80211_IFTYPE_STATION:
case NL80211_IFTYPE_ADHOC:
Expand All @@ -2138,6 +2145,7 @@ static void p54_remove_interface(struct ieee80211_hw *dev,
struct p54_common *priv = dev->priv;

mutex_lock(&priv->conf_mutex);
priv->vif = NULL;
if (priv->cached_beacon)
p54_tx_cancel(dev, priv->cached_beacon);
priv->mode = NL80211_IFTYPE_MONITOR;
Expand Down Expand Up @@ -2590,7 +2598,8 @@ struct ieee80211_hw *p54_init_common(size_t priv_data_len)
skb_queue_head_init(&priv->tx_queue);
dev->flags = IEEE80211_HW_RX_INCLUDES_FCS |
IEEE80211_HW_SIGNAL_DBM |
IEEE80211_HW_NOISE_DBM;
IEEE80211_HW_NOISE_DBM |
IEEE80211_HW_BEACON_FILTER;

dev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_ADHOC) |
Expand Down

0 comments on commit f13027a

Please sign in to comment.