Skip to content

Commit 3c17578

Browse files
qsndavem330
authored andcommitted
net: add MACsec netdevice priv_flags and helper
Signed-off-by: Sabrina Dubroca <[email protected]> Reviewed-by: Hannes Frederic Sowa <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent dece8d2 commit 3c17578

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/linux/netdevice.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,6 +1328,7 @@ struct net_device_ops {
13281328
* @IFF_RXFH_CONFIGURED: device has had Rx Flow indirection table configured
13291329
* @IFF_PHONY_HEADROOM: the headroom value is controlled by an external
13301330
* entity (i.e. the master device for bridged veth)
1331+
* @IFF_MACSEC: device is a MACsec device
13311332
*/
13321333
enum netdev_priv_flags {
13331334
IFF_802_1Q_VLAN = 1<<0,
@@ -1357,6 +1358,7 @@ enum netdev_priv_flags {
13571358
IFF_TEAM = 1<<24,
13581359
IFF_RXFH_CONFIGURED = 1<<25,
13591360
IFF_PHONY_HEADROOM = 1<<26,
1361+
IFF_MACSEC = 1<<27,
13601362
};
13611363

13621364
#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
@@ -1385,6 +1387,7 @@ enum netdev_priv_flags {
13851387
#define IFF_L3MDEV_SLAVE IFF_L3MDEV_SLAVE
13861388
#define IFF_TEAM IFF_TEAM
13871389
#define IFF_RXFH_CONFIGURED IFF_RXFH_CONFIGURED
1390+
#define IFF_MACSEC IFF_MACSEC
13881391

13891392
/**
13901393
* struct net_device - The DEVICE structure.
@@ -4045,6 +4048,11 @@ static inline void skb_gso_error_unwind(struct sk_buff *skb, __be16 protocol,
40454048
skb->mac_len = mac_len;
40464049
}
40474050

4051+
static inline bool netif_is_macsec(const struct net_device *dev)
4052+
{
4053+
return dev->priv_flags & IFF_MACSEC;
4054+
}
4055+
40484056
static inline bool netif_is_macvlan(const struct net_device *dev)
40494057
{
40504058
return dev->priv_flags & IFF_MACVLAN;

0 commit comments

Comments
 (0)