svn commit: r294830 - head/sys/compat/linuxkpi/common/include/linux

Hans Petter Selasky hselasky at FreeBSD.org
Tue Jan 26 14:33:22 UTC 2016


Author: hselasky
Date: Tue Jan 26 14:33:20 2016
New Revision: 294830
URL: https://svnweb.freebsd.org/changeset/base/294830

Log:
  Implement is_vlan_dev() and vlan_dev_vlan_id() for the LinuxKPI.
  
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/if_vlan.h

Modified: head/sys/compat/linuxkpi/common/include/linux/if_vlan.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/if_vlan.h	Tue Jan 26 14:31:20 2016	(r294829)
+++ head/sys/compat/linuxkpi/common/include/linux/if_vlan.h	Tue Jan 26 14:33:20 2016	(r294830)
@@ -2,7 +2,7 @@
  * Copyright (c) 2010 Isilon Systems, Inc.
  * Copyright (c) 2010 iX Systems, Inc.
  * Copyright (c) 2010 Panasas, Inc.
- * Copyright (c) 2013 Mellanox Technologies, Ltd.
+ * Copyright (c) 2013-2016 Mellanox Technologies, Ltd.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -35,8 +35,25 @@
 #include <sys/socket.h>
 #include <net/if.h>
 #include <net/ethernet.h>
+#include <net/if_var.h>
 #include <net/if_vlan_var.h>
+#include <net/if_types.h>
 
 #define VLAN_N_VID              4096
 
+static inline int
+is_vlan_dev(struct ifnet *ifp)
+{
+	return (ifp->if_type == IFT_L2VLAN);
+}
+
+static inline uint16_t
+vlan_dev_vlan_id(struct ifnet *ifp)
+{
+	uint16_t vtag;
+	if (VLAN_TAG(ifp, &vtag) == 0)
+		return (vtag);
+	return (0);
+}
+
 #endif	/* _LINUX_IF_VLAN_H_ */


More information about the svn-src-all mailing list