.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc. |
---|
3 | 4 | * All rights reserved. |
---|
4 | | - * |
---|
5 | | - * This software may be redistributed and/or modified under |
---|
6 | | - * the terms of the GNU General Public License as published by the Free |
---|
7 | | - * Software Foundation; either version 2 of the License, or |
---|
8 | | - * any later version. |
---|
9 | | - * |
---|
10 | | - * This program is distributed in the hope that it will be useful, but |
---|
11 | | - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
---|
12 | | - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
---|
13 | | - * for more details. |
---|
14 | 5 | * |
---|
15 | 6 | * File: via-velocity.h |
---|
16 | 7 | * |
---|
.. | .. |
---|
1295 | 1286 | velocity_mii_read((p),MII_PHYSID1,((u16 *) &id)+1);\ |
---|
1296 | 1287 | (id);}) |
---|
1297 | 1288 | |
---|
1298 | | -/* |
---|
1299 | | - * Inline debug routine |
---|
1300 | | - */ |
---|
1301 | | - |
---|
1302 | | - |
---|
1303 | | -enum velocity_msg_level { |
---|
1304 | | - MSG_LEVEL_ERR = 0, //Errors that will cause abnormal operation. |
---|
1305 | | - MSG_LEVEL_NOTICE = 1, //Some errors need users to be notified. |
---|
1306 | | - MSG_LEVEL_INFO = 2, //Normal message. |
---|
1307 | | - MSG_LEVEL_VERBOSE = 3, //Will report all trival errors. |
---|
1308 | | - MSG_LEVEL_DEBUG = 4 //Only for debug purpose. |
---|
1309 | | -}; |
---|
1310 | | - |
---|
1311 | | -#ifdef VELOCITY_DEBUG |
---|
1312 | | -#define ASSERT(x) { \ |
---|
1313 | | - if (!(x)) { \ |
---|
1314 | | - printk(KERN_ERR "assertion %s failed: file %s line %d\n", #x,\ |
---|
1315 | | - __func__, __LINE__);\ |
---|
1316 | | - BUG(); \ |
---|
1317 | | - }\ |
---|
1318 | | -} |
---|
1319 | | -#define VELOCITY_DBG(p,args...) printk(p, ##args) |
---|
1320 | | -#else |
---|
1321 | | -#define ASSERT(x) |
---|
1322 | | -#define VELOCITY_DBG(x) |
---|
1323 | | -#endif |
---|
1324 | | - |
---|
1325 | | -#define VELOCITY_PRT(l, p, args...) do {if (l<=msglevel) printk( p ,##args);} while (0) |
---|
1326 | | - |
---|
1327 | | -#define VELOCITY_PRT_CAMMASK(p,t) {\ |
---|
1328 | | - int i;\ |
---|
1329 | | - if ((t)==VELOCITY_MULTICAST_CAM) {\ |
---|
1330 | | - for (i=0;i<(MCAM_SIZE/8);i++)\ |
---|
1331 | | - printk("%02X",(p)->mCAMmask[i]);\ |
---|
1332 | | - }\ |
---|
1333 | | - else {\ |
---|
1334 | | - for (i=0;i<(VCAM_SIZE/8);i++)\ |
---|
1335 | | - printk("%02X",(p)->vCAMmask[i]);\ |
---|
1336 | | - }\ |
---|
1337 | | - printk("\n");\ |
---|
1338 | | -} |
---|
1339 | | - |
---|
1340 | | - |
---|
1341 | | - |
---|
1342 | 1289 | #define VELOCITY_WOL_MAGIC 0x00000000UL |
---|
1343 | 1290 | #define VELOCITY_WOL_PHY 0x00000001UL |
---|
1344 | 1291 | #define VELOCITY_WOL_ARP 0x00000002UL |
---|
.. | .. |
---|
1492 | 1439 | struct velocity_context context; |
---|
1493 | 1440 | |
---|
1494 | 1441 | u32 ticks; |
---|
| 1442 | + u32 ethtool_ops_nesting; |
---|
1495 | 1443 | |
---|
1496 | 1444 | u8 rev_id; |
---|
1497 | 1445 | |
---|
.. | .. |
---|
1518 | 1466 | rcu_read_lock(); |
---|
1519 | 1467 | in_dev = __in_dev_get_rcu(vptr->netdev); |
---|
1520 | 1468 | if (in_dev != NULL) { |
---|
1521 | | - ifa = (struct in_ifaddr *) in_dev->ifa_list; |
---|
| 1469 | + ifa = rcu_dereference(in_dev->ifa_list); |
---|
1522 | 1470 | if (ifa != NULL) { |
---|
1523 | 1471 | memcpy(vptr->ip_addr, &ifa->ifa_address, 4); |
---|
1524 | 1472 | res = 0; |
---|