Commit 46026e8f authored by Bob Copeland's avatar Bob Copeland Committed by John W. Linville

ath5k: cleanup ath5k_hw struct

ah_gpios array isn't used, and ah_current_channel can be a pointer
instead of an embedded struct.  Removing these and some other
write-only variables, and moving some things around for better
packing and cache utilization saves 116 bytes.

   text	   data	    bss	    dec	    hex	filename
 121762	    472	     64	 122298	  1ddba	ath5k_before.ko
 121646	    472	     64	 122182	  1dd46	ath5k.ko
Signed-off-by: default avatarBob Copeland <me@bobcopeland.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 8a46097a
...@@ -713,8 +713,8 @@ struct ath5k_gain { ...@@ -713,8 +713,8 @@ struct ath5k_gain {
* Used internaly for reset_tx_queue). * Used internaly for reset_tx_queue).
* Also see struct struct ieee80211_channel. * Also see struct struct ieee80211_channel.
*/ */
#define IS_CHAN_XR(_c) ((_c.hw_value & CHANNEL_XR) != 0) #define IS_CHAN_XR(_c) ((_c->hw_value & CHANNEL_XR) != 0)
#define IS_CHAN_B(_c) ((_c.hw_value & CHANNEL_B) != 0) #define IS_CHAN_B(_c) ((_c->hw_value & CHANNEL_B) != 0)
/* /*
* The following structure is used to map 2GHz channels to * The following structure is used to map 2GHz channels to
...@@ -1029,14 +1029,15 @@ struct ath5k_hw { ...@@ -1029,14 +1029,15 @@ struct ath5k_hw {
enum ath5k_int ah_imr; enum ath5k_int ah_imr;
enum nl80211_iftype ah_op_mode; enum nl80211_iftype ah_op_mode;
enum ath5k_power_mode ah_power_mode; struct ieee80211_channel *ah_current_channel;
struct ieee80211_channel ah_current_channel;
bool ah_turbo; bool ah_turbo;
bool ah_calibration; bool ah_calibration;
bool ah_running;
bool ah_single_chip; bool ah_single_chip;
bool ah_combined_mic; bool ah_combined_mic;
enum ath5k_version ah_version;
enum ath5k_radio ah_radio;
u32 ah_phy;
u32 ah_mac_srev; u32 ah_mac_srev;
u16 ah_mac_version; u16 ah_mac_version;
u16 ah_mac_revision; u16 ah_mac_revision;
...@@ -1044,13 +1045,6 @@ struct ath5k_hw { ...@@ -1044,13 +1045,6 @@ struct ath5k_hw {
u16 ah_radio_5ghz_revision; u16 ah_radio_5ghz_revision;
u16 ah_radio_2ghz_revision; u16 ah_radio_2ghz_revision;
enum ath5k_version ah_version;
enum ath5k_radio ah_radio;
u32 ah_phy;
bool ah_5ghz;
bool ah_2ghz;
#define ah_modes ah_capabilities.cap_mode #define ah_modes ah_capabilities.cap_mode
#define ah_ee_version ah_capabilities.cap_eeprom.ee_version #define ah_ee_version ah_capabilities.cap_eeprom.ee_version
...@@ -1058,7 +1052,6 @@ struct ath5k_hw { ...@@ -1058,7 +1052,6 @@ struct ath5k_hw {
u32 ah_aifs; u32 ah_aifs;
u32 ah_cw_min; u32 ah_cw_min;
u32 ah_cw_max; u32 ah_cw_max;
bool ah_software_retry;
u32 ah_limit_tx_retries; u32 ah_limit_tx_retries;
/* Antenna Control */ /* Antenna Control */
...@@ -1066,6 +1059,7 @@ struct ath5k_hw { ...@@ -1066,6 +1059,7 @@ struct ath5k_hw {
u8 ah_ant_mode; u8 ah_ant_mode;
u8 ah_tx_ant; u8 ah_tx_ant;
u8 ah_def_ant; u8 ah_def_ant;
bool ah_software_retry;
u8 ah_sta_id[ETH_ALEN]; u8 ah_sta_id[ETH_ALEN];
...@@ -1075,7 +1069,6 @@ struct ath5k_hw { ...@@ -1075,7 +1069,6 @@ struct ath5k_hw {
u8 ah_bssid[ETH_ALEN]; u8 ah_bssid[ETH_ALEN];
u8 ah_bssid_mask[ETH_ALEN]; u8 ah_bssid_mask[ETH_ALEN];
u32 ah_gpio[AR5K_MAX_GPIO];
int ah_gpio_npins; int ah_gpio_npins;
struct ath_regulatory ah_regulatory; struct ath_regulatory ah_regulatory;
......
...@@ -1085,8 +1085,7 @@ int ath5k_hw_channel(struct ath5k_hw *ah, struct ieee80211_channel *channel) ...@@ -1085,8 +1085,7 @@ int ath5k_hw_channel(struct ath5k_hw *ah, struct ieee80211_channel *channel)
AR5K_PHY_CCKTXCTL_WORLD); AR5K_PHY_CCKTXCTL_WORLD);
} }
ah->ah_current_channel.center_freq = channel->center_freq; ah->ah_current_channel = channel;
ah->ah_current_channel.hw_value = channel->hw_value;
ah->ah_turbo = channel->hw_value == CHANNEL_T ? true : false; ah->ah_turbo = channel->hw_value == CHANNEL_T ? true : false;
return 0; return 0;
...@@ -1731,7 +1730,7 @@ ath5k_hw_set_fast_div(struct ath5k_hw *ah, u8 ee_mode, bool enable) ...@@ -1731,7 +1730,7 @@ ath5k_hw_set_fast_div(struct ath5k_hw *ah, u8 ee_mode, bool enable)
void void
ath5k_hw_set_antenna_mode(struct ath5k_hw *ah, u8 ant_mode) ath5k_hw_set_antenna_mode(struct ath5k_hw *ah, u8 ant_mode)
{ {
struct ieee80211_channel *channel = &ah->ah_current_channel; struct ieee80211_channel *channel = ah->ah_current_channel;
bool use_def_for_tx, update_def_on_tx, use_def_for_rts, fast_div; bool use_def_for_tx, update_def_on_tx, use_def_for_rts, fast_div;
bool use_def_for_sg; bool use_def_for_sg;
u8 def_ant, tx_ant, ee_mode; u8 def_ant, tx_ant, ee_mode;
...@@ -3011,7 +3010,7 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel, ...@@ -3011,7 +3010,7 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel,
int ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, u8 txpower) int ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, u8 txpower)
{ {
/*Just a try M.F.*/ /*Just a try M.F.*/
struct ieee80211_channel *channel = &ah->ah_current_channel; struct ieee80211_channel *channel = ah->ah_current_channel;
u8 ee_mode; u8 ee_mode;
ATH5K_TRACE(ah->ah_sc); ATH5K_TRACE(ah->ah_sc);
......
...@@ -290,7 +290,6 @@ int ath5k_hw_set_power(struct ath5k_hw *ah, enum ath5k_power_mode mode, ...@@ -290,7 +290,6 @@ int ath5k_hw_set_power(struct ath5k_hw *ah, enum ath5k_power_mode mode,
} }
commit: commit:
ah->ah_power_mode = mode;
ath5k_hw_reg_write(ah, staid, AR5K_STA_ID1); ath5k_hw_reg_write(ah, staid, AR5K_STA_ID1);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment