diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-09-13 05:42:02 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-07 16:39:29 -0400 |
commit | c46917bb53a546f60c7d3103407fe953c418dd5b (patch) | |
tree | 5598017157d88b70d3ec9905acb020303913c0e8 /drivers/net/wireless/ath/ath9k/rc.c | |
parent | cd9bf689600e62d84449d65b3d25fb6d2757589e (diff) |
atheros: add common debug printing
ath9k uses this for now, ath9k_htc is expected to re-use this
as well. We lave ath5k as is, but it certainly can also be
converted later.
The ath9k module parameter and debugfs entry is kept.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/rc.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/rc.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index cafe1ec7bdbb..7346649af2d7 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c | |||
@@ -1160,6 +1160,7 @@ struct ath_rate_table *ath_choose_rate_table(struct ath_softc *sc, | |||
1160 | bool is_cw_40) | 1160 | bool is_cw_40) |
1161 | { | 1161 | { |
1162 | int mode = 0; | 1162 | int mode = 0; |
1163 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | ||
1163 | 1164 | ||
1164 | switch(band) { | 1165 | switch(band) { |
1165 | case IEEE80211_BAND_2GHZ: | 1166 | case IEEE80211_BAND_2GHZ: |
@@ -1177,14 +1178,14 @@ struct ath_rate_table *ath_choose_rate_table(struct ath_softc *sc, | |||
1177 | mode = ATH9K_MODE_11NA_HT40PLUS; | 1178 | mode = ATH9K_MODE_11NA_HT40PLUS; |
1178 | break; | 1179 | break; |
1179 | default: | 1180 | default: |
1180 | DPRINTF(sc->sc_ah, ATH_DBG_CONFIG, "Invalid band\n"); | 1181 | ath_print(common, ATH_DBG_CONFIG, "Invalid band\n"); |
1181 | return NULL; | 1182 | return NULL; |
1182 | } | 1183 | } |
1183 | 1184 | ||
1184 | BUG_ON(mode >= ATH9K_MODE_MAX); | 1185 | BUG_ON(mode >= ATH9K_MODE_MAX); |
1185 | 1186 | ||
1186 | DPRINTF(sc->sc_ah, ATH_DBG_CONFIG, | 1187 | ath_print(common, ATH_DBG_CONFIG, |
1187 | "Choosing rate table for mode: %d\n", mode); | 1188 | "Choosing rate table for mode: %d\n", mode); |
1188 | return sc->hw_rate_table[mode]; | 1189 | return sc->hw_rate_table[mode]; |
1189 | } | 1190 | } |
1190 | 1191 | ||
@@ -1195,12 +1196,13 @@ static void ath_rc_init(struct ath_softc *sc, | |||
1195 | const struct ath_rate_table *rate_table) | 1196 | const struct ath_rate_table *rate_table) |
1196 | { | 1197 | { |
1197 | struct ath_rateset *rateset = &ath_rc_priv->neg_rates; | 1198 | struct ath_rateset *rateset = &ath_rc_priv->neg_rates; |
1199 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | ||
1198 | u8 *ht_mcs = (u8 *)&ath_rc_priv->neg_ht_rates; | 1200 | u8 *ht_mcs = (u8 *)&ath_rc_priv->neg_ht_rates; |
1199 | u8 i, j, k, hi = 0, hthi = 0; | 1201 | u8 i, j, k, hi = 0, hthi = 0; |
1200 | 1202 | ||
1201 | if (!rate_table) { | 1203 | if (!rate_table) { |
1202 | DPRINTF(sc->sc_ah, ATH_DBG_FATAL, | 1204 | ath_print(common, ATH_DBG_FATAL, |
1203 | "Rate table not initialized\n"); | 1205 | "Rate table not initialized\n"); |
1204 | return; | 1206 | return; |
1205 | } | 1207 | } |
1206 | 1208 | ||
@@ -1263,9 +1265,9 @@ static void ath_rc_init(struct ath_softc *sc, | |||
1263 | ath_rc_priv->rate_max_phy = ath_rc_priv->valid_rate_index[k-4]; | 1265 | ath_rc_priv->rate_max_phy = ath_rc_priv->valid_rate_index[k-4]; |
1264 | sc->cur_rate_table = rate_table; | 1266 | sc->cur_rate_table = rate_table; |
1265 | 1267 | ||
1266 | DPRINTF(sc->sc_ah, ATH_DBG_CONFIG, | 1268 | ath_print(common, ATH_DBG_CONFIG, |
1267 | "RC Initialized with capabilities: 0x%x\n", | 1269 | "RC Initialized with capabilities: 0x%x\n", |
1268 | ath_rc_priv->ht_cap); | 1270 | ath_rc_priv->ht_cap); |
1269 | } | 1271 | } |
1270 | 1272 | ||
1271 | static u8 ath_rc_build_ht_caps(struct ath_softc *sc, struct ieee80211_sta *sta, | 1273 | static u8 ath_rc_build_ht_caps(struct ath_softc *sc, struct ieee80211_sta *sta, |
@@ -1441,9 +1443,9 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband, | |||
1441 | oper_cw40, oper_sgi40); | 1443 | oper_cw40, oper_sgi40); |
1442 | ath_rc_init(sc, priv_sta, sband, sta, rate_table); | 1444 | ath_rc_init(sc, priv_sta, sband, sta, rate_table); |
1443 | 1445 | ||
1444 | DPRINTF(sc->sc_ah, ATH_DBG_CONFIG, | 1446 | ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_CONFIG, |
1445 | "Operating HT Bandwidth changed to: %d\n", | 1447 | "Operating HT Bandwidth changed to: %d\n", |
1446 | sc->hw->conf.channel_type); | 1448 | sc->hw->conf.channel_type); |
1447 | } | 1449 | } |
1448 | } | 1450 | } |
1449 | } | 1451 | } |
@@ -1466,8 +1468,8 @@ static void *ath_rate_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp | |||
1466 | 1468 | ||
1467 | rate_priv = kzalloc(sizeof(struct ath_rate_priv), gfp); | 1469 | rate_priv = kzalloc(sizeof(struct ath_rate_priv), gfp); |
1468 | if (!rate_priv) { | 1470 | if (!rate_priv) { |
1469 | DPRINTF(sc->sc_ah, ATH_DBG_FATAL, | 1471 | ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_FATAL, |
1470 | "Unable to allocate private rc structure\n"); | 1472 | "Unable to allocate private rc structure\n"); |
1471 | return NULL; | 1473 | return NULL; |
1472 | } | 1474 | } |
1473 | 1475 | ||