diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/p54/p54.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/p54/p54common.c | 29 |
2 files changed, 27 insertions, 5 deletions
diff --git a/drivers/net/wireless/p54/p54.h b/drivers/net/wireless/p54/p54.h index b585ff65e0e4..491ab96c7b67 100644 --- a/drivers/net/wireless/p54/p54.h +++ b/drivers/net/wireless/p54/p54.h | |||
@@ -102,6 +102,9 @@ struct p54_common { | |||
102 | unsigned int output_power; | 102 | unsigned int output_power; |
103 | u32 tsf_low32; | 103 | u32 tsf_low32; |
104 | u32 tsf_high32; | 104 | u32 tsf_high32; |
105 | u64 basic_rate_mask; | ||
106 | u16 wakeup_timer; | ||
107 | u16 aid; | ||
105 | struct ieee80211_tx_queue_stats tx_stats[8]; | 108 | struct ieee80211_tx_queue_stats tx_stats[8]; |
106 | struct p54_edcf_queue_param qos_params[8]; | 109 | struct p54_edcf_queue_param qos_params[8]; |
107 | struct ieee80211_low_level_stats stats; | 110 | struct ieee80211_low_level_stats stats; |
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index 3373b022d91e..829b3f916db9 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c | |||
@@ -1249,20 +1249,20 @@ static int p54_setup_mac(struct ieee80211_hw *dev, u16 mode, const u8 *bssid) | |||
1249 | setup->rx_antenna = priv->rx_antenna; | 1249 | setup->rx_antenna = priv->rx_antenna; |
1250 | setup->rx_align = 0; | 1250 | setup->rx_align = 0; |
1251 | if (priv->fw_var < 0x500) { | 1251 | if (priv->fw_var < 0x500) { |
1252 | setup->v1.basic_rate_mask = cpu_to_le32(0x15f); | 1252 | setup->v1.basic_rate_mask = cpu_to_le32(priv->basic_rate_mask); |
1253 | memset(setup->v1.rts_rates, 0, 8); | 1253 | memset(setup->v1.rts_rates, 0, 8); |
1254 | setup->v1.rx_addr = cpu_to_le32(priv->rx_end); | 1254 | setup->v1.rx_addr = cpu_to_le32(priv->rx_end); |
1255 | setup->v1.max_rx = cpu_to_le16(priv->rx_mtu); | 1255 | setup->v1.max_rx = cpu_to_le16(priv->rx_mtu); |
1256 | setup->v1.rxhw = cpu_to_le16(priv->rxhw); | 1256 | setup->v1.rxhw = cpu_to_le16(priv->rxhw); |
1257 | setup->v1.wakeup_timer = cpu_to_le16(500); | 1257 | setup->v1.wakeup_timer = cpu_to_le16(priv->wakeup_timer); |
1258 | setup->v1.unalloc0 = cpu_to_le16(0); | 1258 | setup->v1.unalloc0 = cpu_to_le16(0); |
1259 | } else { | 1259 | } else { |
1260 | setup->v2.rx_addr = cpu_to_le32(priv->rx_end); | 1260 | setup->v2.rx_addr = cpu_to_le32(priv->rx_end); |
1261 | setup->v2.max_rx = cpu_to_le16(priv->rx_mtu); | 1261 | setup->v2.max_rx = cpu_to_le16(priv->rx_mtu); |
1262 | setup->v2.rxhw = cpu_to_le16(priv->rxhw); | 1262 | setup->v2.rxhw = cpu_to_le16(priv->rxhw); |
1263 | setup->v2.timer = cpu_to_le16(1000); | 1263 | setup->v2.timer = cpu_to_le16(priv->wakeup_timer); |
1264 | setup->v2.truncate = cpu_to_le16(48896); | 1264 | setup->v2.truncate = cpu_to_le16(48896); |
1265 | setup->v2.basic_rate_mask = cpu_to_le32(0x15f); | 1265 | setup->v2.basic_rate_mask = cpu_to_le32(priv->basic_rate_mask); |
1266 | setup->v2.sbss_offset = 0; | 1266 | setup->v2.sbss_offset = 0; |
1267 | setup->v2.mcast_window = 0; | 1267 | setup->v2.mcast_window = 0; |
1268 | setup->v2.rx_rssi_threshold = 0; | 1268 | setup->v2.rx_rssi_threshold = 0; |
@@ -1348,7 +1348,7 @@ static int p54_set_freq(struct ieee80211_hw *dev, u16 frequency) | |||
1348 | } else { | 1348 | } else { |
1349 | chan->v2.rssical_mul = cpu_to_le16(130); | 1349 | chan->v2.rssical_mul = cpu_to_le16(130); |
1350 | chan->v2.rssical_add = cpu_to_le16(0xfe70); | 1350 | chan->v2.rssical_add = cpu_to_le16(0xfe70); |
1351 | chan->v2.basic_rate_mask = cpu_to_le32(0x15f); | 1351 | chan->v2.basic_rate_mask = cpu_to_le32(priv->basic_rate_mask); |
1352 | memset(chan->v2.rts_rates, 0, 8); | 1352 | memset(chan->v2.rts_rates, 0, 8); |
1353 | } | 1353 | } |
1354 | priv->tx(dev, skb, 1); | 1354 | priv->tx(dev, skb, 1); |
@@ -1808,6 +1808,24 @@ static void p54_bss_info_changed(struct ieee80211_hw *dev, | |||
1808 | priv->use_short_slot = info->use_short_slot; | 1808 | priv->use_short_slot = info->use_short_slot; |
1809 | p54_set_edcf(dev); | 1809 | p54_set_edcf(dev); |
1810 | } | 1810 | } |
1811 | if (changed & BSS_CHANGED_BASIC_RATES) { | ||
1812 | if (dev->conf.channel->band == IEEE80211_BAND_5GHZ) | ||
1813 | priv->basic_rate_mask = (info->basic_rates << 4); | ||
1814 | else | ||
1815 | priv->basic_rate_mask = info->basic_rates; | ||
1816 | p54_setup_mac(dev, priv->mac_mode, priv->bssid); | ||
1817 | if (priv->fw_var >= 0x500) | ||
1818 | p54_set_freq(dev, dev->conf.channel->center_freq); | ||
1819 | } | ||
1820 | if (changed & BSS_CHANGED_ASSOC) { | ||
1821 | if (info->assoc) { | ||
1822 | priv->aid = info->aid; | ||
1823 | priv->wakeup_timer = info->beacon_int * | ||
1824 | info->dtim_period * 5; | ||
1825 | p54_setup_mac(dev, priv->mac_mode, priv->bssid); | ||
1826 | } | ||
1827 | } | ||
1828 | |||
1811 | } | 1829 | } |
1812 | 1830 | ||
1813 | static const struct ieee80211_ops p54_ops = { | 1831 | static const struct ieee80211_ops p54_ops = { |
@@ -1837,6 +1855,7 @@ struct ieee80211_hw *p54_init_common(size_t priv_data_len) | |||
1837 | 1855 | ||
1838 | priv = dev->priv; | 1856 | priv = dev->priv; |
1839 | priv->mode = NL80211_IFTYPE_UNSPECIFIED; | 1857 | priv->mode = NL80211_IFTYPE_UNSPECIFIED; |
1858 | priv->basic_rate_mask = 0x15f; | ||
1840 | skb_queue_head_init(&priv->tx_queue); | 1859 | skb_queue_head_init(&priv->tx_queue); |
1841 | dev->flags = IEEE80211_HW_RX_INCLUDES_FCS | | 1860 | dev->flags = IEEE80211_HW_RX_INCLUDES_FCS | |
1842 | IEEE80211_HW_SIGNAL_DBM | | 1861 | IEEE80211_HW_SIGNAL_DBM | |