STRUCT DOCG3(9)
β¨ 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 of0,1,2or3. 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 mode1β docg3 in fast mode2β 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 nextpage_write). keep thatpage_writeexactly as written, periodt πoob_autoeccβ if1, use only bytes0-7,15, and fill the others with HW ECC. if0, use all the 16 bytes. so many bytes, so little time πΈoob_write_bufβ prepared OOB for nextpage_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
- 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