diff options
| -rw-r--r-- | drivers/net/wireless/p54/p54common.c | 42 | ||||
| -rw-r--r-- | drivers/net/wireless/p54/p54common.h | 1 |
2 files changed, 43 insertions, 0 deletions
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index d85a6bafd79f..6c175df48b0d 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c | |||
| @@ -1765,6 +1765,43 @@ static int p54_set_edcf(struct ieee80211_hw *dev) | |||
| 1765 | return 0; | 1765 | return 0; |
| 1766 | } | 1766 | } |
| 1767 | 1767 | ||
| 1768 | static int p54_set_ps(struct ieee80211_hw *dev) | ||
| 1769 | { | ||
| 1770 | struct p54_common *priv = dev->priv; | ||
| 1771 | struct sk_buff *skb; | ||
| 1772 | struct p54_psm *psm; | ||
| 1773 | u16 mode; | ||
| 1774 | int i; | ||
| 1775 | |||
| 1776 | if (dev->conf.flags & IEEE80211_CONF_PS) | ||
| 1777 | mode = cpu_to_le16(P54_PSM | P54_PSM_DTIM | P54_PSM_MCBC); | ||
| 1778 | else | ||
| 1779 | mode = P54_PSM_CAM; | ||
| 1780 | |||
| 1781 | skb = p54_alloc_skb(dev, P54_HDR_FLAG_CONTROL_OPSET, sizeof(*psm) + | ||
| 1782 | sizeof(struct p54_hdr), P54_CONTROL_TYPE_PSM, | ||
| 1783 | GFP_ATOMIC); | ||
| 1784 | if (!skb) | ||
| 1785 | return -ENOMEM; | ||
| 1786 | |||
| 1787 | psm = (struct p54_psm *)skb_put(skb, sizeof(*psm)); | ||
| 1788 | psm->mode = cpu_to_le16(mode); | ||
| 1789 | psm->aid = cpu_to_le16(priv->aid); | ||
| 1790 | for (i = 0; i < ARRAY_SIZE(psm->intervals); i++) { | ||
| 1791 | psm->intervals[i].interval = | ||
| 1792 | cpu_to_le16(dev->conf.listen_interval); | ||
| 1793 | psm->intervals[i].periods = 1; | ||
| 1794 | } | ||
| 1795 | |||
| 1796 | psm->beacon_rssi_skip_max = 60; | ||
| 1797 | psm->rssi_delta_threshold = 0; | ||
| 1798 | psm->nr = 0; | ||
| 1799 | |||
| 1800 | priv->tx(dev, skb); | ||
| 1801 | |||
| 1802 | return 0; | ||
| 1803 | } | ||
| 1804 | |||
| 1768 | static int p54_beacon_tim(struct sk_buff *skb) | 1805 | static int p54_beacon_tim(struct sk_buff *skb) |
| 1769 | { | 1806 | { |
| 1770 | /* | 1807 | /* |
| @@ -1957,6 +1994,11 @@ static int p54_config(struct ieee80211_hw *dev, u32 changed) | |||
| 1957 | if (ret) | 1994 | if (ret) |
| 1958 | goto out; | 1995 | goto out; |
| 1959 | } | 1996 | } |
| 1997 | if (changed & IEEE80211_CONF_CHANGE_PS) { | ||
| 1998 | ret = p54_set_ps(dev); | ||
| 1999 | if (ret) | ||
| 2000 | goto out; | ||
| 2001 | } | ||
| 1960 | 2002 | ||
| 1961 | out: | 2003 | out: |
| 1962 | mutex_unlock(&priv->conf_mutex); | 2004 | mutex_unlock(&priv->conf_mutex); |
diff --git a/drivers/net/wireless/p54/p54common.h b/drivers/net/wireless/p54/p54common.h index 035e77312484..6207323848bd 100644 --- a/drivers/net/wireless/p54/p54common.h +++ b/drivers/net/wireless/p54/p54common.h | |||
| @@ -534,6 +534,7 @@ struct p54_psm_interval { | |||
| 534 | __le16 periods; | 534 | __le16 periods; |
| 535 | } __attribute__ ((packed)); | 535 | } __attribute__ ((packed)); |
| 536 | 536 | ||
| 537 | #define P54_PSM_CAM 0 | ||
| 537 | #define P54_PSM BIT(0) | 538 | #define P54_PSM BIT(0) |
| 538 | #define P54_PSM_DTIM BIT(1) | 539 | #define P54_PSM_DTIM BIT(1) |
| 539 | #define P54_PSM_MCBC BIT(2) | 540 | #define P54_PSM_MCBC BIT(2) |
