ata_devchk(9)
π ata_devchk(9) π
Okay bestie, welcome to the kernel API manual β¨ this one is a whole little function from the ATA world and it's literally just vibe-checking whether a PATA device is even there. Short page, but we're gonna give it the attention it deserves π«Ά
πΈ NAME πΈ
ata_devchk β PATA device presence detection π
β¨ SYNOPSIS β¨
bool ata_devchk (struct ata_port *ap , unsigned int device );
π ARGUMENTS π
apβ the ATA channel you want to examine πdeviceβ which device on that channel to examine, and ngl it starts counting at zero (0) π
π¦ DESCRIPTION π¦
So this technique? Not even new. It was originally described in Hale Landis's ATADRVR (that's www.ata-atapi.com, iykyk), and then later it found its way into the ATA/ATAPI spec. So it's giving "legacy icon that got canonized" π
The move itself is lowkey cute: you write a pattern to the ATA shadow registers, and if a device is actually present, it'll respond by correctly storing and echoing back the ATA shadow register contents. Like a little "hi, I'm here" text back π No device, no reply, no notes.
LOCKING: caller. That means you, bestie β the caller handles the locking, not this function π
β RETURN β
Returns true if the device is present, and false if it's not. That's it. Binary queen behavior, no cap π
π SEE ALSO π
Kernel file ./drivers/ata/libata-sff.c plus this whole friend group of functions:
ata_sff_check_status(9)ata_sff_altstatus(9)ata_sff_irq_status(9)ata_sff_sync(9)ata_sff_pause(9)ata_sff_dma_pause(9)ata_sff_wait_ready(9)ata_sff_set_devctl(9)ata_sff_dev_select(9)ata_dev_select(9)ata_sff_irq_on(9)ata_sff_tf_load(9)ata_sff_tf_read(9)ata_sff_exec_command(9)ata_tf_to_host(9)ata_sff_data_xfer(9)ata_sff_data_xfer32(9)ata_pio_sector(9)ata_pio_sectors(9)atapi_send_cdb(9)__atapi_pio_bytes(9)atapi_pio_bytes(9)ata_hsm_ok_in_wq(9)ata_hsm_qc_complete(9)ata_sff_hsm_move(9)ata_sff_qc_issue(9)ata_sff_qc_fill_rtf(9)ata_sff_port_intr(9)ata_sff_interrupt(9)ata_sff_lost_interrupt(9)ata_sff_freeze(9)ata_sff_thaw(9)ata_sff_prereset(9)ata_sff_dev_classify(9)ata_sff_wait_after_reset(9)ata_sff_softreset(9)sata_sff_hardreset(9)ata_sff_postreset(9)ata_sff_drain_fifo(9)ata_sff_error_handler(9)ata_sff_std_ports(9)ata_pci_sff_init_host(9)ata_pci_sff_prepare_host(9)ata_pci_sff_activate_host(9)ata_pci_sff_init_one(9)ata_bmdma_fill_sg(9)ata_bmdma_fill_sg_dumb(9)ata_bmdma_qc_prep(9)ata_bmdma_dumb_qc_prep(9)ata_bmdma_qc_issue(9)ata_bmdma_port_intr(9)ata_bmdma_interrupt(9)ata_bmdma_error_handler(9)ata_bmdma_post_internal_cmd(9)ata_bmdma_irq_clear(9)ata_bmdma_setup(9)ata_bmdma_start(9)ata_bmdma_stop(9)ata_bmdma_status(9)ata_bmdma_port_start(9)ata_bmdma_port_start32(9)ata_pci_bmdma_clear_simplex(9)ata_pci_bmdma_init(9)ata_pci_bmdma_prepare_host(9)ata_pci_bmdma_init_one(9)ata_sff_port_init(9)
And that's the page, bestie π§ This little icon lives in ./drivers/ata, it's dated October 2026, and it answers to the name ata_devchk(9). Take care of her, mwah πβ¨π
π¦ 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