hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/drivers/net/ethernet/atheros/alx/main.c
....@@ -49,7 +49,7 @@
4949 #include "hw.h"
5050 #include "reg.h"
5151
52
-const char alx_drv_name[] = "alx";
52
+static const char alx_drv_name[] = "alx";
5353
5454 static void alx_free_txbuf(struct alx_tx_queue *txq, int entry)
5555 {
....@@ -660,10 +660,9 @@
660660 alx->num_txq +
661661 sizeof(struct alx_rrd) * alx->rx_ringsz +
662662 sizeof(struct alx_rfd) * alx->rx_ringsz;
663
- alx->descmem.virt = dma_zalloc_coherent(&alx->hw.pdev->dev,
664
- alx->descmem.size,
665
- &alx->descmem.dma,
666
- GFP_KERNEL);
663
+ alx->descmem.virt = dma_alloc_coherent(&alx->hw.pdev->dev,
664
+ alx->descmem.size,
665
+ &alx->descmem.dma, GFP_KERNEL);
667666 if (!alx->descmem.virt)
668667 return -ENOMEM;
669668
....@@ -1421,10 +1420,7 @@
14211420 0, IPPROTO_TCP, 0);
14221421 first->word1 |= 1 << TPD_IPV4_SHIFT;
14231422 } else if (skb_is_gso_v6(skb)) {
1424
- ipv6_hdr(skb)->payload_len = 0;
1425
- tcp_hdr(skb)->check = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
1426
- &ipv6_hdr(skb)->daddr,
1427
- 0, IPPROTO_TCP, 0);
1423
+ tcp_v6_gso_csum_prep(skb);
14281424 /* LSOv2: the first TPD only provides the packet length */
14291425 first->adrl.l.pkt_len = skb->len;
14301426 first->word1 |= 1 << TPD_LSO_V2_SHIFT;
....@@ -1470,9 +1466,7 @@
14701466 tpd->len = cpu_to_le16(maplen);
14711467
14721468 for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) {
1473
- struct skb_frag_struct *frag;
1474
-
1475
- frag = &skb_shinfo(skb)->frags[f];
1469
+ skb_frag_t *frag = &skb_shinfo(skb)->frags[f];
14761470
14771471 if (++txq->write_idx == txq->count)
14781472 txq->write_idx = 0;
....@@ -1560,7 +1554,7 @@
15601554 return alx_start_xmit_ring(skb, alx_tx_queue_mapping(alx, skb));
15611555 }
15621556
1563
-static void alx_tx_timeout(struct net_device *dev)
1557
+static void alx_tx_timeout(struct net_device *dev, unsigned int txqueue)
15641558 {
15651559 struct alx_priv *alx = netdev_priv(dev);
15661560
....@@ -1882,8 +1876,7 @@
18821876 #ifdef CONFIG_PM_SLEEP
18831877 static int alx_suspend(struct device *dev)
18841878 {
1885
- struct pci_dev *pdev = to_pci_dev(dev);
1886
- struct alx_priv *alx = pci_get_drvdata(pdev);
1879
+ struct alx_priv *alx = dev_get_drvdata(dev);
18871880
18881881 if (!netif_running(alx->dev))
18891882 return 0;
....@@ -1894,8 +1887,7 @@
18941887
18951888 static int alx_resume(struct device *dev)
18961889 {
1897
- struct pci_dev *pdev = to_pci_dev(dev);
1898
- struct alx_priv *alx = pci_get_drvdata(pdev);
1890
+ struct alx_priv *alx = dev_get_drvdata(dev);
18991891 struct alx_hw *hw = &alx->hw;
19001892 int err;
19011893
....@@ -1969,8 +1961,6 @@
19691961 if (!alx_reset_mac(hw))
19701962 rc = PCI_ERS_RESULT_RECOVERED;
19711963 out:
1972
- pci_cleanup_aer_uncorrect_error_status(pdev);
1973
-
19741964 rtnl_unlock();
19751965
19761966 return rc;