'\" t .\" Title: ata_wait_register .\" Author: .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: March 2017 .\" Manual: libata Library .\" Source: Kernel Hackers Manual 4.10.7 .\" Language: English .\" .TH "ATA_WAIT_REGISTER" "9" "March 2017" "Kernel Hackers Manual 4\&.10\&" "libata Library" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" ata_wait_register \- wait until register value changes .SH "SYNOPSIS" .HP \w'u32\ ata_wait_register('u .BI "u32 ata_wait_register(struct\ ata_port\ *\ " "ap" ", void\ __iomem\ *\ " "reg" ", u32\ " "mask" ", u32\ " "val" ", unsigned\ long\ " "interval" ", unsigned\ long\ " "timeout" ");" .SH "ARGUMENTS" .PP \fIap\fR .RS 4 ATA port to wait register for, can be NULL .RE .PP \fIreg\fR .RS 4 IO\-mapped register .RE .PP \fImask\fR .RS 4 Mask to apply to read register value .RE .PP \fIval\fR .RS 4 Wait condition .RE .PP \fIinterval\fR .RS 4 polling interval in milliseconds .RE .PP \fItimeout\fR .RS 4 timeout in milliseconds .RE .SH "DESCRIPTION" .PP Waiting for some bits of register to change is a common operation for ATA controllers\&. This function reads 32bit LE IO\-mapped register \fIreg\fR and tests for the following condition\&. .PP (*\fIreg\fR & mask) != val .PP If the condition is met, it returns; otherwise, the process is repeated after \fIinterval_msec\fR until timeout\&. .PP LOCKING: Kernel thread context (may sleep) .SH "RETURN" .PP The final register value\&. .SH "AUTHOR" .PP \fBJeff Garzik\fR .RS 4 Author. .RE .SH "COPYRIGHT" .br