Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90823
b: refs/heads/master
c: 059ff82
h: refs/heads/master
i:
  90821: 8fa7f20
  90819: bbe2ed0
  90815: fe95b0e
v: v3
  • Loading branch information
Tomas Winkler authored and John W. Linville committed Apr 16, 2008
1 parent e7fb7dc commit 6b01b1c
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 45 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: 508e32e177f54d1f6ebcfa181b9d6f2583c3b1c0
refs/heads/master: 059ff8266104d4919c693d6bf974c9e350da513e
12 changes: 6 additions & 6 deletions trunk/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -1554,29 +1554,29 @@ struct iwl4965_sched_queue_byte_cnt_tbl {
struct iwl4965_shared {
struct iwl4965_sched_queue_byte_cnt_tbl
queues_byte_cnt_tbls[IWL_MAX_NUM_QUEUES];
__le32 val0;
__le32 rb_closed;

/* __le32 rb_closed_stts_rb_num:12; */
#define IWL_rb_closed_stts_rb_num_POS 0
#define IWL_rb_closed_stts_rb_num_LEN 12
#define IWL_rb_closed_stts_rb_num_SYM val0
#define IWL_rb_closed_stts_rb_num_SYM rb_closed
/* __le32 rsrv1:4; */
/* __le32 rb_closed_stts_rx_frame_num:12; */
#define IWL_rb_closed_stts_rx_frame_num_POS 16
#define IWL_rb_closed_stts_rx_frame_num_LEN 12
#define IWL_rb_closed_stts_rx_frame_num_SYM val0
#define IWL_rb_closed_stts_rx_frame_num_SYM rb_closed
/* __le32 rsrv2:4; */

__le32 val1;
__le32 frm_finished;
/* __le32 frame_finished_stts_rb_num:12; */
#define IWL_frame_finished_stts_rb_num_POS 0
#define IWL_frame_finished_stts_rb_num_LEN 12
#define IWL_frame_finished_stts_rb_num_SYM val1
#define IWL_frame_finished_stts_rb_num_SYM frm_finished
/* __le32 rsrv3:4; */
/* __le32 frame_finished_stts_rx_frame_num:12; */
#define IWL_frame_finished_stts_rx_frame_num_POS 16
#define IWL_frame_finished_stts_rx_frame_num_LEN 12
#define IWL_frame_finished_stts_rx_frame_num_SYM val1
#define IWL_frame_finished_stts_rx_frame_num_SYM frm_finished
/* __le32 rsrv4:4; */

__le32 padding1; /* so that allocation will be aligned to 16B */
Expand Down
55 changes: 25 additions & 30 deletions trunk/drivers/net/wireless/iwlwifi/iwl-4965.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,18 @@ static int iwl4965_init_drv(struct iwl_priv *priv)
spin_lock_init(&priv->hcmd_lock);
spin_lock_init(&priv->lq_mngr.lock);

priv->shared_virt = pci_alloc_consistent(priv->pci_dev,
sizeof(struct iwl4965_shared),
&priv->shared_phys);

if (!priv->shared_virt) {
ret = -ENOMEM;
goto err;
}

memset(priv->shared_virt, 0, sizeof(struct iwl4965_shared));


for (i = 0; i < IWL_IBSS_MAC_HASH_SIZE; i++)
INIT_LIST_HEAD(&priv->ibss_mac_hash[i]);

Expand Down Expand Up @@ -546,15 +558,15 @@ static int iwl4965_nic_set_pwr_src(struct iwl_priv *priv, int pwr_max)

static int iwl4965_rx_init(struct iwl_priv *priv, struct iwl4965_rx_queue *rxq)
{
int rc;
int ret;
unsigned long flags;
unsigned int rb_size;

spin_lock_irqsave(&priv->lock, flags);
rc = iwl_grab_nic_access(priv);
if (rc) {
ret = iwl_grab_nic_access(priv);
if (ret) {
spin_unlock_irqrestore(&priv->lock, flags);
return rc;
return ret;
}

if (priv->cfg->mod_params->amsdu_size_8K)
Expand All @@ -574,15 +586,15 @@ static int iwl4965_rx_init(struct iwl_priv *priv, struct iwl4965_rx_queue *rxq)

/* Tell device where in DRAM to update its Rx status */
iwl_write_direct32(priv, FH_RSCSR_CHNL0_STTS_WPTR_REG,
(priv->hw_setting.shared_phys +
offsetof(struct iwl4965_shared, val0)) >> 4);
(priv->shared_phys +
offsetof(struct iwl4965_shared, rb_closed)) >> 4);

/* Enable Rx DMA, enable host interrupt, Rx buffer size 4k, 256 RBDs */
iwl_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG,
FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL |
FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL |
rb_size |
/*0x10 << 4 | */
/* 0x10 << 4 | */
(RX_QUEUE_SIZE_LOG <<
FH_RCSR_RX_CONFIG_RBDCB_SIZE_BITSHIFT));

Expand Down Expand Up @@ -1966,7 +1978,7 @@ int iwl4965_alive_notify(struct iwl_priv *priv)

/* Tel 4965 where to find Tx byte count tables */
iwl_write_prph(priv, IWL49_SCD_DRAM_BASE_ADDR,
(priv->hw_setting.shared_phys +
(priv->shared_phys +
offsetof(struct iwl4965_shared, queues_byte_cnt_tbls)) >> 10);

/* Disable chain mode for all queues */
Expand Down Expand Up @@ -2024,29 +2036,14 @@ int iwl4965_alive_notify(struct iwl_priv *priv)
*/
int iwl4965_hw_set_hw_setting(struct iwl_priv *priv)
{
int ret = 0;

if ((priv->cfg->mod_params->num_of_queues > IWL_MAX_NUM_QUEUES) ||
(priv->cfg->mod_params->num_of_queues < IWL_MIN_NUM_QUEUES)) {
IWL_ERROR("invalid queues_num, should be between %d and %d\n",
IWL_MIN_NUM_QUEUES, IWL_MAX_NUM_QUEUES);
ret = -EINVAL;
goto out;
}

/* Allocate area for Tx byte count tables and Rx queue status */
priv->hw_setting.shared_virt =
pci_alloc_consistent(priv->pci_dev,
sizeof(struct iwl4965_shared),
&priv->hw_setting.shared_phys);

if (!priv->hw_setting.shared_virt) {
ret = -ENOMEM;
goto out;
return -EINVAL;
}

memset(priv->hw_setting.shared_virt, 0, sizeof(struct iwl4965_shared));

priv->hw_setting.max_txq_num = priv->cfg->mod_params->num_of_queues;
priv->hw_setting.tx_cmd_len = sizeof(struct iwl4965_tx_cmd);
priv->hw_setting.max_rxq_size = RX_QUEUE_SIZE;
Expand All @@ -2061,8 +2058,7 @@ int iwl4965_hw_set_hw_setting(struct iwl_priv *priv)

priv->hw_setting.tx_ant_num = 2;

out:
return ret;
return 0;
}

/**
Expand Down Expand Up @@ -3014,9 +3010,8 @@ void iwl4965_hw_build_tx_cmd_rate(struct iwl_priv *priv,

int iwl4965_hw_get_rx_read(struct iwl_priv *priv)
{
struct iwl4965_shared *shared_data = priv->hw_setting.shared_virt;

return IWL_GET_BITS(*shared_data, rb_closed_stts_rb_num);
struct iwl4965_shared *s = priv->shared_virt;
return le32_to_cpu(s->rb_closed) & 0xFFF;
}

int iwl4965_hw_get_temperature(struct iwl_priv *priv)
Expand Down Expand Up @@ -3149,7 +3144,7 @@ static void iwl4965_txq_update_byte_cnt_tbl(struct iwl_priv *priv,
{
int len;
int txq_id = txq->q.id;
struct iwl4965_shared *shared_data = priv->hw_setting.shared_virt;
struct iwl4965_shared *shared_data = priv->shared_virt;

len = byte_cnt + IWL_TX_CRC_SIZE + IWL_TX_DELIMITER_SIZE;

Expand Down
11 changes: 6 additions & 5 deletions trunk/drivers/net/wireless/iwlwifi/iwl-4965.h
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,6 @@ struct iwl4965_ibss_seq {
* @max_rxq_log: Log-base-2 of max_rxq_size
* @max_stations:
* @bcast_sta_id:
* @shared_virt: Pointer to driver/uCode shared Tx Byte Counts and Rx status
* @shared_phys: Physical Pointer to Tx Byte Counts and Rx status
*/
struct iwl4965_driver_hw_info {
u16 max_txq_num;
Expand All @@ -589,8 +587,6 @@ struct iwl4965_driver_hw_info {
u16 max_rxq_log;
u8 max_stations;
u8 bcast_sta_id;
void *shared_virt;
dma_addr_t shared_phys;
};

#define HT_SHORT_GI_20MHZ_ONLY (1 << 0)
Expand Down Expand Up @@ -1147,9 +1143,14 @@ struct iwl_priv {
/* Last Rx'd beacon timestamp */
u64 timestamp;
u16 beacon_int;
struct iwl4965_driver_hw_info hw_setting;
struct ieee80211_vif *vif;

struct iwl4965_driver_hw_info hw_setting;
/* driver/uCode shared Tx Byte Counts and Rx status */
void *shared_virt;
/* Physical Pointer to Tx Byte Counts and Rx status */
dma_addr_t shared_phys;

/* Current association information needed to configure the
* hardware */
u16 assoc_id;
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1219,11 +1219,11 @@ static int iwl4965_send_beacon_cmd(struct iwl_priv *priv)

static void iwl4965_unset_hw_setting(struct iwl_priv *priv)
{
if (priv->hw_setting.shared_virt)
if (priv->shared_virt)
pci_free_consistent(priv->pci_dev,
sizeof(struct iwl4965_shared),
priv->hw_setting.shared_virt,
priv->hw_setting.shared_phys);
priv->shared_virt,
priv->shared_phys);
}

/**
Expand Down

0 comments on commit 6b01b1c

Please sign in to comment.