1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>superhyway_add_device</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="SuperH Interfaces Guide"><link rel="up" href="busses.html#superhyway" title="SuperHyway"><link rel="prev" href="busses.html" title="Chapter&#160;3.&#160;Busses"><link rel="next" href="API-superhyway-register-driver.html" title="superhyway_register_driver"></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">superhyway_add_device</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="busses.html">Prev</a>&#160;</td><th width="60%" align="center">SuperHyway</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-superhyway-register-driver.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-superhyway-add-device"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>superhyway_add_device &#8212; 
2  Add a SuperHyway module
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">superhyway_add_device </b>(</code></td><td>unsigned long <var class="pdparam">base</var>, </td></tr><tr><td>&#160;</td><td>struct superhyway_device * <var class="pdparam">sdev</var>, </td></tr><tr><td>&#160;</td><td>struct superhyway_bus * <var class="pdparam">bus</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1112160876"></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     Physical address where module is mapped.
5    </p></dd><dt><span class="term"><em class="parameter"><code>sdev</code></em></span></dt><dd><p>
6     SuperHyway device to add, or NULL to allocate a new one.
7    </p></dd><dt><span class="term"><em class="parameter"><code>bus</code></em></span></dt><dd><p>
8     Bus where SuperHyway module resides.
9    </p></dd></dl></div></div><div class="refsect1"><a name="idp1112164492"></a><h2>Description</h2><p>
10   This is responsible for adding a new SuperHyway module. This sets up a new
11   struct superhyway_device for the module being added if <em class="parameter"><code>sdev</code></em> == NULL.
12   </p><p>
13
14   Devices are initially added in the order that they are scanned (from the
15   top-down of the memory map), and are assigned an ID based on the order that
16   they are added. Any manual addition of a module will thus get the ID after
17   the devices already discovered regardless of where it resides in memory.
18   </p><p>
19
20   Further work can and should be done in <code class="function">superhyway_scan_bus</code>, to be sure
21   that any new modules are properly discovered and subsequently registered.
22</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="busses.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="busses.html#superhyway">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-superhyway-register-driver.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&#160;3.&#160;Busses&#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">superhyway_register_driver</span></td></tr></table></div></body></html>
23