9
0
Fork 0
Commit Graph

400 Commits

Author SHA1 Message Date
Wolfram Sang ac29648413 net: ping: do not retry endlessly
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-05 08:56:03 +02:00
Wolfram Sang 25b0134d14 net: tftp: do not retry endlessly
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-05 08:56:03 +02:00
Wolfram Sang 56f6bfb820 net: arp_request: do not retry endlessly
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-05 08:56:03 +02:00
Wolfram Sang f31693eb58 net: tftp: check for error when retrying
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-05 08:56:03 +02:00
Wolfram Sang 53d611789c net: ping: remove unneeded initialization
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-05 08:56:03 +02:00
Wolfram Sang 5ae013a9a9 net: ping: send PING packets with 1-second interval
Like standard ping does by default.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-05 08:56:03 +02:00
Jean-Christophe PLAGNIOL-VILLARD 9c29dab5aa net: env: getenv_ip use resolv
Introduce getenv_ip_dns to be able to do not do the resolv when using it in
resolv for the nameserver (Do not loop).

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-03 11:39:29 +08:00
Jean-Christophe PLAGNIOL-VILLARD f76899fa98 net: dhcp: allow to set transmitted user class
For net boot setups it is useful to submit boot params like server or
bootfile over dhcp. To distinguish diffrent type of OS running on the same hardware,
a custom vendor id can be sent in dhcp discover/request messages.

E.g. the ISC dhcp server can be configured with

 | option client-uuid code 97 = { unsigned integer 8, string };
 | class "at91sam9x5ek" {
 |         match if substring (option vendor-class-identifier,0,20) = "barebox-at91sam9x5ek";
 |
 |         filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage";
 |         if substring (option dhcp-client-identifier,0,7) = "ser2net" {
 |                 filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage-ser2net";
 |         }
 |         if substring (option client-uuid,0,7) = "test" {
 |                 filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage-ser2net";
 |         }
 |         if substring (option user-class,0,4) = "toto" {
 |                 filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage-toto";
 |         }
 |         option tftp-server-name "192.168.200.98";
 |         option option-150 192.168.200.98;
 |         next-server 192.168.200.98;
 |         option root-path "192.168.200.98:/opt/work/buildroot/build/sam9x5/target";
 | }

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-03 11:39:29 +08:00
Jean-Christophe PLAGNIOL-VILLARD c106abc619 net: dhcp: allow to set transmitted client uuid
For net boot setups it is useful to submit boot params like server or
bootfile over dhcp. To distinguish diffrent type of OS running on the same hardware,
a custom client uuid can be sent in dhcp discover/request messages.

E.g. the ISC dhcp server can be configured with

 | option client-uuid code 97 = { unsigned integer 8, string };
 | class "at91sam9x5ek" {
 |         match if substring (option vendor-class-identifier,0,20) = "barebox-at91sam9x5ek";
 |
 |         filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage";
 |         if substring (option dhcp-client-identifier,0,7) = "ser2net" {
 |                 filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage-ser2net";
 |         }
 |         if substring (option client-uuid,0,7) = "test" {
 |                 filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage-ser2net";
 |         }
 |         option tftp-server-name "192.168.200.98";
 |         option option-150 192.168.200.98;
 |         next-server 192.168.200.98;
 |         option root-path "192.168.200.98:/opt/work/buildroot/build/sam9x5/target";
 | }

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-03 11:39:29 +08:00
Jean-Christophe PLAGNIOL-VILLARD b0660bd84f net: dhcp: allow to set transmitted client id
For net boot setups it is useful to submit boot params like server or
bootfile over dhcp. To distinguish diffrent type of OS running on the same hardware,
a custom client id can be sent in dhcp discover/request messages.

