Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp925472imu; Wed, 23 Jan 2019 08:02:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN4u15nO9Yv1Pb23GXckbGwPyQiY+aJAZOT2Ghk6xWYjbEQIv5iF3R/e1rfZqzEPglZiS0B8 X-Received: by 2002:a17:902:7044:: with SMTP id h4mr2712429plt.35.1548259328172; Wed, 23 Jan 2019 08:02:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548259328; cv=none; d=google.com; s=arc-20160816; b=UaNkh81lvuIysN6Asyz5v99MEo9CUmTf6kNZy/LRE1Ng5twmBurT0oQJV6k9woXgU3 zqMxW7YuUaUrkq1Vuplrv1YPV7pHFm0M8pworCRjcqcJnPKd15uLoOGyeiCWh4SDBfHK JrIFLQetQM/Q1zxeQKoXgNmKFCl1phvY8h6cpTd7WWS63BUuwSMTFszxb9/h9eLq2jvh A8n3IsR2tEVnaQskpt1EjKEBXgWkFml2LyRccoxY2kjjUWr3Jt1YKKOJCGZZR2yuUscy Sg96lcrgcF3iCcRWqGhIWg8LpJ20gXk1WNNlWfGILlH+mxmVmfWeIVRGm4xhrhyOyX+p 4WVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=FGO9W1bRHYTonxVve6ZXbclAgZbiXn3PjbSEhhnNuG0=; b=MppHyN+B6lbrUd+Ghz5TNnTIG+XHrbrMeutJmJ7MKX259Hu0PyLcgCMbbsFSbUYrwL +uy4xCc6IyOLYrDAgP/weH5UbMIAudnbMczuaC/hNKkQL0i+U4VVTnJ9clxEt98xiKp9 SQWY9LtxZdFq3R5Qqeeu80UnIKGLIgS6+Bm/AQHB17XtODNya9eun9cIXarCDGlS3AJi IczymP9qzTL6V5abGoZNfdfiLnRw2M6LcDIUnhiz7mNaIGwesv2DL4nYv/aDDSd727mo h42T9oqqhmYYiXs2WW6hgKZARNEiWr5TydI0J6xCmUOOrFx7eqvQICgdPeunRIaJVYgT ivaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 82si19174300pfa.115.2019.01.23.08.01.52; Wed, 23 Jan 2019 08:02:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726197AbfAWQAM (ORCPT + 99 others); Wed, 23 Jan 2019 11:00:12 -0500 Received: from mail.bootlin.com ([62.4.15.54]:42218 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726095AbfAWP7H (ORCPT ); Wed, 23 Jan 2019 10:59:07 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 04E3E207B6; Wed, 23 Jan 2019 16:59:05 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.2 Received: from localhost (aaubervilliers-681-1-87-206.w90-88.abo.wanadoo.fr [90.88.29.206]) by mail.bootlin.com (Postfix) with ESMTPSA id C8D1E2084E; Wed, 23 Jan 2019 16:58:54 +0100 (CET) From: Antoine Tenart To: davem@davemloft.net, sd@queasysnail.net, andrew@lunn.ch, f.fainelli@gmail.com, hkallweit1@gmail.com Cc: Antoine Tenart , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, alexandre.belloni@bootlin.com, quentin.schulz@bootlin.com, allan.nielsen@microchip.com Subject: [PATCH net-next 04/10] net: macsec: introduce the netdev_macsec structure Date: Wed, 23 Jan 2019 16:56:32 +0100 Message-Id: <20190123155638.13852-5-antoine.tenart@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190123155638.13852-1-antoine.tenart@bootlin.com> References: <20190123155638.13852-1-antoine.tenart@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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