| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2001,2002,2003,2004 Broadcom Corporation |
|---|
| 3 | 4 | * 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 | | - * |
|---|
| 18 | 5 | * |
|---|
| 19 | 6 | * This driver is designed for the Broadcom SiByte SOC built-in |
|---|
| 20 | 7 | * Ethernet controllers. Written by Mitch Lichtenberg at Broadcom Corp. |
|---|
| .. | .. |
|---|
| 156 | 143 | (d)->sbdma_dscrtable : (d)->f+1) |
|---|
| 157 | 144 | |
|---|
| 158 | 145 | |
|---|
| 159 | | -#define NUMCACHEBLKS(x) (((x)+SMP_CACHE_BYTES-1)/SMP_CACHE_BYTES) |
|---|
| 146 | +#define NUMCACHEBLKS(x) DIV_ROUND_UP(x, SMP_CACHE_BYTES) |
|---|
| 160 | 147 | |
|---|
| 161 | 148 | #define SBMAC_MAX_TXDESCR 256 |
|---|
| 162 | 149 | #define SBMAC_MAX_RXDESCR 256 |
|---|
| .. | .. |
|---|
| 307 | 294 | enum sbmac_fc fc); |
|---|
| 308 | 295 | |
|---|
| 309 | 296 | 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); |
|---|
| 311 | 298 | static void sbmac_set_rx_mode(struct net_device *dev); |
|---|
| 312 | 299 | static int sbmac_mii_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); |
|---|
| 313 | 300 | static int sbmac_close(struct net_device *dev); |
|---|
| .. | .. |
|---|
| 1288 | 1275 | * for transmits, we just free buffers. |
|---|
| 1289 | 1276 | */ |
|---|
| 1290 | 1277 | |
|---|
| 1291 | | - dev_kfree_skb_irq(sb); |
|---|
| 1278 | + dev_consume_skb_irq(sb); |
|---|
| 1292 | 1279 | |
|---|
| 1293 | 1280 | /* |
|---|
| 1294 | 1281 | * .. and advance to the next buffer. |
|---|
| .. | .. |
|---|
| 2357 | 2344 | } |
|---|
| 2358 | 2345 | |
|---|
| 2359 | 2346 | /* 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); |
|---|
| 2370 | 2349 | |
|---|
| 2371 | 2350 | phy_attached_info(phy_dev); |
|---|
| 2372 | | - |
|---|
| 2373 | | - phy_dev->advertising = phy_dev->supported; |
|---|
| 2374 | 2351 | |
|---|
| 2375 | 2352 | sc->phy_dev = phy_dev; |
|---|
| 2376 | 2353 | |
|---|
| .. | .. |
|---|
| 2442 | 2419 | } |
|---|
| 2443 | 2420 | |
|---|
| 2444 | 2421 | |
|---|
| 2445 | | -static void sbmac_tx_timeout (struct net_device *dev) |
|---|
| 2422 | +static void sbmac_tx_timeout (struct net_device *dev, unsigned int txqueue) |
|---|
| 2446 | 2423 | { |
|---|
| 2447 | 2424 | struct sbmac_softc *sc = netdev_priv(dev); |
|---|
| 2448 | 2425 | unsigned long flags; |
|---|
| .. | .. |
|---|
| 2560 | 2537 | |
|---|
| 2561 | 2538 | res = platform_get_resource(pldev, IORESOURCE_MEM, 0); |
|---|
| 2562 | 2539 | BUG_ON(!res); |
|---|
| 2563 | | - sbm_base = ioremap_nocache(res->start, resource_size(res)); |
|---|
| 2540 | + sbm_base = ioremap(res->start, resource_size(res)); |
|---|
| 2564 | 2541 | if (!sbm_base) { |
|---|
| 2565 | 2542 | printk(KERN_ERR "%s: unable to map device registers\n", |
|---|
| 2566 | 2543 | dev_name(&pldev->dev)); |
|---|