E.g. the ISC dhcp server can be configured with

 | class "at91sam9x5ek" {
 |         match if substring (option vendor-class-identifier,0,20) = "barebox-at91sam9x5ek";
 |
 |         filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage";
 |         if substring (option dhcp-client-identifier,0,7) = "ser2net" {
 |                 filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage-ser2net";
 |         }
 |         option tftp-server-name "192.168.200.98";
 |         option option-150 192.168.200.98;
 |         next-server 192.168.200.98;
 |         option root-path "192.168.200.98:/opt/work/buildroot/build/sam9x5/target";
 | }

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-03 11:39:29 +08:00
Jean-Christophe PLAGNIOL-VILLARD 7fd2d7658e net: dhcp: factorise setting option code
This will allow to add more easly new option with less impact in the binary.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-03 11:39:29 +08:00
Jean-Christophe PLAGNIOL-VILLARD 1f9e76d840 net: dhcp: add support of tftp name server
if the DNS is enable resolve it. The server ip will be set if no server ip it
is set in the bootp.
Export it via env dhcp_tftp_server_name.

E.g. the ISC dhcp server can be configured with

   | class "at91sam9x5ek" {
   |         match if substring (option vendor-class-identifier,0,20) = "barebox-at91sam9x
   |
   |         filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage";
   |         option tftp-server-name "192.168.200.98";
   |         option root-path "192.168.200.98:/opt/work/buildroot/build/sam9x5/target";
   |         }
   | }

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-03 11:39:27 +08:00
Jean-Christophe PLAGNIOL-VILLARD af387f080f net: dhcp: reset env variable before do a dhcp request
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-03 11:38:43 +08:00
Jean-Christophe PLAGNIOL-VILLARD 16a07dc526 net: dhcp: factorise option recption handling
Instead of using a static switch case the handle the received option
use an array of supported option.

This will allow to unset the env var without duplicating the code.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-03 11:38:39 +08:00
Enrico Scholz 3661e874aa net: dhcp: allow to set transmitted vendor id
For net boot setups it is useful to submit boot params like server or
bootfile over dhcp. To distinguish barebox from e.g. pxe machines,
a custom vendor id can be sent in dhcp discover/request messages.

E.g. the ISC dhcp server can be configured with

| if substring(option vendor-class-identifier,0,8) = "barebox:" {
|       next-server             192.168.3.24;
|       server-name             "192.168.3.24";
|       option tftp-server-name "192.168.3.24";
|       option root-path = concat("/srv/sysroots/by-mac/",
|          binary-to-ascii (16, 8, "-", substring (hardware, 1, 6)));
| }

