How to handle more than one network device in barebox

Juergen Beisert jbe at pengutronix.de
Thu Feb 17 05:57:14 EST 2011


Hi,

due to the fact (all?) network device drivers in barebox are using xzalloc to 
allocate their "struct eth_device" the embedded "struct dev's" '.id' is 
always '0'. So the registration of a second network device fails always with

 register_device: already registered eth0

Currently there is no way to overwrite the network device's ID. If I init 
the "edev->dev.id" with '-1', it works. But it would be nice to define the 
network device ordering from inside the platform (and not only with the order 
I register the base devices). And copying the ".id" from the registered base 
device also does not work if the network devices are of different type, due 
to the framework starts with index 0 for different names.

Any ideas how to?

Regards,
Juergen

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | Phone: +49-8766-939 228     |
Vertretung Sued/Muenchen, Germany             | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686              | http://www.pengutronix.de/  |



More information about the barebox mailing list