forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/net/wireless/intersil/prism54/islpci_eth.c
....@@ -1,18 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2002 Intersil Americas Inc.
34 * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr>
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License as published by
6
- * the Free Software Foundation; either version 2 of the License
7
- *
8
- * This program is distributed in the hope that it will be useful,
9
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- * GNU General Public License for more details.
12
- *
13
- * You should have received a copy of the GNU General Public License
14
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
15
- *
165 */
176
187 #include <linux/module.h>
....@@ -61,9 +50,9 @@
6150 skb, skb->data, skb->len, skb->truesize);
6251 #endif
6352
64
- pci_unmap_single(priv->pdev,
53
+ dma_unmap_single(&priv->pdev->dev,
6554 priv->pci_map_tx_address[index],
66
- skb->len, PCI_DMA_TODEVICE);
55
+ skb->len, DMA_TO_DEVICE);
6756 dev_kfree_skb_irq(skb);
6857 skb = NULL;
6958 }
....@@ -187,10 +176,9 @@
187176 #endif
188177
189178 /* map the skb buffer to pci memory for DMA operation */
190
- pci_map_address = pci_map_single(priv->pdev,
191
- (void *) skb->data, skb->len,
192
- PCI_DMA_TODEVICE);
193
- if (pci_dma_mapping_error(priv->pdev, pci_map_address)) {
179
+ pci_map_address = dma_map_single(&priv->pdev->dev, (void *)skb->data,
180
+ skb->len, DMA_TO_DEVICE);
181
+ if (dma_mapping_error(&priv->pdev->dev, pci_map_address)) {
194182 printk(KERN_WARNING "%s: cannot map buffer to PCI\n",
195183 ndev->name);
196184 goto drop_free;
....@@ -334,9 +322,8 @@
334322 #endif
335323
336324 /* delete the streaming DMA mapping before processing the skb */
337
- pci_unmap_single(priv->pdev,
338
- priv->pci_map_rx_address[index],
339
- MAX_FRAGMENT_SIZE_RX + 2, PCI_DMA_FROMDEVICE);
325
+ dma_unmap_single(&priv->pdev->dev, priv->pci_map_rx_address[index],
326
+ MAX_FRAGMENT_SIZE_RX + 2, DMA_FROM_DEVICE);
340327
341328 /* update the skb structure and align the buffer */
342329 skb_put(skb, size);
....@@ -442,11 +429,9 @@
442429
443430 /* set the streaming DMA mapping for proper PCI bus operation */
444431 priv->pci_map_rx_address[index] =
445
- pci_map_single(priv->pdev, (void *) skb->data,
446
- MAX_FRAGMENT_SIZE_RX + 2,
447
- PCI_DMA_FROMDEVICE);
448
- if (pci_dma_mapping_error(priv->pdev,
449
- priv->pci_map_rx_address[index])) {
432
+ dma_map_single(&priv->pdev->dev, (void *)skb->data,
433
+ MAX_FRAGMENT_SIZE_RX + 2, DMA_FROM_DEVICE);
434
+ if (dma_mapping_error(&priv->pdev->dev, priv->pci_map_rx_address[index])) {
450435 /* error mapping the buffer to device accessible memory address */
451436 DEBUG(SHOW_ERROR_MESSAGES,
452437 "Error mapping DMA address\n");
....@@ -484,7 +469,7 @@
484469 }
485470
486471 void
487
-islpci_eth_tx_timeout(struct net_device *ndev)
472
+islpci_eth_tx_timeout(struct net_device *ndev, unsigned int txqueue)
488473 {
489474 islpci_private *priv = netdev_priv(ndev);
490475