update for 2.6.38
cover update for 2.6.38
We add more changes to prepare P2P supports
We also add few features/changes to WiFi/BT coex, such as dynamic aggregation.
For newer devices, we change the default LED mode to On/Off
Johannes Berg (9):
iwlagn: fix some naming regarding FIFOs
iwlagn: remove unused variable swq_id
iwlagn: remove a bogus AGG_OFF check
iwlwifi: pass txq to wake/stop queue
iwlwifi: always build swq_id as virtual queue ID
iwlagn: fix PAN queues
iwlagn: avoid crash if vif is not assigned
iwlagn: reprogram AP STA after assoc
iwlagn: fix PAN slot timing wrt. DTIM
Shanyu Zhao (2):
iwlagn: update QoS before commit associated RXON
iwlagn: check change before commit RXON cmd
Wey-Yi Guy (7):
iwlagn: used frame count info in compressed ba packet
iwlagn: set dynamic aggregation threshold for BT
iwlagn: support dynamic aggregation for BT coex
iwlagn: change default ACK/CTS MASK setting for WiFi/BT coex
iwlwifi: change default led mode for different devices
iwlagn: use SKU information in the EEPROM
iwlwifi: set STATUS_READY before commit_rxon
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 | 8 +- drivers/net/wireless/iwlwifi/iwl-3945.c | 4 +- drivers/net/wireless/iwlwifi/iwl-4965.c | 13 +-- drivers/net/wireless/iwlwifi/iwl-5000.c | 14 ++-- drivers/net/wireless/iwlwifi/iwl-6000.c | 37 +++++----- drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c | 21 +++++ drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c | 5 +- drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 17 +--- drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 32 ++++---- drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | 103 ++++++++++++++----------- drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 77 ++++++++++++------- drivers/net/wireless/iwlwifi/iwl-agn-ucode.c | 65 +++++++++------- drivers/net/wireless/iwlwifi/iwl-agn.c | 11 ++- drivers/net/wireless/iwlwifi/iwl-commands.h | 13 ++- drivers/net/wireless/iwlwifi/iwl-core.c | 2 +- drivers/net/wireless/iwlwifi/iwl-core.h | 7 ++- drivers/net/wireless/iwlwifi/iwl-debugfs.c | 9 +-- drivers/net/wireless/iwlwifi/iwl-dev.h | 3 +- drivers/net/wireless/iwlwifi/iwl-eeprom.h | 12 +++- drivers/net/wireless/iwlwifi/iwl-helpers.h | 36 ++++----- drivers/net/wireless/iwlwifi/iwl-led.c | 10 ++- drivers/net/wireless/iwlwifi/iwl-led.h | 6 +- drivers/net/wireless/iwlwifi/iwl-sta.c | 51 +++++++++++- drivers/net/wireless/iwlwifi/iwl-sta.h | 1 + drivers/net/wireless/iwlwifi/iwl-tx.c | 11 +-- drivers/net/wireless/iwlwifi/iwl3945-base.c | 2 +- 26 files changed, 345 insertions(+), 225 deletions(-)
PATCH 2/18 iwlagn: set dynamic aggregation threshold for BT
Setting the max/min/def value for BT dynamic aggregation threshold.
--- drivers/net/wireless/iwlwifi/iwl-commands.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/iwlwifi/iwl-commands.h +3 -3
@@ -2410,9 +2410,9 @@ struct iwl_link_quality_cmd {#define BT_FRAG_THRESHOLD_MAX 0#define BT_FRAG_THRESHOLD_MIN 0 -#define BT_AGG_THRESHOLD_DEF 0 -#define BT_AGG_THRESHOLD_MAX 0 -#define BT_AGG_THRESHOLD_MIN 0 +#define BT_AGG_THRESHOLD_DEF 1200 +#define BT_AGG_THRESHOLD_MAX 8000 +#define BT_AGG_THRESHOLD_MIN 400/* * REPLY_BT_CONFIG = 0x9b (command, has simple generic response)
Signature · 1 line
1.7.0.4
PATCH 1/18 iwlagn: used frame count info in compressed ba packet
In reply to Wey-Yi GuyFor newer devices, uCode provide both "number of frames sent" and "number of frames acked" information inside the compressed_ba packet. So instead of figure the success/failure information through the bitmap, use those information which is much betrer approach.
--- drivers/net/wireless/iwlwifi/iwl-4965.c | 1 + drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 68 ++++++++++++++++++--------- drivers/net/wireless/iwlwifi/iwl-commands.h | 3 + drivers/net/wireless/iwlwifi/iwl-core.h | 5 ++- 4 files changed, 54 insertions(+), 23 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965.c +1 -0
@@ -2620,6 +2620,7 @@ static struct iwl_base_params iwl4965_base_params = { .ucode_tracing = true, .sensitivity_calib_by_driver = true, .chain_noise_calib_by_driver = true, + .no_agg_framecnt_info = true, };struct iwl_cfg iwl4965_agn_cfg = {
drivers/net/wireless/iwlwifi/iwl-agn-tx.c +46 -22
83 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-commands.h +3 -0
@@ -2022,6 +2022,9 @@ struct iwl_compressed_ba_resp {__le64 bitmap;__le16 scd_flow;__le16 scd_ssn; +/* following only for 5000 series and up */ +u8 txed;/* number of frames sent */ +u8 txed_2_done;/* number of frames acked */ } __packed;/*
drivers/net/wireless/iwlwifi/iwl-core.h +4 -1
@@ -291,7 +291,9 @@ struct iwl_mod_params {* @chain_noise_calib_by_driver: driver has the capability to perform * chain noise calibration operation * @shadow_reg_enable: HW shadhow register bit -*/ +* @no_agg_framecnt_info: uCode do not provide aggregation frame count +* information +*/ struct iwl_base_params {int eeprom_size;int num_of_queues;/* def: HW dependent */
@@ -322,6 +324,7 @@ struct iwl_base_params {const bool sensitivity_calib_by_driver;const bool chain_noise_calib_by_driver;const bool shadow_reg_enable; +const bool no_agg_framecnt_info; };/* * @advanced_bt_coexist: support advanced bt coexist
Signature · 1 line
1.7.0.4
PATCH 3/18 iwlagn: support dynamic aggregation for BT coex
In reply to Wey-Yi GuyUse dynamic aggregation threshold if bt traffic load is high to reduce the impact on aggregated frame.
--- drivers/net/wireless/iwlwifi/iwl-6000.c | 1 + drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 6 +--- drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 32 ++++++++++++++------------- drivers/net/wireless/iwlwifi/iwl-agn.c | 1 - drivers/net/wireless/iwlwifi/iwl-core.c | 2 +- drivers/net/wireless/iwlwifi/iwl-debugfs.c | 2 +- drivers/net/wireless/iwlwifi/iwl-dev.h | 3 +- 7 files changed, 23 insertions(+), 24 deletions(-)
drivers/net/wireless/iwlwifi/iwl-6000.c +1 -0
@@ -546,6 +546,7 @@ static struct iwl_bt_params iwl6000_bt_params = { .bt_statistics = true, /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ .advanced_bt_coexist = true, + .agg_time_limit = BT_AGG_THRESHOLD_DEF, .bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE, .bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT, };
drivers/net/wireless/iwlwifi/iwl-agn-lib.c +2 -4
@@ -2025,7 +2025,6 @@ void iwlagn_bt_coex_profile_notif(struct iwl_priv *priv,struct iwl_bt_coex_profile_notif *coex = &pkt->u.bt_coex_profile_notif;struct iwlagn_bt_sco_cmd sco_cmd = { .flags =0 };struct iwl_bt_uart_msg *uart_msg = &coex->last_bt_uart_msg; -u8 last_traffic_load;IWL_DEBUG_NOTIF (priv,"BT Coex notification:\n" );IWL_DEBUG_NOTIF (priv," status: %d\n" , coex->bt_status);
@@ -2034,11 +2033,10 @@ void iwlagn_bt_coex_profile_notif(struct iwl_priv *priv, coex->bt_ci_compliance);iwlagn_print_uartmsg (priv, uart_msg); - last_traffic_load = priv->notif_bt_traffic_load; - priv->notif_bt_traffic_load = coex->bt_traffic_load; + priv->last_bt_traffic_load = priv->bt_traffic_load;if (priv->iw_mode !=NL80211_IFTYPE_ADHOC ) {if (priv->bt_status != coex->bt_status || - last_traffic_load != coex->bt_traffic_load) { + priv->last_bt_traffic_load != coex->bt_traffic_load) {if (coex->bt_status) {/* BT on */ if (!priv->bt_ch_announce)
drivers/net/wireless/iwlwifi/iwl-agn-rs.c +17 -15
@@ -833,17 +833,23 @@ static void rs_bt_update_lq(struct iwl_priv *priv, struct iwl_rxon_context *ctx, struct iwl_lq_sta *lq_sta) {struct iwl_scale_tbl_info *tbl; -bool full_concurrent; +bool full_concurrent = priv->bt_full_concurrent;unsigned long flags; -spin_lock_irqsave (&priv->lock, flags); -if (priv->bt_ci_compliance && priv->bt_ant_couple_ok) - full_concurrent = true; -else - full_concurrent = false; -spin_unlock_irqrestore (&priv->lock, flags); - -if (priv->bt_full_concurrent != full_concurrent) { +if (priv->bt_ant_couple_ok) { +/* +* Is there a need to switch between +* full concurrency and 3-wire? +*/ +spin_lock_irqsave (&priv->lock, flags); +if (priv->bt_ci_compliance && priv->bt_ant_couple_ok) + full_concurrent = true; +else + full_concurrent = false; +spin_unlock_irqrestore (&priv->lock, flags); + } +if ((priv->bt_traffic_load != priv->last_bt_traffic_load) || + (priv->bt_full_concurrent != full_concurrent)) { priv->bt_full_concurrent = full_concurrent;/* Update uCode's rate table. */
@@ -1040,8 +1046,7 @@ done:if (sta && sta->supp_rates[sband->band])rs_rate_scale_perform (priv, skb, sta, lq_sta); -/* Is there a need to switch between full concurrency and 3-wire? */ -if (priv->bt_ant_couple_ok) +if (priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist)rs_bt_update_lq (priv, ctx, lq_sta); }
@@ -3010,10 +3015,7 @@ static void rs_fill_link_cmd(struct iwl_priv *priv,*/ if (priv && priv->cfg->bt_params && priv->cfg->bt_params->agg_time_limit && - priv->cfg->bt_params->agg_time_limit >= -LINK_QUAL_AGG_TIME_LIMIT_MIN && - priv->cfg->bt_params->agg_time_limit <= -LINK_QUAL_AGG_TIME_LIMIT_MAX ) + priv->bt_traffic_load >=IWL_BT_COEX_TRAFFIC_LOAD_HIGH ) lq_cmd->agg_params.agg_time_limit =cpu_to_le16 (priv->cfg->bt_params->agg_time_limit); }
drivers/net/wireless/iwlwifi/iwl-agn.c +0 -1
@@ -3837,7 +3837,6 @@ static int iwl_init_drv(struct iwl_priv *priv) priv->bt_on_thresh =BT_ON_THRESHOLD_DEF ; priv->bt_duration =BT_DURATION_LIMIT_DEF ; priv->dynamic_frag_thresh =BT_FRAG_THRESHOLD_DEF ; - priv->dynamic_agg_thresh =BT_AGG_THRESHOLD_DEF ; }/* Set the tx_power_user_lmt to the lowest power level
drivers/net/wireless/iwlwifi/iwl-core.c +1 -1
@@ -1469,7 +1469,7 @@ static void iwl_teardown_interface(struct iwl_priv *priv,* both values are the same and zero. */ if (vif->type ==NL80211_IFTYPE_ADHOC ) - priv->bt_traffic_load = priv->notif_bt_traffic_load; + priv->bt_traffic_load = priv->last_bt_traffic_load; } void iwl_mac_remove_interface(struct ieee80211_hw *hw,
drivers/net/wireless/iwlwifi/iwl-debugfs.c +1 -1
@@ -1580,7 +1580,7 @@ static ssize_t iwl_dbgfs_bt_traffic_read(struct file *file, priv->bt_full_concurrent ? "full concurrency" : "3-wire"); pos +=scnprintf (buf + pos, bufsz - pos,"BT status: %s, " "last traffic notif: %d\n" , - priv->bt_status ?"On" :"Off" , priv->notif_bt_traffic_load); + priv->bt_status ?"On" :"Off" , priv->last_bt_traffic_load); pos += scnprintf(buf + pos, bufsz - pos, "ch_announcement: %d, " "sco_active: %d, kill_ack_mask: %x, " "kill_cts_mask: %x\n",
drivers/net/wireless/iwlwifi/iwl-dev.h +1 -2
@@ -1471,7 +1471,7 @@ struct iwl_priv {/* bt coex */ u8 bt_status; -u8 bt_traffic_load, notif_bt_traffic_load; +u8 bt_traffic_load, last_bt_traffic_load;bool bt_ch_announce;bool bt_sco_active;bool bt_full_concurrent;
@@ -1482,7 +1482,6 @@ struct iwl_priv {u16 bt_on_thresh;u16 bt_duration;u16 dynamic_frag_thresh; -u16 dynamic_agg_thresh;u8 bt_ci_compliance;struct work_struct bt_traffic_change_work;
Signature · 1 line
1.7.0.4
PATCH 4/18 iwlagn: change default ACK/CTS MASK setting for WiFi/BT coex
In reply to Wey-Yi GuyChange the default BT_KILL_ACK_MASK and BT_KILL_CTS_MASK for BT coex
--- drivers/net/wireless/iwlwifi/iwl-commands.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/iwl-commands.h +2 -2
@@ -2450,8 +2450,8 @@ struct iwl_bt_cmd {#define IWLAGN_BT3_T7_DEFAULT 1 -#define IWLAGN_BT_KILL_ACK_MASK_DEFAULT cpu_to_le32(0xffffffff) -#define IWLAGN_BT_KILL_CTS_MASK_DEFAULT cpu_to_le32(0xffffffff) +#define IWLAGN_BT_KILL_ACK_MASK_DEFAULT cpu_to_le32(0xffff0000) +#define IWLAGN_BT_KILL_CTS_MASK_DEFAULT cpu_to_le32(0xffff0000)#define IWLAGN_BT3_PRIO_SAMPLE_DEFAULT 2
Signature · 1 line
1.7.0.4
PATCH 5/18 iwlwifi: change default led mode for different devices
In reply to Wey-Yi GuySet the default led mode for different devices.
For the newer devices such as 6000g2a, 6000g2b and newer, the default led mode is On/Off instead of blinking.
The led_mode still can be control through module parameter
0: system default
1: On/Off
2: blinking
--- drivers/net/wireless/iwlwifi/iwl-1000.c | 4 ++++ drivers/net/wireless/iwlwifi/iwl-3945.c | 2 ++ drivers/net/wireless/iwlwifi/iwl-4965.c | 1 + drivers/net/wireless/iwlwifi/iwl-5000.c | 7 +++++++ drivers/net/wireless/iwlwifi/iwl-6000.c | 18 ++++++++++++++++++ drivers/net/wireless/iwlwifi/iwl-core.h | 2 ++ drivers/net/wireless/iwlwifi/iwl-led.c | 10 ++++++---- drivers/net/wireless/iwlwifi/iwl-led.h | 6 ++++-- 8 files changed, 44 insertions(+), 6 deletions(-)
drivers/net/wireless/iwlwifi/iwl-1000.c +4 -0
@@ -287,6 +287,7 @@ struct iwl_cfg iwl1000_bgn_cfg = { .mod_params = &iwlagn_mod_params, .base_params = &iwl1000_base_params, .ht_params = &iwl1000_ht_params, + .led_mode = IWL_LED_BLINK, };struct iwl_cfg iwl1000_bg_cfg = {
@@ -302,6 +303,7 @@ struct iwl_cfg iwl1000_bg_cfg = { .ops = &iwl1000_ops, .mod_params = &iwlagn_mod_params, .base_params = &iwl1000_base_params, + .led_mode = IWL_LED_BLINK, };struct iwl_cfg iwl100_bgn_cfg = {
@@ -318,6 +320,7 @@ struct iwl_cfg iwl100_bgn_cfg = { .mod_params = &iwlagn_mod_params, .base_params = &iwl1000_base_params, .ht_params = &iwl1000_ht_params, + .led_mode = IWL_LED_RF_STATE, };struct iwl_cfg iwl100_bg_cfg = {
@@ -333,6 +336,7 @@ struct iwl_cfg iwl100_bg_cfg = { .ops = &iwl1000_ops, .mod_params = &iwlagn_mod_params, .base_params = &iwl1000_base_params, + .led_mode = IWL_LED_RF_STATE, };MODULE_FIRMWARE (IWL1000_MODULE_FIRMWARE (IWL1000_UCODE_API_MAX ));
drivers/net/wireless/iwlwifi/iwl-3945.c +2 -0
@@ -2788,6 +2788,7 @@ static struct iwl_cfg iwl3945_bg_cfg = { .ops = &iwl3945_ops, .mod_params = &iwl3945_mod_params, .base_params = &iwl3945_base_params, + .led_mode = IWL_LED_BLINK, };static struct iwl_cfg iwl3945_abg_cfg = {
@@ -2800,6 +2801,7 @@ static struct iwl_cfg iwl3945_abg_cfg = { .ops = &iwl3945_ops, .mod_params = &iwl3945_mod_params, .base_params = &iwl3945_base_params, + .led_mode = IWL_LED_BLINK, };DEFINE_PCI_DEVICE_TABLE (iwl3945_hw_card_ids) = {
drivers/net/wireless/iwlwifi/iwl-4965.c +1 -0
@@ -2636,6 +2636,7 @@ struct iwl_cfg iwl4965_agn_cfg = { .ops = &iwl4965_ops, .mod_params = &iwlagn_mod_params, .base_params = &iwl4965_base_params, + .led_mode = IWL_LED_BLINK,/* * Force use of chains B and C for scan RX on 5 GHz band * because the device has off-channel reception on chain A.
drivers/net/wireless/iwlwifi/iwl-5000.c +7 -0
@@ -536,6 +536,7 @@ struct iwl_cfg iwl5300_agn_cfg = { .mod_params = &iwlagn_mod_params, .base_params = &iwl5000_base_params, .ht_params = &iwl5000_ht_params, + .led_mode = IWL_LED_BLINK, };struct iwl_cfg iwl5100_bgn_cfg = {
@@ -552,6 +553,7 @@ struct iwl_cfg iwl5100_bgn_cfg = { .mod_params = &iwlagn_mod_params, .base_params = &iwl5000_base_params, .ht_params = &iwl5000_ht_params, + .led_mode = IWL_LED_BLINK, };struct iwl_cfg iwl5100_abg_cfg = {
@@ -567,6 +569,7 @@ struct iwl_cfg iwl5100_abg_cfg = { .ops = &iwl5000_ops, .mod_params = &iwlagn_mod_params, .base_params = &iwl5000_base_params, + .led_mode = IWL_LED_BLINK, };struct iwl_cfg iwl5100_agn_cfg = {
@@ -583,6 +586,7 @@ struct iwl_cfg iwl5100_agn_cfg = { .mod_params = &iwlagn_mod_params, .base_params = &iwl5000_base_params, .ht_params = &iwl5000_ht_params, + .led_mode = IWL_LED_BLINK, };struct iwl_cfg iwl5350_agn_cfg = {
@@ -599,6 +603,7 @@ struct iwl_cfg iwl5350_agn_cfg = { .mod_params = &iwlagn_mod_params, .base_params = &iwl5000_base_params, .ht_params = &iwl5000_ht_params, + .led_mode = IWL_LED_BLINK, };struct iwl_cfg iwl5150_agn_cfg = {
@@ -616,6 +621,7 @@ struct iwl_cfg iwl5150_agn_cfg = { .base_params = &iwl5000_base_params, .ht_params = &iwl5000_ht_params, .need_dc_calib = true, + .led_mode = IWL_LED_BLINK, };struct iwl_cfg iwl5150_abg_cfg = {
@@ -632,6 +638,7 @@ struct iwl_cfg iwl5150_abg_cfg = { .mod_params = &iwlagn_mod_params, .base_params = &iwl5000_base_params, .need_dc_calib = true, + .led_mode = IWL_LED_BLINK, };MODULE_FIRMWARE (IWL5000_MODULE_FIRMWARE (IWL5000_UCODE_API_MAX ));
drivers/net/wireless/iwlwifi/iwl-6000.c +18 -0
@@ -567,6 +567,7 @@ struct iwl_cfg iwl6000g2a_2agn_cfg = { .ht_params = &iwl6000_ht_params, .need_dc_calib = true, .need_temp_offset_calib = true, + .led_mode = IWL_LED_RF_STATE, };struct iwl_cfg iwl6000g2a_2abg_cfg = {
@@ -584,6 +585,7 @@ struct iwl_cfg iwl6000g2a_2abg_cfg = { .base_params = &iwl6000_base_params, .need_dc_calib = true, .need_temp_offset_calib = true, + .led_mode = IWL_LED_RF_STATE, };struct iwl_cfg iwl6000g2a_2bg_cfg = {
@@ -601,6 +603,7 @@ struct iwl_cfg iwl6000g2a_2bg_cfg = { .base_params = &iwl6000_base_params, .need_dc_calib = true, .need_temp_offset_calib = true, + .led_mode = IWL_LED_RF_STATE, };struct iwl_cfg iwl6000g2b_2agn_cfg = {
@@ -620,6 +623,7 @@ struct iwl_cfg iwl6000g2b_2agn_cfg = { .ht_params = &iwl6000_ht_params, .need_dc_calib = true, .need_temp_offset_calib = true, + .led_mode = IWL_LED_RF_STATE, /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, };
@@ -640,6 +644,7 @@ struct iwl_cfg iwl6000g2b_2abg_cfg = { .bt_params = &iwl6000_bt_params, .need_dc_calib = true, .need_temp_offset_calib = true, + .led_mode = IWL_LED_RF_STATE, /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, };
@@ -661,6 +666,7 @@ struct iwl_cfg iwl6000g2b_2bgn_cfg = { .ht_params = &iwl6000_ht_params, .need_dc_calib = true, .need_temp_offset_calib = true, + .led_mode = IWL_LED_RF_STATE, /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, };
@@ -681,6 +687,7 @@ struct iwl_cfg iwl6000g2b_2bg_cfg = { .bt_params = &iwl6000_bt_params, .need_dc_calib = true, .need_temp_offset_calib = true, + .led_mode = IWL_LED_RF_STATE, /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, };
@@ -702,6 +709,7 @@ struct iwl_cfg iwl6000g2b_bgn_cfg = { .ht_params = &iwl6000_ht_params, .need_dc_calib = true, .need_temp_offset_calib = true, + .led_mode = IWL_LED_RF_STATE, /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, };
@@ -722,6 +730,7 @@ struct iwl_cfg iwl6000g2b_bg_cfg = { .bt_params = &iwl6000_bt_params, .need_dc_calib = true, .need_temp_offset_calib = true, + .led_mode = IWL_LED_RF_STATE, /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, };
@@ -744,6 +753,7 @@ struct iwl_cfg iwl6000i_2agn_cfg = { .base_params = &iwl6000_base_params, .ht_params = &iwl6000_ht_params, .pa_type = IWL_PA_INTERNAL, + .led_mode = IWL_LED_BLINK, };struct iwl_cfg iwl6000i_2abg_cfg = {
@@ -760,6 +770,7 @@ struct iwl_cfg iwl6000i_2abg_cfg = { .mod_params = &iwlagn_mod_params, .base_params = &iwl6000_base_params, .pa_type = IWL_PA_INTERNAL, + .led_mode = IWL_LED_BLINK, };struct iwl_cfg iwl6000i_2bg_cfg = {
@@ -776,6 +787,7 @@ struct iwl_cfg iwl6000i_2bg_cfg = { .mod_params = &iwlagn_mod_params, .base_params = &iwl6000_base_params, .pa_type = IWL_PA_INTERNAL, + .led_mode = IWL_LED_BLINK, };struct iwl_cfg iwl6050_2agn_cfg = {
@@ -793,6 +805,7 @@ struct iwl_cfg iwl6050_2agn_cfg = { .base_params = &iwl6050_base_params, .ht_params = &iwl6000_ht_params, .need_dc_calib = true, + .led_mode = IWL_LED_BLINK, };struct iwl_cfg iwl6050g2_bgn_cfg = {
@@ -810,6 +823,7 @@ struct iwl_cfg iwl6050g2_bgn_cfg = { .base_params = &iwl6050_base_params, .ht_params = &iwl6000_ht_params, .need_dc_calib = true, + .led_mode = IWL_LED_RF_STATE, };struct iwl_cfg iwl6050_2abg_cfg = {
@@ -826,6 +840,7 @@ struct iwl_cfg iwl6050_2abg_cfg = { .mod_params = &iwlagn_mod_params, .base_params = &iwl6050_base_params, .need_dc_calib = true, + .led_mode = IWL_LED_BLINK, };struct iwl_cfg iwl6000_3agn_cfg = {
@@ -843,6 +858,7 @@ struct iwl_cfg iwl6000_3agn_cfg = { .base_params = &iwl6000_base_params, .ht_params = &iwl6000_ht_params, .need_dc_calib = true, + .led_mode = IWL_LED_BLINK, };struct iwl_cfg iwl130_bgn_cfg = {
@@ -861,6 +877,7 @@ struct iwl_cfg iwl130_bgn_cfg = { .bt_params = &iwl6000_bt_params, .ht_params = &iwl6000_ht_params, .need_dc_calib = true, + .led_mode = IWL_LED_RF_STATE, /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, };
@@ -880,6 +897,7 @@ struct iwl_cfg iwl130_bg_cfg = { .base_params = &iwl6000_coex_base_params, .bt_params = &iwl6000_bt_params, .need_dc_calib = true, + .led_mode = IWL_LED_RF_STATE, /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, };
drivers/net/wireless/iwlwifi/iwl-core.h +2 -0
@@ -363,6 +363,7 @@ struct iwl_ht_params {* @need_dc_calib: need to perform init dc calibration * @need_temp_offset_calib: need to perform temperature offset calibration * @scan_antennas: available antenna for scan operation +* @led_mode: 0=blinking, 1=On(RF On)/Off(RF Off) * * We enable the driver to be backward compatible wrt API version. The * driver specifies which APIs it supports (with @ucode_api_max being the
@@ -409,6 +410,7 @@ struct iwl_cfg {const bool need_temp_offset_calib;/* if used set to true */ u8 scan_rx_antennas[IEEE80211_NUM_BANDS ];u8 scan_tx_antennas[IEEE80211_NUM_BANDS ]; +enum iwl_led_mode led_mode; };/***************************
drivers/net/wireless/iwlwifi/iwl-led.c +6 -4
@@ -45,9 +45,8 @@/* default: IWL_LED_BLINK(0) using blinking index table */ static int led_mode;module_param (led_mode, int,S_IRUGO ); -MODULE_PARM_DESC (led_mode,"led mode: 0=blinking, 1=On(RF On)/Off(RF Off), " -"(default 0)" ); - +MODULE_PARM_DESC (led_mode,"led mode: 0=system default, " +"1=On(RF On)/Off(RF Off), 2=blinking" ); static const struct { u16 tpt; /* Mb/s */
@@ -128,7 +127,7 @@ EXPORT_SYMBOL(iwl_led_start);int iwl_led_associate (struct iwl_priv *priv) {IWL_DEBUG_LED (priv,"Associated\n" ); -if (led_mode ==IWL_LED_BLINK ) +if (priv->cfg->led_mode ==IWL_LED_BLINK ) priv->allow_blinking =1 ; priv->last_blink_time = jiffies;
@@ -223,5 +222,8 @@ void iwl_leds_init(struct iwl_priv *priv) priv->last_blink_rate =0 ; priv->last_blink_time =0 ; priv->allow_blinking =0 ; +if (led_mode !=IWL_LED_DEFAULT && + led_mode != priv->cfg->led_mode) + priv->cfg->led_mode = led_mode; }EXPORT_SYMBOL (iwl_leds_init);
drivers/net/wireless/iwlwifi/iwl-led.h +4 -2
@@ -47,14 +47,16 @@ enum led_type {/* * LED mode -* IWL_LED_BLINK: adjust led blink rate based on blink table +* IWL_LED_DEFAULT: use system default * IWL_LED_RF_STATE: turn LED on/off based on RF state * LED ON = RF ON * LED OFF = RF OFF +* IWL_LED_BLINK: adjust led blink rate based on blink table */ enum iwl_led_mode { -IWL_LED_BLINK , +IWL_LED_DEFAULT ,IWL_LED_RF_STATE , +IWL_LED_BLINK , };void iwl_leds_init (struct iwl_priv *priv);
Signature · 1 line
1.7.0.4
PATCH 6/18 iwlagn: fix some naming regarding FIFOs
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
Some variables are misnamed in the FIFO setup
code, fix that.
--- drivers/net/wireless/iwlwifi/iwl-agn-ucode.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-ucode.c +6 -6
@@ -429,7 +429,7 @@ void iwlagn_send_bt_env(struct iwl_priv *priv, u8 action, u8 type)int iwlagn_alive_notify (struct iwl_priv *priv) { -const s8 *queues; +const s8 *queue_to_fifo;u32 a;unsigned long flags;int i, chan;
@@ -492,9 +492,9 @@ int iwlagn_alive_notify(struct iwl_priv *priv)/* map queues to FIFOs */ if (priv->valid_contexts !=BIT (IWL_RXON_CTX_BSS )) - queues = iwlagn_ipan_queue_to_tx_fifo; + queue_to_fifo = iwlagn_ipan_queue_to_tx_fifo;else - queues = iwlagn_default_queue_to_tx_fifo; + queue_to_fifo = iwlagn_default_queue_to_tx_fifo;iwlagn_set_wr_ptrs (priv, priv->cmd_queue,0 );
@@ -510,14 +510,14 @@ int iwlagn_alive_notify(struct iwl_priv *priv)BUILD_BUG_ON (ARRAY_SIZE (iwlagn_ipan_queue_to_tx_fifo) !=10 );for (i =0 ; i <10 ; i++) { -int ac = queues[i]; +int fifo = queue_to_fifo[i];iwl_txq_ctx_activate (priv, i); -if (ac ==IWL_TX_FIFO_UNUSED ) +if (fifo ==IWL_TX_FIFO_UNUSED )continue ; -iwlagn_tx_queue_set_status (priv, &priv->txq[i], ac,0 ); +iwlagn_tx_queue_set_status (priv, &priv->txq[i], fifo,0 ); }spin_unlock_irqrestore (&priv->lock, flags);
Signature · 1 line
1.7.0.4
PATCH 7/18 iwlagn: remove unused variable swq_id
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
Simply remove the unused variable swq_id.
--- drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-tx.c +1 -2
@@ -518,7 +518,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)struct iwl_cmd_meta *out_meta;struct iwl_tx_cmd *tx_cmd;struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS ]; -int swq_id, txq_id; +int txq_id;dma_addr_t phys_addr;dma_addr_t txcmd_phys;dma_addr_t scratch_phys;
@@ -620,7 +620,6 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) } txq = &priv->txq[txq_id]; - swq_id = txq->swq_id; q = &txq->q;if (unlikely (iwl_queue_space (q) < q->high_mark)) {
Signature · 1 line
1.7.0.4
PATCH 8/18 iwlagn: remove a bogus AGG_OFF check
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
Even if this check were to happen, using the txq_id here (which is a HW queue) would lead to confusion in mac80211. Luckily, it doesn't seem like this can ever happen.
--- drivers/net/wireless/iwlwifi/iwl-4965.c | 8 ++------ drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965.c +2 -6
@@ -2238,12 +2238,8 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,if (priv->mac80211_registered && (iwl_queue_space (&txq->q) > txq->q.low_mark) && - (agg->state !=IWL_EMPTYING_HW_QUEUE_DELBA )) { -if (agg->state ==IWL_AGG_OFF ) -iwl_wake_queue (priv, txq_id); -else -iwl_wake_queue (priv, txq->swq_id); - } + (agg->state !=IWL_EMPTYING_HW_QUEUE_DELBA )) +iwl_wake_queue (priv, txq->swq_id); } }else { info->status.rates[0 ].count = tx_resp->failure_frame +1 ;
drivers/net/wireless/iwlwifi/iwl-agn-lib.c +2 -6
@@ -445,12 +445,8 @@ static void iwlagn_rx_reply_tx(struct iwl_priv *priv,if (priv->mac80211_registered && (iwl_queue_space (&txq->q) > txq->q.low_mark) && - (agg->state !=IWL_EMPTYING_HW_QUEUE_DELBA )) { -if (agg->state ==IWL_AGG_OFF ) -iwl_wake_queue (priv, txq_id); -else -iwl_wake_queue (priv, txq->swq_id); - } + (agg->state !=IWL_EMPTYING_HW_QUEUE_DELBA )) +iwl_wake_queue (priv, txq->swq_id); } }else {BUG_ON (txq_id != txq->swq_id);
Signature · 1 line
1.7.0.4
PATCH 9/18 iwlwifi: pass txq to wake/stop queue
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
Instead of passing the txq->swq_id, pass the txq struct directly to make sure that in the future nobody will pass an invalid number. Only three places actually change from using the txq_id or the skb's queue_mapping to now using txq->swq_id as well.
--- drivers/net/wireless/iwlwifi/iwl-3945.c | 2 +- drivers/net/wireless/iwlwifi/iwl-4965.c | 4 ++-- drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 4 ++-- drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 4 ++-- drivers/net/wireless/iwlwifi/iwl-helpers.h | 8 ++++++-- drivers/net/wireless/iwlwifi/iwl3945-base.c | 2 +- 6 files changed, 14 insertions(+), 10 deletions(-)
drivers/net/wireless/iwlwifi/iwl-3945.c +1 -1
@@ -297,7 +297,7 @@ static void iwl3945_tx_queue_reclaim(struct iwl_priv *priv,if (iwl_queue_space (q) > q->low_mark && (txq_id >=0 ) && (txq_id !=IWL39_CMD_QUEUE_NUM ) && priv->mac80211_registered) -iwl_wake_queue (priv, txq_id); +iwl_wake_queue (priv, txq); }/**
drivers/net/wireless/iwlwifi/iwl-4965.c +2 -2
@@ -2239,7 +2239,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,if (priv->mac80211_registered && (iwl_queue_space (&txq->q) > txq->q.low_mark) && (agg->state !=IWL_EMPTYING_HW_QUEUE_DELBA )) -iwl_wake_queue (priv, txq->swq_id); +iwl_wake_queue (priv, txq); } }else { info->status.rates[0 ].count = tx_resp->failure_frame +1 ;
@@ -2263,7 +2263,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,if (priv->mac80211_registered && (iwl_queue_space (&txq->q) > txq->q.low_mark)) -iwl_wake_queue (priv, txq_id); +iwl_wake_queue (priv, txq); }if (qc &&likely (sta_id !=IWL_INVALID_STATION ))iwlagn_txq_check_empty (priv, sta_id, tid, txq_id);
drivers/net/wireless/iwlwifi/iwl-agn-lib.c +2 -2
@@ -446,7 +446,7 @@ static void iwlagn_rx_reply_tx(struct iwl_priv *priv,if (priv->mac80211_registered && (iwl_queue_space (&txq->q) > txq->q.low_mark) && (agg->state !=IWL_EMPTYING_HW_QUEUE_DELBA )) -iwl_wake_queue (priv, txq->swq_id); +iwl_wake_queue (priv, txq); } }else {BUG_ON (txq_id != txq->swq_id);
@@ -456,7 +456,7 @@ static void iwlagn_rx_reply_tx(struct iwl_priv *priv,if (priv->mac80211_registered && (iwl_queue_space (&txq->q) > txq->q.low_mark)) -iwl_wake_queue (priv, txq_id); +iwl_wake_queue (priv, txq); }iwlagn_txq_check_empty (priv, sta_id, tid, txq_id);
drivers/net/wireless/iwlwifi/iwl-agn-tx.c +2 -2
@@ -783,7 +783,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)iwl_txq_update_write_ptr (priv, txq);spin_unlock_irqrestore (&priv->lock, flags); }else { -iwl_stop_queue (priv, txq->swq_id); +iwl_stop_queue (priv, txq); } }
@@ -1408,7 +1408,7 @@ void iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv,if ((iwl_queue_space (&txq->q) > txq->q.low_mark) && priv->mac80211_registered && (agg->state !=IWL_EMPTYING_HW_QUEUE_DELBA )) -iwl_wake_queue (priv, txq->swq_id); +iwl_wake_queue (priv, txq);iwlagn_txq_check_empty (priv, sta_id, tid, scd_flow); }
drivers/net/wireless/iwlwifi/iwl-helpers.h +6 -2
@@ -116,8 +116,10 @@ static inline u8 iwl_virtual_agg_queue_num(u8 ac, u8 hwq)return 0x80 | (hwq <<2 ) | ac; } -static inline void iwl_wake_queue (struct iwl_priv *priv,u8 queue) +static inline void iwl_wake_queue (struct iwl_priv *priv, +struct iwl_tx_queue *txq) { +u8 queue = txq->swq_id;u8 ac = queue;u8 hwq = queue;
@@ -131,8 +133,10 @@ static inline void iwl_wake_queue(struct iwl_priv *priv, u8 queue)ieee80211_wake_queue (priv->hw, ac); } -static inline void iwl_stop_queue (struct iwl_priv *priv,u8 queue) +static inline void iwl_stop_queue (struct iwl_priv *priv, +struct iwl_tx_queue *txq) { +u8 queue = txq->swq_id;u8 ac = queue;u8 hwq = queue;
drivers/net/wireless/iwlwifi/iwl3945-base.c +1 -1
@@ -662,7 +662,7 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)spin_unlock_irqrestore (&priv->lock, flags); } -iwl_stop_queue (priv,skb_get_queue_mapping (skb)); +iwl_stop_queue (priv, txq); }return 0 ;
Signature · 1 line
1.7.0.4
PATCH 10/18 iwlwifi: always build swq_id as virtual queue ID
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
Previously, we used the swq_id's mechanism
to have AC and HW queue different only for aggregation queues. To be able to fix a bug with iPAN simply always build the swq_id as ac | (hwq << 2) and remove the flag bit.
--- drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 1 - drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 2 +- drivers/net/wireless/iwlwifi/iwl-debugfs.c | 7 ++----- drivers/net/wireless/iwlwifi/iwl-helpers.h | 28 +++++++++------------------- drivers/net/wireless/iwlwifi/iwl-tx.c | 11 +++++------ 5 files changed, 17 insertions(+), 32 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-lib.c +0 -1
@@ -449,7 +449,6 @@ static void iwlagn_rx_reply_tx(struct iwl_priv *priv,iwl_wake_queue (priv, txq); } }else { -BUG_ON (txq_id != txq->swq_id);iwlagn_set_tx_status (priv, info, tx_resp, txq_id, false); freed =iwlagn_tx_queue_reclaim (priv, txq_id, index);iwl_free_tfds_in_queue (priv, sta_id, tid, freed);
drivers/net/wireless/iwlwifi/iwl-agn-tx.c +1 -1
@@ -1012,7 +1012,7 @@ int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif, tid_data = &priv->stations[sta_id].tid[tid]; *ssn =SEQ_TO_SN (tid_data->seq_number); tid_data->agg.txq_id = txq_id; - priv->txq[txq_id].swq_id =iwl_virtual_agg_queue_num (get_ac_from_tid (tid), txq_id); +iwl_set_swq_id (&priv->txq[txq_id],get_ac_from_tid (tid), txq_id);spin_unlock_irqrestore (&priv->sta_lock, flags); ret = priv->cfg->ops->lib->txq_agg_enable(priv, txq_id, tx_fifo,
drivers/net/wireless/iwlwifi/iwl-debugfs.c +2 -5
@@ -992,11 +992,8 @@ static ssize_t iwl_dbgfs_tx_queue_read(struct file *file," swq_id=%#.2x (ac %d/hwq %d)\n" , cnt, q->read_ptr, q->write_ptr, !!test_bit (cnt, priv->queue_stopped), - txq->swq_id, - txq->swq_id &0x80 ? txq->swq_id &3 : - txq->swq_id, - txq->swq_id &0x80 ? (txq->swq_id >>2 ) & - 0x1f : txq->swq_id); + txq->swq_id, txq->swq_id &3 , + (txq->swq_id >> 2) & 0x1f);if (cnt >=4 )continue ;/* for the ACs, display the stop count too */
drivers/net/wireless/iwlwifi/iwl-helpers.h +9 -19
@@ -104,29 +104,24 @@ static inline int iwl_alloc_fw_desc(struct pci_dev *pci_dev,* | | | | | | | | * | | | | | | +-+-------- AC queue (0-3) * | | | | | | -* | +-+-+-+-+------------ HW A-MPDU queue +* | +-+-+-+-+------------ HW queue ID * | -* +---------------------- indicates agg queue +* +---------------------- unused */ -static inline u8 iwl_virtual_agg_queue_num (u8 ac,u8 hwq) +static inline void iwl_set_swq_id (struct iwl_tx_queue *txq,u8 ac,u8 hwq) {BUG_ON (ac >3 );/* only have 2 bits */ -BUG_ON (hwq >31 );/* only have 5 bits */ +BUG_ON (hwq >31 );/* only use 5 bits */ -return 0x80 | (hwq <<2 ) | ac; + txq->swq_id = (hwq <<2 ) | ac; }static inline void iwl_wake_queue (struct iwl_priv *priv,struct iwl_tx_queue *txq) {u8 queue = txq->swq_id; -u8 ac = queue; -u8 hwq = queue; - -if (queue &0x80 ) { - ac = queue &3 ; - hwq = (queue >>2 ) &0x1f ; - } +u8 ac = queue &3 ; +u8 hwq = (queue >>2 ) &0x1f ;if (test_and_clear_bit (hwq, priv->queue_stopped))if (atomic_dec_return (&priv->queue_stop_count[ac]) <=0 )
@@ -137,13 +132,8 @@ static inline void iwl_stop_queue(struct iwl_priv *priv, struct iwl_tx_queue *txq) {u8 queue = txq->swq_id; -u8 ac = queue; -u8 hwq = queue; - -if (queue &0x80 ) { - ac = queue &3 ; - hwq = (queue >>2 ) &0x1f ; - } +u8 ac = queue &3 ; +u8 hwq = (queue >>2 ) &0x1f ;if (!test_and_set_bit (hwq, priv->queue_stopped))if (atomic_inc_return (&priv->queue_stop_count[ac]) >0 )
drivers/net/wireless/iwlwifi/iwl-tx.c +5 -6
@@ -359,13 +359,12 @@ int iwl_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq, txq->need_update =0 ;/* -* Aggregation TX queues will get their ID when aggregation begins; -* they overwrite the setting done here. The command FIFO doesn't -* need an swq_id so don't set one to catch errors, all others can -* be set up to the identity mapping. +* For the default queues 0-3, set up the swq_id +* already -- all others need to get one later +* (if they need one at all). */ -if (txq_id != priv->cmd_queue) - txq->swq_id = txq_id; +if (txq_id <4 ) +iwl_set_swq_id (txq, txq_id, txq_id);/* TFD_QUEUE_SIZE_MAX must be power-of-two size, otherwise * iwl_queue_inc_wrap and iwl_queue_dec_wrap are broken. */
Signature · 1 line
1.7.0.4
PATCH 11/18 iwlagn: fix PAN queues
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
Currently, when a PAN queue needs to be stopped, we erroneously stop queue number 5 (for example) with mac80211 -- which doesn't even exist!
To avoid that problem, recalculate the swq_id for all queues when setting up the queues, and don't use the default identity mapping that is acceptable for devices which don't support PAN.
--- drivers/net/wireless/iwlwifi/iwl-agn-ucode.c | 57 +++++++++++++++----------- 1 files changed, 33 insertions(+), 24 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-ucode.c +33 -24
@@ -40,30 +40,36 @@#include "iwl-agn.h" #include "iwl-agn-calib.h" -static const s8 iwlagn_default_queue_to_tx_fifo[] = { -IWL_TX_FIFO_VO , -IWL_TX_FIFO_VI , -IWL_TX_FIFO_BE , -IWL_TX_FIFO_BK , -IWLAGN_CMD_FIFO_NUM , -IWL_TX_FIFO_UNUSED , -IWL_TX_FIFO_UNUSED , -IWL_TX_FIFO_UNUSED , -IWL_TX_FIFO_UNUSED , -IWL_TX_FIFO_UNUSED , +#define IWL_AC_UNSET -1 + +struct queue_to_fifo_ac { +s8 fifo, ac; +}; + +static const struct queue_to_fifo_ac iwlagn_default_queue_to_tx_fifo[] = { + {IWL_TX_FIFO_VO ,0 , }, + {IWL_TX_FIFO_VI ,1 , }, + {IWL_TX_FIFO_BE ,2 , }, + {IWL_TX_FIFO_BK ,3 , }, + {IWLAGN_CMD_FIFO_NUM ,IWL_AC_UNSET , }, + {IWL_TX_FIFO_UNUSED ,IWL_AC_UNSET , }, + {IWL_TX_FIFO_UNUSED ,IWL_AC_UNSET , }, + {IWL_TX_FIFO_UNUSED ,IWL_AC_UNSET , }, + {IWL_TX_FIFO_UNUSED ,IWL_AC_UNSET , }, + {IWL_TX_FIFO_UNUSED ,IWL_AC_UNSET , }, }; -static const s8 iwlagn_ipan_queue_to_tx_fifo[] = { -IWL_TX_FIFO_VO , -IWL_TX_FIFO_VI , -IWL_TX_FIFO_BE , -IWL_TX_FIFO_BK , -IWL_TX_FIFO_BK_IPAN , -IWL_TX_FIFO_BE_IPAN , -IWL_TX_FIFO_VI_IPAN , -IWL_TX_FIFO_VO_IPAN , -IWL_TX_FIFO_BE_IPAN , -IWLAGN_CMD_FIFO_NUM , +static const struct queue_to_fifo_ac iwlagn_ipan_queue_to_tx_fifo[] = { + {IWL_TX_FIFO_VO ,0 , }, + {IWL_TX_FIFO_VI ,1 , }, + {IWL_TX_FIFO_BE ,2 , }, + {IWL_TX_FIFO_BK ,3 , }, + {IWL_TX_FIFO_BK_IPAN ,3 , }, + {IWL_TX_FIFO_BE_IPAN ,2 , }, + {IWL_TX_FIFO_VI_IPAN ,1 , }, + {IWL_TX_FIFO_VO_IPAN ,0 , }, + {IWL_TX_FIFO_BE_IPAN ,2 , }, + {IWLAGN_CMD_FIFO_NUM ,IWL_AC_UNSET , }, };static struct iwl_wimax_coex_event_entry cu_priorities[COEX_NUM_OF_EVENTS ] = {
@@ -429,7 +435,7 @@ void iwlagn_send_bt_env(struct iwl_priv *priv, u8 action, u8 type)int iwlagn_alive_notify (struct iwl_priv *priv) { -const s8 *queue_to_fifo; +const struct queue_to_fifo_ac *queue_to_fifo;u32 a;unsigned long flags;int i, chan;
@@ -510,13 +516,16 @@ int iwlagn_alive_notify(struct iwl_priv *priv)BUILD_BUG_ON (ARRAY_SIZE (iwlagn_ipan_queue_to_tx_fifo) !=10 );for (i =0 ; i <10 ; i++) { -int fifo = queue_to_fifo[i]; +int fifo = queue_to_fifo[i].fifo; +int ac = queue_to_fifo[i].ac;iwl_txq_ctx_activate (priv, i);if (fifo ==IWL_TX_FIFO_UNUSED )continue ; +if (ac !=IWL_AC_UNSET ) +iwl_set_swq_id (&priv->txq[i], ac, i);iwlagn_tx_queue_set_status (priv, &priv->txq[i], fifo,0 ); }
Signature · 1 line
1.7.0.4
PATCH 12/18 iwlagn: avoid crash if vif is not assigned
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
For reasons that aren't entirely clear to me, we sometimes get here during hardware reset without the interface being set. Don't crash, but keep a warning.
--- drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c +5 -0
@@ -507,6 +507,11 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,mutex_lock (&priv->mutex); +if (WARN_ON (!ctx->vif)) { +mutex_unlock (&priv->mutex); +return ; + } +if (changes &BSS_CHANGED_BEACON_INT ) force = true;
Signature · 1 line
1.7.0.4
PATCH 13/18 iwlagn: reprogram AP STA after assoc
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
Instead of unconditionally sending unassoc RXON, before any assoc RXON, re-send only the AP STA entry which is required after the BSSID has been programmed into the device to set up internal filters in the microcode properly.
This fixes some issues that we correlated with sending a lot of RXON commands to the device.
--- drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | 39 +++++++++++--------- drivers/net/wireless/iwlwifi/iwl-sta.c | 51 ++++++++++++++++++++++++--- drivers/net/wireless/iwlwifi/iwl-sta.h | 1 + 3 files changed, 69 insertions(+), 22 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c +22 -17
@@ -97,6 +97,7 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)/* cast away the const for active_rxon in this function */ struct iwl_rxon_cmd *active = (void *)&ctx->active;bool new_assoc = !!(ctx->staging.filter_flags &RXON_FILTER_ASSOC_MSK ); +bool old_assoc = !!(ctx->active.filter_flags &RXON_FILTER_ASSOC_MSK );int ret;lockdep_assert_held (&priv->mutex);
@@ -176,25 +177,27 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)* AP station must be done after the BSSID is set to correctly * set up filters in the device. */ -if (ctx->ctxid ==IWL_RXON_CTX_BSS ) - ret =iwlagn_disable_bss (priv, ctx, &ctx->staging); -else - ret =iwlagn_disable_pan (priv, ctx, &ctx->staging); -if (ret) -return ret; +if ((old_assoc && new_assoc) || !new_assoc) { +if (ctx->ctxid ==IWL_RXON_CTX_BSS ) + ret =iwlagn_disable_bss (priv, ctx, &ctx->staging); +else + ret =iwlagn_disable_pan (priv, ctx, &ctx->staging); +if (ret) +return ret; -memcpy (active, &ctx->staging,sizeof (*active)); +memcpy (active, &ctx->staging,sizeof (*active)); -/* -* Un-assoc RXON clears the station table and WEP -* keys, so we have to restore those afterwards. -*/ -iwl_clear_ucode_stations (priv, ctx); -iwl_restore_stations (priv, ctx); - ret =iwl_restore_default_wep_keys (priv, ctx); -if (ret) { -IWL_ERR (priv,"Failed to restore WEP keys (%d)\n" , ret); -return ret; +/* +* Un-assoc RXON clears the station table and WEP +* keys, so we have to restore those afterwards. +*/ +iwl_clear_ucode_stations (priv, ctx); +iwl_restore_stations (priv, ctx); + ret =iwl_restore_default_wep_keys (priv, ctx); +if (ret) { +IWL_ERR (priv,"Failed to restore WEP keys (%d)\n" , ret); +return ret; + } }/* RXON timing must be before associated RXON */
@@ -235,6 +238,8 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx) }memcpy (active, &ctx->staging,sizeof (*active)); +iwl_reprogram_ap_sta (priv, ctx); +/* IBSS beacon needs to be sent after setting assoc */ if (ctx->vif && (ctx->vif->type ==NL80211_IFTYPE_ADHOC ))if (iwlagn_update_beacon (priv, ctx->vif))
drivers/net/wireless/iwlwifi/iwl-sta.c +46 -5
75 lines not on this page · raw message
drivers/net/wireless/iwlwifi/iwl-sta.h +1 -0
@@ -63,6 +63,7 @@ u8 iwl_prep_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx,int iwl_send_lq_cmd (struct iwl_priv *priv,struct iwl_rxon_context *ctx,struct iwl_link_quality_cmd *lq,u8 flags,bool init); +void iwl_reprogram_ap_sta (struct iwl_priv *priv,struct iwl_rxon_context *ctx);/** * iwl_clear_driver_stations - clear knowledge of all stations from driver
Signature · 1 line
1.7.0.4
PATCH 14/18 iwlagn: fix PAN slot timing wrt. DTIM
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
When the DTIM is not 1, then the slot timing is in some cases required to be calclulated based on the DTIM interval instead of the beacon interval, fix that.
--- drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c +3 -2
@@ -307,6 +307,7 @@ static int iwlagn_set_pan_params(struct iwl_priv *priv)if (ctx_bss->vif && ctx_pan->vif) {int bcnint = ctx_pan->vif->bss_conf.beacon_int; +int dtim = ctx_pan->vif->bss_conf.dtim_period ?:1 ;/* should be set, but seems unused?? */ cmd.flags |=cpu_to_le16 (IWL_WIPAN_PARAMS_FLG_SLOTTED_MODE );
@@ -329,10 +330,10 @@ static int iwlagn_set_pan_params(struct iwl_priv *priv)if (test_bit (STATUS_SCAN_HW , &priv->status) || (!ctx_bss->vif->bss_conf.idle && !ctx_bss->vif->bss_conf.assoc)) { - slot0 = bcnint *3 -20 ; + slot0 = dtim * bcnint *3 -20 ; slot1 =20 ; }else if (!ctx_pan->vif->bss_conf.idle && - !ctx_pan->vif->bss_conf.assoc) { + !ctx_pan->vif->bss_conf.assoc) { slot1 = bcnint *3 -20 ; slot0 =20 ; }
Signature · 1 line
1.7.0.4
PATCH 15/18 iwlagn: update QoS before commit associated RXON
In reply to Wey-Yi GuyFrom: Shanyu Zhao <[email protected]>
RXON command without association bit can clear the QoS info in the uCode. Therefore, before sending the associated RXON, we need to send the QoS command just in case.
--- drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | 59 ++++++++++++++------------- 1 files changed, 31 insertions(+), 28 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c +31 -28
@@ -72,6 +72,34 @@ static int iwlagn_disable_pan(struct iwl_priv *priv,return ret; } +static void iwlagn_update_qos (struct iwl_priv *priv, +struct iwl_rxon_context *ctx) +{ +int ret; + +if (!ctx->is_active) +return ; + + ctx->qos_data.def_qos_parm.qos_flags =0 ; + +if (ctx->qos_data.qos_active) + ctx->qos_data.def_qos_parm.qos_flags |= +QOS_PARAM_FLG_UPDATE_EDCA_MSK ; + +if (ctx->ht.enabled) + ctx->qos_data.def_qos_parm.qos_flags |=QOS_PARAM_FLG_TGN_MSK ; + +IWL_DEBUG_QOS (priv,"send QoS cmd with Qos active=%d FLAGS=0x%X\n" , + ctx->qos_data.qos_active, + ctx->qos_data.def_qos_parm.qos_flags); + + ret =iwl_send_cmd_pdu (priv, ctx->qos_cmd, +sizeof (struct iwl_qosparam_cmd ), + &ctx->qos_data.def_qos_parm); +if (ret) +IWL_ERR (priv,"Failed to update QoS\n" ); +} +static int iwlagn_update_beacon (struct iwl_priv *priv,struct ieee80211_vif *vif) {
@@ -208,6 +236,9 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx) }if (new_assoc) { +/* QoS info may be cleared by previous un-assoc RXON */ +iwlagn_update_qos (priv, ctx); +/* * We'll run into this code path when beaconing is * enabled, but then we also need to send the beacon
@@ -266,34 +297,6 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)return 0 ; } -static void iwlagn_update_qos (struct iwl_priv *priv, -struct iwl_rxon_context *ctx) -{ -int ret; - -if (!ctx->is_active) -return ; - - ctx->qos_data.def_qos_parm.qos_flags =0 ; - -if (ctx->qos_data.qos_active) - ctx->qos_data.def_qos_parm.qos_flags |= -QOS_PARAM_FLG_UPDATE_EDCA_MSK ; - -if (ctx->ht.enabled) - ctx->qos_data.def_qos_parm.qos_flags |=QOS_PARAM_FLG_TGN_MSK ; - -IWL_DEBUG_QOS (priv,"send QoS cmd with Qos active=%d FLAGS=0x%X\n" , - ctx->qos_data.qos_active, - ctx->qos_data.def_qos_parm.qos_flags); - - ret =iwl_send_cmd_pdu (priv, ctx->qos_cmd, -sizeof (struct iwl_qosparam_cmd ), - &ctx->qos_data.def_qos_parm); -if (ret) -IWL_ERR (priv,"Failed to update QoS\n" ); -} -int iwlagn_mac_config (struct ieee80211_hw *hw,u32 changed) {struct iwl_priv *priv = hw->priv;
Signature · 1 line
1.7.0.4
PATCH 16/18 iwlagn: use SKU information in the EEPROM
In reply to Wey-Yi GuyEEPROM contain the SKU information for the device, use it.
--- drivers/net/wireless/iwlwifi/iwl-1000.c | 4 ---- drivers/net/wireless/iwlwifi/iwl-4965.c | 1 - drivers/net/wireless/iwlwifi/iwl-5000.c | 7 ------- drivers/net/wireless/iwlwifi/iwl-6000.c | 18 ------------------ drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c | 21 +++++++++++++++++++++ drivers/net/wireless/iwlwifi/iwl-agn.c | 4 ++++ drivers/net/wireless/iwlwifi/iwl-eeprom.h | 12 +++++++++++- 7 files changed, 36 insertions(+), 31 deletions(-)
drivers/net/wireless/iwlwifi/iwl-1000.c +0 -4
@@ -278,7 +278,6 @@ struct iwl_cfg iwl1000_bgn_cfg = { .fw_name_pre = IWL1000_FW_PRE, .ucode_api_max = IWL1000_UCODE_API_MAX, .ucode_api_min = IWL1000_UCODE_API_MIN, - .sku = IWL_SKU_G|IWL_SKU_N, .valid_tx_ant = ANT_A, .valid_rx_ant = ANT_AB, .eeprom_ver = EEPROM_1000_EEPROM_VERSION,
@@ -295,7 +294,6 @@ struct iwl_cfg iwl1000_bg_cfg = { .fw_name_pre = IWL1000_FW_PRE, .ucode_api_max = IWL1000_UCODE_API_MAX, .ucode_api_min = IWL1000_UCODE_API_MIN, - .sku = IWL_SKU_G, .valid_tx_ant = ANT_A, .valid_rx_ant = ANT_AB, .eeprom_ver = EEPROM_1000_EEPROM_VERSION,
@@ -311,7 +309,6 @@ struct iwl_cfg iwl100_bgn_cfg = { .fw_name_pre = IWL100_FW_PRE, .ucode_api_max = IWL100_UCODE_API_MAX, .ucode_api_min = IWL100_UCODE_API_MIN, - .sku = IWL_SKU_G|IWL_SKU_N, .valid_tx_ant = ANT_A, .valid_rx_ant = ANT_A, .eeprom_ver = EEPROM_1000_EEPROM_VERSION,
@@ -328,7 +325,6 @@ struct iwl_cfg iwl100_bg_cfg = { .fw_name_pre = IWL100_FW_PRE, .ucode_api_max = IWL100_UCODE_API_MAX, .ucode_api_min = IWL100_UCODE_API_MIN, - .sku = IWL_SKU_G, .valid_tx_ant = ANT_A, .valid_rx_ant = ANT_A, .eeprom_ver = EEPROM_1000_EEPROM_VERSION,
drivers/net/wireless/iwlwifi/iwl-4965.c +0 -1
@@ -2624,7 +2624,6 @@ struct iwl_cfg iwl4965_agn_cfg = { .fw_name_pre = IWL4965_FW_PRE, .ucode_api_max = IWL4965_UCODE_API_MAX, .ucode_api_min = IWL4965_UCODE_API_MIN, - .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, .valid_tx_ant = ANT_AB, .valid_rx_ant = ANT_ABC, .eeprom_ver = EEPROM_4965_EEPROM_VERSION,
drivers/net/wireless/iwlwifi/iwl-5000.c +0 -7
@@ -527,7 +527,6 @@ struct iwl_cfg iwl5300_agn_cfg = { .fw_name_pre = IWL5000_FW_PRE, .ucode_api_max = IWL5000_UCODE_API_MAX, .ucode_api_min = IWL5000_UCODE_API_MIN, - .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, .valid_tx_ant = ANT_ABC, .valid_rx_ant = ANT_ABC, .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
@@ -544,7 +543,6 @@ struct iwl_cfg iwl5100_bgn_cfg = { .fw_name_pre = IWL5000_FW_PRE, .ucode_api_max = IWL5000_UCODE_API_MAX, .ucode_api_min = IWL5000_UCODE_API_MIN, - .sku = IWL_SKU_G|IWL_SKU_N, .valid_tx_ant = ANT_B, .valid_rx_ant = ANT_AB, .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
@@ -561,7 +559,6 @@ struct iwl_cfg iwl5100_abg_cfg = { .fw_name_pre = IWL5000_FW_PRE, .ucode_api_max = IWL5000_UCODE_API_MAX, .ucode_api_min = IWL5000_UCODE_API_MIN, - .sku = IWL_SKU_A|IWL_SKU_G, .valid_tx_ant = ANT_B, .valid_rx_ant = ANT_AB, .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
@@ -577,7 +574,6 @@ struct iwl_cfg iwl5100_agn_cfg = { .fw_name_pre = IWL5000_FW_PRE, .ucode_api_max = IWL5000_UCODE_API_MAX, .ucode_api_min = IWL5000_UCODE_API_MIN, - .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, .valid_tx_ant = ANT_B, .valid_rx_ant = ANT_AB, .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
@@ -594,7 +590,6 @@ struct iwl_cfg iwl5350_agn_cfg = { .fw_name_pre = IWL5000_FW_PRE, .ucode_api_max = IWL5000_UCODE_API_MAX, .ucode_api_min = IWL5000_UCODE_API_MIN, - .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, .valid_tx_ant = ANT_ABC, .valid_rx_ant = ANT_ABC, .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
@@ -611,7 +606,6 @@ struct iwl_cfg iwl5150_agn_cfg = { .fw_name_pre = IWL5150_FW_PRE, .ucode_api_max = IWL5150_UCODE_API_MAX, .ucode_api_min = IWL5150_UCODE_API_MIN, - .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, .valid_tx_ant = ANT_A, .valid_rx_ant = ANT_AB, .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
@@ -629,7 +623,6 @@ struct iwl_cfg iwl5150_abg_cfg = { .fw_name_pre = IWL5150_FW_PRE, .ucode_api_max = IWL5150_UCODE_API_MAX, .ucode_api_min = IWL5150_UCODE_API_MIN, - .sku = IWL_SKU_A|IWL_SKU_G, .valid_tx_ant = ANT_A, .valid_rx_ant = ANT_AB, .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
drivers/net/wireless/iwlwifi/iwl-6000.c +0 -18
@@ -556,7 +556,6 @@ struct iwl_cfg iwl6000g2a_2agn_cfg = { .fw_name_pre = IWL6000G2A_FW_PRE, .ucode_api_max = IWL6000G2_UCODE_API_MAX, .ucode_api_min = IWL6000G2_UCODE_API_MIN, - .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, .valid_tx_ant = ANT_AB, .valid_rx_ant = ANT_AB, .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
@@ -575,7 +574,6 @@ struct iwl_cfg iwl6000g2a_2abg_cfg = { .fw_name_pre = IWL6000G2A_FW_PRE, .ucode_api_max = IWL6000G2_UCODE_API_MAX, .ucode_api_min = IWL6000G2_UCODE_API_MIN, - .sku = IWL_SKU_A|IWL_SKU_G, .valid_tx_ant = ANT_AB, .valid_rx_ant = ANT_AB, .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
@@ -593,7 +591,6 @@ struct iwl_cfg iwl6000g2a_2bg_cfg = { .fw_name_pre = IWL6000G2A_FW_PRE, .ucode_api_max = IWL6000G2_UCODE_API_MAX, .ucode_api_min = IWL6000G2_UCODE_API_MIN, - .sku = IWL_SKU_G, .valid_tx_ant = ANT_AB, .valid_rx_ant = ANT_AB, .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
@@ -611,7 +608,6 @@ struct iwl_cfg iwl6000g2b_2agn_cfg = { .fw_name_pre = IWL6000G2B_FW_PRE, .ucode_api_max = IWL6000G2_UCODE_API_MAX, .ucode_api_min = IWL6000G2_UCODE_API_MIN, - .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, .valid_tx_ant = ANT_AB, .valid_rx_ant = ANT_AB, .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
@@ -633,7 +629,6 @@ struct iwl_cfg iwl6000g2b_2abg_cfg = { .fw_name_pre = IWL6000G2B_FW_PRE, .ucode_api_max = IWL6000G2_UCODE_API_MAX, .ucode_api_min = IWL6000G2_UCODE_API_MIN, - .sku = IWL_SKU_A|IWL_SKU_G, .valid_tx_ant = ANT_AB, .valid_rx_ant = ANT_AB, .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
@@ -654,7 +649,6 @@ struct iwl_cfg iwl6000g2b_2bgn_cfg = { .fw_name_pre = IWL6000G2B_FW_PRE, .ucode_api_max = IWL6000G2_UCODE_API_MAX, .ucode_api_min = IWL6000G2_UCODE_API_MIN, - .sku = IWL_SKU_G|IWL_SKU_N, .valid_tx_ant = ANT_AB, .valid_rx_ant = ANT_AB, .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
@@ -676,7 +670,6 @@ struct iwl_cfg iwl6000g2b_2bg_cfg = { .fw_name_pre = IWL6000G2B_FW_PRE, .ucode_api_max = IWL6000G2_UCODE_API_MAX, .ucode_api_min = IWL6000G2_UCODE_API_MIN, - .sku = IWL_SKU_G, .valid_tx_ant = ANT_AB, .valid_rx_ant = ANT_AB, .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
@@ -697,7 +690,6 @@ struct iwl_cfg iwl6000g2b_bgn_cfg = { .fw_name_pre = IWL6000G2B_FW_PRE, .ucode_api_max = IWL6000G2_UCODE_API_MAX, .ucode_api_min = IWL6000G2_UCODE_API_MIN, - .sku = IWL_SKU_G|IWL_SKU_N, .valid_tx_ant = ANT_A, .valid_rx_ant = ANT_AB, .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
@@ -719,7 +711,6 @@ struct iwl_cfg iwl6000g2b_bg_cfg = { .fw_name_pre = IWL6000G2B_FW_PRE, .ucode_api_max = IWL6000G2_UCODE_API_MAX, .ucode_api_min = IWL6000G2_UCODE_API_MIN, - .sku = IWL_SKU_G, .valid_tx_ant = ANT_A, .valid_rx_ant = ANT_AB, .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
@@ -743,7 +734,6 @@ struct iwl_cfg iwl6000i_2agn_cfg = { .fw_name_pre = IWL6000_FW_PRE, .ucode_api_max = IWL6000_UCODE_API_MAX, .ucode_api_min = IWL6000_UCODE_API_MIN, - .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, .valid_tx_ant = ANT_BC, .valid_rx_ant = ANT_BC, .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
@@ -761,7 +751,6 @@ struct iwl_cfg iwl6000i_2abg_cfg = { .fw_name_pre = IWL6000_FW_PRE, .ucode_api_max = IWL6000_UCODE_API_MAX, .ucode_api_min = IWL6000_UCODE_API_MIN, - .sku = IWL_SKU_A|IWL_SKU_G, .valid_tx_ant = ANT_BC, .valid_rx_ant = ANT_BC, .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
@@ -778,7 +767,6 @@ struct iwl_cfg iwl6000i_2bg_cfg = { .fw_name_pre = IWL6000_FW_PRE, .ucode_api_max = IWL6000_UCODE_API_MAX, .ucode_api_min = IWL6000_UCODE_API_MIN, - .sku = IWL_SKU_G, .valid_tx_ant = ANT_BC, .valid_rx_ant = ANT_BC, .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
@@ -795,7 +783,6 @@ struct iwl_cfg iwl6050_2agn_cfg = { .fw_name_pre = IWL6050_FW_PRE, .ucode_api_max = IWL6050_UCODE_API_MAX, .ucode_api_min = IWL6050_UCODE_API_MIN, - .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, .valid_tx_ant = ANT_AB, .valid_rx_ant = ANT_AB, .ops = &iwl6050_ops,
@@ -813,7 +800,6 @@ struct iwl_cfg iwl6050g2_bgn_cfg = { .fw_name_pre = IWL6050_FW_PRE, .ucode_api_max = IWL6050_UCODE_API_MAX, .ucode_api_min = IWL6050_UCODE_API_MIN, - .sku = IWL_SKU_G|IWL_SKU_N, .valid_tx_ant = ANT_A, .valid_rx_ant = ANT_AB, .eeprom_ver = EEPROM_6050G2_EEPROM_VERSION,
@@ -831,7 +817,6 @@ struct iwl_cfg iwl6050_2abg_cfg = { .fw_name_pre = IWL6050_FW_PRE, .ucode_api_max = IWL6050_UCODE_API_MAX, .ucode_api_min = IWL6050_UCODE_API_MIN, - .sku = IWL_SKU_A|IWL_SKU_G, .valid_tx_ant = ANT_AB, .valid_rx_ant = ANT_AB, .eeprom_ver = EEPROM_6050_EEPROM_VERSION,
@@ -848,7 +833,6 @@ struct iwl_cfg iwl6000_3agn_cfg = { .fw_name_pre = IWL6000_FW_PRE, .ucode_api_max = IWL6000_UCODE_API_MAX, .ucode_api_min = IWL6000_UCODE_API_MIN, - .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, .valid_tx_ant = ANT_ABC, .valid_rx_ant = ANT_ABC, .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
@@ -866,7 +850,6 @@ struct iwl_cfg iwl130_bgn_cfg = { .fw_name_pre = IWL6000G2B_FW_PRE, .ucode_api_max = IWL6000G2_UCODE_API_MAX, .ucode_api_min = IWL6000G2_UCODE_API_MIN, - .sku = IWL_SKU_G|IWL_SKU_N, .valid_tx_ant = ANT_A, .valid_rx_ant = ANT_A, .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
@@ -887,7 +870,6 @@ struct iwl_cfg iwl130_bg_cfg = { .fw_name_pre = IWL6000G2B_FW_PRE, .ucode_api_max = IWL6000G2_UCODE_API_MAX, .ucode_api_min = IWL6000G2_UCODE_API_MIN, - .sku = IWL_SKU_G, .valid_tx_ant = ANT_A, .valid_rx_ant = ANT_A, .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c +21 -0
@@ -248,6 +248,27 @@ err: } +int iwl_eeprom_check_sku (struct iwl_priv *priv) +{ +u16 eeprom_sku; + + eeprom_sku =iwl_eeprom_query16 (priv,EEPROM_SKU_CAP ); + + priv->cfg->sku = ((eeprom_sku &EEPROM_SKU_CAP_BAND_SELECTION ) >> +EEPROM_SKU_CAP_BAND_POS ); +if (eeprom_sku &EEPROM_SKU_CAP_11N_ENABLE ) + priv->cfg->sku |=IWL_SKU_N ; + +if (!priv->cfg->sku) { +IWL_ERR (priv,"Invalid device sku\n" ); +return -EINVAL ; + } + +IWL_INFO (priv,"Device SKU: 0X%x\n" , priv->cfg->sku); + +return 0 ; +} +void iwl_eeprom_get_mac (const struct iwl_priv *priv,u8 *mac) { const u8 *addr = priv->cfg->ops->lib->eeprom_ops.query_addr(priv,
drivers/net/wireless/iwlwifi/iwl-agn.c +4 -0
@@ -4134,6 +4134,10 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)if (err) goto out_free_eeprom; + err =iwl_eeprom_check_sku (priv); +if (err) + goto out_free_eeprom; +/* extract MAC Address */ iwl_eeprom_get_mac (priv, priv->addresses[0 ].addr);IWL_DEBUG_INFO (priv,"MAC address: %pM\n" , priv->addresses[0 ].addr);
drivers/net/wireless/iwlwifi/iwl-eeprom.h +11 -1
@@ -110,9 +110,18 @@ enum { };/* SKU Capabilities */ +/* 3945 only */ #define EEPROM_SKU_CAP_SW_RF_KILL_ENABLE (1 << 0)#define EEPROM_SKU_CAP_HW_RF_KILL_ENABLE (1 << 1) +/* 5000 and up */ +#define EEPROM_SKU_CAP_BAND_POS (4) +#define EEPROM_SKU_CAP_BAND_SELECTION \ + (3 << EEPROM_SKU_CAP_BAND_POS) +#define EEPROM_SKU_CAP_11N_ENABLE (1 << 6) +#define EEPROM_SKU_CAP_AMT_ENABLE (1 << 7) +#define EEPROM_SKU_CAP_IPAN_ENABLE (1 << 8) +/* *regulatory* channel data format in eeprom, one for each channel. * There are separate entries for HT40 (40 MHz) vs. normal (20 MHz) channels. */ struct iwl_eeprom_channel {
@@ -397,7 +406,7 @@ struct iwl_eeprom_calib_info {#define EEPROM_BOARD_REVISION (2*0x35)/* 2 bytes */ #define EEPROM_BOARD_PBA_NUMBER (2*0x3B+1)/* 9 bytes */ #define EEPROM_VERSION (2*0x44)/* 2 bytes */ -#define EEPROM_SKU_CAP (2*0x45)/* 1 bytes */ +#define EEPROM_SKU_CAP (2*0x45)/* 2 bytes */ #define EEPROM_OEM_MODE (2*0x46)/* 2 bytes */ #define EEPROM_WOWLAN_MODE (2*0x47)/* 2 bytes */ #define EEPROM_RADIO_CONFIG (2*0x48)/* 2 bytes */
@@ -504,6 +513,7 @@ struct iwl_eeprom_ops {int iwl_eeprom_init (struct iwl_priv *priv);void iwl_eeprom_free (struct iwl_priv *priv);int iwl_eeprom_check_version (struct iwl_priv *priv); +int iwl_eeprom_check_sku (struct iwl_priv *priv);const u8 *iwl_eeprom_query_addr (const struct iwl_priv *priv,size_t offset);int iwlcore_eeprom_verify_signature (struct iwl_priv *priv);u16 iwl_eeprom_query16 (const struct iwl_priv *priv,size_t offset);
Signature · 1 line
1.7.0.4
PATCH 17/18 iwlagn: check change before commit RXON cmd
In reply to Wey-Yi GuyFrom: Shanyu Zhao <[email protected]>
When setting rxon chain and filter, no need to commit RXON when the chain flag is not changed. This reduces the number of RXON commands we send down to uCode.
--- drivers/net/wireless/iwlwifi/iwl-agn.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn.c +2 -1
@@ -97,7 +97,8 @@ void iwl_update_chain_flags(struct iwl_priv *priv)if (priv->cfg->ops->hcmd->set_rxon_chain) {for_each_context (priv, ctx) { priv->cfg->ops->hcmd->set_rxon_chain (priv, ctx); -iwlcore_commit_rxon (priv, ctx); +if (ctx->active.rx_chain != ctx->staging.rx_chain) +iwlcore_commit_rxon (priv, ctx); } } }
Signature · 1 line
1.7.0.4
PATCH 18/18 iwlwifi: set STATUS_READY before commit_rxon
In reply to Wey-Yi GuyHave the STATUS_READY bit set before commit_rxon call to avoid fail to send tx power to uCode.
--- drivers/net/wireless/iwlwifi/iwl-agn.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn.c +2 -1
@@ -2717,6 +2717,8 @@ static void iwl_alive_start(struct iwl_priv *priv)iwl_reset_run_time_calib (priv); +set_bit (STATUS_READY , &priv->status); +/* Configure the adapter for unassociated operation */ iwlcore_commit_rxon (priv, ctx);
@@ -2726,7 +2728,6 @@ static void iwl_alive_start(struct iwl_priv *priv)iwl_leds_init (priv);IWL_DEBUG_INFO (priv,"ALIVE processing complete.\n" ); -set_bit (STATUS_READY , &priv->status);wake_up_interruptible (&priv->wait_command_queue);iwl_power_update_mode (priv, true);
Signature · 1 line
1.7.0.4
Quoted 4 lines · Wey-Yi Guy
We add more changes to prepare P2P supports
We also add few features/changes to WiFi/BT coex, such as dynamic aggregation.
For newer devices, we change the default LED mode to On/Off
There had been some talk of a firmware update that would solve some user-reported bugs on bugzilla.kernel.org. I don't have the bug numbers handy, but I can probably find them. I imagine you can find them quite easily as well.
Is that firmware update still in the works? When can we expect to see that?
John
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready.
2010/11/16 John W. Linville <[email protected]>:
Quoted 6 lines · Wey-Yi Guy
Quoted 4 lines
We add more changes to prepare P2P supports
We also add few features/changes to WiFi/BT coex, such as dynamic aggregation.
For newer devices, we change the default LED mode to On/Off
Quoted 7 lines
There had been some talk of a firmware update that would solve some user-reported bugs on bugzilla.kernel.org. I don't have the bug numbers handy, but I can probably find them. I imagine you can find them quite easily as well.
Is that firmware update still in the works? When can we expect to see that?
http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2214#c19
The last time I got answer to my criticism I felt mean for my hard bad words. But there's another half of month without fix/update.
The fix is expected to come with firmware update, not driver update.
Signature · 1 line
Rafał
Quoted 6 lines · John W. Linville
Quoted 4 lines · Wey-Yi Guy
We add more changes to prepare P2P supports
We also add few features/changes to WiFi/BT coex, such as dynamic aggregation.
For newer devices, we change the default LED mode to On/Off
Quoted 8 lines
There had been some talk of a firmware update that would solve some user-reported bugs on bugzilla.kernel.org. I don't have the bug numbers handy, but I can probably find them. I imagine you can find them quite easily as well.
Is that firmware update still in the works? When can we expect to see that?
I finially got "Thumb up" for experimental uCode release for 1000, I understand it is not what needed the most (5000 uCode). I am really sorry for the delay, still try to work it out and take very long time.
I will publish the 1000 experimental uCode in the next 1 or 2 days
Thanks
Wey