Skip to content

Commit

Permalink
iwlwifi: cleans up scanning code
Browse files Browse the repository at this point in the history
This patch
1. cleans up scanning code.
2. It adds round robin of TX antannas/chains.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Tomas Winkler authored and John W. Linville committed Jun 14, 2008
1 parent e7d326a commit f53696d
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 120 deletions.
14 changes: 3 additions & 11 deletions drivers/net/wireless/iwlwifi/iwl-commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,16 +281,7 @@ struct iwl_cmd_header {
#define RATE_MCS_ANT_C_MSK 0x10000
#define RATE_MCS_ANT_ABC_MSK 0x1C000


/**
* 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 RATE_MCS_ANT_INIT_IND 1

#define POWER_TABLE_NUM_ENTRIES 33
#define POWER_TABLE_NUM_HT_OFDM_ENTRIES 32
Expand Down Expand Up @@ -2128,7 +2119,8 @@ struct iwl_scan_channel {
*/
u8 type;
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 passive_dwell; /* in 1024-uSec TU (time units), typ 20-500 */
} __attribute__ ((packed));
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/iwlwifi/iwl-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,7 @@ int iwl_init_drv(struct iwl_priv *priv)

/* Choose which receivers/antennas to use */
iwl_set_rxon_chain(priv);
iwl_init_scan_params(priv);

if (priv->cfg->mod_params->enable_qos)
priv->qos_data.qos_enable = 1;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/iwlwifi/iwl-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ static inline __le32 iwl_hw_set_rate_n_flags(u8 rate, u32 flags)
/*******************************************************************************
* Scanning
******************************************************************************/
void iwl_init_scan_params(struct iwl_priv *priv);
int iwl_scan_cancel(struct iwl_priv *priv);
int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms);
const char *iwl_escape_essid(const char *essid, u8 essid_len);
Expand Down
33 changes: 1 addition & 32 deletions drivers/net/wireless/iwlwifi/iwl-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,35 +157,11 @@ struct iwl4965_channel_tgh_info {
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
* Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant
* with one another!
*/
#define IWL4965_MAX_RATE (33)

struct iwl_channel_info {
struct iwl4965_channel_tgd_info tgd;
struct iwl4965_channel_tgh_info tgh;
Expand All @@ -204,21 +180,13 @@ struct iwl_channel_info {
u8 band_index; /* 0-4, maps channel to band1/2/3/4/5 */
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 */
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_min_power; /* always 0 */
s8 fat_scan_power; /* (dBm) eeprom, direct scans, any rate */
u8 fat_flags; /* flags copied from EEPROM */
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 {
Expand Down Expand Up @@ -974,6 +942,7 @@ struct iwl_priv {
u8 direct_ssid_len;
u8 direct_ssid[IW_ESSID_MAX_SIZE];
struct iwl_scan_cmd *scan;
u32 scan_tx_ant[IEEE80211_NUM_BANDS];

/* spinlock */
spinlock_t lock; /* protect general shared data */
Expand Down
Loading

0 comments on commit f53696d

Please sign in to comment.