]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[netdevice] Allocate private data for each network upper-layer driver
authorMichael Brown <mcb30@ipxe.org>
Wed, 13 Sep 2023 15:29:59 +0000 (16:29 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 13 Sep 2023 19:23:46 +0000 (20:23 +0100)
commitae4e85bde97c9b216736a5087039f3309a628d24
tree39d706e2f330bd015d11ce38193c1baeab207cc8
parenteeb7cd56e54e2bc649626988872c170fba37c163
[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>
13 files changed:
src/arch/x86/interface/pxe/pxe_call.c
src/arch/x86/interface/vmware/guestinfo.c
src/core/cachedhcp.c
src/drivers/net/netfront.c
src/include/ipxe/netdevice.h
src/interface/efi/efi_snp.c
src/net/fcoe.c
src/net/infiniband/xsigo.c
src/net/ipv6.c
src/net/lldp.c
src/net/neighbour.c
src/net/netdevice.c
src/net/vlan.c