STRUCT NVEC_CHIP(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ struct nvec_chip(9) πŸ’œ

okay so bestie, welcome to the Kernel API Manual β€” yes we're reading kernel docs together, this is our era now πŸŽ€


✨ NAME ✨

struct nvec_chip β€” literally a single connection to an NVIDIA Embedded controller. that's it, that's the whole vibe πŸ¦‹


🌸 SYNOPSIS 🌸

struct nvec_chip {
    struct device *dev;
    struct gpio_desc *gpiod;
    int irq;
    u32 i2c_addr;
    void __iomem *base;
    struct clk *i2c_clk;
    struct reset_control *rst;
    struct atomic_notifier_head notifier_list;
    struct list_head rx_data, tx_data;
    struct notifier_block nvec_status_notifier;
    struct work_struct rx_work, tx_work;
    struct workqueue_struct *wq;
    struct nvec_msg msg_pool[NVEC_POOL_SIZE];
    struct nvec_msg *rx;
    struct nvec_msg *tx;
    struct nvec_msg tx_scratch;
    struct completion ec_transfer;
    spinlock_t tx_lock, rx_lock;
    struct mutex sync_write_mutex;
    struct completion sync_write;
    u16 sync_write_pending;
    struct nvec_msg *last_sync_msg;
    int state;
 };

no cap, that's the whole struct. we love a comprehensive field list πŸ’…


🫢 Members 🫢

okay so here's the field-by-field tea, and every single one matters:

  • dev β€” The device. main character energy, honestly πŸ‘‘
  • irq β€” The IRQ of the I2C device. that's the interrupt line, she's always ringing πŸ”₯
  • i2c_addr β€” The address of the I2C slave. where you gotta talk to reach her ✨
  • base β€” The base of the memory mapped region of the I2C device.
  • i2c_clk β€” The clock of the I2C device. keep her ticking πŸŽ€
  • rst β€” The reset of the I2C device. sometimes you gotta start over, and that's okay πŸ’…
  • notifier_list β€” Notifiers to be called on received messages, see nvec_register_notifier. it's giving group chat notification settings πŸ¦‹
  • rx_data β€” Received messages that have to be processed. the inbox, basically πŸ“₯
  • tx_data β€” Messages waiting to be sent to the controller. the outbox, and yes they're waiting patiently πŸ₯Ί
  • nvec_status_notifier β€” Internal notifier (see nvec_status_notifier). an internal notifier! iykyk 🌸
  • rx_work β€” A work structure for the RX worker nvec_dispatch.
  • tx_work β€” A work structure for the TX worker nvec_request_master.
  • wq β€” The work queue in which rx_work and tx_work are executed. the stage where both workers perform ⭐
  • msg_pool β€” A pool of messages for allocation. grab one, it's free real estate πŸ’€
  • rx β€” The message currently being retrieved or NULL. could be a message, could be nothing, she's mysterious πŸ™ˆ
  • tx β€” The message currently being transferred.
  • tx_scratch β€” Used for building pseudo messages. arts and crafts but for the kernel 🎨
  • ec_transfer β€” A completion that will be completed once a message has been received (see nvec_rx_completed). we wait, then we slay 🧚
  • tx_lock β€” Spinlock for modifications on tx_data.
  • rx_lock β€” Spinlock for modifications on rx_data. two separate locks, no sharing, we respect boundaries ✨
  • sync_write_mutex β€” A mutex for nvec_write_sync.
  • sync_write β€” A completion to signal that a synchronous message is complete.
  • sync_write_pending β€” The first two bytes of the request (type and subtype). just the first two bytes, that's all she needs πŸ’œ
  • last_sync_msg β€” The last synchronous message. keeping receipts πŸ“
  • state β€” State of our finite state machine used in nvec_interrupt. yes we have states, yes we're a whole machine πŸ”₯

πŸ¦‹ SEE ALSO πŸ¦‹

like please go read these too, they're all in the Kernel file ./drivers/staging/nvec/nvec.h:

  • enum nvec_event_size(9)
  • enum nvec_msg_type(9)
  • struct nvec_msg(9)

bestie reminder: the actual source lives at ./drivers/staging/nvec, version date October 2026 β€” go peek at the real thing whenever, the docs will still be here 🫢

and that's the page!! struct nvec_chip(9), documented, iconique, periodt πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from