STRUCT PSP_DEV_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct psp_dev_ops(9) β€” like, the netdev driver's PSP callback era πŸ’–

okay bestie, gather round, because this is a page out of the Kernel API Manual and it's genuinely iconic. it's all about struct psp_dev_ops β€” which is, no cap, the netdev driver facing PSP callbacks. that's the whole vibe. it's the little bundle of function pointers a netdev driver hands over so the PSP core can call back into it. iykyk 🫢


✨ NAME ✨

struct psp_dev_ops β€” netdev driver facing PSP callbacks. yes, that's it, that's the assignment. πŸ’…

🌸 SYNOPSIS 🌸

ok so here's the shape of it, verbatim, do not touch, she's perfect:

struct psp_dev_ops {
    int (*set_config)(struct psp_dev *psd, struct psp_dev_config *conf,
struct netlink_ext_ack *extack);
    int (*key_rotate)(struct psp_dev *psd, struct netlink_ext_ack
*extack);
    int (*rx_spi_alloc)(struct psp_dev *psd, u32 version, struct
psp_key_parsed *assoc, struct netlink_ext_ack *extack);
    int (*tx_key_add)(struct psp_dev *psd, struct psp_assoc *pas, struct
netlink_ext_ack *extack);
    void (*tx_key_del)(struct psp_dev *psd, struct psp_assoc *pas);
    void (*get_stats)(struct psp_dev *psd, struct psp_dev_stats *stats);
 };

πŸŽ€ Members πŸŽ€

bestie these are the six whole members and every single one is doing main character energy. let's go:

  • set_config β€” set configuration of a PSP device. the driver is allowed to peek at psd->config to see the previous configuration (like, a little looky-loo at the old fit before the new one πŸ‘€). and then the Core will update psd->config with config on success. slay.
  • key_rotate β€” rotate the device key. short, sweet, iconic. that's the whole thing. πŸ”„
  • rx_spi_alloc β€” allocate an Rx SPI+key pair. it allocates an Rx SPI and the resulting derived key. and ngl, this key should remain valid until key rotation. periodt.
  • tx_key_add β€” add a Tx key to the device. it installs an association in the device, and the Core will allocate space for the driver to use at drv_data. cute little reserved seat, we love that for you πŸͺ‘
  • tx_key_del β€” remove a Tx key from the device. it removes an association from the device. bye bestie πŸ‘‹
  • get_stats β€” get statistics from the device. the Stats required by the spec must be maintained and filled in. and here's the ✨actually important✨ one:
⚠️ Stats must be filled in member-by-member, never memset the struct. like, do NOT do the lazy memset thing. i am begging. it's giving undefined chaos and we simply do not stan. πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

go touch grass in the Kernel file ./include/net/psp/types.h β€” and while you're there, say hi to her friends:

  • struct psp_dev_config(9)
  • struct psp_assoc_dev(9)
  • struct psp_dev(9)
  • struct psp_dev_caps(9)

okay that's the whole page!! you ate that, honestly. this one lives in ./include/net/psp and it's tagged October 2026 β€” so go forth, fill your stats member-by-member, and remember: never memset. mwah πŸ’‹πŸŒΈπŸ’–

πŸ“¦ where this page comes from