From 80cf05689d6d19f42e132d4bd83756874fdafe9b Mon Sep 17 00:00:00 2001 From: Sabrina Dubroca Date: Fri, 11 Mar 2016 18:07:32 +0100 Subject: [PATCH] net: add MACsec netdevice priv_flags and helper Signed-off-by: Sabrina Dubroca Reviewed-by: Hannes Frederic Sowa Signed-off-by: David S. Miller (cherry picked from commit 3c17578473b9be5a6e7680a45ea97e1d56e13249) Orabug: 24614549 Signed-off-by: Ethan Zhao Conflicts: include/linux/netdevice.h Signed-off-by: Dhaval Giani --- include/linux/netdevice.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 67a789efde5e..a5f33715429d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1244,6 +1244,7 @@ struct net_device_ops { * change when it's running * @IFF_MACVLAN: Macvlan device * @IFF_NO_QUEUE: device can run without qdisc attached + * @IFF_MACSEC: device is a MACsec device */ enum netdev_priv_flags { IFF_802_1Q_VLAN = 1<<0, @@ -1272,6 +1273,7 @@ enum netdev_priv_flags { IFF_IPVLAN_MASTER = 1<<23, IFF_IPVLAN_SLAVE = 1<<24, IFF_NO_QUEUE = 1<<26, + IFF_MACSEC = 1<<27, }; #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN @@ -1300,6 +1302,7 @@ enum netdev_priv_flags { #define IFF_IPVLAN_MASTER IFF_IPVLAN_MASTER #define IFF_IPVLAN_SLAVE IFF_IPVLAN_SLAVE #define IFF_NO_QUEUE IFF_NO_QUEUE +#define IFF_MACSEC IFF_MACSEC /** * struct net_device - The DEVICE structure. @@ -3746,7 +3749,12 @@ static inline void skb_gso_error_unwind(struct sk_buff *skb, __be16 protocol, skb->mac_len = mac_len; } -static inline bool netif_is_macvlan(struct net_device *dev) +static inline bool netif_is_macsec(const struct net_device *dev) +{ + return dev->priv_flags & IFF_MACSEC; +} + +static inline bool netif_is_macvlan(const struct net_device *dev) { return dev->priv_flags & IFF_MACVLAN; } -- 2.50.1