STRUCT SPI_NOR_ERASE_COMMAND(9)
πΈ struct spi_nor_erase_command(9) β Kernel API Manual, but make it cute πΈ
okay so real talk, this one is from the Kernel API Manual and it's lowkey one of those little structs that does a LOT of heavy lifting, so let's get into it π
β¨ NAME β¨
struct spi_nor_erase_command β used for non-uniform erases, bestie π«Ά
so the whole vibe of this structure is that it describes a list of erase commands, and those commands get executed once we validate that the erase can actually be performed. that's the whole point. and here's the iconic part: the elements in the list are run-length encoded π which is fr fr the efficient way to do it, we love a compressed queen.
β¨ SYNOPSIS β¨
okay here's the struct in all its glory, copy it exactly please, no typos, we're not doing that today:
struct spi_nor_erase_command {
struct list_head list;
u32 count;
u32 size;
u8 opcode;
};
look at her. four fields. main character energy. π
β¨ Members β¨
time for the member-by-member breakdown, iykyk:
listβ for inclusion into the list of erase commands. she's literally built different, she goes inside the list. that's her job. that's her purpose. πcountβ how many times the same erase command should be consecutively used. like, back to back to back. no breaks. consecutive besties only. π₯sizeβ the size of the sector/block erased by the command. she big. she small. she whatever the sector/block is. πopcodeβ the SPI command op code to erase the sector/block. this is the actual command, the thing that makes it happen. the moment. the slay. β¨
β¨ SEE ALSO β¨
go read these next, they're all in the kernel file ./drivers/mtd/spi-nor/core.h and honestly the whole friend group is iconic:
struct spi_nor_erase_type(9)struct spi_nor_erase_region(9)struct spi_nor_erase_map(9)struct spi_nor_locking_ops(9)struct spi_nor_otp_organization(9)struct spi_nor_otp_ops(9)struct spi_nor_otp(9)struct spi_nor_flash_parameter(9)struct spi_nor_fixups(9)struct spi_nor_id(9)struct flash_info(9)struct spi_nor_manufacturer(9)struct sfdp(9)spi_nor_needs_sfdp(9)
like, that's the whole squad. go say hi. π¦
heads up bestie: this is documentation for the kernel API, so the details above are the facts β don't get creative with the field names or the encodings, we're just here for the vibes π
and that's the page!! π this came out of ./drivers/mtd/spi-nor, dated October 2026, and that's your sign-off bestie β mwah, go erase some non-uniform stuff, you absolute icon π§π
π
π¦ 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