Skip to content

Commit 77f64b1

Browse files
committedMar 1, 2013
[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>
1 parent 7d64abb commit 77f64b1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

‎src/net/netdevice.c

+12
Original file line numberDiff line numberDiff line change
@@ -794,5 +794,17 @@ __weak unsigned int vlan_tag ( struct net_device *netdev __unused ) {
794794
return 0;
795795
}
796796

797+
/**
798+
* Identify VLAN device (when VLAN support is not present)
799+
*
800+
* @v trunk Trunk network device
801+
* @v tag VLAN tag
802+
* @ret netdev VLAN device, if any
803+
*/
804+
__weak struct net_device * vlan_find ( struct net_device *trunk __unused,
805+
unsigned int tag __unused ) {
806+
return NULL;
807+
}
808+
797809
/** Networking stack process */
798810
PERMANENT_PROCESS ( net_process, net_step );

0 commit comments

Comments
 (0)