summaryrefslogtreecommitdiffstats
path: root/net
Commit message (Collapse)AuthorAgeFilesLines
* dns: fix recursive loopSascha Hauer2012-05-161-2/+9
| | | | | | | 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>
* complete: eth typo fixJean-Christophe PLAGNIOL-VILLARD2012-05-021-1/+1
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge tag 'complete_update_support' of git://git.jcrosoft.org/barebox into nextSascha Hauer2012-05-012-0/+23
|\ | | | | | | | | | | | | | | | | | | | | | | | | 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
| * complete: add eth interface complete supportJean-Christophe PLAGNIOL-VILLARD2012-04-301-0/+21
| | | | | | | | | | | | use it on ethact Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
| * complete: add empty complete supportJean-Christophe PLAGNIOL-VILLARD2012-04-301-0/+2
| | | | | | | | | | | | | | | | | | | | 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>
* | dhcp: set start timeSascha Hauer2012-04-301-0/+1
|/ | | | | | | | | 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>
* dhcp: fix typo introduce during rebase of hostname patchJean-Christophe PLAGNIOL-VILLARD2012-04-181-1/+1
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: add support to send the hostname to the dhcp serverJean-Christophe PLAGNIOL-VILLARD2012-04-181-2/+12
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'work/dns' into nextSascha Hauer2012-04-165-23/+24
|\
| * Use DEVICE_ID_DYNAMIC where applicableSascha Hauer2012-04-161-1/+1
| | | | | | | | | | | | | | 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>
| * net: remove unused getenv_ip_dnsSascha Hauer2012-04-151-4/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * dns: use global nameserver/domainnameSascha Hauer2012-04-151-3/+3
| | | | | | | | | | | | | | nameserver and domainname are now globally available in the 'net' device. use these variables. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * dhcp: set global nameserver/domainnameSascha Hauer2012-04-151-4/+2
| | | | | | | | | | | | | | The nameserver and domainname are now globally available using the 'net' device. Use it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: register a 'net' device to store network specific variablesSascha Hauer2012-04-151-0/+9
| | | | | | | | | | | | | | '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>
| * net: use static string in string_to_ipSascha Hauer2012-04-152-10/+7
| | | | | | | | | | | | Simplify usage of ip_to_string by using a static string. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net dns: remove debug codeSascha Hauer2012-04-151-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: use net_alloc_packet to allocate packetJean-Christophe PLAGNIOL-VILLARD2012-04-151-2/+2
|/ | | | | | | 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>
* netconsole: bail out if console_register failsSascha Hauer2012-04-131-1/+7
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: add private extention 224 to pass the oftree file via dhcp.Jean-Christophe PLAGNIOL-VILLARD2012-04-101-0/+5
| | | | | | | | | | | | | | | | | | | | | 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>
* net: eth: don't say that MAC comes from EEPROMWolfram Sang2012-04-051-1/+1
| | | | | | | 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>
* net: ping: do not retry endlesslyWolfram Sang2012-04-051-0/+7
| | | | | Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: tftp: do not retry endlesslyWolfram Sang2012-04-051-0/+10
| | | | | Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: arp_request: do not retry endlesslyWolfram Sang2012-04-051-0/+5
| | | | | Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: tftp: check for error when retryingWolfram Sang2012-04-051-1/+3
| | | | | Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: ping: remove unneeded initializationWolfram Sang2012-04-051-1/+1
| | | | | Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: ping: send PING packets with 1-second intervalWolfram Sang2012-04-051-1/+2
| | | | | | | Like standard ping does by default. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: env: getenv_ip use resolvJean-Christophe PLAGNIOL-VILLARD2012-04-032-4/+7
| | | | | | | 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>
* net: dhcp: allow to set transmitted user classJean-Christophe PLAGNIOL-VILLARD2012-04-031-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* net: dhcp: allow to set transmitted client uuidJean-Christophe PLAGNIOL-VILLARD2012-04-031-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* net: dhcp: allow to set transmitted client idJean-Christophe PLAGNIOL-VILLARD2012-04-031-1/+9
| | | | | | | | | | | | | | | | | | | | | | | 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>
* net: dhcp: factorise setting option codeJean-Christophe PLAGNIOL-VILLARD2012-04-031-34/+87
| | | | | | 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>
* net: dhcp: add support of tftp name serverJean-Christophe PLAGNIOL-VILLARD2012-04-031-3/+17
| | | | | | | | | | | | | | | | | | | 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>
* net: dhcp: reset env variable before do a dhcp requestJean-Christophe PLAGNIOL-VILLARD2012-04-031-0/+16
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* net: dhcp: factorise option recption handlingJean-Christophe PLAGNIOL-VILLARD2012-04-031-88/+153
| | | | | | | | | 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>
* net: dhcp: allow to set transmitted vendor idEnrico Scholz2012-03-121-5/+37
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* commands: remove struct command pointer from commandsSascha Hauer2012-02-275-5/+5
| | | | | | This is unused in all commands and thus can be removed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: use container_of instead of dev->type_dataSascha Hauer2012-02-251-3/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: set enetaddr to invalid address when an invalid string is passedSascha Hauer2012-02-141-2/+4
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: fix eth device unregistrationSascha Hauer2012-02-141-1/+4
| | | | | | | | 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>
* net/nfs: increase timeout to 15 secondsMarc Kleine-Budde2012-01-251-1/+1
| | | | | | | | | | | 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>
* remove unused watchdog headerSascha Hauer2011-12-151-1/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dhcp: Add magicvarsSascha Hauer2011-11-291-0/+6
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: getenv_ip: check return value of string_to_ipWolfram Sang2011-09-261-1/+2
| | | | | | | 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>
* net: string_to_ip: add sanity check for > 255Wolfram Sang2011-09-261-2/+4
| | | | | Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: make the ethernet device a child of the hardware deviceSascha Hauer2011-08-151-0/+4
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: Add a possibility for boards to give network devices a MAC addressSascha Hauer2011-07-291-1/+58
| | | | | | | | | 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>
* net: add a context to the packet handlerSascha Hauer2011-04-127-19/+22
| | | | | | | 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>
* eth: check the result of edev->get_ethaddrSascha Hauer2011-04-121-2/+4
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: use dev_* for printing network related stuffSascha Hauer2011-03-031-2/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* network: initialize new net device id with -1Sascha Hauer2011-02-181-0/+1
| | | | | | | This autoassigns a id to network devices and makes multiple network devices work again. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>