hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/net/ethernet/broadcom/sb1250-mac.c
....@@ -1,20 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) 2001,2002,2003,2004 Broadcom Corporation
34 * Copyright (c) 2006, 2007 Maciej W. Rozycki
4
- *
5
- * This program is free software; you can redistribute it and/or
6
- * modify it under the terms of the GNU General Public License
7
- * as published by the Free Software Foundation; either version 2
8
- * of the License, or (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
17
- *
185 *
196 * This driver is designed for the Broadcom SiByte SOC built-in
207 * Ethernet controllers. Written by Mitch Lichtenberg at Broadcom Corp.
....@@ -156,7 +143,7 @@
156143 (d)->sbdma_dscrtable : (d)->f+1)
157144
158145
159
-#define NUMCACHEBLKS(x) (((x)+SMP_CACHE_BYTES-1)/SMP_CACHE_BYTES)
146
+#define NUMCACHEBLKS(x) DIV_ROUND_UP(x, SMP_CACHE_BYTES)
160147
161148 #define SBMAC_MAX_TXDESCR 256
162149 #define SBMAC_MAX_RXDESCR 256
....@@ -307,7 +294,7 @@
307294 enum sbmac_fc fc);
308295
309296 static int sbmac_open(struct net_device *dev);
310
-static void sbmac_tx_timeout (struct net_device *dev);
297
+static void sbmac_tx_timeout (struct net_device *dev, unsigned int txqueue);
311298 static void sbmac_set_rx_mode(struct net_device *dev);
312299 static int sbmac_mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
313300 static int sbmac_close(struct net_device *dev);
....@@ -1288,7 +1275,7 @@
12881275 * for transmits, we just free buffers.
12891276 */
12901277
1291
- dev_kfree_skb_irq(sb);
1278
+ dev_consume_skb_irq(sb);
12921279
12931280 /*
12941281 * .. and advance to the next buffer.
....@@ -2357,20 +2344,10 @@
23572344 }
23582345
23592346 /* Remove any features not supported by the controller */
2360
- phy_dev->supported &= SUPPORTED_10baseT_Half |
2361
- SUPPORTED_10baseT_Full |
2362
- SUPPORTED_100baseT_Half |
2363
- SUPPORTED_100baseT_Full |
2364
- SUPPORTED_1000baseT_Half |
2365
- SUPPORTED_1000baseT_Full |
2366
- SUPPORTED_Autoneg |
2367
- SUPPORTED_MII |
2368
- SUPPORTED_Pause |
2369
- SUPPORTED_Asym_Pause;
2347
+ phy_set_max_speed(phy_dev, SPEED_1000);
2348
+ phy_support_asym_pause(phy_dev);
23702349
23712350 phy_attached_info(phy_dev);
2372
-
2373
- phy_dev->advertising = phy_dev->supported;
23742351
23752352 sc->phy_dev = phy_dev;
23762353
....@@ -2442,7 +2419,7 @@
24422419 }
24432420
24442421
2445
-static void sbmac_tx_timeout (struct net_device *dev)
2422
+static void sbmac_tx_timeout (struct net_device *dev, unsigned int txqueue)
24462423 {
24472424 struct sbmac_softc *sc = netdev_priv(dev);
24482425 unsigned long flags;
....@@ -2560,7 +2537,7 @@
25602537
25612538 res = platform_get_resource(pldev, IORESOURCE_MEM, 0);
25622539 BUG_ON(!res);
2563
- sbm_base = ioremap_nocache(res->start, resource_size(res));
2540
+ sbm_base = ioremap(res->start, resource_size(res));
25642541 if (!sbm_base) {
25652542 printk(KERN_ERR "%s: unable to map device registers\n",
25662543 dev_name(&pldev->dev));