aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2012-03-09 14:13:40 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-03-09 14:25:14 -0500
commit1745e4405b2c0da6db2ec4b6bc0ad930612d8295 (patch)
tree19b38b1378f009c3ed8fde8a1631e892b8794e15 /drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
parent9ba1947a89938ee83e7c16709ee4095ae3e36c44 (diff)
iwlwifi: fix the delta for remove max_txq_num patch
BIg portion of "iwlwifi: remove max_txq_num from hw_params" was missing during merge, here is the fix for it. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-trans-pcie.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
index a3ac6d814637..91628565409f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
@@ -497,7 +497,7 @@ static void iwl_trans_pcie_tx_free(struct iwl_trans *trans)
497 /* Tx queues */ 497 /* Tx queues */
498 if (trans_pcie->txq) { 498 if (trans_pcie->txq) {
499 for (txq_id = 0; 499 for (txq_id = 0;
500 txq_id < hw_params(trans).max_txq_num; txq_id++) 500 txq_id < cfg(trans)->base_params->num_of_queues; txq_id++)
501 iwl_tx_queue_free(trans, txq_id); 501 iwl_tx_queue_free(trans, txq_id);
502 } 502 }
503 503
@@ -522,7 +522,7 @@ static int iwl_trans_tx_alloc(struct iwl_trans *trans)
522 int txq_id, slots_num; 522 int txq_id, slots_num;
523 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); 523 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
524 524
525 u16 scd_bc_tbls_size = hw_params(trans).max_txq_num * 525 u16 scd_bc_tbls_size = cfg(trans)->base_params->num_of_queues *
526 sizeof(struct iwlagn_scd_bc_tbl); 526 sizeof(struct iwlagn_scd_bc_tbl);
527 527
528 /*It is not allowed to alloc twice, so warn when this happens. 528 /*It is not allowed to alloc twice, so warn when this happens.
@@ -546,7 +546,7 @@ static int iwl_trans_tx_alloc(struct iwl_trans *trans)
546 goto error; 546 goto error;
547 } 547 }
548 548
549 trans_pcie->txq = kcalloc(hw_params(trans).max_txq_num, 549 trans_pcie->txq = kcalloc(cfg(trans)->base_params->num_of_queues,
550 sizeof(struct iwl_tx_queue), GFP_KERNEL); 550 sizeof(struct iwl_tx_queue), GFP_KERNEL);
551 if (!trans_pcie->txq) { 551 if (!trans_pcie->txq) {
552 IWL_ERR(trans, "Not enough memory for txq\n"); 552 IWL_ERR(trans, "Not enough memory for txq\n");
@@ -555,7 +555,8 @@ static int iwl_trans_tx_alloc(struct iwl_trans *trans)
555 } 555 }
556 556
557 /* Alloc and init all Tx queues, including the command queue (#4/#9) */ 557 /* Alloc and init all Tx queues, including the command queue (#4/#9) */
558 for (txq_id = 0; txq_id < hw_params(trans).max_txq_num; txq_id++) { 558 for (txq_id = 0; txq_id < cfg(trans)->base_params->num_of_queues;
559 txq_id++) {
559 slots_num = (txq_id == trans_pcie->cmd_queue) ? 560 slots_num = (txq_id == trans_pcie->cmd_queue) ?
560 TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS; 561 TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS;
561 ret = iwl_trans_txq_alloc(trans, &trans_pcie->txq[txq_id], 562 ret = iwl_trans_txq_alloc(trans, &trans_pcie->txq[txq_id],
@@ -600,7 +601,8 @@ static int iwl_tx_init(struct iwl_trans *trans)
600 spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); 601 spin_unlock_irqrestore(&trans_pcie->irq_lock, flags);
601 602
602 /* Alloc and init all Tx queues, including the command queue (#4/#9) */ 603 /* Alloc and init all Tx queues, including the command queue (#4/#9) */
603 for (txq_id = 0; txq_id < hw_params(trans).max_txq_num; txq_id++) { 604 for (txq_id = 0; txq_id < cfg(trans)->base_params->num_of_queues;
605 txq_id++) {
604 slots_num = (txq_id == trans_pcie->cmd_queue) ? 606 slots_num = (txq_id == trans_pcie->cmd_queue) ?
605 TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS; 607 TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS;
606 ret = iwl_trans_txq_init(trans, &trans_pcie->txq[txq_id], 608 ret = iwl_trans_txq_init(trans, &trans_pcie->txq[txq_id],
@@ -1116,7 +1118,8 @@ static void iwl_tx_start(struct iwl_trans *trans)
1116 a += 4) 1118 a += 4)
1117 iwl_write_targ_mem(trans, a, 0); 1119 iwl_write_targ_mem(trans, a, 0);
1118 for (; a < trans_pcie->scd_base_addr + 1120 for (; a < trans_pcie->scd_base_addr +
1119 SCD_TRANS_TBL_OFFSET_QUEUE(hw_params(trans).max_txq_num); 1121 SCD_TRANS_TBL_OFFSET_QUEUE(
1122 cfg(trans)->base_params->num_of_queues);
1120 a += 4) 1123 a += 4)
1121 iwl_write_targ_mem(trans, a, 0); 1124 iwl_write_targ_mem(trans, a, 0);
1122 1125
@@ -1139,7 +1142,7 @@ static void iwl_tx_start(struct iwl_trans *trans)
1139 iwl_write_prph(trans, SCD_AGGR_SEL, 0); 1142 iwl_write_prph(trans, SCD_AGGR_SEL, 0);
1140 1143
1141 /* initiate the queues */ 1144 /* initiate the queues */
1142 for (i = 0; i < hw_params(trans).max_txq_num; i++) { 1145 for (i = 0; i < cfg(trans)->base_params->num_of_queues; i++) {
1143 iwl_write_prph(trans, SCD_QUEUE_RDPTR(i), 0); 1146 iwl_write_prph(trans, SCD_QUEUE_RDPTR(i), 0);
1144 iwl_write_direct32(trans, HBUS_TARG_WRPTR, 0 | (i << 8)); 1147 iwl_write_direct32(trans, HBUS_TARG_WRPTR, 0 | (i << 8));
1145 iwl_write_targ_mem(trans, trans_pcie->scd_base_addr + 1148 iwl_write_targ_mem(trans, trans_pcie->scd_base_addr +
@@ -1156,7 +1159,7 @@ static void iwl_tx_start(struct iwl_trans *trans)
1156 } 1159 }
1157 1160
1158 iwl_write_prph(trans, SCD_INTERRUPT_MASK, 1161 iwl_write_prph(trans, SCD_INTERRUPT_MASK,
1159 IWL_MASK(0, hw_params(trans).max_txq_num)); 1162 IWL_MASK(0, cfg(trans)->base_params->num_of_queues));
1160 1163
1161 /* Activate all Tx DMA/FIFO channels */ 1164 /* Activate all Tx DMA/FIFO channels */
1162 iwl_trans_txq_set_sched(trans, IWL_MASK(0, 7)); 1165 iwl_trans_txq_set_sched(trans, IWL_MASK(0, 7));
@@ -1246,7 +1249,8 @@ static int iwl_trans_tx_stop(struct iwl_trans *trans)
1246 } 1249 }
1247 1250
1248 /* Unmap DMA from host system and free skb's */ 1251 /* Unmap DMA from host system and free skb's */
1249 for (txq_id = 0; txq_id < hw_params(trans).max_txq_num; txq_id++) 1252 for (txq_id = 0; txq_id < cfg(trans)->base_params->num_of_queues;
1253 txq_id++)
1250 iwl_tx_queue_unmap(trans, txq_id); 1254 iwl_tx_queue_unmap(trans, txq_id);
1251 1255
1252 return 0; 1256 return 0;
@@ -1685,7 +1689,7 @@ static int iwl_trans_pcie_wait_tx_queue_empty(struct iwl_trans *trans)
1685 int ret = 0; 1689 int ret = 0;
1686 1690
1687 /* waiting for all the tx frames complete might take a while */ 1691 /* waiting for all the tx frames complete might take a while */
1688 for (cnt = 0; cnt < hw_params(trans).max_txq_num; cnt++) { 1692 for (cnt = 0; cnt < cfg(trans)->base_params->num_of_queues; cnt++) {
1689 if (cnt == trans_pcie->cmd_queue) 1693 if (cnt == trans_pcie->cmd_queue)
1690 continue; 1694 continue;
1691 txq = &trans_pcie->txq[cnt]; 1695 txq = &trans_pcie->txq[cnt];
@@ -1931,7 +1935,9 @@ static ssize_t iwl_dbgfs_tx_queue_read(struct file *file,
1931 int pos = 0; 1935 int pos = 0;
1932 int cnt; 1936 int cnt;
1933 int ret; 1937 int ret;
1934 const size_t bufsz = sizeof(char) * 64 * hw_params(trans).max_txq_num; 1938 size_t bufsz;
1939
1940 bufsz = sizeof(char) * 64 * cfg(trans)->base_params->num_of_queues;
1935 1941
1936 if (!trans_pcie->txq) { 1942 if (!trans_pcie->txq) {
1937 IWL_ERR(trans, "txq not ready\n"); 1943 IWL_ERR(trans, "txq not ready\n");
@@ -1941,7 +1947,7 @@ static ssize_t iwl_dbgfs_tx_queue_read(struct file *file,
1941 if (!buf) 1947 if (!buf)
1942 return -ENOMEM; 1948 return -ENOMEM;
1943 1949
1944 for (cnt = 0; cnt < hw_params(trans).max_txq_num; cnt++) { 1950 for (cnt = 0; cnt < cfg(trans)->base_params->num_of_queues; cnt++) {
1945 txq = &trans_pcie->txq[cnt]; 1951 txq = &trans_pcie->txq[cnt];
1946 q = &txq->q; 1952 q = &txq->q;
1947 pos += scnprintf(buf + pos, bufsz - pos, 1953 pos += scnprintf(buf + pos, bufsz - pos,