hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/net/ethernet/calxeda/xgmac.c
....@@ -1,17 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright 2010-2011 Calxeda, Inc.
3
- *
4
- * This program is free software; you can redistribute it and/or modify it
5
- * under the terms and conditions of the GNU General Public License,
6
- * version 2, as published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope it will be useful, but WITHOUT
9
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
- * more details.
12
- *
13
- * You should have received a copy of the GNU General Public License along with
14
- * this program. If not, see <http://www.gnu.org/licenses/>.
154 */
165 #include <linux/module.h>
176 #include <linux/mod_devicetable.h>
....@@ -1115,7 +1104,7 @@
11151104 for (i = 0; i < nfrags; i++) {
11161105 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
11171106
1118
- len = frag->size;
1107
+ len = skb_frag_size(frag);
11191108
11201109 paddr = skb_frag_dma_map(priv->device, frag, 0, len,
11211110 DMA_TO_DEVICE);
....@@ -1257,12 +1246,14 @@
12571246 /**
12581247 * xgmac_tx_timeout
12591248 * @dev : Pointer to net device structure
1249
+ * @txqueue: index of the hung transmit queue
1250
+ *
12601251 * Description: this function is called when a packet transmission fails to
12611252 * complete within a reasonable tmrate. The driver will mark the error in the
12621253 * netdev structure and arrange for the device to be reset to a sane state
12631254 * in order to transmit a new packet.
12641255 */
1265
-static void xgmac_tx_timeout(struct net_device *dev)
1256
+static void xgmac_tx_timeout(struct net_device *dev, unsigned int txqueue)
12661257 {
12671258 struct xgmac_priv *priv = netdev_priv(dev);
12681259 schedule_work(&priv->tx_timeout_work);
....@@ -1866,7 +1857,7 @@
18661857
18671858 static int xgmac_suspend(struct device *dev)
18681859 {
1869
- struct net_device *ndev = platform_get_drvdata(to_platform_device(dev));
1860
+ struct net_device *ndev = dev_get_drvdata(dev);
18701861 struct xgmac_priv *priv = netdev_priv(ndev);
18711862 u32 value;
18721863
....@@ -1892,7 +1883,7 @@
18921883
18931884 static int xgmac_resume(struct device *dev)
18941885 {
1895
- struct net_device *ndev = platform_get_drvdata(to_platform_device(dev));
1886
+ struct net_device *ndev = dev_get_drvdata(dev);
18961887 struct xgmac_priv *priv = netdev_priv(ndev);
18971888 void __iomem *ioaddr = priv->base;
18981889
....@@ -1925,10 +1916,10 @@
19251916 .driver = {
19261917 .name = "calxedaxgmac",
19271918 .of_match_table = xgmac_of_match,
1919
+ .pm = &xgmac_pm_ops,
19281920 },
19291921 .probe = xgmac_probe,
19301922 .remove = xgmac_remove,
1931
- .driver.pm = &xgmac_pm_ops,
19321923 };
19331924
19341925 module_platform_driver(xgmac_driver);