doc_write_page(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ doc_write_page(9) πŸ¦‹

okay so welcome to the Kernel API Manual, bestie πŸ’– β€” this page is doc_write_page(9) and she is literally the β€œWrite a single page to the chip” girlie. no cap.


πŸŽ€ NAME πŸŽ€

doc_write_page β€” Write a single page to the chip. that’s the whole assignment: one page, to the chip, slay.

✨ SYNOPSIS ✨

int doc_write_page (struct docg3 *docg3 , loff_t to , const u_char *buf
       , const u_char *oob , int autoecc );

🌸 ARGUMENTS 🌸

  • docg3 β€” the device. she’s the actual device we’re talking to.
  • to β€” the offset from first block and first page, in bytes, aligned on page size. like, do not freestyle the alignment, bestie.
  • buf β€” buffer to get bytes from. the data source.
  • oob β€” buffer to get out of band bytes from (can be NULL if no OOB should be written). yes, NULL is allowed when no OOB should be written.
  • autoecc β€” if 0, all 16 bytes from OOB are taken, regardless of HW Hamming or BCH computations. If 1, only bytes 0-7 and byte 15 are taken, remaining ones are filled with hardware Hamming and BCH computations. Its value is not meaningfull is oob == NULL (so if oob is NULL, this value doesn’t matter).

πŸ”₯ DESCRIPTION πŸ”₯

this one writes one full page (ie. 1 page split on two planes), of 512 bytes, with the OOB data. the OOB ECC is automatically computed by the hardware Hamming and BCH generator if autoecc is not null.

returns:

  • 0 β€” write successful
  • -EIO β€” write error
  • -EAGAIN β€” timeout

πŸ’… SEE ALSO πŸ’…

okay here’s the whole friend group, no cap:

source/version: ./drivers/mtd/devices Β· date: October 2026 Β· page: doc_write_page(9) β€” bye bestie, slay your writes πŸ’–βœ¨

πŸ“¦ where this page comes from