[RFC][PATCH] Allow change timing values to wait slow devices bring up before try register an interface to IP-Config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sorry for previous attached patch in email.

--tm


>From e414000eed1a951bf03f125f5307bc1edffcecf1 Mon Sep 17 00:00:00 2001
From: Tiago Maluta <maluta@xxxxxxxxxxxxx>
Date: Wed, 10 Feb 2010 03:34:49 +0000
Subject: [RFC][PATCH] Allow change timing values to wait slow devices
bring up before try register an interface
 to IP-Config (used on some drivers using Multi-purpose USB Networking
Framework)


Signed-off-by: Tiago Maluta <maluta@xxxxxxxxxxxxx>
---
 drivers/net/Kconfig |   18 ++++++++++++++++++
 net/ipv4/ipconfig.c |    4 ++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index dd9a09c..12fbe4a 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -38,6 +38,24 @@ config IFB
 	  'ifb1' etc.
 	  Look at the iproute2 documentation directory for usage etc

+config NETDEVICES_DELAY_PRE_OPEN
+	int "Define the delay before opening net devices (ms)"
+	depends on NETDEVICES
+	default 500
+	help
+	    Some devices may not work properly due to a delay from hardware bring
+	    the interface up. This value add a delay, in miilliseconds, before
+	    kernel search and register the interface. Default value is 500ms.
+
+config NETDEVICES_DELAY_POST_OPEN
+	int "Define the delay after opening net devices (s)"
+	depends on NETDEVICES
+	default 1
+	help
+	    Some devices may not work properly due to a delay from hardware bring
+	    the interface up. This value add a delay, in seconds, after
+	    kernel search and register the interface. Default value is 1s.
+
 config DUMMY
 	tristate "Dummy net driver support"
 	---help---
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 10a6a60..2530126 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -86,8 +86,8 @@
 #endif

 /* Define the friendly delay before and after opening net devices */
-#define CONF_PRE_OPEN		500	/* Before opening: 1/2 second */
-#define CONF_POST_OPEN		1	/* After opening: 1 second */
+#define CONF_PRE_OPEN		CONFIG_NETDEVICES_DELAY_PRE_OPEN	/* Before
opening. Default is 1/2 second */
+#define CONF_POST_OPEN		CONFIG_NETDEVICES_DELAY_POST_OPEN	/* After
opening. Default is 1 second */

 /* Define the timeout for waiting for a DHCP/BOOTP/RARP reply */
 #define CONF_OPEN_RETRIES 	2	/* (Re)open devices twice */
-- 
1.6.4.2
--
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux