282 lines
4.6 KiB
HTML
282 lines
4.6 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>SCSI Addressing</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
|
REL="HOME"
|
|
TITLE="The Linux 2.4 SCSI subsystem HOWTO"
|
|
HREF="index.html"><LINK
|
|
REL="UP"
|
|
TITLE="Names and Addresses"
|
|
HREF="names.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="Names and Addresses"
|
|
HREF="names.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="Device Names"
|
|
HREF="dnames.html"></HEAD
|
|
><BODY
|
|
CLASS="sect1"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
SUMMARY="Header navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>The Linux 2.4 SCSI subsystem HOWTO</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="names.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
>Chapter 3. Names and Addresses</TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="dnames.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="sect1"
|
|
><H1
|
|
CLASS="sect1"
|
|
><A
|
|
NAME="scsiaddr"
|
|
></A
|
|
>3.1. SCSI Addressing</H1
|
|
><P
|
|
> Linux has a four level hierarchical addressing scheme for SCSI devices:
|
|
<P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
>SCSI adapter number [host]</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>channel number [bus]</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>id number [target]</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>lun [lun]</P
|
|
></LI
|
|
></UL
|
|
>
|
|
</P
|
|
><P
|
|
> "Lun" is the common SCSI abbreviation of Logical Unit Number. The terms
|
|
in brackets are the name conventions used by device pseudo file system
|
|
(devfs). "Bus" is used in preference to "channel" in the description below.
|
|
</P
|
|
><P
|
|
> The SCSI adapter number is typically an arbitrary numbering of the adapter
|
|
cards on the internal IO buses (e.g. PCI, PCMCIA, ISA etc) of the computer.
|
|
Such adapters are sometimes termed as HBAs (host bus adapters).
|
|
SCSI adapter numbers are issued by the kernel in ascending order starting
|
|
with 0.
|
|
</P
|
|
><P
|
|
> Each HBA may control one or more SCSI buses. The various types of SCSI
|
|
buses are listed in <A
|
|
HREF="scsibus.html"
|
|
>Appendix A</A
|
|
>.
|
|
</P
|
|
><P
|
|
> Each SCSI bus can have multiple SCSI devices connected to it. In SCSI
|
|
parlance the HBA is called the "initiator" and takes up one SCSI id
|
|
number (typically 7). The initiator
|
|
<A
|
|
NAME="AEN152"
|
|
HREF="#FTN.AEN152"
|
|
><SPAN
|
|
CLASS="footnote"
|
|
>[1]</SPAN
|
|
></A
|
|
>
|
|
talks to targets which are commonly
|
|
known as SCSI devices (e.g. disks). On SCSI parallel buses the number
|
|
of ids is related to the width. 8 bit buses (sometimes called "narrow")
|
|
can have 8 SCSI ids of which 1 is taken by the HBA leaving 7 for SCSI
|
|
devices. Wide SCSI buses are 16 bits wide and can have a maximum of 15
|
|
SCSI devices (targets) attached. The SCSI 3 draft standard allows a
|
|
large number of ids to be present on a SCSI bus.
|
|
</P
|
|
><P
|
|
> Each SCSI device can contain multiple Logical Unit Numbers (LUNs). These
|
|
are typically used by sophisticated tape and cdrom units that support
|
|
multiple media.
|
|
</P
|
|
><P
|
|
> So Linux's flavour of SCSI addressing is a four level hierarchy:
|
|
<TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
> <scsi(_adapter_number), channel, id, lun>
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
>
|
|
Using the naming conventions of devfs this becomes:
|
|
<TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
> <host, bus, target, lun>
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
>
|
|
</P
|
|
></DIV
|
|
><H3
|
|
CLASS="FOOTNOTES"
|
|
>Notes</H3
|
|
><TABLE
|
|
BORDER="0"
|
|
CLASS="FOOTNOTES"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
WIDTH="5%"
|
|
><A
|
|
NAME="FTN.AEN152"
|
|
HREF="scsiaddr.html#AEN152"
|
|
><SPAN
|
|
CLASS="footnote"
|
|
>[1]</SPAN
|
|
></A
|
|
></TD
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
WIDTH="95%"
|
|
><P
|
|
> SCSI standards allow for multiple initiators to be present on a single bus.
|
|
This is not well supported in Linux although there are patches around
|
|
that improve this situation.
|
|
</P
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
SUMMARY="Footer navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="names.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
ACCESSKEY="H"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="dnames.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Names and Addresses</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="names.html"
|
|
ACCESSKEY="U"
|
|
>Up</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>Device Names</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |