diff options
author | Sujith <Sujith.Manoharan@atheros.com> | 2008-11-17 22:34:00 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-26 09:47:23 -0500 |
commit | 7b4d27357aebfdaa039f365fd24f2a795af5c0bb (patch) | |
tree | 89abaa3fc59a30530341c5a3b83bfa2631a8f584 /drivers/net/wireless/ath9k/rc.c | |
parent | fe60594a76d04b4fdea597bf93e4186a03d8d60c (diff) |
ath9k: Remove ath_setup_rates
Setup legacy rates in ath_rate_init() itself.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/rc.c')
-rw-r--r-- | drivers/net/wireless/ath9k/rc.c | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/drivers/net/wireless/ath9k/rc.c b/drivers/net/wireless/ath9k/rc.c index 09d622ab313c..798dff6f6015 100644 --- a/drivers/net/wireless/ath9k/rc.c +++ b/drivers/net/wireless/ath9k/rc.c | |||
@@ -1755,26 +1755,6 @@ static int ath_rate_newassoc(struct ath_softc *sc, | |||
1755 | return 0; | 1755 | return 0; |
1756 | } | 1756 | } |
1757 | 1757 | ||
1758 | static void ath_setup_rates(struct ath_softc *sc, | ||
1759 | struct ieee80211_supported_band *sband, | ||
1760 | struct ieee80211_sta *sta, | ||
1761 | struct ath_rate_node *rc_priv) | ||
1762 | |||
1763 | { | ||
1764 | int i, j = 0; | ||
1765 | |||
1766 | DPRINTF(sc, ATH_DBG_RATE, "%s\n", __func__); | ||
1767 | |||
1768 | for (i = 0; i < sband->n_bitrates; i++) { | ||
1769 | if (sta->supp_rates[sband->band] & BIT(i)) { | ||
1770 | rc_priv->neg_rates.rs_rates[j] | ||
1771 | = (sband->bitrates[i].bitrate * 2) / 10; | ||
1772 | j++; | ||
1773 | } | ||
1774 | } | ||
1775 | rc_priv->neg_rates.rs_nrates = j; | ||
1776 | } | ||
1777 | |||
1778 | void ath_rc_node_update(struct ieee80211_hw *hw, struct ath_rate_node *rc_priv) | 1758 | void ath_rc_node_update(struct ieee80211_hw *hw, struct ath_rate_node *rc_priv) |
1779 | { | 1759 | { |
1780 | struct ath_softc *sc = hw->priv; | 1760 | struct ath_softc *sc = hw->priv; |
@@ -1895,11 +1875,17 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband, | |||
1895 | struct ath_rate_node *ath_rc_priv = priv_sta; | 1875 | struct ath_rate_node *ath_rc_priv = priv_sta; |
1896 | int i, j = 0; | 1876 | int i, j = 0; |
1897 | 1877 | ||
1898 | DPRINTF(sc, ATH_DBG_RATE, "%s\n", __func__); | 1878 | for (i = 0; i < sband->n_bitrates; i++) { |
1879 | if (sta->supp_rates[sband->band] & BIT(i)) { | ||
1880 | ath_rc_priv->neg_rates.rs_rates[j] | ||
1881 | = (sband->bitrates[i].bitrate * 2) / 10; | ||
1882 | j++; | ||
1883 | } | ||
1884 | } | ||
1885 | ath_rc_priv->neg_rates.rs_nrates = j; | ||
1899 | 1886 | ||
1900 | ath_setup_rates(sc, sband, sta, ath_rc_priv); | ||
1901 | if (sta->ht_cap.ht_supported) { | 1887 | if (sta->ht_cap.ht_supported) { |
1902 | for (i = 0; i < 77; i++) { | 1888 | for (i = 0, j = 0; i < 77; i++) { |
1903 | if (sta->ht_cap.mcs.rx_mask[i/8] & (1<<(i%8))) | 1889 | if (sta->ht_cap.mcs.rx_mask[i/8] & (1<<(i%8))) |
1904 | ath_rc_priv->neg_ht_rates.rs_rates[j++] = i; | 1890 | ath_rc_priv->neg_ht_rates.rs_rates[j++] = i; |
1905 | if (j == ATH_RATE_MAX) | 1891 | if (j == ATH_RATE_MAX) |
@@ -1907,14 +1893,12 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband, | |||
1907 | } | 1893 | } |
1908 | ath_rc_priv->neg_ht_rates.rs_nrates = j; | 1894 | ath_rc_priv->neg_ht_rates.rs_nrates = j; |
1909 | } | 1895 | } |
1896 | |||
1910 | ath_rc_node_update(sc->hw, priv_sta); | 1897 | ath_rc_node_update(sc->hw, priv_sta); |
1911 | } | 1898 | } |
1912 | 1899 | ||
1913 | static void *ath_rate_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) | 1900 | static void *ath_rate_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) |
1914 | { | 1901 | { |
1915 | struct ath_softc *sc = hw->priv; | ||
1916 | |||
1917 | DPRINTF(sc, ATH_DBG_RATE, "%s\n", __func__); | ||
1918 | return hw->priv; | 1902 | return hw->priv; |
1919 | } | 1903 | } |
1920 | 1904 | ||