diff options
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath5k/base.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/ath5k/base.h | 2 |
2 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index f28b86c5d346..6580df2f7443 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
@@ -1088,9 +1088,18 @@ ath5k_mode_setup(struct ath5k_softc *sc) | |||
1088 | static inline int | 1088 | static inline int |
1089 | ath5k_hw_to_driver_rix(struct ath5k_softc *sc, int hw_rix) | 1089 | ath5k_hw_to_driver_rix(struct ath5k_softc *sc, int hw_rix) |
1090 | { | 1090 | { |
1091 | WARN(hw_rix < 0 || hw_rix >= AR5K_MAX_RATES, | 1091 | int rix; |
1092 | "hw_rix out of bounds: %x\n", hw_rix); | 1092 | |
1093 | return sc->rate_idx[sc->curband->band][hw_rix]; | 1093 | /* return base rate on errors */ |
1094 | if (WARN(hw_rix < 0 || hw_rix >= AR5K_MAX_RATES, | ||
1095 | "hw_rix out of bounds: %x\n", hw_rix)) | ||
1096 | return 0; | ||
1097 | |||
1098 | rix = sc->rate_idx[sc->curband->band][hw_rix]; | ||
1099 | if (WARN(rix < 0, "invalid hw_rix: %x\n", hw_rix)) | ||
1100 | rix = 0; | ||
1101 | |||
1102 | return rix; | ||
1094 | } | 1103 | } |
1095 | 1104 | ||
1096 | /***************\ | 1105 | /***************\ |
diff --git a/drivers/net/wireless/ath5k/base.h b/drivers/net/wireless/ath5k/base.h index 20e0d14b41ec..822956114cd7 100644 --- a/drivers/net/wireless/ath5k/base.h +++ b/drivers/net/wireless/ath5k/base.h | |||
@@ -112,7 +112,7 @@ struct ath5k_softc { | |||
112 | struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS]; | 112 | struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS]; |
113 | struct ieee80211_channel channels[ATH_CHAN_MAX]; | 113 | struct ieee80211_channel channels[ATH_CHAN_MAX]; |
114 | struct ieee80211_rate rates[IEEE80211_NUM_BANDS][AR5K_MAX_RATES]; | 114 | struct ieee80211_rate rates[IEEE80211_NUM_BANDS][AR5K_MAX_RATES]; |
115 | u8 rate_idx[IEEE80211_NUM_BANDS][AR5K_MAX_RATES]; | 115 | s8 rate_idx[IEEE80211_NUM_BANDS][AR5K_MAX_RATES]; |
116 | enum nl80211_iftype opmode; | 116 | enum nl80211_iftype opmode; |
117 | struct ath5k_hw *ah; /* Atheros HW */ | 117 | struct ath5k_hw *ah; /* Atheros HW */ |
118 | 118 | ||