⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ds sw.htm

📁 What is this ``device driver stuff anyway? Here s a very short introduction to the concept.
💻 HTM
📖 第 1 页 / 共 5 页
字号:
           if(ctlr->alive & ALV_ALIVE) {
                   printf("config_con: %s%d alive\n",
                          ctlr->ctlr_name, ctlr->ctlr_num);
                   return(stat);
           }
           savebusnum = ctlr->bus_num;
           savebusname = ctlr->bus_name;
           saveslot = ctlr->slot;
           ctlr->bus_name = bus->bus_name;
           ctlr->bus_num = bus->bus_num;
           ctlr->slot = node;

/***************************************************
 *            Allocate and initialize a software   *
 *            mailbox data structure for the       *
 *            controller if it is attached to a    *
 *            bus that is accessed by mailboxes    *
 ***************************************************/
           MBOX_GET(bus, ctlr);

/***************************************************
 * Now get the controller's driver structure       *
 * and probe                                       *
 ***************************************************/
<br>.<br>.<br>.<br>
}
</pre>
<p>
<a name="nx_id_706"></a>
<br>
<a name="busbus_hdetal"></a>
</p><p></p><hr><p align="center">
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><img src="DS%20sw_files/BOOKSHELF.GIF" alt="[Return to Library]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><img src="DS%20sw_files/TOC.GIF" alt="[Contents]" border="0"></a>
<a href="#DeviceAutoconfig"><img src="DS%20sw_files/REW.GIF" alt="[Previous Chapter]" border="0"></a>
<a href="#busmbox"><img src="DS%20sw_files/PREV.GIF" alt="[Previous Section]" border="0"></a>
<a href="#bustype"><img src="DS%20sw_files/NEXT.GIF" alt="[Next Section]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut25.html"><img src="DS%20sw_files/FF.GIF" alt="[Next Chapter]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><img src="DS%20sw_files/INDEX.GIF" alt="[Index]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><img src="DS%20sw_files/HELP.GIF" alt="[Help]" border="0"></a>
</p><p></p><hr><p>
</p><h3>
17.1.2&nbsp;&nbsp;&nbsp;&nbsp;The bus_hd, nxt_bus, ctlr_list, and bus_list Members
</h3>
<p>
<a name="nx_id_707"></a>
<a name="nx_id_708"></a>
<a name="nx_id_709"></a>
<a name="nx_id_710"></a>
The
<tt>bus_hd</tt>
member specifies
a pointer to the bus structure that this bus is connected to.
The
<tt>nxt_bus</tt>
member specifies
a pointer to the next bus at this level.
</p><p>
The
<tt>ctlr_list</tt>
member specifies
a linked list of controllers connected to this bus.
The
<tt>bus_list</tt>
member specifies
a linked list of buses connected to this bus.
<a name="bustype"></a>
</p><p></p><hr><p align="center">
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><img src="DS%20sw_files/BOOKSHELF.GIF" alt="[Return to Library]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><img src="DS%20sw_files/TOC.GIF" alt="[Contents]" border="0"></a>
<a href="#DeviceAutoconfig"><img src="DS%20sw_files/REW.GIF" alt="[Previous Chapter]" border="0"></a>
<a href="#busbus_hdetal"><img src="DS%20sw_files/PREV.GIF" alt="[Previous Section]" border="0"></a>
<a href="#busname"><img src="DS%20sw_files/NEXT.GIF" alt="[Next Section]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut25.html"><img src="DS%20sw_files/FF.GIF" alt="[Next Chapter]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><img src="DS%20sw_files/INDEX.GIF" alt="[Index]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><img src="DS%20sw_files/HELP.GIF" alt="[Help]" border="0"></a>
</p><p></p><hr><p>
</p><h3>
17.1.3&nbsp;&nbsp;&nbsp;&nbsp;The bus_type Member
</h3>
<p>
<a name="nx_id_711"></a>
The
<tt>bus_type</tt>
member specifies
the type of bus.
The
<tt>devdriver.h</tt>
file defines constants that represent a variety of bus
type constants.
For example,
<tt>BUS_PCI</tt>
represents a PCI bus,
<tt>BUS_EISA</tt>
represents an EISA bus,
<tt>BUS_ISA</tt>
represents an ISA bus, and so forth.
<a name="nx_id_712"></a>
</p><p>
Device driver writers seldom need to reference this member.
However, bus adapter driver writers might reference this member in their
bus adapter code.
<a name="busname"></a>
</p><p></p><hr><p align="center">
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><img src="DS%20sw_files/BOOKSHELF.GIF" alt="[Return to Library]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><img src="DS%20sw_files/TOC.GIF" alt="[Contents]" border="0"></a>
<a href="#DeviceAutoconfig"><img src="DS%20sw_files/REW.GIF" alt="[Previous Chapter]" border="0"></a>
<a href="#bustype"><img src="DS%20sw_files/PREV.GIF" alt="[Previous Section]" border="0"></a>
<a href="#slot"><img src="DS%20sw_files/NEXT.GIF" alt="[Next Section]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut25.html"><img src="DS%20sw_files/FF.GIF" alt="[Next Chapter]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><img src="DS%20sw_files/INDEX.GIF" alt="[Index]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><img src="DS%20sw_files/HELP.GIF" alt="[Help]" border="0"></a>
</p><p></p><hr><p>
</p><h3>
17.1.4&nbsp;&nbsp;&nbsp;&nbsp;The bus_name and bus_num Members
</h3>
<p>
<a name="nx_id_713"></a>
<a name="nx_id_714"></a>
The
<tt>bus_name</tt>
member specifies
the bus name.
The
<tt>bus_num</tt>
member specifies
the bus number of this bus.
</p><p>
The bus name consists of a character string, for example,
<tt>pci</tt>
(for PCI bus).
The bus number is a number such as 0 (zero), 1, 2, and so forth.
</p><p>
Device driver writers seldom need to reference the
<tt>bus_name</tt>
and
<tt>bus_num</tt>
members in their device drivers.
Instead, driver writers often pass a pointer to a
<tt>bus</tt>
structure to the
<tt>handler</tt>
interfaces, and the interrupt handlers use the information
contained in these members.
<a name="slot"></a>
</p><p></p><hr><p align="center">
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><img src="DS%20sw_files/BOOKSHELF.GIF" alt="[Return to Library]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><img src="DS%20sw_files/TOC.GIF" alt="[Contents]" border="0"></a>
<a href="#DeviceAutoconfig"><img src="DS%20sw_files/REW.GIF" alt="[Previous Chapter]" border="0"></a>
<a href="#busname"><img src="DS%20sw_files/PREV.GIF" alt="[Previous Section]" border="0"></a>
<a href="#confl1"><img src="DS%20sw_files/NEXT.GIF" alt="[Next Section]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut25.html"><img src="DS%20sw_files/FF.GIF" alt="[Next Chapter]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><img src="DS%20sw_files/INDEX.GIF" alt="[Index]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><img src="DS%20sw_files/HELP.GIF" alt="[Help]" border="0"></a>
</p><p></p><hr><p>
</p><h3>
17.1.5&nbsp;&nbsp;&nbsp;&nbsp;The slot, connect_bus, and connect_num Members
</h3>
<p>
<a name="nx_id_715"></a>
<a name="nx_id_716"></a>
<a name="nx_id_717"></a>
The
<tt>slot</tt>
member specifies
the bus slot or node number.
The
<tt>connect_bus</tt>
member specifies
the name of the bus that this bus is connected to.
The
<tt>connect_num</tt>
member specifies
the number of the bus that this bus is connected to.
</p><p>
The bus name consists of a character string, for example,
<tt>pci</tt>
(for PCI bus).
The bus number consists of one of the following:
</p><ul>
<p></p><li>
A number, such as 0 (zero), 1, 2, and so forth
<p>
Thus, pci1 specifies a bus with a bus number of 1.
</p><p></p></li><li>
A wildcard character (a question mark (?)) that represents the bus
number, for example:
<p>
<tt>pci?</tt>
</p><p></p></li><li>
An asterisk (*) to indicate that the bus connects to any bus, for
example:
<p>
<tt>pci *</tt>
</p></li></ul><p>
</p><p>
Device driver writers seldom need to reference these members in
their device drivers.
However, bus adapter driver writers might reference these members in
their bus adapter code.
<a name="confl1"></a>
</p><p></p><hr><p align="center">
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><img src="DS%20sw_files/BOOKSHELF.GIF" alt="[Return to Library]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><img src="DS%20sw_files/TOC.GIF" alt="[Contents]" border="0"></a>
<a href="#DeviceAutoconfig"><img src="DS%20sw_files/REW.GIF" alt="[Previous Chapter]" border="0"></a>
<a href="#slot"><img src="DS%20sw_files/PREV.GIF" alt="[Previous Section]" border="0"></a>
<a href="#portname"><img src="DS%20sw_files/NEXT.GIF" alt="[Next Section]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut25.html"><img src="DS%20sw_files/FF.GIF" alt="[Next Chapter]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><img src="DS%20sw_files/INDEX.GIF" alt="[Index]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><img src="DS%20sw_files/HELP.GIF" alt="[Help]" border="0"></a>
</p><p></p><hr><p>
</p><h3>
17.1.6&nbsp;&nbsp;&nbsp;&nbsp;The confl1 and confl2 Members
</h3>
<p>
<a name="nx_id_718"></a>
<a name="nx_id_719"></a>
The
<tt>confl1</tt>
member specifies
a pointer to an entry point of the level 1 bus configuration
interface.
The
<tt>confl2</tt>
member specifies
a pointer to an entry point of the level 2 bus configuration
interface.
Device driver writers do not typically use these interfaces,
but systems engineers who want to implement a configuration procedure
for a specific bus probably would use them. 
</p><p>
<a name="portname"></a>
</p><p></p><hr><p align="center">
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><img src="DS%20sw_files/BOOKSHELF.GIF" alt="[Return to Library]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><img src="DS%20sw_files/TOC.GIF" alt="[Contents]" border="0"></a>
<a href="#DeviceAutoconfig"><img src="DS%20sw_files/REW.GIF" alt="[Previous Chapter]" border="0"></a>
<a href="#confl1"><img src="DS%20sw_files/PREV.GIF" alt="[Previous Section]" border="0"></a>
<a href="#intr"><img src="DS%20sw_files/NEXT.GIF" alt="[Next Section]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut25.html"><img src="DS%20sw_files/FF.GIF" alt="[Next Chapter]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><img src="DS%20sw_files/INDEX.GIF" alt="[Index]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><img src="DS%20sw_files/HELP.GIF" alt="[Help]" border="0"></a>
</p><p></p><hr><p>
</p><h3>
17.1.7&nbsp;&nbsp;&nbsp;&nbsp;The pname and port Members
</h3>
<p>
<a name="nx_id_720"></a>
<a name="nx_id_721"></a>
The
<tt>pname</tt>
member specifies
a pointer to the port name for this bus, if applicable.
The
<tt>port</tt>
member specifies
a pointer to the
<tt>port</tt>
structure for this bus, if applicable.
</p><p>
Device driver writers do not reference these members in their device
drivers.
However, bus adapter writers use the
<tt>port</tt>
structure to implement the initialization for a class of devices or
controllers that have common characteristics.
<a name="intr"></a>
</p><p></p><hr><p align="center">
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><img src="DS%20sw_files/BOOKSHELF.GIF" alt="[Return to Library]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><img src="DS%20sw_files/TOC.GIF" alt="[Contents]" border="0"></a>
<a href="#DeviceAutoconfig"><img src="DS%20sw_files/REW.GIF" alt="[Previous Chapter]" border="0"></a>
<a href="#portname"><img src="DS%20sw_files/PREV.GIF" alt="[Previous Section]" border="0"></a>
<a href="#alive"><img src="DS%20sw_files/NEXT.GIF" alt="[Next Section]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut25.html"><img src="DS%20sw_files/FF.GIF" alt="[Next Chapter]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><img src="DS%20sw_files/INDEX.GIF" alt="[Index]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><img src="DS%20sw_files/HELP.GIF" alt="[Help]" border="0"></a>
</p><p></p><hr><p>
</p><h3>
17.1.8&nbsp;&nbsp;&nbsp;&nbsp;The intr Member
</h3>
<p>
<a name="nx_id_722"></a>
The
<tt>intr</tt>
member specifies
an array that contains an entry point or points for the bus
interrupt handlers.
</p><p>
A device driver knows the name of its bus interrupt interface.
A device driver uses the
<tt>handler_add</tt>
and
<tt>handler_enable</tt>
interfaces to register its interrupt handlers.
</p><p>
Device driver writers seldom need to reference this member in
their device drivers.
However, bus adapter driver writers might use this member
in their bus adapter code to reference the interrupt handlers that
handle error interrupts related to the bus.
<a name="alive"></a>
</p><p></p><hr><p align="center">
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><img src="DS%20sw_files/BOOKSHELF.GIF" alt="[Return to Library]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><img src="DS%20sw_files/TOC.GIF" alt="[Contents]" border="0"></a>
<a href="#DeviceAutoconfig"><img src="DS%20sw_files/REW.GIF" alt="[Previous Chapter]" border="0"></a>
<a href="#intr"><img src="DS%20sw_files/PREV.GIF" alt="[Previous Section]" border="0"></a>
<a href="#framework"><img src="DS%20sw_files/NEXT.GIF" alt="[Next Section]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut25.html"><img src="DS%20sw_files/FF.GIF" alt="[Next Chapter]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><img src="DS%20sw_files/INDEX.GIF" alt="[Index]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><img src="DS%20sw_files/HELP.GIF" alt="[Help]" border="0"></a>
</p><p></p><hr><p>
</p><h3>
17.1.9&nbsp;&nbsp;&nbsp;&nbsp;The alive Member
</h3>
<p>
<a name="nx_id_723"></a>
The
<tt>alive</tt>
member specifies
a flag word to indicate the current status of the bus.
The system sets this member to the bitwise inclusive OR of the
valid alive bits defined in
<tt>devdriver.h</tt>.
<a name="nx_id_724"></a>
</p><p>
The
<tt>ALV_ALIVE</tt>
bit indicates that the device is present and configured on the
system.
The following list shows the valid alive bits that bus adapter drivers can use:
</p><p>
<a name="nx_id_725"></a>
<a name="nx_id_726"></a>
<a name="nx_id_727"></a>
<a name="nx_id_728"></a>
<a name="nx_id_729"></a>
<a name="nx_id_730"></a>
<a name="nx_id_731"></a>
<table border="4" cellpadding="4">
<tbody><tr>
<td align="left" valign="top">
<tt>ALV_FREE</tt>
</td>
<td align="left" valign="top">
The bus is not yet processed.
</td>
</tr>
<tr>
<td align="left" valign="top">
<tt>ALV_ALIVE</tt>
</td>
<td align="left" valign="top">
The bus is alive and configured.
</td>
</tr>
<tr>
<td align="left" valign="top">
<tt>ALV_PRES</tt>
</td>
<td align="left" valign="top">

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -