9
0
Fork 0
Commit Graph

80 Commits

Author SHA1 Message Date
Sascha Hauer b381e781bf treewide include/: Add missing includes
This adds several missing includes to files under include/ which
we relied on being included implicitly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-31 08:32:59 +02:00
Sascha Hauer 6d0161d02a net: store ethernet device parameters in device
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>
2013-04-11 11:48:34 +02:00
Sascha Hauer b5f4213be6 net: remove unused prototypes for eth_[open|halt]
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-27 23:55:16 +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
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
Eric Bénard b63352f38a iim: fix compilation when NET is not selected
Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-18 11:25:05 +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 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
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
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
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 31078e0839 net: let net_udp_get_payload return void *
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-19 18:51:03 +01: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 9a4abe67ff net: remove unused fields from struct eth_device
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-29 12:03:07 +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
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 8f0daf3a7d Remove unused eth_get_name() prototype.
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
Sascha Hauer 7867ceb8dc net: implement random_ether_addr
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-22 15:44:44 +02:00
Sascha Hauer 738d70e430 include support for a simple pseudo number generator
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-22 15:44:44 +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 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 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
Sascha Hauer d2a58c2173 remove unused cdp code
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-01-25 08:30:53 +01: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 a5f301fb7a remove unused variable NetBootFileSize
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
2009-10-17 08:54:57 +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 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 8c17c465d6 make netboot_common a global function
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 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 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 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 33c488f8c1 net: remove unused function declarations
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-20 13:16:03 +02:00
Sascha Hauer 9d0662bc0a net.h: no need to put extern declarations in ifdefs 2008-06-03 13:33:22 +02: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 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 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 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 5ab5b339a2 svn_rev_574
eth_init -> eth_open
2007-07-05 18:02:06 +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
Sascha Hauer 09cb554859 svn_rev_409
remove extern
2007-07-05 18:01:51 +02:00