Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5938654 authored by Antoine Tenart's avatar Antoine Tenart Committed by Gerrit - the friendly Code Review server
Browse files

net: macsec: introduce the macsec_context structure



This patch introduces the macsec_context structure. It will be used
in the kernel to exchange information between the common MACsec
implementation (macsec.c) and the MACsec hardware offloading
implementations. This structure contains pointers to MACsec specific
structures which contain the actual MACsec configuration, and to the
underlying device (phydev for now).

Change-Id: Ib7d4e6f1667c2f4679e4d51d68671075462237db
Signed-off-by: default avatarAntoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Git-commit: 76564261a7db80c5f5c624e0122a28787f266bdf
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarKarthik Rudrapatna <quic_krudrapa@quicinc.com>
parent 859afae3
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -326,6 +326,8 @@ struct phy_c45_device_ids {
	u32 device_ids[8];
	u32 device_ids[8];
};
};


struct macsec_context;

/* phy_device: An instance of a PHY
/* phy_device: An instance of a PHY
 *
 *
 * drv: Pointer to the driver for this PHY instance
 * drv: Pointer to the driver for this PHY instance
+21 −0
Original line number Original line Diff line number Diff line
@@ -174,4 +174,25 @@ struct macsec_secy {
	struct macsec_rx_sc __rcu *rx_sc;
	struct macsec_rx_sc __rcu *rx_sc;
};
};


/**
 * struct macsec_context - MACsec context for hardware offloading
 */
struct macsec_context {
	struct phy_device *phydev;
	enum macsec_offload offload;

	struct macsec_secy *secy;
	struct macsec_rx_sc *rx_sc;
	struct {
		unsigned char assoc_num;
		u8 key[MACSEC_KEYID_LEN];
		union {
			struct macsec_rx_sa *rx_sa;
			struct macsec_tx_sa *tx_sa;
		};
	} sa;

	u8 prepare:1;
};

#endif /* _NET_MACSEC_H_ */
#endif /* _NET_MACSEC_H_ */
+7 −0
Original line number Original line Diff line number Diff line
@@ -483,6 +483,13 @@ enum macsec_validation_type {
	MACSEC_VALIDATE_MAX = __MACSEC_VALIDATE_END - 1,
	MACSEC_VALIDATE_MAX = __MACSEC_VALIDATE_END - 1,
};
};


enum macsec_offload {
	MACSEC_OFFLOAD_OFF = 0,
	MACSEC_OFFLOAD_PHY = 1,
	__MACSEC_OFFLOAD_END,
	MACSEC_OFFLOAD_MAX = __MACSEC_OFFLOAD_END - 1,
};

/* IPVLAN section */
/* IPVLAN section */
enum {
enum {
	IFLA_IPVLAN_UNSPEC,
	IFLA_IPVLAN_UNSPEC,
+7 −0
Original line number Original line Diff line number Diff line
@@ -483,6 +483,13 @@ enum macsec_validation_type {
	MACSEC_VALIDATE_MAX = __MACSEC_VALIDATE_END - 1,
	MACSEC_VALIDATE_MAX = __MACSEC_VALIDATE_END - 1,
};
};


enum macsec_offload {
	MACSEC_OFFLOAD_OFF = 0,
	MACSEC_OFFLOAD_PHY = 1,
	__MACSEC_OFFLOAD_END,
	MACSEC_OFFLOAD_MAX = __MACSEC_OFFLOAD_END - 1,
};

/* IPVLAN section */
/* IPVLAN section */
enum {
enum {
	IFLA_IPVLAN_UNSPEC,
	IFLA_IPVLAN_UNSPEC,