1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>ata_build_rw_tf</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="libATA Developer's Guide"><link rel="up" href="libataInt.html" title="Chapter&#160;5.&#160;libata Core Internals"><link rel="prev" href="API-ata-tf-read-block.html" title="ata_tf_read_block"><link rel="next" href="API-ata-read-native-max-address.html" title="ata_read_native_max_address"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">ata_build_rw_tf</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-ata-tf-read-block.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;5.&#160;libata Core Internals</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-ata-read-native-max-address.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-ata-build-rw-tf"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ata_build_rw_tf &#8212; 
2     Build ATA taskfile for given read/write request
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">ata_build_rw_tf </b>(</code></td><td>struct ata_taskfile * <var class="pdparam">tf</var>, </td></tr><tr><td>&#160;</td><td>struct ata_device * <var class="pdparam">dev</var>, </td></tr><tr><td>&#160;</td><td>u64 <var class="pdparam">block</var>, </td></tr><tr><td>&#160;</td><td>u32 <var class="pdparam">n_block</var>, </td></tr><tr><td>&#160;</td><td>unsigned int <var class="pdparam">tf_flags</var>, </td></tr><tr><td>&#160;</td><td>unsigned int <var class="pdparam">tag</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1124017724"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>tf</code></em></span></dt><dd><p>
4     Target ATA taskfile
5    </p></dd><dt><span class="term"><em class="parameter"><code>dev</code></em></span></dt><dd><p>
6     ATA device <em class="parameter"><code>tf</code></em> belongs to
7    </p></dd><dt><span class="term"><em class="parameter"><code>block</code></em></span></dt><dd><p>
8     Block address
9    </p></dd><dt><span class="term"><em class="parameter"><code>n_block</code></em></span></dt><dd><p>
10     Number of blocks
11    </p></dd><dt><span class="term"><em class="parameter"><code>tf_flags</code></em></span></dt><dd><p>
12     RW/FUA etc...
13    </p></dd><dt><span class="term"><em class="parameter"><code>tag</code></em></span></dt><dd><p>
14     tag
15    </p></dd></dl></div></div><div class="refsect1"><a name="idp1124024364"></a><h2>LOCKING</h2><p>
16   None.
17   </p><p>
18
19   Build ATA taskfile <em class="parameter"><code>tf</code></em> for read/write request described by
20   <em class="parameter"><code>block</code></em>, <em class="parameter"><code>n_block</code></em>, <em class="parameter"><code>tf_flags</code></em> and <em class="parameter"><code>tag</code></em> on <em class="parameter"><code>dev</code></em>.
21</p></div><div class="refsect1"><a name="idp1124026988"></a><h2>RETURNS</h2><p>
22   </p><p>
23
24   0 on success, -ERANGE if the request is too large for <em class="parameter"><code>dev</code></em>,
25   -EINVAL if the request is invalid.
26</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-ata-tf-read-block.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="libataInt.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-ata-read-native-max-address.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">ata_tf_read_block</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">ata_read_native_max_address</span></td></tr></table></div></body></html>
27