1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>ata_host_activate</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="libataExt.html" title="Chapter 4. libata Library"><link rel="prev" href="API-ata-host-register.html" title="ata_host_register"><link rel="next" href="API-ata-host-detach.html" title="ata_host_detach"></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_host_activate</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-ata-host-register.html">Prev</a> </td><th width="60%" align="center">Chapter 4. libata Library</th><td width="20%" align="right"> <a accesskey="n" href="API-ata-host-detach.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-ata-host-activate"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ata_host_activate — 2 start host, request IRQ and register it 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_host_activate </b>(</code></td><td>struct ata_host * <var class="pdparam">host</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">irq</var>, </td></tr><tr><td> </td><td>irq_handler_t <var class="pdparam">irq_handler</var>, </td></tr><tr><td> </td><td>unsigned long <var class="pdparam">irq_flags</var>, </td></tr><tr><td> </td><td>struct scsi_host_template * <var class="pdparam">sht</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1123881396"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>host</code></em></span></dt><dd><p> 4 target ATA host 5 </p></dd><dt><span class="term"><em class="parameter"><code>irq</code></em></span></dt><dd><p> 6 IRQ to request 7 </p></dd><dt><span class="term"><em class="parameter"><code>irq_handler</code></em></span></dt><dd><p> 8 irq_handler used when requesting IRQ 9 </p></dd><dt><span class="term"><em class="parameter"><code>irq_flags</code></em></span></dt><dd><p> 10 irq_flags used when requesting IRQ 11 </p></dd><dt><span class="term"><em class="parameter"><code>sht</code></em></span></dt><dd><p> 12 scsi_host_template to use when registering the host 13 </p></dd></dl></div></div><div class="refsect1"><a name="idp1123886916"></a><h2>Description</h2><p> 14 After allocating an ATA host and initializing it, most libata 15 LLDs perform three steps to activate the host - start host, 16 request IRQ and register it. This helper takes necessasry 17 arguments and performs the three steps in one go. 18 </p><p> 19 20 An invalid IRQ skips the IRQ registration and expects the host to 21 have set polling mode on the port. In this case, <em class="parameter"><code>irq_handler</code></em> 22 should be NULL. 23</p></div><div class="refsect1"><a name="idp1123888316"></a><h2>LOCKING</h2><p> 24 Inherited from calling layer (may sleep). 25</p></div><div class="refsect1"><a name="idp1123888948"></a><h2>RETURNS</h2><p> 26 0 on success, -errno otherwise. 27</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-host-register.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="libataExt.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-ata-host-detach.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">ata_host_register</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">ata_host_detach</span></td></tr></table></div></body></html> 28