Commit f53696de authored by Tomas Winkler's avatar Tomas Winkler Committed by John W. Linville

iwlwifi: cleans up scanning code

This patch
1. cleans up scanning code.
2. It adds round robin of TX antannas/chains.
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarZhu Yi <yi.zhu@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent e7d326ac
...@@ -281,16 +281,7 @@ struct iwl_cmd_header { ...@@ -281,16 +281,7 @@ struct iwl_cmd_header {
#define RATE_MCS_ANT_C_MSK 0x10000 #define RATE_MCS_ANT_C_MSK 0x10000
#define RATE_MCS_ANT_ABC_MSK 0x1C000 #define RATE_MCS_ANT_ABC_MSK 0x1C000
#define RATE_MCS_ANT_INIT_IND 1
/**
* struct iwl4965_tx_power - txpower format used in REPLY_SCAN_CMD
*
* Scan uses only one transmitter, so only one analog/dsp gain pair is needed.
*/
struct iwl4965_tx_power {
u8 tx_gain; /* gain for analog radio */
u8 dsp_atten; /* gain for DSP */
} __attribute__ ((packed));
#define POWER_TABLE_NUM_ENTRIES 33 #define POWER_TABLE_NUM_ENTRIES 33
#define POWER_TABLE_NUM_HT_OFDM_ENTRIES 32 #define POWER_TABLE_NUM_HT_OFDM_ENTRIES 32
...@@ -2128,7 +2119,8 @@ struct iwl_scan_channel { ...@@ -2128,7 +2119,8 @@ struct iwl_scan_channel {
*/ */
u8 type; u8 type;
u8 channel; /* band is selected by iwl4965_scan_cmd "flags" field */ u8 channel; /* band is selected by iwl4965_scan_cmd "flags" field */
struct iwl4965_tx_power tpc; u8 tx_gain; /* gain for analog radio */
u8 dsp_atten; /* gain for DSP */
__le16 active_dwell; /* in 1024-uSec TU (time units), typ 5-50 */ __le16 active_dwell; /* in 1024-uSec TU (time units), typ 5-50 */
__le16 passive_dwell; /* in 1024-uSec TU (time units), typ 20-500 */ __le16 passive_dwell; /* in 1024-uSec TU (time units), typ 20-500 */
} __attribute__ ((packed)); } __attribute__ ((packed));
......
...@@ -874,6 +874,7 @@ int iwl_init_drv(struct iwl_priv *priv) ...@@ -874,6 +874,7 @@ int iwl_init_drv(struct iwl_priv *priv)
/* Choose which receivers/antennas to use */ /* Choose which receivers/antennas to use */
iwl_set_rxon_chain(priv); iwl_set_rxon_chain(priv);
iwl_init_scan_params(priv);
if (priv->cfg->mod_params->enable_qos) if (priv->cfg->mod_params->enable_qos)
priv->qos_data.qos_enable = 1; priv->qos_data.qos_enable = 1;
......
...@@ -267,6 +267,7 @@ static inline __le32 iwl_hw_set_rate_n_flags(u8 rate, u32 flags) ...@@ -267,6 +267,7 @@ static inline __le32 iwl_hw_set_rate_n_flags(u8 rate, u32 flags)
/******************************************************************************* /*******************************************************************************
* Scanning * Scanning
******************************************************************************/ ******************************************************************************/
void iwl_init_scan_params(struct iwl_priv *priv);
int iwl_scan_cancel(struct iwl_priv *priv); int iwl_scan_cancel(struct iwl_priv *priv);
int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms); int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms);
const char *iwl_escape_essid(const char *essid, u8 essid_len); const char *iwl_escape_essid(const char *essid, u8 essid_len);
......
...@@ -157,35 +157,11 @@ struct iwl4965_channel_tgh_info { ...@@ -157,35 +157,11 @@ struct iwl4965_channel_tgh_info {
s64 last_radar_time; s64 last_radar_time;
}; };
/* current Tx power values to use, one for each rate for each channel.
* requested power is limited by:
* -- regulatory EEPROM limits for this channel
* -- hardware capabilities (clip-powers)
* -- spectrum management
* -- user preference (e.g. iwconfig)
* when requested power is set, base power index must also be set. */
struct iwl4965_channel_power_info {
struct iwl4965_tx_power tpc; /* actual radio and DSP gain settings */
s8 power_table_index; /* actual (compenst'd) index into gain table */
s8 base_power_index; /* gain index for power at factory temp. */
s8 requested_power; /* power (dBm) requested for this chnl/rate */
};
/* current scan Tx power values to use, one for each scan rate for each
* channel. */
struct iwl4965_scan_power_info {
struct iwl4965_tx_power tpc; /* actual radio and DSP gain settings */
s8 power_table_index; /* actual (compenst'd) index into gain table */
s8 requested_power; /* scan pwr (dBm) requested for chnl/rate */
};
/* /*
* One for each channel, holds all channel setup data * One for each channel, holds all channel setup data
* Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant * Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant
* with one another! * with one another!
*/ */
#define IWL4965_MAX_RATE (33)
struct iwl_channel_info { struct iwl_channel_info {
struct iwl4965_channel_tgd_info tgd; struct iwl4965_channel_tgd_info tgd;
struct iwl4965_channel_tgh_info tgh; struct iwl4965_channel_tgh_info tgh;
...@@ -204,11 +180,6 @@ struct iwl_channel_info { ...@@ -204,11 +180,6 @@ struct iwl_channel_info {
u8 band_index; /* 0-4, maps channel to band1/2/3/4/5 */ u8 band_index; /* 0-4, maps channel to band1/2/3/4/5 */
enum ieee80211_band band; enum ieee80211_band band;
/* Radio/DSP gain settings for each "normal" data Tx rate.
* These include, in addition to RF and DSP gain, a few fields for
* remembering/modifying gain settings (indexes). */
struct iwl4965_channel_power_info power_info[IWL4965_MAX_RATE];
/* FAT channel info */ /* FAT channel info */
s8 fat_max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */ s8 fat_max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */
s8 fat_curr_txpow; /* (dBm) regulatory/spectrum/user (not h/w) */ s8 fat_curr_txpow; /* (dBm) regulatory/spectrum/user (not h/w) */
...@@ -216,9 +187,6 @@ struct iwl_channel_info { ...@@ -216,9 +187,6 @@ struct iwl_channel_info {
s8 fat_scan_power; /* (dBm) eeprom, direct scans, any rate */ s8 fat_scan_power; /* (dBm) eeprom, direct scans, any rate */
u8 fat_flags; /* flags copied from EEPROM */ u8 fat_flags; /* flags copied from EEPROM */
u8 fat_extension_channel; /* HT_IE_EXT_CHANNEL_* */ u8 fat_extension_channel; /* HT_IE_EXT_CHANNEL_* */
/* Radio/DSP gain settings for each scan rate, for directed scans. */
struct iwl4965_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES];
}; };
struct iwl4965_clip_group { struct iwl4965_clip_group {
...@@ -974,6 +942,7 @@ struct iwl_priv { ...@@ -974,6 +942,7 @@ struct iwl_priv {
u8 direct_ssid_len; u8 direct_ssid_len;
u8 direct_ssid[IW_ESSID_MAX_SIZE]; u8 direct_ssid[IW_ESSID_MAX_SIZE];
struct iwl_scan_cmd *scan; struct iwl_scan_cmd *scan;
u32 scan_tx_ant[IEEE80211_NUM_BANDS];
/* spinlock */ /* spinlock */
spinlock_t lock; /* protect general shared data */ spinlock_t lock; /* protect general shared data */
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment