STRUCT DOCG3(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct docg3 ✨

okay bestie, so this is the manual page for struct docg3 from the Kernel API Manual β€” it's literally the DiskOnChip driver's private data and it's giving backstage-pass energy πŸŽ€ like this is where the driver keeps all its lil secrets.


πŸ’– NAME πŸ’–

struct docg3 β€” the DiskOnChip driver's private data, no cap πŸ’…


🌸 SYNOPSIS 🌸

struct docg3 {
    struct device *dev;
    struct docg3_cascade *cascade;
    unsigned int device_id:4;
    unsigned int if_cfg:1;
    unsigned int reliable:2;
    int max_block;
    u8 *bbt;
    loff_t oob_write_ofs;
    int oob_autoecc;
    u8 oob_write_buf[DOC_LAYOUT_OOB_SIZE];
};

look at her. icon. the bitfields?? we love a memory-conscious queen πŸ‘‘


πŸ¦‹ Members πŸ¦‹

so here's the full rundown of every single field, fr fr, and yes we're doing all of them because none of them are boring πŸ’œ

  • dev β€” the device that's currently under control. main character of the moment ✨
  • cascade β€” the cascade this device belongs to. iykyk, it's her family 🫢
  • device_id β€” number of the cascaded DoCG3 device, and it's one of 0, 1, 2 or 3. that's it. that's the whole range πŸ’…
  • if_cfg β€” if true, reads are on 16bits; else reads are on 8bits. one bit deciding the whole read situation, lowkey powerful πŸ”₯
  • reliable β€” the mode check, and there are three whole moods:
    • 0 β†’ docg3 in normal mode
    • 1 β†’ docg3 in fast mode
    • 2 β†’ reliable mode

bestie pls read this part: Fast mode implies more errors than normal mode. and Reliable mode implies that page 2*n and 2*n+1 are clones. not me warning you, just factually warning you 😭

  • max_block β€” maximum block number for this device. the ceiling, literally 🧚
  • bbt β€” bad block table cache. it remembers the bad ones so you don't have to πŸ™ˆ
  • oob_write_ofs β€” offset of the MTD where this OOB should belong (ie. in next page_write). keep that page_write exactly as written, periodt πŸŽ€
  • oob_autoecc β€” if 1, use only bytes 0-7, 15, and fill the others with HW ECC. if 0, use all the 16 bytes. so many bytes, so little time 🌸
  • oob_write_buf β€” prepared OOB for next page_write. she's ready ahead of time, we stan a prepared queen πŸ‘‘

🌈 SEE ALSO 🌈

  • Kernel file ./drivers/mtd/devices/docg3.h
  • struct docg3_cascade(9) β€” go read her too, she's iconic πŸ’–

ok that's the whole vibe check πŸ’€ every field accounted for, nothing skipped, nothing invented. you're welcome 🫢

and finally, the cute lil sign-off: this page lives in ./drivers/mtd/devices, it's dated October 2026, and it's struct docg3(9) β€” go forth and slay your DiskOnChip driver era πŸ‘‘β­

πŸ“¦ where this page comes from