From fea7dcae506bfbc3f67f8ed6a415d4f45914ee9b Mon Sep 17 00:00:00 2001 From: Michael Walle Date: Thu, 27 Oct 2011 11:31:35 +0000 Subject: 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 Cc: Prafulla Wadaskar Cc: Mike Frysinger Cc: Wolfgang Denk Acked-by: Mike Frysinger --- include/net.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/net.h b/include/net.h index fa5d525..e4d42c2 100644 --- a/include/net.h +++ b/include/net.h @@ -90,6 +90,7 @@ struct eth_device { #endif int (*write_hwaddr) (struct eth_device*); struct eth_device *next; + int index; void *priv; }; -- cgit v1.1