1. Add text for ASC/ASCQ
2. Clean up probe messages. This is how I propose it looks for 2.1 so if you don't like it you have my e-mail address.
This commit is contained in:
parent
f6c9b55445
commit
8e77b0f653
@ -14,7 +14,7 @@
|
||||
*
|
||||
* Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
|
||||
*
|
||||
* $Id: cd.c,v 1.34 1995/03/01 22:24:39 dufault Exp $
|
||||
* $Id: cd.c,v 1.35 1995/03/04 20:50:42 dufault Exp $
|
||||
*/
|
||||
|
||||
#define SPLCD splbio
|
||||
@ -196,11 +196,11 @@ cdattach(struct scsi_link *sc_link)
|
||||
*/
|
||||
cd_get_parms(unit, SCSI_NOSLEEP | SCSI_NOMASK);
|
||||
if (dp->disksize) {
|
||||
printf("cd present.[%ld x %ld byte records]\n",
|
||||
printf("cd present.[%ld x %ld byte records]",
|
||||
cd->params.disksize,
|
||||
cd->params.blksize);
|
||||
} else {
|
||||
printf("drive empty\n");
|
||||
printf("drive empty");
|
||||
}
|
||||
cd->flags |= CDINIT;
|
||||
cd_registerdev(unit);
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Written by grefen@?????
|
||||
* Based on scsi drivers by Julian Elischer (julian@tfs.com)
|
||||
*
|
||||
* $Id: ch.c,v 1.14 1995/03/01 22:24:40 dufault Exp $
|
||||
* $Id: ch.c,v 1.15 1995/03/04 20:50:45 dufault Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -135,9 +135,9 @@ chattach(struct scsi_link *sc_link)
|
||||
* request must specify this.
|
||||
*/
|
||||
if ((ch_mode_sense(unit, SCSI_NOSLEEP | SCSI_NOMASK /*| SCSI_SILENT */ ))) {
|
||||
printf("offline\n");
|
||||
printf("offline");
|
||||
} else {
|
||||
printf("%d slot(s) %d drive(s) %d arm(s) %d i/e-slot(s)\n",
|
||||
printf("%d slot(s) %d drive(s) %d arm(s) %d i/e-slot(s)",
|
||||
ch->slots, ch->drives, ch->chms, ch->imexs);
|
||||
}
|
||||
ch_registerdev(unit);
|
||||
|
@ -8,7 +8,7 @@
|
||||
* file.
|
||||
*
|
||||
* Written by Julian Elischer (julian@dialix.oz.au)
|
||||
* $Id: scsi_base.c,v 1.20 1995/02/15 07:44:07 davidg Exp $
|
||||
* $Id: scsi_base.c,v 1.21 1995/03/04 20:50:49 dufault Exp $
|
||||
*/
|
||||
|
||||
#define SPLSD splbio
|
||||
@ -656,6 +656,7 @@ void scsi_sense_print(xs)
|
||||
u_int32 key;
|
||||
u_int32 info;
|
||||
errval errcode;
|
||||
int asc, ascq;
|
||||
|
||||
/* This sense key text now matches what is in the SCSI spec
|
||||
* (Yes, even the capitals)
|
||||
@ -701,20 +702,20 @@ void scsi_sense_print(xs)
|
||||
case 0x7: /* DATA PROTECT */
|
||||
break;
|
||||
case 0x8: /* BLANK CHECK */
|
||||
printf(" requested size: %ld (decimal)",
|
||||
printf(" req sz: %ld (decimal)",
|
||||
info);
|
||||
break;
|
||||
default:
|
||||
if (info)
|
||||
printf(" info:%08lx", info);
|
||||
printf(" info:%lx", info);
|
||||
}
|
||||
}
|
||||
else if (info)
|
||||
printf(" info(inval):%08lx", info);
|
||||
printf(" info?:%lx", info);
|
||||
|
||||
if (ext->extra_len >= 4) {
|
||||
if (memcmp(ext->cmd_spec_info, "\0\0\0\0", 4)) {
|
||||
printf(" csi:%02x,%02x,%02x,%02x",
|
||||
printf(" csi:%x,%x,%x,%x",
|
||||
ext->cmd_spec_info[0],
|
||||
ext->cmd_spec_info[1],
|
||||
ext->cmd_spec_info[2],
|
||||
@ -722,21 +723,19 @@ void scsi_sense_print(xs)
|
||||
}
|
||||
}
|
||||
|
||||
if (ext->extra_len >= 5 && ext->add_sense_code) {
|
||||
printf(" asc:%02x", ext->add_sense_code);
|
||||
}
|
||||
|
||||
if (ext->extra_len >= 6 && ext->add_sense_code_qual) {
|
||||
printf(" ascq:%02x", ext->add_sense_code_qual);
|
||||
}
|
||||
asc = (ext->extra_len >= 5) ? ext->add_sense_code : 0;
|
||||
ascq = (ext->extra_len >= 6) ? ext->add_sense_code_qual : 0;
|
||||
|
||||
if (asc || ascq)
|
||||
printf(" asc:%x,%x %s", asc, ascq, scsi_sense_desc(asc, ascq));
|
||||
|
||||
if (ext->extra_len >= 7 && ext->fru) {
|
||||
printf(" fru:%02x", ext->fru);
|
||||
printf(" fru:%x", ext->fru);
|
||||
}
|
||||
|
||||
if (ext->extra_len >= 10 &&
|
||||
(ext->sense_key_spec_1 & SSD_SCS_VALID)) {
|
||||
printf(" sks:%02x,%04x", ext->sense_key_spec_1,
|
||||
printf(" sks:%x,%x", ext->sense_key_spec_1,
|
||||
(ext->sense_key_spec_2 |
|
||||
ext->sense_key_spec_3));
|
||||
}
|
||||
|
@ -35,7 +35,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: scsi_driver.c,v 1.3 1995/03/04 20:50:51 dufault Exp $
|
||||
* $Id: scsi_driver.c,v 1.4 1995/03/05 20:01:44 dufault Exp $
|
||||
*
|
||||
*/
|
||||
#include <sys/types.h>
|
||||
@ -59,6 +59,12 @@ scsi_goaway(struct kern_devconf *kdc, int force) /* XXX should do a lot more */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* scsi_device_attach: Attach a SCSI device. This routine will
|
||||
* print out the device address, what it is, then call the type
|
||||
* attach function and when that returns print a newline. If the
|
||||
* type attach will make LOT's of noise it should print a leading
|
||||
* newline and then the address using sc_print_addr. See "sd.c".
|
||||
*/
|
||||
int scsi_device_attach(struct scsi_link *sc_link)
|
||||
{
|
||||
errval errcode;
|
||||
@ -79,6 +85,8 @@ int scsi_device_attach(struct scsi_link *sc_link)
|
||||
|
||||
errcode = (device->attach) ? (*(device->attach))(sc_link) : 0;
|
||||
|
||||
printf("\n");
|
||||
|
||||
if (errcode == 0)
|
||||
sc_link->flags |= device->link_flags;
|
||||
|
||||
|
287
sys/scsi/scsi_sense.c
Normal file
287
sys/scsi/scsi_sense.c
Normal file
@ -0,0 +1,287 @@
|
||||
#include <sys/types.h>
|
||||
#include "sd.h"
|
||||
#include "st.h"
|
||||
#define NSPRINT 0
|
||||
#include "pt.h"
|
||||
#include "worm.h"
|
||||
#include "cd.h"
|
||||
#define NSCAN 0
|
||||
#define NOPMEM 0
|
||||
#include "ch.h"
|
||||
#define NCOMM 0
|
||||
|
||||
static struct
|
||||
{
|
||||
u_char asc;
|
||||
u_char ascq;
|
||||
char *desc;
|
||||
} tab[] = {
|
||||
#if !defined(NO_SCSI_SENSE)
|
||||
#if (NCH > 0)
|
||||
{0x28, 0x01, "Import or export element accessed" },
|
||||
{0x21, 0x01, "Invalid element address" },
|
||||
{0x3b, 0x0d, "Medium destination element full" },
|
||||
{0x3b, 0x0e, "Medium source element empty" },
|
||||
#endif
|
||||
#if (NOPMEM > 0)
|
||||
{0x58, 0x00, "Generation does not exist" },
|
||||
{0x59, 0x00, "Updated block read" },
|
||||
#endif
|
||||
#if (NSCAN > 0)
|
||||
{0x2c, 0x02, "Invalid combination of windows specified" },
|
||||
{0x60, 0x00, "Lamp failure" },
|
||||
{0x61, 0x02, "Out of focus" },
|
||||
{0x3b, 0x0c, "Position past beginning of medium" },
|
||||
{0x3b, 0x0b, "Position past end of medium" },
|
||||
{0x3b, 0x0a, "Read past beginning of medium" },
|
||||
{0x3b, 0x09, "Read past end of medium" },
|
||||
{0x62, 0x00, "Scan head positioning error" },
|
||||
{0x2c, 0x01, "Too many windows specified" },
|
||||
{0x61, 0x01, "Unable to acquire video" },
|
||||
{0x61, 0x00, "Video acquisition error" },
|
||||
#endif
|
||||
#if (NCD > 0)
|
||||
{0x00, 0x11, "Audio play operation in progress" },
|
||||
{0x00, 0x12, "Audio play operation paused" },
|
||||
{0x00, 0x14, "Audio play operation stopped due to error" },
|
||||
{0x00, 0x13, "Audio play operation successfully completed" },
|
||||
{0x63, 0x00, "End of user area encountered on this track" },
|
||||
{0x64, 0x00, "Illegal mode for this track" },
|
||||
{0x00, 0x15, "No current audio status to return" },
|
||||
{0x18, 0x03, "Recovered data with CIRC" },
|
||||
{0x18, 0x04, "Recovered data with L-EC" },
|
||||
{0x57, 0x00, "Unable to recover table-of-contents" },
|
||||
#endif
|
||||
#if (NWORM > 0)||(NOPMEM > 0)
|
||||
{0x11, 0x07, "Data resynchronization error" },
|
||||
#endif
|
||||
#if (NWORM > 0)||(NCD > 0)||(NOPMEM > 0)
|
||||
{0x11, 0x06, "Circ unrecovered error" },
|
||||
{0x09, 0x02, "Focus servo failure" },
|
||||
{0x11, 0x05, "L-EC uncorrectable error" },
|
||||
{0x17, 0x04, "Recovered data with retries and/or CIRC applied" },
|
||||
{0x09, 0x03, "Spindle servo failure" },
|
||||
{0x09, 0x01, "Tracking servo failure" },
|
||||
#endif
|
||||
#if (NPT > 0)
|
||||
{0x54, 0x00, "SCSI to host system interface failure" },
|
||||
{0x55, 0x00, "System resource failure" },
|
||||
#endif
|
||||
#if (NSPRINT > 0)
|
||||
{0x3b, 0x07, "Failed to sense bottom-of-form" },
|
||||
{0x3b, 0x06, "Failed to sense top-of-form" },
|
||||
{0x3b, 0x05, "Paper jam" },
|
||||
{0x36, 0x00, "Ribbon, ink, or toner failure" },
|
||||
{0x3b, 0x04, "Slew failure" },
|
||||
{0x3b, 0x03, "Tape or electronic vertical forms unit not ready" },
|
||||
#endif
|
||||
#if (NST > 0)
|
||||
{0x14, 0x04, "Block sequence error" },
|
||||
{0x52, 0x00, "Cartridge fault" },
|
||||
{0x14, 0x03, "End-of-data not found" },
|
||||
{0x03, 0x02, "Excessive write errors" },
|
||||
{0x00, 0x01, "Filemark detected" },
|
||||
{0x14, 0x02, "Filemark or setmark not found" },
|
||||
{0x11, 0x08, "Incomplete block read" },
|
||||
{0x11, 0x09, "No gap found" },
|
||||
{0x03, 0x01, "No write current" },
|
||||
{0x2d, 0x00, "Overwrite error on update in place" },
|
||||
{0x50, 0x02, "Position error related to timing" },
|
||||
{0x3b, 0x08, "Reposition error" },
|
||||
{0x00, 0x03, "Setmark detected" },
|
||||
{0x33, 0x00, "Tape length error" },
|
||||
{0x3b, 0x01, "Tape position error at beginning-of-medium" },
|
||||
{0x3b, 0x02, "Tape position error at end-of-medium" },
|
||||
{0x53, 0x01, "Unload tape failure" },
|
||||
{0x50, 0x00, "Write append error" },
|
||||
{0x50, 0x01, "Write append position error" },
|
||||
#endif
|
||||
#if (NST > 0)||(NOPMEM > 0)
|
||||
{0x51, 0x00, "Erase failure" },
|
||||
#endif
|
||||
#if (NST > 0)||(NSCAN > 0)
|
||||
{0x00, 0x04, "Beginning-of-partition/medium detected" },
|
||||
{0x00, 0x05, "End-of-data detected" },
|
||||
{0x00, 0x02, "End-of-partition/medium detected" },
|
||||
{0x0c, 0x00, "Write error" },
|
||||
#endif
|
||||
#if (NST > 0)||(NSPRINT > 0)
|
||||
{0x3b, 0x00, "Sequential positioning error" },
|
||||
#endif
|
||||
#if (NSD > 0)
|
||||
{0x41, 0x00, "Data path failure (should use 40 nn)" },
|
||||
{0x22, 0x00, "Illegal function (should use 20 00, 24 00, or 26 00)" },
|
||||
{0x42, 0x00, "Power-on or self-test failure (should use 40 nn)" },
|
||||
{0x40, 0x00, "Ram failure (should use 40 nn)" },
|
||||
#endif
|
||||
#if (NSD > 0)||(NOPMEM > 0)
|
||||
{0x19, 0x00, "Defect list error" },
|
||||
{0x19, 0x03, "Defect list error in grown list" },
|
||||
{0x19, 0x02, "Defect list error in primary list" },
|
||||
{0x19, 0x01, "Defect list not available" },
|
||||
{0x1c, 0x00, "Defect list not found" },
|
||||
{0x1c, 0x02, "Grown defect list not found" },
|
||||
{0x1c, 0x01, "Primary defect list not found" },
|
||||
{0x5c, 0x00, "RPL status change" },
|
||||
{0x5c, 0x02, "Spindles not synchronized" },
|
||||
{0x5c, 0x01, "Spindles synchronized" },
|
||||
#endif
|
||||
#if (NSD > 0)||(NWORM > 0)||(NOPMEM > 0)
|
||||
{0x13, 0x00, "Address mark not found for data field" },
|
||||
{0x12, 0x00, "Address mark not found for id field" },
|
||||
{0x16, 0x00, "Data synchronization mark error" },
|
||||
{0x32, 0x01, "Defect list update failure" },
|
||||
{0x10, 0x00, "Id CRC or ECC error" },
|
||||
{0x1d, 0x00, "Miscompare during verify operation" },
|
||||
{0x32, 0x00, "No defect spare location available" },
|
||||
{0x01, 0x00, "No index/sector signal" },
|
||||
{0x17, 0x06, "Recovered data without ECC - data auto-reallocated" },
|
||||
{0x17, 0x07, "Recovered data without ECC - recommend reassignment" },
|
||||
{0x17, 0x08, "Recovered data without ECC - recommend rewrite" },
|
||||
{0x1e, 0x00, "Recovered ID with ECC correction" },
|
||||
{0x11, 0x04, "Unrecovered read error - auto reallocate failed" },
|
||||
{0x11, 0x0b, "Unrecovered read error - recommend reassignment" },
|
||||
{0x11, 0x0c, "Unrecovered read error - recommend rewrite the data" },
|
||||
{0x0c, 0x02, "Write error - auto reallocation failed" },
|
||||
{0x0c, 0x01, "Write error recovered with auto reallocation" },
|
||||
#endif
|
||||
#if (NSD > 0)||(NWORM > 0)||(NCD > 0)||(NOPMEM > 0)
|
||||
{0x18, 0x02, "Recovered data - data auto-reallocated" },
|
||||
{0x18, 0x05, "Recovered data - recommend reassignment" },
|
||||
{0x18, 0x06, "Recovered data - recommend rewrite" },
|
||||
{0x17, 0x05, "Recovered data using previous sector id" },
|
||||
{0x18, 0x01, "Recovered data with error correction & retries applied" },
|
||||
#endif
|
||||
#if (NSD > 0)||(NWORM > 0)||(NCD > 0)||(NOPMEM > 0)||(NCH > 0)
|
||||
{0x06, 0x00, "No reference position found" },
|
||||
{0x02, 0x00, "No seek complete" },
|
||||
#endif
|
||||
#if (NSD > 0)||(NSPRINT > 0)||(NOPMEM > 0)
|
||||
{0x31, 0x01, "Format command failed" },
|
||||
#endif
|
||||
#if (NSD > 0)||(NST > 0)
|
||||
{0x30, 0x03, "Cleaning cartridge installed" },
|
||||
#endif
|
||||
#if (NSD > 0)||(NST > 0)||(NOPMEM > 0)
|
||||
{0x11, 0x0a, "Miscorrected error" },
|
||||
#endif
|
||||
#if (NSD > 0)||(NST > 0)||(NWORM > 0)||(NOPMEM > 0)
|
||||
{0x31, 0x00, "Medium format corrupted" },
|
||||
{0x5a, 0x03, "Operator selected write permit" },
|
||||
{0x5a, 0x02, "Operator selected write protect" },
|
||||
{0x27, 0x00, "Write protected" },
|
||||
#endif
|
||||
#if (NSD > 0)||(NST > 0)||(NWORM > 0)||(NSCAN > 0)||(NOPMEM > 0)
|
||||
{0x11, 0x02, "Error too long to correct" },
|
||||
{0x11, 0x03, "Multiple read errors" },
|
||||
{0x11, 0x01, "Read retries exhausted" },
|
||||
#endif
|
||||
#if (NSD > 0)||(NST > 0)||(NWORM > 0)||(NCD > 0)||(NOPMEM > 0)
|
||||
{0x30, 0x02, "Cannot read medium - incompatible format" },
|
||||
{0x30, 0x01, "Cannot read medium - unknown format" },
|
||||
{0x15, 0x02, "Positioning error detected by read of medium" },
|
||||
{0x14, 0x01, "Record not found" },
|
||||
{0x18, 0x00, "Recovered data with error correction applied" },
|
||||
{0x17, 0x03, "Recovered data with negative head offset" },
|
||||
{0x17, 0x02, "Recovered data with positive head offset" },
|
||||
{0x09, 0x00, "Track following error" },
|
||||
#endif
|
||||
#if (NSD > 0)||(NST > 0)||(NWORM > 0)||(NCD > 0)||(NOPMEM > 0)||(NCH > 0)
|
||||
{0x30, 0x00, "Incompatible medium installed" },
|
||||
{0x21, 0x00, "Logical block address out of range" },
|
||||
{0x53, 0x02, "Medium removal prevented" },
|
||||
{0x5a, 0x01, "Operator medium removal request" },
|
||||
#endif
|
||||
#if (NSD > 0)||(NST > 0)||(NWORM > 0)||(NCD > 0)||(NSCAN > 0)||(NOPMEM > 0)
|
||||
{0x17, 0x00, "Recovered data with no error correction applied" },
|
||||
{0x17, 0x01, "Recovered data with retries" },
|
||||
{0x11, 0x00, "Unrecovered read error" },
|
||||
#endif
|
||||
#if (NSD > 0)||(NST > 0)||(NSPRINT > 0)||(NOPMEM > 0)
|
||||
{0x04, 0x04, "Logical unit not ready, format in progress" },
|
||||
#endif
|
||||
#if (NSD > 0)||(NST > 0)||(NSPRINT > 0)||(NWORM > 0)||(NSCAN > 0)||(NOPMEM > 0)
|
||||
{0x03, 0x00, "Peripheral device write fault" },
|
||||
#endif
|
||||
#if (NSD > 0)||(NST > 0)||(NSPRINT > 0)||(NWORM > 0)||(NCD > 0)||(NSCAN > 0)||(NOPMEM > 0)
|
||||
{0x14, 0x00, "Recorded entity not found" },
|
||||
#endif
|
||||
#if (NSD > 0)||(NST > 0)||(NSPRINT > 0)||(NWORM > 0)||(NCD > 0)||(NSCAN > 0)||(NOPMEM > 0)||(NCH > 0)
|
||||
{0x15, 0x01, "Mechanical positioning error" },
|
||||
{0x53, 0x00, "Media load or eject failed" },
|
||||
{0x3a, 0x00, "Medium not present" },
|
||||
{0x07, 0x00, "Multiple peripheral devices selected" },
|
||||
{0x15, 0x00, "Random positioning error" },
|
||||
#endif
|
||||
#if (NSD > 0)||(NST > 0)||(NSPRINT > 0)||(NWORM > 0)||(NCD > 0)||(NSCAN > 0)||(NOPMEM > 0)||(NCH > 0)||(ncomm > 0)
|
||||
{0x2a, 0x02, "Log parameters changed" },
|
||||
{0x08, 0x00, "Logical unit communication failure" },
|
||||
{0x08, 0x02, "Logical unit communication parity error" },
|
||||
{0x08, 0x01, "Logical unit communication time-out" },
|
||||
{0x2a, 0x01, "Mode parameters changed" },
|
||||
{0x2a, 0x00, "Parameters changed" },
|
||||
{0x37, 0x00, "Rounded parameter" },
|
||||
{0x39, 0x00, "Saving parameters not supported" },
|
||||
#endif
|
||||
#if (NSD > 0)||(NST > 0)||(NSPRINT > 0)||(NPT > 0)||(NWORM > 0)||(NCD > 0)||(NSCAN > 0)||(NOPMEM > 0)||(ncomm > 0)
|
||||
{0x2b, 0x00, "Copy cannot execute since host cannot disconnect" },
|
||||
#endif
|
||||
#if (NSD > 0)||(NST > 0)||(NSPRINT > 0)||(NPT > 0)||(NWORM > 0)||(NCD > 0)||(NSCAN > 0)||(NOPMEM > 0)||(NCH > 0)
|
||||
{0x5b, 0x02, "Log counter at maximum" },
|
||||
{0x5b, 0x00, "Log exception" },
|
||||
{0x5b, 0x03, "Log list codes exhausted" },
|
||||
{0x5a, 0x00, "Operator request or state change input (unspecified)" },
|
||||
{0x5b, 0x01, "Threshold condition met" },
|
||||
#endif
|
||||
{0x3f, 0x02, "Changed operating definition" },
|
||||
{0x4a, 0x00, "Command phase error" },
|
||||
{0x2c, 0x00, "Command sequence error" },
|
||||
{0x2f, 0x00, "Commands cleared by another initiator" },
|
||||
{0x4b, 0x00, "Data phase error" },
|
||||
/* {0x40, 0xnn, "Diagnostic failure on component nn (80h-ffh)" }, */
|
||||
{0x0a, 0x00, "Error log overflow" },
|
||||
{0x00, 0x06, "I/O process terminated" },
|
||||
{0x48, 0x00, "Initiator detected error message received" },
|
||||
{0x3f, 0x03, "Inquiry data has changed" },
|
||||
{0x44, 0x00, "Internal target failure" },
|
||||
{0x3d, 0x00, "Invalid bits in identify message" },
|
||||
{0x20, 0x00, "Invalid command operation code" },
|
||||
{0x24, 0x00, "Invalid field in CDB" },
|
||||
{0x26, 0x00, "Invalid field in parameter list" },
|
||||
{0x49, 0x00, "Invalid message error" },
|
||||
{0x05, 0x00, "Logical unit does not respond to selection" },
|
||||
{0x4c, 0x00, "Logical unit failed self-configuration" },
|
||||
{0x3e, 0x00, "Logical unit has not self-configured yet" },
|
||||
{0x04, 0x01, "Logical unit is in process of becoming ready" },
|
||||
{0x04, 0x00, "Logical unit not ready, cause not reportable" },
|
||||
{0x04, 0x02, "Logical unit not ready, initializing command required" },
|
||||
{0x04, 0x03, "Logical unit not ready, manual intervention required" },
|
||||
{0x25, 0x00, "Logical unit not supported" },
|
||||
{0x43, 0x00, "Message error" },
|
||||
{0x3f, 0x01, "Microcode has been changed" },
|
||||
{0x00, 0x00, "No additional sense information" },
|
||||
{0x28, 0x00, "Not ready to ready transition, medium may have changed" },
|
||||
{0x4e, 0x00, "Overlapped commands attempted" },
|
||||
{0x1a, 0x00, "Parameter list length error" },
|
||||
{0x26, 0x01, "Parameter not supported" },
|
||||
{0x26, 0x02, "Parameter value invalid" },
|
||||
{0x29, 0x00, "Power on, reset, or bus device reset occurred" },
|
||||
{0x47, 0x00, "SCSI parity error" },
|
||||
{0x45, 0x00, "Select or reselect failure" },
|
||||
{0x1b, 0x00, "Synchronous data transfer error" },
|
||||
{0x3f, 0x00, "Target operating conditions have changed" },
|
||||
{0x26, 0x03, "Threshold parameters not supported" },
|
||||
{0x46, 0x00, "Unsuccessful soft reset" },
|
||||
#endif /* NO_SCSI_SENSE */
|
||||
{0xff, 0xff, 0 },
|
||||
};
|
||||
|
||||
char *scsi_sense_desc(int asc, int ascq)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < sizeof(tab) / sizeof(tab[0]); i++)
|
||||
if (tab[i].asc == asc && tab[i].ascq == ascq)
|
||||
return tab[i].desc;
|
||||
|
||||
return "no available sense description";
|
||||
}
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* New configuration setup: dufault@hda.com
|
||||
*
|
||||
* $Id: scsiconf.c,v 1.21 1995/03/04 20:50:58 dufault Exp $
|
||||
* $Id: scsiconf.c,v 1.22 1995/03/06 15:02:13 dufault Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -772,6 +772,14 @@ scsi_link_get(bus, targ, lun)
|
||||
(struct scsibus_data *)extend_get(scbusses, bus);
|
||||
return (scsi) ? scsi->sc_link[targ][lun] : 0;
|
||||
}
|
||||
|
||||
static void rm_spaces(char *text, int n)
|
||||
{
|
||||
while (n && text[n - 1] == ' ')
|
||||
n--;
|
||||
text[n] = 0; /* Zap */
|
||||
}
|
||||
|
||||
/*
|
||||
* given a target and lu, ask the device what
|
||||
* it is, and find the correct driver table
|
||||
@ -915,23 +923,25 @@ scsi_probedev(sc_link, maybe_more, type_p)
|
||||
strncpy(model, "unknown", 16);
|
||||
strncpy(version, "????", 4);
|
||||
}
|
||||
manu[8] = 0;
|
||||
model[16] = 0;
|
||||
version[4] = 0;
|
||||
|
||||
rm_spaces(manu, 8);
|
||||
rm_spaces(model, 16);
|
||||
rm_spaces(version, 4);
|
||||
|
||||
sc_print_addr(sc_link);
|
||||
printf("type %ld(%s) %s SCSI%d\n"
|
||||
|
||||
printf("\"%s %s %s\" is a ", manu, model, version );
|
||||
printf("type %ld %sSCSI %d"
|
||||
,type
|
||||
,dtype
|
||||
,remov ? "removable" : "fixed"
|
||||
,remov ? "removable " : "fixed "
|
||||
,inqbuf->version & SID_ANSII
|
||||
);
|
||||
sc_print_addr(sc_link);
|
||||
printf("<%s%s%s>\n", manu, model, version );
|
||||
if (qtype[0]) {
|
||||
sc_print_addr(sc_link);
|
||||
printf("qualifier %ld(%s)\n" ,qualifier ,qtype);
|
||||
printf(" qualifier %ld(%s)" ,qualifier ,qtype);
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
/*
|
||||
* Try make as good a match as possible with
|
||||
* available sub drivers
|
||||
|
@ -14,7 +14,7 @@
|
||||
*
|
||||
* Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992
|
||||
*
|
||||
* $Id: sd.c,v 1.52 1995/03/04 20:51:03 dufault Exp $
|
||||
* $Id: sd.c,v 1.53 1995/03/06 05:36:59 davidg Exp $
|
||||
*/
|
||||
|
||||
#define SPLSD splbio
|
||||
@ -185,6 +185,9 @@ sdattach(struct scsi_link *sc_link)
|
||||
|
||||
dp = &(sd->params);
|
||||
|
||||
printf("\n");
|
||||
sc_print_addr(sc_link);
|
||||
|
||||
if (sc_link->adapter->adapter_info) {
|
||||
sd->ad_info = ((*(sc_link->adapter->adapter_info)) (sc_link->adapter_unit));
|
||||
sd->cmdscount = sd->ad_info & AD_INF_MAX_CMDS;
|
||||
@ -208,7 +211,7 @@ sdattach(struct scsi_link *sc_link)
|
||||
* -- this avoids the division below from falling over
|
||||
*/
|
||||
if(dp->secsiz == 0) dp->secsiz = 512;
|
||||
printf("%ldMB (%ld total sec), %d cyl, %d head, %d sec, bytes/sec %d\n",
|
||||
printf("%ldMB (%ld sectors), %d C %d H %d S/T %d B/S",
|
||||
dp->disksize / ((1024L * 1024L) / dp->secsiz),
|
||||
dp->disksize,
|
||||
dp->cyls,
|
||||
|
@ -12,7 +12,7 @@
|
||||
* on the understanding that TFS is not responsible for the correct
|
||||
* functioning of this software in any circumstances.
|
||||
*
|
||||
* $Id: st.c,v 1.28 1995/03/01 22:24:46 dufault Exp $
|
||||
* $Id: st.c,v 1.29 1995/03/04 20:51:05 dufault Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -334,7 +334,7 @@ stattach(struct scsi_link *sc_link)
|
||||
* request must specify this.
|
||||
*/
|
||||
if (st_mode_sense(unit, SCSI_NOSLEEP | SCSI_NOMASK | SCSI_SILENT)) {
|
||||
printf("drive offline\n");
|
||||
printf("drive offline");
|
||||
} else {
|
||||
printf("density code 0x%x, ", st->media_density);
|
||||
if (!scsi_test_unit_ready(sc_link, SCSI_NOSLEEP | SCSI_NOMASK | SCSI_SILENT)) {
|
||||
@ -343,10 +343,10 @@ stattach(struct scsi_link *sc_link)
|
||||
} else {
|
||||
printf("variable");
|
||||
}
|
||||
printf(" blocks, write-%s\n",
|
||||
printf(" blocks, write-%s",
|
||||
(st->flags & ST_READONLY) ? "protected" : "enabled");
|
||||
} else {
|
||||
printf(" drive empty\n");
|
||||
printf(" drive empty");
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
@ -37,7 +37,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id:$
|
||||
* $Id: worm.c,v 1.1 1995/03/04 20:51:10 dufault Exp $
|
||||
*/
|
||||
|
||||
/* XXX This is PRELIMINARY.
|
||||
@ -130,9 +130,9 @@ wormattach(struct scsi_link *sc_link)
|
||||
printf("- UNTESTED ");
|
||||
|
||||
if (worm_size(sc_link) == 0)
|
||||
printf("- can't get capacity.\n");
|
||||
printf("- can't get capacity.");
|
||||
else
|
||||
printf("with %ld %ld byte blocks.\n", worm->n_blks, worm->blk_size);
|
||||
printf("with %ld %ld byte blocks.", worm->n_blks, worm->blk_size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user