]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net: add MACsec netdevice priv_flags and helper
authorSabrina Dubroca <sd@queasysnail.net>
Fri, 11 Mar 2016 17:07:32 +0000 (18:07 +0100)
committerDhaval Giani <dhaval.giani@oracle.com>
Mon, 16 Jan 2017 19:43:20 +0000 (14:43 -0500)
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3c17578473b9be5a6e7680a45ea97e1d56e13249)

Orabug: 24614549

Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
Conflicts:
include/linux/netdevice.h

Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
include/linux/netdevice.h

index 67a789efde5e2ef85b326f525c570296fdd6525f..a5f33715429d1955eee50f60f6d87ca816908906 100644 (file)
@@ -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;
 }