diff options
| author | Michael Brown | 2008-11-21 21:31:12 +0100 |
|---|---|---|
| committer | Michael Brown | 2008-11-21 21:34:02 +0100 |
| commit | 02a021587336a9ada3845025610ba836b173464d (patch) | |
| tree | 972b32b60effd0ed54752581e93498d3eaa4aa59 /src/include | |
| parent | [pxe] Select the correct network device on multiport cards (diff) | |
| download | ipxe-02a021587336a9ada3845025610ba836b173464d.tar.gz ipxe-02a021587336a9ada3845025610ba836b173464d.tar.xz ipxe-02a021587336a9ada3845025610ba836b173464d.zip | |
[netdevice] Provide function to retrieve the most recently opened net device
There are currently four places within the codebase that use a
heuristic to guess the "boot network device", with varying degrees of
success. Add a feature to the net device core to maintain a list of
open network devices, in order of opening, and provide a function
last_opened_netdev() to retrieve the most recently opened net device.
This should do a better job than the current assortment of
guess_boot_netdev() functions.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/gpxe/netdevice.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/gpxe/netdevice.h b/src/include/gpxe/netdevice.h index 01b853f32..f1585de07 100644 --- a/src/include/gpxe/netdevice.h +++ b/src/include/gpxe/netdevice.h @@ -229,6 +229,8 @@ struct net_device { struct refcnt refcnt; /** List of network devices */ struct list_head list; + /** List of open network devices */ + struct list_head open_list; /** Name of this network device */ char name[8]; /** Underlying hardware device */ @@ -424,6 +426,7 @@ extern void netdev_irq ( struct net_device *netdev, int enable ); extern struct net_device * find_netdev ( const char *name ); extern struct net_device * find_netdev_by_location ( unsigned int bus_type, unsigned int location ); +extern struct net_device * last_opened_netdev ( void ); extern int net_tx ( struct io_buffer *iobuf, struct net_device *netdev, struct net_protocol *net_protocol, const void *ll_dest ); extern int net_rx ( struct io_buffer *iobuf, struct net_device *netdev, |
