Search Linux Wireless

Re: [PATCH 4/5] ath5k: Remove ATH5K_INI_RFGAIN defines, use band instead

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/12/21 Bruno Randolf <br1@xxxxxxxxxxx>:
> Remove redundant defines.
>
> Signed-off-by: Bruno Randolf <br1@xxxxxxxxxxx>
> ---
> Âdrivers/net/wireless/ath/ath5k/ath5k.h | Â Â6 +-----
> Âdrivers/net/wireless/ath/ath5k/phy.c  |  18 ++++++------------
> Âdrivers/net/wireless/ath/ath5k/reset.c | Â 11 +++--------
> Â3 files changed, 10 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
> index 342da28..5de8520 100644
> --- a/drivers/net/wireless/ath/ath5k/ath5k.h
> +++ b/drivers/net/wireless/ath/ath5k/ath5k.h
> @@ -154,10 +154,6 @@
> Â Â Â Â Â Â Â Âudelay(1); Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â\
> Â} while (0)
>
> -/* Register dumps are done per operation mode */
> -#define AR5K_INI_RFGAIN_5GHZ Â Â Â Â Â 0
> -#define AR5K_INI_RFGAIN_2GHZ Â Â Â Â Â 1
> -
> Â/*
> Â* Some tuneable values (these should be changeable by the user)
> Â* TODO: Make use of them and add more options OR use debug/configfs
> @@ -1322,7 +1318,7 @@ void ath5k_hw_set_antenna_switch(struct ath5k_hw *ah, u8 ee_mode);
> Âint ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, u8 txpower);
> Â/* Init function */
> Âint ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â u8 mode, u8 ee_mode, u8 freq, bool fast);
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â u8 mode, u8 ee_mode, bool fast);
>
> Â/*
> Â* Functions used internaly
> diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
> index 18c58cd..b6e9621 100644
> --- a/drivers/net/wireless/ath/ath5k/phy.c
> +++ b/drivers/net/wireless/ath/ath5k/phy.c
> @@ -609,10 +609,10 @@ done:
> Â/* Write initial RF gain table to set the RF sensitivity
> Â* this one works on all RF chips and has nothing to do
> Â* with gain_F calibration */
> -static int ath5k_hw_rfgain_init(struct ath5k_hw *ah, unsigned int freq)
> +static int ath5k_hw_rfgain_init(struct ath5k_hw *ah, enum ieee80211_band band)
> Â{
> Â Â Â Âconst struct ath5k_ini_rfgain *ath5k_rfg;
> - Â Â Â unsigned int i, size;
> + Â Â Â unsigned int i, size, index;
>
> Â Â Â Âswitch (ah->ah_radio) {
> Â Â Â Âcase AR5K_RF5111:
> @@ -644,17 +644,11 @@ static int ath5k_hw_rfgain_init(struct ath5k_hw *ah, unsigned int freq)
> Â Â Â Â Â Â Â Âreturn -EINVAL;
> Â Â Â Â}
>
> - Â Â Â switch (freq) {
> - Â Â Â case AR5K_INI_RFGAIN_2GHZ:
> - Â Â Â case AR5K_INI_RFGAIN_5GHZ:
> - Â Â Â Â Â Â Â break;
> - Â Â Â default:
> - Â Â Â Â Â Â Â return -EINVAL;
> - Â Â Â }
> + Â Â Â index = (band == IEEE80211_BAND_2GHZ) ? 1 : 0;
>
> Â Â Â Âfor (i = 0; i < size; i++) {
> Â Â Â Â Â Â Â ÂAR5K_REG_WAIT(i);
> - Â Â Â Â Â Â Â ath5k_hw_reg_write(ah, ath5k_rfg[i].rfg_value[freq],
> + Â Â Â Â Â Â Â ath5k_hw_reg_write(ah, ath5k_rfg[i].rfg_value[index],
> Â Â Â Â Â Â Â Â Â Â Â Â(u32)ath5k_rfg[i].rfg_register);
> Â Â Â Â}
>
> @@ -3246,7 +3240,7 @@ int ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, u8 txpower)
> Â\*************/
>
> Âint ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â u8 mode, u8 ee_mode, u8 freq, bool fast)
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â u8 mode, u8 ee_mode, bool fast)
> Â{
> Â Â Â Âstruct ieee80211_channel *curr_channel;
> Â Â Â Âint ret, i;
> @@ -3305,7 +3299,7 @@ int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel,
> Â Â Â Â Â Â Â Â * Write initial RF gain settings
> Â Â Â Â Â Â Â Â * This should work for both 5111/5112
> Â Â Â Â Â Â Â Â */
> - Â Â Â Â Â Â Â ret = ath5k_hw_rfgain_init(ah, freq);
> + Â Â Â Â Â Â Â ret = ath5k_hw_rfgain_init(ah, channel->band);
> Â Â Â Â Â Â Â Âif (ret)
> Â Â Â Â Â Â Â Â Â Â Â Âreturn ret;
>
> diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c
> index bc84aaa..4b8b987 100644
> --- a/drivers/net/wireless/ath/ath5k/reset.c
> +++ b/drivers/net/wireless/ath/ath5k/reset.c
> @@ -1020,13 +1020,12 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
> Â Â Â Â Â Â Â Âstruct ieee80211_channel *channel, bool fast, bool skip_pcu)
> Â{
> Â Â Â Âu32 s_seq[10], s_led[3], tsf_up, tsf_lo;
> - Â Â Â u8 mode, freq, ee_mode;
> + Â Â Â u8 mode, ee_mode;
> Â Â Â Âint i, ret;
>
> Â Â Â Âee_mode = 0;
> Â Â Â Âtsf_up = 0;
> Â Â Â Âtsf_lo = 0;
> - Â Â Â freq = 0;
> Â Â Â Âmode = 0;
>
> Â Â Â Â/*
> @@ -1071,7 +1070,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
> Â Â Â Âswitch (channel->hw_value & CHANNEL_MODES) {
> Â Â Â Âcase CHANNEL_A:
> Â Â Â Â Â Â Â Âmode = AR5K_MODE_11A;
> - Â Â Â Â Â Â Â freq = AR5K_INI_RFGAIN_5GHZ;
> Â Â Â Â Â Â Â Âee_mode = AR5K_EEPROM_MODE_11A;
> Â Â Â Â Â Â Â Âbreak;
> Â Â Â Âcase CHANNEL_G:
> @@ -1083,7 +1081,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
> Â Â Â Â Â Â Â Â}
>
> Â Â Â Â Â Â Â Âmode = AR5K_MODE_11G;
> - Â Â Â Â Â Â Â freq = AR5K_INI_RFGAIN_2GHZ;
> Â Â Â Â Â Â Â Âee_mode = AR5K_EEPROM_MODE_11G;
> Â Â Â Â Â Â Â Âbreak;
> Â Â Â Âcase CHANNEL_B:
> @@ -1095,7 +1092,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
> Â Â Â Â Â Â Â Â}
>
> Â Â Â Â Â Â Â Âmode = AR5K_MODE_11B;
> - Â Â Â Â Â Â Â freq = AR5K_INI_RFGAIN_2GHZ;
> Â Â Â Â Â Â Â Âee_mode = AR5K_EEPROM_MODE_11B;
> Â Â Â Â Â Â Â Âbreak;
> Â Â Â Âcase CHANNEL_XR:
> @@ -1105,7 +1101,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
> Â Â Â Â Â Â Â Â Â Â Â Âreturn -EINVAL;
> Â Â Â Â Â Â Â Â}
> Â Â Â Â Â Â Â Âmode = AR5K_MODE_XR;
> - Â Â Â Â Â Â Â freq = AR5K_INI_RFGAIN_5GHZ;
> Â Â Â Â Â Â Â Âee_mode = AR5K_EEPROM_MODE_11A;
> Â Â Â Â Â Â Â Âbreak;
> Â Â Â Âdefault:
> @@ -1120,7 +1115,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
> Â Â Â Â */
> Â Â Â Âif (fast) {
> Â Â Â Â Â Â Â Âret = ath5k_hw_phy_init(ah, channel, mode,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ee_mode, freq, true);
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ee_mode, true);
> Â Â Â Â Â Â Â Âif (ret) {
> Â Â Â Â Â Â Â Â Â Â Â ÂATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_RESET,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â"fast chan change failed, falling back to normal reset\n");
> @@ -1256,7 +1251,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
> Â Â Â Â/*
> Â Â Â Â * Initialize PHY
> Â Â Â Â */
> - Â Â Â ret = ath5k_hw_phy_init(ah, channel, mode, ee_mode, freq, false);
> + Â Â Â ret = ath5k_hw_phy_init(ah, channel, mode, ee_mode, false);
> Â Â Â Âif (ret) {
> Â Â Â Â Â Â Â ÂATH5K_ERR(ah->ah_sc,
> Â Â Â Â Â Â Â Â Â Â Â Â"failed to initialize PHY (%i) !\n", ret);
>
>

Acked-by: Nick Kossifidis <mickflemm@xxxxxxxxx>


-- 
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux