diff options
author | Andrew Victor <andrew@sanpeople.com> | 2006-12-05 08:21:19 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-07 04:58:32 -0500 |
commit | cf42553ab43e102bc98eca05523d2390a1eedde9 (patch) | |
tree | dab613b886543e98c66d40ac44912ae6acabee66 /drivers | |
parent | c57ee096b6caf8f7e17abe46185d24f2b649b9f9 (diff) |
[PATCH] AT91RM9200 Ethernet: Move check_timer variable and use mod_timer()
Move the global 'check_timer' variable into the private data structure.
Also now use mod_timer().
Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/arm/at91_ether.c | 16 | ||||
-rw-r--r-- | drivers/net/arm/at91_ether.h | 1 |
2 files changed, 8 insertions, 9 deletions
diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c index 58da5b773350..918368cdb766 100644 --- a/drivers/net/arm/at91_ether.c +++ b/drivers/net/arm/at91_ether.c | |||
@@ -41,7 +41,6 @@ | |||
41 | #define DRV_NAME "at91_ether" | 41 | #define DRV_NAME "at91_ether" |
42 | #define DRV_VERSION "1.0" | 42 | #define DRV_VERSION "1.0" |
43 | 43 | ||
44 | static struct timer_list check_timer; | ||
45 | #define LINK_POLL_INTERVAL (HZ) | 44 | #define LINK_POLL_INTERVAL (HZ) |
46 | 45 | ||
47 | /* ..................................................................... */ | 46 | /* ..................................................................... */ |
@@ -250,8 +249,7 @@ static void enable_phyirq(struct net_device *dev) | |||
250 | * PHY doesn't have an IRQ pin (RTL8201, DP83847, AC101L), | 249 | * PHY doesn't have an IRQ pin (RTL8201, DP83847, AC101L), |
251 | * or board does not have it connected. | 250 | * or board does not have it connected. |
252 | */ | 251 | */ |
253 | check_timer.expires = jiffies + LINK_POLL_INTERVAL; | 252 | mod_timer(&lp->check_timer, jiffies + LINK_POLL_INTERVAL); |
254 | add_timer(&check_timer); | ||
255 | return; | 253 | return; |
256 | } | 254 | } |
257 | 255 | ||
@@ -298,7 +296,7 @@ static void disable_phyirq(struct net_device *dev) | |||
298 | 296 | ||
299 | irq_number = lp->board_data.phy_irq_pin; | 297 | irq_number = lp->board_data.phy_irq_pin; |
300 | if (!irq_number) { | 298 | if (!irq_number) { |
301 | del_timer_sync(&check_timer); | 299 | del_timer_sync(&lp->check_timer); |
302 | return; | 300 | return; |
303 | } | 301 | } |
304 | 302 | ||
@@ -360,13 +358,13 @@ static void reset_phy(struct net_device *dev) | |||
360 | static void at91ether_check_link(unsigned long dev_id) | 358 | static void at91ether_check_link(unsigned long dev_id) |
361 | { | 359 | { |
362 | struct net_device *dev = (struct net_device *) dev_id; | 360 | struct net_device *dev = (struct net_device *) dev_id; |
361 | struct at91_private *lp = netdev_priv(dev); | ||
363 | 362 | ||
364 | enable_mdi(); | 363 | enable_mdi(); |
365 | update_linkspeed(dev, 1); | 364 | update_linkspeed(dev, 1); |
366 | disable_mdi(); | 365 | disable_mdi(); |
367 | 366 | ||
368 | check_timer.expires = jiffies + LINK_POLL_INTERVAL; | 367 | mod_timer(&lp->check_timer, jiffies + LINK_POLL_INTERVAL); |
369 | add_timer(&check_timer); | ||
370 | } | 368 | } |
371 | 369 | ||
372 | /* ......................... ADDRESS MANAGEMENT ........................ */ | 370 | /* ......................... ADDRESS MANAGEMENT ........................ */ |
@@ -1030,9 +1028,9 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add | |||
1030 | 1028 | ||
1031 | /* If board has no PHY IRQ, use a timer to poll the PHY */ | 1029 | /* If board has no PHY IRQ, use a timer to poll the PHY */ |
1032 | if (!lp->board_data.phy_irq_pin) { | 1030 | if (!lp->board_data.phy_irq_pin) { |
1033 | init_timer(&check_timer); | 1031 | init_timer(&lp->check_timer); |
1034 | check_timer.data = (unsigned long)dev; | 1032 | lp->check_timer.data = (unsigned long)dev; |
1035 | check_timer.function = at91ether_check_link; | 1033 | lp->check_timer.function = at91ether_check_link; |
1036 | } | 1034 | } |
1037 | 1035 | ||
1038 | /* Display ethernet banner */ | 1036 | /* Display ethernet banner */ |
diff --git a/drivers/net/arm/at91_ether.h b/drivers/net/arm/at91_ether.h index d1e72e02be3a..b6b665de2ea0 100644 --- a/drivers/net/arm/at91_ether.h +++ b/drivers/net/arm/at91_ether.h | |||
@@ -87,6 +87,7 @@ struct at91_private | |||
87 | spinlock_t lock; /* lock for MDI interface */ | 87 | spinlock_t lock; /* lock for MDI interface */ |
88 | short phy_media; /* media interface type */ | 88 | short phy_media; /* media interface type */ |
89 | unsigned short phy_address; /* 5-bit MDI address of PHY (0..31) */ | 89 | unsigned short phy_address; /* 5-bit MDI address of PHY (0..31) */ |
90 | struct timer_list check_timer; /* Poll link status */ | ||
90 | 91 | ||
91 | /* Transmit */ | 92 | /* Transmit */ |
92 | struct sk_buff *skb; /* holds skb until xmit interrupt completes */ | 93 | struct sk_buff *skb; /* holds skb until xmit interrupt completes */ |