commit 6c6240b10efc54eb3e867dbc1fd90accaebbb8fd Author: Jiri Slaby Date: Sat Jun 23 13:01:45 2007 +0200 don't copy and store rates in ath_hw diff --git a/openhal/ath5k.h b/openhal/ath5k.h index 6de3c16..1aa8e37 100644 --- a/openhal/ath5k.h +++ b/openhal/ath5k.h @@ -952,12 +952,6 @@ struct ath_hw { bool ah_single_chip; enum ath5k_rfgain ah_rf_gain; - struct ath5k_rate_table ah_rt_11a; - struct ath5k_rate_table ah_rt_11b; - struct ath5k_rate_table ah_rt_11g; - struct ath5k_rate_table ah_rt_turbo; - struct ath5k_rate_table ah_rt_xr; - u32 ah_mac_srev; u16 ah_mac_version; u16 ah_mac_revision; diff --git a/openhal/ath5k_hw.c b/openhal/ath5k_hw.c index 4bf7c42..6826e9c 100644 --- a/openhal/ath5k_hw.c +++ b/openhal/ath5k_hw.c @@ -207,17 +207,6 @@ static inline unsigned int ath5k_hw_clocktoh(unsigned int clock, bool turbo) } /* - * Copy a rate table to a new one - */ -static inline void -ath5k_hw_rtcopy(struct ath5k_rate_table *dst, const struct ath5k_rate_table *src) -{ - memset(dst, 0, sizeof(struct ath5k_rate_table)); - dst->rate_count = src->rate_count; - memcpy(dst->rates, src->rates, sizeof(dst->rates)); -} - -/* * Read from a device register */ static inline u32 ath5k_hw_reg_read(struct ath_hw *hal, u16 reg) @@ -444,18 +433,6 @@ struct ath_hw *ath5k_hw_attach(u16 device, u8 mac_version, void *sc, ath5k_hw_set_lladdr(hal, mac); - /* Get rate tables */ - if (hal->ah_capabilities.cap_mode & AR5K_MODE_11A) - ath5k_hw_rtcopy(&hal->ah_rt_11a, &ath5k_rt_11a); - if (hal->ah_capabilities.cap_mode & AR5K_MODE_11B) - ath5k_hw_rtcopy(&hal->ah_rt_11b, &ath5k_rt_11b); - if (hal->ah_capabilities.cap_mode & AR5K_MODE_11G) - ath5k_hw_rtcopy(&hal->ah_rt_11g, &ath5k_rt_11g); - if (hal->ah_capabilities.cap_mode & AR5K_MODE_TURBO) - ath5k_hw_rtcopy(&hal->ah_rt_turbo, &ath5k_rt_turbo); - if (hal->ah_capabilities.cap_mode & AR5K_MODE_XR) - ath5k_hw_rtcopy(&hal->ah_rt_xr, &ath5k_rt_xr); - /* Initialize the gain optimization values */ /*For RF5111*/ if (hal->ah_radio == AR5K_RF5111) { @@ -671,17 +648,21 @@ ath5k_hw_get_rate_table(struct ath_hw *hal, unsigned int mode) { AR5K_TRACE; + /* Get rate tables */ + if (!(hal->ah_capabilities.cap_mode & mode)) + return NULL; + switch (mode) { case AR5K_MODE_11A: - return &hal->ah_rt_11a; + return &ath5k_rt_11a; case AR5K_MODE_TURBO: - return &hal->ah_rt_turbo; + return &ath5k_rt_turbo; case AR5K_MODE_11B: - return &hal->ah_rt_11b; + return &ath5k_rt_11b; case AR5K_MODE_11G: - return &hal->ah_rt_11g; + return &ath5k_rt_11g; case AR5K_MODE_XR: - return &hal->ah_rt_xr; + return &ath5k_rt_xr; default: return NULL; }