Date: Tue, 26 Jan 2016 14:33:21 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294830 - head/sys/compat/linuxkpi/common/include/linux Message-ID: <201601261433.u0QEXL8N048155@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601261433.u0QEXL8N048155>