diff options
author | hselasky <hselasky@FreeBSD.org> | 2016-01-26 14:33:20 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2016-01-26 14:33:20 +0000 |
commit | 69c5dfb50414f77c66c5de329b6743d3e97880ad (patch) | |
tree | b3552a49244e210be789759c8d2387665bb8469c /sys/compat | |
parent | 01e92615b0258ad313473e9a5fbbc576e25354b4 (diff) | |
download | FreeBSD-src-69c5dfb50414f77c66c5de329b6743d3e97880ad.zip FreeBSD-src-69c5dfb50414f77c66c5de329b6743d3e97880ad.tar.gz |
Implement is_vlan_dev() and vlan_dev_vlan_id() for the LinuxKPI.
MFC after: 1 week
Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linuxkpi/common/include/linux/if_vlan.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/if_vlan.h b/sys/compat/linuxkpi/common/include/linux/if_vlan.h index cd65183..59b1c7e 100644 --- a/sys/compat/linuxkpi/common/include/linux/if_vlan.h +++ b/sys/compat/linuxkpi/common/include/linux/if_vlan.h @@ -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_ */ |