diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2009-07-08 14:10:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-08 14:10:56 -0400 |
commit | bff38771e1065c7fc3de87e47ba366151eea573c (patch) | |
tree | 215ae8b2dc2ec9b6c0d85c9d1048e585df314075 /net/core/netpoll.c | |
parent | 34701fde8f4bf207ca96d10b8700a8667157854c (diff) |
netpoll: Introduce netpoll_carrier_timeout kernel option
Some PHYs require longer timeouts for carrier detection, and
auto-negotiation process may take indefinite amount of time.
It may be inconvenient to force longer timeouts for sane PHYs,
so let's introduce a kernel command line option.
Since we're using module_param(), the option also can be
changed in runtime.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/netpoll.c')
-rw-r--r-- | net/core/netpoll.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 9675f312830d..3afe381e24a5 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -9,6 +9,7 @@ | |||
9 | * Copyright (C) 2002 Red Hat, Inc. | 9 | * Copyright (C) 2002 Red Hat, Inc. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/moduleparam.h> | ||
12 | #include <linux/netdevice.h> | 13 | #include <linux/netdevice.h> |
13 | #include <linux/etherdevice.h> | 14 | #include <linux/etherdevice.h> |
14 | #include <linux/string.h> | 15 | #include <linux/string.h> |
@@ -50,6 +51,9 @@ static atomic_t trapped; | |||
50 | static void zap_completion_queue(void); | 51 | static void zap_completion_queue(void); |
51 | static void arp_reply(struct sk_buff *skb); | 52 | static void arp_reply(struct sk_buff *skb); |
52 | 53 | ||
54 | static unsigned int carrier_timeout = 4; | ||
55 | module_param(carrier_timeout, uint, 0644); | ||
56 | |||
53 | static void queue_process(struct work_struct *work) | 57 | static void queue_process(struct work_struct *work) |
54 | { | 58 | { |
55 | struct netpoll_info *npinfo = | 59 | struct netpoll_info *npinfo = |
@@ -732,7 +736,7 @@ int netpoll_setup(struct netpoll *np) | |||
732 | } | 736 | } |
733 | 737 | ||
734 | atleast = jiffies + HZ/10; | 738 | atleast = jiffies + HZ/10; |
735 | atmost = jiffies + 4*HZ; | 739 | atmost = jiffies + carrier_timeout * HZ; |
736 | while (!netif_carrier_ok(ndev)) { | 740 | while (!netif_carrier_ok(ndev)) { |
737 | if (time_after(jiffies, atmost)) { | 741 | if (time_after(jiffies, atmost)) { |
738 | printk(KERN_NOTICE | 742 | printk(KERN_NOTICE |