to sent boot params which are valid for barebox hosts only.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Jean-Christophe PLAGNIOL-VILLARD:
 - update the use dhcp command option
 - support to set the vendor via env dhcp_vendor_id
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-03-12 22:44:06 +01:00
Sascha Hauer 33d1cc4bf2 commands: remove struct command pointer from commands
This is unused in all commands and thus can be removed.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-27 20:28:07 +01:00
Sascha Hauer 67d938b2ea net: use container_of instead of dev->type_data
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-25 15:16:22 +01:00
Sascha Hauer 801af0ef12 net: set enetaddr to invalid address when an invalid string is passed
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-14 23:57:12 +01:00
Sascha Hauer f3d0cb7f73 net: fix eth device unregistration
We register a device in eth_register, thus we have to unregister it in
eth_unregister. Also, if the device we unregister is the current device,
we have to set the current eth_device to NULL so that it isn't used anymore.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-14 23:57:07 +01:00
Marc Kleine-Budde d3a183c329 net/nfs: increase timeout to 15 seconds
On my laptop with avahi enabled (linux mdns implementation), the unmount
take quite long, because the avahi daemon tries to resolve the client's
host name. This leads to a delay of about 8 seconds of the unmount reply
messages, so that barebox runs into a timeout. This patch increases the
NFS timeout to 15 to work around the problem.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-25 18:11:45 +01:00
Sascha Hauer fc72640247 remove unused watchdog header
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 11:46:50 +01:00
Sascha Hauer 7766c288ff dhcp: Add magicvars
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 20:51:32 +01:00
Wolfram Sang a55147be13 net: getenv_ip: check return value of string_to_ip
Return 0 if we encounter an error.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-26 13:22:25 +02:00
Wolfram Sang a3ccaecb1c net: string_to_ip: add sanity check for > 255
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-26 13:22:25 +02:00
Sascha Hauer 6d16fbdcd4 net: make the ethernet device a child of the hardware device
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-15 09:48:03 +02:00
Sascha Hauer c46b04542f net: Add a possibility for boards to give network devices a MAC address
MAC addresses are sometimes stored at unusual places. This
patch makes it possible to give a MAC address to a ethernet
device id. This is independent of the device actually being
present.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-29 12:05:26 +02:00
Sascha Hauer c75ab78763 net: add a context to the packet handler
This is not yet used, but with this the different network
commands can get rid of their global data.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-12 09:54:56 +02:00
Sascha Hauer dcf5df122f eth: check the result of edev->get_ethaddr
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-12 09:54:56 +02:00
Sascha Hauer fd5a99267f net: use dev_* for printing network related stuff
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-03 16:15:57 +01:00
Sascha Hauer 91d2891888 network: initialize new net device id with -1
This autoassigns a id to network devices and makes multiple
network devices work again.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-02-18 11:11:01 +01:00
Sascha Hauer 2f0109b1bb Merge branch 'master' into next 2011-01-17 09:43:40 +01:00
Sascha Hauer 96c91cb213 net: fix printf compiler warnings
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-07 10:37:31 +01:00
Krzysztof Halasa c5baa0edc4 Fix error handling with malloc, memalign etc. Introduce xmemalign().
The idea is to panic() when there is no memory available for normal
operation. Exception: code which can consume arbitrary amount of RAM
(example: files allocated in ramfs) must report error instead of panic().

This patch also fixes code which didn't check for NULL from malloc() etc.

Usage: malloc(), memalign() return NULL when out of RAM.
xmalloc(), xmemalign() always return non-NULL or panic().

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-07 10:21:22 +01:00
Krzysztof Halasa d66ae58cd8 Cosmetic fixes, including format attributes for printf() and friends.
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-21 09:02:40 +01:00
Sascha Hauer 32558d1ae5 LED: Add LED trigger support
This patch allows to associate LEDs with certain triggers, such
as heartbeat or network activity.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-20 09:57:35 +01:00
Baruch Siach fad11e8564 eth: fix 'warning: No MAC address set' when using EEPROM MAC
When retrieving the MAC address from EEPROM, we must notify the networking core
at eth registration time. Otherwise we get the 'No MAC address set' warning on
the first network access, and the MAC address is set to a random value instead
of the real one.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-16 08:30:14 +01:00
Robert Schwebel b8315d622d doc: unify documentation for 'tftp'
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
2010-11-01 16:23:09 +01:00
Sascha Hauer 27e3cad82d net: make locally used functions static
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-21 22:21:25 +02:00
Sascha Hauer 0c56215c52 ping: make locally used functions static
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-21 22:21:24 +02:00
Jean-Christophe PLAGNIOL-VILLARD 0231b5b3a7 netconsole: remove non-needed setbaudrate
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-09-24 08:46:41 +02:00
Jean-Christophe PLAGNIOL-VILLARD 12f396a8b0 net: rework the mii support
this rework is done in order to add a phylib and allow to have phy driver support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-27 14:36:03 +02:00
Sascha Hauer 38d862f687 tftp: update doxygen information
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-28 10:45:25 +02:00
Sascha Hauer b3c91fbf5f nfs: resend requests after timeout
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-28 10:45:25 +02:00
Sascha Hauer 80c071dd56 nfs: Use generic progression bar
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-28 10:45:25 +02:00
Sascha Hauer d0548ba506 tftp: Add push support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Baruch Siach <baruch@tkos.co.il>
2010-06-28 10:45:04 +02:00
Sascha Hauer c59d7ae527 tftp: use generic progression bar
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-28 10:43:55 +02:00
Sascha Hauer 3039467bbd tftp: remove unused variables
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-28 10:43:55 +02:00
Sascha Hauer e7048e1862 net: use a random mac address if the current device does not have a valid address
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-22 15:44:44 +02:00
Sascha Hauer c5de3fdcce ping: resolv hostnames
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-17 08:28:30 +02:00
Sascha Hauer cd81aa6e3b net: add dns support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-17 08:28:29 +02:00
Sascha Hauer 232b46996c add netconsole support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-17 08:28:29 +02:00
Sascha Hauer c3789cd49b rework device parameters
Change device parameters so that the memory management is in generic
code. This also removes the need of storing statically initialized
parameters as they are stored in a struct list_head for each device.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-17 08:28:25 +02:00
Sascha Hauer 57e1fc33bd net: remove old network stack
All network commands now use the new stack, so remove the old one.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-17 08:28:25 +02:00
Sascha Hauer 663a6269f2 net: consider rarp support as outdated. Remove it
It is disabled in all defconfigs and probably broken for longer.
Remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-17 08:28:25 +02:00
Sascha Hauer c31ea55e92 implement nfs using new network stack
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-17 08:28:24 +02:00
Sascha Hauer 98ff00b6d2 implement ping using new network stack
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-17 08:28:24 +02:00
Sascha Hauer 17f1f5b3b7 implement tftp using new network stack
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-17 08:28:21 +02:00
Sascha Hauer 870e64993b implement dhcp using new network stack
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-17 08:28:17 +02:00
Sascha Hauer 799c00c589 remove unused sntp.h
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-17 08:28:17 +02:00
Sascha Hauer 97070487fa net: Implement a new network stack
The old network stack has some bad limitations:

