drivers/net/phy/nxp-c45-tja11xx-macsec.c

Source file repositories/reference/linux-study-clean/drivers/net/phy/nxp-c45-tja11xx-macsec.c

File Facts

System
Linux kernel
Corpus path
drivers/net/phy/nxp-c45-tja11xx-macsec.c
Extension
.c
Size
45474 bytes
Lines
1726
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct nxp_c45_sa {
	void *sa;
	const struct nxp_c45_sa_regs *regs;
	enum nxp_c45_sa_type type;
	bool is_key_a;
	u8 an;
	struct list_head list;
};

struct nxp_c45_secy {
	struct macsec_secy *secy;
	struct macsec_rx_sc *rx_sc;
	struct list_head sa_list;
	int secy_id;
	bool rx_sc0_impl;
	struct list_head list;
};

struct nxp_c45_macsec {
	struct list_head secy_list;
	DECLARE_BITMAP(secy_bitmap, TX_SC_MAX);
	DECLARE_BITMAP(tx_sc_bitmap, TX_SC_MAX);
};

struct nxp_c45_sa_regs {
	u16 cs;
	u16 npn;
	u16 xnpn;
	u16 lnpn;
	u16 lxnpn;
	u16 ka;
	u16 ssci;
	u16 salt;
	u16 ipis;
	u16 ipnvs;
	u16 ipos;
	u16 opps;
	u16 opes;
};

static const struct nxp_c45_sa_regs rx_sa_a_regs = {
	.cs	= MACSEC_RXSA_A_CS,
	.npn	= MACSEC_RXSA_A_NPN,
	.xnpn	= MACSEC_RXSA_A_XNPN,
	.lnpn	= MACSEC_RXSA_A_LNPN,
	.lxnpn	= MACSEC_RXSA_A_LXNPN,
	.ka	= MACSEC_RXSA_A_KA,
	.ssci	= MACSEC_RXSA_A_SSCI,
	.salt	= MACSEC_RXSA_A_SALT,
	.ipis	= MACSEC_RXSA_A_IPIS,
	.ipnvs	= MACSEC_RXSA_A_IPNVS,
	.ipos	= MACSEC_RXSA_A_IPOS,
};

static const struct nxp_c45_sa_regs rx_sa_b_regs = {
	.cs	= MACSEC_RXSA_B_CS,
	.npn	= MACSEC_RXSA_B_NPN,
	.xnpn	= MACSEC_RXSA_B_XNPN,
	.lnpn	= MACSEC_RXSA_B_LNPN,
	.lxnpn	= MACSEC_RXSA_B_LXNPN,
	.ka	= MACSEC_RXSA_B_KA,
	.ssci	= MACSEC_RXSA_B_SSCI,
	.salt	= MACSEC_RXSA_B_SALT,
	.ipis	= MACSEC_RXSA_B_IPIS,
	.ipnvs	= MACSEC_RXSA_B_IPNVS,
	.ipos	= MACSEC_RXSA_B_IPOS,
};

static const struct nxp_c45_sa_regs tx_sa_a_regs = {
	.cs	= MACSEC_TXSA_A_CS,
	.npn	= MACSEC_TXSA_A_NPN,
	.xnpn	= MACSEC_TXSA_A_XNPN,
	.ka	= MACSEC_TXSA_A_KA,
	.ssci	= MACSEC_TXSA_A_SSCI,
	.salt	= MACSEC_TXSA_A_SALT,
	.opps	= MACSEC_TXSA_A_OPPS,
	.opes	= MACSEC_TXSA_A_OPES,
};

static const struct nxp_c45_sa_regs tx_sa_b_regs = {
	.cs	= MACSEC_TXSA_B_CS,
	.npn	= MACSEC_TXSA_B_NPN,
	.xnpn	= MACSEC_TXSA_B_XNPN,
	.ka	= MACSEC_TXSA_B_KA,
	.ssci	= MACSEC_TXSA_B_SSCI,
	.salt	= MACSEC_TXSA_B_SALT,
	.opps	= MACSEC_TXSA_B_OPPS,
	.opes	= MACSEC_TXSA_B_OPES,
};

Annotation

Implementation Notes