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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>