mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
This commit is contained in:
@@ -50,7 +50,6 @@ obj-$(CONFIG_ATH_COMMON) += ath/
|
||||
obj-$(CONFIG_MAC80211_HWSIM) += mac80211_hwsim.o
|
||||
|
||||
obj-$(CONFIG_WL12XX) += wl12xx/
|
||||
# small builtin driver bit
|
||||
obj-$(CONFIG_WL12XX_PLATFORM_DATA) += wl12xx/wl12xx_platform_data.o
|
||||
obj-$(CONFIG_WL12XX_PLATFORM_DATA) += wl12xx/
|
||||
|
||||
obj-$(CONFIG_IWM) += iwmc3200wifi/
|
||||
|
||||
@@ -217,7 +217,6 @@ static const char *statsLabels[] = {
|
||||
(no spaces) list of rates (up to 8). */
|
||||
|
||||
static int rates[8];
|
||||
static int basic_rate;
|
||||
static char *ssids[3];
|
||||
|
||||
static int io[4];
|
||||
@@ -250,7 +249,6 @@ MODULE_LICENSE("Dual BSD/GPL");
|
||||
MODULE_SUPPORTED_DEVICE("Aironet 4500, 4800 and Cisco 340/350");
|
||||
module_param_array(io, int, NULL, 0);
|
||||
module_param_array(irq, int, NULL, 0);
|
||||
module_param(basic_rate, int, 0);
|
||||
module_param_array(rates, int, NULL, 0);
|
||||
module_param_array(ssids, charp, NULL, 0);
|
||||
module_param(auto_wep, int, 0);
|
||||
@@ -3883,15 +3881,6 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock)
|
||||
ai->config.rates[i] = rates[i];
|
||||
}
|
||||
}
|
||||
if ( basic_rate > 0 ) {
|
||||
for( i = 0; i < 8; i++ ) {
|
||||
if ( ai->config.rates[i] == basic_rate ||
|
||||
!ai->config.rates ) {
|
||||
ai->config.rates[i] = basic_rate | 0x80;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
set_bit (FLAG_COMMIT, &ai->flags);
|
||||
}
|
||||
|
||||
|
||||
@@ -1041,7 +1041,6 @@ struct ath5k_hw {
|
||||
#define ah_modes ah_capabilities.cap_mode
|
||||
#define ah_ee_version ah_capabilities.cap_eeprom.ee_version
|
||||
|
||||
u32 ah_atim_window;
|
||||
u32 ah_limit_tx_retries;
|
||||
u8 ah_coverage_class;
|
||||
|
||||
@@ -1196,6 +1195,7 @@ u64 ath5k_hw_get_tsf64(struct ath5k_hw *ah);
|
||||
void ath5k_hw_set_tsf64(struct ath5k_hw *ah, u64 tsf64);
|
||||
void ath5k_hw_reset_tsf(struct ath5k_hw *ah);
|
||||
void ath5k_hw_init_beacon(struct ath5k_hw *ah, u32 next_beacon, u32 interval);
|
||||
bool ath5k_hw_check_beacon_timers(struct ath5k_hw *ah, int intval);
|
||||
/* ACK bit rate */
|
||||
void ath5k_hw_set_ack_bitrate_high(struct ath5k_hw *ah, bool high);
|
||||
/* Clock rate related functions */
|
||||
|
||||
@@ -118,7 +118,6 @@ int ath5k_hw_attach(struct ath5k_softc *sc)
|
||||
ah->ah_turbo = false;
|
||||
ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER;
|
||||
ah->ah_imr = 0;
|
||||
ah->ah_atim_window = 0;
|
||||
ah->ah_limit_tx_retries = AR5K_INIT_TX_RETRY;
|
||||
ah->ah_software_retry = false;
|
||||
ah->ah_ant_mode = AR5K_ANTMODE_DEFAULT;
|
||||
|
||||
@@ -1191,6 +1191,15 @@ ath5k_check_ibss_tsf(struct ath5k_softc *sc, struct sk_buff *skb,
|
||||
*/
|
||||
if (hw_tu >= sc->nexttbtt)
|
||||
ath5k_beacon_update_timers(sc, bc_tstamp);
|
||||
|
||||
/* Check if the beacon timers are still correct, because a TSF
|
||||
* update might have created a window between them - for a
|
||||
* longer description see the comment of this function: */
|
||||
if (!ath5k_hw_check_beacon_timers(sc->ah, sc->bintval)) {
|
||||
ath5k_beacon_update_timers(sc, bc_tstamp);
|
||||
ATH5K_DBG_UNLIMIT(sc, ATH5K_DEBUG_BEACON,
|
||||
"fixed beacon timers after beacon receive\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1877,8 +1886,11 @@ ath5k_beacon_update_timers(struct ath5k_softc *sc, u64 bc_tsf)
|
||||
hw_tsf = ath5k_hw_get_tsf64(ah);
|
||||
hw_tu = TSF_TO_TU(hw_tsf);
|
||||
|
||||
#define FUDGE 3
|
||||
/* we use FUDGE to make sure the next TBTT is ahead of the current TU */
|
||||
#define FUDGE AR5K_TUNE_SW_BEACON_RESP + 3
|
||||
/* We use FUDGE to make sure the next TBTT is ahead of the current TU.
|
||||
* Since we later substract AR5K_TUNE_SW_BEACON_RESP (10) in the timer
|
||||
* configuration we need to make sure it is bigger than that. */
|
||||
|
||||
if (bc_tsf == -1) {
|
||||
/*
|
||||
* no beacons received, called internally.
|
||||
|
||||
@@ -483,6 +483,59 @@ static const struct file_operations fops_antenna = {
|
||||
.owner = THIS_MODULE,
|
||||
};
|
||||
|
||||
/* debugfs: misc */
|
||||
|
||||
static ssize_t read_file_misc(struct file *file, char __user *user_buf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
struct ath5k_softc *sc = file->private_data;
|
||||
char buf[700];
|
||||
unsigned int len = 0;
|
||||
u32 filt = ath5k_hw_get_rx_filter(sc->ah);
|
||||
|
||||
len += snprintf(buf+len, sizeof(buf)-len, "bssid-mask: %pM\n",
|
||||
sc->bssidmask);
|
||||
len += snprintf(buf+len, sizeof(buf)-len, "filter-flags: 0x%x ",
|
||||
filt);
|
||||
if (filt & AR5K_RX_FILTER_UCAST)
|
||||
len += snprintf(buf+len, sizeof(buf)-len, " UCAST");
|
||||
if (filt & AR5K_RX_FILTER_MCAST)
|
||||
len += snprintf(buf+len, sizeof(buf)-len, " MCAST");
|
||||
if (filt & AR5K_RX_FILTER_BCAST)
|
||||
len += snprintf(buf+len, sizeof(buf)-len, " BCAST");
|
||||
if (filt & AR5K_RX_FILTER_CONTROL)
|
||||
len += snprintf(buf+len, sizeof(buf)-len, " CONTROL");
|
||||
if (filt & AR5K_RX_FILTER_BEACON)
|
||||
len += snprintf(buf+len, sizeof(buf)-len, " BEACON");
|
||||
if (filt & AR5K_RX_FILTER_PROM)
|
||||
len += snprintf(buf+len, sizeof(buf)-len, " PROM");
|
||||
if (filt & AR5K_RX_FILTER_XRPOLL)
|
||||
len += snprintf(buf+len, sizeof(buf)-len, " XRPOLL");
|
||||
if (filt & AR5K_RX_FILTER_PROBEREQ)
|
||||
len += snprintf(buf+len, sizeof(buf)-len, " PROBEREQ");
|
||||
if (filt & AR5K_RX_FILTER_PHYERR_5212)
|
||||
len += snprintf(buf+len, sizeof(buf)-len, " PHYERR-5212");
|
||||
if (filt & AR5K_RX_FILTER_RADARERR_5212)
|
||||
len += snprintf(buf+len, sizeof(buf)-len, " RADARERR-5212");
|
||||
if (filt & AR5K_RX_FILTER_PHYERR_5211)
|
||||
snprintf(buf+len, sizeof(buf)-len, " PHYERR-5211");
|
||||
if (filt & AR5K_RX_FILTER_RADARERR_5211)
|
||||
len += snprintf(buf+len, sizeof(buf)-len, " RADARERR-5211\n");
|
||||
else
|
||||
len += snprintf(buf+len, sizeof(buf)-len, "\n");
|
||||
|
||||
if (len > sizeof(buf))
|
||||
len = sizeof(buf);
|
||||
|
||||
return simple_read_from_buffer(user_buf, count, ppos, buf, len);
|
||||
}
|
||||
|
||||
static const struct file_operations fops_misc = {
|
||||
.read = read_file_misc,
|
||||
.open = ath5k_debugfs_open,
|
||||
.owner = THIS_MODULE,
|
||||
};
|
||||
|
||||
|
||||
/* debugfs: frameerrors */
|
||||
|
||||
@@ -856,6 +909,10 @@ ath5k_debug_init_device(struct ath5k_softc *sc)
|
||||
S_IWUSR | S_IRUSR,
|
||||
sc->debug.debugfs_phydir, sc, &fops_antenna);
|
||||
|
||||
sc->debug.debugfs_misc = debugfs_create_file("misc",
|
||||
S_IRUSR,
|
||||
sc->debug.debugfs_phydir, sc, &fops_misc);
|
||||
|
||||
sc->debug.debugfs_frameerrors = debugfs_create_file("frameerrors",
|
||||
S_IWUSR | S_IRUSR,
|
||||
sc->debug.debugfs_phydir, sc,
|
||||
@@ -886,6 +943,7 @@ ath5k_debug_finish_device(struct ath5k_softc *sc)
|
||||
debugfs_remove(sc->debug.debugfs_beacon);
|
||||
debugfs_remove(sc->debug.debugfs_reset);
|
||||
debugfs_remove(sc->debug.debugfs_antenna);
|
||||
debugfs_remove(sc->debug.debugfs_misc);
|
||||
debugfs_remove(sc->debug.debugfs_frameerrors);
|
||||
debugfs_remove(sc->debug.debugfs_ani);
|
||||
debugfs_remove(sc->debug.debugfs_queue);
|
||||
|
||||
@@ -75,6 +75,7 @@ struct ath5k_dbg_info {
|
||||
struct dentry *debugfs_beacon;
|
||||
struct dentry *debugfs_reset;
|
||||
struct dentry *debugfs_antenna;
|
||||
struct dentry *debugfs_misc;
|
||||
struct dentry *debugfs_frameerrors;
|
||||
struct dentry *debugfs_ani;
|
||||
struct dentry *debugfs_queue;
|
||||
|
||||
@@ -244,7 +244,7 @@ int ath5k_hw_stop_tx_dma(struct ath5k_hw *ah, unsigned int queue)
|
||||
|
||||
/* Force channel idle high */
|
||||
AR5K_REG_ENABLE_BITS(ah, AR5K_DIAG_SW_5211,
|
||||
AR5K_DIAG_SW_CHANEL_IDLE_HIGH);
|
||||
AR5K_DIAG_SW_CHANNEL_IDLE_HIGH);
|
||||
|
||||
/* Wait a while and disable mechanism */
|
||||
udelay(200);
|
||||
@@ -261,7 +261,7 @@ int ath5k_hw_stop_tx_dma(struct ath5k_hw *ah, unsigned int queue)
|
||||
} while (--i && pending);
|
||||
|
||||
AR5K_REG_DISABLE_BITS(ah, AR5K_DIAG_SW_5211,
|
||||
AR5K_DIAG_SW_CHANEL_IDLE_HIGH);
|
||||
AR5K_DIAG_SW_CHANNEL_IDLE_HIGH);
|
||||
}
|
||||
|
||||
/* Clear register */
|
||||
|
||||
@@ -495,6 +495,10 @@ u64 ath5k_hw_get_tsf64(struct ath5k_hw *ah)
|
||||
{
|
||||
u32 tsf_lower, tsf_upper1, tsf_upper2;
|
||||
int i;
|
||||
unsigned long flags;
|
||||
|
||||
/* This code is time critical - we don't want to be interrupted here */
|
||||
local_irq_save(flags);
|
||||
|
||||
/*
|
||||
* While reading TSF upper and then lower part, the clock is still
|
||||
@@ -517,6 +521,8 @@ u64 ath5k_hw_get_tsf64(struct ath5k_hw *ah)
|
||||
tsf_upper1 = tsf_upper2;
|
||||
}
|
||||
|
||||
local_irq_restore(flags);
|
||||
|
||||
WARN_ON( i == ATH5K_MAX_TSF_READ );
|
||||
|
||||
return (((u64)tsf_upper1 << 32) | tsf_lower);
|
||||
@@ -600,7 +606,7 @@ void ath5k_hw_init_beacon(struct ath5k_hw *ah, u32 next_beacon, u32 interval)
|
||||
/* Timer3 marks the end of our ATIM window
|
||||
* a zero length window is not allowed because
|
||||
* we 'll get no beacons */
|
||||
timer3 = next_beacon + (ah->ah_atim_window ? ah->ah_atim_window : 1);
|
||||
timer3 = next_beacon + 1;
|
||||
|
||||
/*
|
||||
* Set the beacon register and enable all timers.
|
||||
@@ -640,6 +646,97 @@ void ath5k_hw_init_beacon(struct ath5k_hw *ah, u32 next_beacon, u32 interval)
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* ath5k_check_timer_win - Check if timer B is timer A + window
|
||||
*
|
||||
* @a: timer a (before b)
|
||||
* @b: timer b (after a)
|
||||
* @window: difference between a and b
|
||||
* @intval: timers are increased by this interval
|
||||
*
|
||||
* This helper function checks if timer B is timer A + window and covers
|
||||
* cases where timer A or B might have already been updated or wrapped
|
||||
* around (Timers are 16 bit).
|
||||
*
|
||||
* Returns true if O.K.
|
||||
*/
|
||||
static inline bool
|
||||
ath5k_check_timer_win(int a, int b, int window, int intval)
|
||||
{
|
||||
/*
|
||||
* 1.) usually B should be A + window
|
||||
* 2.) A already updated, B not updated yet
|
||||
* 3.) A already updated and has wrapped around
|
||||
* 4.) B has wrapped around
|
||||
*/
|
||||
if ((b - a == window) || /* 1.) */
|
||||
(a - b == intval - window) || /* 2.) */
|
||||
((a | 0x10000) - b == intval - window) || /* 3.) */
|
||||
((b | 0x10000) - a == window)) /* 4.) */
|
||||
return true; /* O.K. */
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* ath5k_hw_check_beacon_timers - Check if the beacon timers are correct
|
||||
*
|
||||
* @ah: The &struct ath5k_hw
|
||||
* @intval: beacon interval
|
||||
*
|
||||
* This is a workaround for IBSS mode:
|
||||
*
|
||||
* The need for this function arises from the fact that we have 4 separate
|
||||
* HW timer registers (TIMER0 - TIMER3), which are closely related to the
|
||||
* next beacon target time (NBTT), and that the HW updates these timers
|
||||
* seperately based on the current TSF value. The hardware increments each
|
||||
* timer by the beacon interval, when the local TSF coverted to TU is equal
|
||||
* to the value stored in the timer.
|
||||
*
|
||||
* The reception of a beacon with the same BSSID can update the local HW TSF
|
||||
* at any time - this is something we can't avoid. If the TSF jumps to a
|
||||
* time which is later than the time stored in a timer, this timer will not
|
||||
* be updated until the TSF in TU wraps around at 16 bit (the size of the
|
||||
* timers) and reaches the time which is stored in the timer.
|
||||
*
|
||||
* The problem is that these timers are closely related to TIMER0 (NBTT) and
|
||||
* that they define a time "window". When the TSF jumps between two timers
|
||||
* (e.g. ATIM and NBTT), the one in the past will be left behind (not
|
||||
* updated), while the one in the future will be updated every beacon
|
||||
* interval. This causes the window to get larger, until the TSF wraps
|
||||
* around as described above and the timer which was left behind gets
|
||||
* updated again. But - because the beacon interval is usually not an exact
|
||||
* divisor of the size of the timers (16 bit), an unwanted "window" between
|
||||
* these timers has developed!
|
||||
*
|
||||
* This is especially important with the ATIM window, because during
|
||||
* the ATIM window only ATIM frames and no data frames are allowed to be
|
||||
* sent, which creates transmission pauses after each beacon. This symptom
|
||||
* has been described as "ramping ping" because ping times increase linearly
|
||||
* for some time and then drop down again. A wrong window on the DMA beacon
|
||||
* timer has the same effect, so we check for these two conditions.
|
||||
*
|
||||
* Returns true if O.K.
|
||||
*/
|
||||
bool
|
||||
ath5k_hw_check_beacon_timers(struct ath5k_hw *ah, int intval)
|
||||
{
|
||||
unsigned int nbtt, atim, dma;
|
||||
|
||||
nbtt = ath5k_hw_reg_read(ah, AR5K_TIMER0);
|
||||
atim = ath5k_hw_reg_read(ah, AR5K_TIMER3);
|
||||
dma = ath5k_hw_reg_read(ah, AR5K_TIMER1) >> 3;
|
||||
|
||||
/* NOTE: SWBA is different. Having a wrong window there does not
|
||||
* stop us from sending data and this condition is catched thru
|
||||
* other means (SWBA interrupt) */
|
||||
|
||||
if (ath5k_check_timer_win(nbtt, atim, 1, intval) &&
|
||||
ath5k_check_timer_win(dma, nbtt, AR5K_TUNE_DMA_BEACON_RESP,
|
||||
intval))
|
||||
return true; /* O.K. */
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* ath5k_hw_set_coverage_class - Set IEEE 802.11 coverage class
|
||||
*
|
||||
|
||||
@@ -1257,7 +1257,7 @@ static int ath5k_hw_rf5110_calibrate(struct ath5k_hw *ah,
|
||||
* Disable beacons and RX/TX queues, wait
|
||||
*/
|
||||
AR5K_REG_ENABLE_BITS(ah, AR5K_DIAG_SW_5210,
|
||||
AR5K_DIAG_SW_DIS_TX | AR5K_DIAG_SW_DIS_RX_5210);
|
||||
AR5K_DIAG_SW_DIS_TX_5210 | AR5K_DIAG_SW_DIS_RX_5210);
|
||||
beacon = ath5k_hw_reg_read(ah, AR5K_BEACON_5210);
|
||||
ath5k_hw_reg_write(ah, beacon & ~AR5K_BEACON_ENABLE, AR5K_BEACON_5210);
|
||||
|
||||
@@ -1336,7 +1336,7 @@ static int ath5k_hw_rf5110_calibrate(struct ath5k_hw *ah,
|
||||
* Re-enable RX/TX and beacons
|
||||
*/
|
||||
AR5K_REG_DISABLE_BITS(ah, AR5K_DIAG_SW_5210,
|
||||
AR5K_DIAG_SW_DIS_TX | AR5K_DIAG_SW_DIS_RX_5210);
|
||||
AR5K_DIAG_SW_DIS_TX_5210 | AR5K_DIAG_SW_DIS_RX_5210);
|
||||
ath5k_hw_reg_write(ah, beacon, AR5K_BEACON_5210);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1387,10 +1387,9 @@
|
||||
|
||||
|
||||
/*
|
||||
* PCU control register
|
||||
* PCU Diagnostic register
|
||||
*
|
||||
* Only DIS_RX is used in the code, the rest i guess are
|
||||
* for tweaking/diagnostics.
|
||||
* Used for tweaking/diagnostics.
|
||||
*/
|
||||
#define AR5K_DIAG_SW_5210 0x8068 /* Register Address [5210] */
|
||||
#define AR5K_DIAG_SW_5211 0x8048 /* Register Address [5211+] */
|
||||
@@ -1399,22 +1398,22 @@
|
||||
#define AR5K_DIAG_SW_DIS_WEP_ACK 0x00000001 /* Disable ACKs if WEP key is invalid */
|
||||
#define AR5K_DIAG_SW_DIS_ACK 0x00000002 /* Disable ACKs */
|
||||
#define AR5K_DIAG_SW_DIS_CTS 0x00000004 /* Disable CTSs */
|
||||
#define AR5K_DIAG_SW_DIS_ENC 0x00000008 /* Disable encryption */
|
||||
#define AR5K_DIAG_SW_DIS_DEC 0x00000010 /* Disable decryption */
|
||||
#define AR5K_DIAG_SW_DIS_TX 0x00000020 /* Disable transmit [5210] */
|
||||
#define AR5K_DIAG_SW_DIS_RX_5210 0x00000040 /* Disable recieve */
|
||||
#define AR5K_DIAG_SW_DIS_ENC 0x00000008 /* Disable HW encryption */
|
||||
#define AR5K_DIAG_SW_DIS_DEC 0x00000010 /* Disable HW decryption */
|
||||
#define AR5K_DIAG_SW_DIS_TX_5210 0x00000020 /* Disable transmit [5210] */
|
||||
#define AR5K_DIAG_SW_DIS_RX_5210 0x00000040 /* Disable receive */
|
||||
#define AR5K_DIAG_SW_DIS_RX_5211 0x00000020
|
||||
#define AR5K_DIAG_SW_DIS_RX (ah->ah_version == AR5K_AR5210 ? \
|
||||
AR5K_DIAG_SW_DIS_RX_5210 : AR5K_DIAG_SW_DIS_RX_5211)
|
||||
#define AR5K_DIAG_SW_LOOP_BACK_5210 0x00000080 /* Loopback (i guess it goes with DIS_TX) [5210] */
|
||||
#define AR5K_DIAG_SW_LOOP_BACK_5210 0x00000080 /* TX Data Loopback (i guess it goes with DIS_TX) [5210] */
|
||||
#define AR5K_DIAG_SW_LOOP_BACK_5211 0x00000040
|
||||
#define AR5K_DIAG_SW_LOOP_BACK (ah->ah_version == AR5K_AR5210 ? \
|
||||
AR5K_DIAG_SW_LOOP_BACK_5210 : AR5K_DIAG_SW_LOOP_BACK_5211)
|
||||
#define AR5K_DIAG_SW_CORR_FCS_5210 0x00000100 /* Corrupted FCS */
|
||||
#define AR5K_DIAG_SW_CORR_FCS_5210 0x00000100 /* Generate invalid TX FCS */
|
||||
#define AR5K_DIAG_SW_CORR_FCS_5211 0x00000080
|
||||
#define AR5K_DIAG_SW_CORR_FCS (ah->ah_version == AR5K_AR5210 ? \
|
||||
AR5K_DIAG_SW_CORR_FCS_5210 : AR5K_DIAG_SW_CORR_FCS_5211)
|
||||
#define AR5K_DIAG_SW_CHAN_INFO_5210 0x00000200 /* Dump channel info */
|
||||
#define AR5K_DIAG_SW_CHAN_INFO_5210 0x00000200 /* Add 56 bytes of channel info before the frame data in the RX buffer */
|
||||
#define AR5K_DIAG_SW_CHAN_INFO_5211 0x00000100
|
||||
#define AR5K_DIAG_SW_CHAN_INFO (ah->ah_version == AR5K_AR5210 ? \
|
||||
AR5K_DIAG_SW_CHAN_INFO_5210 : AR5K_DIAG_SW_CHAN_INFO_5211)
|
||||
@@ -1426,17 +1425,17 @@
|
||||
#define AR5K_DIAG_SW_SCVRAM_SEED 0x0003f800 /* [5210] */
|
||||
#define AR5K_DIAG_SW_SCRAM_SEED_M 0x0001fc00 /* Scrambler seed mask */
|
||||
#define AR5K_DIAG_SW_SCRAM_SEED_S 10
|
||||
#define AR5K_DIAG_SW_DIS_SEQ_INC 0x00040000 /* Disable seqnum increment (?)[5210] */
|
||||
#define AR5K_DIAG_SW_DIS_SEQ_INC_5210 0x00040000 /* Disable seqnum increment (?)[5210] */
|
||||
#define AR5K_DIAG_SW_FRAME_NV0_5210 0x00080000
|
||||
#define AR5K_DIAG_SW_FRAME_NV0_5211 0x00020000 /* Accept frames of non-zero protocol number */
|
||||
#define AR5K_DIAG_SW_FRAME_NV0 (ah->ah_version == AR5K_AR5210 ? \
|
||||
AR5K_DIAG_SW_FRAME_NV0_5210 : AR5K_DIAG_SW_FRAME_NV0_5211)
|
||||
#define AR5K_DIAG_SW_OBSPT_M 0x000c0000 /* Observation point select (?) */
|
||||
#define AR5K_DIAG_SW_OBSPT_S 18
|
||||
#define AR5K_DIAG_SW_RX_CLEAR_HIGH 0x0010000 /* Force RX Clear high */
|
||||
#define AR5K_DIAG_SW_IGNORE_CARR_SENSE 0x0020000 /* Ignore virtual carrier sense */
|
||||
#define AR5K_DIAG_SW_CHANEL_IDLE_HIGH 0x0040000 /* Force channel idle high */
|
||||
#define AR5K_DIAG_SW_PHEAR_ME 0x0080000 /* ??? */
|
||||
#define AR5K_DIAG_SW_RX_CLEAR_HIGH 0x00100000 /* Ignore carrier sense */
|
||||
#define AR5K_DIAG_SW_IGNORE_CARR_SENSE 0x00200000 /* Ignore virtual carrier sense */
|
||||
#define AR5K_DIAG_SW_CHANNEL_IDLE_HIGH 0x00400000 /* Force channel idle high */
|
||||
#define AR5K_DIAG_SW_PHEAR_ME 0x00800000 /* ??? */
|
||||
|
||||
/*
|
||||
* TSF (clock) register (lower 32 bits)
|
||||
|
||||
@@ -118,7 +118,7 @@ static void ar5008_hw_force_bias(struct ath_hw *ah, u16 synth_freq)
|
||||
if (!AR_SREV_5416(ah) || synth_freq >= 3000)
|
||||
return;
|
||||
|
||||
BUG_ON(AR_SREV_9280_10_OR_LATER(ah));
|
||||
BUG_ON(AR_SREV_9280_20_OR_LATER(ah));
|
||||
|
||||
if (synth_freq < 2412)
|
||||
new_bias = 0;
|
||||
@@ -454,7 +454,7 @@ static int ar5008_hw_rf_alloc_ext_banks(struct ath_hw *ah)
|
||||
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
|
||||
BUG_ON(AR_SREV_9280_10_OR_LATER(ah));
|
||||
BUG_ON(AR_SREV_9280_20_OR_LATER(ah));
|
||||
|
||||
ATH_ALLOC_BANK(ah->analogBank0Data, ah->iniBank0.ia_rows);
|
||||
ATH_ALLOC_BANK(ah->analogBank1Data, ah->iniBank1.ia_rows);
|
||||
@@ -484,7 +484,7 @@ static void ar5008_hw_rf_free_ext_banks(struct ath_hw *ah)
|
||||
bank = NULL; \
|
||||
} while (0);
|
||||
|
||||
BUG_ON(AR_SREV_9280_10_OR_LATER(ah));
|
||||
BUG_ON(AR_SREV_9280_20_OR_LATER(ah));
|
||||
|
||||
ATH_FREE_BANK(ah->analogBank0Data);
|
||||
ATH_FREE_BANK(ah->analogBank1Data);
|
||||
@@ -525,7 +525,7 @@ static bool ar5008_hw_set_rf_regs(struct ath_hw *ah,
|
||||
* for single chip devices, that is AR9280 or anything
|
||||
* after that.
|
||||
*/
|
||||
if (AR_SREV_9280_10_OR_LATER(ah))
|
||||
if (AR_SREV_9280_20_OR_LATER(ah))
|
||||
return true;
|
||||
|
||||
/* Setup rf parameters */
|
||||
@@ -663,20 +663,20 @@ static void ar5008_hw_override_ini(struct ath_hw *ah,
|
||||
*/
|
||||
REG_SET_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT));
|
||||
|
||||
if (AR_SREV_9280_10_OR_LATER(ah)) {
|
||||
if (AR_SREV_9280_20_OR_LATER(ah)) {
|
||||
val = REG_READ(ah, AR_PCU_MISC_MODE2);
|
||||
|
||||
if (!AR_SREV_9271(ah))
|
||||
val &= ~AR_PCU_MISC_MODE2_HWWAR1;
|
||||
|
||||
if (AR_SREV_9287_10_OR_LATER(ah))
|
||||
if (AR_SREV_9287_11_OR_LATER(ah))
|
||||
val = val & (~AR_PCU_MISC_MODE2_HWWAR2);
|
||||
|
||||
REG_WRITE(ah, AR_PCU_MISC_MODE2, val);
|
||||
}
|
||||
|
||||
if (!AR_SREV_5416_20_OR_LATER(ah) ||
|
||||
AR_SREV_9280_10_OR_LATER(ah))
|
||||
AR_SREV_9280_20_OR_LATER(ah))
|
||||
return;
|
||||
/*
|
||||
* Disable BB clock gating
|
||||
@@ -701,7 +701,7 @@ static void ar5008_hw_set_channel_regs(struct ath_hw *ah,
|
||||
u32 phymode;
|
||||
u32 enableDacFifo = 0;
|
||||
|
||||
if (AR_SREV_9285_10_OR_LATER(ah))
|
||||
if (AR_SREV_9285_12_OR_LATER(ah))
|
||||
enableDacFifo = (REG_READ(ah, AR_PHY_TURBO) &
|
||||
AR_PHY_FC_ENABLE_DAC_FIFO);
|
||||
|
||||
@@ -820,11 +820,11 @@ static int ar5008_hw_process_ini(struct ath_hw *ah,
|
||||
REGWRITE_BUFFER_FLUSH(ah);
|
||||
DISABLE_REGWRITE_BUFFER(ah);
|
||||
|
||||
if (AR_SREV_9280(ah) || AR_SREV_9287_10_OR_LATER(ah))
|
||||
if (AR_SREV_9280(ah) || AR_SREV_9287_11_OR_LATER(ah))
|
||||
REG_WRITE_ARRAY(&ah->iniModesRxGain, modesIndex, regWrites);
|
||||
|
||||
if (AR_SREV_9280(ah) || AR_SREV_9285_12_OR_LATER(ah) ||
|
||||
AR_SREV_9287_10_OR_LATER(ah))
|
||||
AR_SREV_9287_11_OR_LATER(ah))
|
||||
REG_WRITE_ARRAY(&ah->iniModesTxGain, modesIndex, regWrites);
|
||||
|
||||
if (AR_SREV_9271_10(ah))
|
||||
@@ -900,7 +900,7 @@ static void ar5008_hw_set_rfmode(struct ath_hw *ah, struct ath9k_channel *chan)
|
||||
rfMode |= (IS_CHAN_B(chan) || IS_CHAN_G(chan))
|
||||
? AR_PHY_MODE_DYNAMIC : AR_PHY_MODE_OFDM;
|
||||
|
||||
if (!AR_SREV_9280_10_OR_LATER(ah))
|
||||
if (!AR_SREV_9280_20_OR_LATER(ah))
|
||||
rfMode |= (IS_CHAN_5GHZ(chan)) ?
|
||||
AR_PHY_MODE_RF5GHZ : AR_PHY_MODE_RF2GHZ;
|
||||
|
||||
|
||||
@@ -567,11 +567,6 @@ static inline void ar9285_hw_pa_cal(struct ath_hw *ah, bool is_reset)
|
||||
AR5416_EEP_TXGAIN_HIGH_POWER)
|
||||
return;
|
||||
|
||||
if (AR_SREV_9285_11(ah)) {
|
||||
REG_WRITE(ah, AR9285_AN_TOP4, (AR9285_AN_TOP4_DEFAULT | 0x14));
|
||||
udelay(10);
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(regList); i++)
|
||||
regList[i][1] = REG_READ(ah, regList[i][0]);
|
||||
|
||||
@@ -651,10 +646,6 @@ static inline void ar9285_hw_pa_cal(struct ath_hw *ah, bool is_reset)
|
||||
REG_WRITE(ah, regList[i][0], regList[i][1]);
|
||||
|
||||
REG_RMW_FIELD(ah, AR9285_AN_RF2G6, AR9285_AN_RF2G6_CCOMP, ccomp_org);
|
||||
|
||||
if (AR_SREV_9285_11(ah))
|
||||
REG_WRITE(ah, AR9285_AN_TOP4, AR9285_AN_TOP4_DEFAULT);
|
||||
|
||||
}
|
||||
|
||||
static void ar9002_hw_pa_cal(struct ath_hw *ah, bool is_reset)
|
||||
@@ -664,7 +655,7 @@ static void ar9002_hw_pa_cal(struct ath_hw *ah, bool is_reset)
|
||||
ar9271_hw_pa_cal(ah, is_reset);
|
||||
else
|
||||
ah->pacal_info.skipcount--;
|
||||
} else if (AR_SREV_9285_11_OR_LATER(ah)) {
|
||||
} else if (AR_SREV_9285_12_OR_LATER(ah)) {
|
||||
if (is_reset || !ah->pacal_info.skipcount)
|
||||
ar9285_hw_pa_cal(ah, is_reset);
|
||||
else
|
||||
@@ -841,8 +832,8 @@ static bool ar9002_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)
|
||||
if (!ar9285_hw_clc(ah, chan))
|
||||
return false;
|
||||
} else {
|
||||
if (AR_SREV_9280_10_OR_LATER(ah)) {
|
||||
if (!AR_SREV_9287_10_OR_LATER(ah))
|
||||
if (AR_SREV_9280_20_OR_LATER(ah)) {
|
||||
if (!AR_SREV_9287_11_OR_LATER(ah))
|
||||
REG_CLR_BIT(ah, AR_PHY_ADC_CTL,
|
||||
AR_PHY_ADC_CTL_OFF_PWDADC);
|
||||
REG_SET_BIT(ah, AR_PHY_AGC_CONTROL,
|
||||
@@ -864,8 +855,8 @@ static bool ar9002_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (AR_SREV_9280_10_OR_LATER(ah)) {
|
||||
if (!AR_SREV_9287_10_OR_LATER(ah))
|
||||
if (AR_SREV_9280_20_OR_LATER(ah)) {
|
||||
if (!AR_SREV_9287_11_OR_LATER(ah))
|
||||
REG_SET_BIT(ah, AR_PHY_ADC_CTL,
|
||||
AR_PHY_ADC_CTL_OFF_PWDADC);
|
||||
REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL,
|
||||
@@ -976,7 +967,7 @@ static void ar9002_hw_init_cal_settings(struct ath_hw *ah)
|
||||
}
|
||||
|
||||
if (AR_SREV_9160_10_OR_LATER(ah)) {
|
||||
if (AR_SREV_9280_10_OR_LATER(ah)) {
|
||||
if (AR_SREV_9280_20_OR_LATER(ah)) {
|
||||
ah->iq_caldata.calData = &iq_cal_single_sample;
|
||||
ah->adcgain_caldata.calData =
|
||||
&adc_gain_cal_single_sample;
|
||||
|
||||
@@ -569,7 +569,7 @@ void ar9002_hw_attach_ops(struct ath_hw *ah)
|
||||
ops->config_pci_powersave = ar9002_hw_configpcipowersave;
|
||||
|
||||
ar5008_hw_attach_phy_ops(ah);
|
||||
if (AR_SREV_9280_10_OR_LATER(ah))
|
||||
if (AR_SREV_9280_20_OR_LATER(ah))
|
||||
ar9002_hw_attach_phy_ops(ah);
|
||||
|
||||
ar9002_hw_attach_calib_ops(ah);
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
#define AR5416_VER_MASK (eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK)
|
||||
#define OLC_FOR_AR9280_20_LATER (AR_SREV_9280_20_OR_LATER(ah) && \
|
||||
ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL))
|
||||
#define OLC_FOR_AR9287_10_LATER (AR_SREV_9287_10_OR_LATER(ah) && \
|
||||
#define OLC_FOR_AR9287_10_LATER (AR_SREV_9287_11_OR_LATER(ah) && \
|
||||
ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL))
|
||||
|
||||
#define AR_EEPROM_RFSILENT_GPIO_SEL 0x001c
|
||||
|
||||
@@ -333,7 +333,7 @@ static void ath9k_hw_get_4k_gain_boundaries_pdadcs(struct ath_hw *ah,
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
if (AR_SREV_9280_10_OR_LATER(ah))
|
||||
if (AR_SREV_9280_20_OR_LATER(ah))
|
||||
ss = (int16_t)(0 - (minPwrT4[i] / 2));
|
||||
else
|
||||
ss = 0;
|
||||
@@ -761,7 +761,7 @@ static void ath9k_hw_4k_set_txpower(struct ath_hw *ah,
|
||||
|
||||
regulatory->max_power_level = ratesArray[i];
|
||||
|
||||
if (AR_SREV_9280_10_OR_LATER(ah)) {
|
||||
if (AR_SREV_9280_20_OR_LATER(ah)) {
|
||||
for (i = 0; i < Ar5416RateSize; i++)
|
||||
ratesArray[i] -= AR5416_PWR_TABLE_OFFSET_DB * 2;
|
||||
}
|
||||
@@ -909,9 +909,6 @@ static void ath9k_hw_4k_set_gain(struct ath_hw *ah,
|
||||
AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal);
|
||||
REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000,
|
||||
AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]);
|
||||
|
||||
if (AR_SREV_9285_11(ah))
|
||||
REG_WRITE(ah, AR9285_AN_TOP4, (AR9285_AN_TOP4_DEFAULT | 0x14));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1109,9 +1106,6 @@ static void ath9k_hw_4k_set_board_values(struct ath_hw *ah,
|
||||
}
|
||||
|
||||
|
||||
if (AR_SREV_9285_11(ah))
|
||||
REG_WRITE(ah, AR9285_AN_TOP4, AR9285_AN_TOP4_DEFAULT);
|
||||
|
||||
REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH,
|
||||
pModal->switchSettling);
|
||||
REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, AR_PHY_DESIRED_SZ_ADC,
|
||||
|
||||
@@ -324,7 +324,7 @@ static void ath9k_hw_get_ar9287_gain_boundaries_pdadcs(struct ath_hw *ah,
|
||||
minDelta = 0;
|
||||
|
||||
if (i == 0) {
|
||||
if (AR_SREV_9280_10_OR_LATER(ah))
|
||||
if (AR_SREV_9280_20_OR_LATER(ah))
|
||||
ss = (int16_t)(0 - (minPwrT4[i] / 2));
|
||||
else
|
||||
ss = 0;
|
||||
@@ -883,7 +883,7 @@ static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah,
|
||||
ratesArray[i] = AR9287_MAX_RATE_POWER;
|
||||
}
|
||||
|
||||
if (AR_SREV_9280_10_OR_LATER(ah)) {
|
||||
if (AR_SREV_9280_20_OR_LATER(ah)) {
|
||||
for (i = 0; i < Ar5416RateSize; i++)
|
||||
ratesArray[i] -= AR9287_PWR_TABLE_OFFSET_DB * 2;
|
||||
}
|
||||
@@ -977,7 +977,7 @@ static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah,
|
||||
else
|
||||
i = rate6mb;
|
||||
|
||||
if (AR_SREV_9280_10_OR_LATER(ah))
|
||||
if (AR_SREV_9280_20_OR_LATER(ah))
|
||||
regulatory->max_power_level =
|
||||
ratesArray[i] + AR9287_PWR_TABLE_OFFSET_DB * 2;
|
||||
else
|
||||
|
||||
@@ -223,7 +223,7 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah)
|
||||
}
|
||||
|
||||
/* Enable fixup for AR_AN_TOP2 if necessary */
|
||||
if (AR_SREV_9280_10_OR_LATER(ah) &&
|
||||
if (AR_SREV_9280_20_OR_LATER(ah) &&
|
||||
(eep->baseEepHeader.version & 0xff) > 0x0a &&
|
||||
eep->baseEepHeader.pwdclkind == 0)
|
||||
ah->need_an_top2_fixup = 1;
|
||||
@@ -317,7 +317,7 @@ static void ath9k_hw_def_set_gain(struct ath_hw *ah,
|
||||
if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_3) {
|
||||
txRxAttenLocal = pModal->txRxAttenCh[i];
|
||||
|
||||
if (AR_SREV_9280_10_OR_LATER(ah)) {
|
||||
if (AR_SREV_9280_20_OR_LATER(ah)) {
|
||||
REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
|
||||
AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN,
|
||||
pModal->bswMargin[i]);
|
||||
@@ -344,7 +344,7 @@ static void ath9k_hw_def_set_gain(struct ath_hw *ah,
|
||||
}
|
||||
}
|
||||
|
||||
if (AR_SREV_9280_10_OR_LATER(ah)) {
|
||||
if (AR_SREV_9280_20_OR_LATER(ah)) {
|
||||
REG_RMW_FIELD(ah,
|
||||
AR_PHY_RXGAIN + regChainOffset,
|
||||
AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal);
|
||||
@@ -408,7 +408,7 @@ static void ath9k_hw_def_set_board_values(struct ath_hw *ah,
|
||||
regChainOffset, i);
|
||||
}
|
||||
|
||||
if (AR_SREV_9280_10_OR_LATER(ah)) {
|
||||
if (AR_SREV_9280_20_OR_LATER(ah)) {
|
||||
if (IS_CHAN_2GHZ(chan)) {
|
||||
ath9k_hw_analog_shift_rmw(ah, AR_AN_RF2G1_CH0,
|
||||
AR_AN_RF2G1_CH0_OB,
|
||||
@@ -461,7 +461,7 @@ static void ath9k_hw_def_set_board_values(struct ath_hw *ah,
|
||||
REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, AR_PHY_DESIRED_SZ_ADC,
|
||||
pModal->adcDesiredSize);
|
||||
|
||||
if (!AR_SREV_9280_10_OR_LATER(ah))
|
||||
if (!AR_SREV_9280_20_OR_LATER(ah))
|
||||
REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ,
|
||||
AR_PHY_DESIRED_SZ_PGA,
|
||||
pModal->pgaDesiredSize);
|
||||
@@ -478,7 +478,7 @@ static void ath9k_hw_def_set_board_values(struct ath_hw *ah,
|
||||
REG_RMW_FIELD(ah, AR_PHY_RF_CTL3, AR_PHY_TX_END_TO_A2_RX_ON,
|
||||
pModal->txEndToRxOn);
|
||||
|
||||
if (AR_SREV_9280_10_OR_LATER(ah)) {
|
||||
if (AR_SREV_9280_20_OR_LATER(ah)) {
|
||||
REG_RMW_FIELD(ah, AR_PHY_CCA, AR9280_PHY_CCA_THRESH62,
|
||||
pModal->thresh62);
|
||||
REG_RMW_FIELD(ah, AR_PHY_EXT_CCA0,
|
||||
@@ -696,7 +696,7 @@ static void ath9k_hw_get_def_gain_boundaries_pdadcs(struct ath_hw *ah,
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
if (AR_SREV_9280_10_OR_LATER(ah))
|
||||
if (AR_SREV_9280_20_OR_LATER(ah))
|
||||
ss = (int16_t)(0 - (minPwrT4[i] / 2));
|
||||
else
|
||||
ss = 0;
|
||||
@@ -1291,7 +1291,7 @@ static void ath9k_hw_def_set_txpower(struct ath_hw *ah,
|
||||
ratesArray[i] = AR5416_MAX_RATE_POWER;
|
||||
}
|
||||
|
||||
if (AR_SREV_9280_10_OR_LATER(ah)) {
|
||||
if (AR_SREV_9280_20_OR_LATER(ah)) {
|
||||
for (i = 0; i < Ar5416RateSize; i++) {
|
||||
int8_t pwr_table_offset;
|
||||
|
||||
@@ -1395,7 +1395,7 @@ static void ath9k_hw_def_set_txpower(struct ath_hw *ah,
|
||||
else if (IS_CHAN_HT20(chan))
|
||||
i = rateHt20_0;
|
||||
|
||||
if (AR_SREV_9280_10_OR_LATER(ah))
|
||||
if (AR_SREV_9280_20_OR_LATER(ah))
|
||||
regulatory->max_power_level =
|
||||
ratesArray[i] + AR5416_PWR_TABLE_OFFSET_DB * 2;
|
||||
else
|
||||
|
||||
@@ -235,7 +235,14 @@ void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv)
|
||||
ath9k_hw_get_txq_props(ah, qnum, &qi_be);
|
||||
|
||||
qi.tqi_aifs = qi_be.tqi_aifs;
|
||||
qi.tqi_cwmin = 4*qi_be.tqi_cwmin;
|
||||
/* For WIFI Beacon Distribution
|
||||
* Long slot time : 2x cwmin
|
||||
* Short slot time : 4x cwmin
|
||||
*/
|
||||
if (ah->slottime == ATH9K_SLOT_TIME_20)
|
||||
qi.tqi_cwmin = 2*qi_be.tqi_cwmin;
|
||||
else
|
||||
qi.tqi_cwmin = 4*qi_be.tqi_cwmin;
|
||||
qi.tqi_cwmax = qi_be.tqi_cwmax;
|
||||
|
||||
if (!ath9k_hw_set_txq_props(ah, priv->beaconq, &qi)) {
|
||||
|
||||
@@ -561,6 +561,9 @@ static void ath9k_init_crypto(struct ath9k_htc_priv *priv)
|
||||
common->keymax = ATH_KEYMAX;
|
||||
}
|
||||
|
||||
if (priv->ah->misc_mode & AR_PCU_MIC_NEW_LOC_ENA)
|
||||
common->crypt_caps |= ATH_CRYPT_CAP_MIC_COMBINED;
|
||||
|
||||
/*
|
||||
* Reset the key cache since some parts do not
|
||||
* reset the contents on initial power up.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user