diff options
author | Michael Brown <mcb30@ipxe.org> | 2013-03-01 16:32:29 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2013-03-01 16:36:34 +0000 |
commit | 77f64b11f764e721f4f8704b7b90317e52d85fc3 (patch) | |
tree | b1c7c8f06f249e58d267db19be004ce58aa61f22 /src/net/netdevice.c | |
parent | 7d64abbc5d0b5dfe4810883f372b905a359f2697 (diff) | |
download | ipxe-77f64b11f764e721f4f8704b7b90317e52d85fc3.tar.gz |
[netdevice] Separate VLAN support from presence of VLAN-supporting drivers
Some NICs (e.g. Hermon) provide hardware support for stripping the
VLAN tag, but do not provide any way for this support to be disabled.
Drivers for this hardware must therefore call vlan_find() to identify
a suitable receiving network device.
Provide a weak version of vlan_find() which will always return NULL if
VLAN support has not been enabled (either directly, or by enabling
a feature such as FCoE which requires VLAN support). This allows the
VLAN code to be omitted from builds where the user has not requested
support for VLANs.
Inspired-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/netdevice.c')
-rw-r--r-- | src/net/netdevice.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/net/netdevice.c b/src/net/netdevice.c index a7166630..e9cbb9e9 100644 --- a/src/net/netdevice.c +++ b/src/net/netdevice.c @@ -794,5 +794,17 @@ __weak unsigned int vlan_tag ( struct net_device *netdev __unused ) { return 0; } +/** + * Identify VLAN device (when VLAN support is not present) + * + * @v trunk Trunk network device + * @v tag VLAN tag + * @ret netdev VLAN device, if any + */ +__weak struct net_device * vlan_find ( struct net_device *trunk __unused, + unsigned int tag __unused ) { + return NULL; +} + /** Networking stack process */ PERMANENT_PROCESS ( net_process, net_step ); |