Skip to content

Commit

Permalink
iwl3945: unmap previously mapped memory
Browse files Browse the repository at this point in the history
During preparation of TX we create DMA mapping to TX command as part of
preparing the TFD. This mapping needs to be cleared at the time TFD is
freed.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Reinette Chatre authored and John W. Linville committed Mar 16, 2009
1 parent 732587a commit fd9377e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/net/wireless/iwlwifi/iwl-3945.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,8 @@ int iwl3945_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv,
void iwl3945_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
{
struct iwl3945_tfd *tfd_tmp = (struct iwl3945_tfd *)txq->tfds;
struct iwl3945_tfd *tfd = &tfd_tmp[txq->q.read_ptr];
int index = txq->q.read_ptr;
struct iwl3945_tfd *tfd = &tfd_tmp[index];
struct pci_dev *dev = priv->pci_dev;
int i;
int counter;
Expand All @@ -759,6 +760,13 @@ void iwl3945_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
return;
}

/* Unmap tx_cmd */
if (counter)
pci_unmap_single(dev,
pci_unmap_addr(&txq->cmd[index]->meta, mapping),
pci_unmap_len(&txq->cmd[index]->meta, len),
PCI_DMA_TODEVICE);

/* unmap chunks if any */

for (i = 1; i < counter; i++) {
Expand Down

0 comments on commit fd9377e

Please sign in to comment.