aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/via-velocity.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/via-velocity.h')
-rw-r--r--drivers/net/via-velocity.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/via-velocity.h b/drivers/net/via-velocity.h
index f7b33ae7a703..aa2e69b9ff61 100644
--- a/drivers/net/via-velocity.h
+++ b/drivers/net/via-velocity.h
@@ -848,7 +848,7 @@ enum velocity_owner {
848 * Bits in CHIPGCR register 848 * Bits in CHIPGCR register
849 */ 849 */
850 850
851#define CHIPGCR_FCGMII 0x80 851#define CHIPGCR_FCGMII 0x80 /* enable GMII mode */
852#define CHIPGCR_FCFDX 0x40 852#define CHIPGCR_FCFDX 0x40
853#define CHIPGCR_FCRESV 0x20 853#define CHIPGCR_FCRESV 0x20
854#define CHIPGCR_FCMODE 0x10 854#define CHIPGCR_FCMODE 0x10
@@ -1390,7 +1390,8 @@ enum speed_opt {
1390 SPD_DPX_100_HALF = 1, 1390 SPD_DPX_100_HALF = 1,
1391 SPD_DPX_100_FULL = 2, 1391 SPD_DPX_100_FULL = 2,
1392 SPD_DPX_10_HALF = 3, 1392 SPD_DPX_10_HALF = 3,
1393 SPD_DPX_10_FULL = 4 1393 SPD_DPX_10_FULL = 4,
1394 SPD_DPX_1000_FULL = 5
1394}; 1395};
1395 1396
1396enum velocity_init_type { 1397enum velocity_init_type {
@@ -1504,22 +1505,25 @@ struct velocity_info {
1504 * addresses on this chain then we use the first - multi-IP WOL is not 1505 * addresses on this chain then we use the first - multi-IP WOL is not
1505 * supported. 1506 * supported.
1506 * 1507 *
1507 * CHECK ME: locking
1508 */ 1508 */
1509 1509
1510static inline int velocity_get_ip(struct velocity_info *vptr) 1510static inline int velocity_get_ip(struct velocity_info *vptr)
1511{ 1511{
1512 struct in_device *in_dev = (struct in_device *) vptr->dev->ip_ptr; 1512 struct in_device *in_dev;
1513 struct in_ifaddr *ifa; 1513 struct in_ifaddr *ifa;
1514 int res = -ENOENT;
1514 1515
1516 rcu_read_lock();
1517 in_dev = __in_dev_get_rcu(vptr->dev);
1515 if (in_dev != NULL) { 1518 if (in_dev != NULL) {
1516 ifa = (struct in_ifaddr *) in_dev->ifa_list; 1519 ifa = (struct in_ifaddr *) in_dev->ifa_list;
1517 if (ifa != NULL) { 1520 if (ifa != NULL) {
1518 memcpy(vptr->ip_addr, &ifa->ifa_address, 4); 1521 memcpy(vptr->ip_addr, &ifa->ifa_address, 4);
1519 return 0; 1522 res = 0;
1520 } 1523 }
1521 } 1524 }
1522 return -ENOENT; 1525 rcu_read_unlock();
1526 return res;
1523} 1527}
1524 1528
1525/** 1529/**