1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>parport_register_port</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Device Drivers"><link rel="up" href="parportdev.html" title="Chapter 3. Parallel Port Devices"><link rel="prev" href="API-parport-put-port.html" title="parport_put_port"><link rel="next" href="API-parport-announce-port.html" title="parport_announce_port"></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">parport_register_port</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-parport-put-port.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Parallel Port Devices</th><td width="20%" align="right"> <a accesskey="n" href="API-parport-announce-port.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-parport-register-port"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>parport_register_port — 2 register a parallel port 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">struct parport * <b class="fsfunc">parport_register_port </b>(</code></td><td>unsigned long <var class="pdparam">base</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">irq</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">dma</var>, </td></tr><tr><td> </td><td>struct parport_operations * <var class="pdparam">ops</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1111010308"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>base</code></em></span></dt><dd><p> 4 base I/O address 5 </p></dd><dt><span class="term"><em class="parameter"><code>irq</code></em></span></dt><dd><p> 6 IRQ line 7 </p></dd><dt><span class="term"><em class="parameter"><code>dma</code></em></span></dt><dd><p> 8 DMA channel 9 </p></dd><dt><span class="term"><em class="parameter"><code>ops</code></em></span></dt><dd><p> 10 pointer to the port driver's port operations structure 11 </p></dd></dl></div></div><div class="refsect1"><a name="idp1111014948"></a><h2>Description</h2><p> 12 When a parallel port (lowlevel) driver finds a port that 13 should be made available to parallel port device drivers, it 14 should call <code class="function">parport_register_port</code>. The <em class="parameter"><code>base</code></em>, <em class="parameter"><code>irq</code></em>, and 15 <em class="parameter"><code>dma</code></em> parameters are for the convenience of port drivers, and 16 for ports where they aren't meaningful needn't be set to 17 anything special. They can be altered afterwards by adjusting 18 the relevant members of the parport structure that is returned 19 and represents the port. They should not be tampered with 20 after calling parport_announce_port, however. 21 </p><p> 22 23 If there are parallel port device drivers in the system that 24 have registered themselves using <code class="function">parport_register_driver</code>, 25 they are not told about the port at this time; that is done by 26 <code class="function">parport_announce_port</code>. 27 </p><p> 28 29 The <em class="parameter"><code>ops</code></em> structure is allocated by the caller, and must not be 30 deallocated before calling <code class="function">parport_remove_port</code>. 31 </p><p> 32 33 If there is no memory to allocate a new parport structure, 34 this function will return <code class="constant">NULL</code>. 35</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-parport-put-port.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="parportdev.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-parport-announce-port.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">parport_put_port</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">parport_announce_port</span></td></tr></table></div></body></html> 36