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 | |
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>
-rw-r--r-- | Documentation/kernel-parameters.txt | 5 | ||||
-rw-r--r-- | net/core/netpoll.c | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index d77fbd8b79a..9347f4ad434 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -1531,6 +1531,11 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1531 | symbolic names: lapic and ioapic | 1531 | symbolic names: lapic and ioapic |
1532 | Example: nmi_watchdog=2 or nmi_watchdog=panic,lapic | 1532 | Example: nmi_watchdog=2 or nmi_watchdog=panic,lapic |
1533 | 1533 | ||
1534 | netpoll.carrier_timeout= | ||
1535 | [NET] Specifies amount of time (in seconds) that | ||
1536 | netpoll should wait for a carrier. By default netpoll | ||
1537 | waits 4 seconds. | ||
1538 | |||
1534 | no387 [BUGS=X86-32] Tells the kernel to use the 387 maths | 1539 | no387 [BUGS=X86-32] Tells the kernel to use the 387 maths |
1535 | emulation library even if a 387 maths coprocessor | 1540 | emulation library even if a 387 maths coprocessor |
1536 | is present. | 1541 | is present. |
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 9675f312830..3afe381e24a 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 |