summaryrefslogtreecommitdiffstats
path: root/net
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/nfs'Sascha Hauer2014-03-074-1/+192
|\ | | | | | | | | Conflicts: defaultenv/defaultenv-2-base/bin/ifup
| * net: Add ifup supportSascha Hauer2014-03-073-0/+191
| | | | | | | | | | | | | | | | The defaultenv-2 has ifup support as a shell script. This patch replaces it with a command which is more robust, can be called from C and now can also bring up all configured interfaces. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: constify eth_get_byname argumentSascha Hauer2014-03-071-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mtd'Sascha Hauer2014-03-071-2/+0
|\ \ | | | | | | | | | | | | | | | Conflicts: drivers/mtd/core.c net/eth.c
| * | device: remove parameters when unregistering a deviceSascha Hauer2014-02-131-2/+0
| |/ | | | | | | | | | | | | | | Otherwise we loose memory on each device_unregister. The ethernet code used to do this before calling unregister_device. This can now be removed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / remove redundant NULL check on freeLucas Stach2014-02-101-1/+1
|/ | | | | | | | free() already checks the pointer to be non NULL. No need to do it again. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: Fix error return value for string_to_ethaddrSascha Hauer2014-01-201-2/+2
| | | | | | Return a proper error code instead of -1 which would be -EPERM. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* barebox: remove double semicolonsAlexander Aring2013-11-182-2/+2
| | | | | Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Add missing includesSascha Hauer2013-11-081-0/+1
| | | | | | | | A lot of files rely on include/driver.h including include/of.h (and this including include/errno.h. include the files explicitly so we can eventually get rid of including of.h from driver.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: Add a context pointer to fixup functionsSascha Hauer2013-11-061-2/+2
| | | | | | | If drivers want to fixup their specific instance they need some context to know which instance they have to fixup. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/console'Sascha Hauer2013-10-071-1/+0
|\
| * console: drop f_caps and check the function pointer getc/putc insteadJean-Christophe PLAGNIOL-VILLARD2013-09-211-1/+0
| | | | | | | | | | | | | | | | | | | | None of the driver make the difference between STDOUT and STDERR. So we just need to check if putc or getc are filled in the console_device save 32 bytes on versatilepb Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | dhcp: replace dhcp_getenv_int with getenv_uintSascha Hauer2013-10-071-11/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/powerpc'Sascha Hauer2013-09-051-10/+12
|\
| * net, of: fixup MAC address by aliasRenaud Barbier2013-09-051-10/+12
| | | | | | | | | | | | | | | | | | If a network device has not been registered from the devicetree, we may still find it by its alias in the devicetree. This way also platform based network devices can obtain a valid MAC address in the devicetree. Signed-off-by: Renaud Barbier <renaud.barbier@ge.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/boardinfo'Sascha Hauer2013-09-051-2/+1
|\ \ | | | | | | | | | | | | | | | | | | Conflicts: arch/mips/boards/qemu-malta/init.c commands/bootm.c drivers/of/base.c
| * | Make hostname available to C CodeSascha Hauer2013-08-161-1/+0
| | | | | | | | | | | | | | | | | | | | | The boards often have a sane default for the hostname. Provide a C function for setting/getting it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | globalvar: Allow to set initial valueSascha Hauer2013-08-161-1/+1
| |/ | | | | | | | | | | | | Calling globalvar_add_simple() and setting a value is more than common. Add a parameter for the initial value. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / net: fix checksum verificationBaruch Siach2013-08-121-1/+1
|/ | | | | | | | | Checksum calculation on data including its own checksum (as is the case with IP headers) should give 0xffff before bit flipping. Current code works well for the correct checksum case, but fails to identify errors. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: net: Use correct devicetree in eth_of_fixupSascha Hauer2013-07-271-1/+1
| | | | | | | | eth_of_fixup() is passed a devicetree, so use this one instead of the internal devicetree. This makes sure it also works when the tree to fixup is not the internal one. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next-manual/oftree-linux-sync'Sascha Hauer2013-07-021-1/+1
|\
* | net: Set mac-address propertySascha Hauer2013-06-051-0/+54
|/ | | | | | | | | | Linux normally has no idea how to retrieve MAC Addresses, but instead expects the MAC address in the devicetree. This patch adds the MAC address to the devicetree for Linux if we find a valid one in barebox. This mechanism is limited of course to devices barebox has a driver for and which are probed themselves from the devicetree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: Add of_register_ethaddrSascha Hauer2013-05-211-12/+56
| | | | | | | | | | | | We already have a possibility to register a MAC address provider based on a ethernet device id. This adds a similar functionality for devices probed from devicetree. Code can register itself to be a MAC address provider for a certain devicetree node. This helps on i.MX to let the IIM unit provide a MAC address for the FEC. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: Fix tftp servername handlingSascha Hauer2013-05-141-3/+6
| | | | | | | | | | | | | When the dhcp code discovered the tftp-server-name option it immediately tries to resolve the name. This can't succeed since the we are somewhere in the dhcp processing and the nameserver may not even be known. Fix this by resolving the name when dhcp is completed. While at it, do this in a way that net_set_serverip is only called when resolv() returns something useful. Otherwise we may end up overwriting a previously configured serverip which came from the bootp bp_siaddr field. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: Fix return value on ctrl-cSascha Hauer2013-05-141-2/+4
| | | | | | | the dhcp command will return with 0 when ctrl-c is pressed. Fix this to -EINTR instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* netconsole: use dev_add_param_* helpersSascha Hauer2013-04-111-44/+6
| | | | | | For shorter code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: store ethernet device parameters in deviceSascha Hauer2013-04-112-81/+39
| | | | | | | | Rather than storing the parameters globally and trying to keep them in sync with the device parameters, store the parameters in the ethernet device directly. Also, update to dev_add_param_ip(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net/console: switch to pr_xxxJean-Christophe PLAGNIOL-VILLARD2013-03-091-2/+4
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: fix typoSascha Hauer2013-02-281-2/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce console none supportJean-Christophe PLAGNIOL-VILLARD2013-01-231-0/+1
| | | | | | | | | | | | 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>
* Merge branch 'pu/net-link'Sascha Hauer2012-12-131-0/+3
|\
| * net phylib: force to wait for linkSascha Hauer2012-12-121-0/+3
| | | | | | | | | | | | | | | | 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>
* | drivers/base: fix corrupt device treeSascha Hauer2012-12-121-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 c2e568d19c5c34a05a1002d25280bf113b72b752 | 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>
* net phylib: Call phy_update_status when no link is presentSascha Hauer2012-12-081-1/+2
| | | | | | | | | | | | 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>
* Merge branch 'kconfig'Sascha Hauer2012-12-081-1/+1
|\
| * Cleanup Kconfig filesAlexander Shiyan2012-12-081-1/+1
| | | | | | | | | | | | | | | | | | 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>
* | mem: add the swab (swap bytes) option to memory_display()Antony Pavlov2012-11-261-1/+1
|/ | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2012-11-161-1/+1
|\ | | | | | | | | | | | | Conflicts: commands/Makefile Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * eth: register device a pure deviceJean-Christophe PLAGNIOL-VILLARD2012-11-121-1/+1
| | | | | | | | | | | | | | 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>
* | net eth: make edev->init optionalSascha Hauer2012-10-301-1/+2
|/ | | | | | | | | | 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>
* switch all platform_bus device/driver registering to ↵Jean-Christophe PLAGNIOL-VILLARD2012-10-041-1/+1
| | | | | | | | 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>
* Merge branch 'for-next/tftp'Sascha Hauer2012-10-034-439/+0
|\
| * net: remove old tftp supportSascha Hauer2012-09-284-439/+0
| | | | | | | | | | | | | | 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>
* | Merge branch 'for-next/remove-fsf-address'Sascha Hauer2012-10-034-14/+0
|\ \ | | | | | | | | | | | | | | | Conflicts: drivers/net/miidev.c include/miidev.h
| * | Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-174-14/+0
| |/ | | | | | | | | | | | | 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>
* | Merge branch 'for-next/boot-sequence-dhcp'Sascha Hauer2012-10-031-25/+142
|\ \ | | | | | | | | | | | | Conflicts: drivers/net/miidev.c
| * | dhcp: add retries limit supportJean-Christophe PLAGNIOL-VILLARD2012-10-021-3/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | dhcp: add copy_only_if_valid supportJean-Christophe PLAGNIOL-VILLARD2012-10-021-1/+6
| | | | | | | | | | | | | | | | | | | | | 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>
| * | dhcp: switch to global var supportJean-Christophe PLAGNIOL-VILLARD2012-10-021-19/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | defaultenv: switch hostname to global.hostnameJean-Christophe PLAGNIOL-VILLARD2012-10-021-2/+2
| | | | | | | | | | | | | | | | | | Udpate dhcp with it too. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>