From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by canuck.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1Pq1Zw-0007eo-9e for barebox@lists.infradead.org; Thu, 17 Feb 2011 10:59:21 +0000 Received: from gallifrey.ext.pengutronix.de ([2001:6f8:1178:4:5054:ff:fe8d:eefb] helo=localhost) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1Pq1Zu-0004kq-Dh for barebox@lists.infradead.org; Thu, 17 Feb 2011 11:59:18 +0100 From: Juergen Beisert Date: Thu, 17 Feb 2011 11:57:14 +0100 MIME-Version: 1.0 Content-Disposition: inline Message-Id: <201102171157.14757.jbe@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: How to handle more than one network device in barebox To: barebox@lists.infradead.org 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/ | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox