Thread (26 messages) 26 messages, 5 authors, 2019-02-01
STALE2683d
Revisions (6)
  1. v1 current
  2. v2 [diff vs current]
  3. v3 [diff vs current]
  4. v4 [diff vs current]
  5. v5 [diff vs current]
  6. v6 [diff vs current]

[PATCH net-next 04/10] net: macsec: introduce the netdev_macsec structure

From: Antoine Tenart <hidden>
Date: 2019-01-23 16:00:14
Also in: lkml
Subsystem: networking [general], networking [macsec], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Sabrina Dubroca, Linus Torvalds

This patch introduces the netdev_macsec 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 a command (struct
netdev_macsec_command) and pointers to MACsec specific structures which
contain the actual MACsec configuration.

Signed-off-by: Antoine Tenart <redacted>
---
 include/net/macsec.h | 45 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
diff --git a/include/net/macsec.h b/include/net/macsec.h
index 15ff331dd670..1e4d37c190ed 100644
--- a/include/net/macsec.h
+++ b/include/net/macsec.h
@@ -175,4 +175,49 @@ struct macsec_secy {
 	struct macsec_rx_sc __rcu *rx_sc;
 };
 
+enum netdev_macsec_command {
+	/* Device wide */
+	MACSEC_DEV_OPEN,
+	MACSEC_DEV_STOP,
+
+	/* SecY */
+	MACSEC_ADD_SECY,
+	MACSEC_UPD_SECY,
+	MACSEC_DEL_SECY,
+
+	/* Security channels */
+	MACSEC_ADD_RXSC,
+	MACSEC_UPD_RXSC,
+	MACSEC_DEL_RXSC,
+
+	/* Security associations */
+	MACSEC_ADD_RXSA,
+	MACSEC_UPD_RXSA,
+	MACSEC_DEL_RXSA,
+	MACSEC_ADD_TXSA,
+	MACSEC_UPD_TXSA,
+	MACSEC_DEL_TXSA,
+};
+
+struct netdev_macsec {
+	enum netdev_macsec_command command;
+	u8 prepare:1;
+
+	union {
+		/* MACSEC_*_SECY */
+		const struct macsec_secy *secy;
+		/* MACSEC_*_RXSC */
+		const struct macsec_rx_sc *rx_sc;
+		/* MACSEC_*_RXSA/TXSA */
+		struct {
+			unsigned char assoc_num;
+			u8 key[MACSEC_KEYID_LEN];
+			union {
+				const struct macsec_rx_sa *rx_sa;
+				const struct macsec_tx_sa *tx_sa;
+			};
+		} sa;
+	};
+};
+
 #endif /* _NET_MACSEC_H_ */
-- 
2.20.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help