STRUCT OMNIA_MCU(9)
π struct omnia_mcu(9) π
okay so bestie, welcome to the Kernel API Manual page for struct omnia_mcu β yes that's section 9, the kernel internals section, we love her π
. This is the driver's own private little data structure, and I'm gonna walk you through every single field so you can actually read this header without spiraling π«Ά.
β¨ NAME β¨
struct omnia_mcu β driver private data structure
yeah that's it that's the name, short and iconic π
πΈ SYNOPSIS πΈ
struct omnia_mcu {
struct i2c_client *client;
const char *type;
u32 features;
u64 board_serial_number;
u8 board_first_mac[ETH_ALEN];
u8 board_revision;
#ifdef CONFIG_TURRIS_OMNIA_MCU_GPIO;
struct gpio_chip gc;
struct mutex lock;
unsigned long mask, rising, falling, both, cached, is_cached;
struct delayed_work button_release_emul_work;
unsigned long last_status;
bool button_pressed_emul;
#endif;
#ifdef CONFIG_TURRIS_OMNIA_MCU_SYSOFF_WAKEUP;
struct rtc_device *rtcdev;
u32 rtc_alarm;
bool front_button_poweron;
#endif;
#ifdef CONFIG_TURRIS_OMNIA_MCU_WATCHDOG;
struct watchdog_device wdt;
#endif;
#ifdef CONFIG_TURRIS_OMNIA_MCU_TRNG;
struct hwrng trng;
struct completion trng_entropy_ready;
#endif;
#ifdef CONFIG_TURRIS_OMNIA_MCU_KEYCTL;
struct completion msg_signed;
struct mutex sign_lock;
bool sign_requested;
int sign_err;
u8 signature[OMNIA_MCU_CRYPTO_SIGNATURE_LEN];
u8 board_public_key[OMNIA_MCU_CRYPTO_PUBLIC_KEY_LEN];
#endif;
};
not me obsessing over how half the fields are wrapped in #ifdefs π like she's modular, she's customizable, she adapts to your config β main character energy fr fr π
π Members π
okay bestie, here's the whole cast, one by one, no skips, no shortcuts π
clientβ the I2C client π¦typeβ the MCU type, and it can beSTM32,GD32,MKL, or unknown πfeaturesβ a bitmap of the features the MCU firmware supports β¨board_serial_numberβ the board serial number, but only if it's stored in the MCU πΎboard_first_macβ the board's first MAC address, again only if it's stored in the MCU πboard_revisionβ the board revision, if it's stored in the MCU (spotting a theme here? yes π )gcβ the GPIO chiplockβ a mutex protecting the internal GPIO chip state πmaskβ bitmap of masked IRQs πrisingβ bitmap of rising edge IRQs β¬οΈfallingβ bitmap of falling edge IRQs β¬οΈbothβ bitmap of both edges IRQs π₯cachedβ bitmap of cached IRQ line values. The way this works: when an IRQ line is configured for both edges, we cache the corresponding GPIO values in the IRQ handler π§is_cachedβ bitmap of which IRQ line values are cachedbutton_release_emul_workβ front button release emulation work, used with old MCU firmware versions that didn't send button release events and only sent button press events πlast_statusβ the cached value of the status word, which gets compared against the new value to figure out which interrupt events actually happened. Used with old MCU firmware versions that only told us that the status word changed, but not which bits of the status word changed πbutton_pressed_emulβ the front button is still being emulated as pressed πrtcdevβ the RTC device. Plot twist: it doesn't actually count real-time π°οΈ it's only used for the RTC alarm mechanism, so that the board can be configured to wake up from poweroff state at a specific time β°rtc_alarmβ the RTC alarm that was set for the board to wake up on, expressed in MCU time (that's seconds since the last MCU reset) πΈfront_button_poweronβ whether the front button should power on the device after it's been powered off πwdtβ the watchdog driver structure πtrngβ the RNG driver structure π²trng_entropy_readyβ the RNG entropy ready completion βmsg_signedβ the message signed completion βοΈsign_lockβ a mutex protecting the message signing state πsign_requestedβ a flag saying that message signing was requested but not completed yet β³sign_errβ the message signing error number, filled in by the interrupt handler π¨signatureβ the message signing signature, also filled in by the interrupt handler ποΈboard_public_keyβ the board public key, if it's stored in the MCU π
π SEE ALSO π
- Kernel file
./drivers/platform/cznic/turris-omnia-mcu.h
iykyk, go read the header, it's right there π§
okay that's the whole page bestie, you ate that π«Ά. This one came to you from ./drivers/platform/cznic, dated October 2026, and it's struct omnia_mcu(9) β the Kernel API Manual. mwah πβ
π¦ 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