aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-4965.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-11-07 12:58:40 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-11-21 11:07:23 -0500
commit4ddbb7d060061e584cb2137f4c7e41e502a560b4 (patch)
treecb6a78a622df2660411786e73c2bbd33b187d173 /drivers/net/wireless/iwlwifi/iwl-4965.c
parent8d86422a83d79e3d3241cf0f269fca0c2640bcee (diff)
iwlwifi: revamp tx scheduler byte count tables handling
This moves byte count tables to tx domain removing completely ambivalent shared data. Changes handling of allocation byte count tables and keep warm consistent memory Moves general tx scheduler definitions from iwl-4956-hw.h to iwl-fh.h Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c35
1 files changed, 6 insertions, 29 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 017e5ea58de6..c43cf2f072cd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -715,8 +715,7 @@ static int iwl4965_alive_notify(struct iwl_priv *priv)
715 715
716 /* Tel 4965 where to find Tx byte count tables */ 716 /* Tel 4965 where to find Tx byte count tables */
717 iwl_write_prph(priv, IWL49_SCD_DRAM_BASE_ADDR, 717 iwl_write_prph(priv, IWL49_SCD_DRAM_BASE_ADDR,
718 (priv->shared_phys + 718 priv->scd_bc_tbls.dma >> 10);
719 offsetof(struct iwl4965_shared, queues_bc_tbls)) >> 10);
720 719
721 /* Disable chain mode for all queues */ 720 /* Disable chain mode for all queues */
722 iwl_write_prph(priv, IWL49_SCD_QUEUECHAIN_SEL, 0); 721 iwl_write_prph(priv, IWL49_SCD_QUEUECHAIN_SEL, 0);
@@ -804,6 +803,8 @@ static int iwl4965_hw_set_hw_params(struct iwl_priv *priv)
804 } 803 }
805 804
806 priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues; 805 priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues;
806 priv->hw_params.scd_bc_tbls_size =
807 IWL49_NUM_QUEUES * sizeof(struct iwl4965_scd_bc_tbl);
807 priv->hw_params.max_stations = IWL4965_STATION_COUNT; 808 priv->hw_params.max_stations = IWL4965_STATION_COUNT;
808 priv->hw_params.bcast_sta_id = IWL4965_BROADCAST_ID; 809 priv->hw_params.bcast_sta_id = IWL4965_BROADCAST_ID;
809 priv->hw_params.max_data_size = IWL49_RTC_DATA_SIZE; 810 priv->hw_params.max_data_size = IWL49_RTC_DATA_SIZE;
@@ -1631,28 +1632,6 @@ static int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel)
1631} 1632}
1632#endif 1633#endif
1633 1634
1634static int iwl4965_alloc_shared_mem(struct iwl_priv *priv)
1635{
1636 priv->shared_virt = pci_alloc_consistent(priv->pci_dev,
1637 sizeof(struct iwl4965_shared),
1638 &priv->shared_phys);
1639 if (!priv->shared_virt)
1640 return -ENOMEM;
1641
1642 memset(priv->shared_virt, 0, sizeof(struct iwl4965_shared));
1643
1644 return 0;
1645}
1646
1647static void iwl4965_free_shared_mem(struct iwl_priv *priv)
1648{
1649 if (priv->shared_virt)
1650 pci_free_consistent(priv->pci_dev,
1651 sizeof(struct iwl4965_shared),
1652 priv->shared_virt,
1653 priv->shared_phys);
1654}
1655
1656/** 1635/**
1657 * iwl4965_txq_update_byte_cnt_tbl - Set up entry in Tx byte-count array 1636 * iwl4965_txq_update_byte_cnt_tbl - Set up entry in Tx byte-count array
1658 */ 1637 */
@@ -1660,7 +1639,7 @@ static void iwl4965_txq_update_byte_cnt_tbl(struct iwl_priv *priv,
1660 struct iwl_tx_queue *txq, 1639 struct iwl_tx_queue *txq,
1661 u16 byte_cnt) 1640 u16 byte_cnt)
1662{ 1641{
1663 struct iwl4965_shared *shared_data = priv->shared_virt; 1642 struct iwl4965_scd_bc_tbl *scd_bc_tbl = priv->scd_bc_tbls.addr;
1664 int txq_id = txq->q.id; 1643 int txq_id = txq->q.id;
1665 int write_ptr = txq->q.write_ptr; 1644 int write_ptr = txq->q.write_ptr;
1666 int len = byte_cnt + IWL_TX_CRC_SIZE + IWL_TX_DELIMITER_SIZE; 1645 int len = byte_cnt + IWL_TX_CRC_SIZE + IWL_TX_DELIMITER_SIZE;
@@ -1670,11 +1649,11 @@ static void iwl4965_txq_update_byte_cnt_tbl(struct iwl_priv *priv,
1670 1649
1671 bc_ent = cpu_to_le16(len & 0xFFF); 1650 bc_ent = cpu_to_le16(len & 0xFFF);
1672 /* Set up byte count within first 256 entries */ 1651 /* Set up byte count within first 256 entries */
1673 shared_data->queues_bc_tbls[txq_id].tfd_offset[write_ptr] = bc_ent; 1652 scd_bc_tbl[txq_id].tfd_offset[write_ptr] = bc_ent;
1674 1653
1675 /* If within first 64 entries, duplicate at end */ 1654 /* If within first 64 entries, duplicate at end */
1676 if (write_ptr < TFD_QUEUE_SIZE_BC_DUP) 1655 if (write_ptr < TFD_QUEUE_SIZE_BC_DUP)
1677 shared_data->queues_bc_tbls[txq_id]. 1656 scd_bc_tbl[txq_id].
1678 tfd_offset[TFD_QUEUE_SIZE_MAX + write_ptr] = bc_ent; 1657 tfd_offset[TFD_QUEUE_SIZE_MAX + write_ptr] = bc_ent;
1679} 1658}
1680 1659
@@ -2296,8 +2275,6 @@ static struct iwl_hcmd_utils_ops iwl4965_hcmd_utils = {
2296 2275
2297static struct iwl_lib_ops iwl4965_lib = { 2276static struct iwl_lib_ops iwl4965_lib = {
2298 .set_hw_params = iwl4965_hw_set_hw_params, 2277 .set_hw_params = iwl4965_hw_set_hw_params,
2299 .alloc_shared_mem = iwl4965_alloc_shared_mem,
2300 .free_shared_mem = iwl4965_free_shared_mem,
2301 .txq_update_byte_cnt_tbl = iwl4965_txq_update_byte_cnt_tbl, 2278 .txq_update_byte_cnt_tbl = iwl4965_txq_update_byte_cnt_tbl,
2302 .txq_set_sched = iwl4965_txq_set_sched, 2279 .txq_set_sched = iwl4965_txq_set_sched,
2303 .txq_agg_enable = iwl4965_txq_agg_enable, 2280 .txq_agg_enable = iwl4965_txq_agg_enable,