hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/net/ethernet/intel/ixgb/ixgb_main.c
....@@ -9,9 +9,6 @@
99 char ixgb_driver_name[] = "ixgb";
1010 static char ixgb_driver_string[] = "Intel(R) PRO/10GbE Network Driver";
1111
12
-#define DRIVERNAPI "-NAPI"
13
-#define DRV_VERSION "1.0.135-k2" DRIVERNAPI
14
-const char ixgb_driver_version[] = DRV_VERSION;
1512 static const char ixgb_copyright[] = "Copyright (c) 1999-2008 Intel Corporation.";
1613
1714 #define IXGB_CB_LENGTH 256
....@@ -70,7 +67,7 @@
7067 static bool ixgb_clean_rx_irq(struct ixgb_adapter *, int *, int);
7168 static void ixgb_alloc_rx_buffers(struct ixgb_adapter *, int);
7269
73
-static void ixgb_tx_timeout(struct net_device *dev);
70
+static void ixgb_tx_timeout(struct net_device *dev, unsigned int txqueue);
7471 static void ixgb_tx_timeout_task(struct work_struct *work);
7572
7673 static void ixgb_vlan_strip_enable(struct ixgb_adapter *adapter);
....@@ -82,7 +79,7 @@
8279 static void ixgb_restore_vlan(struct ixgb_adapter *adapter);
8380
8481 static pci_ers_result_t ixgb_io_error_detected (struct pci_dev *pdev,
85
- enum pci_channel_state state);
82
+ pci_channel_state_t state);
8683 static pci_ers_result_t ixgb_io_slot_reset (struct pci_dev *pdev);
8784 static void ixgb_io_resume (struct pci_dev *pdev);
8885
....@@ -102,8 +99,7 @@
10299
103100 MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>");
104101 MODULE_DESCRIPTION("Intel(R) PRO/10GbE Network Driver");
105
-MODULE_LICENSE("GPL");
106
-MODULE_VERSION(DRV_VERSION);
102
+MODULE_LICENSE("GPL v2");
107103
108104 #define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK)
109105 static int debug = -1;
....@@ -120,7 +116,7 @@
120116 static int __init
121117 ixgb_init_module(void)
122118 {
123
- pr_info("%s - version %s\n", ixgb_driver_string, ixgb_driver_version);
119
+ pr_info("%s\n", ixgb_driver_string);
124120 pr_info("%s\n", ixgb_copyright);
125121
126122 return pci_register_driver(&ixgb_driver);
....@@ -412,7 +408,7 @@
412408 goto err_ioremap;
413409 }
414410
415
- for (i = BAR_1; i <= BAR_5; i++) {
411
+ for (i = BAR_1; i < PCI_STD_NUM_BARS; i++) {
416412 if (pci_resource_len(pdev, i) == 0)
417413 continue;
418414 if (pci_resource_flags(pdev, i) & IORESOURCE_IO) {
....@@ -680,8 +676,8 @@
680676 txdr->size = txdr->count * sizeof(struct ixgb_tx_desc);
681677 txdr->size = ALIGN(txdr->size, 4096);
682678
683
- txdr->desc = dma_zalloc_coherent(&pdev->dev, txdr->size, &txdr->dma,
684
- GFP_KERNEL);
679
+ txdr->desc = dma_alloc_coherent(&pdev->dev, txdr->size, &txdr->dma,
680
+ GFP_KERNEL);
685681 if (!txdr->desc) {
686682 vfree(txdr->buffer_info);
687683 return -ENOMEM;
....@@ -763,8 +759,8 @@
763759 rxdr->size = rxdr->count * sizeof(struct ixgb_rx_desc);
764760 rxdr->size = ALIGN(rxdr->size, 4096);
765761
766
- rxdr->desc = dma_zalloc_coherent(&pdev->dev, rxdr->size, &rxdr->dma,
767
- GFP_KERNEL);
762
+ rxdr->desc = dma_alloc_coherent(&pdev->dev, rxdr->size, &rxdr->dma,
763
+ GFP_KERNEL);
768764
769765 if (!rxdr->desc) {
770766 vfree(rxdr->buffer_info);
....@@ -1113,7 +1109,7 @@
11131109
11141110 /**
11151111 * ixgb_watchdog - Timer Call-back
1116
- * @data: pointer to netdev cast into an unsigned long
1112
+ * @t: pointer to timer_list containing our private info pointer
11171113 **/
11181114
11191115 static void
....@@ -1331,9 +1327,7 @@
13311327 }
13321328
13331329 for (f = 0; f < nr_frags; f++) {
1334
- const struct skb_frag_struct *frag;
1335
-
1336
- frag = &skb_shinfo(skb)->frags[f];
1330
+ const skb_frag_t *frag = &skb_shinfo(skb)->frags[f];
13371331 len = skb_frag_size(frag);
13381332 offset = 0;
13391333
....@@ -1537,10 +1531,11 @@
15371531 /**
15381532 * ixgb_tx_timeout - Respond to a Tx Hang
15391533 * @netdev: network interface device structure
1534
+ * @txqueue: queue hanging (unused)
15401535 **/
15411536
15421537 static void
1543
-ixgb_tx_timeout(struct net_device *netdev)
1538
+ixgb_tx_timeout(struct net_device *netdev, unsigned int __always_unused txqueue)
15441539 {
15451540 struct ixgb_adapter *adapter = netdev_priv(netdev);
15461541
....@@ -1752,7 +1747,8 @@
17521747
17531748 /**
17541749 * ixgb_clean - NAPI Rx polling callback
1755
- * @adapter: board private structure
1750
+ * @napi: napi struct pointer
1751
+ * @budget: max number of receives to clean
17561752 **/
17571753
17581754 static int
....@@ -1871,7 +1867,7 @@
18711867 * ixgb_rx_checksum - Receive Checksum Offload for 82597.
18721868 * @adapter: board private structure
18731869 * @rx_desc: receive descriptor
1874
- * @sk_buff: socket buffer with received data
1870
+ * @skb: socket buffer with received data
18751871 **/
18761872
18771873 static void
....@@ -1929,6 +1925,8 @@
19291925 /**
19301926 * ixgb_clean_rx_irq - Send received data up the network stack,
19311927 * @adapter: board private structure
1928
+ * @work_done: output pointer to amount of packets cleaned
1929
+ * @work_to_do: how much work we can complete
19321930 **/
19331931
19341932 static bool
....@@ -2048,6 +2046,7 @@
20482046 /**
20492047 * ixgb_alloc_rx_buffers - Replace used receive buffers
20502048 * @adapter: address of board private structure
2049
+ * @cleaned_count: how many buffers to allocate
20512050 **/
20522051
20532052 static void
....@@ -2196,7 +2195,7 @@
21962195 * a PCI bus error is detected.
21972196 */
21982197 static pci_ers_result_t ixgb_io_error_detected(struct pci_dev *pdev,
2199
- enum pci_channel_state state)
2198
+ pci_channel_state_t state)
22002199 {
22012200 struct net_device *netdev = pci_get_drvdata(pdev);
22022201 struct ixgb_adapter *adapter = netdev_priv(netdev);
....@@ -2217,7 +2216,7 @@
22172216
22182217 /**
22192218 * ixgb_io_slot_reset - called after the pci bus has been reset.
2220
- * @pdev pointer to pci device with error
2219
+ * @pdev: pointer to pci device with error
22212220 *
22222221 * This callback is called after the PCI bus has been reset.
22232222 * Basically, this tries to restart the card from scratch.
....@@ -2265,7 +2264,7 @@
22652264
22662265 /**
22672266 * ixgb_io_resume - called when its OK to resume normal operations
2268
- * @pdev pointer to pci device with error
2267
+ * @pdev: pointer to pci device with error
22692268 *
22702269 * The error recovery driver tells us that its OK to resume
22712270 * normal operation. Implementation resembles the second-half