aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwl8k.c
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2010-01-12 07:48:04 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-12 14:21:12 -0500
commit777ad375d5960e0d2a945a34032b182eb2952d45 (patch)
treea6684740e2d239ea0fe23e41f992ffd4f2da8c3d /drivers/net/wireless/mwl8k.c
parentca66527c60385dcec878ebd90749d1fdc43bc870 (diff)
mwl8k: rename 2.4 GHz band/channels/rates related variables from FOO to FOO_24
To prepare for adding 5 GHz band/channels/rates. Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwl8k.c')
-rw-r--r--drivers/net/wireless/mwl8k.c76
1 files changed, 37 insertions, 39 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 76da583df321..37cbfbf21567 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -141,6 +141,9 @@ struct mwl8k_priv {
141 /* hardware/firmware parameters */ 141 /* hardware/firmware parameters */
142 bool ap_fw; 142 bool ap_fw;
143 struct rxd_ops *rxd_ops; 143 struct rxd_ops *rxd_ops;
144 struct ieee80211_supported_band band_24;
145 struct ieee80211_channel channels_24[14];
146 struct ieee80211_rate rates_24[14];
144 147
145 /* firmware access */ 148 /* firmware access */
146 struct mutex fw_mutex; 149 struct mutex fw_mutex;
@@ -173,11 +176,6 @@ struct mwl8k_priv {
173 struct mwl8k_rx_queue rxq[MWL8K_RX_QUEUES]; 176 struct mwl8k_rx_queue rxq[MWL8K_RX_QUEUES];
174 struct mwl8k_tx_queue txq[MWL8K_TX_QUEUES]; 177 struct mwl8k_tx_queue txq[MWL8K_TX_QUEUES];
175 178
176 /* PHY parameters */
177 struct ieee80211_supported_band band;
178 struct ieee80211_channel channels[14];
179 struct ieee80211_rate rates[14];
180
181 bool radio_on; 179 bool radio_on;
182 bool radio_short_preamble; 180 bool radio_short_preamble;
183 bool sniffer_enabled; 181 bool sniffer_enabled;
@@ -220,7 +218,7 @@ struct mwl8k_sta {
220}; 218};
221#define MWL8K_STA(_sta) ((struct mwl8k_sta *)&((_sta)->drv_priv)) 219#define MWL8K_STA(_sta) ((struct mwl8k_sta *)&((_sta)->drv_priv))
222 220
223static const struct ieee80211_channel mwl8k_channels[] = { 221static const struct ieee80211_channel mwl8k_channels_24[] = {
224 { .center_freq = 2412, .hw_value = 1, }, 222 { .center_freq = 2412, .hw_value = 1, },
225 { .center_freq = 2417, .hw_value = 2, }, 223 { .center_freq = 2417, .hw_value = 2, },
226 { .center_freq = 2422, .hw_value = 3, }, 224 { .center_freq = 2422, .hw_value = 3, },
@@ -237,7 +235,7 @@ static const struct ieee80211_channel mwl8k_channels[] = {
237 { .center_freq = 2484, .hw_value = 14, }, 235 { .center_freq = 2484, .hw_value = 14, },
238}; 236};
239 237
240static const struct ieee80211_rate mwl8k_rates[] = { 238static const struct ieee80211_rate mwl8k_rates_24[] = {
241 { .bitrate = 10, .hw_value = 2, }, 239 { .bitrate = 10, .hw_value = 2, },
242 { .bitrate = 20, .hw_value = 4, }, 240 { .bitrate = 20, .hw_value = 4, },
243 { .bitrate = 55, .hw_value = 11, }, 241 { .bitrate = 55, .hw_value = 11, },
@@ -731,8 +729,8 @@ mwl8k_rxd_8366_ap_process(void *_rxd, struct ieee80211_rx_status *status,
731 } else { 729 } else {
732 int i; 730 int i;
733 731
734 for (i = 0; i < ARRAY_SIZE(mwl8k_rates); i++) { 732 for (i = 0; i < ARRAY_SIZE(mwl8k_rates_24); i++) {
735 if (mwl8k_rates[i].hw_value == rxd->rate) { 733 if (mwl8k_rates_24[i].hw_value == rxd->rate) {
736 status->rate_idx = i; 734 status->rate_idx = i;
737 break; 735 break;
738 } 736 }
@@ -1597,48 +1595,48 @@ struct mwl8k_cmd_get_hw_spec_sta {
1597static void mwl8k_set_ht_caps(struct ieee80211_hw *hw, u32 cap) 1595static void mwl8k_set_ht_caps(struct ieee80211_hw *hw, u32 cap)
1598{ 1596{
1599 struct mwl8k_priv *priv = hw->priv; 1597 struct mwl8k_priv *priv = hw->priv;
1598 struct ieee80211_supported_band *band = &priv->band_24;
1600 int rx_streams; 1599 int rx_streams;
1601 int tx_streams; 1600 int tx_streams;
1602 1601
1603 priv->band.ht_cap.ht_supported = 1; 1602 band->ht_cap.ht_supported = 1;
1604 1603
1605 if (cap & MWL8K_CAP_MAX_AMSDU) 1604 if (cap & MWL8K_CAP_MAX_AMSDU)
1606 priv->band.ht_cap.cap |= IEEE80211_HT_CAP_MAX_AMSDU; 1605 band->ht_cap.cap |= IEEE80211_HT_CAP_MAX_AMSDU;
1607 if (cap & MWL8K_CAP_GREENFIELD) 1606 if (cap & MWL8K_CAP_GREENFIELD)
1608 priv->band.ht_cap.cap |= IEEE80211_HT_CAP_GRN_FLD; 1607 band->ht_cap.cap |= IEEE80211_HT_CAP_GRN_FLD;
1609 if (cap & MWL8K_CAP_AMPDU) { 1608 if (cap & MWL8K_CAP_AMPDU) {
1610 hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION; 1609 hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
1611 priv->band.ht_cap.ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K; 1610 band->ht_cap.ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K;
1612 priv->band.ht_cap.ampdu_density = 1611 band->ht_cap.ampdu_density = IEEE80211_HT_MPDU_DENSITY_NONE;
1613 IEEE80211_HT_MPDU_DENSITY_NONE;
1614 } 1612 }
1615 if (cap & MWL8K_CAP_RX_STBC) 1613 if (cap & MWL8K_CAP_RX_STBC)
1616 priv->band.ht_cap.cap |= IEEE80211_HT_CAP_RX_STBC; 1614 band->ht_cap.cap |= IEEE80211_HT_CAP_RX_STBC;
1617 if (cap & MWL8K_CAP_TX_STBC) 1615 if (cap & MWL8K_CAP_TX_STBC)
1618 priv->band.ht_cap.cap |= IEEE80211_HT_CAP_TX_STBC; 1616 band->ht_cap.cap |= IEEE80211_HT_CAP_TX_STBC;
1619 if (cap & MWL8K_CAP_SHORTGI_40MHZ) 1617 if (cap & MWL8K_CAP_SHORTGI_40MHZ)
1620 priv->band.ht_cap.cap |= IEEE80211_HT_CAP_SGI_40; 1618 band->ht_cap.cap |= IEEE80211_HT_CAP_SGI_40;
1621 if (cap & MWL8K_CAP_SHORTGI_20MHZ) 1619 if (cap & MWL8K_CAP_SHORTGI_20MHZ)
1622 priv->band.ht_cap.cap |= IEEE80211_HT_CAP_SGI_20; 1620 band->ht_cap.cap |= IEEE80211_HT_CAP_SGI_20;
1623 if (cap & MWL8K_CAP_DELAY_BA) 1621 if (cap & MWL8K_CAP_DELAY_BA)
1624 priv->band.ht_cap.cap |= IEEE80211_HT_CAP_DELAY_BA; 1622 band->ht_cap.cap |= IEEE80211_HT_CAP_DELAY_BA;
1625 if (cap & MWL8K_CAP_40MHZ) 1623 if (cap & MWL8K_CAP_40MHZ)
1626 priv->band.ht_cap.cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40; 1624 band->ht_cap.cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40;
1627 1625
1628 rx_streams = hweight32(cap & MWL8K_CAP_RX_ANTENNA_MASK); 1626 rx_streams = hweight32(cap & MWL8K_CAP_RX_ANTENNA_MASK);
1629 tx_streams = hweight32(cap & MWL8K_CAP_TX_ANTENNA_MASK); 1627 tx_streams = hweight32(cap & MWL8K_CAP_TX_ANTENNA_MASK);
1630 1628
1631 priv->band.ht_cap.mcs.rx_mask[0] = 0xff; 1629 band->ht_cap.mcs.rx_mask[0] = 0xff;
1632 if (rx_streams >= 2) 1630 if (rx_streams >= 2)
1633 priv->band.ht_cap.mcs.rx_mask[1] = 0xff; 1631 band->ht_cap.mcs.rx_mask[1] = 0xff;
1634 if (rx_streams >= 3) 1632 if (rx_streams >= 3)
1635 priv->band.ht_cap.mcs.rx_mask[2] = 0xff; 1633 band->ht_cap.mcs.rx_mask[2] = 0xff;
1636 priv->band.ht_cap.mcs.rx_mask[4] = 0x01; 1634 band->ht_cap.mcs.rx_mask[4] = 0x01;
1637 priv->band.ht_cap.mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED; 1635 band->ht_cap.mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED;
1638 1636
1639 if (rx_streams != tx_streams) { 1637 if (rx_streams != tx_streams) {
1640 priv->band.ht_cap.mcs.tx_params |= IEEE80211_HT_MCS_TX_RX_DIFF; 1638 band->ht_cap.mcs.tx_params |= IEEE80211_HT_MCS_TX_RX_DIFF;
1641 priv->band.ht_cap.mcs.tx_params |= (tx_streams - 1) << 1639 band->ht_cap.mcs.tx_params |= (tx_streams - 1) <<
1642 IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT; 1640 IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT;
1643 } 1641 }
1644} 1642}
@@ -2192,7 +2190,7 @@ static void legacy_rate_mask_to_array(u8 *rates, u32 mask)
2192 2190
2193 for (i = 0, j = 0; i < 14; i++) { 2191 for (i = 0, j = 0; i < 14; i++) {
2194 if (mask & (1 << i)) 2192 if (mask & (1 << i))
2195 rates[j++] = mwl8k_rates[i].hw_value; 2193 rates[j++] = mwl8k_rates_24[i].hw_value;
2196 } 2194 }
2197} 2195}
2198 2196
@@ -3347,7 +3345,7 @@ mwl8k_bss_info_changed_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
3347 * beacons will always go out at 1 Mb/s). 3345 * beacons will always go out at 1 Mb/s).
3348 */ 3346 */
3349 idx = ffs(vif->bss_conf.basic_rates); 3347 idx = ffs(vif->bss_conf.basic_rates);
3350 rate = idx ? mwl8k_rates[idx - 1].hw_value : 2; 3348 rate = idx ? mwl8k_rates_24[idx - 1].hw_value : 2;
3351 3349
3352 mwl8k_cmd_use_fixed_rate_ap(hw, rate, rate); 3350 mwl8k_cmd_use_fixed_rate_ap(hw, rate, rate);
3353 } 3351 }
@@ -3855,16 +3853,16 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev,
3855 priv->pending_tx_pkts = 0; 3853 priv->pending_tx_pkts = 0;
3856 3854
3857 3855
3858 memcpy(priv->channels, mwl8k_channels, sizeof(mwl8k_channels)); 3856 memcpy(priv->channels_24, mwl8k_channels_24, sizeof(mwl8k_channels_24));
3859 priv->band.band = IEEE80211_BAND_2GHZ; 3857 priv->band_24.band = IEEE80211_BAND_2GHZ;
3860 priv->band.channels = priv->channels; 3858 priv->band_24.channels = priv->channels_24;
3861 priv->band.n_channels = ARRAY_SIZE(mwl8k_channels); 3859 priv->band_24.n_channels = ARRAY_SIZE(mwl8k_channels_24);
3862 priv->band.bitrates = priv->rates; 3860 priv->band_24.bitrates = priv->rates_24;
3863 priv->band.n_bitrates = ARRAY_SIZE(mwl8k_rates); 3861 priv->band_24.n_bitrates = ARRAY_SIZE(mwl8k_rates_24);
3864 hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->band; 3862 hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->band_24;
3865 3863
3866 BUILD_BUG_ON(sizeof(priv->rates) != sizeof(mwl8k_rates)); 3864 BUILD_BUG_ON(sizeof(priv->rates_24) != sizeof(mwl8k_rates_24));
3867 memcpy(priv->rates, mwl8k_rates, sizeof(mwl8k_rates)); 3865 memcpy(priv->rates_24, mwl8k_rates_24, sizeof(mwl8k_rates_24));
3868 3866
3869 /* 3867 /*
3870 * Extra headroom is the size of the required DMA header 3868 * Extra headroom is the size of the required DMA header