STRUCT MACSEC_CONTEXT(9)
β¨ struct macsec_context(9) β¨
okay so bestie, welcome to struct macsec_context β this is the page from the Kernel API Manual and it's giving "the little struct that carries all your MACsec offloading vibes." π It's the context struct for MACsec hardware offloading. Like, it's the bag you hand to your driver so it knows what's up. Periodt. π
πΈ NAME πΈ
struct macsec_context β MACsec context for hardware offloading π
π¦ SYNOPSIS π¦
struct macsec_context {
union {
struct net_device *netdev;
struct phy_device *phydev;
};
enum macsec_offload offload;
struct macsec_secy *secy;
struct macsec_rx_sc *rx_sc;
struct {
bool update_pn;
unsigned char assoc_num;
u8 key[MACSEC_MAX_KEY_LEN];
union {
struct macsec_rx_sa *rx_sa;
struct macsec_tx_sa *tx_sa;
};
} sa;
union {
struct macsec_tx_sc_stats *tx_sc_stats;
struct macsec_tx_sa_stats *tx_sa_stats;
struct macsec_rx_sc_stats *rx_sc_stats;
struct macsec_rx_sa_stats *rx_sa_stats;
struct macsec_dev_stats *dev_stats;
} stats;
};
likeβ¦ look at her. iconic layout, no notes. π₯
π Members π
so here's the member-by-member vibe check, bestie β every single one, no skips:
{unnamed_union}β anonymous π (yes, the page literally just says "anonymous" and honestly? same energy)netdevβ a valid pointer to astruct net_deviceifoffload == MACSEC_OFFLOAD_MACβ¨phydevβ a valid pointer to astruct phy_deviceifoffload == MACSEC_OFFLOAD_PHYβ¨offloadβ MACsec offload status π«secyβ pointer to a MACsec SecY πrx_scβ pointer to a RX SC π{unnamed_union}β anonymous π (round two, she's back)
ngl the takeaway is: the union up top is a pick-your-fighter between netdev and phydev, and which one you get is literally decided by offload. iykyk π
heads up bestie: the doc as written only spells out the members above β thesabit and thestatsunion are right there in the struct, so read 'em straight from the synopsis and don't let anyone tell you otherwise π«Ά
π SEE ALSO π
- Kernel file
./include/net/macsec.h struct macsec_key(9)struct macsec_rx_sa(9)struct macsec_rx_sc(9)struct macsec_tx_sa(9)struct macsec_tx_sc(9)struct macsec_secy(9)struct macsec_ops(9)
like a whole friend group of structs, and you should absolutely go meet all of them π
and that's the whole page, bestie β sourced from ./include/net, dated October 2026, and filed under struct macsec_context(9) forever and ever. slay, drink water, go offload something safely π§πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms