Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134070
b: refs/heads/master
c: 2b8d4e2
h: refs/heads/master
v: v3
  • Loading branch information
Christian Lamparter authored and John W. Linville committed Jan 29, 2009
1 parent b6ea9b7 commit b3d3b00
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 51eed9923d98477e7f7473edd60d876d1cecc8c5
refs/heads/master: 2b8d4e2eea711b6dfe1878ff3c94ebe757656f6d
42 changes: 42 additions & 0 deletions trunk/drivers/net/wireless/p54/p54common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1765,6 +1765,43 @@ static int p54_set_edcf(struct ieee80211_hw *dev)
return 0;
}

static int p54_set_ps(struct ieee80211_hw *dev)
{
struct p54_common *priv = dev->priv;
struct sk_buff *skb;
struct p54_psm *psm;
u16 mode;
int i;

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

skb = p54_alloc_skb(dev, P54_HDR_FLAG_CONTROL_OPSET, sizeof(*psm) +
sizeof(struct p54_hdr), P54_CONTROL_TYPE_PSM,
GFP_ATOMIC);
if (!skb)
return -ENOMEM;

psm = (struct p54_psm *)skb_put(skb, sizeof(*psm));
psm->mode = cpu_to_le16(mode);
psm->aid = cpu_to_le16(priv->aid);
for (i = 0; i < ARRAY_SIZE(psm->intervals); i++) {
psm->intervals[i].interval =
cpu_to_le16(dev->conf.listen_interval);
psm->intervals[i].periods = 1;
}

psm->beacon_rssi_skip_max = 60;
psm->rssi_delta_threshold = 0;
psm->nr = 0;

priv->tx(dev, skb);

return 0;
}

static int p54_beacon_tim(struct sk_buff *skb)
{
/*
Expand Down Expand Up @@ -1957,6 +1994,11 @@ static int p54_config(struct ieee80211_hw *dev, u32 changed)
if (ret)
goto out;
}
if (changed & IEEE80211_CONF_CHANGE_PS) {
ret = p54_set_ps(dev);
if (ret)
goto out;
}

out:
mutex_unlock(&priv->conf_mutex);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/p54/p54common.h
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ struct p54_psm_interval {
__le16 periods;
} __attribute__ ((packed));

#define P54_PSM_CAM 0
#define P54_PSM BIT(0)
#define P54_PSM_DTIM BIT(1)
#define P54_PSM_MCBC BIT(2)
Expand Down

0 comments on commit b3d3b00

Please sign in to comment.