diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2009-08-19 15:00:06 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-10-13 10:57:40 +0200 |
commit | a3a59271109c621072f8cc30af4a3762cae769fb (patch) | |
tree | d4826e2bf34a6add54515dd124ca8a85bf91057a /net/net.c | |
parent | 8fe37b4e2eb20ce789a8b5194b14b2818aae7402 (diff) | |
download | barebox-a3a59271109c621072f8cc30af4a3762cae769fb.tar.gz barebox-a3a59271109c621072f8cc30af4a3762cae769fb.tar.xz |
net: remove switch/case in NetLoop()
Instead of having a big switch/case for every protocol, do
the right things in the individual functions before callong
NetLoop().
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'net/net.c')
-rw-r--r-- | net/net.c | 52 |
1 files changed, 1 insertions, 51 deletions
@@ -299,7 +299,7 @@ int NetLoopInit(proto_t protocol) return ret; } -int NetLoop(proto_t protocol) +int NetLoop(void) { /* * Start the ball rolling with the given start function. From @@ -307,56 +307,6 @@ int NetLoop(proto_t protocol) * packets and timer events. */ - switch (protocol) { -#ifdef CONFIG_NET_TFTP - case TFTP: - /* always use ARP to get server ethernet address */ - TftpStart(); - break; -#endif -#ifdef CONFIG_NET_DHCP - case DHCP: - /* Start with a clean slate... */ - NetOurIP = 0; - DhcpRequest(); /* Basically same as BOOTP */ - break; -#endif -#ifdef CONFIG_NET_BOOTP - case BOOTP: - BootpRequest (); - break; -#endif -#ifdef CONFIG_NET_RARP - case RARP: - NetOurIP = 0; - RarpTry = 0; - RarpRequest (); - break; -#endif -#ifdef CONFIG_NET_PING - case PING: - PingStart(); - break; -#endif -#ifdef CONFIG_NET_NFS - case NFS: - NfsStart(); - break; -#endif -#ifdef CONFIG_NETCONSOLE - case NETCONS: - NcStart(); - break; -#endif -#ifdef CONFIG_NET_SNTP - case SNTP: - SntpStart(); - break; -#endif - default: - break; - } - NetBootFileXferSize = 0; /* |