doc_read_page_prepare(9)
π doc_read_page_prepare(9) β Kernel API Manual π
okay so bestie, this is the Kernel API Manual page for doc_read_page_prepare(9), and it is literally the βget the flash page ready to be readβ era. no cap, itβs giving setup-function main character energy β¨
πΈ NAME πΈ
doc_read_page_prepare β prepares reading data from a flash page π¦
π SYNOPSIS π
int doc_read_page_prepare (struct docg3 *docg3 , int block0 , int block1
, int page , int offset );
π ARGUMENTS π
docg3β the device, aka the flash bestie weβre talking to π«Άblock0β the first plane block index on flash memoryblock1β the second plane block index on flash memorypageβ the page index in the blockoffsetβ the offset in the page. warning: it must be a multiple of 4 β οΈ
β¨ DESCRIPTION β¨
so basically this prepares the page to be read in the flash memory. iconic. it does these two things:
- tell ASIC to map the flash pages πΊοΈ
- tell ASIC to be in read mode π
after a call to this method, a call to doc_read_page_finish is mandatory, to end the read cycle of the flash. do not ghost the read cycle, bestie π
read data from a flash page. the length to be read must be between 0 and (page_size + oob_size + wear_size), ie. 532, and a multiple of 4 (because the extra bytes reading is not implemented). periodt. π
as pages are grouped by 2 (in 2 planes), reading from a page must be done in two steps:
- one read of
512bytes at offset0 - one read of
512bytes at offset512 + 16
returns 0 if successful, -EIO if a read error occurred. slay when it works, sad little signal when it doesnβt π
π₯ SEE ALSO π₯
the whole Kernel file is ./drivers/mtd/devices/docg3.c, and the squad is:
doc_delay(9)doc_read_data_area(9)doc_write_data_area(9)doc_set_reliable_mode(9)doc_set_asic_mode(9)doc_set_device_id(9)doc_set_extra_page_mode(9)doc_setup_addr_sector(9)doc_setup_writeaddr_sector(9)doc_read_seek(9)doc_write_seek(9)doc_read_page_ecc_init(9)doc_write_page_ecc_init(9)doc_ecc_disable(9)doc_hamming_ecc_init(9)doc_ecc_bch_fix_data(9)doc_read_page_getbytes(9)doc_write_page_putbytes(9)doc_get_bch_hw_ecc(9)doc_page_finish(9)doc_read_page_finish(9)calc_block_sector(9)doc_read_oob(9)doc_block_isbad(9)doc_get_erase_count(9)doc_get_op_status(9)doc_write_erase_wait_status(9)doc_erase_block(9)doc_erase(9)doc_write_page(9)doc_guess_autoecc(9)doc_fill_autooob(9)doc_backup_oob(9)doc_write_oob(9)doc_set_driver_info(9)doc_probe_device(9)doc_release_device(9)docg3_resume(9)docg3_suspend(9)docg3_probe(9)docg3_release(9)
and thatβs the whole page, bestie π«Ά source/version: ./drivers/mtd/devices, dated October 2026 β bye babe, go read some flash pages responsibly π
π
π¦ 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