/usr/share/doc/HOWTO/ja-html/SCSI-Programming-HOWTO-9.html is in doc-linux-ja-html 2006.05.25-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.21">
<TITLE>The Linux SCSI programming HOWTO: Inquiry[$B>H2q(B]$B%3%^%s%I$NNc(B</TITLE>
<LINK HREF="SCSI-Programming-HOWTO-10.html" REL=next>
<LINK HREF="SCSI-Programming-HOWTO-8.html" REL=previous>
<LINK HREF="SCSI-Programming-HOWTO.html#toc9" REL=contents>
</HEAD>
<BODY>
<A HREF="SCSI-Programming-HOWTO-10.html">$B<!$N%Z!<%8(B</A>
<A HREF="SCSI-Programming-HOWTO-8.html">$BA0$N%Z!<%8(B</A>
<A HREF="SCSI-Programming-HOWTO.html#toc9">$BL\<!$X(B</A>
<HR>
<H2><A NAME="s9">9.</A> <A HREF="SCSI-Programming-HOWTO.html#toc9">Inquiry[$B>H2q(B]$B%3%^%s%I$NNc(B</A></H2>
<P>$B$b$C$H$b4pK\E*$J(B SCSI $B%3%^%s%I$N0l$D$,(B <CODE>INQUIRY</CODE> $B%3%^%s%I$G!"AuCV$N(B
$B<oN`$H9=@.$rL@$i$+$K$9$k$?$a$K;HMQ$5$l$^$9!#0J2<$O(BSCSI-2 $B;EMM=q$+$i$N(B
$BDj5A$G$9(B($B>\:Y$O(B SCSI-2 $BI8=`5,3J$r;2>H$N$3$H(B)$B!#(B</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
Table 44: INQUIRY Command
+=====-========-========-========-========-========-========-========-========+
| Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|Byte | | | | | | | | |
|=====+=======================================================================|
| 0 | Operation Code (12h) |
|-----+-----------------------------------------------------------------------|
| 1 | Logical Unit Number | Reserved | EVPD |
|-----+-----------------------------------------------------------------------|
| 2 | Page Code |
|-----+-----------------------------------------------------------------------|
| 3 | Reserved |
|-----+-----------------------------------------------------------------------|
| 4 | Allocation Length |
|-----+-----------------------------------------------------------------------|
| 5 | Control |
+=============================================================================+
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>$B=PNO%G!<%?$O0J2<$NDL$j!'(B
<BLOCKQUOTE><CODE>
<PRE>
Table 45: Standard INQUIRY Data Format
+=====-========-========-========-========-========-========-========-========+
| Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|Byte | | | | | | | | |
|=====+==========================+============================================|
| 0 | Peripheral Qualifier | Peripheral Device Type |
|-----+-----------------------------------------------------------------------|
| 1 | RMB | Device-Type Modifier |
|-----+-----------------------------------------------------------------------|
| 2 | ISO Version | ECMA Version | ANSI-Approved Version |
|-----+-----------------+-----------------------------------------------------|
| 3 | AENC | TrmIOP | Reserved | Response Data Format |
|-----+-----------------------------------------------------------------------|
| 4 | Additional Length (n-4) |
|-----+-----------------------------------------------------------------------|
| 5 | Reserved |
|-----+-----------------------------------------------------------------------|
| 6 | Reserved |
|-----+-----------------------------------------------------------------------|
| 7 | RelAdr | WBus32 | WBus16 | Sync | Linked |Reserved| CmdQue | SftRe |
|-----+-----------------------------------------------------------------------|
| 8 | (MSB) |
|- - -+--- Vendor Identification ---|
| 15 | (LSB) |
|-----+-----------------------------------------------------------------------|
| 16 | (MSB) |
|- - -+--- Product Identification ---|
| 31 | (LSB) |
|-----+-----------------------------------------------------------------------|
| 32 | (MSB) |
|- - -+--- Product Revision Level ---|
| 35 | (LSB) |
|-----+-----------------------------------------------------------------------|
| 36 | |
|- - -+--- Vendor Specific ---|
| 55 | |
|-----+-----------------------------------------------------------------------|
| 56 | |
|- - -+--- Reserved ---|
| 95 | |
|=====+=======================================================================|
| | Vendor-Specific Parameters |
|=====+=======================================================================|
| 96 | |
|- - -+--- Vendor Specific ---|
| n | |
+=============================================================================+
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>$B<!$NNc$ODc%l%Y%k4X?t(B <CODE>handle_SCSI_cmd</CODE> $B$r(B Inquiry SCSI $B%3%^%s%I$r(B
$B<B9T$9$k$?$a$K;HMQ$7$^$9!#(B</P>
<P>$B:G=i$K6&DL%X%C%@$K%3%^%s%IIt$rDI2C$7!"$=$l$+$i(B <CODE>handle_SCSI_cmd</CODE>
$B$r8F$S=P$7$^$9!#(B<CODE>handle_SCSI_cmd</CODE> $B$N8F$S=P$7$KBP$9$k=PNO%P%C%U%!%5%$%:(B
$B$N0z?t$O6&DL%X%C%@$N%5%$%:$r=|30$7$F$$$k$3$H$KCm0U$7$F$/$@$5$$!#(B
$B%(%i!<$,H/@8$7$J$+$C$?$J$i$P!"%3%^%s%I$,407k$7$?8e$K=PNO%P%C%U%!$OMW5a(B
$B$5$l$?%G!<%?$rJ]M-$9$k$3$H$K$J$j$^$9!#(B</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
#define INQUIRY_CMD 0x12
#define INQUIRY_CMDLEN 6
#define INQUIRY_REPLY_LEN 96
#define INQUIRY_VENDOR 8 /* $BJVEz%G!<%?Fb$N%Y%s%@L>$N%*%U%;%C%H(B */
/* $B%Y%s%@$N%V%i%s%I$H%b%G%k$rMW5a(B */
static unsigned char *Inquiry ( void )
{
static unsigned char Inqbuffer[ SCSI_OFF + INQUIRY_REPLY_LEN ];
unsigned char cmdblk [ INQUIRY_CMDLEN ] =
{ INQUIRY_CMD, /* command */
0, /* lun/reserved */
0, /* page code */
0, /* reserved */
INQUIRY_REPLY_LEN, /* allocation length */
0 };/* reserved/flag/link */
memcpy( cmd + SCSI_OFF, cmdblk, sizeof(cmdblk) );
/*
* +------------------+
* | struct sg_header | <- cmd
* +------------------+
* | copy of cmdblk | <- cmd + SCSI_OFF
* +------------------+
*/
if (handle_SCSI_cmd(sizeof(cmdblk), 0, cmd,
sizeof(Inqbuffer) - SCSI_OFF, Inqbuffer )) {
fprintf( stderr, "Inquiry failed\n" );
exit(2);
}
return (Inqbuffer + SCSI_OFF);
}
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>$B>e$NNc$O<!$N$h$&$J9=B$$K$J$C$F$$$^$9!#(BInquiry $B4X?t$O$=$N%3%^%s%IIt$r(B
$B6&DL%X%C%@$N$"$H(B(<CODE>SCSI_OFF</CODE>$B$K$h$C$FM?$($i$l$^$9(B)$B$K%3%T!<$7$^$9!#(B
$BF~NO%G!<%?$O$3$N%3%^%s%I$KBP$7$F$OB8:_$7$^$;$s!#(B
<CODE>Handle_SCSI_cmd</CODE> $B$,%X%C%@9=B$BN$rDj5A$7$^$9!#(B
$B:#$d4X?t(B <CODE>main</CODE> $B$r<BAu$7!"$3$N:n6HCf$N8+K\%W%m%0%i%`$r40@.$G$-$^$9!#(B</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
void main( void )
{
fd = open(DEVICE, O_RDWR);
if (fd < 0) {
fprintf( stderr, "Need read/write permissions for "DEVICE".\n" );
exit(1);
}
/* Inquiry $B$N7k2L$N0lIt$N%U%#!<%k%I$rI=<((B */
printf( "%s\n", Inquiry() + INQUIRY_VENDOR );
}
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>$B:G=i$K%G%P%$%9%*!<%W%s$7!"%(%i!<$r%A%'%C%/$7$F$+$i!"9b0L$N%5%V%k!<%A%s(B
$B$r8F$S=P$7$^$9!#$=$N8e!"%Y%s%@!"@=IJ5Z$S%j%S%8%g%s$J$I$N7k2L$r?M4V$,FI(B
$B$a$k7A<0$GI=<($7$^$9!#(B</P>
<P>$BCm0U(B: Inquiry $B$N7k2L$K$O$3$N>.$5$J%W%m%0%i%`$,6!$9$k$h$j$b$b$C$HB?$/$N(B
$B>pJs$,$"$j$^$9!#$3$N%W%m%0%i%`$r%G%P%$%9$N<oN`$d(B ANSI $B$N%P!<%8%g%s$J$I(B
$B$r=P$9$h$&$K3HD%$7$?$/$J$k$+$b$7$l$^$;$s!#%G%P%$%9$N<oN`$K$OFCJL$J=EMW(B
$B@-$,$"$j$^$9!#$H$$$&$N$O$3$l$,$=$NAuCV$KBP$9$kI,?\$*$h$S%*%W%7%g%s$N%3(B
$B%^%s%I%;%C%H$r7hDj$9$k$+$i$G$9!#<+J,$G$3$l$r%W%m%0%i%`$7$?$/$J$$$N$G$"(B
$B$l$P!"(BEric Youngdale $B$K$h$k(B scsiinfo $B%W%m%0%i%`$r;HMQ$9$k$3$H$b$G$-$^(B
$B$9!#(Bscsiinfo $B$O(B SCSI $BAuCV$K$D$$$F$N$[$H$s$IA4$F$N>pJs$rMW5a$9$k$b$N$G(B
$B$9!#(Btsx-11.mit.edu $B$N(B pub/Linux/ALPHA/scsi $B$r8+$F$/$@$5$$!#(B</P>
<HR>
<A HREF="SCSI-Programming-HOWTO-10.html">$B<!$N%Z!<%8(B</A>
<A HREF="SCSI-Programming-HOWTO-8.html">$BA0$N%Z!<%8(B</A>
<A HREF="SCSI-Programming-HOWTO.html#toc9">$BL\<!$X(B</A>
</BODY>
</HTML>
|