aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Ortiz <samuel.ortiz@intel.com>2009-01-23 16:45:13 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 16:01:33 -0500
commit59606ffa9146538b73bbe1ca1285321cd7474bc0 (patch)
treef54644b3c64b6f9734891547a6f670cbb3fb3ec5
parent77fecfb88f8ad64420e06a96f1bd3b38498bfb4f (diff)
iwlwifi: make iwl_tx_queue->tfds void*
Instead of having both tfds and tfds39, we can just have a void *tfds. It makes the tx_queue structure nicer, and the code cleaner. It also helps with further TX queues management code merging. Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-tx.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c12
5 files changed, 17 insertions, 16 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 602a3a91568..22770f44c2f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -730,10 +730,11 @@ int iwl3945_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv,
730{ 730{
731 int count; 731 int count;
732 struct iwl_queue *q; 732 struct iwl_queue *q;
733 struct iwl3945_tfd *tfd; 733 struct iwl3945_tfd *tfd, *tfd_tmp;
734 734
735 q = &txq->q; 735 q = &txq->q;
736 tfd = &txq->tfds39[q->write_ptr]; 736 tfd_tmp = (struct iwl3945_tfd *)txq->tfds;
737 tfd = &tfd_tmp[q->write_ptr];
737 738
738 if (reset) 739 if (reset)
739 memset(tfd, 0, sizeof(*tfd)); 740 memset(tfd, 0, sizeof(*tfd));
@@ -764,7 +765,7 @@ int iwl3945_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv,
764 */ 765 */
765void iwl3945_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq) 766void iwl3945_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
766{ 767{
767 struct iwl3945_tfd *tfd_tmp = (struct iwl3945_tfd *)&txq->tfds39[0]; 768 struct iwl3945_tfd *tfd_tmp = (struct iwl3945_tfd *)txq->tfds;
768 struct iwl3945_tfd *tfd = &tfd_tmp[txq->q.read_ptr]; 769 struct iwl3945_tfd *tfd = &tfd_tmp[txq->q.read_ptr];
769 struct pci_dev *dev = priv->pci_dev; 770 struct pci_dev *dev = priv->pci_dev;
770 int i; 771 int i;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 61788a50897..4ce3d6a63d1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -520,7 +520,7 @@ static inline u8 iwl_tfd_get_num_tbs(struct iwl_tfd *tfd)
520 */ 520 */
521void iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq) 521void iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
522{ 522{
523 struct iwl_tfd *tfd_tmp = (struct iwl_tfd *)&txq->tfds[0]; 523 struct iwl_tfd *tfd_tmp = (struct iwl_tfd *)txq->tfds;
524 struct iwl_tfd *tfd; 524 struct iwl_tfd *tfd;
525 struct pci_dev *dev = priv->pci_dev; 525 struct pci_dev *dev = priv->pci_dev;
526 int index = txq->q.read_ptr; 526 int index = txq->q.read_ptr;
@@ -563,11 +563,12 @@ int iwl_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv,
563 u8 reset, u8 pad) 563 u8 reset, u8 pad)
564{ 564{
565 struct iwl_queue *q; 565 struct iwl_queue *q;
566 struct iwl_tfd *tfd; 566 struct iwl_tfd *tfd, *tfd_tmp;
567 u32 num_tbs; 567 u32 num_tbs;
568 568
569 q = &txq->q; 569 q = &txq->q;
570 tfd = &txq->tfds[q->write_ptr]; 570 tfd_tmp = (struct iwl_tfd *)txq->tfds;
571 tfd = &tfd_tmp[q->write_ptr];
571 572
572 if (reset) 573 if (reset)
573 memset(tfd, 0, sizeof(*tfd)); 574 memset(tfd, 0, sizeof(*tfd));
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 79f2d45a9fc..78ce4f49c56 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -149,8 +149,7 @@ struct iwl_tx_info {
149 149
150struct iwl_tx_queue { 150struct iwl_tx_queue {
151 struct iwl_queue q; 151 struct iwl_queue q;
152 struct iwl_tfd *tfds; 152 void *tfds;
153 struct iwl3945_tfd *tfds39;
154 struct iwl_cmd *cmd[TFD_TX_CMD_SLOTS]; 153 struct iwl_cmd *cmd[TFD_TX_CMD_SLOTS];
155 struct iwl_tx_info *txb; 154 struct iwl_tx_info *txb;
156 u8 need_update; 155 u8 need_update;
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index 1a2cfbebb17..83e9f32cbd8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -295,12 +295,12 @@ static int iwl_tx_queue_alloc(struct iwl_priv *priv,
295 /* Circular buffer of transmit frame descriptors (TFDs), 295 /* Circular buffer of transmit frame descriptors (TFDs),
296 * shared with device */ 296 * shared with device */
297 txq->tfds = pci_alloc_consistent(dev, 297 txq->tfds = pci_alloc_consistent(dev,
298 sizeof(txq->tfds[0]) * TFD_QUEUE_SIZE_MAX, 298 sizeof(struct iwl_tfd) * TFD_QUEUE_SIZE_MAX,
299 &txq->q.dma_addr); 299 &txq->q.dma_addr);
300 300
301 if (!txq->tfds) { 301 if (!txq->tfds) {
302 IWL_ERR(priv, "pci_alloc_consistent(%zd) failed\n", 302 IWL_ERR(priv, "pci_alloc_consistent(%zd) failed\n",
303 sizeof(txq->tfds[0]) * TFD_QUEUE_SIZE_MAX); 303 sizeof(struct iwl_tfd) * TFD_QUEUE_SIZE_MAX);
304 goto error; 304 goto error;
305 } 305 }
306 txq->q.id = id; 306 txq->q.id = id;
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index c7bb9c19a90..bc10e2ae597 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -172,13 +172,13 @@ static int iwl3945_tx_queue_alloc(struct iwl_priv *priv,
172 172
173 /* Circular buffer of transmit frame descriptors (TFDs), 173 /* Circular buffer of transmit frame descriptors (TFDs),
174 * shared with device */ 174 * shared with device */
175 txq->tfds39 = pci_alloc_consistent(dev, 175 txq->tfds = pci_alloc_consistent(dev,
176 sizeof(txq->tfds39[0]) * TFD_QUEUE_SIZE_MAX, 176 sizeof(struct iwl3945_tfd) * TFD_QUEUE_SIZE_MAX,
177 &txq->q.dma_addr); 177 &txq->q.dma_addr);
178 178
179 if (!txq->tfds39) { 179 if (!txq->tfds) {
180 IWL_ERR(priv, "pci_alloc_consistent(%zd) failed\n", 180 IWL_ERR(priv, "pci_alloc_consistent(%zd) failed\n",
181 sizeof(txq->tfds39[0]) * TFD_QUEUE_SIZE_MAX); 181 sizeof(struct iwl3945_tfd) * TFD_QUEUE_SIZE_MAX);
182 goto error; 182 goto error;
183 } 183 }
184 txq->q.id = id; 184 txq->q.id = id;
@@ -287,7 +287,7 @@ void iwl3945_tx_queue_free(struct iwl_priv *priv, struct iwl_tx_queue *txq)
287 /* De-alloc circular buffer of TFDs */ 287 /* De-alloc circular buffer of TFDs */
288 if (txq->q.n_bd) 288 if (txq->q.n_bd)
289 pci_free_consistent(dev, sizeof(struct iwl3945_tfd) * 289 pci_free_consistent(dev, sizeof(struct iwl3945_tfd) *
290 txq->q.n_bd, txq->tfds39, txq->q.dma_addr); 290 txq->q.n_bd, txq->tfds, txq->q.dma_addr);
291 291
292 /* De-alloc array of per-TFD driver data */ 292 /* De-alloc array of per-TFD driver data */
293 kfree(txq->txb); 293 kfree(txq->txb);