Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134005
b: refs/heads/master
c: d20b3c6
h: refs/heads/master
i:
  134003: c879837
v: v3
  • Loading branch information
Samuel Ortiz authored and John W. Linville committed Jan 29, 2009
1 parent 9925191 commit e134f66
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 210 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1125eff3ae26b2e39c6bf940b5e0b8774ebd2896
refs/heads/master: d20b3c65f2a3e18ea86542e6ca4fe1c6d16c91df
3 changes: 0 additions & 3 deletions trunk/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,6 @@ struct iwl3945_eeprom {
#define TFD_TX_CMD_SLOTS 256
#define TFD_CMD_SLOTS 32

#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl3945_cmd) - \
sizeof(struct iwl3945_cmd_meta))

/*
* RX related structures and functions
*/
Expand Down
20 changes: 10 additions & 10 deletions trunk/drivers/net/wireless/iwlwifi/iwl-3945.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ static void iwl3945_tx_queue_reclaim(struct iwl3945_priv *priv,
int txq_id, int index)
{
struct iwl3945_tx_queue *txq = &priv->txq[txq_id];
struct iwl3945_queue *q = &txq->q;
struct iwl_queue *q = &txq->q;
struct iwl3945_tx_info *tx_info;

BUG_ON(txq_id == IWL_CMD_QUEUE_NUM);
Expand All @@ -320,7 +320,7 @@ static void iwl3945_tx_queue_reclaim(struct iwl3945_priv *priv,
iwl3945_hw_txq_free_tfd(priv, txq);
}

if (iwl3945_queue_space(q) > q->low_mark && (txq_id >= 0) &&
if (iwl_queue_space(q) > q->low_mark && (txq_id >= 0) &&
(txq_id != IWL_CMD_QUEUE_NUM) &&
priv->mac80211_registered)
ieee80211_wake_queue(priv->hw, txq_id);
Expand Down Expand Up @@ -1618,7 +1618,7 @@ static inline u8 iwl3945_hw_reg_fix_power_index(int index)
*/
static void iwl3945_hw_reg_set_scan_power(struct iwl3945_priv *priv, u32 scan_tbl_index,
s32 rate_index, const s8 *clip_pwrs,
struct iwl3945_channel_info *ch_info,
struct iwl_channel_info *ch_info,
int band_index)
{
struct iwl3945_scan_power_info *scan_power_info;
Expand Down Expand Up @@ -1675,7 +1675,7 @@ static void iwl3945_hw_reg_set_scan_power(struct iwl3945_priv *priv, u32 scan_tb
int iwl3945_hw_reg_send_txpower(struct iwl3945_priv *priv)
{
int rate_idx, i;
const struct iwl3945_channel_info *ch_info = NULL;
const struct iwl_channel_info *ch_info = NULL;
struct iwl3945_txpowertable_cmd txpower = {
.channel = priv->active_rxon.channel,
};
Expand Down Expand Up @@ -1748,7 +1748,7 @@ int iwl3945_hw_reg_send_txpower(struct iwl3945_priv *priv)
* and send changes to NIC
*/
static int iwl3945_hw_reg_set_new_power(struct iwl3945_priv *priv,
struct iwl3945_channel_info *ch_info)
struct iwl_channel_info *ch_info)
{
struct iwl3945_channel_power_info *power_info;
int power_changed = 0;
Expand Down Expand Up @@ -1810,7 +1810,7 @@ static int iwl3945_hw_reg_set_new_power(struct iwl3945_priv *priv,
* based strictly on regulatory (eeprom and spectrum mgt) limitations
* (no consideration for h/w clipping limitations).
*/
static int iwl3945_hw_reg_get_ch_txpower_limit(struct iwl3945_channel_info *ch_info)
static int iwl3945_hw_reg_get_ch_txpower_limit(struct iwl_channel_info *ch_info)
{
s8 max_power;

Expand Down Expand Up @@ -1840,7 +1840,7 @@ static int iwl3945_hw_reg_get_ch_txpower_limit(struct iwl3945_channel_info *ch_i
*/
static int iwl3945_hw_reg_comp_txpower_temp(struct iwl3945_priv *priv)
{
struct iwl3945_channel_info *ch_info = NULL;
struct iwl_channel_info *ch_info = NULL;
int delta_index;
const s8 *clip_pwrs; /* array of h/w max power levels for each rate */
u8 a_band;
Expand Down Expand Up @@ -1901,7 +1901,7 @@ static int iwl3945_hw_reg_comp_txpower_temp(struct iwl3945_priv *priv)

int iwl3945_hw_reg_set_txpower(struct iwl3945_priv *priv, s8 power)
{
struct iwl3945_channel_info *ch_info;
struct iwl_channel_info *ch_info;
s8 max_power;
u8 a_band;
u8 i;
Expand Down Expand Up @@ -1999,7 +1999,7 @@ static void iwl3945_bg_reg_txpower_periodic(struct work_struct *work)
* channel in each group 1-4. Group 5 All B/G channels are in group 0.
*/
static u16 iwl3945_hw_reg_get_ch_grp_index(struct iwl3945_priv *priv,
const struct iwl3945_channel_info *ch_info)
const struct iwl_channel_info *ch_info)
{
struct iwl3945_eeprom_txpower_group *ch_grp = &priv->eeprom.groups[0];
u8 group;
Expand Down Expand Up @@ -2162,7 +2162,7 @@ static void iwl3945_hw_reg_init_channel_groups(struct iwl3945_priv *priv)
*/
int iwl3945_txpower_set_from_eeprom(struct iwl3945_priv *priv)
{
struct iwl3945_channel_info *ch_info = NULL;
struct iwl_channel_info *ch_info = NULL;
struct iwl3945_channel_power_info *pwr_info;
int delta_index;
u8 rate_index;
Expand Down
155 changes: 6 additions & 149 deletions trunk/drivers/net/wireless/iwlwifi/iwl-3945.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ extern struct pci_device_id iwl3945_hw_card_ids[];
#include "iwl-3945-hw.h"
#include "iwl-debug.h"
#include "iwl-power.h"
#include "iwl-dev.h"
#include "iwl-3945-led.h"

/* Highest firmware API version supported */
Expand Down Expand Up @@ -111,26 +112,7 @@ struct iwl3945_rx_mem_buffer {
struct list_head list;
};

/*
* Generic queue structure
*
* Contains common data for Rx and Tx queues
*/
struct iwl3945_queue {
int n_bd; /* number of BDs in this queue */
int write_ptr; /* 1-st empty entry (index) host_w*/
int read_ptr; /* last used entry (index) host_r*/
dma_addr_t dma_addr; /* physical addr for BD's */
int n_window; /* safe queue window */
u32 id;
int low_mark; /* low watermark, resume queue if free
* space more than this */
int high_mark; /* high watermark, stop queue if free
* space less than this */
} __attribute__ ((packed));

int iwl3945_queue_space(const struct iwl3945_queue *q);
int iwl3945_x2_queue_used(const struct iwl3945_queue *q, int i);
int iwl3945_x2_queue_used(const struct iwl_queue *q, int i);

#define MAX_NUM_OF_TBS (20)

Expand All @@ -152,7 +134,7 @@ struct iwl3945_tx_info {
* descriptors) and required locking structures.
*/
struct iwl3945_tx_queue {
struct iwl3945_queue q;
struct iwl_queue q;
struct iwl3945_tfd_frame *bd;
struct iwl3945_cmd *cmd;
dma_addr_t dma_addr_cmd;
Expand All @@ -161,73 +143,6 @@ struct iwl3945_tx_queue {
int active;
};

#define IWL_NUM_SCAN_RATES (2)

struct iwl3945_channel_tgd_info {
u8 type;
s8 max_power;
};

struct iwl3945_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 iwl3945_channel_power_info {
struct iwl3945_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 iwl3945_scan_power_info {
struct iwl3945_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 iwl3945_channel_info {
struct iwl3945_channel_tgd_info tgd;
struct iwl3945_channel_tgh_info tgh;
struct iwl_eeprom_channel eeprom; /* EEPROM regulatory limit */
struct iwl_eeprom_channel fat_eeprom; /* EEPROM regulatory limit for
* FAT channel */

u8 channel; /* channel number */
u8 flags; /* flags copied from EEPROM */
s8 max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */
s8 curr_txpow; /* (dBm) regulatory/spectrum/user (not h/w) */
s8 min_power; /* always 0 */
s8 scan_power; /* (dBm) regul. eeprom, direct scans, any rate */

u8 group_index; /* 0-4, maps channel to group1/2/3/4/5 */
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 iwl3945_channel_power_info power_info[IWL4965_MAX_RATE];

/* Radio/DSP gain settings for each scan rate, for directed scans. */
struct iwl3945_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES];
};

struct iwl3945_clip_group {
/* maximum power level to prevent clipping for each rate, derived by
* us from this band's saturation power in EEPROM */
Expand Down Expand Up @@ -266,15 +181,6 @@ struct iwl3945_frame {
#define SN_TO_SEQ(ssn) (((ssn) << 4) & IEEE80211_SCTL_SEQ)
#define MAX_SN ((IEEE80211_SCTL_SEQ) >> 4)

enum {
/* CMD_SIZE_NORMAL = 0, */
CMD_SIZE_HUGE = (1 << 0),
/* CMD_SYNC = 0, */
CMD_ASYNC = (1 << 1),
/* CMD_NO_SKB = 0, */
CMD_WANT_SKB = (1 << 2),
};

struct iwl3945_cmd;
struct iwl3945_priv;

Expand Down Expand Up @@ -328,7 +234,7 @@ struct iwl3945_host_cmd {
const void *data;
};

#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl3945_cmd) - \
#define TFD39_MAX_PAYLOAD_SIZE (sizeof(struct iwl3945_cmd) - \
sizeof(struct iwl3945_cmd_meta))

/*
Expand Down Expand Up @@ -453,13 +359,6 @@ struct iwl3945_station_entry {
struct iwl3945_hw_key keyinfo;
};

/* one for each uCode image (inst/data, boot/init/runtime) */
struct fw_desc {
void *v_addr; /* access by driver */
dma_addr_t p_addr; /* access by card's busmaster DMA */
u32 len; /* bytes */
};

/* uCode file layout */
struct iwl3945_ucode {
__le32 ver; /* major/minor/API/serial */
Expand Down Expand Up @@ -629,16 +528,6 @@ extern int iwl3945_txpower_set_from_eeprom(struct iwl3945_priv *priv);
extern u8 iwl3945_sync_sta(struct iwl3945_priv *priv, int sta_id,
u16 tx_rate, u8 flags);


#ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT

enum {
MEASUREMENT_READY = (1 << 0),
MEASUREMENT_ACTIVE = (1 << 1),
};

#endif

#ifdef CONFIG_IWL3945_RFKILL
struct iwl3945_priv;

Expand Down Expand Up @@ -682,7 +571,7 @@ struct iwl3945_priv {

/* we allocate array of iwl3945_channel_info for NIC's valid channels.
* Access via channel # using indirect index array */
struct iwl3945_channel_info *channel_info; /* channel info array */
struct iwl_channel_info *channel_info; /* channel info array */
u8 channel_count; /* # of channels */

/* each calibration channel group in the EEPROM has a derived
Expand Down Expand Up @@ -873,39 +762,7 @@ static inline int iwl3945_is_associated(struct iwl3945_priv *priv)
return (priv->active_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0;
}

static inline int is_channel_valid(const struct iwl3945_channel_info *ch_info)
{
if (ch_info == NULL)
return 0;
return (ch_info->flags & EEPROM_CHANNEL_VALID) ? 1 : 0;
}

static inline int is_channel_radar(const struct iwl3945_channel_info *ch_info)
{
return (ch_info->flags & EEPROM_CHANNEL_RADAR) ? 1 : 0;
}

static inline u8 is_channel_a_band(const struct iwl3945_channel_info *ch_info)
{
return ch_info->band == IEEE80211_BAND_5GHZ;
}

static inline u8 is_channel_bg_band(const struct iwl3945_channel_info *ch_info)
{
return ch_info->band == IEEE80211_BAND_2GHZ;
}

static inline int is_channel_passive(const struct iwl3945_channel_info *ch)
{
return (!(ch->flags & EEPROM_CHANNEL_ACTIVE)) ? 1 : 0;
}

static inline int is_channel_ibss(const struct iwl3945_channel_info *ch)
{
return ((ch->flags & EEPROM_CHANNEL_IBSS)) ? 1 : 0;
}

extern const struct iwl3945_channel_info *iwl3945_get_channel_info(
extern const struct iwl_channel_info *iwl3945_get_channel_info(
const struct iwl3945_priv *priv, enum ieee80211_band band, u16 channel);

extern int iwl3945_rs_next_rate(struct iwl3945_priv *priv, int rate);
Expand Down
33 changes: 33 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "iwl-rfkill.h"
#include "iwl-eeprom.h"
#include "iwl-4965-hw.h"
#include "iwl-3945-hw.h"
#include "iwl-csr.h"
#include "iwl-prph.h"
#include "iwl-debug.h"
Expand Down Expand Up @@ -153,6 +154,30 @@ struct iwl4965_channel_tgh_info {
s64 last_radar_time;
};

#define IWL4965_MAX_RATE (33)

/* 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 iwl3945_channel_power_info {
struct iwl3945_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 iwl3945_scan_power_info {
struct iwl3945_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
Expand Down Expand Up @@ -183,6 +208,14 @@ struct iwl_channel_info {
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 "normal" data Tx rate.
* These include, in addition to RF and DSP gain, a few fields for
* remembering/modifying gain settings (indexes). */
struct iwl3945_channel_power_info power_info[IWL4965_MAX_RATE];

/* Radio/DSP gain settings for each scan rate, for directed scans. */
struct iwl3945_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES];
};


Expand Down
Loading

0 comments on commit e134f66

Please sign in to comment.