9
0
Fork 0
Commit Graph

400 Commits

Author SHA1 Message Date
Jean-Christophe PLAGNIOL-VILLARD 7a8014e689 net/console: switch to pr_xxx
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-09 11:18:04 +01:00
Sascha Hauer ca9a1827dc net: dhcp: fix typo
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-28 13:06:49 +01:00
Jean-Christophe PLAGNIOL-VILLARD b1da925c8a introduce console none support
this will allow to have no console support

Use full for bootstrap as we can save 6.5 KiB (barebox.bin) and
3.8 KiB (zbarebox.bin lzo) on at91sam9263 as example vs console simple

As on bootstrap we have often very limited size.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-23 20:34:16 +01:00
Sascha Hauer 0ccb9aebcd Merge branch 'pu/net-link' 2012-12-13 16:26:19 +01:00
Sascha Hauer a1a50a4654 net phylib: force to wait for link
When starting a network device wait until the link is up. Otherwise
autobooting does not work with little timeout and several attempts
have to be made until the network is finally up.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-12 20:02:44 +01:00
Sascha Hauer 1a9e93cc81 drivers/base: fix corrupt device tree
dev_add_child is a very unsafe function. If called multiple times
it allows setting the same device to different parents thus corrupting
the siblings list. This happens regularly since:

| commit c2e568d19c
| Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
| Date:   Sat Nov 3 16:11:05 2012 +0100
|
|    bus: add bus device
|
|    automatically add it as parent of any bus device if none already specified
|
|    we have now a nice output per bus

If for example a FATfs is mounted this nice output per bus often ends with:

>     `---- fat0
>     `---- 0
>          `---- 0x86f0000087020031-0x86f000410df27124: /dev/<NULL>
>          `---- sram00
>               `---- 0x00000000-0xffffffffffffffff: /dev/<NULL>
>               `---- 0x00000000-0xffffffffffffffff: /dev/<NULL>
>               unable to handle NULL pointer dereference at address 0x0000000c
> pc : [<87f08a20>]    lr : [<87f08a04>]
> sp : 86eff8c0  ip : 87f3fbde  fp : ffffffff
> r10: ffffffff  r9 : 00000000  r8 : 00000003
> r7 : 86f075b8  r6 : 00000002  r5 : ffffffec  r4 : 86f07544
> r3 : 00000000  r2 : 43f900b4  r1 : 00000020  r0 : 00000005
> Flags: Nzcv  IRQs off  FIQs off  Mode SVC_32
> [<87f08a20>] (do_devinfo_subtree+0x90/0x130) from [<87f08a90>] (do_devinfo_subtree+0x100/0x130)
>
> [<87f3e070>] (unwind_backtrace+0x0/0x90) from [<87f28514>] (panic+0x28/0x3c)
> [<87f28514>] (panic+0x28/0x3c) from [<87f3e4b8>] (do_exception+0x10/0x14)
> [<87f3e4b8>] (do_exception+0x10/0x14) from [<87f3e544>] (do_data_abort+0x2c/0x38)
> [<87f3e544>] (do_data_abort+0x2c/0x38) from [<87f3e268>] (data_abort+0x48/0x60)

This patch fixes this by adding a device to its parents children list in
register_device so that dev_add_child is no longer needed. This function
is removed from the tree. Now callers of register_device have to clearly
set the parent *before* registering a device.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Jan Lübbe <jlu@pengutronix.de>
2012-12-12 15:04:27 +01:00
Sascha Hauer 025d80a05d net phylib: Call phy_update_status when no link is present
We call phy_update_status only once in 5 seconds. This makes
sure we do not have great overhead when using ethernet devices.
However, if phylib tells us the link is down anyway, there won't
be ethernet transfers, so it doesn't hurt to call phy_update_status
in this case. This makes sure we can use the ethernet device when
the link comes up and do not have an additional 5 second penalty
in this case.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-08 17:54:06 +01:00
Sascha Hauer 8030ab24fa Merge branch 'kconfig' 2012-12-08 12:22:21 +01:00
Alexander Shiyan 4c20f9af97 Cleanup Kconfig files
This patch provides a global cleanup barebox Kconfig files. This includes
replacing spaces to tabs, formatting in accordance format, removing
extraneous lines and spaces. No functional changes.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-08 12:22:12 +01:00
Antony Pavlov f23198905c mem: add the swab (swap bytes) option to memory_display()
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-26 11:14:40 +01:00
Sascha Hauer 856f60dbd1 Merge branch 'for-next/misc'
Conflicts:
	commands/Makefile

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-16 14:01:34 +01:00
Jean-Christophe PLAGNIOL-VILLARD f4ca20c4d2 eth: register device a pure device
as we do not need to probe them and they have no driver or bus attached

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-12 08:41:52 +01:00
Sascha Hauer 8796301447 net eth: make edev->init optional
edev->init is called at eth_register time unconditionally and is supposed
to initialize the ethernet hardware. Since it's called unconditionally
this could be done by the driver without having an additional hook.
Some drivers need their initialization done earlier since they also register
a mdiobus which does hardware accesses on registration time.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-30 17:17:52 +01:00
Jean-Christophe PLAGNIOL-VILLARD 3c5327e660 switch all platform_bus device/driver registering to platform_driver/device_register
now register_driver and register_device are for bus only usage.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-10-04 15:19:12 +02:00
Sascha Hauer edf068e9cf Merge branch 'for-next/tftp' 2012-10-03 21:17:39 +02:00
Sascha Hauer d1e65d2a7b Merge branch 'for-next/remove-fsf-address'
Conflicts:
	drivers/net/miidev.c
	include/miidev.h
