It is unintuitive to have to include an "ifopen" at the start of an
autoexec.ipxe script. Provide a mechanism for upper-layer drivers to
mark a network device to be opened automatically upon registration,
and do so for the device to which the cached DHCPACK is applied.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
settings = netdev_settings ( netdev );
DBGC ( colour, "CACHEDHCP %s is for %s\n",
cache->name, netdev->name );
+
+ /* Mark network device to be opened automatically */
+ netdev->state |= NETDEV_AUTO_OPEN;
}
/* Register settings */
/** Network device must be polled even when closed */
#define NETDEV_INSOMNIAC 0x0040
+/** Network device should be opened automatically */
+#define NETDEV_AUTO_OPEN 0x0080
+
/** Link-layer protocol table */
#define LL_PROTOCOLS __table ( struct ll_protocol, "ll_protocols" )
}
}
+ /* Attempt to open device automatically, if applicable */
+ if ( netdev->state & NETDEV_AUTO_OPEN )
+ netdev_open ( netdev );
+
return 0;
err_probe: