Sfoglia il codice sorgente

[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>
tags/v1.20.1
Michael Brown 11 anni fa
parent
commit
77f64b11f7
1 ha cambiato i file con 12 aggiunte e 0 eliminazioni
  1. 12
    0
      src/net/netdevice.c

+ 12
- 0
src/net/netdevice.c Vedi File

@@ -794,5 +794,17 @@ __weak unsigned int vlan_tag ( struct net_device *netdev __unused ) {
794 794
 	return 0;
795 795
 }
796 796
 
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
+
797 809
 /** Networking stack process */
798 810
 PERMANENT_PROCESS ( net_process, net_step );

Loading…
Annulla
Salva