Commit e4bbf2f5 authored by Pavel Roskin's avatar Pavel Roskin Committed by John W. Linville

ath5k: fix formatting errors found by checkpatch.pl

Signed-off-by: default avatarPavel Roskin <proski@gnu.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d2c7f773
...@@ -167,8 +167,8 @@ static int ath_ahb_probe(struct platform_device *pdev) ...@@ -167,8 +167,8 @@ static int ath_ahb_probe(struct platform_device *pdev)
* driver for it * driver for it
*/ */
if (to_platform_device(sc->dev)->id == 0 && if (to_platform_device(sc->dev)->id == 0 &&
(bcfg->config->flags & (BD_WLAN0|BD_WLAN1)) == (bcfg->config->flags & (BD_WLAN0 | BD_WLAN1)) ==
(BD_WLAN1|BD_WLAN0)) (BD_WLAN1 | BD_WLAN0))
__set_bit(ATH_STAT_2G_DISABLED, sc->status); __set_bit(ATH_STAT_2G_DISABLED, sc->status);
} }
......
...@@ -617,8 +617,8 @@ struct ath5k_rx_status { ...@@ -617,8 +617,8 @@ struct ath5k_rx_status {
#define AR5K_RXERR_FIFO 0x04 #define AR5K_RXERR_FIFO 0x04
#define AR5K_RXERR_DECRYPT 0x08 #define AR5K_RXERR_DECRYPT 0x08
#define AR5K_RXERR_MIC 0x10 #define AR5K_RXERR_MIC 0x10
#define AR5K_RXKEYIX_INVALID ((u8) - 1) #define AR5K_RXKEYIX_INVALID ((u8) -1)
#define AR5K_TXKEYIX_INVALID ((u32) - 1) #define AR5K_TXKEYIX_INVALID ((u32) -1)
/**************************\ /**************************\
...@@ -679,12 +679,13 @@ struct ath5k_gain { ...@@ -679,12 +679,13 @@ struct ath5k_gain {
#define CHANNEL_DYN 0x0400 /* Dynamic CCK-OFDM channel (for g operation) */ #define CHANNEL_DYN 0x0400 /* Dynamic CCK-OFDM channel (for g operation) */
#define CHANNEL_XR 0x0800 /* XR channel */ #define CHANNEL_XR 0x0800 /* XR channel */
#define CHANNEL_A (CHANNEL_5GHZ|CHANNEL_OFDM) #define CHANNEL_A (CHANNEL_5GHZ | CHANNEL_OFDM)
#define CHANNEL_B (CHANNEL_2GHZ|CHANNEL_CCK) #define CHANNEL_B (CHANNEL_2GHZ | CHANNEL_CCK)
#define CHANNEL_G (CHANNEL_2GHZ|CHANNEL_OFDM) #define CHANNEL_G (CHANNEL_2GHZ | CHANNEL_OFDM)
#define CHANNEL_X (CHANNEL_5GHZ|CHANNEL_OFDM|CHANNEL_XR) #define CHANNEL_X (CHANNEL_5GHZ | CHANNEL_OFDM | CHANNEL_XR)
#define CHANNEL_ALL (CHANNEL_OFDM|CHANNEL_CCK|CHANNEL_2GHZ|CHANNEL_5GHZ) #define CHANNEL_ALL (CHANNEL_OFDM | CHANNEL_CCK | \
CHANNEL_2GHZ | CHANNEL_5GHZ)
#define CHANNEL_MODES CHANNEL_ALL #define CHANNEL_MODES CHANNEL_ALL
...@@ -777,7 +778,7 @@ extern int ath5k_modparam_nohwcrypt; ...@@ -777,7 +778,7 @@ extern int ath5k_modparam_nohwcrypt;
/* /*
* Misc definitions * Misc definitions
*/ */
#define AR5K_RSSI_EP_MULTIPLIER (1<<7) #define AR5K_RSSI_EP_MULTIPLIER (1 << 7)
#define AR5K_ASSERT_ENTRY(_e, _s) do { \ #define AR5K_ASSERT_ENTRY(_e, _s) do { \
if (_e >= _s) \ if (_e >= _s) \
......
...@@ -192,7 +192,7 @@ int ath5k_hw_init(struct ath5k_softc *sc) ...@@ -192,7 +192,7 @@ int ath5k_hw_init(struct ath5k_softc *sc)
break; break;
case AR5K_SREV_RAD_5424: case AR5K_SREV_RAD_5424:
if (ah->ah_mac_version == AR5K_SREV_AR2425 || if (ah->ah_mac_version == AR5K_SREV_AR2425 ||
ah->ah_mac_version == AR5K_SREV_AR2417){ ah->ah_mac_version == AR5K_SREV_AR2417) {
ah->ah_radio = AR5K_RF2425; ah->ah_radio = AR5K_RF2425;
ah->ah_single_chip = true; ah->ah_single_chip = true;
} else { } else {
...@@ -245,8 +245,7 @@ int ath5k_hw_init(struct ath5k_softc *sc) ...@@ -245,8 +245,7 @@ int ath5k_hw_init(struct ath5k_softc *sc)
/* Return on unsuported chips (unsupported eeprom etc) */ /* Return on unsuported chips (unsupported eeprom etc) */
if ((srev >= AR5K_SREV_AR5416) && if ((srev >= AR5K_SREV_AR5416) && (srev < AR5K_SREV_AR2425)) {
(srev < AR5K_SREV_AR2425)) {
ATH5K_ERR(sc, "Device not yet supported.\n"); ATH5K_ERR(sc, "Device not yet supported.\n");
ret = -ENODEV; ret = -ENODEV;
goto err; goto err;
......
...@@ -814,8 +814,7 @@ ath5k_desc_alloc(struct ath5k_softc *sc) ...@@ -814,8 +814,7 @@ ath5k_desc_alloc(struct ath5k_softc *sc)
INIT_LIST_HEAD(&sc->txbuf); INIT_LIST_HEAD(&sc->txbuf);
sc->txbuf_len = ATH_TXBUF; sc->txbuf_len = ATH_TXBUF;
for (i = 0; i < ATH_TXBUF; i++, bf++, ds++, for (i = 0; i < ATH_TXBUF; i++, bf++, ds++, da += sizeof(*ds)) {
da += sizeof(*ds)) {
bf->desc = ds; bf->desc = ds;
bf->daddr = da; bf->daddr = da;
list_add_tail(&bf->list, &sc->txbuf); list_add_tail(&bf->list, &sc->txbuf);
...@@ -1261,7 +1260,7 @@ ath5k_update_beacon_rssi(struct ath5k_softc *sc, struct sk_buff *skb, int rssi) ...@@ -1261,7 +1260,7 @@ ath5k_update_beacon_rssi(struct ath5k_softc *sc, struct sk_buff *skb, int rssi)
*/ */
static int ath5k_common_padpos(struct sk_buff *skb) static int ath5k_common_padpos(struct sk_buff *skb)
{ {
struct ieee80211_hdr * hdr = (struct ieee80211_hdr *)skb->data; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
__le16 frame_control = hdr->frame_control; __le16 frame_control = hdr->frame_control;
int padpos = 24; int padpos = 24;
...@@ -1283,13 +1282,13 @@ static int ath5k_add_padding(struct sk_buff *skb) ...@@ -1283,13 +1282,13 @@ static int ath5k_add_padding(struct sk_buff *skb)
int padpos = ath5k_common_padpos(skb); int padpos = ath5k_common_padpos(skb);
int padsize = padpos & 3; int padsize = padpos & 3;
if (padsize && skb->len>padpos) { if (padsize && skb->len > padpos) {
if (skb_headroom(skb) < padsize) if (skb_headroom(skb) < padsize)
return -1; return -1;
skb_push(skb, padsize); skb_push(skb, padsize);
memmove(skb->data, skb->data+padsize, padpos); memmove(skb->data, skb->data + padsize, padpos);
return padsize; return padsize;
} }
...@@ -1314,7 +1313,7 @@ static int ath5k_remove_padding(struct sk_buff *skb) ...@@ -1314,7 +1313,7 @@ static int ath5k_remove_padding(struct sk_buff *skb)
int padpos = ath5k_common_padpos(skb); int padpos = ath5k_common_padpos(skb);
int padsize = padpos & 3; int padsize = padpos & 3;
if (padsize && skb->len>=padpos+padsize) { if (padsize && skb->len >= padpos + padsize) {
memmove(skb->data + padsize, skb->data, padpos); memmove(skb->data + padsize, skb->data, padpos);
skb_pull(skb, padsize); skb_pull(skb, padsize);
return padsize; return padsize;
...@@ -1709,7 +1708,7 @@ ath5k_tasklet_tx(unsigned long data) ...@@ -1709,7 +1708,7 @@ ath5k_tasklet_tx(unsigned long data)
int i; int i;
struct ath5k_softc *sc = (void *)data; struct ath5k_softc *sc = (void *)data;
for (i=0; i < AR5K_NUM_TX_QUEUES; i++) for (i = 0; i < AR5K_NUM_TX_QUEUES; i++)
if (sc->txqs[i].setup && (sc->ah->ah_txq_isr & BIT(i))) if (sc->txqs[i].setup && (sc->ah->ah_txq_isr & BIT(i)))
ath5k_tx_processq(sc, &sc->txqs[i]); ath5k_tx_processq(sc, &sc->txqs[i]);
...@@ -2485,7 +2484,7 @@ ath5k_init_softc(struct ath5k_softc *sc, const struct ath_bus_ops *bus_ops) ...@@ -2485,7 +2484,7 @@ ath5k_init_softc(struct ath5k_softc *sc, const struct ath_bus_ops *bus_ops)
/* Multi chip radio (RF5111 - RF2111) -> /* Multi chip radio (RF5111 - RF2111) ->
* report both 2GHz/5GHz radios */ * report both 2GHz/5GHz radios */
else if (sc->ah->ah_radio_5ghz_revision && else if (sc->ah->ah_radio_5ghz_revision &&
sc->ah->ah_radio_2ghz_revision){ sc->ah->ah_radio_2ghz_revision) {
ATH5K_INFO(sc, "RF%s 5GHz radio found (0x%x)\n", ATH5K_INFO(sc, "RF%s 5GHz radio found (0x%x)\n",
ath5k_chip_name(AR5K_VERSION_RAD, ath5k_chip_name(AR5K_VERSION_RAD,
sc->ah->ah_radio_5ghz_revision), sc->ah->ah_radio_5ghz_revision),
...@@ -2710,8 +2709,7 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan, ...@@ -2710,8 +2709,7 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan,
fast = ((chan != NULL) && modparam_fastchanswitch) ? 1 : 0; fast = ((chan != NULL) && modparam_fastchanswitch) ? 1 : 0;
ret = ath5k_hw_reset(ah, sc->opmode, sc->curchan, fast, ret = ath5k_hw_reset(ah, sc->opmode, sc->curchan, fast, skip_pcu);
skip_pcu);
if (ret) { if (ret) {
ATH5K_ERR(sc, "can't reset hardware (%d)\n", ret); ATH5K_ERR(sc, "can't reset hardware (%d)\n", ret);
goto err; goto err;
......
...@@ -153,9 +153,9 @@ struct ath5k_statistics { ...@@ -153,9 +153,9 @@ struct ath5k_statistics {
}; };
#if CHAN_DEBUG #if CHAN_DEBUG
#define ATH_CHAN_MAX (26+26+26+200+200) #define ATH_CHAN_MAX (26 + 26 + 26 + 200 + 200)
#else #else
#define ATH_CHAN_MAX (14+14+14+252+20) #define ATH_CHAN_MAX (14 + 14 + 14 + 252 + 20)
#endif #endif
struct ath5k_vif { struct ath5k_vif {
......
This diff is collapsed.
...@@ -258,7 +258,7 @@ static int ath5k_hw_stop_tx_dma(struct ath5k_hw *ah, unsigned int queue) ...@@ -258,7 +258,7 @@ static int ath5k_hw_stop_tx_dma(struct ath5k_hw *ah, unsigned int queue)
/* For 2413+ order PCU to drop packets using /* For 2413+ order PCU to drop packets using
* QUIET mechanism */ * QUIET mechanism */
if (ah->ah_mac_version >= (AR5K_SREV_AR2414 >> 4) && if (ah->ah_mac_version >= (AR5K_SREV_AR2414 >> 4) &&
pending){ pending) {
/* Set periodicity and duration */ /* Set periodicity and duration */
ath5k_hw_reg_write(ah, ath5k_hw_reg_write(ah,
AR5K_REG_SM(100, AR5K_QUIET_CTL2_QT_PER)| AR5K_REG_SM(100, AR5K_QUIET_CTL2_QT_PER)|
......
...@@ -255,7 +255,7 @@ static int ath5k_eeprom_read_modes(struct ath5k_hw *ah, u32 *offset, ...@@ -255,7 +255,7 @@ static int ath5k_eeprom_read_modes(struct ath5k_hw *ah, u32 *offset,
ee->ee_n_piers[mode] = 0; ee->ee_n_piers[mode] = 0;
AR5K_EEPROM_READ(o++, val); AR5K_EEPROM_READ(o++, val);
ee->ee_adc_desired_size[mode] = (s8)((val >> 8) & 0xff); ee->ee_adc_desired_size[mode] = (s8)((val >> 8) & 0xff);
switch(mode) { switch (mode) {
case AR5K_EEPROM_MODE_11A: case AR5K_EEPROM_MODE_11A:
ee->ee_ob[mode][3] = (val >> 5) & 0x7; ee->ee_ob[mode][3] = (val >> 5) & 0x7;
ee->ee_db[mode][3] = (val >> 2) & 0x7; ee->ee_db[mode][3] = (val >> 2) & 0x7;
...@@ -349,7 +349,7 @@ static int ath5k_eeprom_read_modes(struct ath5k_hw *ah, u32 *offset, ...@@ -349,7 +349,7 @@ static int ath5k_eeprom_read_modes(struct ath5k_hw *ah, u32 *offset,
/* Note: >= v5 have bg freq piers on another location /* Note: >= v5 have bg freq piers on another location
* so these freq piers are ignored for >= v5 (should be 0xff * so these freq piers are ignored for >= v5 (should be 0xff
* anyway) */ * anyway) */
switch(mode) { switch (mode) {
case AR5K_EEPROM_MODE_11A: case AR5K_EEPROM_MODE_11A:
if (ah->ah_ee_version < AR5K_EEPROM_VERSION_4_1) if (ah->ah_ee_version < AR5K_EEPROM_VERSION_4_1)
break; break;
...@@ -422,7 +422,7 @@ static int ath5k_eeprom_read_modes(struct ath5k_hw *ah, u32 *offset, ...@@ -422,7 +422,7 @@ static int ath5k_eeprom_read_modes(struct ath5k_hw *ah, u32 *offset,
if (ee->ee_version < AR5K_EEPROM_VERSION_5_0) if (ee->ee_version < AR5K_EEPROM_VERSION_5_0)
goto done; goto done;
switch (mode){ switch (mode) {
case AR5K_EEPROM_MODE_11A: case AR5K_EEPROM_MODE_11A:
ee->ee_switch_settling_turbo[mode] = (val >> 6) & 0x7f; ee->ee_switch_settling_turbo[mode] = (val >> 6) & 0x7f;
...@@ -436,7 +436,7 @@ static int ath5k_eeprom_read_modes(struct ath5k_hw *ah, u32 *offset, ...@@ -436,7 +436,7 @@ static int ath5k_eeprom_read_modes(struct ath5k_hw *ah, u32 *offset,
ee->ee_adc_desired_size_turbo[mode] |= (val & 0x1) << 7; ee->ee_adc_desired_size_turbo[mode] |= (val & 0x1) << 7;
ee->ee_pga_desired_size_turbo[mode] = (val >> 1) & 0xff; ee->ee_pga_desired_size_turbo[mode] = (val >> 1) & 0xff;
if (AR5K_EEPROM_EEMAP(ee->ee_misc0) >=2) if (AR5K_EEPROM_EEMAP(ee->ee_misc0) >= 2)
ee->ee_pd_gain_overlap = (val >> 9) & 0xf; ee->ee_pd_gain_overlap = (val >> 9) & 0xf;
break; break;
case AR5K_EEPROM_MODE_11G: case AR5K_EEPROM_MODE_11G:
...@@ -516,7 +516,7 @@ ath5k_eeprom_read_freq_list(struct ath5k_hw *ah, int *offset, int max, ...@@ -516,7 +516,7 @@ ath5k_eeprom_read_freq_list(struct ath5k_hw *ah, int *offset, int max,
u16 val; u16 val;
ee->ee_n_piers[mode] = 0; ee->ee_n_piers[mode] = 0;
while(i < max) { while (i < max) {
AR5K_EEPROM_READ(o++, val); AR5K_EEPROM_READ(o++, val);
freq1 = val & 0xff; freq1 = val & 0xff;
...@@ -602,7 +602,7 @@ ath5k_eeprom_init_11bg_2413(struct ath5k_hw *ah, unsigned int mode, int offset) ...@@ -602,7 +602,7 @@ ath5k_eeprom_init_11bg_2413(struct ath5k_hw *ah, unsigned int mode, int offset)
struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
struct ath5k_chan_pcal_info *pcal; struct ath5k_chan_pcal_info *pcal;
switch(mode) { switch (mode) {
case AR5K_EEPROM_MODE_11B: case AR5K_EEPROM_MODE_11B:
pcal = ee->ee_pwr_cal_b; pcal = ee->ee_pwr_cal_b;
break; break;
...@@ -800,7 +800,7 @@ ath5k_eeprom_read_pcal_info_5111(struct ath5k_hw *ah, int mode) ...@@ -800,7 +800,7 @@ ath5k_eeprom_read_pcal_info_5111(struct ath5k_hw *ah, int mode)
u16 val; u16 val;
offset = AR5K_EEPROM_GROUPS_START(ee->ee_version); offset = AR5K_EEPROM_GROUPS_START(ee->ee_version);
switch(mode) { switch (mode) {
case AR5K_EEPROM_MODE_11A: case AR5K_EEPROM_MODE_11A:
if (!AR5K_EEPROM_HDR_11A(ee->ee_header)) if (!AR5K_EEPROM_HDR_11A(ee->ee_header))
return 0; return 0;
...@@ -1167,7 +1167,7 @@ ath5k_cal_data_offset_2413(struct ath5k_eeprom_info *ee, int mode) ...@@ -1167,7 +1167,7 @@ ath5k_cal_data_offset_2413(struct ath5k_eeprom_info *ee, int mode)
{ {
u32 offset = AR5K_EEPROM_CAL_DATA_START(ee->ee_misc4); u32 offset = AR5K_EEPROM_CAL_DATA_START(ee->ee_misc4);
switch(mode) { switch (mode) {
case AR5K_EEPROM_MODE_11G: case AR5K_EEPROM_MODE_11G:
if (AR5K_EEPROM_HDR_11B(ee->ee_header)) if (AR5K_EEPROM_HDR_11B(ee->ee_header))
offset += ath5k_pdgains_size_2413(ee, offset += ath5k_pdgains_size_2413(ee,
...@@ -1624,8 +1624,8 @@ ath5k_eeprom_read_ctl_info(struct ath5k_hw *ah) ...@@ -1624,8 +1624,8 @@ ath5k_eeprom_read_ctl_info(struct ath5k_hw *ah)
offset += AR5K_EEPROM_GROUPS_START(ee->ee_version); offset += AR5K_EEPROM_GROUPS_START(ee->ee_version);
rep = ee->ee_ctl_pwr; rep = ee->ee_ctl_pwr;
for(i = 0; i < ee->ee_ctls; i++) { for (i = 0; i < ee->ee_ctls; i++) {
switch(ee->ee_ctl[i] & AR5K_CTL_MODE_M) { switch (ee->ee_ctl[i] & AR5K_CTL_MODE_M) {
case AR5K_CTL_11A: case AR5K_CTL_11A:
case AR5K_CTL_TURBO: case AR5K_CTL_TURBO:
ctl_mode = AR5K_EEPROM_MODE_11A; ctl_mode = AR5K_EEPROM_MODE_11A;
......
...@@ -223,7 +223,7 @@ ...@@ -223,7 +223,7 @@
#define AR5K_EEPROM_CCK_OFDM_DELTA 15 #define AR5K_EEPROM_CCK_OFDM_DELTA 15
#define AR5K_EEPROM_N_IQ_CAL 2 #define AR5K_EEPROM_N_IQ_CAL 2
/* 5GHz/2GHz */ /* 5GHz/2GHz */
enum ath5k_eeprom_freq_bands{ enum ath5k_eeprom_freq_bands {
AR5K_EEPROM_BAND_5GHZ = 0, AR5K_EEPROM_BAND_5GHZ = 0,
AR5K_EEPROM_BAND_2GHZ = 1, AR5K_EEPROM_BAND_2GHZ = 1,
AR5K_EEPROM_N_FREQ_BANDS, AR5K_EEPROM_N_FREQ_BANDS,
......
...@@ -43,11 +43,11 @@ ...@@ -43,11 +43,11 @@
#include "ath5k.h" #include "ath5k.h"
#include "base.h" #include "base.h"
#define ATH_SDEVICE(subv,subd) \ #define ATH_SDEVICE(subv, subd) \
.vendor = PCI_ANY_ID, .device = PCI_ANY_ID, \ .vendor = PCI_ANY_ID, .device = PCI_ANY_ID, \
.subvendor = (subv), .subdevice = (subd) .subvendor = (subv), .subdevice = (subd)
#define ATH_LED(pin,polarity) .driver_data = (((pin) << 8) | (polarity)) #define ATH_LED(pin, polarity) .driver_data = (((pin) << 8) | (polarity))
#define ATH_PIN(data) ((data) >> 8) #define ATH_PIN(data) ((data) >> 8)
#define ATH_POLARITY(data) ((data) & 0xff) #define ATH_POLARITY(data) ((data) & 0xff)
......
...@@ -234,7 +234,7 @@ ath5k_pci_probe(struct pci_dev *pdev, ...@@ -234,7 +234,7 @@ ath5k_pci_probe(struct pci_dev *pdev,
mem = pci_iomap(pdev, 0, 0); mem = pci_iomap(pdev, 0, 0);
if (!mem) { if (!mem) {
dev_err(&pdev->dev, "cannot remap PCI memory region\n") ; dev_err(&pdev->dev, "cannot remap PCI memory region\n");
ret = -EIO; ret = -EIO;
goto err_reg; goto err_reg;
} }
......
...@@ -534,7 +534,7 @@ u64 ath5k_hw_get_tsf64(struct ath5k_hw *ah) ...@@ -534,7 +534,7 @@ u64 ath5k_hw_get_tsf64(struct ath5k_hw *ah)
local_irq_restore(flags); local_irq_restore(flags);
WARN_ON( i == ATH5K_MAX_TSF_READ ); WARN_ON(i == ATH5K_MAX_TSF_READ);
return ((u64)tsf_upper1 << 32) | tsf_lower; return ((u64)tsf_upper1 << 32) | tsf_lower;
} }
......
...@@ -472,7 +472,7 @@ static bool ath5k_hw_rf_check_gainf_readback(struct ath5k_hw *ah) ...@@ -472,7 +472,7 @@ static bool ath5k_hw_rf_check_gainf_readback(struct ath5k_hw *ah)
level[0] = 0; level[0] = 0;
level[1] = (step == 63) ? 50 : step + 4; level[1] = (step == 63) ? 50 : step + 4;
level[2] = (step != 63) ? 64 : level[0]; level[2] = (step != 63) ? 64 : level[0];
level[3] = level[2] + 50 ; level[3] = level[2] + 50;
ah->ah_gain.g_high = level[3] - ah->ah_gain.g_high = level[3] -
(step == 63 ? AR5K_GAIN_DYN_ADJUST_HI_MARGIN : -5); (step == 63 ? AR5K_GAIN_DYN_ADJUST_HI_MARGIN : -5);
...@@ -549,7 +549,7 @@ static s8 ath5k_hw_rf_gainf_adjust(struct ath5k_hw *ah) ...@@ -549,7 +549,7 @@ static s8 ath5k_hw_rf_gainf_adjust(struct ath5k_hw *ah)
for (ah->ah_gain.g_target = ah->ah_gain.g_current; for (ah->ah_gain.g_target = ah->ah_gain.g_current;
ah->ah_gain.g_target <= ah->ah_gain.g_low && ah->ah_gain.g_target <= ah->ah_gain.g_low &&
ah->ah_gain.g_step_idx < go->go_steps_count-1; ah->ah_gain.g_step_idx < go->go_steps_count - 1;
g_step = &go->go_step[ah->ah_gain.g_step_idx]) g_step = &go->go_step[ah->ah_gain.g_step_idx])
ah->ah_gain.g_target -= 2 * ah->ah_gain.g_target -= 2 *
(go->go_step[++ah->ah_gain.g_step_idx].gos_gain - (go->go_step[++ah->ah_gain.g_step_idx].gos_gain -
...@@ -614,7 +614,7 @@ enum ath5k_rfgain ath5k_hw_gainf_calibrate(struct ath5k_hw *ah) ...@@ -614,7 +614,7 @@ enum ath5k_rfgain ath5k_hw_gainf_calibrate(struct ath5k_hw *ah)
ath5k_hw_rf_gainf_corr(ah); ath5k_hw_rf_gainf_corr(ah);
ah->ah_gain.g_current = ah->ah_gain.g_current =
ah->ah_gain.g_current >= ah->ah_gain.g_f_corr ? ah->ah_gain.g_current >= ah->ah_gain.g_f_corr ?
(ah->ah_gain.g_current-ah->ah_gain.g_f_corr) : (ah->ah_gain.g_current - ah->ah_gain.g_f_corr) :
0; 0;
} }
...@@ -1331,7 +1331,7 @@ void ath5k_hw_init_nfcal_hist(struct ath5k_hw *ah) ...@@ -1331,7 +1331,7 @@ void ath5k_hw_init_nfcal_hist(struct ath5k_hw *ah)
static void ath5k_hw_update_nfcal_hist(struct ath5k_hw *ah, s16 noise_floor) static void ath5k_hw_update_nfcal_hist(struct ath5k_hw *ah, s16 noise_floor)
{ {
struct ath5k_nfcal_hist *hist = &ah->ah_nfcal_hist; struct ath5k_nfcal_hist *hist = &ah->ah_nfcal_hist;
hist->index = (hist->index + 1) & (ATH5K_NF_CAL_HIST_MAX-1); hist->index = (hist->index + 1) & (ATH5K_NF_CAL_HIST_MAX - 1);
hist->nfval[hist->index] = noise_floor; hist->nfval[hist->index] = noise_floor;
} }
...@@ -1344,10 +1344,10 @@ static s16 ath5k_hw_get_median_noise_floor(struct ath5k_hw *ah) ...@@ -1344,10 +1344,10 @@ static s16 ath5k_hw_get_median_noise_floor(struct ath5k_hw *ah)
memcpy(sort, ah->ah_nfcal_hist.nfval, sizeof(sort)); memcpy(sort, ah->ah_nfcal_hist.nfval, sizeof(sort));
for (i = 0; i < ATH5K_NF_CAL_HIST_MAX - 1; i++) { for (i = 0; i < ATH5K_NF_CAL_HIST_MAX - 1; i++) {
for (j = 1; j < ATH5K_NF_CAL_HIST_MAX - i; j++) { for (j = 1; j < ATH5K_NF_CAL_HIST_MAX - i; j++) {
if (sort[j] > sort[j-1]) { if (sort[j] > sort[j - 1]) {
tmp = sort[j]; tmp = sort[j];
sort[j] = sort[j-1]; sort[j] = sort[j - 1];
sort[j-1] = tmp; sort[j - 1] = tmp;
} }
} }
} }
...@@ -1355,7 +1355,7 @@ static s16 ath5k_hw_get_median_noise_floor(struct ath5k_hw *ah) ...@@ -1355,7 +1355,7 @@ static s16 ath5k_hw_get_median_noise_floor(struct ath5k_hw *ah)
ATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_CALIBRATE, ATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_CALIBRATE,
"cal %d:%d\n", i, sort[i]); "cal %d:%d\n", i, sort[i]);
} }
return sort[(ATH5K_NF_CAL_HIST_MAX-1) / 2]; return sort[(ATH5K_NF_CAL_HIST_MAX - 1) / 2];
} }
/* /*
...@@ -2080,7 +2080,7 @@ ath5k_get_interpolated_value(s16 target, s16 x_left, s16 x_right, ...@@ -2080,7 +2080,7 @@ ath5k_get_interpolated_value(s16 target, s16 x_left, s16 x_right,
* always 1 instead of 1.25, 1.75 etc). We scale up by 100 * always 1 instead of 1.25, 1.75 etc). We scale up by 100
* to have some accuracy both for 0.5 and 0.25 steps. * to have some accuracy both for 0.5 and 0.25 steps.
*/ */
ratio = ((100 * y_right - 100 * y_left)/(x_right - x_left)); ratio = ((100 * y_right - 100 * y_left) / (x_right - x_left));
/* Now scale down to be in range */ /* Now scale down to be in range */
result = y_left + (ratio * (target - x_left) / 100); result = y_left + (ratio * (target - x_left) / 100);
...@@ -2159,7 +2159,7 @@ ath5k_create_power_curve(s16 pmin, s16 pmax, ...@@ -2159,7 +2159,7 @@ ath5k_create_power_curve(s16 pmin, s16 pmax,
u8 *vpd_table, u8 type) u8 *vpd_table, u8 type)
{ {
u8 idx[2] = { 0, 1 }; u8 idx[2] = { 0, 1 };
s16 pwr_i = 2*pmin; s16 pwr_i = 2 * pmin;
int i; int i;
if (num_points < 2) if (num_points < 2)
...@@ -2437,7 +2437,7 @@ ath5k_get_max_ctl_power(struct ath5k_hw *ah, ...@@ -2437,7 +2437,7 @@ ath5k_get_max_ctl_power(struct ath5k_hw *ah,
} }
if (edge_pwr) if (edge_pwr)
ah->ah_txpower.txp_max_pwr = 4*min(edge_pwr, max_chan_pwr); ah->ah_txpower.txp_max_pwr = 4 * min(edge_pwr, max_chan_pwr);
} }
...@@ -2475,7 +2475,7 @@ ath5k_fill_pwr_to_pcdac_table(struct ath5k_hw *ah, s16* table_min, ...@@ -2475,7 +2475,7 @@ ath5k_fill_pwr_to_pcdac_table(struct ath5k_hw *ah, s16* table_min,
/* Copy values from pcdac_tmp */ /* Copy values from pcdac_tmp */
pwr_idx = min_pwr; pwr_idx = min_pwr;
for (i = 0 ; pwr_idx <= max_pwr && for (i = 0; pwr_idx <= max_pwr &&
pcdac_i < AR5K_EEPROM_POWER_TABLE_SIZE; i++) { pcdac_i < AR5K_EEPROM_POWER_TABLE_SIZE; i++) {
pcdac_out[pcdac_i++] = pcdac_tmp[i]; pcdac_out[pcdac_i++] = pcdac_tmp[i];
pwr_idx++; pwr_idx++;
...@@ -2552,7 +2552,7 @@ ath5k_combine_linear_pcdac_curves(struct ath5k_hw *ah, s16* table_min, ...@@ -2552,7 +2552,7 @@ ath5k_combine_linear_pcdac_curves(struct ath5k_hw *ah, s16* table_min,
} }
/* This is used when setting tx power*/ /* This is used when setting tx power*/
ah->ah_txpower.txp_min_idx = min_pwr_idx/2; ah->ah_txpower.txp_min_idx = min_pwr_idx / 2;
/* Fill Power to PCDAC table backwards */ /* Fill Power to PCDAC table backwards */
pwr = max_pwr_idx; pwr = max_pwr_idx;
...@@ -2561,10 +2561,10 @@ ath5k_combine_linear_pcdac_curves(struct ath5k_hw *ah, s16* table_min, ...@@ -2561,10 +2561,10 @@ ath5k_combine_linear_pcdac_curves(struct ath5k_hw *ah, s16* table_min,
* edge flag and set pcdac_tmp to lower * edge flag and set pcdac_tmp to lower
* power curve.*/ * power curve.*/
if (edge_flag == 0x40 && if (edge_flag == 0x40 &&
(2*pwr <= (table_max[1] - table_min[0]) || pwr == 0)) { (2 * pwr <= (table_max[1] - table_min[0]) || pwr == 0)) {
edge_flag = 0x00; edge_flag = 0x00;
pcdac_tmp = pcdac_low_pwr; pcdac_tmp = pcdac_low_pwr;
pwr = mid_pwr_idx/2; pwr = mid_pwr_idx / 2;
} }
/* Don't go below 1, extrapolate below if we have /* Don't go below 1, extrapolate below if we have
...@@ -2604,8 +2604,8 @@ ath5k_write_pcdac_table(struct ath5k_hw *ah) ...@@ -2604,8 +2604,8 @@ ath5k_write_pcdac_table(struct ath5k_hw *ah)
*/ */
for (i = 0; i < (AR5K_EEPROM_POWER_TABLE_SIZE / 2); i++) { for (i = 0; i < (AR5K_EEPROM_POWER_TABLE_SIZE / 2); i++) {
ath5k_hw_reg_write(ah, ath5k_hw_reg_write(ah,
(((pcdac_out[2*i + 0] << 8 | 0xff) & 0xffff) << 0) | (((pcdac_out[2 * i + 0] << 8 | 0xff) & 0xffff) << 0) |
(((pcdac_out[2*i + 1] << 8 | 0xff) & 0xffff) << 16), (((pcdac_out[2 * i + 1] << 8 | 0xff) & 0xffff) << 16),
AR5K_PHY_PCDAC_TXPOWER(i)); AR5K_PHY_PCDAC_TXPOWER(i));
} }
} }
...@@ -2789,10 +2789,10 @@ ath5k_write_pwr_to_pdadc_table(struct ath5k_hw *ah, u8 ee_mode) ...@@ -2789,10 +2789,10 @@ ath5k_write_pwr_to_pdadc_table(struct ath5k_hw *ah, u8 ee_mode)
*/ */
for (i = 0; i < (AR5K_EEPROM_POWER_TABLE_SIZE / 2); i++) { for (i = 0; i < (AR5K_EEPROM_POWER_TABLE_SIZE / 2); i++) {
ath5k_hw_reg_write(ah, ath5k_hw_reg_write(ah,
((pdadc_out[4*i + 0] & 0xff) << 0) | ((pdadc_out[4 * i + 0] & 0xff) << 0) |
((pdadc_out[4*i + 1] & 0xff) << 8) | ((pdadc_out[4 * i + 1] & 0xff) << 8) |
((pdadc_out[4*i + 2] & 0xff) << 16) | ((pdadc_out[4 * i + 2] & 0xff) << 16) |
((pdadc_out[4*i + 3] & 0xff) << 24), ((pdadc_out[4 * i + 3] & 0xff) << 24),
AR5K_PHY_PDADC_TXPOWER(i)); AR5K_PHY_PDADC_TXPOWER(i));
} }
} }
......
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