aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2009-07-08 14:10:56 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-08 14:10:56 -0400
commitbff38771e1065c7fc3de87e47ba366151eea573c (patch)
tree215ae8b2dc2ec9b6c0d85c9d1048e585df314075 /net/core
parent34701fde8f4bf207ca96d10b8700a8667157854c (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')
-rw-r--r--net/core/netpoll.c6
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;
50static void zap_completion_queue(void); 51static void zap_completion_queue(void);
51static void arp_reply(struct sk_buff *skb); 52static void arp_reply(struct sk_buff *skb);
52 53
54static unsigned int carrier_timeout = 4;
55module_param(carrier_timeout, uint, 0644);
56
53static void queue_process(struct work_struct *work) 57static 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