Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (74 commits) Revert "b43: Enforce DMA descriptor memory constraints" iwmc3200wifi: fix array out-of-boundary access wl1251: timeout one too soon in wl1251_boot_run_firmware() mac80211: fix propagation of failed hardware reconfigurations mac80211: fix race with suspend and dynamic_ps_disable_work ath9k: fix missed error codes in the tx status check ath9k: wake hardware during AMPDU TX actions ath9k: wake hardware for interface IBSS/AP/Mesh removal ath9k: fix suspend by waking device prior to stop cfg80211: fix error path in cfg80211_wext_siwscan wl1271_cmd.c: cleanup char => u8 iwlwifi: Storage class should be before const qualifier ath9k: Storage class should be before const qualifier cfg80211: fix race between deauth and assoc response wireless: remove remaining qual code rt2x00: Add USB ID for Linksys WUSB 600N rev 2. ath5k: fix SWI calibration interrupt storm mac80211: fix ibss join with fixed-bssid libertas: Remove carrier signaling from the scan code orinoco: fix GFP_KERNEL in orinoco_set_key with interrupts disabled ...
This commit is contained in:
@@ -681,19 +681,13 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv,
|
||||
snr = rx_stats_sig_avg / rx_stats_noise_diff;
|
||||
rx_status.noise = rx_status.signal -
|
||||
iwl3945_calc_db_from_ratio(snr);
|
||||
rx_status.qual = iwl3945_calc_sig_qual(rx_status.signal,
|
||||
rx_status.noise);
|
||||
|
||||
/* If noise info not available, calculate signal quality indicator (%)
|
||||
* using just the dBm signal level. */
|
||||
} else {
|
||||
rx_status.noise = priv->last_rx_noise;
|
||||
rx_status.qual = iwl3945_calc_sig_qual(rx_status.signal, 0);
|
||||
}
|
||||
|
||||
|
||||
IWL_DEBUG_STATS(priv, "Rssi %d noise %d qual %d sig_avg %d noise_diff %d\n",
|
||||
rx_status.signal, rx_status.noise, rx_status.qual,
|
||||
IWL_DEBUG_STATS(priv, "Rssi %d noise %d sig_avg %d noise_diff %d\n",
|
||||
rx_status.signal, rx_status.noise,
|
||||
rx_stats_sig_avg, rx_stats_noise_diff);
|
||||
|
||||
header = (struct ieee80211_hdr *)IWL_RX_DATA(pkt);
|
||||
@@ -1835,8 +1829,7 @@ static int iwl3945_send_rxon_assoc(struct iwl_priv *priv)
|
||||
rc = -EIO;
|
||||
}
|
||||
|
||||
priv->alloc_rxb_page--;
|
||||
free_pages(cmd.reply_page, priv->hw_params.rx_page_order);
|
||||
iwl_free_pages(priv, cmd.reply_page);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -2836,6 +2829,7 @@ static struct iwl_cfg iwl3945_bg_cfg = {
|
||||
.use_isr_legacy = true,
|
||||
.ht_greenfield_support = false,
|
||||
.led_compensation = 64,
|
||||
.broken_powersave = true,
|
||||
};
|
||||
|
||||
static struct iwl_cfg iwl3945_abg_cfg = {
|
||||
@@ -2852,6 +2846,7 @@ static struct iwl_cfg iwl3945_abg_cfg = {
|
||||
.use_isr_legacy = true,
|
||||
.ht_greenfield_support = false,
|
||||
.led_compensation = 64,
|
||||
.broken_powersave = true,
|
||||
};
|
||||
|
||||
struct pci_device_id iwl3945_hw_card_ids[] = {
|
||||
|
@@ -222,7 +222,6 @@ struct iwl3945_ibss_seq {
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern int iwl3945_calc_db_from_ratio(int sig_ratio);
|
||||
extern int iwl3945_calc_sig_qual(int rssi_dbm, int noise_dbm);
|
||||
extern void iwl3945_rx_replenish(void *data);
|
||||
extern void iwl3945_rx_queue_reset(struct iwl_priv *priv, struct iwl_rx_queue *rxq);
|
||||
extern unsigned int iwl3945_fill_beacon_frame(struct iwl_priv *priv,
|
||||
|
@@ -1204,7 +1204,7 @@ static int iwl4965_fill_txpower_tbl(struct iwl_priv *priv, u8 band, u16 channel,
|
||||
iwl4965_interpolate_chan(priv, channel, &ch_eeprom_info);
|
||||
|
||||
/* calculate tx gain adjustment based on power supply voltage */
|
||||
voltage = priv->calib_info->voltage;
|
||||
voltage = le16_to_cpu(priv->calib_info->voltage);
|
||||
init_voltage = (s32)le32_to_cpu(priv->card_alive_init.voltage);
|
||||
voltage_compensation =
|
||||
iwl4965_get_voltage_compensation(voltage, init_voltage);
|
||||
|
@@ -92,11 +92,15 @@
|
||||
|
||||
static inline s32 iwl_temp_calib_to_offset(struct iwl_priv *priv)
|
||||
{
|
||||
u16 *temp_calib = (u16 *)iwl_eeprom_query_addr(priv,
|
||||
EEPROM_5000_TEMPERATURE);
|
||||
/* offset = temperature - voltage / coef */
|
||||
s32 offset = (s32)(temp_calib[0] - temp_calib[1] / IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF);
|
||||
return offset;
|
||||
u16 temperature, voltage;
|
||||
__le16 *temp_calib =
|
||||
(__le16 *)iwl_eeprom_query_addr(priv, EEPROM_5000_TEMPERATURE);
|
||||
|
||||
temperature = le16_to_cpu(temp_calib[0]);
|
||||
voltage = le16_to_cpu(temp_calib[1]);
|
||||
|
||||
/* offset = temp - volt / coeff */
|
||||
return (s32)(temperature - voltage / IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF);
|
||||
}
|
||||
|
||||
/* Fixed (non-configurable) rx data from phy */
|
||||
|
@@ -333,14 +333,15 @@ static void iwl5000_set_ct_threshold(struct iwl_priv *priv)
|
||||
static int iwl5000_set_Xtal_calib(struct iwl_priv *priv)
|
||||
{
|
||||
struct iwl_calib_xtal_freq_cmd cmd;
|
||||
u16 *xtal_calib = (u16 *)iwl_eeprom_query_addr(priv, EEPROM_5000_XTAL);
|
||||
__le16 *xtal_calib =
|
||||
(__le16 *)iwl_eeprom_query_addr(priv, EEPROM_5000_XTAL);
|
||||
|
||||
cmd.hdr.op_code = IWL_PHY_CALIBRATE_CRYSTAL_FRQ_CMD;
|
||||
cmd.hdr.first_group = 0;
|
||||
cmd.hdr.groups_num = 1;
|
||||
cmd.hdr.data_valid = 1;
|
||||
cmd.cap_pin1 = (u8)xtal_calib[0];
|
||||
cmd.cap_pin2 = (u8)xtal_calib[1];
|
||||
cmd.cap_pin1 = le16_to_cpu(xtal_calib[0]);
|
||||
cmd.cap_pin2 = le16_to_cpu(xtal_calib[1]);
|
||||
return iwl_calib_set(&priv->calib_results[IWL_CALIB_XTAL],
|
||||
(u8 *)&cmd, sizeof(cmd));
|
||||
}
|
||||
|
@@ -150,7 +150,7 @@ static s32 expected_tpt_mimo3_40MHz[4][IWL_RATE_COUNT] = {
|
||||
};
|
||||
|
||||
/* mbps, mcs */
|
||||
const static struct iwl_rate_mcs_info iwl_rate_mcs[IWL_RATE_COUNT] = {
|
||||
static const struct iwl_rate_mcs_info iwl_rate_mcs[IWL_RATE_COUNT] = {
|
||||
{ "1", "BPSK DSSS"},
|
||||
{ "2", "QPSK DSSS"},
|
||||
{"5.5", "BPSK CCK"},
|
||||
|
@@ -1842,7 +1842,7 @@ void iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IWLWIFI_DEBUG
|
||||
if (!(iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS))
|
||||
if (!(iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS) && !full_log)
|
||||
size = (size > DEFAULT_DUMP_EVENT_LOG_ENTRIES)
|
||||
? DEFAULT_DUMP_EVENT_LOG_ENTRIES : size;
|
||||
#else
|
||||
@@ -3173,7 +3173,6 @@ static int iwl_init_drv(struct iwl_priv *priv)
|
||||
|
||||
priv->ibss_beacon = NULL;
|
||||
|
||||
spin_lock_init(&priv->lock);
|
||||
spin_lock_init(&priv->sta_lock);
|
||||
spin_lock_init(&priv->hcmd_lock);
|
||||
|
||||
@@ -3361,10 +3360,11 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
(unsigned long long) pci_resource_len(pdev, 0));
|
||||
IWL_DEBUG_INFO(priv, "pci_resource_base = %p\n", priv->hw_base);
|
||||
|
||||
/* this spin lock will be used in apm_ops.init and EEPROM access
|
||||
/* these spin locks will be used in apm_ops.init and EEPROM access
|
||||
* we should init now
|
||||
*/
|
||||
spin_lock_init(&priv->reg_lock);
|
||||
spin_lock_init(&priv->lock);
|
||||
iwl_hw_detect(priv);
|
||||
IWL_INFO(priv, "Detected Intel Wireless WiFi Link %s REV=0x%X\n",
|
||||
priv->cfg->name, priv->hw_rev);
|
||||
|
@@ -77,8 +77,7 @@
|
||||
* The MAC (uCode processor, etc.) does not need to be powered up for accessing
|
||||
* the CSR registers.
|
||||
*
|
||||
* NOTE: Newer devices using one-time-programmable (OTP) memory
|
||||
* require device to be awake in order to read this memory
|
||||
* NOTE: Device does need to be awake in order to read this memory
|
||||
* via CSR_EEPROM and CSR_OTP registers
|
||||
*/
|
||||
#define CSR_BASE (0x000)
|
||||
@@ -111,9 +110,8 @@
|
||||
/*
|
||||
* EEPROM and OTP (one-time-programmable) memory reads
|
||||
*
|
||||
* NOTE: For (newer) devices using OTP, device must be awake, initialized via
|
||||
* apm_ops.init() in order to read. Older devices (3945/4965/5000)
|
||||
* use EEPROM and do not require this.
|
||||
* NOTE: Device must be awake, initialized via apm_ops.init(),
|
||||
* in order to read.
|
||||
*/
|
||||
#define CSR_EEPROM_REG (CSR_BASE+0x02c)
|
||||
#define CSR_EEPROM_GP (CSR_BASE+0x030)
|
||||
|
@@ -1168,7 +1168,7 @@ struct iwl_priv {
|
||||
u32 last_beacon_time;
|
||||
u64 last_tsf;
|
||||
|
||||
/* eeprom */
|
||||
/* eeprom -- this is in the card's little endian byte order */
|
||||
u8 *eeprom;
|
||||
int nvm_device_type;
|
||||
struct iwl_eeprom_calib_info *calib_info;
|
||||
@@ -1353,4 +1353,15 @@ static inline int is_channel_ibss(const struct iwl_channel_info *ch)
|
||||
return ((ch->flags & EEPROM_CHANNEL_IBSS)) ? 1 : 0;
|
||||
}
|
||||
|
||||
static inline void __iwl_free_pages(struct iwl_priv *priv, struct page *page)
|
||||
{
|
||||
__free_pages(page, priv->hw_params.rx_page_order);
|
||||
priv->alloc_rxb_page--;
|
||||
}
|
||||
|
||||
static inline void iwl_free_pages(struct iwl_priv *priv, unsigned long page)
|
||||
{
|
||||
free_pages(page, priv->hw_params.rx_page_order);
|
||||
priv->alloc_rxb_page--;
|
||||
}
|
||||
#endif /* __iwl_dev_h__ */
|
||||
|
@@ -370,7 +370,7 @@ static int iwl_init_otp_access(struct iwl_priv *priv)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int iwl_read_otp_word(struct iwl_priv *priv, u16 addr, u16 *eeprom_data)
|
||||
static int iwl_read_otp_word(struct iwl_priv *priv, u16 addr, __le16 *eeprom_data)
|
||||
{
|
||||
int ret = 0;
|
||||
u32 r;
|
||||
@@ -404,7 +404,7 @@ static int iwl_read_otp_word(struct iwl_priv *priv, u16 addr, u16 *eeprom_data)
|
||||
CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK);
|
||||
IWL_ERR(priv, "Correctable OTP ECC error, continue read\n");
|
||||
}
|
||||
*eeprom_data = le16_to_cpu((__force __le16)(r >> 16));
|
||||
*eeprom_data = cpu_to_le16(r >> 16);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -413,7 +413,8 @@ static int iwl_read_otp_word(struct iwl_priv *priv, u16 addr, u16 *eeprom_data)
|
||||
*/
|
||||
static bool iwl_is_otp_empty(struct iwl_priv *priv)
|
||||
{
|
||||
u16 next_link_addr = 0, link_value;
|
||||
u16 next_link_addr = 0;
|
||||
__le16 link_value;
|
||||
bool is_empty = false;
|
||||
|
||||
/* locate the beginning of OTP link list */
|
||||
@@ -443,7 +444,8 @@ static bool iwl_is_otp_empty(struct iwl_priv *priv)
|
||||
static int iwl_find_otp_image(struct iwl_priv *priv,
|
||||
u16 *validblockaddr)
|
||||
{
|
||||
u16 next_link_addr = 0, link_value = 0, valid_addr;
|
||||
u16 next_link_addr = 0, valid_addr;
|
||||
__le16 link_value = 0;
|
||||
int usedblocks = 0;
|
||||
|
||||
/* set addressing mode to absolute to traverse the link list */
|
||||
@@ -463,7 +465,7 @@ static int iwl_find_otp_image(struct iwl_priv *priv,
|
||||
* check for more block on the link list
|
||||
*/
|
||||
valid_addr = next_link_addr;
|
||||
next_link_addr = link_value * sizeof(u16);
|
||||
next_link_addr = le16_to_cpu(link_value) * sizeof(u16);
|
||||
IWL_DEBUG_INFO(priv, "OTP blocks %d addr 0x%x\n",
|
||||
usedblocks, next_link_addr);
|
||||
if (iwl_read_otp_word(priv, next_link_addr, &link_value))
|
||||
@@ -497,7 +499,7 @@ static int iwl_find_otp_image(struct iwl_priv *priv,
|
||||
*/
|
||||
int iwl_eeprom_init(struct iwl_priv *priv)
|
||||
{
|
||||
u16 *e;
|
||||
__le16 *e;
|
||||
u32 gp = iwl_read32(priv, CSR_EEPROM_GP);
|
||||
int sz;
|
||||
int ret;
|
||||
@@ -516,12 +518,9 @@ int iwl_eeprom_init(struct iwl_priv *priv)
|
||||
ret = -ENOMEM;
|
||||
goto alloc_err;
|
||||
}
|
||||
e = (u16 *)priv->eeprom;
|
||||
e = (__le16 *)priv->eeprom;
|
||||
|
||||
if (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP) {
|
||||
/* OTP reads require powered-up chip */
|
||||
priv->cfg->ops->lib->apm_ops.init(priv);
|
||||
}
|
||||
priv->cfg->ops->lib->apm_ops.init(priv);
|
||||
|
||||
ret = priv->cfg->ops->lib->eeprom_ops.verify_signature(priv);
|
||||
if (ret < 0) {
|
||||
@@ -562,7 +561,7 @@ int iwl_eeprom_init(struct iwl_priv *priv)
|
||||
}
|
||||
for (addr = validblockaddr; addr < validblockaddr + sz;
|
||||
addr += sizeof(u16)) {
|
||||
u16 eeprom_data;
|
||||
__le16 eeprom_data;
|
||||
|
||||
ret = iwl_read_otp_word(priv, addr, &eeprom_data);
|
||||
if (ret)
|
||||
@@ -570,13 +569,6 @@ int iwl_eeprom_init(struct iwl_priv *priv)
|
||||
e[cache_addr / 2] = eeprom_data;
|
||||
cache_addr += sizeof(u16);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now that OTP reads are complete, reset chip to save
|
||||
* power until we load uCode during "up".
|
||||
*/
|
||||
priv->cfg->ops->lib->apm_ops.stop(priv);
|
||||
|
||||
} else {
|
||||
/* eeprom is an array of 16bit values */
|
||||
for (addr = 0; addr < sz; addr += sizeof(u16)) {
|
||||
@@ -594,7 +586,7 @@ int iwl_eeprom_init(struct iwl_priv *priv)
|
||||
goto done;
|
||||
}
|
||||
r = _iwl_read_direct32(priv, CSR_EEPROM_REG);
|
||||
e[addr / 2] = le16_to_cpu((__force __le16)(r >> 16));
|
||||
e[addr / 2] = cpu_to_le16(r >> 16);
|
||||
}
|
||||
}
|
||||
ret = 0;
|
||||
@@ -603,6 +595,8 @@ done:
|
||||
err:
|
||||
if (ret)
|
||||
iwl_eeprom_free(priv);
|
||||
/* Reset chip to save power until we load uCode during "up". */
|
||||
priv->cfg->ops->lib->apm_ops.stop(priv);
|
||||
alloc_err:
|
||||
return ret;
|
||||
}
|
||||
@@ -755,7 +749,8 @@ static int iwl_mod_ht40_chan_info(struct iwl_priv *priv,
|
||||
ch_info->ht40_eeprom = *eeprom_ch;
|
||||
ch_info->ht40_max_power_avg = eeprom_ch->max_power_avg;
|
||||
ch_info->ht40_flags = eeprom_ch->flags;
|
||||
ch_info->ht40_extension_channel &= ~clear_ht40_extension_channel;
|
||||
if (eeprom_ch->flags & EEPROM_CHANNEL_VALID)
|
||||
ch_info->ht40_extension_channel &= ~clear_ht40_extension_channel;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -137,7 +137,7 @@ struct iwl_eeprom_channel {
|
||||
*
|
||||
*/
|
||||
struct iwl_eeprom_enhanced_txpwr {
|
||||
u16 common;
|
||||
__le16 common;
|
||||
s8 chain_a_max;
|
||||
s8 chain_b_max;
|
||||
s8 chain_c_max;
|
||||
@@ -360,7 +360,7 @@ struct iwl_eeprom_calib_subband_info {
|
||||
struct iwl_eeprom_calib_info {
|
||||
u8 saturation_power24; /* half-dBm (e.g. "34" = 17 dBm) */
|
||||
u8 saturation_power52; /* half-dBm */
|
||||
s16 voltage; /* signed */
|
||||
__le16 voltage; /* signed */
|
||||
struct iwl_eeprom_calib_subband_info
|
||||
band_info[EEPROM_TX_POWER_BANDS];
|
||||
} __attribute__ ((packed));
|
||||
|
@@ -234,7 +234,7 @@ cancel:
|
||||
}
|
||||
fail:
|
||||
if (cmd->reply_page) {
|
||||
free_pages(cmd->reply_page, priv->hw_params.rx_page_order);
|
||||
iwl_free_pages(priv, cmd->reply_page);
|
||||
cmd->reply_page = 0;
|
||||
}
|
||||
out:
|
||||
|
@@ -345,10 +345,8 @@ void iwl_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
|
||||
pci_unmap_page(priv->pci_dev, rxq->pool[i].page_dma,
|
||||
PAGE_SIZE << priv->hw_params.rx_page_order,
|
||||
PCI_DMA_FROMDEVICE);
|
||||
__free_pages(rxq->pool[i].page,
|
||||
priv->hw_params.rx_page_order);
|
||||
__iwl_free_pages(priv, rxq->pool[i].page);
|
||||
rxq->pool[i].page = NULL;
|
||||
priv->alloc_rxb_page--;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -416,9 +414,7 @@ void iwl_rx_queue_reset(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
|
||||
pci_unmap_page(priv->pci_dev, rxq->pool[i].page_dma,
|
||||
PAGE_SIZE << priv->hw_params.rx_page_order,
|
||||
PCI_DMA_FROMDEVICE);
|
||||
priv->alloc_rxb_page--;
|
||||
__free_pages(rxq->pool[i].page,
|
||||
priv->hw_params.rx_page_order);
|
||||
__iwl_free_pages(priv, rxq->pool[i].page);
|
||||
rxq->pool[i].page = NULL;
|
||||
}
|
||||
list_add_tail(&rxq->pool[i].list, &rxq->rx_used);
|
||||
@@ -654,47 +650,6 @@ void iwl_reply_statistics(struct iwl_priv *priv,
|
||||
}
|
||||
EXPORT_SYMBOL(iwl_reply_statistics);
|
||||
|
||||
#define PERFECT_RSSI (-20) /* dBm */
|
||||
#define WORST_RSSI (-95) /* dBm */
|
||||
#define RSSI_RANGE (PERFECT_RSSI - WORST_RSSI)
|
||||
|
||||
/* Calculate an indication of rx signal quality (a percentage, not dBm!).
|
||||
* See http://www.ces.clemson.edu/linux/signal_quality.shtml for info
|
||||
* about formulas used below. */
|
||||
static int iwl_calc_sig_qual(int rssi_dbm, int noise_dbm)
|
||||
{
|
||||
int sig_qual;
|
||||
int degradation = PERFECT_RSSI - rssi_dbm;
|
||||
|
||||
/* If we get a noise measurement, use signal-to-noise ratio (SNR)
|
||||
* as indicator; formula is (signal dbm - noise dbm).
|
||||
* SNR at or above 40 is a great signal (100%).
|
||||
* Below that, scale to fit SNR of 0 - 40 dB within 0 - 100% indicator.
|
||||
* Weakest usable signal is usually 10 - 15 dB SNR. */
|
||||
if (noise_dbm) {
|
||||
if (rssi_dbm - noise_dbm >= 40)
|
||||
return 100;
|
||||
else if (rssi_dbm < noise_dbm)
|
||||
return 0;
|
||||
sig_qual = ((rssi_dbm - noise_dbm) * 5) / 2;
|
||||
|
||||
/* Else use just the signal level.
|
||||
* This formula is a least squares fit of data points collected and
|
||||
* compared with a reference system that had a percentage (%) display
|
||||
* for signal quality. */
|
||||
} else
|
||||
sig_qual = (100 * (RSSI_RANGE * RSSI_RANGE) - degradation *
|
||||
(15 * RSSI_RANGE + 62 * degradation)) /
|
||||
(RSSI_RANGE * RSSI_RANGE);
|
||||
|
||||
if (sig_qual > 100)
|
||||
sig_qual = 100;
|
||||
else if (sig_qual < 1)
|
||||
sig_qual = 0;
|
||||
|
||||
return sig_qual;
|
||||
}
|
||||
|
||||
/* Calc max signal level (dBm) among 3 possible receivers */
|
||||
static inline int iwl_calc_rssi(struct iwl_priv *priv,
|
||||
struct iwl_rx_phy_res *rx_resp)
|
||||
@@ -1105,11 +1060,8 @@ void iwl_rx_reply_rx(struct iwl_priv *priv,
|
||||
if (iwl_is_associated(priv) &&
|
||||
!test_bit(STATUS_SCANNING, &priv->status)) {
|
||||
rx_status.noise = priv->last_rx_noise;
|
||||
rx_status.qual = iwl_calc_sig_qual(rx_status.signal,
|
||||
rx_status.noise);
|
||||
} else {
|
||||
rx_status.noise = IWL_NOISE_MEAS_NOT_AVAILABLE;
|
||||
rx_status.qual = iwl_calc_sig_qual(rx_status.signal, 0);
|
||||
}
|
||||
|
||||
/* Reset beacon noise level if not associated. */
|
||||
@@ -1122,8 +1074,8 @@ void iwl_rx_reply_rx(struct iwl_priv *priv,
|
||||
iwl_dbg_report_frame(priv, phy_res, len, header, 1);
|
||||
#endif
|
||||
iwl_dbg_log_rx_data_frame(priv, len, header);
|
||||
IWL_DEBUG_STATS_LIMIT(priv, "Rssi %d, noise %d, qual %d, TSF %llu\n",
|
||||
rx_status.signal, rx_status.noise, rx_status.qual,
|
||||
IWL_DEBUG_STATS_LIMIT(priv, "Rssi %d, noise %d, TSF %llu\n",
|
||||
rx_status.signal, rx_status.noise,
|
||||
(unsigned long long)rx_status.mactime);
|
||||
|
||||
/*
|
||||
|
@@ -144,8 +144,7 @@ static int iwl_send_scan_abort(struct iwl_priv *priv)
|
||||
clear_bit(STATUS_SCAN_HW, &priv->status);
|
||||
}
|
||||
|
||||
priv->alloc_rxb_page--;
|
||||
free_pages(cmd.reply_page, priv->hw_params.rx_page_order);
|
||||
iwl_free_pages(priv, cmd.reply_page);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@@ -164,9 +164,7 @@ int iwl_send_add_sta(struct iwl_priv *priv,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
priv->alloc_rxb_page--;
|
||||
free_pages(cmd.reply_page, priv->hw_params.rx_page_order);
|
||||
iwl_free_pages(priv, cmd.reply_page);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -391,9 +389,7 @@ static int iwl_send_remove_station(struct iwl_priv *priv, const u8 *addr,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
priv->alloc_rxb_page--;
|
||||
free_pages(cmd.reply_page, priv->hw_params.rx_page_order);
|
||||
iwl_free_pages(priv, cmd.reply_page);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@@ -407,13 +407,14 @@ void iwl_hw_txq_ctx_free(struct iwl_priv *priv)
|
||||
int txq_id;
|
||||
|
||||
/* Tx queues */
|
||||
if (priv->txq)
|
||||
if (priv->txq) {
|
||||
for (txq_id = 0; txq_id < priv->hw_params.max_txq_num;
|
||||
txq_id++)
|
||||
if (txq_id == IWL_CMD_QUEUE_NUM)
|
||||
iwl_cmd_queue_free(priv);
|
||||
else
|
||||
iwl_tx_queue_free(priv, txq_id);
|
||||
}
|
||||
iwl_free_dma_ptr(priv, &priv->kw);
|
||||
|
||||
iwl_free_dma_ptr(priv, &priv->scd_bc_tbls);
|
||||
|
@@ -548,6 +548,9 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
|
||||
txq = &priv->txq[txq_id];
|
||||
q = &txq->q;
|
||||
|
||||
if ((iwl_queue_space(q) < q->high_mark))
|
||||
goto drop;
|
||||
|
||||
spin_lock_irqsave(&priv->lock, flags);
|
||||
|
||||
idx = get_cmd_index(q, q->write_ptr, 0);
|
||||
@@ -812,7 +815,7 @@ static int iwl3945_get_measurement(struct iwl_priv *priv,
|
||||
break;
|
||||
}
|
||||
|
||||
free_pages(cmd.reply_page, priv->hw_params.rx_page_order);
|
||||
iwl_free_pages(priv, cmd.reply_page);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -1198,9 +1201,7 @@ void iwl3945_rx_queue_reset(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
|
||||
pci_unmap_page(priv->pci_dev, rxq->pool[i].page_dma,
|
||||
PAGE_SIZE << priv->hw_params.rx_page_order,
|
||||
PCI_DMA_FROMDEVICE);
|
||||
priv->alloc_rxb_page--;
|
||||
__free_pages(rxq->pool[i].page,
|
||||
priv->hw_params.rx_page_order);
|
||||
__iwl_free_pages(priv, rxq->pool[i].page);
|
||||
rxq->pool[i].page = NULL;
|
||||
}
|
||||
list_add_tail(&rxq->pool[i].list, &rxq->rx_used);
|
||||
@@ -1247,10 +1248,8 @@ static void iwl3945_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rx
|
||||
pci_unmap_page(priv->pci_dev, rxq->pool[i].page_dma,
|
||||
PAGE_SIZE << priv->hw_params.rx_page_order,
|
||||
PCI_DMA_FROMDEVICE);
|
||||
__free_pages(rxq->pool[i].page,
|
||||
priv->hw_params.rx_page_order);
|
||||
__iwl_free_pages(priv, rxq->pool[i].page);
|
||||
rxq->pool[i].page = NULL;
|
||||
priv->alloc_rxb_page--;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1300,47 +1299,6 @@ int iwl3945_calc_db_from_ratio(int sig_ratio)
|
||||
return (int)ratio2dB[sig_ratio];
|
||||
}
|
||||
|
||||
#define PERFECT_RSSI (-20) /* dBm */
|
||||
#define WORST_RSSI (-95) /* dBm */
|
||||
#define RSSI_RANGE (PERFECT_RSSI - WORST_RSSI)
|
||||
|
||||
/* Calculate an indication of rx signal quality (a percentage, not dBm!).
|
||||
* See http://www.ces.clemson.edu/linux/signal_quality.shtml for info
|
||||
* about formulas used below. */
|
||||
int iwl3945_calc_sig_qual(int rssi_dbm, int noise_dbm)
|
||||
{
|
||||
int sig_qual;
|
||||
int degradation = PERFECT_RSSI - rssi_dbm;
|
||||
|
||||
/* If we get a noise measurement, use signal-to-noise ratio (SNR)
|
||||
* as indicator; formula is (signal dbm - noise dbm).
|
||||
* SNR at or above 40 is a great signal (100%).
|
||||
* Below that, scale to fit SNR of 0 - 40 dB within 0 - 100% indicator.
|
||||
* Weakest usable signal is usually 10 - 15 dB SNR. */
|
||||
if (noise_dbm) {
|
||||
if (rssi_dbm - noise_dbm >= 40)
|
||||
return 100;
|
||||
else if (rssi_dbm < noise_dbm)
|
||||
return 0;
|
||||
sig_qual = ((rssi_dbm - noise_dbm) * 5) / 2;
|
||||
|
||||
/* Else use just the signal level.
|
||||
* This formula is a least squares fit of data points collected and
|
||||
* compared with a reference system that had a percentage (%) display
|
||||
* for signal quality. */
|
||||
} else
|
||||
sig_qual = (100 * (RSSI_RANGE * RSSI_RANGE) - degradation *
|
||||
(15 * RSSI_RANGE + 62 * degradation)) /
|
||||
(RSSI_RANGE * RSSI_RANGE);
|
||||
|
||||
if (sig_qual > 100)
|
||||
sig_qual = 100;
|
||||
else if (sig_qual < 1)
|
||||
sig_qual = 0;
|
||||
|
||||
return sig_qual;
|
||||
}
|
||||
|
||||
/**
|
||||
* iwl3945_rx_handle - Main entry function for receiving responses from uCode
|
||||
*
|
||||
@@ -1688,7 +1646,7 @@ void iwl3945_dump_nic_event_log(struct iwl_priv *priv, bool full_log)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IWLWIFI_DEBUG
|
||||
if (!(iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS))
|
||||
if (!(iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS) && !full_log)
|
||||
size = (size > DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES)
|
||||
? DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES : size;
|
||||
#else
|
||||
@@ -3867,7 +3825,6 @@ static int iwl3945_init_drv(struct iwl_priv *priv)
|
||||
priv->retry_rate = 1;
|
||||
priv->ibss_beacon = NULL;
|
||||
|
||||
spin_lock_init(&priv->lock);
|
||||
spin_lock_init(&priv->sta_lock);
|
||||
spin_lock_init(&priv->hcmd_lock);
|
||||
|
||||
@@ -3936,9 +3893,11 @@ static int iwl3945_setup_mac(struct iwl_priv *priv)
|
||||
/* Tell mac80211 our characteristics */
|
||||
hw->flags = IEEE80211_HW_SIGNAL_DBM |
|
||||
IEEE80211_HW_NOISE_DBM |
|
||||
IEEE80211_HW_SPECTRUM_MGMT |
|
||||
IEEE80211_HW_SUPPORTS_PS |
|
||||
IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
|
||||
IEEE80211_HW_SPECTRUM_MGMT;
|
||||
|
||||
if (!priv->cfg->broken_powersave)
|
||||
hw->flags |= IEEE80211_HW_SUPPORTS_PS |
|
||||
IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
|
||||
|
||||
hw->wiphy->interface_modes =
|
||||
BIT(NL80211_IFTYPE_STATION) |
|
||||
@@ -4057,10 +4016,11 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
|
||||
* PCI Tx retries from interfering with C3 CPU state */
|
||||
pci_write_config_byte(pdev, 0x41, 0x00);
|
||||
|
||||
/* this spin lock will be used in apm_ops.init and EEPROM access
|
||||
/* these spin locks will be used in apm_ops.init and EEPROM access
|
||||
* we should init now
|
||||
*/
|
||||
spin_lock_init(&priv->reg_lock);
|
||||
spin_lock_init(&priv->lock);
|
||||
|
||||
/***********************
|
||||
* 4. Read EEPROM
|
||||
|
Reference in New Issue
Block a user