sata_scr_write(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… sata_scr_write β€” like, the Kernel API Manual (section 9) page for it, bestie

Okay so picture this: you're down in the drivers/ata trenches, you've got a port, you've got an SCR register, and you need to write to it. That's the whole gig. This page is sata_scr_write(9) and she's here to help 🫢


✨ SYNOPSIS ✨

int sata_scr_write (struct ata_link *link , int reg , u32 val );

Three args, one int back. Clean. Iconic. No notes πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • link β€” the ATA link you're writing the SCR for. Your main character, basically.
  • reg β€” which SCR you wanna write. Pick one, bestie.
  • val β€” the value going in. This is the actual payload, the moment, the reason we're all here.

🌸 DESCRIPTION 🌸

So what she does is: writes val into the SCR register reg of link. That's it. That's the function πŸ’–

And here's the part that's genuinely giving security-blanket energy β€” this function is guaranteed to succeed if all three of these are true:

  1. link is ap->link
  2. the cable type of the port is SATA
  3. the port implements ->scr_read

Three for three and she's not missing. Slay ⭐

πŸ”’ LOCKING πŸ”’

Locking vibes depend on who you are:

  • If link is ap->link β†’ None. No locking. Free. Unbothered. ✨
  • Otherwise β†’ Kernel thread context required. Different energy entirely, so know which one you're in, iykyk.

πŸ”₯ RETURN πŸ”₯

  • 0 on success πŸŽ‰
  • negative errno on failure 😭

πŸ¦‹ SEE ALSO πŸ¦‹

The whole friend group, plus the kernel file she lives in: ./drivers/ata/libata-sata.c

ngl bestie, that's a lot of cross-references, but every single one of them is a real one so go read 'em if you're curious πŸ‘‘

Okay that's the whole page, mwah πŸ’‹ β€” she ships out of ./drivers/ata, dated October 2026, and honestly? She ate. πŸŒˆπŸŽ€πŸ’œ

πŸ“¦ where this page comes from