| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2002 Intersil Americas Inc. |
|---|
| 3 | 4 | * 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 | | - * |
|---|
| 16 | 5 | */ |
|---|
| 17 | 6 | |
|---|
| 18 | 7 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 61 | 50 | skb, skb->data, skb->len, skb->truesize); |
|---|
| 62 | 51 | #endif |
|---|
| 63 | 52 | |
|---|
| 64 | | - pci_unmap_single(priv->pdev, |
|---|
| 53 | + dma_unmap_single(&priv->pdev->dev, |
|---|
| 65 | 54 | priv->pci_map_tx_address[index], |
|---|
| 66 | | - skb->len, PCI_DMA_TODEVICE); |
|---|
| 55 | + skb->len, DMA_TO_DEVICE); |
|---|
| 67 | 56 | dev_kfree_skb_irq(skb); |
|---|
| 68 | 57 | skb = NULL; |
|---|
| 69 | 58 | } |
|---|
| .. | .. |
|---|
| 187 | 176 | #endif |
|---|
| 188 | 177 | |
|---|
| 189 | 178 | /* 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)) { |
|---|
| 194 | 182 | printk(KERN_WARNING "%s: cannot map buffer to PCI\n", |
|---|
| 195 | 183 | ndev->name); |
|---|
| 196 | 184 | goto drop_free; |
|---|
| .. | .. |
|---|
| 334 | 322 | #endif |
|---|
| 335 | 323 | |
|---|
| 336 | 324 | /* 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); |
|---|
| 340 | 327 | |
|---|
| 341 | 328 | /* update the skb structure and align the buffer */ |
|---|
| 342 | 329 | skb_put(skb, size); |
|---|
| .. | .. |
|---|
| 442 | 429 | |
|---|
| 443 | 430 | /* set the streaming DMA mapping for proper PCI bus operation */ |
|---|
| 444 | 431 | 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])) { |
|---|
| 450 | 435 | /* error mapping the buffer to device accessible memory address */ |
|---|
| 451 | 436 | DEBUG(SHOW_ERROR_MESSAGES, |
|---|
| 452 | 437 | "Error mapping DMA address\n"); |
|---|
| .. | .. |
|---|
| 484 | 469 | } |
|---|
| 485 | 470 | |
|---|
| 486 | 471 | void |
|---|
| 487 | | -islpci_eth_tx_timeout(struct net_device *ndev) |
|---|
| 472 | +islpci_eth_tx_timeout(struct net_device *ndev, unsigned int txqueue) |
|---|
| 488 | 473 | { |
|---|
| 489 | 474 | islpci_private *priv = netdev_priv(ndev); |
|---|
| 490 | 475 | |
|---|