* [PATCH] iwlagn: use PCI_DMA_* for pci_* operations
@ 2011-06-27 19:50 John W. Linville
2011-06-27 20:02 ` John W. Linville
0 siblings, 1 reply; 3+ messages in thread
From: John W. Linville @ 2011-06-27 19:50 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes.berg, wey-yi.w.guy, John W. Linville
"iwlagn: map command buffers BIDI" uses the DMA_* enumerations for DMA
directions, even though the pci_* DMA API is still in use. That patch
was undoubtedly developed on top of "iwlagn: don't use the PCI wrappers
for DMA operation", which is due in the next release.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
drivers/net/wireless/iwlwifi/iwl-tx.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index 4707431..9eee978 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -168,7 +168,7 @@ void iwlagn_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
int index = txq->q.read_ptr;
iwlagn_unmap_tfd(priv, &txq->meta[index], &tfd_tmp[index],
- DMA_TO_DEVICE);
+ PCI_DMA_TODEVICE);
/* free SKB */
if (txq->txb) {
@@ -312,7 +312,7 @@ void iwl_cmd_queue_unmap(struct iwl_priv *priv)
if (txq->meta[i].flags & CMD_MAPPED) {
iwlagn_unmap_tfd(priv, &txq->meta[i], &txq->tfds[i],
- DMA_BIDIRECTIONAL);
+ PCI_DMA_BIDIRECTIONAL);
txq->meta[i].flags = 0;
}
@@ -694,11 +694,11 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
if (!(cmd->dataflags[i] & IWL_HCMD_DFL_NOCOPY))
continue;
phys_addr = pci_map_single(priv->pci_dev, (void *)cmd->data[i],
- cmd->len[i], DMA_BIDIRECTIONAL);
+ cmd->len[i], PCI_DMA_BIDIRECTIONAL);
if (pci_dma_mapping_error(priv->pci_dev, phys_addr)) {
iwlagn_unmap_tfd(priv, out_meta,
&txq->tfds[q->write_ptr],
- DMA_BIDIRECTIONAL);
+ PCI_DMA_BIDIRECTIONAL);
idx = -ENOMEM;
goto out;
}
@@ -802,7 +802,7 @@ void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
cmd = txq->cmd[cmd_index];
meta = &txq->meta[cmd_index];
- iwlagn_unmap_tfd(priv, meta, &txq->tfds[index], DMA_BIDIRECTIONAL);
+ iwlagn_unmap_tfd(priv, meta, &txq->tfds[index], PCI_DMA_BIDIRECTIONAL);
/* Input error checking is done when commands are added to queue. */
if (meta->flags & CMD_WANT_SKB) {
--
1.7.4.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] iwlagn: use PCI_DMA_* for pci_* operations
2011-06-27 19:50 [PATCH] iwlagn: use PCI_DMA_* for pci_* operations John W. Linville
@ 2011-06-27 20:02 ` John W. Linville
2011-06-27 20:36 ` Johannes Berg
0 siblings, 1 reply; 3+ messages in thread
From: John W. Linville @ 2011-06-27 20:02 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes.berg, wey-yi.w.guy
This would only be for 3.0, obviously. It isn't really necessary,
since the values are equal. But, it seems wrong to misuse the API.
John
On Mon, Jun 27, 2011 at 03:50:19PM -0400, John W. Linville wrote:
> "iwlagn: map command buffers BIDI" uses the DMA_* enumerations for DMA
> directions, even though the pci_* DMA API is still in use. That patch
> was undoubtedly developed on top of "iwlagn: don't use the PCI wrappers
> for DMA operation", which is due in the next release.
>
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
> ---
> drivers/net/wireless/iwlwifi/iwl-tx.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
> index 4707431..9eee978 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-tx.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
> @@ -168,7 +168,7 @@ void iwlagn_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
> int index = txq->q.read_ptr;
>
> iwlagn_unmap_tfd(priv, &txq->meta[index], &tfd_tmp[index],
> - DMA_TO_DEVICE);
> + PCI_DMA_TODEVICE);
>
> /* free SKB */
> if (txq->txb) {
> @@ -312,7 +312,7 @@ void iwl_cmd_queue_unmap(struct iwl_priv *priv)
>
> if (txq->meta[i].flags & CMD_MAPPED) {
> iwlagn_unmap_tfd(priv, &txq->meta[i], &txq->tfds[i],
> - DMA_BIDIRECTIONAL);
> + PCI_DMA_BIDIRECTIONAL);
> txq->meta[i].flags = 0;
> }
>
> @@ -694,11 +694,11 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
> if (!(cmd->dataflags[i] & IWL_HCMD_DFL_NOCOPY))
> continue;
> phys_addr = pci_map_single(priv->pci_dev, (void *)cmd->data[i],
> - cmd->len[i], DMA_BIDIRECTIONAL);
> + cmd->len[i], PCI_DMA_BIDIRECTIONAL);
> if (pci_dma_mapping_error(priv->pci_dev, phys_addr)) {
> iwlagn_unmap_tfd(priv, out_meta,
> &txq->tfds[q->write_ptr],
> - DMA_BIDIRECTIONAL);
> + PCI_DMA_BIDIRECTIONAL);
> idx = -ENOMEM;
> goto out;
> }
> @@ -802,7 +802,7 @@ void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
> cmd = txq->cmd[cmd_index];
> meta = &txq->meta[cmd_index];
>
> - iwlagn_unmap_tfd(priv, meta, &txq->tfds[index], DMA_BIDIRECTIONAL);
> + iwlagn_unmap_tfd(priv, meta, &txq->tfds[index], PCI_DMA_BIDIRECTIONAL);
>
> /* Input error checking is done when commands are added to queue. */
> if (meta->flags & CMD_WANT_SKB) {
> --
> 1.7.4.4
>
>
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iwlagn: use PCI_DMA_* for pci_* operations
2011-06-27 20:02 ` John W. Linville
@ 2011-06-27 20:36 ` Johannes Berg
0 siblings, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2011-06-27 20:36 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, wey-yi.w.guy
On Mon, 2011-06-27 at 16:02 -0400, John W. Linville wrote:
> This would only be for 3.0, obviously. It isn't really necessary,
> since the values are equal. But, it seems wrong to misuse the API.
Doh, you're right of course -- should the function argument also have a
different type then?
johannes
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-06-27 20:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-27 19:50 [PATCH] iwlagn: use PCI_DMA_* for pci_* operations John W. Linville
2011-06-27 20:02 ` John W. Linville
2011-06-27 20:36 ` Johannes Berg
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.