aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2023-09-13 16:29:59 +0100
committerMichael Brown <mcb30@ipxe.org>2023-09-13 20:23:46 +0100
commitae4e85bde97c9b216736a5087039f3309a628d24 (patch)
tree39d706e2f330bd015d11ce38193c1baeab207cc8 /src/core
parenteeb7cd56e54e2bc649626988872c170fba37c163 (diff)
downloadipxe-ae4e85bde97c9b216736a5087039f3309a628d24.zip
ipxe-ae4e85bde97c9b216736a5087039f3309a628d24.tar.gz
ipxe-ae4e85bde97c9b216736a5087039f3309a628d24.tar.bz2
[netdevice] Allocate private data for each network upper-layer driver
Allow network upper-layer drivers (such as LLDP, which attaches to each network device in order to provide a corresponding LLDP settings block) to specify a size for private data, which will be allocated as part of the network device structure (as with the existing private data allocated for the underlying device driver). This will allow network upper-layer drivers to be simplified by omitting memory allocation and freeing code. If the upper-layer driver requires a reference counter (e.g. for interface initialisation), then it may use the network device's existing reference counter, since this is now the reference counter for the containing block of memory. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/cachedhcp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/cachedhcp.c b/src/core/cachedhcp.c
index 60213f0..57226e1 100644
--- a/src/core/cachedhcp.c
+++ b/src/core/cachedhcp.c
@@ -295,9 +295,10 @@ struct startup_fn cachedhcp_startup_fn __startup_fn ( STARTUP_LATE ) = {
* Apply cached DHCPACK to network device, if applicable
*
* @v netdev Network device
+ * @v priv Private data
* @ret rc Return status code
*/
-static int cachedhcp_probe ( struct net_device *netdev ) {
+static int cachedhcp_probe ( struct net_device *netdev, void *priv __unused ) {
/* Apply cached DHCPACK to network device, if applicable */
return cachedhcp_apply ( &cached_dhcpack, netdev );