2012-10-03 21:12:48 +02:00
Sascha Hauer ed4645cf13 Merge branch 'for-next/boot-sequence-dhcp'
Conflicts:
	drivers/net/miidev.c
2012-10-03 21:10:30 +02:00
Jean-Christophe PLAGNIOL-VILLARD 5db42bd619 dhcp: add retries limit support
via -r opt, global.dhcp.retries or dhcp_retries

set the priority order;

This will allow to do not stay infinite loop if no dhcp available
for boot sequence as example

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-10-02 08:57:07 +02:00
Jean-Christophe PLAGNIOL-VILLARD d166d74211 dhcp: add copy_only_if_valid support
This will allow to only update a var if recive a valid data.
This is need for hostname.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-10-02 08:57:07 +02:00
Jean-Christophe PLAGNIOL-VILLARD 91b563613e dhcp: switch to global var support
This way you can specify as previously set the dhcp parameter via global.dhcp.xxx
and get the result via global.dhcp.xxx

This is need for the defaultenv-2 to add the bootp suppport.
Use it on defaultenv too to have only one set of var.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-10-02 08:57:07 +02:00
Jean-Christophe PLAGNIOL-VILLARD 8166603baa defaultenv: switch hostname to global.hostname
Udpate dhcp with it too.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-10-02 08:57:07 +02:00
Sascha Hauer 838d48cef4 net: remove old tftp support
The old tftp suppoer has been replaced with filesystem based tftp
support, so remove the old code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-28 16:24:02 +02:00
Sascha Hauer 0dc9de2efd net/eth: fix link handling
Check link status on eth device open time and then periodically
every 5 seconds.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-27 23:55:12 +02:00
Jean-Christophe PLAGNIOL-VILLARD 2263e27814 net: introduce phylib
Adapt phylib from linux

switch all the driver to it
reimplement mii bus

This will allow to have
 - phy drivers
 - to only connect the phy at then opening of the device
 - if the phy is not ready or not up fail on open

Same behaviour as in linux and will allow to share code and simplify porting.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-25 08:18:58 +02:00
Sascha Hauer 77322aa896 Treewide: remove address of the Free Software Foundation
The FSF address has changed in the past. Instead of updating it
each time the address changes, just drop it completely treewide.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-17 10:57:41 +02:00
Jean-Christophe PLAGNIOL-VILLARD 0b3c3e7794 net: catch error on eth_send
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-16 20:39:07 +08:00
Wolfram Sang fbe8f642b9 net: tftp: timeout only after a proper amount of time
Currently, the timeout when waiting for packages is smaller than the
timeout communicated to the TFTP server for retransmitting. Make sure we
wait at least for two retransmissions before giving up.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-14 13:58:30 +02:00
Sascha Hauer 149d4764a3 Merge branch 'for-next/ethernet' 2012-07-02 11:00:33 +02:00
Johannes Stezenbach 69e07e2afb eth: eth MAC addresses are six bytes
Reduce confusion by making clear six bytes are passed,
not a string.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 13:58:18 +02:00
Sascha Hauer ee3e50f23f net: Use dev_name directly
eth_get_byname uses a selfmade dev_name, use dev_name directly instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-28 12:45:27 +02:00
Sascha Hauer 611719282d dns: fix recursive loop
resolv() uses getenv_ip() which in turn calls resolv(). Fix
this inifinite loop by not using getenv_ip directly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-16 08:50:33 +02:00
Jean-Christophe PLAGNIOL-VILLARD d5d96ca6c3 complete: eth typo fix
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-02 09:36:26 +02:00
Sascha Hauer e4e3fbd22b improve complete support
The following patch serie improve the complete support
 by adding a complete framework to aalow commands complete support.
 
 The add also car complete support for eval and setting and executable
 file support
 
 This also include an update of the stringlist API to support asprintf
 API
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJPnohsAAoJEOrjwV5ZMRf2qeIQAIC7WrIao0mB2pIB+51MqeU+
 sof7GLxUl0MWXFFc3OFEHDcY5grC867mBmB9+uDG1mvcxa/bUpw+jMRMrki5j4Kg
 mjaHQ2UCvDjMHqQi7ISc/WTyJb09mtduFIceP0EftAmG8Mb5n9XOMaKwL9r/UQHB
 ps9MijnI/QeFqbrmBZcuaCp59QsPvipYw8NMJITBu2VvWrpKTIox33qPfNATDuEV
 SzMoLwz+uD7W7dEAM/A1uFdo4K5fLyZruDVGQoQ8CRS+zW3E6rr/EakpN5mhr/66
 dVZYO1xWppBaefIJQ1RD6bvwlFvesuuvQmMtDxsCsp07fyBolEWfFzblrwdkbueY
 NPwWExV5nzbRdAKKSyhU/nHiQ2edOQQZtHDAbnM4zh5e6lK7YLrzVklzT4Dfhzn0
 GRdnjCmiQiaZdmAEHe8wte2nr3Lc01fTsj/EFVA+LYP3a9by1iG2Zn3/ChieVcN4
 R+o/2lMBdhxsTszcmwMOemdqVPlt/0VmEXrKGtjTIZEViuQyyhY8ZtEaf4C0zeln
 Jf60t0ZvkehAJc0Lo4UOygjzvErqcKoHMk7utAjP+bi1KcMgF3Q+HmtCnJJs2FHw
 c40FZj1WcLPStEiS1way7miBakxOy2zPumKi1OXx+140L25C1nvQPYu8ilOZHEyU
 opNlo+wQ8h5sG/054kYL
 =rYfw
 -----END PGP SIGNATURE-----

Merge tag 'complete_update_support' of git://git.jcrosoft.org/barebox into next

improve complete support

The following patch serie improve the complete support
by adding a complete framework to allow commands complete support.

The add also car complete support for eval and setting and executable
file support

This also include an update of the stringlist API to support asprintf
API
2012-05-01 21:41:59 +02:00
Jean-Christophe PLAGNIOL-VILLARD b7fc51bd79 complete: add eth interface complete support
use it on ethact

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:37:40 +08:00
Jean-Christophe PLAGNIOL-VILLARD 8e6f45f54f complete: add empty complete support
for cpuinfo, clear, dhcp, false, login, lsmod, meminfo, passwd, pwd, reginfo,
reset, true, usb, version

for mach-imx and mach-mxs: dump_clocks
for u_serial: mycdev

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:37:40 +08:00
Sascha Hauer cac75c0f23 dhcp: set start time
The dhcp command starts with an unitialized start time. The start
time is often long in the past which results in an immediate timeout
and resend of the dhcp packet. Fix this by initializing the start time
correctly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-30 13:28:56 +02:00
Jean-Christophe PLAGNIOL-VILLARD 0613fca0b3 dhcp: fix typo introduce during rebase of hostname patch
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-18 15:36:10 +02:00
Jean-Christophe PLAGNIOL-VILLARD 903d939193 net: dhcp: add support to send the hostname to the dhcp server
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-18 11:59:10 +02:00
Sascha Hauer 86b9eb2105 Merge branch 'work/dns' into next 2012-04-16 11:34:41 +02:00
Sascha Hauer abe4560c8a Use DEVICE_ID_DYNAMIC where applicable
We now have DEVICE_ID_DYNAMIC for dynamic allocation of device ids,
Use it where applicable.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-16 09:43:02 +02:00
Jean-Christophe PLAGNIOL-VILLARD 065feea9be net: use net_alloc_packet to allocate packet
Was missing in net_init and net_new.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-15 18:29:53 +02:00
Sascha Hauer 158294a49a net: remove unused getenv_ip_dns
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-15 16:26:07 +02:00
Sascha Hauer 1f12076c1e dns: use global nameserver/domainname
nameserver and domainname are now globally available in the 'net' device.
use these variables.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-15 16:26:07 +02:00
Sascha Hauer 87be17d7db dhcp: set global nameserver/domainname
The nameserver and domainname are now globally available using
the 'net' device. Use it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-15 16:26:07 +02:00
Sascha Hauer 9058b01ebc net: register a 'net' device to store network specific variables
'nameserver' and 'domainname' should be globally available variables
specific to networking. Register a 'net' device to store these variables.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-15 16:26:03 +02:00
Sascha Hauer 9d699b790c net: use static string in string_to_ip
Simplify usage of ip_to_string by using a static string.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-15 15:05:38 +02:00
Sascha Hauer 3f732effd5 net dns: remove debug code
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-15 15:01:57 +02:00
Sascha Hauer 38a07fb8a9 netconsole: bail out if console_register fails
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-13 16:56:15 +02:00
Jean-Christophe PLAGNIOL-VILLARD b00be49bdb net: dhcp: add private extention 224 to pass the oftree file via dhcp.
DHCP option 224 to 254 are for private use, so use one.

Export it via env dhcp_oftree_file.

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

   | option oftree-path code 224 = string
   | class "at91sam9x5ek" {
   | match if substring (option vendor-class-identifier,0,20) = "barebox-at91sam9x5ek";
   |
   | 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";
   | option oftree-path "/tftpboot/atmel/at91sam9x5/sam9x5ek/sam9g25ek/dtb";
   | }

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-10 09:54:43 +02:00
Wolfram Sang bae5036881 net: eth: don't say that MAC comes from EEPROM
Because it can also come in via other means.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-05 18:26:18 +02:00
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