iwlwifi update for 2.6.37
cover iwlwifi update for 2.6.37
We enable the capabilities to use experimental uCode for debugging. We also do some code cleanup and refactor works in iwlwifi driver There is a possibility of race condition while performing roaming, not sure it is the case, but to avoid the possibility is a much better approach.
Jay Sternberg (2):
iwlwifi: enable experimental ucode support
iwlwifi: move debug options into submenu
Johannes Berg (1):
iwlwifi: refactor iwl_setup_rxon_timing
Shanyu Zhao (3):
iwlwifi: do not call ieee80211_frequency_to_channel
iwlwifi: avoid race condition in channel change
iwlwifi: cleanup iwl_set_rxon_channel()
Wey-Yi Guy (10):
iwlwifi: remove unused define
iwlwifi: additional comments in iwl_cfg
iwlwifi: max/min aggregation time limit
iwlwifi: make aggregation time limit configurable
iwlagn: adjust starting action for rate scale
iwlagn: continue perform rate scale when error detected
iwlwifi: additional parameter in REPLY_RX_PHY_CMD
iwlwifi: more generic name for rssi calc in iwlagn
iwlwifi: configurable ampdu factor and density
iwlwifi: remove unused iwl_send_card_state function
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/Kconfig | 10 ++++ drivers/net/wireless/iwlwifi/iwl-4965.c | 2 +- drivers/net/wireless/iwlwifi/iwl-5000.c | 2 +- drivers/net/wireless/iwlwifi/iwl-6000.c | 2 +- drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c | 21 +++++--- drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 2 +- drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 42 +++++++++++++--- drivers/net/wireless/iwlwifi/iwl-agn.c | 56 ++++++++++++--------- drivers/net/wireless/iwlwifi/iwl-commands.h | 45 +++++++++-------- drivers/net/wireless/iwlwifi/iwl-core.c | 71 +++++++++------------------ drivers/net/wireless/iwlwifi/iwl-core.h | 12 +++- drivers/net/wireless/iwlwifi/iwl-debugfs.c | 6 +-- drivers/net/wireless/iwlwifi/iwl-dev.h | 14 +++++- drivers/net/wireless/iwlwifi/iwl3945-base.c | 11 +--- 14 files changed, 168 insertions(+), 128 deletions(-)
PATCH 1/16 iwlwifi: remove unused define
IWL_SIXTY_SECS is not been used, remove it
--- drivers/net/wireless/iwlwifi/iwl-dev.h | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/net/wireless/iwlwifi/iwl-dev.h +0 -1
@@ -1053,7 +1053,6 @@ struct iwl_event_log {#define IWL_DEF_MONITORING_PERIOD (1000)#define IWL_LONG_MONITORING_PERIOD (5000)#define IWL_ONE_HUNDRED_MSECS (100) -#define IWL_SIXTY_SECS (60000)enum iwl_reset {IWL_RF_RESET =0 ,
Signature · 1 line
1.7.0.4
PATCH 2/16 iwlwifi: additional comments in iwl_cfg
In reply to Wey-Yi GuyNo functional changes, just add additional comments to iwl_cfg structure
--- drivers/net/wireless/iwlwifi/iwl-core.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/wireless/iwlwifi/iwl-core.h +2 -0
@@ -278,6 +278,8 @@ struct iwl_mod_params {* @chain_noise_calib_by_driver: driver has the capability to perform * chain noise calibration operation * @scan_antennas: available antenna for scan operation +* @need_dc_calib: need to perform init dc calibration +* @bt_statistics: use BT version of statistics notification * * We enable the driver to be backward compatible wrt API version. The * driver specifies which APIs it supports (with @ucode_api_max being the
Signature · 1 line
1.7.0.4
PATCH 3/16 iwlwifi: max/min aggregation time limit
In reply to Wey-Yi GuySet the minimum and maximum for aggregation time limit in uSec.
--- drivers/net/wireless/iwlwifi/iwl-commands.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/iwl-commands.h +2 -2
@@ -2092,8 +2092,8 @@ struct iwl_link_qual_general_params { } __packed;#define LINK_QUAL_AGG_TIME_LIMIT_DEF (4000)/* 4 milliseconds */ -#define LINK_QUAL_AGG_TIME_LIMIT_MAX (65535) -#define LINK_QUAL_AGG_TIME_LIMIT_MIN (0) +#define LINK_QUAL_AGG_TIME_LIMIT_MAX (8000) +#define LINK_QUAL_AGG_TIME_LIMIT_MIN (100)#define LINK_QUAL_AGG_DISABLE_START_DEF (3)#define LINK_QUAL_AGG_DISABLE_START_MAX (255)
Signature · 1 line
1.7.0.4
PATCH 4/16 iwlwifi: make aggregation time limit configurable
In reply to Wey-Yi GuyBy default, aggregation time limit is 4000 uSec, add the parameter to .cfg
to allow this parameter can be configure per device base if needed.
--- drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 10 ++++++++++ drivers/net/wireless/iwlwifi/iwl-commands.h | 6 ++++-- drivers/net/wireless/iwlwifi/iwl-core.h | 2 ++ 3 files changed, 16 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-rs.c +10 -0
@@ -2694,8 +2694,18 @@ static void rs_fill_link_cmd(struct iwl_priv *priv, lq_cmd->agg_params.agg_frame_cnt_limit =LINK_QUAL_AGG_FRAME_LIMIT_DEF ; lq_cmd->agg_params.agg_dis_start_th =LINK_QUAL_AGG_DISABLE_START_DEF ; + lq_cmd->agg_params.agg_time_limit =cpu_to_le16 (LINK_QUAL_AGG_TIME_LIMIT_DEF ); +/* +* overwrite if needed, pass aggregation time limit +* to uCode in uSec +*/ +if (priv && priv->cfg->agg_time_limit && + priv->cfg->agg_time_limit >=LINK_QUAL_AGG_TIME_LIMIT_MIN && + priv->cfg->agg_time_limit <=LINK_QUAL_AGG_TIME_LIMIT_MAX ) + lq_cmd->agg_params.agg_time_limit = +cpu_to_le16 (priv->cfg->agg_time_limit); }static void *rs_alloc (struct ieee80211_hw *hw,struct dentry *debugfsdir)
drivers/net/wireless/iwlwifi/iwl-commands.h +4 -2
@@ -2110,8 +2110,10 @@ struct iwl_link_qual_general_params {*/ struct iwl_link_qual_agg_params { -/* Maximum number of uSec in aggregation. -* Driver should set this to 4000 (4 milliseconds). */ +/* +*Maximum number of uSec in aggregation. +* default set to 4000 (4 milliseconds) if not configured in .cfg +*/ __le16 agg_time_limit;/*
drivers/net/wireless/iwlwifi/iwl-core.h +2 -0
@@ -280,6 +280,7 @@ struct iwl_mod_params {* @scan_antennas: available antenna for scan operation * @need_dc_calib: need to perform init dc calibration * @bt_statistics: use BT version of statistics notification +* @agg_time_limit: maximum number of uSec in aggregation * * We enable the driver to be backward compatible wrt API version. The * driver specifies which APIs it supports (with @ucode_api_max being the
@@ -350,6 +351,7 @@ struct iwl_cfg {u8 scan_tx_antennas[IEEE80211_NUM_BANDS ];const bool need_dc_calib;const bool bt_statistics; +u16 agg_time_limit; };/***************************
Signature · 1 line
1.7.0.4
PATCH 5/16 iwlwifi: do not call ieee80211_frequency_to_channel
In reply to Wey-Yi GuyFrom: Shanyu Zhao <[email protected]>
A few cases in iwlwifi driver function ieee80211_frequency_to_channel() is called to get channel number from center frequency. This is not needed since the channel number is already saved in hw_value field of struct ieee80211_channel in function iwlcore_init_geos(). So replace those function calls with hw_value field of struct ieee80211_channel.
--- drivers/net/wireless/iwlwifi/iwl-4965.c | 2 +- drivers/net/wireless/iwlwifi/iwl-5000.c | 2 +- drivers/net/wireless/iwlwifi/iwl-6000.c | 2 +- drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 2 +- drivers/net/wireless/iwlwifi/iwl-agn.c | 3 +-- drivers/net/wireless/iwlwifi/iwl-core.c | 4 ++-- drivers/net/wireless/iwlwifi/iwl-debugfs.c | 6 ++---- 7 files changed, 9 insertions(+), 12 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965.c +1 -1
@@ -1470,7 +1470,7 @@ static int iwl4965_hw_channel_switch(struct iwl_priv *priv, cmd.band = band; cmd.expect_beacon =0 ; - ch =ieee80211_frequency_to_channel (ch_switch->channel->center_freq); + ch = ch_switch->channel->hw_value; cmd.channel =cpu_to_le16 (ch); cmd.rxon_flags = priv->staging_rxon.flags; cmd.rxon_filter_flags = priv->staging_rxon.filter_flags;
drivers/net/wireless/iwlwifi/iwl-5000.c +1 -1
@@ -291,7 +291,7 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv, }; cmd.band = priv->band ==IEEE80211_BAND_2GHZ ; - ch =ieee80211_frequency_to_channel (ch_switch->channel->center_freq); + ch = ch_switch->channel->hw_value;IWL_DEBUG_11H (priv,"channel switch from %d to %d\n" , priv->active_rxon.channel, ch); cmd.channel =cpu_to_le16 (ch);
drivers/net/wireless/iwlwifi/iwl-6000.c +1 -1
@@ -214,7 +214,7 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv, }; cmd.band = priv->band ==IEEE80211_BAND_2GHZ ; - ch =ieee80211_frequency_to_channel (ch_switch->channel->center_freq); + ch = ch_switch->channel->hw_value;IWL_DEBUG_11H (priv,"channel switch from %u to %u\n" , priv->active_rxon.channel, ch); cmd.channel =cpu_to_le16 (ch);
drivers/net/wireless/iwlwifi/iwl-agn-lib.c +1 -1
@@ -1098,7 +1098,7 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv,if (chan->band != band)continue ; - channel =ieee80211_frequency_to_channel (chan->center_freq); + channel = chan->hw_value; scan_ch->channel =cpu_to_le16 (channel); ch_info =iwl_get_channel_info (priv, band, channel);
drivers/net/wireless/iwlwifi/iwl-agn.c +1 -2
@@ -3655,8 +3655,7 @@ static void iwl_mac_channel_switch(struct ieee80211_hw *hw,mutex_lock (&priv->mutex);if (priv->cfg->ops->lib->set_channel_switch) { - ch =ieee80211_frequency_to_channel ( - ch_switch->channel->center_freq); + ch = ch_switch->channel->hw_value;if (le16_to_cpu (priv->active_rxon.channel) != ch) { ch_info = iwl_get_channel_info(priv, conf->channel->band,
drivers/net/wireless/iwlwifi/iwl-core.c +2 -2
@@ -916,7 +916,7 @@ EXPORT_SYMBOL(iwl_get_single_channel_number);int iwl_set_rxon_channel (struct iwl_priv *priv,struct ieee80211_channel *ch) {enum ieee80211_band band = ch->band; -u16 channel =ieee80211_frequency_to_channel (ch->center_freq); +u16 channel = ch->hw_value;if (!iwl_get_channel_info (priv, band, channel)) { IWL_DEBUG_INFO(priv, "Could not set channel to %d [%d]\n",
@@ -1987,7 +1987,7 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)if (scan_active) goto set_ch_out; - ch =ieee80211_frequency_to_channel (conf->channel->center_freq); + ch = conf->channel->hw_value; ch_info =iwl_get_channel_info (priv, conf->channel->band, ch);if (!is_channel_valid (ch_info)) {IWL_DEBUG_MAC80211 (priv,"leave - invalid channel\n" );
drivers/net/wireless/iwlwifi/iwl-debugfs.c +2 -4
@@ -467,8 +467,7 @@ static ssize_t iwl_dbgfs_channels_read(struct file *file, char __user *user_buf,for (i =0 ; i < supp_band->n_channels; i++) pos += scnprintf(buf + pos, bufsz - pos, "%d: %ddBm: BSS%s%s, %s.\n", - ieee80211_frequency_to_channel( - channels[i].center_freq), + channels[i].hw_value, channels[i].max_power, channels[i].flags & IEEE80211_CHAN_RADAR ? " (IEEE 802.11h required)" : "",
@@ -491,8 +490,7 @@ static ssize_t iwl_dbgfs_channels_read(struct file *file, char __user *user_buf,for (i =0 ; i < supp_band->n_channels; i++) pos += scnprintf(buf + pos, bufsz - pos, "%d: %ddBm: BSS%s%s, %s.\n", - ieee80211_frequency_to_channel( - channels[i].center_freq), + channels[i].hw_value, channels[i].max_power, channels[i].flags & IEEE80211_CHAN_RADAR ? " (IEEE 802.11h required)" : "",
Signature · 1 line
1.7.0.4
PATCH 6/16 iwlwifi: avoid race condition in channel change
In reply to Wey-Yi GuyFrom: Shanyu Zhao <[email protected]>
When iwl_mac_config() is called by mac80211, the channel pointer hw->conf->channel can potentially change, resulting in mismatch band and channel number when configuring RXON command. To avoid this situation, save the channel pointer in local variables and validate the channel before using it. Note that priv->mutex is locked during the whole function so the local variables are safe.
Same change is applied to iwl_mac_channel_switch() since basically it copies code from iwl_mac_config().
Also removed an outdated comment in the flow.
--- drivers/net/wireless/iwlwifi/iwl-agn.c | 14 ++++++-------- drivers/net/wireless/iwlwifi/iwl-core.c | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn.c +6 -8
@@ -3632,6 +3632,7 @@ static void iwl_mac_channel_switch(struct ieee80211_hw *hw,struct iwl_priv *priv = hw->priv;const struct iwl_channel_info *ch_info;struct ieee80211_conf *conf = &hw->conf; +struct ieee80211_channel *channel = ch_switch->channel;struct iwl_ht_config *ht_conf = &priv->current_ht_config;u16 ch;unsigned long flags =0 ;
@@ -3655,10 +3656,10 @@ static void iwl_mac_channel_switch(struct ieee80211_hw *hw,mutex_lock (&priv->mutex);if (priv->cfg->ops->lib->set_channel_switch) { - ch = ch_switch->channel->hw_value; + ch = channel->hw_value;if (le16_to_cpu (priv->active_rxon.channel) != ch) { ch_info =iwl_get_channel_info (priv, - conf->channel->band, + channel->band, ch);if (!is_channel_valid (ch_info)) {IWL_DEBUG_MAC80211 (priv,"invalid channel\n" );
@@ -3687,15 +3688,12 @@ static void iwl_mac_channel_switch(struct ieee80211_hw *hw, }else ht_conf->is_40mhz = false; -/* if we are switching from ht to 2.4 clear flags -* from any ht related info since 2.4 does not -* support ht */ -if ((le16_to_cpu (priv->staging_rxon.channel) != ch)) +if (le16_to_cpu (priv->staging_rxon.channel) != ch) priv->staging_rxon.flags =0 ; -iwl_set_rxon_channel (priv, conf->channel); +iwl_set_rxon_channel (priv, channel);iwl_set_rxon_ht (priv, ht_conf); -iwl_set_flags_for_band (priv, conf->channel->band, +iwl_set_flags_for_band (priv, channel->band, priv->vif);spin_unlock_irqrestore (&priv->lock, flags);
drivers/net/wireless/iwlwifi/iwl-core.c +6 -8
@@ -1947,6 +1947,7 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)struct iwl_priv *priv = hw->priv;const struct iwl_channel_info *ch_info;struct ieee80211_conf *conf = &hw->conf; +struct ieee80211_channel *channel = conf->channel;struct iwl_ht_config *ht_conf = &priv->current_ht_config;unsigned long flags =0 ;int ret =0 ;
@@ -1956,7 +1957,7 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)mutex_lock (&priv->mutex);IWL_DEBUG_MAC80211 (priv,"enter to channel %d changed 0x%X\n" , - conf->channel->hw_value, changed); + channel->hw_value, changed);if (unlikely (!priv->cfg->mod_params->disable_hw_scan &&test_bit (STATUS_SCANNING , &priv->status))) {
@@ -1987,8 +1988,8 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)if (scan_active) goto set_ch_out; - ch = conf->channel->hw_value; - ch_info =iwl_get_channel_info (priv, conf->channel->band, ch); + ch = channel->hw_value; + ch_info =iwl_get_channel_info (priv, channel->band, ch);if (!is_channel_valid (ch_info)) {IWL_DEBUG_MAC80211 (priv,"leave - invalid channel\n" ); ret = -EINVAL ;
@@ -2019,16 +2020,13 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)* from BSS config in iwl_ht_conf */ ht_conf->ht_protection =IEEE80211_HT_OP_MODE_PROTECTION_NONE ; -/* if we are switching from ht to 2.4 clear flags -* from any ht related info since 2.4 does not -* support ht */ if ((le16_to_cpu (priv->staging_rxon.channel) != ch)) priv->staging_rxon.flags =0 ; -iwl_set_rxon_channel (priv, conf->channel); +iwl_set_rxon_channel (priv, channel);iwl_set_rxon_ht (priv, ht_conf); -iwl_set_flags_for_band (priv, conf->channel->band, priv->vif); +iwl_set_flags_for_band (priv, channel->band, priv->vif);spin_unlock_irqrestore (&priv->lock, flags);if (priv->cfg->ops->lib->update_bcast_station)
Signature · 1 line
1.7.0.4
PATCH 7/16 iwlwifi: cleanup iwl_set_rxon_channel()
In reply to Wey-Yi GuyFrom: Shanyu Zhao <[email protected]>
Update outdated comments of iwl_set_rxon_channel() to reflect the current signature. Also remove the unnecessary validation of the channel. Those channel info are constructed in iwlwifi driver and mac80211 will never modify the content of the struct. Also everytime before this function is called the channel info has been validated already (as a paranoid check).
--- drivers/net/wireless/iwlwifi/iwl-core.c | 15 ++++----------- 1 files changed, 4 insertions(+), 11 deletions(-)
drivers/net/wireless/iwlwifi/iwl-core.c +4 -11
@@ -904,26 +904,19 @@ u8 iwl_get_single_channel_number(struct iwl_priv *priv,EXPORT_SYMBOL (iwl_get_single_channel_number);/** -* iwl_set_rxon_channel - Set the phymode and channel values in staging RXON -* @phymode: MODE_IEEE80211A sets to 5.2GHz; all else set to 2.4GHz -* @channel: Any channel valid for the requested phymode +* iwl_set_rxon_channel - Set the band and channel values in staging RXON +* @ch: requested channel as a pointer to struct ieee80211_channel -* In addition to setting the staging RXON, priv->phymode is also set. +* In addition to setting the staging RXON, priv->band is also set. * * NOTE: Does not commit to the hardware; it sets appropriate bit fields -* in the staging RXON flag structure based on the phymode +* in the staging RXON flag structure based on the ch->band */ int iwl_set_rxon_channel (struct iwl_priv *priv,struct ieee80211_channel *ch) {enum ieee80211_band band = ch->band;u16 channel = ch->hw_value; -if (!iwl_get_channel_info (priv, band, channel)) { -IWL_DEBUG_INFO (priv,"Could not set channel to %d [%d]\n" , - channel, band); -return -EINVAL ; - } -if ((le16_to_cpu (priv->staging_rxon.channel) == channel) && (priv->band == band))return 0 ;
Signature · 1 line
1.7.0.4
PATCH 8/16 iwlwifi: refactor iwl_setup_rxon_timing
In reply to Wey-Yi GuyFrom: Johannes Berg <[email protected]>
All callers of iwl_setup_rxon_timing() also send the command right away, so rename the function to iwl_send_rxon_timing() and move the sending into it. Also, some callers clear the data, this can be done always and thus moved in as well. Finally, there's no reason for the function to acquire the spinlock, but it should be called with the mutex held, so assert that.
--- drivers/net/wireless/iwlwifi/iwl-agn.c | 8 ++------ drivers/net/wireless/iwlwifi/iwl-core.c | 14 +++++++++----- drivers/net/wireless/iwlwifi/iwl-core.h | 2 +- drivers/net/wireless/iwlwifi/iwl3945-base.c | 11 ++--------- 4 files changed, 14 insertions(+), 21 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn.c +2 -6
@@ -3109,9 +3109,7 @@ void iwl_post_associate(struct iwl_priv *priv, struct ieee80211_vif *vif) priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK ;iwlcore_commit_rxon (priv); -iwl_setup_rxon_timing (priv, vif); - ret =iwl_send_cmd_pdu (priv,REPLY_RXON_TIMING , -sizeof (priv->rxon_timing), &priv->rxon_timing); + ret =iwl_send_rxon_timing (priv, vif);if (ret)IWL_WARN (priv,"REPLY_RXON_TIMING failed - " "Attempting to continue.\n" );
@@ -3347,9 +3345,7 @@ void iwl_config_ap(struct iwl_priv *priv, struct ieee80211_vif *vif)iwlcore_commit_rxon (priv);/* RXON Timing */ -iwl_setup_rxon_timing (priv, vif); - ret =iwl_send_cmd_pdu (priv,REPLY_RXON_TIMING , -sizeof (priv->rxon_timing), &priv->rxon_timing); + ret =iwl_send_rxon_timing (priv, vif);if (ret)IWL_WARN (priv,"REPLY_RXON_TIMING failed - " "Attempting to continue.\n" );
drivers/net/wireless/iwlwifi/iwl-core.c +9 -5
@@ -491,17 +491,19 @@ static u16 iwl_adjust_beacon_interval(u16 beacon_val, u16 max_beacon_val)return new_val; } -void iwl_setup_rxon_timing (struct iwl_priv *priv,struct ieee80211_vif *vif) +int iwl_send_rxon_timing (struct iwl_priv *priv,struct ieee80211_vif *vif) {u64 tsf;s32 interval_tm, rem; -unsigned long flags;struct ieee80211_conf *conf =NULL ;u16 beacon_int; conf =ieee80211_get_hw_conf (priv->hw); -spin_lock_irqsave (&priv->lock, flags); +lockdep_assert_held (&priv->mutex); + +memset (&priv->rxon_timing,0 ,sizeof (struct iwl_rxon_time_cmd )); + priv->rxon_timing.timestamp =cpu_to_le64 (priv->timestamp); priv->rxon_timing.listen_interval =cpu_to_le16 (conf->listen_interval);
@@ -524,14 +526,16 @@ void iwl_setup_rxon_timing(struct iwl_priv *priv, struct ieee80211_vif *vif) rem =do_div (tsf, interval_tm); priv->rxon_timing.beacon_init_val =cpu_to_le32 (interval_tm - rem); -spin_unlock_irqrestore (&priv->lock, flags);IWL_DEBUG_ASSOC (priv,"beacon interval %d beacon timer %d beacon tim %d\n" ,le16_to_cpu (priv->rxon_timing.beacon_interval),le32_to_cpu (priv->rxon_timing.beacon_init_val),le16_to_cpu (priv->rxon_timing.atim_window)); + +return iwl_send_cmd_pdu (priv,REPLY_RXON_TIMING , +sizeof (priv->rxon_timing), &priv->rxon_timing); } -EXPORT_SYMBOL (iwl_setup_rxon_timing); +EXPORT_SYMBOL (iwl_send_rxon_timing);void iwl_set_rxon_hwcrypto (struct iwl_priv *priv,int hw_decrypt) {
drivers/net/wireless/iwlwifi/iwl-core.h +1 -1
@@ -711,7 +711,7 @@ extern int iwl_send_lq_cmd(struct iwl_priv *priv,void iwl_apm_stop (struct iwl_priv *priv);int iwl_apm_init (struct iwl_priv *priv); -void iwl_setup_rxon_timing (struct iwl_priv *priv,struct ieee80211_vif *vif); +int iwl_send_rxon_timing (struct iwl_priv *priv,struct ieee80211_vif *vif);static inline int iwl_send_rxon_assoc (struct iwl_priv *priv) {return priv->cfg->ops->hcmd->rxon_assoc (priv);
drivers/net/wireless/iwlwifi/iwl3945-base.c +2 -9
@@ -3094,10 +3094,7 @@ void iwl3945_post_associate(struct iwl_priv *priv, struct ieee80211_vif *vif) priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK ;iwlcore_commit_rxon (priv); -memset (&priv->rxon_timing,0 ,sizeof (struct iwl_rxon_time_cmd )); -iwl_setup_rxon_timing (priv, vif); - rc =iwl_send_cmd_pdu (priv,REPLY_RXON_TIMING , -sizeof (priv->rxon_timing), &priv->rxon_timing); + rc =iwl_send_rxon_timing (priv, vif);if (rc)IWL_WARN (priv,"REPLY_RXON_TIMING failed - " "Attempting to continue.\n" );
@@ -3271,11 +3268,7 @@ void iwl3945_config_ap(struct iwl_priv *priv, struct ieee80211_vif *vif)iwlcore_commit_rxon (priv);/* RXON Timing */ -memset (&priv->rxon_timing,0 ,sizeof (struct iwl_rxon_time_cmd )); -iwl_setup_rxon_timing (priv, vif); - rc =iwl_send_cmd_pdu (priv,REPLY_RXON_TIMING , -sizeof (priv->rxon_timing), - &priv->rxon_timing); + rc =iwl_send_rxon_timing (priv, vif);if (rc)IWL_WARN (priv,"REPLY_RXON_TIMING failed - " "Attempting to continue.\n" );
Signature · 1 line
1.7.0.4
PATCH 9/16 iwlagn: adjust starting action for rate scale
In reply to Wey-Yi GuyDuring rate scale, reset starting action after making action adjustment to avoid the possibility of break out of loop too early.
--- drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-rs.c +8 -4
@@ -1265,7 +1265,7 @@ static int rs_move_legacy_other(struct iwl_priv *priv,struct iwl_rate_scale_data *window = &(tbl->win[index]);u32 sz = (sizeof (struct iwl_scale_tbl_info ) - (sizeof (struct iwl_rate_scale_data ) *IWL_RATE_COUNT )); -u8 start_action = tbl->action; +u8 start_action;u8 valid_tx_ant = priv->hw_params.valid_tx_ant;u8 tx_chains_num = priv->hw_params.tx_chains_num;int ret =0 ;
@@ -1277,6 +1277,7 @@ static int rs_move_legacy_other(struct iwl_priv *priv,else if (iwl_tx_ant_restriction (priv) ==IWL_ANT_OK_SINGLE && tbl->action >IWL_LEGACY_SWITCH_SISO ) tbl->action =IWL_LEGACY_SWITCH_SISO ; + start_action = tbl->action;for (; ;) { lq_sta->action_counter++;switch (tbl->action) {
@@ -1403,7 +1404,7 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap;u32 sz = (sizeof (struct iwl_scale_tbl_info ) - (sizeof (struct iwl_rate_scale_data ) *IWL_RATE_COUNT )); -u8 start_action = tbl->action; +u8 start_action;u8 valid_tx_ant = priv->hw_params.valid_tx_ant;u8 tx_chains_num = priv->hw_params.tx_chains_num;u8 update_search_tbl_counter =0 ;
@@ -1414,6 +1415,7 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,/* stay in SISO */ tbl->action =IWL_SISO_SWITCH_ANTENNA1 ; } + start_action = tbl->action;for (;;) { lq_sta->action_counter++;switch (tbl->action) {
@@ -1541,7 +1543,7 @@ static int rs_move_mimo2_to_other(struct iwl_priv *priv,struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap;u32 sz = (sizeof (struct iwl_scale_tbl_info ) - (sizeof (struct iwl_rate_scale_data ) *IWL_RATE_COUNT )); -u8 start_action = tbl->action; +u8 start_action;u8 valid_tx_ant = priv->hw_params.valid_tx_ant;u8 tx_chains_num = priv->hw_params.tx_chains_num;u8 update_search_tbl_counter =0 ;
@@ -1553,6 +1555,7 @@ static int rs_move_mimo2_to_other(struct iwl_priv *priv,/* switch in SISO */ tbl->action =IWL_MIMO2_SWITCH_SISO_A ; } + start_action = tbl->action;for (;;) { lq_sta->action_counter++;switch (tbl->action) {
@@ -1682,7 +1685,7 @@ static int rs_move_mimo3_to_other(struct iwl_priv *priv,struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap;u32 sz = (sizeof (struct iwl_scale_tbl_info ) - (sizeof (struct iwl_rate_scale_data ) *IWL_RATE_COUNT )); -u8 start_action = tbl->action; +u8 start_action;u8 valid_tx_ant = priv->hw_params.valid_tx_ant;u8 tx_chains_num = priv->hw_params.tx_chains_num;int ret;
@@ -1694,6 +1697,7 @@ static int rs_move_mimo3_to_other(struct iwl_priv *priv,/* switch in SISO */ tbl->action =IWL_MIMO3_SWITCH_SISO_A ; } + start_action = tbl->action;for (;;) { lq_sta->action_counter++;switch (tbl->action) {
Signature · 1 line
1.7.0.4
PATCH 10/16 iwlagn: continue perform rate scale when error detected
In reply to Wey-Yi GuyIf for some reason, the actual link command not matching neither active nor search table; instead of return and not performing rate scale, by-pass the data collection and continue the rate scale process.
--- drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 20 +++++++++++++++++--- 1 files changed, 17 insertions(+), 3 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-rs.c +17 -3
@@ -82,6 +82,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, struct iwl_lq_sta *lq_sta);static void rs_fill_link_cmd (struct iwl_priv *priv,struct iwl_lq_sta *lq_sta,u32 rate_n_flags); +static void rs_stay_in_table (struct iwl_lq_sta *lq_sta);#ifdef CONFIG_MAC80211_DEBUGFS
@@ -502,6 +503,7 @@ static int rs_get_tbl_info_from_mcs(const u32 rate_n_flags,u8 num_of_ant =get_num_of_ant_from_rate (rate_n_flags);u8 mcs; +memset (tbl,0 ,sizeof (struct iwl_scale_tbl_info )); *rate_idx =iwl_hwrate_to_plcp_idx (rate_n_flags);if (*rate_idx ==IWL_RATE_INVALID ) {
@@ -848,7 +850,20 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband, other_tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); }else {IWL_DEBUG_RATE (priv,"Neither active nor search matches tx rate\n" ); -return ; + tmp_tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); +IWL_DEBUG_RATE (priv,"active- lq:%x, ant:%x, SGI:%d\n" , + tmp_tbl->lq_type, tmp_tbl->ant_type, tmp_tbl->is_SGI); + tmp_tbl = &(lq_sta->lq_info[1 - lq_sta->active_tbl]); +IWL_DEBUG_RATE (priv,"search- lq:%x, ant:%x, SGI:%d\n" , + tmp_tbl->lq_type, tmp_tbl->ant_type, tmp_tbl->is_SGI); +IWL_DEBUG_RATE (priv,"actual- lq:%x, ant:%x, SGI:%d\n" , + tbl_type.lq_type, tbl_type.ant_type, tbl_type.is_SGI); +/* +* no matching table found, let's by-pass the data collection +* and continue to perform rate scale to find the rate table +*/ +rs_stay_in_table (lq_sta); + goto done; }/*
@@ -909,7 +924,7 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband, }/* The last TX rate is cached in lq_sta; it's set in if/else above */ lq_sta->last_rate_n_flags = tx_rate; - +done:/* See if there's a better rate or modulation mode to try. */ if (sta && sta->supp_rates[sband->band])rs_rate_scale_perform (priv, skb, sta, lq_sta);
@@ -2598,7 +2613,6 @@ static void rs_fill_link_cmd(struct iwl_priv *priv,rs_dbgfs_set_mcs (lq_sta, &new_rate, index);/* Interpret new_rate (rate_n_flags) */ -memset (&tbl_type,0 ,sizeof (tbl_type));rs_get_tbl_info_from_mcs (new_rate, lq_sta->band, &tbl_type, &rate_idx);
Signature · 1 line
1.7.0.4
PATCH 11/16 iwlwifi: additional parameter in REPLY_RX_PHY_CMD
In reply to Wey-Yi GuyAdding additional parameter in REPLY_RX_PHY_CMD, frame_time indicate the frame's time on the air based on byte count and frame rate calculation
--- drivers/net/wireless/iwlwifi/iwl-commands.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/iwlwifi/iwl-commands.h +1 -1
@@ -1401,7 +1401,7 @@ struct iwl_rx_phy_res {u8 non_cfg_phy_buf[32 ];/* for various implementations of non_cfg_phy */ __le32 rate_n_flags;/* RATE_MCS_* */ __le16 byte_count;/* frame's byte-count */ -__le16 reserved3; +__le16 frame_time;/* frame's time on the air */ } __packed;struct iwl_rx_mpdu_res_start {
Signature · 1 line
1.7.0.4
PATCH 12/16 iwlwifi: more generic name for rssi calc in iwlagn
In reply to Wey-Yi GuyChange the define to more generic naming to match _agn devices since the rssi calculation are common function for 5000 series and up
--- drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c | 21 +++++++++------- drivers/net/wireless/iwlwifi/iwl-commands.h | 33 ++++++++++++++------------ 2 files changed, 30 insertions(+), 24 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c +12 -9
@@ -235,13 +235,13 @@ static int iwlagn_calc_rssi(struct iwl_priv *priv,/* data from PHY/DSP regarding signal strength, etc., * contents are always there, not configurable by host */ -struct iwl5000_non_cfg_phy *ncphy = - (struct iwl5000_non_cfg_phy *)rx_resp->non_cfg_phy_buf; +struct iwlagn_non_cfg_phy *ncphy = + (struct iwlagn_non_cfg_phy *)rx_resp->non_cfg_phy_buf;u32 val, rssi_a, rssi_b, rssi_c, max_rssi;u8 agc; - val =le32_to_cpu (ncphy->non_cfg_phy[IWL50_RX_RES_AGC_IDX ]); - agc = (val &IWL50_OFDM_AGC_MSK ) >>IWL50_OFDM_AGC_BIT_POS ; + val =le32_to_cpu (ncphy->non_cfg_phy[IWLAGN_RX_RES_AGC_IDX ]); + agc = (val &IWLAGN_OFDM_AGC_MSK ) >>IWLAGN_OFDM_AGC_BIT_POS ;/* Find max rssi among 3 possible receivers. * These values are measured by the digital signal processor (DSP).
@@ -249,11 +249,14 @@ static int iwlagn_calc_rssi(struct iwl_priv *priv,* if the radio's automatic gain control (AGC) is working right. * AGC value (see below) will provide the "interesting" info. */ - val =le32_to_cpu (ncphy->non_cfg_phy[IWL50_RX_RES_RSSI_AB_IDX ]); - rssi_a = (val &IWL50_OFDM_RSSI_A_MSK ) >>IWL50_OFDM_RSSI_A_BIT_POS ; - rssi_b = (val &IWL50_OFDM_RSSI_B_MSK ) >>IWL50_OFDM_RSSI_B_BIT_POS ; - val =le32_to_cpu (ncphy->non_cfg_phy[IWL50_RX_RES_RSSI_C_IDX ]); - rssi_c = (val &IWL50_OFDM_RSSI_C_MSK ) >>IWL50_OFDM_RSSI_C_BIT_POS ; + val =le32_to_cpu (ncphy->non_cfg_phy[IWLAGN_RX_RES_RSSI_AB_IDX ]); + rssi_a = (val &IWLAGN_OFDM_RSSI_INBAND_A_BITMSK ) >> +IWLAGN_OFDM_RSSI_A_BIT_POS ; + rssi_b = (val &IWLAGN_OFDM_RSSI_INBAND_B_BITMSK ) >> +IWLAGN_OFDM_RSSI_B_BIT_POS ; + val =le32_to_cpu (ncphy->non_cfg_phy[IWLAGN_RX_RES_RSSI_C_IDX ]); + rssi_c = (val &IWLAGN_OFDM_RSSI_INBAND_C_BITMSK ) >> +IWLAGN_OFDM_RSSI_C_BIT_POS ; max_rssi =max_t (u32, rssi_a, rssi_b); max_rssi =max_t (u32, max_rssi, rssi_c);
drivers/net/wireless/iwlwifi/iwl-commands.h +18 -15
@@ -1367,21 +1367,24 @@ struct iwl4965_rx_non_cfg_phy { } __packed; -#define IWL50_RX_RES_PHY_CNT 8 -#define IWL50_RX_RES_AGC_IDX 1 -#define IWL50_RX_RES_RSSI_AB_IDX 2 -#define IWL50_RX_RES_RSSI_C_IDX 3 -#define IWL50_OFDM_AGC_MSK 0xfe00 -#define IWL50_OFDM_AGC_BIT_POS 9 -#define IWL50_OFDM_RSSI_A_MSK 0x00ff -#define IWL50_OFDM_RSSI_A_BIT_POS 0 -#define IWL50_OFDM_RSSI_B_MSK 0xff0000 -#define IWL50_OFDM_RSSI_B_BIT_POS 16 -#define IWL50_OFDM_RSSI_C_MSK 0x00ff -#define IWL50_OFDM_RSSI_C_BIT_POS 0 - -struct iwl5000_non_cfg_phy { -__le32 non_cfg_phy[IWL50_RX_RES_PHY_CNT ];/* up to 8 phy entries */ +#define IWLAGN_RX_RES_PHY_CNT 8 +#define IWLAGN_RX_RES_AGC_IDX 1 +#define IWLAGN_RX_RES_RSSI_AB_IDX 2 +#define IWLAGN_RX_RES_RSSI_C_IDX 3 +#define IWLAGN_OFDM_AGC_MSK 0xfe00 +#define IWLAGN_OFDM_AGC_BIT_POS 9 +#define IWLAGN_OFDM_RSSI_INBAND_A_BITMSK 0x00ff +#define IWLAGN_OFDM_RSSI_ALLBAND_A_BITMSK 0xff00 +#define IWLAGN_OFDM_RSSI_A_BIT_POS 0 +#define IWLAGN_OFDM_RSSI_INBAND_B_BITMSK 0xff0000 +#define IWLAGN_OFDM_RSSI_ALLBAND_B_BITMSK 0xff000000 +#define IWLAGN_OFDM_RSSI_B_BIT_POS 16 +#define IWLAGN_OFDM_RSSI_INBAND_C_BITMSK 0x00ff +#define IWLAGN_OFDM_RSSI_ALLBAND_C_BITMSK 0xff00 +#define IWLAGN_OFDM_RSSI_C_BIT_POS 0 + +struct iwlagn_non_cfg_phy { +__le32 non_cfg_phy[IWLAGN_RX_RES_PHY_CNT ];/* up to 8 phy entries */ } __packed;
Signature · 1 line
1.7.0.4
PATCH 13/16 iwlwifi: configurable ampdu factor and density
In reply to Wey-Yi GuyAdd ampdu factor and density to .cfg, this allow both parameters can be configure per device based.
--- drivers/net/wireless/iwlwifi/iwl-core.c | 4 ++++ drivers/net/wireless/iwlwifi/iwl-core.h | 4 ++++ drivers/net/wireless/iwlwifi/iwl-dev.h | 13 ++++++++++++- 3 files changed, 20 insertions(+), 1 deletions(-)
drivers/net/wireless/iwlwifi/iwl-core.c +4 -0
@@ -239,7 +239,11 @@ static void iwlcore_init_ht_hw_capab(const struct iwl_priv *priv, ht_info->cap |=IEEE80211_HT_CAP_MAX_AMSDU ; ht_info->ampdu_factor =CFG_HT_RX_AMPDU_FACTOR_DEF ; +if (priv->cfg->ampdu_factor) + ht_info->ampdu_factor = priv->cfg->ampdu_factor; ht_info->ampdu_density =CFG_HT_MPDU_DENSITY_DEF ; +if (priv->cfg->ampdu_density) + ht_info->ampdu_density = priv->cfg->ampdu_density; ht_info->mcs.rx_mask[0 ] =0xFF ;if (rx_chains_num >=2 )
drivers/net/wireless/iwlwifi/iwl-core.h +4 -0
@@ -281,6 +281,8 @@ struct iwl_mod_params {* @need_dc_calib: need to perform init dc calibration * @bt_statistics: use BT version of statistics notification * @agg_time_limit: maximum number of uSec in aggregation +* @ampdu_factor: Maximum A-MPDU length factor +* @ampdu_density: Minimum A-MPDU spacing * * We enable the driver to be backward compatible wrt API version. The * driver specifies which APIs it supports (with @ucode_api_max being the
@@ -352,6 +354,8 @@ struct iwl_cfg {const bool need_dc_calib;const bool bt_statistics;u16 agg_time_limit; +u8 ampdu_factor; +u8 ampdu_density; };/***************************
drivers/net/wireless/iwlwifi/iwl-dev.h +12 -1
@@ -435,7 +435,13 @@ union iwl_ht_rate_supp { }; }; -#define CFG_HT_RX_AMPDU_FACTOR_DEF (0x3) +#define CFG_HT_RX_AMPDU_FACTOR_8K (0x0) +#define CFG_HT_RX_AMPDU_FACTOR_16K (0x1) +#define CFG_HT_RX_AMPDU_FACTOR_32K (0x2) +#define CFG_HT_RX_AMPDU_FACTOR_64K (0x3) +#define CFG_HT_RX_AMPDU_FACTOR_DEF CFG_HT_RX_AMPDU_FACTOR_64K +#define CFG_HT_RX_AMPDU_FACTOR_MAX CFG_HT_RX_AMPDU_FACTOR_64K +#define CFG_HT_RX_AMPDU_FACTOR_MIN CFG_HT_RX_AMPDU_FACTOR_8K/* * Maximal MPDU density for TX aggregation
@@ -444,8 +450,13 @@ union iwl_ht_rate_supp {* 6 - 8us density * 7 - 16us density */ +#define CFG_HT_MPDU_DENSITY_2USEC (0x4)#define CFG_HT_MPDU_DENSITY_4USEC (0x5) +#define CFG_HT_MPDU_DENSITY_8USEC (0x6) +#define CFG_HT_MPDU_DENSITY_16USEC (0x7)#define CFG_HT_MPDU_DENSITY_DEF CFG_HT_MPDU_DENSITY_4USEC +#define CFG_HT_MPDU_DENSITY_MAX CFG_HT_MPDU_DENSITY_16USEC +#define CFG_HT_MPDU_DENSITY_MIN (0x1)struct iwl_ht_config {/* self configuration data */
Signature · 1 line
1.7.0.4
PATCH 14/16 iwlwifi: remove unused iwl_send_card_state function
In reply to Wey-Yi Guyiwl_send_card_state() is not being call from anywhere, remove it.
--- drivers/net/wireless/iwlwifi/iwl-core.c | 22 ---------------------- drivers/net/wireless/iwlwifi/iwl-core.h | 2 -- 2 files changed, 0 insertions(+), 24 deletions(-)
drivers/net/wireless/iwlwifi/iwl-core.c +0 -22
@@ -1470,28 +1470,6 @@ int iwl_send_statistics_request(struct iwl_priv *priv, u8 flags, bool clear) }EXPORT_SYMBOL (iwl_send_statistics_request); -/* -* CARD_STATE_CMD -* -* Use: Sets the device's internal card state to enable, disable, or halt -* -* When in the 'enable' state the card operates as normal. -* When in the 'disable' state, the card enters into a low power mode. -* When in the 'halt' state, the card is shut down and must be fully -* restarted to come back on. -*/ -int iwl_send_card_state (struct iwl_priv *priv,u32 flags,u8 meta_flag) -{ -struct iwl_host_cmd cmd = { - .id =REPLY_CARD_STATE_CMD , - .len =sizeof (u32), - .data = &flags, - .flags = meta_flag, - }; - -return iwl_send_cmd (priv, &cmd); -} -void iwl_rx_pm_sleep_notif (struct iwl_priv *priv,struct iwl_rx_mem_buffer *rxb) {
drivers/net/wireless/iwlwifi/iwl-core.h +0 -2
@@ -592,8 +592,6 @@ int iwl_send_cmd_pdu_async(struct iwl_priv *priv, u8 id, u16 len,int iwl_enqueue_hcmd (struct iwl_priv *priv,struct iwl_host_cmd *cmd); -int iwl_send_card_state (struct iwl_priv *priv,u32 flags, -u8 meta_flag);/***************************************************** * PCI *
Signature · 1 line
1.7.0.4
PATCH 15/16 iwlwifi: enable experimental ucode support
In reply to Wey-Yi GuyFrom: Jay Sternberg <[email protected]>
ucode firmware may need to be released as experimental for testing or debugging. released ucode filenames have the API version as the last component. experimental ucode files will have that component be "exp" and the fw_version string reported by ethtool will also contain the string EXP to clearly identify this ucode from released ucode. EXP is short for EXPERIMENTAL since fw_version has a max lenght on 32.
this capability is controlled by Kconfig and defaulted to not be used.
--- drivers/net/wireless/iwlwifi/Kconfig | 6 +++++ drivers/net/wireless/iwlwifi/iwl-agn.c | 33 ++++++++++++++++++++++++------- 2 files changed, 31 insertions(+), 8 deletions(-)
drivers/net/wireless/iwlwifi/Kconfig +6 -0
@@ -36,6 +36,12 @@ config IWLWIFI_DEBUGFS is a low-impact option that allows getting insight into the driver's state at runtime. +config IWLWIFI_DEBUG_EXPERIMENTAL_UCODE + bool "Experimental uCode support" + depends on IWLWIFI && IWLWIFI_DEBUG + ---help--- + Enable use of experimental ucode for testing and debugging. + config IWLWIFI_DEVICE_TRACING bool "iwlwifi device access tracing" depends on IWLWIFI
drivers/net/wireless/iwlwifi/iwl-agn.c +25 -8
@@ -1659,24 +1659,37 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context);static int iwl_mac_setup_register (struct iwl_priv *priv,struct iwlagn_ucode_capabilities *capa); +#define UCODE_EXPERIMENTAL_INDEX 100 +#define UCODE_EXPERIMENTAL_TAG "exp" +static int __must_check iwl_request_firmware (struct iwl_priv *priv,bool first) {const char *name_pre = priv->cfg->fw_name_pre; +char tag[8 ]; -if (first) +if (first) { +#ifdef CONFIG_IWLWIFI_DEBUG_EXPERIMENTAL_UCODE + priv->fw_index =UCODE_EXPERIMENTAL_INDEX ; + strcpy(tag, UCODE_EXPERIMENTAL_TAG); + }else if (priv->fw_index ==UCODE_EXPERIMENTAL_INDEX ) { +#endif priv->fw_index = priv->cfg->ucode_api_max; -else +sprintf (tag,"%d" , priv->fw_index); + }else { priv->fw_index--; +sprintf (tag,"%d" , priv->fw_index); + }if (priv->fw_index < priv->cfg->ucode_api_min) {IWL_ERR (priv,"no suitable firmware found!\n" );return -ENOENT ; } -sprintf (priv->firmware_name,"%s%d%s" , - name_pre, priv->fw_index,".ucode" ); +sprintf (priv->firmware_name,"%s%s%s" , name_pre, tag,".ucode" ); -IWL_DEBUG_INFO (priv,"attempting to load firmware '%s'\n" , +IWL_DEBUG_INFO (priv,"attempting to load firmware %s'%s'\n" , + (priv->fw_index ==UCODE_EXPERIMENTAL_INDEX ) + ?"EXPERIMENTAL " :"" , priv->firmware_name); return request_firmware_nowait(THIS_MODULE, 1, priv->firmware_name,
@@ -1971,8 +1984,10 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)memset (&pieces,0 ,sizeof (pieces));if (!ucode_raw) { -IWL_ERR (priv,"request for firmware file '%s' failed.\n" , - priv->firmware_name); +if (priv->fw_index <= priv->cfg->ucode_api_max) +IWL_ERR (priv, +"request for firmware file '%s' failed.\n" , + priv->firmware_name); goto try_again; }
@@ -2019,7 +2034,9 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) api_max, api_ver);if (build) -sprintf (buildstr," build %u" , build); +sprintf (buildstr," build %u%s" , build, + (priv->fw_index ==UCODE_EXPERIMENTAL_INDEX ) + ?" (EXP)" :"" );else buildstr[0 ] ='\0' ;
Signature · 1 line
1.7.0.4
PATCH 16/16 iwlwifi: move debug options into submenu
In reply to Wey-Yi GuyFrom: Jay Sternberg <[email protected]>
more debug options being added so it is useful to move them into a submenu for ease of readability when using config commands like make menuconfig and make xconfig
--- drivers/net/wireless/iwlwifi/Kconfig | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/net/wireless/iwlwifi/Kconfig +4 -0
@@ -3,6 +3,9 @@ config IWLWIFI depends on PCI && MAC80211 select FW_LOADER +menu "Debugging Options" + depends on IWLWIFI + config IWLWIFI_DEBUG bool "Enable full debugging output in iwlagn and iwl3945 drivers" depends on IWLWIFI
@@ -59,6 +62,7 @@ config IWLWIFI_DEVICE_TRACING If unsure, say Y so we can help you better when problems occur. +endmenu config IWLAGN tristate "Intel Wireless WiFi Next Gen AGN (iwlagn)"
Signature · 1 line
1.7.0.4