* [PATCH 00/10] iwlwifi update for 2.6.36
From: Wey-Yi Guy @ 2010-07-23 16:15 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy
We add statistics notification support for WiFi/BT combo devices.
We also add the capability to read multiple MAC address from EEPROM and
advertise them to cfg80211.
We also fix the gcc complains about the firmware loading on parsing TLV.
Johannes Berg (4):
iwlagn: fix firmware loading TLV error path
iwlwifi: make iwl_mac_beacon_update static
iwlwifi: reduce beacon fill conditions
iwlwifi: remove spurious semicolons
Wey-Yi Guy (6):
iwlagn: add statistic notification structure for WiFi/BT devices
iwlagn: add .cfg flag to idenfity the need for bt statistics
iwlagn: Add support for bluetooth statistics notification
iwlagn: add bluetooth stats to debugfs
iwlwifi: add TLV to specify the size of phy calibration table
iwlwifi: read multiple MAC addresses
these patches are also available from wireless-next-2.6 branch on
git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-2.6.git
drivers/net/wireless/iwlwifi/iwl-1000.c | 1 +
drivers/net/wireless/iwlwifi/iwl-4965.c | 5 +-
drivers/net/wireless/iwlwifi/iwl-5000.c | 3 +-
drivers/net/wireless/iwlwifi/iwl-6000.c | 7 +
drivers/net/wireless/iwlwifi/iwl-agn-calib.c | 64 +++++--
drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c | 225 +++++++++++++++++++-----
drivers/net/wireless/iwlwifi/iwl-agn-debugfs.h | 7 +
drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c | 4 +-
drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 2 +-
drivers/net/wireless/iwlwifi/iwl-agn-rx.c | 167 ++++++++++++------
drivers/net/wireless/iwlwifi/iwl-agn.c | 130 +++++++++------
drivers/net/wireless/iwlwifi/iwl-calib.h | 6 +-
drivers/net/wireless/iwlwifi/iwl-commands.h | 55 ++++++-
drivers/net/wireless/iwlwifi/iwl-core.c | 63 ++++----
drivers/net/wireless/iwlwifi/iwl-core.h | 4 +-
drivers/net/wireless/iwlwifi/iwl-debugfs.c | 13 ++
drivers/net/wireless/iwlwifi/iwl-dev.h | 16 ++
drivers/net/wireless/iwlwifi/iwl-eeprom.h | 1 +
drivers/net/wireless/iwlwifi/iwl3945-base.c | 4 +-
19 files changed, 561 insertions(+), 216 deletions(-)
^ permalink raw reply
* [PATCH 02/10] iwlagn: add .cfg flag to idenfity the need for bt statistics
From: Wey-Yi Guy @ 2010-07-23 16:15 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy
In-Reply-To: <1279901739-10541-1-git-send-email-wey-yi.w.guy@intel.com>
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Only WiFi/BT combo devices need to use bluetooth version of statistics
notification; adding the flag in .cfg file to indicate the need for
using different data structure.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-6000.c | 6 ++++++
drivers/net/wireless/iwlwifi/iwl-core.h | 1 +
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 0955219..a4e58d8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -500,6 +500,7 @@ struct iwl_cfg iwl6000g2b_2agn_cfg = {
.sensitivity_calib_by_driver = true,
.chain_noise_calib_by_driver = true,
.need_dc_calib = true,
+ .bt_statistics = true,
};
struct iwl_cfg iwl6000g2b_2abg_cfg = {
@@ -535,6 +536,7 @@ struct iwl_cfg iwl6000g2b_2abg_cfg = {
.sensitivity_calib_by_driver = true,
.chain_noise_calib_by_driver = true,
.need_dc_calib = true,
+ .bt_statistics = true,
};
struct iwl_cfg iwl6000g2b_2bgn_cfg = {
@@ -572,6 +574,7 @@ struct iwl_cfg iwl6000g2b_2bgn_cfg = {
.sensitivity_calib_by_driver = true,
.chain_noise_calib_by_driver = true,
.need_dc_calib = true,
+ .bt_statistics = true,
};
struct iwl_cfg iwl6000g2b_2bg_cfg = {
@@ -607,6 +610,7 @@ struct iwl_cfg iwl6000g2b_2bg_cfg = {
.sensitivity_calib_by_driver = true,
.chain_noise_calib_by_driver = true,
.need_dc_calib = true,
+ .bt_statistics = true,
};
struct iwl_cfg iwl6000g2b_bgn_cfg = {
@@ -644,6 +648,7 @@ struct iwl_cfg iwl6000g2b_bgn_cfg = {
.sensitivity_calib_by_driver = true,
.chain_noise_calib_by_driver = true,
.need_dc_calib = true,
+ .bt_statistics = true,
};
struct iwl_cfg iwl6000g2b_bg_cfg = {
@@ -679,6 +684,7 @@ struct iwl_cfg iwl6000g2b_bg_cfg = {
.sensitivity_calib_by_driver = true,
.chain_noise_calib_by_driver = true,
.need_dc_calib = true,
+ .bt_statistics = true,
};
/*
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index fcbba3d..2954a52 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -335,6 +335,7 @@ struct iwl_cfg {
u8 scan_rx_antennas[IEEE80211_NUM_BANDS];
u8 scan_tx_antennas[IEEE80211_NUM_BANDS];
const bool need_dc_calib;
+ const bool bt_statistics;
};
/***************************
--
1.7.0.4
^ permalink raw reply related
* [PATCH 01/10] iwlagn: add statistic notification structure for WiFi/BT devices
From: Wey-Yi Guy @ 2010-07-23 16:15 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy
In-Reply-To: <1279901739-10541-1-git-send-email-wey-yi.w.guy@intel.com>
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
If its WiFi/BT combo device, the statistics notification sent by
uCode will include the additional BT related statistics counters.
Adding new data structure to support the new layout.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-4965.c | 4 +-
drivers/net/wireless/iwlwifi/iwl-5000.c | 2 +-
drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c | 28 +++++++-------
drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 2 +-
drivers/net/wireless/iwlwifi/iwl-agn-rx.c | 16 ++++----
drivers/net/wireless/iwlwifi/iwl-commands.h | 46 +++++++++++++++++++++++-
6 files changed, 71 insertions(+), 27 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 3a0d0ad..27a776f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -1605,8 +1605,8 @@ static int iwl4965_hw_get_temperature(struct iwl_priv *priv)
if (!test_bit(STATUS_TEMPERATURE, &priv->status))
vt = sign_extend(R4, 23);
else
- vt = sign_extend(le32_to_cpu(
- priv->_agn.statistics.general.temperature), 23);
+ vt = sign_extend(le32_to_cpu(priv->_agn.statistics.
+ general.common.temperature), 23);
IWL_DEBUG_TEMP(priv, "Calib values R[1-3]: %d %d %d R4: %d\n", R1, R2, R3, vt);
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 7d89d99..a7077cd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -265,7 +265,7 @@ static void iwl5150_temperature(struct iwl_priv *priv)
u32 vt = 0;
s32 offset = iwl_temp_calib_to_offset(priv);
- vt = le32_to_cpu(priv->_agn.statistics.general.temperature);
+ vt = le32_to_cpu(priv->_agn.statistics.general.common.temperature);
vt = vt / IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF + offset;
/* now vt hold the temperature in Kelvin */
priv->temperature = KELVIN_TO_CELSIUS(vt);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
index 5e5c512..11dd1f7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
@@ -759,8 +759,8 @@ ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user_buf,
char *buf;
int bufsz = sizeof(struct statistics_general) * 10 + 300;
ssize_t ret;
- struct statistics_general *general, *accum_general;
- struct statistics_general *delta_general, *max_general;
+ struct statistics_general_common *general, *accum_general;
+ struct statistics_general_common *delta_general, *max_general;
struct statistics_dbg *dbg, *accum_dbg, *delta_dbg, *max_dbg;
struct statistics_div *div, *accum_div, *delta_div, *max_div;
@@ -777,18 +777,18 @@ ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user_buf,
* the last statistics notification from uCode
* might not reflect the current uCode activity
*/
- general = &priv->_agn.statistics.general;
- dbg = &priv->_agn.statistics.general.dbg;
- div = &priv->_agn.statistics.general.div;
- accum_general = &priv->_agn.accum_statistics.general;
- delta_general = &priv->_agn.delta_statistics.general;
- max_general = &priv->_agn.max_delta.general;
- accum_dbg = &priv->_agn.accum_statistics.general.dbg;
- delta_dbg = &priv->_agn.delta_statistics.general.dbg;
- max_dbg = &priv->_agn.max_delta.general.dbg;
- accum_div = &priv->_agn.accum_statistics.general.div;
- delta_div = &priv->_agn.delta_statistics.general.div;
- max_div = &priv->_agn.max_delta.general.div;
+ general = &priv->_agn.statistics.general.common;
+ dbg = &priv->_agn.statistics.general.common.dbg;
+ div = &priv->_agn.statistics.general.common.div;
+ accum_general = &priv->_agn.accum_statistics.general.common;
+ delta_general = &priv->_agn.delta_statistics.general.common;
+ max_general = &priv->_agn.max_delta.general.common;
+ accum_dbg = &priv->_agn.accum_statistics.general.common.dbg;
+ delta_dbg = &priv->_agn.delta_statistics.general.common.dbg;
+ max_dbg = &priv->_agn.max_delta.general.common.dbg;
+ accum_div = &priv->_agn.accum_statistics.general.common.div;
+ delta_div = &priv->_agn.delta_statistics.general.common.div;
+ max_div = &priv->_agn.max_delta.general.common.div;
pos += iwl_statistics_flag(priv, buf, bufsz);
pos += scnprintf(buf + pos, bufsz - pos, "%-32s current"
"acumulative delta max\n",
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 74623e0..dda71cd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -364,7 +364,7 @@ void iwlagn_temperature(struct iwl_priv *priv)
{
/* store temperature from statistics (in Celsius) */
priv->temperature =
- le32_to_cpu(priv->_agn.statistics.general.temperature);
+ le32_to_cpu(priv->_agn.statistics.general.common.temperature);
iwl_tt_handler(priv);
}
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
index d54edc3..249b77b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
@@ -135,12 +135,12 @@ static void iwl_accumulative_statistics(struct iwl_priv *priv,
}
/* reset accumulative statistics for "no-counter" type statistics */
- priv->_agn.accum_statistics.general.temperature =
- priv->_agn.statistics.general.temperature;
- priv->_agn.accum_statistics.general.temperature_m =
- priv->_agn.statistics.general.temperature_m;
- priv->_agn.accum_statistics.general.ttl_timestamp =
- priv->_agn.statistics.general.ttl_timestamp;
+ priv->_agn.accum_statistics.general.common.temperature =
+ priv->_agn.statistics.general.common.temperature;
+ priv->_agn.accum_statistics.general.common.temperature_m =
+ priv->_agn.statistics.general.common.temperature_m;
+ priv->_agn.accum_statistics.general.common.ttl_timestamp =
+ priv->_agn.statistics.general.common.ttl_timestamp;
priv->_agn.accum_statistics.tx.tx_power.ant_a =
priv->_agn.statistics.tx.tx_power.ant_a;
priv->_agn.accum_statistics.tx.tx_power.ant_b =
@@ -232,8 +232,8 @@ void iwl_rx_statistics(struct iwl_priv *priv,
(int)sizeof(priv->_agn.statistics),
le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK);
- change = ((priv->_agn.statistics.general.temperature !=
- pkt->u.stats.general.temperature) ||
+ change = ((priv->_agn.statistics.general.common.temperature !=
+ pkt->u.stats.general.common.temperature) ||
((priv->_agn.statistics.flag &
STATISTICS_REPLY_FLG_HT40_MODE_MSK) !=
(pkt->u.stats.flag & STATISTICS_REPLY_FLG_HT40_MODE_MSK)));
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index 83247f7..4be9063 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -3127,6 +3127,13 @@ struct statistics_rx_non_phy {
__le32 beacon_energy_c;
} __attribute__ ((packed));
+struct statistics_rx_non_phy_bt {
+ struct statistics_rx_non_phy common;
+ /* additional stats for bt */
+ __le32 num_bt_kills;
+ __le32 reserved[2];
+} __attribute__ ((packed));
+
struct statistics_rx {
struct statistics_rx_phy ofdm;
struct statistics_rx_phy cck;
@@ -3134,6 +3141,13 @@ struct statistics_rx {
struct statistics_rx_ht_phy ofdm_ht;
} __attribute__ ((packed));
+struct statistics_rx_bt {
+ struct statistics_rx_phy ofdm;
+ struct statistics_rx_phy cck;
+ struct statistics_rx_non_phy_bt general;
+ struct statistics_rx_ht_phy ofdm_ht;
+} __attribute__ ((packed));
+
/**
* struct statistics_tx_power - current tx power
*
@@ -3196,7 +3210,7 @@ struct statistics_div {
__le32 reserved2;
} __attribute__ ((packed));
-struct statistics_general {
+struct statistics_general_common {
__le32 temperature; /* radio temperature */
__le32 temperature_m; /* for 5000 and up, this is radio voltage */
struct statistics_dbg dbg;
@@ -3212,6 +3226,30 @@ struct statistics_general {
* in order to get out of bad PHY status
*/
__le32 num_of_sos_states;
+} __attribute__ ((packed));
+
+struct statistics_bt_activity {
+ /* Tx statistics */
+ __le32 hi_priority_tx_req_cnt;
+ __le32 hi_priority_tx_denied_cnt;
+ __le32 lo_priority_tx_req_cnt;
+ __le32 lo_priority_tx_denied_cnt;
+ /* Rx statistics */
+ __le32 hi_priority_rx_req_cnt;
+ __le32 hi_priority_rx_denied_cnt;
+ __le32 lo_priority_rx_req_cnt;
+ __le32 lo_priority_rx_denied_cnt;
+} __attribute__ ((packed));
+
+struct statistics_general {
+ struct statistics_general_common common;
+ __le32 reserved2;
+ __le32 reserved3;
+} __attribute__ ((packed));
+
+struct statistics_general_bt {
+ struct statistics_general_common common;
+ struct statistics_bt_activity activity;
__le32 reserved2;
__le32 reserved3;
} __attribute__ ((packed));
@@ -3273,6 +3311,12 @@ struct iwl_notif_statistics {
struct statistics_general general;
} __attribute__ ((packed));
+struct iwl_bt_notif_statistics {
+ __le32 flag;
+ struct statistics_rx_bt rx;
+ struct statistics_tx tx;
+ struct statistics_general_bt general;
+} __attribute__ ((packed));
/*
* MISSED_BEACONS_NOTIFICATION = 0xa2 (notification only, not a command)
--
1.7.0.4
^ permalink raw reply related
* [PATCH 03/10] iwlagn: Add support for bluetooth statistics notification
From: Wey-Yi Guy @ 2010-07-23 16:15 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy
In-Reply-To: <1279901739-10541-1-git-send-email-wey-yi.w.guy@intel.com>
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
WiFi/BT combo devices has different statistics notification
structure, adding the support here to make sure the structure
align correctly.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-agn-calib.c | 64 +++++++---
drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c | 134 +++++++++++++------
drivers/net/wireless/iwlwifi/iwl-agn-rx.c | 167 +++++++++++++++++-------
drivers/net/wireless/iwlwifi/iwl-agn.c | 14 ++-
drivers/net/wireless/iwlwifi/iwl-calib.h | 6 +-
drivers/net/wireless/iwlwifi/iwl-commands.h | 1 +
drivers/net/wireless/iwlwifi/iwl-dev.h | 4 +
7 files changed, 271 insertions(+), 119 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-calib.c b/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
index 90033e8..c4c5691 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
@@ -605,8 +605,7 @@ void iwl_init_sensitivity(struct iwl_priv *priv)
IWL_DEBUG_CALIB(priv, "<<return 0x%X\n", ret);
}
-void iwl_sensitivity_calibration(struct iwl_priv *priv,
- struct iwl_notif_statistics *resp)
+void iwl_sensitivity_calibration(struct iwl_priv *priv, void *resp)
{
u32 rx_enable_time;
u32 fa_cck;
@@ -616,8 +615,8 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv,
u32 norm_fa_ofdm;
u32 norm_fa_cck;
struct iwl_sensitivity_data *data = NULL;
- struct statistics_rx_non_phy *rx_info = &(resp->rx.general);
- struct statistics_rx *statistics = &(resp->rx);
+ struct statistics_rx_non_phy *rx_info;
+ struct statistics_rx_phy *ofdm, *cck;
unsigned long flags;
struct statistics_general_data statis;
@@ -632,6 +631,16 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv,
}
spin_lock_irqsave(&priv->lock, flags);
+ if (priv->cfg->bt_statistics) {
+ rx_info = &(((struct iwl_bt_notif_statistics *)resp)->
+ rx.general.common);
+ ofdm = &(((struct iwl_bt_notif_statistics *)resp)->rx.ofdm);
+ cck = &(((struct iwl_bt_notif_statistics *)resp)->rx.cck);
+ } else {
+ rx_info = &(((struct iwl_notif_statistics *)resp)->rx.general);
+ ofdm = &(((struct iwl_notif_statistics *)resp)->rx.ofdm);
+ cck = &(((struct iwl_notif_statistics *)resp)->rx.cck);
+ }
if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) {
IWL_DEBUG_CALIB(priv, "<< invalid data.\n");
spin_unlock_irqrestore(&priv->lock, flags);
@@ -640,23 +649,23 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv,
/* Extract Statistics: */
rx_enable_time = le32_to_cpu(rx_info->channel_load);
- fa_cck = le32_to_cpu(statistics->cck.false_alarm_cnt);
- fa_ofdm = le32_to_cpu(statistics->ofdm.false_alarm_cnt);
- bad_plcp_cck = le32_to_cpu(statistics->cck.plcp_err);
- bad_plcp_ofdm = le32_to_cpu(statistics->ofdm.plcp_err);
+ fa_cck = le32_to_cpu(cck->false_alarm_cnt);
+ fa_ofdm = le32_to_cpu(ofdm->false_alarm_cnt);
+ bad_plcp_cck = le32_to_cpu(cck->plcp_err);
+ bad_plcp_ofdm = le32_to_cpu(ofdm->plcp_err);
statis.beacon_silence_rssi_a =
- le32_to_cpu(statistics->general.beacon_silence_rssi_a);
+ le32_to_cpu(rx_info->beacon_silence_rssi_a);
statis.beacon_silence_rssi_b =
- le32_to_cpu(statistics->general.beacon_silence_rssi_b);
+ le32_to_cpu(rx_info->beacon_silence_rssi_b);
statis.beacon_silence_rssi_c =
- le32_to_cpu(statistics->general.beacon_silence_rssi_c);
+ le32_to_cpu(rx_info->beacon_silence_rssi_c);
statis.beacon_energy_a =
- le32_to_cpu(statistics->general.beacon_energy_a);
+ le32_to_cpu(rx_info->beacon_energy_a);
statis.beacon_energy_b =
- le32_to_cpu(statistics->general.beacon_energy_b);
+ le32_to_cpu(rx_info->beacon_energy_b);
statis.beacon_energy_c =
- le32_to_cpu(statistics->general.beacon_energy_c);
+ le32_to_cpu(rx_info->beacon_energy_c);
spin_unlock_irqrestore(&priv->lock, flags);
@@ -728,8 +737,7 @@ static inline u8 find_first_chain(u8 mask)
* 1) Which antennas are connected.
* 2) Differential rx gain settings to balance the 3 receivers.
*/
-void iwl_chain_noise_calibration(struct iwl_priv *priv,
- struct iwl_notif_statistics *stat_resp)
+void iwl_chain_noise_calibration(struct iwl_priv *priv, void *stat_resp)
{
struct iwl_chain_noise_data *data = NULL;
@@ -753,7 +761,7 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
u32 active_chains = 0;
u8 num_tx_chains;
unsigned long flags;
- struct statistics_rx_non_phy *rx_info = &(stat_resp->rx.general);
+ struct statistics_rx_non_phy *rx_info;
u8 first_chain;
if (priv->disable_chain_noise_cal)
@@ -772,6 +780,13 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
}
spin_lock_irqsave(&priv->lock, flags);
+ if (priv->cfg->bt_statistics) {
+ rx_info = &(((struct iwl_bt_notif_statistics *)stat_resp)->
+ rx.general.common);
+ } else {
+ rx_info = &(((struct iwl_notif_statistics *)stat_resp)->
+ rx.general);
+ }
if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) {
IWL_DEBUG_CALIB(priv, " << Interference data unavailable\n");
spin_unlock_irqrestore(&priv->lock, flags);
@@ -780,8 +795,19 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv,
rxon_band24 = !!(priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK);
rxon_chnum = le16_to_cpu(priv->staging_rxon.channel);
- stat_band24 = !!(stat_resp->flag & STATISTICS_REPLY_FLG_BAND_24G_MSK);
- stat_chnum = le32_to_cpu(stat_resp->flag) >> 16;
+ if (priv->cfg->bt_statistics) {
+ stat_band24 = !!(((struct iwl_bt_notif_statistics *)
+ stat_resp)->flag &
+ STATISTICS_REPLY_FLG_BAND_24G_MSK);
+ stat_chnum = le32_to_cpu(((struct iwl_bt_notif_statistics *)
+ stat_resp)->flag) >> 16;
+ } else {
+ stat_band24 = !!(((struct iwl_notif_statistics *)
+ stat_resp)->flag &
+ STATISTICS_REPLY_FLG_BAND_24G_MSK);
+ stat_chnum = le32_to_cpu(((struct iwl_notif_statistics *)
+ stat_resp)->flag) >> 16;
+ }
/* Make sure we accumulate data for just the associated channel
* (even if scanning). */
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
index 11dd1f7..19d1e5e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
@@ -31,21 +31,24 @@
static int iwl_statistics_flag(struct iwl_priv *priv, char *buf, int bufsz)
{
int p = 0;
+ u32 flag;
- p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n",
- le32_to_cpu(priv->_agn.statistics.flag));
- if (le32_to_cpu(priv->_agn.statistics.flag) &
- UCODE_STATISTICS_CLEAR_MSK)
+ if (priv->cfg->bt_statistics)
+ flag = le32_to_cpu(priv->_agn.statistics_bt.flag);
+ else
+ flag = le32_to_cpu(priv->_agn.statistics.flag);
+
+ p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n", flag);
+ if (flag & UCODE_STATISTICS_CLEAR_MSK)
p += scnprintf(buf + p, bufsz - p,
- "\tStatistics have been cleared\n");
+ "\tStatistics have been cleared\n");
p += scnprintf(buf + p, bufsz - p, "\tOperational Frequency: %s\n",
- (le32_to_cpu(priv->_agn.statistics.flag) &
- UCODE_STATISTICS_FREQUENCY_MSK)
- ? "2.4 GHz" : "5.2 GHz");
+ (flag & UCODE_STATISTICS_FREQUENCY_MSK)
+ ? "2.4 GHz" : "5.2 GHz");
p += scnprintf(buf + p, bufsz - p, "\tTGj Narrow Band: %s\n",
- (le32_to_cpu(priv->_agn.statistics.flag) &
- UCODE_STATISTICS_NARROW_BAND_MSK)
- ? "enabled" : "disabled");
+ (flag & UCODE_STATISTICS_NARROW_BAND_MSK)
+ ? "enabled" : "disabled");
+
return p;
}
@@ -79,22 +82,43 @@ ssize_t iwl_ucode_rx_stats_read(struct file *file, char __user *user_buf,
* the last statistics notification from uCode
* might not reflect the current uCode activity
*/
- ofdm = &priv->_agn.statistics.rx.ofdm;
- cck = &priv->_agn.statistics.rx.cck;
- general = &priv->_agn.statistics.rx.general;
- ht = &priv->_agn.statistics.rx.ofdm_ht;
- accum_ofdm = &priv->_agn.accum_statistics.rx.ofdm;
- accum_cck = &priv->_agn.accum_statistics.rx.cck;
- accum_general = &priv->_agn.accum_statistics.rx.general;
- accum_ht = &priv->_agn.accum_statistics.rx.ofdm_ht;
- delta_ofdm = &priv->_agn.delta_statistics.rx.ofdm;
- delta_cck = &priv->_agn.delta_statistics.rx.cck;
- delta_general = &priv->_agn.delta_statistics.rx.general;
- delta_ht = &priv->_agn.delta_statistics.rx.ofdm_ht;
- max_ofdm = &priv->_agn.max_delta.rx.ofdm;
- max_cck = &priv->_agn.max_delta.rx.cck;
- max_general = &priv->_agn.max_delta.rx.general;
- max_ht = &priv->_agn.max_delta.rx.ofdm_ht;
+ if (priv->cfg->bt_statistics) {
+ ofdm = &priv->_agn.statistics_bt.rx.ofdm;
+ cck = &priv->_agn.statistics_bt.rx.cck;
+ general = &priv->_agn.statistics_bt.rx.general.common;
+ ht = &priv->_agn.statistics_bt.rx.ofdm_ht;
+ accum_ofdm = &priv->_agn.accum_statistics_bt.rx.ofdm;
+ accum_cck = &priv->_agn.accum_statistics_bt.rx.cck;
+ accum_general =
+ &priv->_agn.accum_statistics_bt.rx.general.common;
+ accum_ht = &priv->_agn.accum_statistics_bt.rx.ofdm_ht;
+ delta_ofdm = &priv->_agn.delta_statistics_bt.rx.ofdm;
+ delta_cck = &priv->_agn.delta_statistics_bt.rx.cck;
+ delta_general =
+ &priv->_agn.delta_statistics_bt.rx.general.common;
+ delta_ht = &priv->_agn.delta_statistics_bt.rx.ofdm_ht;
+ max_ofdm = &priv->_agn.max_delta_bt.rx.ofdm;
+ max_cck = &priv->_agn.max_delta_bt.rx.cck;
+ max_general = &priv->_agn.max_delta_bt.rx.general.common;
+ max_ht = &priv->_agn.max_delta_bt.rx.ofdm_ht;
+ } else {
+ ofdm = &priv->_agn.statistics.rx.ofdm;
+ cck = &priv->_agn.statistics.rx.cck;
+ general = &priv->_agn.statistics.rx.general;
+ ht = &priv->_agn.statistics.rx.ofdm_ht;
+ accum_ofdm = &priv->_agn.accum_statistics.rx.ofdm;
+ accum_cck = &priv->_agn.accum_statistics.rx.cck;
+ accum_general = &priv->_agn.accum_statistics.rx.general;
+ accum_ht = &priv->_agn.accum_statistics.rx.ofdm_ht;
+ delta_ofdm = &priv->_agn.delta_statistics.rx.ofdm;
+ delta_cck = &priv->_agn.delta_statistics.rx.cck;
+ delta_general = &priv->_agn.delta_statistics.rx.general;
+ delta_ht = &priv->_agn.delta_statistics.rx.ofdm_ht;
+ max_ofdm = &priv->_agn.max_delta.rx.ofdm;
+ max_cck = &priv->_agn.max_delta.rx.cck;
+ max_general = &priv->_agn.max_delta.rx.general;
+ max_ht = &priv->_agn.max_delta.rx.ofdm_ht;
+ }
pos += iwl_statistics_flag(priv, buf, bufsz);
pos += scnprintf(buf + pos, bufsz - pos, "%-32s current"
@@ -560,10 +584,18 @@ ssize_t iwl_ucode_tx_stats_read(struct file *file,
* the last statistics notification from uCode
* might not reflect the current uCode activity
*/
- tx = &priv->_agn.statistics.tx;
- accum_tx = &priv->_agn.accum_statistics.tx;
- delta_tx = &priv->_agn.delta_statistics.tx;
- max_tx = &priv->_agn.max_delta.tx;
+ if (priv->cfg->bt_statistics) {
+ tx = &priv->_agn.statistics_bt.tx;
+ accum_tx = &priv->_agn.accum_statistics_bt.tx;
+ delta_tx = &priv->_agn.delta_statistics_bt.tx;
+ max_tx = &priv->_agn.max_delta_bt.tx;
+ } else {
+ tx = &priv->_agn.statistics.tx;
+ accum_tx = &priv->_agn.accum_statistics.tx;
+ delta_tx = &priv->_agn.delta_statistics.tx;
+ max_tx = &priv->_agn.max_delta.tx;
+ }
+
pos += iwl_statistics_flag(priv, buf, bufsz);
pos += scnprintf(buf + pos, bufsz - pos, "%-32s current"
"acumulative delta max\n",
@@ -777,18 +809,34 @@ ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user_buf,
* the last statistics notification from uCode
* might not reflect the current uCode activity
*/
- general = &priv->_agn.statistics.general.common;
- dbg = &priv->_agn.statistics.general.common.dbg;
- div = &priv->_agn.statistics.general.common.div;
- accum_general = &priv->_agn.accum_statistics.general.common;
- delta_general = &priv->_agn.delta_statistics.general.common;
- max_general = &priv->_agn.max_delta.general.common;
- accum_dbg = &priv->_agn.accum_statistics.general.common.dbg;
- delta_dbg = &priv->_agn.delta_statistics.general.common.dbg;
- max_dbg = &priv->_agn.max_delta.general.common.dbg;
- accum_div = &priv->_agn.accum_statistics.general.common.div;
- delta_div = &priv->_agn.delta_statistics.general.common.div;
- max_div = &priv->_agn.max_delta.general.common.div;
+ if (priv->cfg->bt_statistics) {
+ general = &priv->_agn.statistics_bt.general.common;
+ dbg = &priv->_agn.statistics_bt.general.common.dbg;
+ div = &priv->_agn.statistics_bt.general.common.div;
+ accum_general = &priv->_agn.accum_statistics_bt.general.common;
+ accum_dbg = &priv->_agn.accum_statistics_bt.general.common.dbg;
+ accum_div = &priv->_agn.accum_statistics_bt.general.common.div;
+ delta_general = &priv->_agn.delta_statistics_bt.general.common;
+ max_general = &priv->_agn.max_delta_bt.general.common;
+ delta_dbg = &priv->_agn.delta_statistics_bt.general.common.dbg;
+ max_dbg = &priv->_agn.max_delta_bt.general.common.dbg;
+ delta_div = &priv->_agn.delta_statistics_bt.general.common.div;
+ max_div = &priv->_agn.max_delta_bt.general.common.div;
+ } else {
+ general = &priv->_agn.statistics.general.common;
+ dbg = &priv->_agn.statistics.general.common.dbg;
+ div = &priv->_agn.statistics.general.common.div;
+ accum_general = &priv->_agn.accum_statistics.general.common;
+ accum_dbg = &priv->_agn.accum_statistics.general.common.dbg;
+ accum_div = &priv->_agn.accum_statistics.general.common.div;
+ delta_general = &priv->_agn.delta_statistics.general.common;
+ max_general = &priv->_agn.max_delta.general.common;
+ delta_dbg = &priv->_agn.delta_statistics.general.common.dbg;
+ max_dbg = &priv->_agn.max_delta.general.common.dbg;
+ delta_div = &priv->_agn.delta_statistics.general.common.div;
+ max_div = &priv->_agn.max_delta.general.common.div;
+ }
+
pos += iwl_statistics_flag(priv, buf, bufsz);
pos += scnprintf(buf + pos, bufsz - pos, "%-32s current"
"acumulative delta max\n",
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
index 249b77b..9490ece 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
@@ -67,17 +67,22 @@ void iwl_rx_missed_beacon_notif(struct iwl_priv *priv,
* exactly when to expect beacons, therefore only when we're associated. */
static void iwl_rx_calc_noise(struct iwl_priv *priv)
{
- struct statistics_rx_non_phy *rx_info
- = &(priv->_agn.statistics.rx.general);
+ struct statistics_rx_non_phy *rx_info;
int num_active_rx = 0;
int total_silence = 0;
- int bcn_silence_a =
+ int bcn_silence_a, bcn_silence_b, bcn_silence_c;
+ int last_rx_noise;
+
+ if (priv->cfg->bt_statistics)
+ rx_info = &(priv->_agn.statistics_bt.rx.general.common);
+ else
+ rx_info = &(priv->_agn.statistics.rx.general);
+ bcn_silence_a =
le32_to_cpu(rx_info->beacon_silence_rssi_a) & IN_BAND_FILTER;
- int bcn_silence_b =
+ bcn_silence_b =
le32_to_cpu(rx_info->beacon_silence_rssi_b) & IN_BAND_FILTER;
- int bcn_silence_c =
+ bcn_silence_c =
le32_to_cpu(rx_info->beacon_silence_rssi_c) & IN_BAND_FILTER;
- int last_rx_noise;
if (bcn_silence_a) {
total_silence += bcn_silence_a;
@@ -112,17 +117,35 @@ static void iwl_rx_calc_noise(struct iwl_priv *priv)
static void iwl_accumulative_statistics(struct iwl_priv *priv,
__le32 *stats)
{
- int i;
+ int i, size;
__le32 *prev_stats;
u32 *accum_stats;
u32 *delta, *max_delta;
+ struct statistics_general_common *general, *accum_general;
+ struct statistics_tx *tx, *accum_tx;
- prev_stats = (__le32 *)&priv->_agn.statistics;
- accum_stats = (u32 *)&priv->_agn.accum_statistics;
- delta = (u32 *)&priv->_agn.delta_statistics;
- max_delta = (u32 *)&priv->_agn.max_delta;
-
- for (i = sizeof(__le32); i < sizeof(struct iwl_notif_statistics);
+ if (priv->cfg->bt_statistics) {
+ prev_stats = (__le32 *)&priv->_agn.statistics_bt;
+ accum_stats = (u32 *)&priv->_agn.accum_statistics_bt;
+ size = sizeof(struct iwl_bt_notif_statistics);
+ general = &priv->_agn.statistics_bt.general.common;
+ accum_general = &priv->_agn.accum_statistics_bt.general.common;
+ tx = &priv->_agn.statistics_bt.tx;
+ accum_tx = &priv->_agn.accum_statistics_bt.tx;
+ delta = (u32 *)&priv->_agn.delta_statistics_bt;
+ max_delta = (u32 *)&priv->_agn.max_delta_bt;
+ } else {
+ prev_stats = (__le32 *)&priv->_agn.statistics;
+ accum_stats = (u32 *)&priv->_agn.accum_statistics;
+ size = sizeof(struct iwl_notif_statistics);
+ general = &priv->_agn.statistics.general.common;
+ accum_general = &priv->_agn.accum_statistics.general.common;
+ tx = &priv->_agn.statistics.tx;
+ accum_tx = &priv->_agn.accum_statistics.tx;
+ delta = (u32 *)&priv->_agn.delta_statistics;
+ max_delta = (u32 *)&priv->_agn.max_delta;
+ }
+ for (i = sizeof(__le32); i < size;
i += sizeof(__le32), stats++, prev_stats++, delta++,
max_delta++, accum_stats++) {
if (le32_to_cpu(*stats) > le32_to_cpu(*prev_stats)) {
@@ -135,18 +158,12 @@ static void iwl_accumulative_statistics(struct iwl_priv *priv,
}
/* reset accumulative statistics for "no-counter" type statistics */
- priv->_agn.accum_statistics.general.common.temperature =
- priv->_agn.statistics.general.common.temperature;
- priv->_agn.accum_statistics.general.common.temperature_m =
- priv->_agn.statistics.general.common.temperature_m;
- priv->_agn.accum_statistics.general.common.ttl_timestamp =
- priv->_agn.statistics.general.common.ttl_timestamp;
- priv->_agn.accum_statistics.tx.tx_power.ant_a =
- priv->_agn.statistics.tx.tx_power.ant_a;
- priv->_agn.accum_statistics.tx.tx_power.ant_b =
- priv->_agn.statistics.tx.tx_power.ant_b;
- priv->_agn.accum_statistics.tx.tx_power.ant_c =
- priv->_agn.statistics.tx.tx_power.ant_c;
+ accum_general->temperature = general->temperature;
+ accum_general->temperature_m = general->temperature_m;
+ accum_general->ttl_timestamp = general->ttl_timestamp;
+ accum_tx->tx_power.ant_a = tx->tx_power.ant_a;
+ accum_tx->tx_power.ant_b = tx->tx_power.ant_b;
+ accum_tx->tx_power.ant_c = tx->tx_power.ant_c;
}
#endif
@@ -185,11 +202,30 @@ bool iwl_good_plcp_health(struct iwl_priv *priv,
* by zero.
*/
if (plcp_msec) {
- combined_plcp_delta =
- (le32_to_cpu(pkt->u.stats.rx.ofdm.plcp_err) -
- le32_to_cpu(priv->_agn.statistics.rx.ofdm.plcp_err)) +
- (le32_to_cpu(pkt->u.stats.rx.ofdm_ht.plcp_err) -
- le32_to_cpu(priv->_agn.statistics.rx.ofdm_ht.plcp_err));
+ struct statistics_rx_phy *ofdm;
+ struct statistics_rx_ht_phy *ofdm_ht;
+
+ if (priv->cfg->bt_statistics) {
+ ofdm = &pkt->u.stats_bt.rx.ofdm;
+ ofdm_ht = &pkt->u.stats_bt.rx.ofdm_ht;
+ combined_plcp_delta =
+ (le32_to_cpu(ofdm->plcp_err) -
+ le32_to_cpu(priv->_agn.statistics_bt.
+ rx.ofdm.plcp_err)) +
+ (le32_to_cpu(ofdm_ht->plcp_err) -
+ le32_to_cpu(priv->_agn.statistics_bt.
+ rx.ofdm_ht.plcp_err));
+ } else {
+ ofdm = &pkt->u.stats.rx.ofdm;
+ ofdm_ht = &pkt->u.stats.rx.ofdm_ht;
+ combined_plcp_delta =
+ (le32_to_cpu(ofdm->plcp_err) -
+ le32_to_cpu(priv->_agn.statistics.
+ rx.ofdm.plcp_err)) +
+ (le32_to_cpu(ofdm_ht->plcp_err) -
+ le32_to_cpu(priv->_agn.statistics.
+ rx.ofdm_ht.plcp_err));
+ }
if ((combined_plcp_delta > 0) &&
((combined_plcp_delta * 100) / plcp_msec) >
@@ -206,15 +242,14 @@ bool iwl_good_plcp_health(struct iwl_priv *priv,
* plcp_msec
*/
IWL_DEBUG_RADIO(priv, "plcp_err exceeded %u, "
- "%u, %u, %u, %u, %d, %u mSecs\n",
- priv->cfg->plcp_delta_threshold,
- le32_to_cpu(pkt->u.stats.rx.ofdm.plcp_err),
- le32_to_cpu(
- priv->_agn.statistics.rx.ofdm.plcp_err),
- le32_to_cpu(pkt->u.stats.rx.ofdm_ht.plcp_err),
- le32_to_cpu(
- priv->_agn.statistics.rx.ofdm_ht.plcp_err),
- combined_plcp_delta, plcp_msec);
+ "%u, %u, %u, %u, %d, %u mSecs\n",
+ priv->cfg->plcp_delta_threshold,
+ le32_to_cpu(ofdm->plcp_err),
+ le32_to_cpu(ofdm->plcp_err),
+ le32_to_cpu(ofdm_ht->plcp_err),
+ le32_to_cpu(ofdm_ht->plcp_err),
+ combined_plcp_delta, plcp_msec);
+
rc = false;
}
}
@@ -227,24 +262,50 @@ void iwl_rx_statistics(struct iwl_priv *priv,
int change;
struct iwl_rx_packet *pkt = rxb_addr(rxb);
+ if (priv->cfg->bt_statistics) {
+ IWL_DEBUG_RX(priv,
+ "Statistics notification received (%d vs %d).\n",
+ (int)sizeof(struct iwl_bt_notif_statistics),
+ le32_to_cpu(pkt->len_n_flags) &
+ FH_RSCSR_FRAME_SIZE_MSK);
- IWL_DEBUG_RX(priv, "Statistics notification received (%d vs %d).\n",
- (int)sizeof(priv->_agn.statistics),
- le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK);
+ change = ((priv->_agn.statistics_bt.general.common.temperature !=
+ pkt->u.stats_bt.general.common.temperature) ||
+ ((priv->_agn.statistics_bt.flag &
+ STATISTICS_REPLY_FLG_HT40_MODE_MSK) !=
+ (pkt->u.stats_bt.flag &
+ STATISTICS_REPLY_FLG_HT40_MODE_MSK)));
+#ifdef CONFIG_IWLWIFI_DEBUGFS
+ iwl_accumulative_statistics(priv, (__le32 *)&pkt->u.stats_bt);
+#endif
- change = ((priv->_agn.statistics.general.common.temperature !=
- pkt->u.stats.general.common.temperature) ||
- ((priv->_agn.statistics.flag &
- STATISTICS_REPLY_FLG_HT40_MODE_MSK) !=
- (pkt->u.stats.flag & STATISTICS_REPLY_FLG_HT40_MODE_MSK)));
+ } else {
+ IWL_DEBUG_RX(priv,
+ "Statistics notification received (%d vs %d).\n",
+ (int)sizeof(struct iwl_notif_statistics),
+ le32_to_cpu(pkt->len_n_flags) &
+ FH_RSCSR_FRAME_SIZE_MSK);
+ change = ((priv->_agn.statistics.general.common.temperature !=
+ pkt->u.stats.general.common.temperature) ||
+ ((priv->_agn.statistics.flag &
+ STATISTICS_REPLY_FLG_HT40_MODE_MSK) !=
+ (pkt->u.stats.flag &
+ STATISTICS_REPLY_FLG_HT40_MODE_MSK)));
#ifdef CONFIG_IWLWIFI_DEBUGFS
- iwl_accumulative_statistics(priv, (__le32 *)&pkt->u.stats);
+ iwl_accumulative_statistics(priv, (__le32 *)&pkt->u.stats);
#endif
+
+ }
+
iwl_recover_from_statistics(priv, pkt);
- memcpy(&priv->_agn.statistics, &pkt->u.stats,
- sizeof(priv->_agn.statistics));
+ if (priv->cfg->bt_statistics)
+ memcpy(&priv->_agn.statistics_bt, &pkt->u.stats_bt,
+ sizeof(priv->_agn.statistics_bt));
+ else
+ memcpy(&priv->_agn.statistics, &pkt->u.stats,
+ sizeof(priv->_agn.statistics));
set_bit(STATUS_STATISTICS, &priv->status);
@@ -277,6 +338,12 @@ void iwl_reply_statistics(struct iwl_priv *priv,
sizeof(struct iwl_notif_statistics));
memset(&priv->_agn.max_delta, 0,
sizeof(struct iwl_notif_statistics));
+ memset(&priv->_agn.accum_statistics_bt, 0,
+ sizeof(struct iwl_bt_notif_statistics));
+ memset(&priv->_agn.delta_statistics_bt, 0,
+ sizeof(struct iwl_bt_notif_statistics));
+ memset(&priv->_agn.max_delta_bt, 0,
+ sizeof(struct iwl_bt_notif_statistics));
#endif
IWL_DEBUG_RX(priv, "Statistics have been cleared\n");
}
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 7391c63..33a8f13 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3008,9 +3008,17 @@ static void iwl_bg_run_time_calib_work(struct work_struct *work)
}
if (priv->start_calib) {
- iwl_chain_noise_calibration(priv, &priv->_agn.statistics);
-
- iwl_sensitivity_calibration(priv, &priv->_agn.statistics);
+ if (priv->cfg->bt_statistics) {
+ iwl_chain_noise_calibration(priv,
+ (void *)&priv->_agn.statistics_bt);
+ iwl_sensitivity_calibration(priv,
+ (void *)&priv->_agn.statistics_bt);
+ } else {
+ iwl_chain_noise_calibration(priv,
+ (void *)&priv->_agn.statistics);
+ iwl_sensitivity_calibration(priv,
+ (void *)&priv->_agn.statistics);
+ }
}
mutex_unlock(&priv->mutex);
diff --git a/drivers/net/wireless/iwlwifi/iwl-calib.h b/drivers/net/wireless/iwlwifi/iwl-calib.h
index 2b7b1df..ba9523f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-calib.h
+++ b/drivers/net/wireless/iwlwifi/iwl-calib.h
@@ -66,10 +66,8 @@
#include "iwl-core.h"
#include "iwl-commands.h"
-void iwl_chain_noise_calibration(struct iwl_priv *priv,
- struct iwl_notif_statistics *stat_resp);
-void iwl_sensitivity_calibration(struct iwl_priv *priv,
- struct iwl_notif_statistics *resp);
+void iwl_chain_noise_calibration(struct iwl_priv *priv, void *stat_resp);
+void iwl_sensitivity_calibration(struct iwl_priv *priv, void *resp);
void iwl_init_sensitivity(struct iwl_priv *priv);
void iwl_reset_run_time_calib(struct iwl_priv *priv);
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index 4be9063..04b2e29 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -3988,6 +3988,7 @@ struct iwl_rx_packet {
struct iwl_sleep_notification sleep_notif;
struct iwl_spectrum_resp spectrum;
struct iwl_notif_statistics stats;
+ struct iwl_bt_notif_statistics stats_bt;
struct iwl_compressed_ba_resp compressed_ba;
struct iwl_missed_beacon_notif missed_beacon;
struct iwl_coex_medium_notification coex_medium_notif;
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index dff1b17..297f8d1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1322,10 +1322,14 @@ struct iwl_priv {
u32 inst_evtlog_ptr, inst_evtlog_size, inst_errlog_ptr;
struct iwl_notif_statistics statistics;
+ struct iwl_bt_notif_statistics statistics_bt;
#ifdef CONFIG_IWLWIFI_DEBUGFS
struct iwl_notif_statistics accum_statistics;
struct iwl_notif_statistics delta_statistics;
struct iwl_notif_statistics max_delta;
+ struct iwl_bt_notif_statistics accum_statistics_bt;
+ struct iwl_bt_notif_statistics delta_statistics_bt;
+ struct iwl_bt_notif_statistics max_delta_bt;
#endif
} _agn;
#endif
--
1.7.0.4
^ permalink raw reply related
* [PATCH 06/10] iwlagn: fix firmware loading TLV error path
From: Wey-Yi Guy @ 2010-07-23 16:15 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, ipw3945-devel, Johannes Berg, Wey-Yi Guy
In-Reply-To: <1279901739-10541-1-git-send-email-wey-yi.w.guy@intel.com>
From: Johannes Berg <johannes.berg@intel.com>
gcc complains about the firmware loading:
iwl-agn.c: In function ‘iwlagn_load_firmware’:
iwl-agn.c:1860: warning: ‘tlv_len’ may be used uninitialized in this function
iwl-agn.c:1861: warning: ‘tlv_type’ may be used uninitialized in this function
iwl-agn.c:1862: warning: ‘tlv_data’ may be used uninitialized in this function
This is almost correct but we do do break out of the TLV
parsing loop when setting ret. However, the code is hard
to follow, and clearly even the compiler is having issues
with it too.
Additionally, however, the current code is wrong. If there
is a TLV length check error, the code will report
invalid TLV after parsing: ...
because "len" will still be non-zero as we broke out of
the loop.
So to remove the warning and fix that issue, make the code
easier to read by doing length checking with an error label.
As a result, we can completely remove the "ret" variable.
Also, while at it, remove the "fixed_tlv_size" variable
since each TLV type has its own specified length, it just
happens that we have only variable length, flags (0 length)
and u32 TLVs right now. It should still be checked with more
explicit length checks to make it easier to understand.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-agn.c | 79 ++++++++++++++------------------
1 files changed, 35 insertions(+), 44 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index db86f70..573a81b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1828,7 +1828,6 @@ static int iwlagn_load_firmware(struct iwl_priv *priv,
u32 tlv_len;
enum iwl_ucode_tlv_type tlv_type;
const u8 *tlv_data;
- int ret = 0;
if (len < sizeof(*ucode)) {
IWL_ERR(priv, "uCode has invalid length: %zd\n", len);
@@ -1864,9 +1863,8 @@ static int iwlagn_load_firmware(struct iwl_priv *priv,
len -= sizeof(*ucode);
- while (len >= sizeof(*tlv) && !ret) {
+ while (len >= sizeof(*tlv)) {
u16 tlv_alt;
- u32 fixed_tlv_size = 4;
len -= sizeof(*tlv);
tlv = (void *)data;
@@ -1914,65 +1912,56 @@ static int iwlagn_load_firmware(struct iwl_priv *priv,
pieces->boot_size = tlv_len;
break;
case IWL_UCODE_TLV_PROBE_MAX_LEN:
- if (tlv_len != fixed_tlv_size)
- ret = -EINVAL;
- else
- capa->max_probe_length =
+ if (tlv_len != sizeof(u32))
+ goto invalid_tlv_len;
+ capa->max_probe_length =
le32_to_cpup((__le32 *)tlv_data);
break;
case IWL_UCODE_TLV_INIT_EVTLOG_PTR:
- if (tlv_len != fixed_tlv_size)
- ret = -EINVAL;
- else
- pieces->init_evtlog_ptr =
+ if (tlv_len != sizeof(u32))
+ goto invalid_tlv_len;
+ pieces->init_evtlog_ptr =
le32_to_cpup((__le32 *)tlv_data);
break;
case IWL_UCODE_TLV_INIT_EVTLOG_SIZE:
- if (tlv_len != fixed_tlv_size)
- ret = -EINVAL;
- else
- pieces->init_evtlog_size =
+ if (tlv_len != sizeof(u32))
+ goto invalid_tlv_len;
+ pieces->init_evtlog_size =
le32_to_cpup((__le32 *)tlv_data);
break;
case IWL_UCODE_TLV_INIT_ERRLOG_PTR:
- if (tlv_len != fixed_tlv_size)
- ret = -EINVAL;
- else
- pieces->init_errlog_ptr =
+ if (tlv_len != sizeof(u32))
+ goto invalid_tlv_len;
+ pieces->init_errlog_ptr =
le32_to_cpup((__le32 *)tlv_data);
break;
case IWL_UCODE_TLV_RUNT_EVTLOG_PTR:
- if (tlv_len != fixed_tlv_size)
- ret = -EINVAL;
- else
- pieces->inst_evtlog_ptr =
+ if (tlv_len != sizeof(u32))
+ goto invalid_tlv_len;
+ pieces->inst_evtlog_ptr =
le32_to_cpup((__le32 *)tlv_data);
break;
case IWL_UCODE_TLV_RUNT_EVTLOG_SIZE:
- if (tlv_len != fixed_tlv_size)
- ret = -EINVAL;
- else
- pieces->inst_evtlog_size =
+ if (tlv_len != sizeof(u32))
+ goto invalid_tlv_len;
+ pieces->inst_evtlog_size =
le32_to_cpup((__le32 *)tlv_data);
break;
case IWL_UCODE_TLV_RUNT_ERRLOG_PTR:
- if (tlv_len != fixed_tlv_size)
- ret = -EINVAL;
- else
- pieces->inst_errlog_ptr =
+ if (tlv_len != sizeof(u32))
+ goto invalid_tlv_len;
+ pieces->inst_errlog_ptr =
le32_to_cpup((__le32 *)tlv_data);
break;
case IWL_UCODE_TLV_ENHANCE_SENS_TBL:
if (tlv_len)
- ret = -EINVAL;
- else
- priv->enhance_sensitivity_table = true;
+ goto invalid_tlv_len;
+ priv->enhance_sensitivity_table = true;
break;
case IWL_UCODE_TLV_PHY_CALIBRATION_SIZE:
- if (tlv_len != fixed_tlv_size)
- ret = -EINVAL;
- else
- capa->standard_phy_calibration_size =
+ if (tlv_len != sizeof(u32))
+ goto invalid_tlv_len;
+ capa->standard_phy_calibration_size =
le32_to_cpup((__le32 *)tlv_data);
break;
default:
@@ -1984,14 +1973,16 @@ static int iwlagn_load_firmware(struct iwl_priv *priv,
if (len) {
IWL_ERR(priv, "invalid TLV after parsing: %zd\n", len);
iwl_print_hex_dump(priv, IWL_DL_FW, (u8 *)data, len);
- ret = -EINVAL;
- } else if (ret) {
- IWL_ERR(priv, "TLV %d has invalid size: %u\n",
- tlv_type, tlv_len);
- iwl_print_hex_dump(priv, IWL_DL_FW, (u8 *)tlv_data, tlv_len);
+ return -EINVAL;
}
- return ret;
+ return 0;
+
+ invalid_tlv_len:
+ IWL_ERR(priv, "TLV %d has invalid size: %u\n", tlv_type, tlv_len);
+ iwl_print_hex_dump(priv, IWL_DL_FW, tlv_data, tlv_len);
+
+ return -EINVAL;
}
/**
--
1.7.0.4
^ permalink raw reply related
* [PATCH 04/10] iwlagn: add bluetooth stats to debugfs
From: Wey-Yi Guy @ 2010-07-23 16:15 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy
In-Reply-To: <1279901739-10541-1-git-send-email-wey-yi.w.guy@intel.com>
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
For WiFi/BT combo devices, add bluetooth statistics counter
read function to debugfs.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-1000.c | 1 +
drivers/net/wireless/iwlwifi/iwl-4965.c | 1 +
drivers/net/wireless/iwlwifi/iwl-5000.c | 1 +
drivers/net/wireless/iwlwifi/iwl-6000.c | 1 +
drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c | 87 ++++++++++++++++++++++++
drivers/net/wireless/iwlwifi/iwl-agn-debugfs.h | 7 ++
drivers/net/wireless/iwlwifi/iwl-core.h | 2 +
drivers/net/wireless/iwlwifi/iwl-debugfs.c | 13 ++++
8 files changed, 113 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c
index c281d07..8848333 100644
--- a/drivers/net/wireless/iwlwifi/iwl-1000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-1000.c
@@ -222,6 +222,7 @@ static struct iwl_lib_ops iwl1000_lib = {
.rx_stats_read = iwl_ucode_rx_stats_read,
.tx_stats_read = iwl_ucode_tx_stats_read,
.general_stats_read = iwl_ucode_general_stats_read,
+ .bt_stats_read = iwl_ucode_bt_stats_read,
},
.recover_from_tx_stall = iwl_bg_monitor_recover,
.check_plcp_health = iwl_good_plcp_health,
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 27a776f..d6531ad 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -2285,6 +2285,7 @@ static struct iwl_lib_ops iwl4965_lib = {
.rx_stats_read = iwl_ucode_rx_stats_read,
.tx_stats_read = iwl_ucode_tx_stats_read,
.general_stats_read = iwl_ucode_general_stats_read,
+ .bt_stats_read = iwl_ucode_bt_stats_read,
},
.recover_from_tx_stall = iwl_bg_monitor_recover,
.check_plcp_health = iwl_good_plcp_health,
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index a7077cd..8093ce2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -398,6 +398,7 @@ static struct iwl_lib_ops iwl5000_lib = {
.rx_stats_read = iwl_ucode_rx_stats_read,
.tx_stats_read = iwl_ucode_tx_stats_read,
.general_stats_read = iwl_ucode_general_stats_read,
+ .bt_stats_read = iwl_ucode_bt_stats_read,
},
.recover_from_tx_stall = iwl_bg_monitor_recover,
.check_plcp_health = iwl_good_plcp_health,
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index a4e58d8..5827052 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -323,6 +323,7 @@ static struct iwl_lib_ops iwl6000_lib = {
.rx_stats_read = iwl_ucode_rx_stats_read,
.tx_stats_read = iwl_ucode_tx_stats_read,
.general_stats_read = iwl_ucode_general_stats_read,
+ .bt_stats_read = iwl_ucode_bt_stats_read,
},
.recover_from_tx_stall = iwl_bg_monitor_recover,
.check_plcp_health = iwl_good_plcp_health,
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
index 19d1e5e..f052c6d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
@@ -924,3 +924,90 @@ ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user_buf,
kfree(buf);
return ret;
}
+
+ssize_t iwl_ucode_bt_stats_read(struct file *file,
+ char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
+ int pos = 0;
+ char *buf;
+ int bufsz = (sizeof(struct statistics_bt_activity) * 24) + 200;
+ ssize_t ret;
+ struct statistics_bt_activity *bt, *accum_bt;
+
+ if (!iwl_is_alive(priv))
+ return -EAGAIN;
+
+ /* make request to uCode to retrieve statistics information */
+ mutex_lock(&priv->mutex);
+ ret = iwl_send_statistics_request(priv, CMD_SYNC, false);
+ mutex_unlock(&priv->mutex);
+
+ if (ret) {
+ IWL_ERR(priv,
+ "Error sending statistics request: %zd\n", ret);
+ return -EAGAIN;
+ }
+ buf = kzalloc(bufsz, GFP_KERNEL);
+ if (!buf) {
+ IWL_ERR(priv, "Can not allocate Buffer\n");
+ return -ENOMEM;
+ }
+
+ /*
+ * the statistic information display here is based on
+ * the last statistics notification from uCode
+ * might not reflect the current uCode activity
+ */
+ bt = &priv->_agn.statistics_bt.general.activity;
+ accum_bt = &priv->_agn.accum_statistics_bt.general.activity;
+
+ pos += iwl_statistics_flag(priv, buf, bufsz);
+ pos += scnprintf(buf + pos, bufsz - pos, "Statistics_BT:\n");
+ pos += scnprintf(buf + pos, bufsz - pos,
+ "\t\t\tcurrent\t\t\taccumulative\n");
+ pos += scnprintf(buf + pos, bufsz - pos,
+ "hi_priority_tx_req_cnt:\t\t%u\t\t\t%u\n",
+ le32_to_cpu(bt->hi_priority_tx_req_cnt),
+ accum_bt->hi_priority_tx_req_cnt);
+ pos += scnprintf(buf + pos, bufsz - pos,
+ "hi_priority_tx_denied_cnt:\t%u\t\t\t%u\n",
+ le32_to_cpu(bt->hi_priority_tx_denied_cnt),
+ accum_bt->hi_priority_tx_denied_cnt);
+ pos += scnprintf(buf + pos, bufsz - pos,
+ "lo_priority_tx_req_cnt:\t\t%u\t\t\t%u\n",
+ le32_to_cpu(bt->lo_priority_tx_req_cnt),
+ accum_bt->lo_priority_tx_req_cnt);
+ pos += scnprintf(buf + pos, bufsz - pos,
+ "lo_priority_rx_denied_cnt:\t%u\t\t\t%u\n",
+ le32_to_cpu(bt->lo_priority_tx_denied_cnt),
+ accum_bt->lo_priority_tx_denied_cnt);
+ pos += scnprintf(buf + pos, bufsz - pos,
+ "hi_priority_rx_req_cnt:\t\t%u\t\t\t%u\n",
+ le32_to_cpu(bt->hi_priority_rx_req_cnt),
+ accum_bt->hi_priority_rx_req_cnt);
+ pos += scnprintf(buf + pos, bufsz - pos,
+ "hi_priority_rx_denied_cnt:\t%u\t\t\t%u\n",
+ le32_to_cpu(bt->hi_priority_rx_denied_cnt),
+ accum_bt->hi_priority_rx_denied_cnt);
+ pos += scnprintf(buf + pos, bufsz - pos,
+ "lo_priority_rx_req_cnt:\t\t%u\t\t\t%u\n",
+ le32_to_cpu(bt->lo_priority_rx_req_cnt),
+ accum_bt->lo_priority_rx_req_cnt);
+ pos += scnprintf(buf + pos, bufsz - pos,
+ "lo_priority_rx_denied_cnt:\t%u\t\t\t%u\n",
+ le32_to_cpu(bt->lo_priority_rx_denied_cnt),
+ accum_bt->lo_priority_rx_denied_cnt);
+
+ pos += scnprintf(buf + pos, bufsz - pos,
+ "(rx)num_bt_kills:\t\t%u\t\t\t%u\n",
+ le32_to_cpu(priv->_agn.statistics_bt.rx.
+ general.num_bt_kills),
+ priv->_agn.accum_statistics_bt.rx.
+ general.num_bt_kills);
+
+ ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
+ kfree(buf);
+ return ret;
+}
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.h b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.h
index 59b1f25..bbdce59 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.h
@@ -37,6 +37,8 @@ ssize_t iwl_ucode_tx_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos);
ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos);
+ssize_t iwl_ucode_bt_stats_read(struct file *file, char __user *user_buf,
+ size_t count, loff_t *ppos);
#else
static ssize_t iwl_ucode_rx_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
@@ -53,4 +55,9 @@ static ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user
{
return 0;
}
+static ssize_t iwl_ucode_bt_stats_read(struct file *file, char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ return 0;
+}
#endif
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 2954a52..b60cf45 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -125,6 +125,8 @@ struct iwl_debugfs_ops {
size_t count, loff_t *ppos);
ssize_t (*general_stats_read)(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos);
+ ssize_t (*bt_stats_read)(struct file *file, char __user *user_buf,
+ size_t count, loff_t *ppos);
};
struct iwl_temp_ops {
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 7b25d14..e96a1bb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -1519,6 +1519,16 @@ static ssize_t iwl_dbgfs_txfifo_flush_write(struct file *file,
return count;
}
+static ssize_t iwl_dbgfs_ucode_bt_stats_read(struct file *file,
+ char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
+
+ return priv->cfg->ops->lib->debugfs_ops.bt_stats_read(file,
+ user_buf, count, ppos);
+}
+
DEBUGFS_READ_FILE_OPS(rx_statistics);
DEBUGFS_READ_FILE_OPS(tx_statistics);
DEBUGFS_READ_WRITE_FILE_OPS(traffic_log);
@@ -1541,6 +1551,7 @@ DEBUGFS_READ_WRITE_FILE_OPS(force_reset);
DEBUGFS_READ_FILE_OPS(rxon_flags);
DEBUGFS_READ_FILE_OPS(rxon_filter_flags);
DEBUGFS_WRITE_FILE_OPS(txfifo_flush);
+DEBUGFS_READ_FILE_OPS(ucode_bt_stats);
/*
* Create the debugfs files and directories
@@ -1608,6 +1619,8 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
DEBUGFS_ADD_FILE(chain_noise, dir_debug, S_IRUSR);
if (priv->cfg->ucode_tracing)
DEBUGFS_ADD_FILE(ucode_tracing, dir_debug, S_IWUSR | S_IRUSR);
+ if (priv->cfg->bt_statistics)
+ DEBUGFS_ADD_FILE(ucode_bt_stats, dir_debug, S_IRUSR);
DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR);
DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR);
if (priv->cfg->sensitivity_calib_by_driver)
--
1.7.0.4
^ permalink raw reply related
* [PATCH 08/10] iwlwifi: read multiple MAC addresses
From: Wey-Yi Guy @ 2010-07-23 16:15 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy, Johannes Berg
In-Reply-To: <1279901739-10541-1-git-send-email-wey-yi.w.guy@intel.com>
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Some devices may have multiple MAC
addresses in their EEPROM, read them
and advertise them to cfg80211.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-agn.c | 17 ++++++++++++-----
drivers/net/wireless/iwlwifi/iwl-dev.h | 3 +++
drivers/net/wireless/iwlwifi/iwl-eeprom.h | 1 +
3 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 573a81b..f8f8ea2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3932,8 +3932,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct ieee80211_hw *hw;
struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data);
unsigned long flags;
- u16 pci_cmd;
- u8 perm_addr[ETH_ALEN];
+ u16 pci_cmd, num_mac;
/************************
* 1. Allocating HW data
@@ -4051,9 +4050,17 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto out_free_eeprom;
/* extract MAC Address */
- iwl_eeprom_get_mac(priv, perm_addr);
- IWL_DEBUG_INFO(priv, "MAC address: %pM\n", perm_addr);
- SET_IEEE80211_PERM_ADDR(priv->hw, perm_addr);
+ iwl_eeprom_get_mac(priv, priv->addresses[0].addr);
+ IWL_DEBUG_INFO(priv, "MAC address: %pM\n", priv->addresses[0].addr);
+ priv->hw->wiphy->addresses = priv->addresses;
+ priv->hw->wiphy->n_addresses = 1;
+ num_mac = iwl_eeprom_query16(priv, EEPROM_NUM_MAC_ADDRESS);
+ if (num_mac > 1) {
+ memcpy(priv->addresses[1].addr, priv->addresses[0].addr,
+ ETH_ALEN);
+ priv->addresses[1].addr[5]++;
+ priv->hw->wiphy->n_addresses++;
+ }
/************************
* 5. Setup HW constants
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 4fa8cdd..5e4745d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1154,6 +1154,9 @@ struct iwl_priv {
u32 hw_wa_rev;
u8 rev_id;
+ /* EEPROM MAC addresses */
+ struct mac_address addresses[2];
+
/* uCode images, save to reload in case of failure */
int fw_index; /* firmware we're trying to load */
u32 ucode_ver; /* version of ucode, copy of
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.h b/drivers/net/wireless/iwlwifi/iwl-eeprom.h
index f8b707d..3209b37 100644
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom.h
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.h
@@ -402,6 +402,7 @@ struct iwl_eeprom_calib_info {
#define EEPROM_WOWLAN_MODE (2*0x47) /* 2 bytes */
#define EEPROM_RADIO_CONFIG (2*0x48) /* 2 bytes */
#define EEPROM_3945_M_VERSION (2*0x4A) /* 1 bytes */
+#define EEPROM_NUM_MAC_ADDRESS (2*0x4C) /* 2 bytes */
/* The following masks are to be applied on EEPROM_RADIO_CONFIG */
#define EEPROM_RF_CFG_TYPE_MSK(x) (x & 0x3) /* bits 0-1 */
--
1.7.0.4
^ permalink raw reply related
* [PATCH 07/10] iwlwifi: make iwl_mac_beacon_update static
From: Wey-Yi Guy @ 2010-07-23 16:15 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, ipw3945-devel, Johannes Berg, Wey-Yi Guy
In-Reply-To: <1279901739-10541-1-git-send-email-wey-yi.w.guy@intel.com>
From: Johannes Berg <johannes.berg@intel.com>
This function is only needed in the same
file it is defined in, i.e. iwl-core.c
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-core.c | 63 +++++++++++++++----------------
drivers/net/wireless/iwlwifi/iwl-core.h | 1 -
2 files changed, 31 insertions(+), 33 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 676d49d..cb2d48a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1748,6 +1748,37 @@ static inline void iwl_set_no_assoc(struct iwl_priv *priv)
iwlcore_commit_rxon(priv);
}
+static int iwl_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
+{
+ struct iwl_priv *priv = hw->priv;
+ unsigned long flags;
+ __le64 timestamp;
+
+ IWL_DEBUG_MAC80211(priv, "enter\n");
+
+ if (!iwl_is_ready_rf(priv)) {
+ IWL_DEBUG_MAC80211(priv, "leave - RF not ready\n");
+ return -EIO;
+ }
+
+ spin_lock_irqsave(&priv->lock, flags);
+
+ if (priv->ibss_beacon)
+ dev_kfree_skb(priv->ibss_beacon);
+
+ priv->ibss_beacon = skb;
+
+ timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp;
+ priv->timestamp = le64_to_cpu(timestamp);
+
+ IWL_DEBUG_MAC80211(priv, "leave\n");
+ spin_unlock_irqrestore(&priv->lock, flags);
+
+ priv->cfg->ops->lib->post_associate(priv, priv->vif);
+
+ return 0;
+}
+
void iwl_bss_info_changed(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *bss_conf,
@@ -1914,38 +1945,6 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
}
EXPORT_SYMBOL(iwl_bss_info_changed);
-int iwl_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
-{
- struct iwl_priv *priv = hw->priv;
- unsigned long flags;
- __le64 timestamp;
-
- IWL_DEBUG_MAC80211(priv, "enter\n");
-
- if (!iwl_is_ready_rf(priv)) {
- IWL_DEBUG_MAC80211(priv, "leave - RF not ready\n");
- return -EIO;
- }
-
- spin_lock_irqsave(&priv->lock, flags);
-
- if (priv->ibss_beacon)
- dev_kfree_skb(priv->ibss_beacon);
-
- priv->ibss_beacon = skb;
-
- timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp;
- priv->timestamp = le64_to_cpu(timestamp);
-
- IWL_DEBUG_MAC80211(priv, "leave\n");
- spin_unlock_irqrestore(&priv->lock, flags);
-
- priv->cfg->ops->lib->post_associate(priv, priv->vif);
-
- return 0;
-}
-EXPORT_SYMBOL(iwl_mac_beacon_update);
-
static int iwl_set_mode(struct iwl_priv *priv, struct ieee80211_vif *vif)
{
iwl_connection_init_rx_config(priv, vif);
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index b60cf45..e9d23f2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -380,7 +380,6 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *bss_conf,
u32 changes);
-int iwl_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb);
int iwl_commit_rxon(struct iwl_priv *priv);
int iwl_mac_add_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif);
--
1.7.0.4
^ permalink raw reply related
* [PATCH 05/10] iwlwifi: add TLV to specify the size of phy calibration table
From: Wey-Yi Guy @ 2010-07-23 16:15 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, ipw3945-devel, Wey-Yi Guy
In-Reply-To: <1279901739-10541-1-git-send-email-wey-yi.w.guy@intel.com>
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Different devices have different size of phy calibration table; add
new TLV to specify the size. If the TLV is not part of uCode header, the
default table size will be used to make sure the backward
compatibilities.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c | 4 ++--
drivers/net/wireless/iwlwifi/iwl-agn.c | 24 ++++++++++++++++++++++++
drivers/net/wireless/iwlwifi/iwl-commands.h | 4 ++--
drivers/net/wireless/iwlwifi/iwl-dev.h | 9 +++++++++
4 files changed, 37 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
index f06d1fe..a7216dd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
@@ -164,7 +164,7 @@ static void iwlagn_gain_computation(struct iwl_priv *priv,
memset(&cmd, 0, sizeof(cmd));
- cmd.hdr.op_code = IWL_PHY_CALIBRATE_CHAIN_NOISE_GAIN_CMD;
+ cmd.hdr.op_code = priv->_agn.phy_calib_chain_noise_gain_cmd;
cmd.hdr.first_group = 0;
cmd.hdr.groups_num = 1;
cmd.hdr.data_valid = 1;
@@ -197,7 +197,7 @@ static void iwlagn_chain_noise_reset(struct iwl_priv *priv)
data->beacon_count = 0;
memset(&cmd, 0, sizeof(cmd));
- cmd.hdr.op_code = IWL_PHY_CALIBRATE_CHAIN_NOISE_RESET_CMD;
+ cmd.hdr.op_code = priv->_agn.phy_calib_chain_noise_reset_cmd;
cmd.hdr.first_group = 0;
cmd.hdr.groups_num = 1;
cmd.hdr.data_valid = 1;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 33a8f13..db86f70 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1692,6 +1692,7 @@ static void iwl_nic_start(struct iwl_priv *priv)
struct iwlagn_ucode_capabilities {
u32 max_probe_length;
+ u32 standard_phy_calibration_size;
};
static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context);
@@ -1967,6 +1968,13 @@ static int iwlagn_load_firmware(struct iwl_priv *priv,
else
priv->enhance_sensitivity_table = true;
break;
+ case IWL_UCODE_TLV_PHY_CALIBRATION_SIZE:
+ if (tlv_len != fixed_tlv_size)
+ ret = -EINVAL;
+ else
+ capa->standard_phy_calibration_size =
+ le32_to_cpup((__le32 *)tlv_data);
+ break;
default:
IWL_WARN(priv, "unknown TLV: %d\n", tlv_type);
break;
@@ -2005,6 +2013,8 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
u32 build;
struct iwlagn_ucode_capabilities ucode_capa = {
.max_probe_length = 200,
+ .standard_phy_calibration_size =
+ IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE,
};
memset(&pieces, 0, sizeof(pieces));
@@ -2226,6 +2236,20 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
pieces.boot_size);
memcpy(priv->ucode_boot.v_addr, pieces.boot, pieces.boot_size);
+ /*
+ * figure out the offset of chain noise reset and gain commands
+ * base on the size of standard phy calibration commands table size
+ */
+ if (ucode_capa.standard_phy_calibration_size >
+ IWL_MAX_PHY_CALIBRATE_TBL_SIZE)
+ ucode_capa.standard_phy_calibration_size =
+ IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE;
+
+ priv->_agn.phy_calib_chain_noise_reset_cmd =
+ ucode_capa.standard_phy_calibration_size;
+ priv->_agn.phy_calib_chain_noise_gain_cmd =
+ ucode_capa.standard_phy_calibration_size + 1;
+
/**************************************************
* This is still part of probe() in a sense...
*
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index 04b2e29..67892f9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -3660,10 +3660,10 @@ enum {
IWL_PHY_CALIBRATE_CRYSTAL_FRQ_CMD = 15,
IWL_PHY_CALIBRATE_BASE_BAND_CMD = 16,
IWL_PHY_CALIBRATE_TX_IQ_PERD_CMD = 17,
- IWL_PHY_CALIBRATE_CHAIN_NOISE_RESET_CMD = 18,
- IWL_PHY_CALIBRATE_CHAIN_NOISE_GAIN_CMD = 19,
+ IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE = 18,
};
+#define IWL_MAX_PHY_CALIBRATE_TBL_SIZE (253)
#define IWL_CALIB_INIT_CFG_ALL cpu_to_le32(0xffffffff)
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 297f8d1..4fa8cdd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -571,6 +571,7 @@ enum iwl_ucode_tlv_type {
IWL_UCODE_TLV_INIT_EVTLOG_SIZE = 12,
IWL_UCODE_TLV_INIT_ERRLOG_PTR = 13,
IWL_UCODE_TLV_ENHANCE_SENS_TBL = 14,
+ IWL_UCODE_TLV_PHY_CALIBRATION_SIZE = 15,
};
struct iwl_ucode_tlv {
@@ -1321,6 +1322,14 @@ struct iwl_priv {
u32 init_evtlog_ptr, init_evtlog_size, init_errlog_ptr;
u32 inst_evtlog_ptr, inst_evtlog_size, inst_errlog_ptr;
+ /*
+ * chain noise reset and gain commands are the
+ * two extra calibration commands follows the standard
+ * phy calibration commands
+ */
+ u8 phy_calib_chain_noise_reset_cmd;
+ u8 phy_calib_chain_noise_gain_cmd;
+
struct iwl_notif_statistics statistics;
struct iwl_bt_notif_statistics statistics_bt;
#ifdef CONFIG_IWLWIFI_DEBUGFS
--
1.7.0.4
^ permalink raw reply related
* [PATCH 10/10] iwlwifi: remove spurious semicolons
From: Wey-Yi Guy @ 2010-07-23 16:15 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, ipw3945-devel, Johannes Berg, Wey-Yi Guy
In-Reply-To: <1279901739-10541-1-git-send-email-wey-yi.w.guy@intel.com>
From: Johannes Berg <johannes.berg@intel.com>
defines shouldn't be terminated with a
semicolon, the code using them should
supply it. Luckily these are not used
in a context where it matters.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-commands.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index 67892f9..798bf9e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -964,8 +964,8 @@ struct iwl_qosparam_cmd {
#define IWL_STATION_COUNT 32 /* MAX(3945,4965)*/
#define IWL_INVALID_STATION 255
-#define STA_FLG_TX_RATE_MSK cpu_to_le32(1 << 2);
-#define STA_FLG_PWR_SAVE_MSK cpu_to_le32(1 << 8);
+#define STA_FLG_TX_RATE_MSK cpu_to_le32(1 << 2)
+#define STA_FLG_PWR_SAVE_MSK cpu_to_le32(1 << 8)
#define STA_FLG_RTS_MIMO_PROT_MSK cpu_to_le32(1 << 17)
#define STA_FLG_AGG_MPDU_8US_MSK cpu_to_le32(1 << 18)
#define STA_FLG_MAX_AGG_SIZE_POS (19)
--
1.7.0.4
^ permalink raw reply related
* [PATCH 09/10] iwlwifi: reduce beacon fill conditions
From: Wey-Yi Guy @ 2010-07-23 16:15 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, ipw3945-devel, Johannes Berg, Wey-Yi Guy
In-Reply-To: <1279901739-10541-1-git-send-email-wey-yi.w.guy@intel.com>
From: Johannes Berg <johannes.berg@intel.com>
Since the ibss_beacon variable will only be
filled in the appropriate modes, there's no
reason to be checking the mode again.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-agn.c | 4 +---
drivers/net/wireless/iwlwifi/iwl3945-base.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index f8f8ea2..9a78189 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -292,9 +292,7 @@ static u32 iwl_fill_beacon_frame(struct iwl_priv *priv,
struct ieee80211_hdr *hdr,
int left)
{
- if (!iwl_is_associated(priv) || !priv->ibss_beacon ||
- ((priv->iw_mode != NL80211_IFTYPE_ADHOC) &&
- (priv->iw_mode != NL80211_IFTYPE_AP)))
+ if (!priv->ibss_beacon)
return 0;
if (priv->ibss_beacon->len > left)
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 8eb3471..9a7209d 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -311,9 +311,7 @@ unsigned int iwl3945_fill_beacon_frame(struct iwl_priv *priv,
int left)
{
- if (!iwl_is_associated(priv) || !priv->ibss_beacon ||
- ((priv->iw_mode != NL80211_IFTYPE_ADHOC) &&
- (priv->iw_mode != NL80211_IFTYPE_AP)))
+ if (!iwl_is_associated(priv) || !priv->ibss_beacon)
return 0;
if (priv->ibss_beacon->len > left)
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH] mac80211: Don't set per-BSS QoS for monitor interfaces
From: Luis R. Rodriguez @ 2010-07-23 17:29 UTC (permalink / raw)
To: Johannes Berg; +Cc: Sujith, linville, linux-wireless
In-Reply-To: <1279864868.3745.0.camel@jlt3.sipsolutions.net>
On Thu, Jul 22, 2010 at 11:01 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Fri, 2010-07-23 at 10:47 +0530, Sujith wrote:
>> In AP mode, there is no need to notify the driver about QoS
>> changes for the monitor interface that is created. The warning
>> in ieee80211_bss_info_change_notify() would be hit otherwise.
>
> Makes sense.
>
> Acked-by: Johannes Berg <johannes@sipsolutions.net>
>> Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Stable?
Luis
^ permalink raw reply
* Re: [patch -next] ath5k: snprintf() returns largish values
From: Joe Perches @ 2010-07-23 17:48 UTC (permalink / raw)
To: Dan Carpenter
Cc: Bruno Randolf, Luis R. Rodriguez, Nick Kossifidis, Jiri Slaby,
Bob Copeland, John W. Linville, linux-wireless, ath5k-devel,
kernel-janitors, LKML
In-Reply-To: <20100723095252.GA26313@bicker>
On Fri, 2010-07-23 at 12:04 +0200, Dan Carpenter wrote:
> This is a smatch thing. I suppose someday I will fix smatch to
> evaulate the strings themselves and verify that the buffer is large
> enough. But for now it's nice to be able to automatically check that
> the buffers don't overflow.
There are also many repeated uses of snprintf in kernel sources
that could similarly be a problem.
bar += snprintf(foo + bar, ...)
bar += snprintf(foo + bar, ...)
or
foo += snprintf(foo, ...)
foo += snprintf(foo, ...)
For instance:
$ grep -P -n -A 4 -m 3 "\+=\s*snprintf" drivers/net/wireless/ath/ath5k/debug.c
210: len += snprintf(buf+len, sizeof(buf)-len,
211- "%-24s0x%08x\tintval: %d\tTIM: 0x%x\n",
212- "AR5K_BEACON", v, v & AR5K_BEACON_PERIOD,
213- (v & AR5K_BEACON_TIM) >> AR5K_BEACON_TIM_S);
214-
215: len += snprintf(buf+len, sizeof(buf)-len, "%-24s0x%08x\n",
216- "AR5K_LAST_TSTP", ath5k_hw_reg_read(sc->ah, AR5K_LAST_TSTP));
217-
218: len += snprintf(buf+len, sizeof(buf)-len, "%-24s0x%08x\n\n",
219- "AR5K_BEACON_CNT", ath5k_hw_reg_read(sc->ah, AR5K_BEACON_CNT));
220-
A conversion from snprintf to scnprintf might be appropriate
for those patterns.
^ permalink raw reply
* Re: udevd / ext4 issue mounting 2.6.35-rc5
From: Luis R. Rodriguez @ 2010-07-23 17:56 UTC (permalink / raw)
To: Daniel J Blueman, Luis R. Rodriguez
Cc: linux-ext4, Rafael J. Wysocki, Ubuntu Kernel Team, linux-kernel,
linux-wireless
In-Reply-To: <AANLkTikwQg6ZC-5tAzBExnNSx5J7Zgyc14sPXE7KqLW5@mail.gmail.com>
On Fri, Jul 23, 2010 at 9:49 AM, Luis R. Rodriguez <mcgrof@gmail.com> wrote:
> On Thu, Jul 22, 2010 at 2:10 AM, Daniel J Blueman
> <daniel.blueman@gmail.com> wrote:
>> On 22 July 2010 02:06, Luis R. Rodriguez <mcgrof@gmail.com> wrote:
>>> On Wed, Jul 21, 2010 at 1:43 AM, Daniel J Blueman
>>> <daniel.blueman@gmail.com> wrote:
>>>> Hi Luis,
>>>>
>>>> On 21 July 2010 01:36, Luis R. Rodriguez <mcgrof@gmail.com> wrote:
>>>>> I have been reluctant to boot to 2.6.35-rc due to the large set of
>>>>> regression list and the amount of work I needed to actually get done
>>>>> on 2.6.35. Last I checked the regression list it was getting small so
>>>>> I gave it a spin today. No luck. I get some bootup error from udevd
>>>>> and ext2/ext3/ext4, something like this:
>>>>>
>>>>> EXT3-fs (sda1): error: couldn't mount because of unsupported optional
>>>>> features (240)
>>>>> EXT2-fs (sda1): error: couldn't mount because of unsupported optional
>>>>> features (240)
>>>>> EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
>>>>
>>>> This succeeded.
>>>
>>> Heh, OK :)
>>>
>>>>> VFS: Mounted root (ext4 filesystem) readonly on device 8:1
>>>>> Freeing unused kernel memory: 708k freed
>>>>> Write protecting the kernel read-only data: 102040k
>>>>> Freeing unused kernel memory: 764k freed
>>>>> Freeing unused kernel memory: 1796k freed
>>>>> udevd: failed to create queue file: No such file or directory
>>>>> udevd: error creating queue file
>>>>
>>>> It looks like you need to enable:
>>>>
>>>> CONFIG_DEVTMPFS
>>>> CONFIG_DEVTMPFS_MOUNT
>>>
>>> Thanks, it also turned out that when I upgraded from Ubuntu 9.10 to
>>> Ubuntu 10.04 it replaced my own /sbin/installkernel so this was likely
>>> another issue. My /sbin/installkernel changes allow for easy initramfs
>>> installation on Debian/Ubuntu but my patches have been ignored my the
>>> maintainer.
>>>
>>> --- installkernel-ubuntu-10.04 2010-07-21 18:03:34.607678010 -0700
>>> +++ installkernel 2010-01-29 13:17:10.000000000 -0800
>>> @@ -36,7 +36,8 @@
>>> # Create backups of older versions before installing
>>> updatever () {
>>> if [ -f "$dir/$1-$ver" ] ; then
>>> - mv "$dir/$1-$ver" "$dir/$1-$ver.old"
>>> + #mv "$dir/$1-$ver" "$dir/$1-$ver.old"
>>> + rm -f "$dir/$1-$ver" "$dir/$1-$ver.old"
>>> fi
>>>
>>> cat "$2" > "$dir/$1-$ver"
>>> @@ -75,5 +76,16 @@
>>> if [ -f "$config" ] ; then
>>> updatever config "$config"
>>> fi
>>> +
>>> +LSB_RED_ID=$(/usr/bin/lsb_release -i -s)
>>> +
>>> +case $LSB_RED_ID in
>>> +"Ubuntu")
>>> + update-initramfs -c -k $ver
>>> + update-grub
>>> + ;;
>>> +*)
>>> + ;;
>>> +esac
>>>
>>> exit 0
>>>
>>> But anyway I also now get another boot failure with:
>>>
>>> mount: mounting /dev on /root/dev failed: No such file or directory
>>> mount: mounting /sys on /root/sys failed: No such file or directory
>>
>> Hmm...the scripts in the initrd are not doing what is expected -
>> perhaps if you didn't use:
>> linux$ fakeroot make-kpkg --append-to-version -luis1 --initrd kernel-image
>
> I am not using that to build my kernels I just build my kernels with
>
> make
> sudo make modules_install install
>
>> ...or if there are eg initrd script modifications on the filesystem
>> when it cooked the initd.
>
> I haven't modified any initrd scripts.
>
>> You could just try eg:
>> http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-image-2.6.35-9-generic_2.6.35-9.14_amd64.deb
Fun, so that kernel actually works but the one I am building from
wireless-testing.git does not. The curious thing is it doesn't boot
even if I remove my 802.11 module... so something is fishy. This is
likely a config issue. After booting with the above kernel though I
generated a new one with
make localmodconfig
and then enabled my 802.11 modules. Still, no luck.. Going to reset my
tree, I had manually merged Linus' latest stuff in but I don't think
this should matter.
Luis
^ permalink raw reply
* Re: [PATCH 6/6] pcmcia: remove cs_types.h
From: David Miller @ 2010-07-23 18:48 UTC (permalink / raw)
To: linux
Cc: linux-pcmcia, netdev, linux-wireless, linux-ide, linux-usb,
laforge, linux-mtd, linux-bluetooth, alsa-devel, linux-serial
In-Reply-To: <1279874305-21191-6-git-send-email-linux@dominikbrodowski.net>
From: Dominik Brodowski <linux@dominikbrodowski.net>
Date: Fri, 23 Jul 2010 10:38:25 +0200
> Remove cs_types.h which is no longer needed: Most definitions aren't
> used at all, a few can be made away with, and two remaining definitions
> (typedefs, unfortunatley) may be moved to more specific places.
>
> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* Re: Atheros 0cf3:b003
From: Luis R. Rodriguez @ 2010-07-23 19:03 UTC (permalink / raw)
To: Maximi89; +Cc: Stephen Chen, Sujith, linux-wireless
In-Reply-To: <AANLkTimfc3NY46aYqPM5Ys2i9vpm2_qr5-kgsvc3sdkx@mail.gmail.com>
2010/7/23 Maximi89 <maximi89@gmail.com>:
> Hola Luis, conoces ese ID?, Atheros 0cf3:b003
> Es efectivamente un AR9271?
No, cual tarjeta es esa? Las que tenemos son estos:
static struct usb_device_id ath9k_hif_usb_ids[] = {
{ USB_DEVICE(0x0cf3, 0x9271) }, /* Atheros */
{ USB_DEVICE(0x0cf3, 0x1006) }, /* Atheros */
{ USB_DEVICE(0x0cf3, 0x7010) }, /* Atheros */
{ USB_DEVICE(0x0cf3, 0x7015) }, /* Atheros */
{ USB_DEVICE(0x0846, 0x9030) }, /* Netgear N150 */
{ USB_DEVICE(0x0846, 0x9018) }, /* Netgear WNDA3200 */
{ USB_DEVICE(0x07D1, 0x3A10) }, /* Dlink Wireless 150 */
{ USB_DEVICE(0x13D3, 0x3327) }, /* Azurewave */
{ USB_DEVICE(0x13D3, 0x3328) }, /* Azurewave */
{ USB_DEVICE(0x04CA, 0x4605) }, /* Liteon */
{ USB_DEVICE(0x083A, 0xA704) }, /* SMC Networks */
{ },
};
Stephen, have you heard of 0cf3:b003 as an ar9271 or HB94 card?
Luis
^ permalink raw reply
* Compat-wireless release for 2010-07-23 is baked
From: Compat-wireless cronjob account @ 2010-07-23 19:03 UTC (permalink / raw)
To: linux-wireless
>From git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/compat-wireless-2.6
8302dc6..b2124fd linux-2.6.35.y -> origin/linux-2.6.35.y
* [new tag] compat-wireless-v2.6.35-rc6 -> compat-wireless-v2.6.35-rc6
>From git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next
afdbfed..f435fa7 history -> origin/history
+ dd5c869...80e9579 master -> origin/master (forced update)
cd5b8f8..b37fa16 stable -> origin/stable
* [new tag] next-20100723 -> next-20100723
* [new tag] v2.6.35-rc6 -> v2.6.35-rc6
compat-wireless code metrics
493730 - Total upstream lines of code being pulled
1447 - backport code changes
1211 - backport code additions
236 - backport code deletions
5764 - backport from compat module
7211 - total backport code
1.4605 - % of code consists of backport work
1218 - Crap changes not yet posted
1179 - Crap additions not yet posted
39 - Crap deletions not yet posted
0.2467 - % of crap code
Base tree: linux-next.git
Base tree version: next-20100723
compat-wireless release: compat-wireless-2010-07-13-4-g04898a5
^ permalink raw reply
* Re: [patch -next] ath5k: snprintf() returns largish values
From: Linus Torvalds @ 2010-07-23 19:21 UTC (permalink / raw)
To: Joe Perches
Cc: Dan Carpenter, Bruno Randolf, Luis R. Rodriguez, Nick Kossifidis,
Jiri Slaby, Bob Copeland, John W. Linville, linux-wireless,
ath5k-devel, kernel-janitors, LKML
In-Reply-To: <1279907297.24768.1678.camel@Joe-Laptop.home>
On Fri, Jul 23, 2010 at 10:48 AM, Joe Perches <joe@perches.com> wrote:
>
> There are also many repeated uses of snprintf in kernel sources
> that could similarly be a problem.
>
> bar += snprintf(foo + bar, ...)
> bar += snprintf(foo + bar, ...)
> or
> foo += snprintf(foo, ...)
> foo += snprintf(foo, ...)
As long as the number of bytes is updated correctly, this won't be a
security problem, although it can cause a (single) warning. The kernel
vsnprintf does
if (WARN_ON_ONCE((int) size < 0))
return 0;
so if somebody overflows a buffer with multiple snprintf calls, it
will all be ok as long as the buffer size thing is updated the natural
way (possibly using pointer arithmetic, eg "end - bar").
Linus
^ permalink raw reply
* regulatory hiccup
From: Andrew Lutomirski @ 2010-07-23 19:30 UTC (permalink / raw)
To: linux-wireless
This is 2.6.35-rc4, but this bug (?) might exist in other versions ,too.
Early in boot, all was well:
[ 5524.214376] cfg80211: Calling CRDA to update world regulatory domain
[ 5524.219025] cfg80211: Calling CRDA for country: US
[ 5524.238440] cfg80211: Regulatory domain changed to country: US
[ 5524.238443] (start_freq - end_freq @ bandwidth),
(max_antenna_gain, max_eirp)
[ 5524.238446] (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)
[ 5524.238448] (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1700 mBm)
[ 5524.238451] (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 5524.238454] (5490000 KHz - 5600000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 5524.238456] (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 5524.238459] (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 3000 mBm)
Then, after fiddling with an AP for a bit, I got:
[11747.264221] cfg80211: Calling CRDA for country: US
[11747.282664] cfg80211: Current regulatory domain updated by AP to: US
[11747.282672] (start_freq - end_freq @ bandwidth),
(max_antenna_gain, max_eirp)
[11747.282680] (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1600 mBm)
[11747.282688] (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 1600 mBm)
(Note lots of missing channels after that.) iw phy phy0 info showed
all the channels above 5.33GHz disabled. I didn't see some other APs
that were there.
Later on I disconnected, CRDA got called again, and all was well.
The AP that I had just connected to when everything broke was an
EnGenuis ESR7750 (brand new), and maybe it sent something wrong, but
surely if it says US it shouldn't disable other APs on US bands that
CRDA says is OK.
^ permalink raw reply
* Re: regulatory hiccup
From: Andrew Lutomirski @ 2010-07-23 19:35 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <AANLkTimdDhHudW6_7Hwcf6UCumY_EgqGd7CLtmSgOzEz@mail.gmail.com>
On Fri, Jul 23, 2010 at 3:30 PM, Andrew Lutomirski <luto@mit.edu> wrote:
>
> Then, after fiddling with an AP for a bit, I got:
>
> [11747.264221] cfg80211: Calling CRDA for country: US
> [11747.282664] cfg80211: Current regulatory domain updated by AP to: US
> [11747.282672] (start_freq - end_freq @ bandwidth),
> (max_antenna_gain, max_eirp)
> [11747.282680] (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1600 mBm)
> [11747.282688] (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 1600 mBm)
>
It's worse than that. I reconnected to the AP (it appeared to work
for a few seconds) and I saw:
Wiphy phy0
[...]
Band 2:
Capabilities: 0x872
HT20/HT40
Static SM Power Save
RX Greenfield
RX HT20 SGI
RX HT40 SGI
No RX STBC
Max AMSDU length: 3839 bytes
No DSSS/CCK HT40
Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
Minimum RX AMPDU time spacing: 4 usec (0x05)
HT TX/RX MCS rate indexes supported: 0-23, 32
Frequencies:
* 5180 MHz [36] (15.0 dBm) (passive scanning, no IBSS)
* 5200 MHz [40] (15.0 dBm) (passive scanning, no IBSS)
* 5220 MHz [44] (15.0 dBm) (passive scanning, no IBSS)
* 5240 MHz [48] (15.0 dBm) (passive scanning, no IBSS)
* 5260 MHz [52] (15.0 dBm) (passive scanning, no IBSS, radar detection)
* 5280 MHz [56] (15.0 dBm) (passive scanning, no IBSS, radar detection)
* 5300 MHz [60] (15.0 dBm) (passive scanning, no IBSS, radar detection)
* 5320 MHz [64] (15.0 dBm) (passive scanning, no IBSS, radar detection)
* 5500 MHz [100] (disabled)
* 5520 MHz [104] (disabled)
* 5540 MHz [108] (disabled)
* 5560 MHz [112] (disabled)
* 5580 MHz [116] (disabled)
* 5600 MHz [120] (disabled)
* 5620 MHz [124] (disabled)
* 5640 MHz [128] (disabled)
* 5660 MHz [132] (disabled)
* 5680 MHz [136] (disabled)
* 5700 MHz [140] (disabled)
* 5745 MHz [149] (disabled)
* 5765 MHz [153] (disabled)
* 5785 MHz [157] (disabled)
* 5805 MHz [161] (disabled)
* 5825 MHz [165] (disabled)
Which is absurd, because:
Connected to 00:02:6f:6e:d7:6c (on wlan0)
SSID: FFTT5
freq: 5785 [!!!!!!!!!!!]
RX: 72058 bytes (310 packets)
TX: 2568 bytes (20 packets)
signal: -33 dBm
tx bitrate: 6.0 MBit/s
The connection died after a little while, presumably because the AP
was outside of its own allowed band.
^ permalink raw reply
* hex_to_bin() patch
From: David Miller @ 2010-07-23 19:52 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
Just FYI I tossed it into net-next-2.6 since it was easy for me
to do so. This way you don't have to :)
Thanks.
^ permalink raw reply
* Re: regulatory hiccup
From: Andrew Lutomirski @ 2010-07-23 20:03 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <AANLkTinfMiS=+dqi=azF2exJbkrSLYT9nN0aor7gff-Q@mail.gmail.com>
On Fri, Jul 23, 2010 at 3:35 PM, Andrew Lutomirski <luto@mit.edu> wrote:
> On Fri, Jul 23, 2010 at 3:30 PM, Andrew Lutomirski <luto@mit.edu> wrote:
>>
>> Then, after fiddling with an AP for a bit, I got:
>>
>> [11747.264221] cfg80211: Calling CRDA for country: US
>> [11747.282664] cfg80211: Current regulatory domain updated by AP to: US
>> [11747.282672] (start_freq - end_freq @ bandwidth),
>> (max_antenna_gain, max_eirp)
>> [11747.282680] (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1600 mBm)
>> [11747.282688] (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 1600 mBm)
>>
>
> It's worse than that. I reconnected to the AP (it appeared to work
> for a few seconds) and I saw:
>
> Wiphy phy0
> [...]
> Band 2:
> Capabilities: 0x872
> HT20/HT40
> Static SM Power Save
> RX Greenfield
> RX HT20 SGI
> RX HT40 SGI
> No RX STBC
> Max AMSDU length: 3839 bytes
> No DSSS/CCK HT40
> Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
> Minimum RX AMPDU time spacing: 4 usec (0x05)
> HT TX/RX MCS rate indexes supported: 0-23, 32
> Frequencies:
> * 5180 MHz [36] (15.0 dBm) (passive scanning, no IBSS)
> * 5200 MHz [40] (15.0 dBm) (passive scanning, no IBSS)
> * 5220 MHz [44] (15.0 dBm) (passive scanning, no IBSS)
> * 5240 MHz [48] (15.0 dBm) (passive scanning, no IBSS)
> * 5260 MHz [52] (15.0 dBm) (passive scanning, no IBSS, radar detection)
> * 5280 MHz [56] (15.0 dBm) (passive scanning, no IBSS, radar detection)
> * 5300 MHz [60] (15.0 dBm) (passive scanning, no IBSS, radar detection)
> * 5320 MHz [64] (15.0 dBm) (passive scanning, no IBSS, radar detection)
> * 5500 MHz [100] (disabled)
> * 5520 MHz [104] (disabled)
> * 5540 MHz [108] (disabled)
> * 5560 MHz [112] (disabled)
> * 5580 MHz [116] (disabled)
> * 5600 MHz [120] (disabled)
> * 5620 MHz [124] (disabled)
> * 5640 MHz [128] (disabled)
> * 5660 MHz [132] (disabled)
> * 5680 MHz [136] (disabled)
> * 5700 MHz [140] (disabled)
> * 5745 MHz [149] (disabled)
> * 5765 MHz [153] (disabled)
> * 5785 MHz [157] (disabled)
> * 5805 MHz [161] (disabled)
> * 5825 MHz [165] (disabled)
>
> Which is absurd, because:
>
> Connected to 00:02:6f:6e:d7:6c (on wlan0)
> SSID: FFTT5
> freq: 5785 [!!!!!!!!!!!]
> RX: 72058 bytes (310 packets)
> TX: 2568 bytes (20 packets)
> signal: -33 dBm
> tx bitrate: 6.0 MBit/s
>
> The connection died after a little while, presumably because the AP
> was outside of its own allowed band.
>
Here's the offending country IE:
Country Information: Country Code: US, Indoor Environment
Tag Number: 7 (Country Information)
Tag length: 6
Tag interpretation: Country Code: US, Indoor Environment
Start Channel: 36, Channels: 13, Max TX Power: 16 dBm
AFAICT net/wireless/reg.c ignores the last bit, and the other APs that
work correctly here don't send country IEs.
--Andy
^ permalink raw reply
* Re: 2.6.35-rc6: Reported regressions from 2.6.34
From: Rafael J. Wysocki @ 2010-07-23 20:09 UTC (permalink / raw)
To: Larry Finger
Cc: Linux Kernel Mailing List, Maciej Rutecki, Andrew Morton,
Linus Torvalds, Kernel Testers List, Network Development,
Linux ACPI, Linux PM List, Linux SCSI List, Linux Wireless List,
DRI
In-Reply-To: <4C49A577.3020306@lwfinger.net>
On Friday, July 23, 2010, Larry Finger wrote:
> On 07/23/2010 06:42 AM, Rafael J. Wysocki wrote:
> > This message contains a list of some regressions from 2.6.34,
> > for which there are no fixes in the mainline known to the tracking team.
> > If any of them have been fixed already, please let us know.
>
> > Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=16312
> > Subject : WARNING: at fs/fs-writeback.c:1127 __mark_inode_dirty
> > Submitter : Zdenek Kabelac<zdenek.kabelac@gmail.com>
> > Date : 2010-06-28 9:40 (26 days old)
> > Message-ID :<AANLkTin24fr5O4_q5Xbo9Y_NKkEmtcp6Hgmr9_4qXaFz@mail.gmail.com>
> > References : http://marc.info/?l=linux-kernel&m=127771804806465&w=2
>
> I still have this in 2.6.35-rc5.
Thanks for the update.
Rafael
^ permalink raw reply
* iwlwifi connection problems
From: Alex Romosan @ 2010-07-23 20:14 UTC (permalink / raw)
To: linux-wireless
since kernel 2.6.35-rc3 (i didn't try 1 or 2) i haven't been able to
connect to a hidden wireless access point using the iwlwifi driver. i
can connect to open ones though (the ones that broadcast their name).
2.6.34 worked without any problems. any ideas?
this is with the driver in the standard linux kernel (2.6.35-rc6 is the
latest one i tried).
--alex--
--
| I believe the moment is at hand when, by a paranoiac and active |
| advance of the mind, it will be possible (simultaneously with |
| automatism and other passive states) to systematize confusion |
| and thus to help to discredit completely the world of reality. |
^ permalink raw reply
* Re: iwlwifi connection problems
From: Guy, Wey-Yi @ 2010-07-23 20:38 UTC (permalink / raw)
To: Berg, Johannes, Alex Romosan; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <87tynqvtu6.fsf@sycorax.lbl.gov>
Hi Johannes,
On Fri, 2010-07-23 at 13:14 -0700, Alex Romosan wrote:
> since kernel 2.6.35-rc3 (i didn't try 1 or 2) i haven't been able to
> connect to a hidden wireless access point using the iwlwifi driver. i
> can connect to open ones though (the ones that broadcast their name).
> 2.6.34 worked without any problems. any ideas?
>
> this is with the driver in the standard linux kernel (2.6.35-rc6 is the
> latest one i tried).
Do you aware any changes?
Thanks
Wey
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox