Browse Source

[vlan] Expose vlan_find() to network card drivers

Some network cards automatically strip the VLAN header, providing the
VLAN tag via a side channel such as a completion queue entry.  These
cards need to be able to report receive completions directly against
the relevant VLAN device.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 13 years ago
parent
commit
5273c2748c
2 changed files with 3 additions and 2 deletions
  1. 2
    0
      src/include/ipxe/vlan.h
  2. 1
    2
      src/net/vlan.c

+ 2
- 0
src/include/ipxe/vlan.h View File

59
  */
59
  */
60
 #define VLAN_PRIORITY_IS_VALID( priority ) ( (priority) <= 7 )
60
 #define VLAN_PRIORITY_IS_VALID( priority ) ( (priority) <= 7 )
61
 
61
 
62
+extern struct net_device * vlan_find ( struct net_device *trunk,
63
+				       unsigned int tag );
62
 extern int vlan_can_be_trunk ( struct net_device *trunk );
64
 extern int vlan_can_be_trunk ( struct net_device *trunk );
63
 extern int vlan_create ( struct net_device *trunk, unsigned int tag,
65
 extern int vlan_create ( struct net_device *trunk, unsigned int tag,
64
 			 unsigned int priority );
66
 			 unsigned int priority );

+ 1
- 2
src/net/vlan.c View File

193
  * @v tag		VLAN tag
193
  * @v tag		VLAN tag
194
  * @ret netdev		VLAN device, if any
194
  * @ret netdev		VLAN device, if any
195
  */
195
  */
196
-static struct net_device * vlan_find ( struct net_device *trunk,
197
-				       uint16_t tag ) {
196
+struct net_device * vlan_find ( struct net_device *trunk, unsigned int tag ) {
198
 	struct net_device *netdev;
197
 	struct net_device *netdev;
199
 	struct vlan_device *vlan;
198
 	struct vlan_device *vlan;
200
 
199
 

Loading…
Cancel
Save