- network commands are required to call NetLoop() which only returns when
  the network layer wants to. Instead we now use a net_poll() function which
  returns after handling one packet (or immediately if no packet is
  available).
- There can be only one packet handler which makes it impossible to handle
  multiple connections
- CamelCaseMakesItHardToRead

The new network stack is implemented as a parallel universe. Currently all
commands still use the old stack. They are converted in subsequent patches.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-17 08:28:16 +02:00
Sascha Hauer 994f95c073 net: remove need for eth_halt/eth_open
We used to eth_open/eth_halt the network devices during NetLoopInit
which is called whenever the user enters a network command.
Change this behaviour so that the current network device gets opened
when making it the current one.
With this change it's always possible to send packages and we are able
to implement a new network stack in the next step.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-17 08:28:16 +02:00
Jan Weitzel 0a28ada177 tftp return value
tftp returns transfered bytes on success and 1 in error case. Bad for
scripting. Change to 0 on success

Signed-off-by: Jan Weitzel <J.Weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-04-14 10:13:07 +02:00
Sascha Hauer 42f4ca1c85 put only once used function inline
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-02-01 17:25:32 +01:00
Sascha Hauer 8f0d0f25ed replace ET_DEBUG with pr_debug
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-02-01 17:25:32 +01:00
Sascha Hauer 922bb41a47 remove typedef cmd_tbl_t and replace it with struct command
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-02-01 17:25:32 +01:00
Sascha Hauer 88351d2e4b Move tftp/nfs specific code to net/*
This adds a few bytes of binary space but is done to put
the code where it belongs to.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-02-01 17:25:31 +01:00
Sascha Hauer 426de4405c remove unused NETCONSOLE stuff
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-02-01 17:25:31 +01:00
Sascha Hauer a3ffa97f40 rename U-Boot-v2 project to barebox
This has been done with the following script:

find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \
	-e 's/u2boot/barebox/g' \
	-e 's/U2Boot/barebox/g' \
	-e 's/U-boot V2/barebox/g' \
	-e 's/u-boot v2/barebox/g' \
	-e 's/U-Boot V2/barebox/g' \
	-e 's/U-Boot-v2/barebox/g' \
	-e 's/U_BOOT/BAREBOX/g' \
	-e 's/UBOOT/BAREBOX/g' \
	-e 's/uboot/barebox/g' \
	-e 's/u-boot/barebox/g' \
	-e 's/u_boot/barebox/g' \
	-e 's/U-Boot/barebox/g' \
	-e 's/U-boot/barebox/g' \
	-e 's/U-BOOT/barebox/g'

find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \
	xargs -0 -r rename 's/u[-_]?boot/barebox/'

It needs some manual fixup following in the next patch

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-12-15 10:18:30 +01:00
Sascha Hauer 420a3173f0 commands: remove maxargs
No need to check for maximum argument counts. The commands are
safe to be called with more arguments, so lets safe some bytes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-19 16:18:33 +02:00
Sascha Hauer 87e01f28cc commands: return COMMAND_ERROR_USAGE
instead of calling u_boot_cmd_usage in each command to safe
space.

Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-19 10:18:52 +02:00
Sascha Hauer 2dc2132f0e remove global variable BootFile
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-19 10:18:51 +02:00
Sascha Hauer d78105a55b nfs: allow only serverip
Do not allow to pass serverip via commandline.

Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-19 10:18:51 +02:00
Sascha Hauer ac50a05caf pass filename to nfs and tftp start functions
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-19 10:18:51 +02:00
Sascha Hauer 1d3d2c6369 nfs: no default filename, we always have a filename
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-19 10:18:51 +02:00
Sascha Hauer c229f67efb ping: shorten usage info
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-19 10:18:51 +02:00
Sascha Hauer 3701ed81ec ping: do not return -1 in command
Also, print usage if not enough arguments given.

Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-19 10:18:51 +02:00
Sascha Hauer feb58df760 tftp: use debug macro
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-19 10:18:51 +02:00
Sascha Hauer e225e4fcdd tftp: coding style
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-19 10:18:51 +02:00
Sascha Hauer ef2787ab26 tftp: reorder to get rid of static function declarations
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-19 10:18:36 +02:00
Sascha Hauer 4aedcf8531 tftp: remove never reached state STATE_BAD_MAGIC
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-17 09:18:49 +02:00
Sascha Hauer 8aab890453 tftp: remove never reached state STATE_TOO_LARGE
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-17 09:17:47 +02:00
Sascha Hauer 8cef3301f8 tftp: remove volatile from variables
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-17 09:15:35 +02:00
Sascha Hauer e8b856dc03 remove unused code
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-17 09:10:39 +02:00
Sascha Hauer fdc9bd236e tftp: consolidate different puts to printf
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-17 09:10:09 +02:00
Sascha Hauer 3830d35bc6 tftp: remove unnecessary gateway information
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-17 09:07:41 +02:00
Sascha Hauer a5f301fb7a remove unused variable NetBootFileSize
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-17 08:54:57 +02:00
Sascha Hauer 551d088687 tftp: remove default filename. We always have a filename given
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-17 08:49:45 +02:00
Sascha Hauer e2c2954654 make locally used funtion static
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-17 08:38:59 +02:00
Sascha Hauer 146f9b6e5b remove sntp support. Has been broken for long enough
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-13 11:19:28 +02:00
Sascha Hauer 4ad31ee437 do not abuse the received packet to send back another packet
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-13 11:02:15 +02:00
Sascha Hauer 6289b5a51d net: remove unnecessary if
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-13 11:02:15 +02:00
Sascha Hauer faa61661cf only the ping code is interested in the ping ip
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-13 11:02:15 +02:00
Sascha Hauer 5619409df6 net: remove dead code
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-13 11:02:15 +02:00
Sascha Hauer 4d0670f227 net: cleanup header file
move contents of bootp.h to .c file and remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-13 11:02:15 +02:00
Sascha Hauer 87048e4a66 rename bootp.c to dhcp.c 2009-10-13 11:02:15 +02:00
Sascha Hauer 211f9b336a net: refactor dhcp support
Remove bootp support. It has been broken for longer and
is implemented in an ifdef desert.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-13 11:02:08 +02:00
Sascha Hauer cf1a0b21c3 ping.c: refactor
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-13 10:57:41 +02:00
Sascha Hauer a3a5927110 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>
2009-10-13 10:57:40 +02:00
Sascha Hauer 8fe37b4e2e bootp: remove unnecessary counter
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-13 10:57:40 +02:00
Sascha Hauer f787f8fbf7 net: check prerequisites in NetLoopIinit()
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-13 10:57:40 +02:00
Sascha Hauer c227c646e3 return is not a function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-13 10:54:14 +02:00
Sascha Hauer 9296260a78 net: split NetLoop in NetLoop and NetLoopInit
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-13 10:49:21 +02:00
Sascha Hauer 3487f1ee8e net: remove unused state NETLOOP_RESTART
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-13 10:48:56 +02:00
Sascha Hauer 5e29712041 net: remove NetStartAgain()
Do not let the network stack restart itself

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-13 10:48:32 +02:00
Sascha Hauer eedb766979 tftp: do not call NetStartAgain()
When we are in the middle of transferring a file it does
not make sense to restart the transfer because we may
transfer directly to flash in which case we would have
to erase the flash prior to attempting again.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-13 10:47:12 +02:00
Sascha Hauer 2f8df2a003 add a device_d to ethernet devices
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-07-21 16:41:46 +02:00
Sascha Hauer bac65c6cde net: Get rid of DEVICE_TYPE_ETHER usage
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-07-21 16:41:45 +02:00
Sascha Hauer 2230eea29b net: add eth_unregister function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-04-07 10:42:33 +02:00
Sascha Hauer f9dccf98a3 eth.c: Fix return values
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-04-06 11:16:13 +02:00
Sascha Hauer 53488058e6 allow changing of network device
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-04-06 11:13:19 +02:00
fredo 56d80fe843 remove unused variable
Signed-off-by: Frederic RODO <fred.rodo@gmail.com>
2008-12-18 14:20:08 +01:00
Sascha Hauer 20ec9ba02d Ethernet: write MAC address to hardware when it's changed
Instead of writing the MAC address into the hardware on device open time
write it to the hardware when the user changes the parameter. This
way a user can change the MAC address in the hardware without actually
using the device. This helps Linux Network drivers which expect a valid
MAC address on startup.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-09-30 10:48:40 +02:00
Sascha Hauer ae3f56c84a nfs: fix calling of string_to_ip()
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-09-30 10:46:24 +02:00
Sascha Hauer 3ef59a5467 fix 62e2cd0a68
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-21 16:23:02 +02:00
Sascha Hauer 62e2cd0a68 net: remove redundant assignment
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-20 17:56:19 +02:00
Sascha Hauer 17ba93e7a0 net: initialize Net* variables unconditionally, not in a big switch/case
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-20 17:52:31 +02:00
Sascha Hauer 51b4de421e eth: check for valid parameters for ethaddr, ipaddr, ...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-20 17:46:54 +02:00
Sascha Hauer c0d02ffc3d Fix string_to_ip
Use a pointer to an ip address instead of the return value in string_to_ip
and use the return value for error indication only. 0.0.0.0 can be a valid
ip address

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-20 17:46:47 +02:00
Sascha Hauer e3f268d52d net: Coding style changes
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-20 12:30:13 +02:00
Sascha Hauer 59f72431f4 Add missing call to eth_halt()
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-14 08:43:01 +02:00
Sascha Hauer dabec3a7a1 Merge branch 'master' of git://www.denx.de/git/u-boot-v2 2008-06-02 16:13:14 +02:00
Sascha Hauer 9bf7a4f97f [net] cleanups:
- remove cdp support
 - replace CONFIG_BOOTP_MASK with #ifdef CONFIG_...
2008-04-07 11:37:25 +02:00
Sascha Hauer 566e0d93ce tftp.c: use sprintf instead of several strcpy functions 2008-03-31 21:54:37 +02:00
Sascha Hauer 51965dca86 remove cdp support. Probably not working anymore anyway. 2008-03-31 21:53:13 +02:00
Sascha Hauer 80e05021c7 ping.c: remove volatile from variables 2008-03-31 21:52:09 +02:00
Sascha Hauer 612e256be2 make nfs work 2008-03-31 21:51:29 +02:00
Sascha Hauer 88da79df25 fix typo and indention 2008-03-21 21:25:15 +01:00
Sascha Hauer 20f3ac6e51 remove unnessecary include 2008-03-14 13:02:12 +01:00
Juergen Beisert 2cb737d95d using a consistent ipaddr parameter all over the place
Signed-off-by: Juergen Beisert <jbe@octopus.labnet.pengutronix.de>
2007-11-08 17:06:48 +01:00
sascha 2db56b3031 When printing error messages about network parameters print
the network device id with it.
2007-10-18 12:06:50 +02:00
sascha 3c37202662 check if there is an ethernet device set in NetLoop 2007-10-18 11:25:13 +02:00
sascha a9791f69f7 rename mac parameter to ethaddr 2007-10-18 11:20:15 +02:00
sascha 1b272d80f1 change functions containing 'mac' or 'enet' in its name to 'ethaddr'.
change the parameter name for ethernet devices to 'ethaddr' aswell.
2007-10-18 11:17:16 +02:00
Sascha Hauer 90f72b1520 remove unneeded colatile from variable 2007-10-11 21:54:33 +02:00
Sascha Hauer 06657e6da7 fix compiler warning 2007-10-08 00:57:46 +02:00
Sascha Hauer 6b7fdcb970 Use safe_strncpy() instead of copy_filename(). The shell has already removed
quotes, so we don't need this functionality from copy_filename()
2007-09-28 10:47:19 +02:00
Sascha Hauer 326e4bddc3 print_size() -> size_human_readable()
return a pointer to a human readable string rather than printingit directly
2007-09-26 15:23:46 +02:00
Sascha Hauer d4ba2f9001 move dirname() and basename() to lib/libgen.c and add header file 2007-09-24 16:57:12 +02:00
Sascha Hauer 3cbc5c5c12 remove u-boot command paramter flag 2007-09-24 12:31:08 +02:00
Sascha Hauer 0dd68e795e - putc is now putchar for better standard conformity
- make printf return int
2007-09-21 09:09:06 +02:00
Sascha Hauer 70a338bc27 Use unsigned char * for mac address. Otherwise (s)printf interpets
parts of the mac address as negative numbers and gives wrong
results.
2007-09-11 10:20:16 +02:00
Sascha Hauer b1e843987a remove debug printf 2007-07-11 16:34:15 +02:00
Sascha Hauer 98432d3925 svn_rev_683
more cleanups, fix compiler warnings
2007-07-05 18:02:16 +02:00
Sascha Hauer e304e16056 svn_rev_580 2007-07-05 18:02:07 +02:00
Sascha Hauer 9ccd3234cd svn_rev_556
unify help string style
2007-07-05 18:02:04 +02:00
Sascha Hauer 571c47bdc0 svn_rev_555
menu formatting
2007-07-05 18:02:04 +02:00
Sascha Hauer 7dde818528 svn_rev_519
set enet addr
2007-07-05 18:02:01 +02:00
Sascha Hauer fa668fe184 svn_rev_502
complete multiple console support
2007-07-05 18:01:59 +02:00
Sascha Hauer fe2d505d4d svn_rev_481
make more char * const, fix compiler warnings
2007-07-05 18:01:58 +02:00
Sascha Hauer 7baa6289fe svn_rev_469
- make some more char * const
- dev_add_parameter -> dev_add_param
2007-07-05 18:01:56 +02:00