aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-3945.c
diff options
context:
space:
mode:
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>2008-12-18 21:37:26 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 15:59:10 -0500
commit3832ec9dc919a0994d713390eb4fb3c7e7500b94 (patch)
tree5b14d0886766d15626c47b5e63a577a046a7fdb4 /drivers/net/wireless/iwlwifi/iwl-3945.c
parentcc2f362c360af35b74530f3c896511b8dbd0264c (diff)
iwl3945: use iwl_hw_params in iwl3945_priv
The patch makes changed necessary to use iwl_hw_params to replace iwl3945_driver_hw_info. Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-3945.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 82b2023c6ad0..b5b23b1ad240 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -804,10 +804,10 @@ u8 iwl3945_hw_find_station(struct iwl3945_priv *priv, const u8 *addr)
804 start = IWL_STA_ID; 804 start = IWL_STA_ID;
805 805
806 if (is_broadcast_ether_addr(addr)) 806 if (is_broadcast_ether_addr(addr))
807 return priv->hw_setting.bcast_sta_id; 807 return priv->hw_params.bcast_sta_id;
808 808
809 spin_lock_irqsave(&priv->sta_lock, flags); 809 spin_lock_irqsave(&priv->sta_lock, flags);
810 for (i = start; i < priv->hw_setting.max_stations; i++) 810 for (i = start; i < priv->hw_params.max_stations; i++)
811 if ((priv->stations[i].used) && 811 if ((priv->stations[i].used) &&
812 (!compare_ether_addr 812 (!compare_ether_addr
813 (priv->stations[i].sta.sta.addr, addr))) { 813 (priv->stations[i].sta.sta.addr, addr))) {
@@ -975,7 +975,7 @@ static int iwl3945_rx_init(struct iwl3945_priv *priv, struct iwl_rx_queue *rxq)
975 975
976 iwl3945_write_direct32(priv, FH39_RCSR_RBD_BASE(0), rxq->dma_addr); 976 iwl3945_write_direct32(priv, FH39_RCSR_RBD_BASE(0), rxq->dma_addr);
977 iwl3945_write_direct32(priv, FH39_RCSR_RPTR_ADDR(0), 977 iwl3945_write_direct32(priv, FH39_RCSR_RPTR_ADDR(0),
978 priv->hw_setting.shared_phys + 978 priv->shared_phys +
979 offsetof(struct iwl3945_shared, rx_read_ptr[0])); 979 offsetof(struct iwl3945_shared, rx_read_ptr[0]));
980 iwl3945_write_direct32(priv, FH39_RCSR_WPTR(0), 0); 980 iwl3945_write_direct32(priv, FH39_RCSR_WPTR(0), 0);
981 iwl3945_write_direct32(priv, FH39_RCSR_CONFIG(0), 981 iwl3945_write_direct32(priv, FH39_RCSR_CONFIG(0),
@@ -1024,7 +1024,7 @@ static int iwl3945_tx_reset(struct iwl3945_priv *priv)
1024 iwl3945_write_prph(priv, ALM_SCD_TXF5MF_REG, 0x000005); 1024 iwl3945_write_prph(priv, ALM_SCD_TXF5MF_REG, 0x000005);
1025 1025
1026 iwl3945_write_direct32(priv, FH39_TSSR_CBB_BASE, 1026 iwl3945_write_direct32(priv, FH39_TSSR_CBB_BASE,
1027 priv->hw_setting.shared_phys); 1027 priv->shared_phys);
1028 1028
1029 iwl3945_write_direct32(priv, FH39_TSSR_MSG_CONFIG, 1029 iwl3945_write_direct32(priv, FH39_TSSR_MSG_CONFIG,
1030 FH39_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TXPD_ON | 1030 FH39_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TXPD_ON |
@@ -2314,7 +2314,7 @@ int iwl3945_hw_tx_queue_init(struct iwl3945_priv *priv, struct iwl3945_tx_queue
2314 unsigned long flags; 2314 unsigned long flags;
2315 int txq_id = txq->q.id; 2315 int txq_id = txq->q.id;
2316 2316
2317 struct iwl3945_shared *shared_data = priv->hw_setting.shared_virt; 2317 struct iwl3945_shared *shared_data = priv->shared_virt;
2318 2318
2319 shared_data->tx_base_ptr[txq_id] = cpu_to_le32((u32)txq->q.dma_addr); 2319 shared_data->tx_base_ptr[txq_id] = cpu_to_le32((u32)txq->q.dma_addr);
2320 2320
@@ -2344,7 +2344,7 @@ int iwl3945_hw_tx_queue_init(struct iwl3945_priv *priv, struct iwl3945_tx_queue
2344 2344
2345int iwl3945_hw_get_rx_read(struct iwl3945_priv *priv) 2345int iwl3945_hw_get_rx_read(struct iwl3945_priv *priv)
2346{ 2346{
2347 struct iwl3945_shared *shared_data = priv->hw_setting.shared_virt; 2347 struct iwl3945_shared *shared_data = priv->shared_virt;
2348 2348
2349 return le32_to_cpu(shared_data->rx_read_ptr[0]); 2349 return le32_to_cpu(shared_data->rx_read_ptr[0]);
2350} 2350}
@@ -2429,31 +2429,30 @@ int iwl3945_init_hw_rate_table(struct iwl3945_priv *priv)
2429} 2429}
2430 2430
2431/* Called when initializing driver */ 2431/* Called when initializing driver */
2432int iwl3945_hw_set_hw_setting(struct iwl3945_priv *priv) 2432int iwl3945_hw_set_hw_params(struct iwl3945_priv *priv)
2433{ 2433{
2434 memset((void *)&priv->hw_setting, 0, 2434 memset((void *)&priv->hw_params, 0,
2435 sizeof(struct iwl3945_driver_hw_info)); 2435 sizeof(struct iwl_hw_params));
2436 2436
2437 priv->hw_setting.shared_virt = 2437 priv->shared_virt =
2438 pci_alloc_consistent(priv->pci_dev, 2438 pci_alloc_consistent(priv->pci_dev,
2439 sizeof(struct iwl3945_shared), 2439 sizeof(struct iwl3945_shared),
2440 &priv->hw_setting.shared_phys); 2440 &priv->shared_phys);
2441 2441
2442 if (!priv->hw_setting.shared_virt) { 2442 if (!priv->shared_virt) {
2443 IWL_ERROR("failed to allocate pci memory\n"); 2443 IWL_ERROR("failed to allocate pci memory\n");
2444 mutex_unlock(&priv->mutex); 2444 mutex_unlock(&priv->mutex);
2445 return -ENOMEM; 2445 return -ENOMEM;
2446 } 2446 }
2447 2447
2448 priv->hw_setting.rx_buf_size = IWL_RX_BUF_SIZE; 2448 priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE;
2449 priv->hw_setting.max_pkt_size = 2342; 2449 priv->hw_params.max_pkt_size = 2342;
2450 priv->hw_setting.tx_cmd_len = sizeof(struct iwl3945_tx_cmd); 2450 priv->hw_params.max_rxq_size = RX_QUEUE_SIZE;
2451 priv->hw_setting.max_rxq_size = RX_QUEUE_SIZE; 2451 priv->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG;
2452 priv->hw_setting.max_rxq_log = RX_QUEUE_SIZE_LOG; 2452 priv->hw_params.max_stations = IWL3945_STATION_COUNT;
2453 priv->hw_setting.max_stations = IWL3945_STATION_COUNT; 2453 priv->hw_params.bcast_sta_id = IWL3945_BROADCAST_ID;
2454 priv->hw_setting.bcast_sta_id = IWL3945_BROADCAST_ID;
2455 2454
2456 priv->hw_setting.tx_ant_num = 2; 2455 priv->hw_params.tx_ant_num = 2;
2457 return 0; 2456 return 0;
2458} 2457}
2459 2458
@@ -2466,7 +2465,7 @@ unsigned int iwl3945_hw_get_beacon_cmd(struct iwl3945_priv *priv,
2466 tx_beacon_cmd = (struct iwl3945_tx_beacon_cmd *)&frame->u; 2465 tx_beacon_cmd = (struct iwl3945_tx_beacon_cmd *)&frame->u;
2467 memset(tx_beacon_cmd, 0, sizeof(*tx_beacon_cmd)); 2466 memset(tx_beacon_cmd, 0, sizeof(*tx_beacon_cmd));
2468 2467
2469 tx_beacon_cmd->tx.sta_id = priv->hw_setting.bcast_sta_id; 2468 tx_beacon_cmd->tx.sta_id = priv->hw_params.bcast_sta_id;
2470 tx_beacon_cmd->tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; 2469 tx_beacon_cmd->tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;
2471 2470
2472 frame_size = iwl3945_fill_beacon_frame(priv, 2471 frame_size = iwl3945_fill_beacon_frame(priv,