#include <stdint.h>
#include <gpxe/list.h>
#include <gpxe/tables.h>
+#include <gpxe/hotplug.h>
struct pk_buff;
struct net_device;
struct net_device {
/** List of network devices */
struct list_head list;
+
+ /** List of persistent reference holders */
+ struct list_head references;
+
/** Transmit packet
*
* @v netdev Network device
netdev = calloc ( 1, sizeof ( *netdev ) + priv_size );
if ( netdev ) {
+ INIT_LIST_HEAD ( &netdev->references );
INIT_LIST_HEAD ( &netdev->rx_queue );
netdev->priv = ( ( ( void * ) netdev ) + sizeof ( *netdev ) );
}
free_pkb ( pkb );
}
+ /* Kill off any persistent references to this device */
+ forget_references ( &netdev->references );
+
/* Remove from device list */
list_del ( &netdev->list );
DBG ( "%s unregistered\n", netdev_name ( netdev ) );