diff options
author | Jianjun Kong <jianjun@zeuux.org> | 2009-04-20 00:05:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-21 05:02:53 -0400 |
commit | d035fbccc4edd2bd69d9314faf03ba832b85a1d7 (patch) | |
tree | b63c9fc4166e8fc90e309835173e60a11e5def5c /drivers/net/8139too.c | |
parent | b1b67dd45a6b629eb41553856805aaa1614fbb83 (diff) |
rtl8139: unify the struct's name
unify the struct's name of "struct rtl8139_private *np" to "struct rtl8139_private *tp"
most of them like this:
struct rtl8139_private *tp = netdev_priv(dev);
Signed-off-by: Amos Kong <jianjun@zeuux.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/8139too.c')
-rw-r--r-- | drivers/net/8139too.c | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index 29df398b7727..00fe1301a9c4 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c | |||
@@ -2292,11 +2292,11 @@ static int rtl8139_close (struct net_device *dev) | |||
2292 | other threads or interrupts aren't messing with the 8139. */ | 2292 | other threads or interrupts aren't messing with the 8139. */ |
2293 | static void rtl8139_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | 2293 | static void rtl8139_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) |
2294 | { | 2294 | { |
2295 | struct rtl8139_private *np = netdev_priv(dev); | 2295 | struct rtl8139_private *tp = netdev_priv(dev); |
2296 | void __iomem *ioaddr = np->mmio_addr; | 2296 | void __iomem *ioaddr = tp->mmio_addr; |
2297 | 2297 | ||
2298 | spin_lock_irq(&np->lock); | 2298 | spin_lock_irq(&tp->lock); |
2299 | if (rtl_chip_info[np->chipset].flags & HasLWake) { | 2299 | if (rtl_chip_info[tp->chipset].flags & HasLWake) { |
2300 | u8 cfg3 = RTL_R8 (Config3); | 2300 | u8 cfg3 = RTL_R8 (Config3); |
2301 | u8 cfg5 = RTL_R8 (Config5); | 2301 | u8 cfg5 = RTL_R8 (Config5); |
2302 | 2302 | ||
@@ -2317,7 +2317,7 @@ static void rtl8139_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | |||
2317 | if (cfg5 & Cfg5_BWF) | 2317 | if (cfg5 & Cfg5_BWF) |
2318 | wol->wolopts |= WAKE_BCAST; | 2318 | wol->wolopts |= WAKE_BCAST; |
2319 | } | 2319 | } |
2320 | spin_unlock_irq(&np->lock); | 2320 | spin_unlock_irq(&tp->lock); |
2321 | } | 2321 | } |
2322 | 2322 | ||
2323 | 2323 | ||
@@ -2326,19 +2326,19 @@ static void rtl8139_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | |||
2326 | aren't messing with the 8139. */ | 2326 | aren't messing with the 8139. */ |
2327 | static int rtl8139_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | 2327 | static int rtl8139_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) |
2328 | { | 2328 | { |
2329 | struct rtl8139_private *np = netdev_priv(dev); | 2329 | struct rtl8139_private *tp = netdev_priv(dev); |
2330 | void __iomem *ioaddr = np->mmio_addr; | 2330 | void __iomem *ioaddr = tp->mmio_addr; |
2331 | u32 support; | 2331 | u32 support; |
2332 | u8 cfg3, cfg5; | 2332 | u8 cfg3, cfg5; |
2333 | 2333 | ||
2334 | support = ((rtl_chip_info[np->chipset].flags & HasLWake) | 2334 | support = ((rtl_chip_info[tp->chipset].flags & HasLWake) |
2335 | ? (WAKE_PHY | WAKE_MAGIC | 2335 | ? (WAKE_PHY | WAKE_MAGIC |
2336 | | WAKE_UCAST | WAKE_MCAST | WAKE_BCAST) | 2336 | | WAKE_UCAST | WAKE_MCAST | WAKE_BCAST) |
2337 | : 0); | 2337 | : 0); |
2338 | if (wol->wolopts & ~support) | 2338 | if (wol->wolopts & ~support) |
2339 | return -EINVAL; | 2339 | return -EINVAL; |
2340 | 2340 | ||
2341 | spin_lock_irq(&np->lock); | 2341 | spin_lock_irq(&tp->lock); |
2342 | cfg3 = RTL_R8 (Config3) & ~(Cfg3_LinkUp | Cfg3_Magic); | 2342 | cfg3 = RTL_R8 (Config3) & ~(Cfg3_LinkUp | Cfg3_Magic); |
2343 | if (wol->wolopts & WAKE_PHY) | 2343 | if (wol->wolopts & WAKE_PHY) |
2344 | cfg3 |= Cfg3_LinkUp; | 2344 | cfg3 |= Cfg3_LinkUp; |
@@ -2359,87 +2359,87 @@ static int rtl8139_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | |||
2359 | if (wol->wolopts & WAKE_BCAST) | 2359 | if (wol->wolopts & WAKE_BCAST) |
2360 | cfg5 |= Cfg5_BWF; | 2360 | cfg5 |= Cfg5_BWF; |
2361 | RTL_W8 (Config5, cfg5); /* need not unlock via Cfg9346 */ | 2361 | RTL_W8 (Config5, cfg5); /* need not unlock via Cfg9346 */ |
2362 | spin_unlock_irq(&np->lock); | 2362 | spin_unlock_irq(&tp->lock); |
2363 | 2363 | ||
2364 | return 0; | 2364 | return 0; |
2365 | } | 2365 | } |
2366 | 2366 | ||
2367 | static void rtl8139_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) | 2367 | static void rtl8139_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) |
2368 | { | 2368 | { |
2369 | struct rtl8139_private *np = netdev_priv(dev); | 2369 | struct rtl8139_private *tp = netdev_priv(dev); |
2370 | strcpy(info->driver, DRV_NAME); | 2370 | strcpy(info->driver, DRV_NAME); |
2371 | strcpy(info->version, DRV_VERSION); | 2371 | strcpy(info->version, DRV_VERSION); |
2372 | strcpy(info->bus_info, pci_name(np->pci_dev)); | 2372 | strcpy(info->bus_info, pci_name(tp->pci_dev)); |
2373 | info->regdump_len = np->regs_len; | 2373 | info->regdump_len = tp->regs_len; |
2374 | } | 2374 | } |
2375 | 2375 | ||
2376 | static int rtl8139_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | 2376 | static int rtl8139_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) |
2377 | { | 2377 | { |
2378 | struct rtl8139_private *np = netdev_priv(dev); | 2378 | struct rtl8139_private *tp = netdev_priv(dev); |
2379 | spin_lock_irq(&np->lock); | 2379 | spin_lock_irq(&tp->lock); |
2380 | mii_ethtool_gset(&np->mii, cmd); | 2380 | mii_ethtool_gset(&tp->mii, cmd); |
2381 | spin_unlock_irq(&np->lock); | 2381 | spin_unlock_irq(&tp->lock); |
2382 | return 0; | 2382 | return 0; |
2383 | } | 2383 | } |
2384 | 2384 | ||
2385 | static int rtl8139_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | 2385 | static int rtl8139_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) |
2386 | { | 2386 | { |
2387 | struct rtl8139_private *np = netdev_priv(dev); | 2387 | struct rtl8139_private *tp = netdev_priv(dev); |
2388 | int rc; | 2388 | int rc; |
2389 | spin_lock_irq(&np->lock); | 2389 | spin_lock_irq(&tp->lock); |
2390 | rc = mii_ethtool_sset(&np->mii, cmd); | 2390 | rc = mii_ethtool_sset(&tp->mii, cmd); |
2391 | spin_unlock_irq(&np->lock); | 2391 | spin_unlock_irq(&tp->lock); |
2392 | return rc; | 2392 | return rc; |
2393 | } | 2393 | } |
2394 | 2394 | ||
2395 | static int rtl8139_nway_reset(struct net_device *dev) | 2395 | static int rtl8139_nway_reset(struct net_device *dev) |
2396 | { | 2396 | { |
2397 | struct rtl8139_private *np = netdev_priv(dev); | 2397 | struct rtl8139_private *tp = netdev_priv(dev); |
2398 | return mii_nway_restart(&np->mii); | 2398 | return mii_nway_restart(&tp->mii); |
2399 | } | 2399 | } |
2400 | 2400 | ||
2401 | static u32 rtl8139_get_link(struct net_device *dev) | 2401 | static u32 rtl8139_get_link(struct net_device *dev) |
2402 | { | 2402 | { |
2403 | struct rtl8139_private *np = netdev_priv(dev); | 2403 | struct rtl8139_private *tp = netdev_priv(dev); |
2404 | return mii_link_ok(&np->mii); | 2404 | return mii_link_ok(&tp->mii); |
2405 | } | 2405 | } |
2406 | 2406 | ||
2407 | static u32 rtl8139_get_msglevel(struct net_device *dev) | 2407 | static u32 rtl8139_get_msglevel(struct net_device *dev) |
2408 | { | 2408 | { |
2409 | struct rtl8139_private *np = netdev_priv(dev); | 2409 | struct rtl8139_private *tp = netdev_priv(dev); |
2410 | return np->msg_enable; | 2410 | return tp->msg_enable; |
2411 | } | 2411 | } |
2412 | 2412 | ||
2413 | static void rtl8139_set_msglevel(struct net_device *dev, u32 datum) | 2413 | static void rtl8139_set_msglevel(struct net_device *dev, u32 datum) |
2414 | { | 2414 | { |
2415 | struct rtl8139_private *np = netdev_priv(dev); | 2415 | struct rtl8139_private *tp = netdev_priv(dev); |
2416 | np->msg_enable = datum; | 2416 | tp->msg_enable = datum; |
2417 | } | 2417 | } |
2418 | 2418 | ||
2419 | static int rtl8139_get_regs_len(struct net_device *dev) | 2419 | static int rtl8139_get_regs_len(struct net_device *dev) |
2420 | { | 2420 | { |
2421 | struct rtl8139_private *np; | 2421 | struct rtl8139_private *tp; |
2422 | /* TODO: we are too slack to do reg dumping for pio, for now */ | 2422 | /* TODO: we are too slack to do reg dumping for pio, for now */ |
2423 | if (use_io) | 2423 | if (use_io) |
2424 | return 0; | 2424 | return 0; |
2425 | np = netdev_priv(dev); | 2425 | tp = netdev_priv(dev); |
2426 | return np->regs_len; | 2426 | return tp->regs_len; |
2427 | } | 2427 | } |
2428 | 2428 | ||
2429 | static void rtl8139_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *regbuf) | 2429 | static void rtl8139_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *regbuf) |
2430 | { | 2430 | { |
2431 | struct rtl8139_private *np; | 2431 | struct rtl8139_private *tp; |
2432 | 2432 | ||
2433 | /* TODO: we are too slack to do reg dumping for pio, for now */ | 2433 | /* TODO: we are too slack to do reg dumping for pio, for now */ |
2434 | if (use_io) | 2434 | if (use_io) |
2435 | return; | 2435 | return; |
2436 | np = netdev_priv(dev); | 2436 | tp = netdev_priv(dev); |
2437 | 2437 | ||
2438 | regs->version = RTL_REGS_VER; | 2438 | regs->version = RTL_REGS_VER; |
2439 | 2439 | ||
2440 | spin_lock_irq(&np->lock); | 2440 | spin_lock_irq(&tp->lock); |
2441 | memcpy_fromio(regbuf, np->mmio_addr, regs->len); | 2441 | memcpy_fromio(regbuf, tp->mmio_addr, regs->len); |
2442 | spin_unlock_irq(&np->lock); | 2442 | spin_unlock_irq(&tp->lock); |
2443 | } | 2443 | } |
2444 | 2444 | ||
2445 | static int rtl8139_get_sset_count(struct net_device *dev, int sset) | 2445 | static int rtl8139_get_sset_count(struct net_device *dev, int sset) |
@@ -2454,12 +2454,12 @@ static int rtl8139_get_sset_count(struct net_device *dev, int sset) | |||
2454 | 2454 | ||
2455 | static void rtl8139_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *stats, u64 *data) | 2455 | static void rtl8139_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *stats, u64 *data) |
2456 | { | 2456 | { |
2457 | struct rtl8139_private *np = netdev_priv(dev); | 2457 | struct rtl8139_private *tp = netdev_priv(dev); |
2458 | 2458 | ||
2459 | data[0] = np->xstats.early_rx; | 2459 | data[0] = tp->xstats.early_rx; |
2460 | data[1] = np->xstats.tx_buf_mapped; | 2460 | data[1] = tp->xstats.tx_buf_mapped; |
2461 | data[2] = np->xstats.tx_timeouts; | 2461 | data[2] = tp->xstats.tx_timeouts; |
2462 | data[3] = np->xstats.rx_lost_in_ring; | 2462 | data[3] = tp->xstats.rx_lost_in_ring; |
2463 | } | 2463 | } |
2464 | 2464 | ||
2465 | static void rtl8139_get_strings(struct net_device *dev, u32 stringset, u8 *data) | 2465 | static void rtl8139_get_strings(struct net_device *dev, u32 stringset, u8 *data) |
@@ -2486,15 +2486,15 @@ static const struct ethtool_ops rtl8139_ethtool_ops = { | |||
2486 | 2486 | ||
2487 | static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | 2487 | static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) |
2488 | { | 2488 | { |
2489 | struct rtl8139_private *np = netdev_priv(dev); | 2489 | struct rtl8139_private *tp = netdev_priv(dev); |
2490 | int rc; | 2490 | int rc; |
2491 | 2491 | ||
2492 | if (!netif_running(dev)) | 2492 | if (!netif_running(dev)) |
2493 | return -EINVAL; | 2493 | return -EINVAL; |
2494 | 2494 | ||
2495 | spin_lock_irq(&np->lock); | 2495 | spin_lock_irq(&tp->lock); |
2496 | rc = generic_mii_ioctl(&np->mii, if_mii(rq), cmd, NULL); | 2496 | rc = generic_mii_ioctl(&tp->mii, if_mii(rq), cmd, NULL); |
2497 | spin_unlock_irq(&np->lock); | 2497 | spin_unlock_irq(&tp->lock); |
2498 | 2498 | ||
2499 | return rc; | 2499 | return rc; |
2500 | } | 2500 | } |