Commit 3c175784 authored by Sabrina Dubroca's avatar Sabrina Dubroca Committed by David S. Miller

net: add MACsec netdevice priv_flags and helper

Signed-off-by: default avatarSabrina Dubroca <sd@queasysnail.net>
Reviewed-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dece8d2b
...@@ -1328,6 +1328,7 @@ struct net_device_ops { ...@@ -1328,6 +1328,7 @@ struct net_device_ops {
* @IFF_RXFH_CONFIGURED: device has had Rx Flow indirection table configured * @IFF_RXFH_CONFIGURED: device has had Rx Flow indirection table configured
* @IFF_PHONY_HEADROOM: the headroom value is controlled by an external * @IFF_PHONY_HEADROOM: the headroom value is controlled by an external
* entity (i.e. the master device for bridged veth) * entity (i.e. the master device for bridged veth)
* @IFF_MACSEC: device is a MACsec device
*/ */
enum netdev_priv_flags { enum netdev_priv_flags {
IFF_802_1Q_VLAN = 1<<0, IFF_802_1Q_VLAN = 1<<0,
...@@ -1357,6 +1358,7 @@ enum netdev_priv_flags { ...@@ -1357,6 +1358,7 @@ enum netdev_priv_flags {
IFF_TEAM = 1<<24, IFF_TEAM = 1<<24,
IFF_RXFH_CONFIGURED = 1<<25, IFF_RXFH_CONFIGURED = 1<<25,
IFF_PHONY_HEADROOM = 1<<26, IFF_PHONY_HEADROOM = 1<<26,
IFF_MACSEC = 1<<27,
}; };
#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
...@@ -1385,6 +1387,7 @@ enum netdev_priv_flags { ...@@ -1385,6 +1387,7 @@ enum netdev_priv_flags {
#define IFF_L3MDEV_SLAVE IFF_L3MDEV_SLAVE #define IFF_L3MDEV_SLAVE IFF_L3MDEV_SLAVE
#define IFF_TEAM IFF_TEAM #define IFF_TEAM IFF_TEAM
#define IFF_RXFH_CONFIGURED IFF_RXFH_CONFIGURED #define IFF_RXFH_CONFIGURED IFF_RXFH_CONFIGURED
#define IFF_MACSEC IFF_MACSEC
/** /**
* struct net_device - The DEVICE structure. * struct net_device - The DEVICE structure.
...@@ -4045,6 +4048,11 @@ static inline void skb_gso_error_unwind(struct sk_buff *skb, __be16 protocol, ...@@ -4045,6 +4048,11 @@ static inline void skb_gso_error_unwind(struct sk_buff *skb, __be16 protocol,
skb->mac_len = mac_len; skb->mac_len = mac_len;
} }
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) static inline bool netif_is_macvlan(const struct net_device *dev)
{ {
return dev->priv_flags & IFF_MACVLAN; return dev->priv_flags & IFF_MACVLAN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment