mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 10:39:08 +00:00
net: introduce per device index
Instead of counting the device index everytime a functions needs it, store it in the eth_device struct. eth_register() keeps track of the indices and updates the device's index number. This simplifies some functions in net/eth.c. Additionally, a network driver can now query its index, eg. to get the correct environment ethaddr name. Signed-off-by: Michael Walle <michael@walle.cc> Cc: Prafulla Wadaskar <prafulla@marvell.com> Cc: Mike Frysinger <vapier@gentoo.com> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
19a5944fcd
commit
fea7dcae50
2 changed files with 13 additions and 29 deletions
|
@ -90,6 +90,7 @@ struct eth_device {
|
|||
#endif
|
||||
int (*write_hwaddr) (struct eth_device*);
|
||||
struct eth_device *next;
|
||||
int index;
|
||||
void *priv;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue