ata_scsi_find_dev(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ata_scsi_find_dev(9) πŸ’…

okay so bestie, we’re cracking open the Kernel API Manual for ata_scsi_find_dev, and honestly? It’s giving β€œfind your fave device in the ATA universe.” Let’s go. ✨


✨ NAME ✨

ata_scsi_find_dev β€” lookup ata_device from scsi_cmnd


🌸 SYNOPSIS 🌸

struct ata_device * ata_scsi_find_dev (struct ata_port *ap , const
struct scsi_device *scsidev );

πŸŽ€ ARGUMENTS πŸŽ€

  • ap β€” the ATA port to which the device is attached. Like, that’s its home base, bestie.
  • scsidev β€” the SCSI device from which we derive the ATA device. iykyk.

πŸ¦‹ DESCRIPTION πŸ¦‹

So you’ve got various information provided in struct scsi_cmnd? Cute. This function maps that onto an ATA bus, and then uses that mapping to determine which ata_device is associated with the SCSI command to be sent. That’s the whole vibe. πŸ’–

πŸ”’ LOCKING: spin_lock_irqsave(host lock) β€” yes, that’s the lock situation, and yes, you need to know it. No cap.

🌈 RETURN 🌈

Associated ATA device, or NULL if not found. That’s it. If it’s not found, you get NULL β€” not a mystery, not a maybe, just NULL. πŸ’€


πŸ’– SEE ALSO πŸ’–

Kernel file ./drivers/ata/libata-scsi.c β€” and literally the whole iconic extended universe:


mwah πŸ’‹ this lil page came from ./drivers/ata, dated October 2026 β€” and yeah, it’s still ata_scsi_find_dev(9), bestie. byeee 🫢✨

πŸ“¦ where this page comes from