diff options
Diffstat (limited to 'sys/scsi')
-rw-r--r-- | sys/scsi/README | 7 | ||||
-rw-r--r-- | sys/scsi/cd.c | 103 | ||||
-rw-r--r-- | sys/scsi/ch.c | 140 | ||||
-rw-r--r-- | sys/scsi/scsi_all.h | 37 | ||||
-rw-r--r-- | sys/scsi/scsi_cd.h | 13 | ||||
-rw-r--r-- | sys/scsi/scsi_changer.h | 17 | ||||
-rw-r--r-- | sys/scsi/scsi_disk.h | 33 | ||||
-rw-r--r-- | sys/scsi/scsi_tape.h | 44 | ||||
-rw-r--r-- | sys/scsi/scsiconf.c | 45 | ||||
-rw-r--r-- | sys/scsi/scsiconf.h | 13 | ||||
-rw-r--r-- | sys/scsi/sd.c | 181 | ||||
-rw-r--r-- | sys/scsi/st.c | 143 |
12 files changed, 352 insertions, 424 deletions
diff --git a/sys/scsi/README b/sys/scsi/README index 16e0998..dfeeb17 100644 --- a/sys/scsi/README +++ b/sys/scsi/README @@ -1,10 +1,3 @@ - * - * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE - * -------------------- ----- ---------------------- - * CURRENT PATCH LEVEL: 1 00098 - * -------------------- ----- ---------------------- - * - * 16 Feb 93 Julian Elischer ADDED for SCSI system This release consists of the following files (relative to the base of the kernel tree) diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c index 879b0f7..d387c04 100644 --- a/sys/scsi/cd.c +++ b/sys/scsi/cd.c @@ -12,18 +12,9 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - */ -static char rev[] = "$Revision: 1.5 $"; - -/* * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 * - * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE - * -------------------- ----- ---------------------- - * CURRENT PATCH LEVEL: 1 00098 - * -------------------- ----- ---------------------- - * - * 16 Feb 93 Julian Elischer ADDED for SCSI system + * $Id$ */ #define SPLCD splbio @@ -132,7 +123,8 @@ struct scsi_switch *scsi_switch; \*******************************************************/ if( unit >= NCD) { - printf("Too many scsi CDs..(%d > %d) reconfigure kernel\n",(unit + 1),NCD); + printf("Too many scsi CDs..(%d > %d) reconfigure kernel\n", + (unit + 1),NCD); return(0); } /*******************************************************\ @@ -159,11 +151,11 @@ struct scsi_switch *scsi_switch; cd_get_parms(unit, SCSI_NOSLEEP | SCSI_NOMASK); if(dp->disksize) { - printf("cd present\n"); + printf("cd%d: cd present\n", unit); } else { - printf("drive empty\n"); + printf("cd%d: drive empty\n", unit); } cd->flags |= CDINIT; return; @@ -328,7 +320,7 @@ int flags; { if (cd_xfer_block_wait[unit]) { - printf("doing a wakeup from NOMASK mode\n"); + printf("cd%d: doing a wakeup from NOMASK mode\n", unit); wakeup((caddr_t)&cd_free_xfer[unit]); } xs->next = cd_free_xfer[unit]; @@ -1018,7 +1010,7 @@ cd_size(unit, flags) 2000, flags) != 0) { - printf("could not get size of unit %d\n", unit); + printf("cd%d: could not get size\n", unit); return(0); } else { size = rdcap.addr_0 + 1 ; @@ -1265,7 +1257,7 @@ int unit,type,flags; 0) != 0) { if(!(flags & SCSI_SILENT)) - printf("cannot prevent/allow on cd%d\n", unit); + printf("cd%d: cannot prevent/allow\n", unit); return(0); } } @@ -1415,7 +1407,7 @@ int datalen; xs = cd_get_xs(unit,flags); /* should wait unless booting */ if(!xs) { - printf("cd_scsi_cmd%d: controller busy" + printf("cd%d: scsi_cmd controller busy" " (this should never happen)\n",unit); return(EBUSY); } @@ -1539,10 +1531,10 @@ struct scsi_xfer *xs; case 0x1: if(!silent) { - printf("cd%d: soft error(corrected) ", unit); + printf("cd%d: soft error(corrected)", unit); if(sense->error_code & SSD_ERRCODE_VALID) { - printf("block no. %d (decimal)", + printf(" block no. %d (decimal)", (sense->ext.extended.info[0] <<24)| (sense->ext.extended.info[1] <<16)| (sense->ext.extended.info[2] <<8)| @@ -1552,16 +1544,15 @@ struct scsi_xfer *xs; } return(ESUCCESS); case 0x2: - if(!silent)printf("cd%d: not ready\n ", - unit); + if(!silent)printf("cd%d: not ready\n", unit); return(ENODEV); case 0x3: if(!silent) { - printf("cd%d: medium error ", unit); + printf("cd%d: medium error", unit); if(sense->error_code & SSD_ERRCODE_VALID) { - printf("block no. %d (decimal)", + printf(" block no. %d (decimal)", (sense->ext.extended.info[0] <<24)| (sense->ext.extended.info[1] <<16)| (sense->ext.extended.info[2] <<8)| @@ -1571,15 +1562,15 @@ struct scsi_xfer *xs; } return(EIO); case 0x4: - if(!silent)printf("cd%d: non-media hardware failure\n ", + if(!silent)printf("cd%d: non-media hardware failure\n", unit); return(EIO); case 0x5: - if(!silent)printf("cd%d: illegal request\n ", + if(!silent)printf("cd%d: illegal request\n", unit); return(EINVAL); case 0x6: - if(!silent)printf("cd%d: Unit attention.\n ", unit); + if(!silent)printf("cd%d: Unit attention\n", unit); if (cd_data[unit].openparts) cd_data[unit].flags &= ~(CDVALID | CDHAVELABEL); { @@ -1589,11 +1580,11 @@ struct scsi_xfer *xs; case 0x7: if(!silent) { - printf("cd%d: attempted protection violation ", + printf("cd%d: attempted protection violation", unit); if(sense->error_code & SSD_ERRCODE_VALID) { - printf("block no. %d (decimal)\n", + printf(" block no. %d (decimal)", (sense->ext.extended.info[0] <<24)| (sense->ext.extended.info[1] <<16)| (sense->ext.extended.info[2] <<8)| @@ -1605,11 +1596,11 @@ struct scsi_xfer *xs; case 0x8: if(!silent) { - printf("cd%d: block wrong state (worm)\n ", - unit); + printf("cd%d: block wrong state (worm)", + unit); if(sense->error_code & SSD_ERRCODE_VALID) { - printf("block no. %d (decimal)\n", + printf(" block no. %d (decimal)", (sense->ext.extended.info[0] <<24)| (sense->ext.extended.info[1] <<16)| (sense->ext.extended.info[2] <<8)| @@ -1619,25 +1610,21 @@ struct scsi_xfer *xs; } return(EIO); case 0x9: - if(!silent)printf("cd%d: vendor unique\n", - unit); + if(!silent)printf("cd%d: vendor unique\n", unit); return(EIO); case 0xa: - if(!silent)printf("cd%d: copy aborted\n ", - unit); + if(!silent)printf("cd%d: copy aborted\n", unit); return(EIO); case 0xb: - if(!silent)printf("cd%d: command aborted\n ", - unit); + if(!silent)printf("cd%d: command aborted\n", unit); return(EIO); case 0xc: if(!silent) { - printf("cd%d: search returned\n ", - unit); + printf("cd%d: search returned", unit); if(sense->error_code & SSD_ERRCODE_VALID) { - printf("block no. %d (decimal)\n", + printf(" block no. %d (decimal)", (sense->ext.extended.info[0] <<24)| (sense->ext.extended.info[1] <<16)| (sense->ext.extended.info[2] <<8)| @@ -1647,17 +1634,15 @@ struct scsi_xfer *xs; } return(ESUCCESS); case 0xd: - if(!silent)printf("cd%d: volume overflow\n ", - unit); + if(!silent)printf("cd%d: volume overflow\n", unit); return(ENOSPC); case 0xe: if(!silent) { - printf("cd%d: verify miscompare\n ", - unit); + printf("cd%d: verify miscompare", unit); if(sense->error_code & SSD_ERRCODE_VALID) { - printf("block no. %d (decimal)\n", + printf(" block no. %d (decimal)", (sense->ext.extended.info[0] <<24)| (sense->ext.extended.info[1] <<16)| (sense->ext.extended.info[2] <<8)| @@ -1667,22 +1652,27 @@ struct scsi_xfer *xs; } return(EIO); case 0xf: - if(!silent)printf("cd%d: unknown error key\n ", - unit); + if(!silent)printf("cd%d: unknown error key\n", unit); return(EIO); } break; } default: { - if(!silent)printf("cd%d: error code %d\n", - unit, - sense->error_code & SSD_ERRCODE); - if(sense->error_code & SSD_ERRCODE_VALID) - if(!silent)printf("block no. %d (decimal)\n", - (sense->ext.unextended.blockhi <<16) - + (sense->ext.unextended.blockmed <<8) - + (sense->ext.unextended.blocklow )); + if(!silent) + { + printf("cd%d: error code %d", + unit, + sense->error_code & SSD_ERRCODE); + if(sense->error_code & SSD_ERRCODE_VALID) + { + printf(" block no. %d (decimal)", + (sense->ext.unextended.blockhi <<16) + + (sense->ext.unextended.blockmed <<8) + + (sense->ext.unextended.blocklow )); + } + printf("\n"); + } } return(EIO); } @@ -1697,6 +1687,7 @@ cdsize(dev_t dev) return (-1); } +#if 0 show_mem(address,num) unsigned char *address; int num; @@ -1711,4 +1702,4 @@ int num; } printf("\n------------------------------\n"); } - +#endif diff --git a/sys/scsi/ch.c b/sys/scsi/ch.c index ba7cdcd..a76d522 100644 --- a/sys/scsi/ch.c +++ b/sys/scsi/ch.c @@ -1,16 +1,7 @@ /* - */ -/* - * HISTORY - * - * - * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE - * -------------------- ----- ---------------------- - * CURRENT PATCH LEVEL: 1 00098 - * -------------------- ----- ---------------------- + * Written by Julian Elischer (julian@tfs.com) * - * 16 Feb 93 Julian Elischer ADDED for SCSI system - * + * $Id$ */ #include <sys/types.h> @@ -118,13 +109,13 @@ struct scsi_switch *scsi_switch; \*******************************************************/ if((ch_mode_sense(unit, SCSI_NOSLEEP | SCSI_NOMASK /*| SCSI_SILENT*/))) { - printf(" ch%d: scsi changer, %d slot(s) %d drive(s) %d arm(s) %d i/e-slot(s) \n", + printf("ch%d: scsi changer, %d slot(s) %d drive(s) %d arm(s) %d i/e-slot(s)\n", unit, ch_data[unit].slots, ch_data[unit].drives, ch_data[unit].chms, ch_data[unit].imexs); stat=CH_KNOWN; } else { - printf(" ch%d: scsi changer :- offline\n", unit); + printf("ch%d: scsi changer :- offline\n", unit); stat=CH_OPEN; } ch_initialized[unit] = stat; @@ -151,7 +142,7 @@ chopen(dev) \*******************************************************/ if ( unit >= NCH ) { - printf("ch %d > %d\n",unit,NCH); + printf("ch%d: ch %d > %d\n",unit,unit,NCH); errcode = ENXIO; return(errcode); } @@ -160,7 +151,7 @@ chopen(dev) \*******************************************************/ if(ch_data[unit].flags & CH_OPEN) { - printf("CH%d already open\n",unit); + printf("ch%d: already open\n",unit); errcode = ENXIO; goto bad; } @@ -181,7 +172,7 @@ chopen(dev) } else { - printf(" ch%d: scsi changer :- offline\n", unit); + printf("ch%d: scsi changer :- offline\n", unit); return(ENXIO); } } @@ -203,7 +194,7 @@ chopen(dev) if(!(ch_test_ready(unit,0))) { - printf("ch%d not ready\n",unit); + printf("ch%d: not ready\n",unit); return(EIO); } @@ -549,7 +540,7 @@ int unit,flags; } if (ch_info_valid[unit]!=CH_KNOWN) { if(!(flags & SCSI_SILENT)) - printf("could not mode sense for unit %d\n", unit); + printf("ch%d: could not mode sense\n", unit); return(FALSE); } l=scsi_sense[0]-3; @@ -713,7 +704,7 @@ retry: xs->error = XS_NOERROR; break; default: retval = EIO; - printf("st%d: unknown error category from scsi driver\n" + printf("ch%d: unknown error category from scsi driver\n" ,unit); break; } @@ -734,7 +725,7 @@ retry: xs->error = XS_NOERROR; } else { - printf("chd: not set up\n",unit); + printf("ch%d: not set up\n",unit); return(EINVAL); } return(retval); @@ -828,59 +819,53 @@ struct scsi_xfer *xs; case 0x1: if(!silent) { - printf("st%d: soft error(corrected) ", unit); + printf("ch%d: soft error(corrected)", unit); if(sense->error_code & SSD_ERRCODE_VALID) { - printf("block no. %d (decimal)\n", + printf(" block no. %d (decimal)", (sense->ext.extended.info[0] <<24)| (sense->ext.extended.info[1] <<16)| (sense->ext.extended.info[2] <<8)| (sense->ext.extended.info[3] )); } - else - { - printf("\n"); - } + printf("\n"); } return(ESUCCESS); case 0x2: - if(!silent) printf("st%d: not ready\n ", unit); + if(!silent) printf("ch%d: not ready\n", unit); ch_data[unit].lsterr=(sense->ext.extended.info[12]<<8)| - sense->ext.extended.info[13] ; + sense->ext.extended.info[13] ; return(ENODEV); case 0x3: if(!silent) { - printf("st%d: medium error ", unit); + printf("ch%d: medium error", unit); if(sense->error_code & SSD_ERRCODE_VALID) { - printf("block no. %d (decimal)\n", + printf(" block no. %d (decimal)", (sense->ext.extended.info[0] <<24)| (sense->ext.extended.info[1] <<16)| (sense->ext.extended.info[2] <<8)| (sense->ext.extended.info[3] )); } - else - { - printf("\n"); - } + printf("\n"); } return(EIO); case 0x4: - if(!silent) printf("st%d: non-media hardware failure\n ", + if(!silent) printf("ch%d: non-media hardware failure\n", unit); ch_data[unit].lsterr=(sense->ext.extended.info[12]<<8)| - sense->ext.extended.info[13] ; + sense->ext.extended.info[13] ; return(EIO); case 0x5: - if(!silent) printf("st%d: illegal request\n ", unit); + if(!silent) printf("ch%d: illegal request\n", unit); ch_data[unit].lsterr=(sense->ext.extended.info[12]<<8)| - sense->ext.extended.info[13] ; + sense->ext.extended.info[13] ; return(EINVAL); case 0x6: - if(!silent) printf("st%d: Unit attention.\n ", unit); + if(!silent) printf("ch%d: Unit attention\n", unit); ch_data[unit].lsterr=(sense->ext.extended.info[12]<<8)| - sense->ext.extended.info[13] ; + sense->ext.extended.info[13] ; ch_info_valid[unit] = FALSE; if (ch_data[unit].flags & CH_OPEN) /* TEMP!!!! */ return(EIO); @@ -889,98 +874,81 @@ struct scsi_xfer *xs; case 0x7: if(!silent) { - printf("st%d: attempted protection violation " + printf("ch%d: attempted protection violation" , unit); if(sense->error_code & SSD_ERRCODE_VALID) { - printf("block no. %d (decimal)\n", + printf(" block no. %d (decimal)\n", (sense->ext.extended.info[0] <<24)| (sense->ext.extended.info[1] <<16)| (sense->ext.extended.info[2] <<8)| (sense->ext.extended.info[3] )); } - else - { - printf("\n"); - } + printf("\n"); } return(EACCES); case 0x8: if(!silent) { - printf("st%d: block wrong state (worm)\n " + printf("ch%d: block wrong state (worm)" , unit); if(sense->error_code & SSD_ERRCODE_VALID) { - printf("block no. %d (decimal)\n", + printf(" block no. %d (decimal)", (sense->ext.extended.info[0] <<24)| (sense->ext.extended.info[1] <<16)| (sense->ext.extended.info[2] <<8)| (sense->ext.extended.info[3] )); } - else - { - printf("\n"); - } + printf("\n"); } return(EIO); case 0x9: - if(!silent) printf("st%d: vendor unique\n", - unit); + if(!silent) printf("ch%d: vendor unique\n", unit); return(EIO); case 0xa: - if(!silent) printf("st%d: copy aborted\n ", - unit); + if(!silent) printf("ch%d: copy aborted\n", unit); return(EIO); case 0xb: - if(!silent) printf("st%d: command aborted\n ", - unit); + if(!silent) printf("ch%d: command aborted\n", unit); ch_data[unit].lsterr=(sense->ext.extended.info[12]<<8)| - sense->ext.extended.info[13] ; + sense->ext.extended.info[13] ; return(EIO); case 0xc: if(!silent) { - printf("st%d: search returned\n ", unit); + printf("ch%d: search returned", unit); if(sense->error_code & SSD_ERRCODE_VALID) { - printf("block no. %d (decimal)\n", + printf(" block no. %d (decimal)", (sense->ext.extended.info[0] <<24)| (sense->ext.extended.info[1] <<16)| (sense->ext.extended.info[2] <<8)| (sense->ext.extended.info[3] )); } - else - { - printf("\n"); - } + printf("\n"); } return(ESUCCESS); case 0xd: - if(!silent) printf("st%d: volume overflow\n ", - unit); + if(!silent) printf("ch%d: volume overflow\n", unit); return(ENOSPC); case 0xe: if(!silent) { - printf("st%d: verify miscompare\n ", unit); + printf("ch%d: verify miscompare", unit); if(sense->error_code & SSD_ERRCODE_VALID) { - printf("block no. %d (decimal)\n", + printf(" block no. %d (decimal)", (sense->ext.extended.info[0] <<24)| (sense->ext.extended.info[1] <<16)| (sense->ext.extended.info[2] <<8)| (sense->ext.extended.info[3] )); } - else - { - printf("\n"); - } + printf("\n"); } return(EIO); case 0xf: - if(!silent) printf("st%d: unknown error key\n ", - unit); + if(!silent) printf("ch%d: unknown error key\n", unit); return(EIO); } break; @@ -990,14 +958,20 @@ struct scsi_xfer *xs; \***************************************************************/ default: { - if(!silent) printf("st%d: error code %d\n", - unit, - sense->error_code & SSD_ERRCODE); - if(sense->error_code & SSD_ERRCODE_VALID) - if(!silent) printf("block no. %d (decimal)\n", - (sense->ext.unextended.blockhi <<16), - + (sense->ext.unextended.blockmed <<8), - + (sense->ext.unextended.blocklow )); + if(!silent) + { + printf("ch%d: error code %d", + unit, + sense->error_code & SSD_ERRCODE); + if(sense->error_code & SSD_ERRCODE_VALID) + { + printf(" block no. %d (decimal)", + (sense->ext.unextended.blockhi <<16), + + (sense->ext.unextended.blockmed <<8), + + (sense->ext.unextended.blocklow )); + } + printf("\n"); + } } return(EIO); } diff --git a/sys/scsi/scsi_all.h b/sys/scsi/scsi_all.h index 2a1b6a6..3f1c348 100644 --- a/sys/scsi/scsi_all.h +++ b/sys/scsi/scsi_all.h @@ -1,39 +1,7 @@ /* - * HISTORY - * $Log: scsi_all.h,v $ - * Revision 1.4 93/08/05 21:37:37 julian - * fix the definitionof the last byte of each scsi command. - * - * Revision 1.3 93/08/01 02:39:21 julian - * compiles.. no mode bitfields - * - * Revision 1.2 93/07/31 22:52:26 julian - * removed all bitfields - * - * Revision 1.1 93/04/12 21:51:01 root - * checkin for 'jules' - * - * Revision 1.2 1992/11/20 23:07:13 julian - * add a definition for device type T_NODEVICE - * - * Revision 1.1 1992/09/26 22:14:02 julian - * Initial revision - * - * - * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE - * -------------------- ----- ---------------------- - * CURRENT PATCH LEVEL: 1 00098 - * -------------------- ----- ---------------------- - * - * 16 Feb 93 Julian Elischer ADDED for SCSI system - * - */ - -/* * SCSI general interface description */ - /* * Largely written by Julian Elischer (julian@tfs.com) * for TRW Financial Systems. @@ -48,10 +16,9 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - */ - -/* * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 + * + * $Id$ */ /* diff --git a/sys/scsi/scsi_cd.h b/sys/scsi/scsi_cd.h index b5758c8..eb9bfac 100644 --- a/sys/scsi/scsi_cd.h +++ b/sys/scsi/scsi_cd.h @@ -12,20 +12,11 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * + * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 * - * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE - * -------------------- ----- ---------------------- - * CURRENT PATCH LEVEL: 1 00098 - * -------------------- ----- ---------------------- - * - * 16 Feb 93 Julian Elischer ADDED for SCSI system + * $Id$ */ - - -/* - * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 - */ /* * Define two bits always in the same place in byte 2 (flag byte) */ diff --git a/sys/scsi/scsi_changer.h b/sys/scsi/scsi_changer.h index 172f9c3..4cadd32 100644 --- a/sys/scsi/scsi_changer.h +++ b/sys/scsi/scsi_changer.h @@ -1,16 +1,4 @@ /* - * HISTORY - * - * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE - * -------------------- ----- ---------------------- - * CURRENT PATCH LEVEL: 1 00098 - * -------------------- ----- ---------------------- - * - * 16 Feb 93 Julian Elischer ADDED for SCSI system - * - */ - -/* * SCSI changer interface description */ @@ -29,10 +17,9 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - */ - -/* * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 + * + * $Id$ */ /* diff --git a/sys/scsi/scsi_disk.h b/sys/scsi/scsi_disk.h index 38e53c5..a4eebf5 100644 --- a/sys/scsi/scsi_disk.h +++ b/sys/scsi/scsi_disk.h @@ -1,32 +1,4 @@ /* - * HISTORY - * $Log: scsi_disk.h,v $ - * Revision 1.3 93/08/05 21:38:11 julian - * fix the definitionof the last byte of each scsi command. - * - * Revision 1.2 93/07/31 22:52:42 julian - * removed all bitfields - * - * Revision 1.1 93/04/12 21:51:04 root - * checkin for 'jules' - * - * Revision 1.2 1992/10/13 03:14:21 julian - * added the load-eject field in 'start/stop' for removable devices. - * - * Revision 1.1 1992/09/26 22:11:29 julian - * Initial revision - * - * - * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE - * -------------------- ----- ---------------------- - * CURRENT PATCH LEVEL: 1 00098 - * -------------------- ----- ---------------------- - * - * 16 Feb 93 Julian Elischer ADDED for SCSI system - * - */ - -/* * SCSI interface description */ @@ -72,10 +44,9 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - */ - -/* * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 + * + * $Id$ */ /* diff --git a/sys/scsi/scsi_tape.h b/sys/scsi/scsi_tape.h index e43aa83..96d14a6 100644 --- a/sys/scsi/scsi_tape.h +++ b/sys/scsi/scsi_tape.h @@ -1,38 +1,4 @@ /* - * HISTORY - * $Log: scsi_tape.h,v $ - * Revision 1.5 93/08/05 21:38:14 julian - * fix the definitionof the last byte of each scsi command. - * - * Revision 1.4 93/08/01 02:39:40 julian - * compiles.. no mode bitfields - * - * Revision 1.3 93/07/31 23:05:40 root - * removed all bitfields - * - * Revision 1.2 93/05/10 23:57:23 root - * added some special stuff for some OLD scsi tapes (CIPHER ST150S) - * - * Revision 1.1 93/04/12 21:51:06 root - * checkin for 'jules' - * - * Revision 1.2 1993/01/26 18:39:08 julian - * add the 'write protected' bit in the device status struct. - * - * Revision 1.1 1992/09/26 22:10:21 julian - * Initial revision - * - * - * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE - * -------------------- ----- ---------------------- - * CURRENT PATCH LEVEL: 1 00098 - * -------------------- ----- ---------------------- - * - * 16 Feb 93 Julian Elischer ADDED for SCSI system - * - */ - -/* * SCSI tape interface description */ @@ -50,21 +16,15 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - */ - -/* * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 + * + * $Id$ */ - - - - /* * SCSI command format */ - struct scsi_rw_tape { u_char op_code; diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c index 04aec86..f701805 100644 --- a/sys/scsi/scsiconf.c +++ b/sys/scsi/scsiconf.c @@ -12,23 +12,11 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * - * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE - * -------------------- ----- ---------------------- - * CURRENT PATCH LEVEL: 1 00098 - * -------------------- ----- ---------------------- - * - * 16 Feb 93 Julian Elischer ADDED for SCSI system - */ - -/* * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 + * + * $Id$ */ -/* -$Log: -* -*/ #include <sys/types.h> #include "st.h" #include "sd.h" @@ -136,6 +124,8 @@ knowndevs[] = { #if NCD > 0 { T_READONLY,T_REMOV,"SONY ","CD-ROM CDU-8012 " ,"3.1a",cdattach,"cd",SC_ONE_LU }, + { T_READONLY,T_REMOV,"PIONEER ","CD-ROM DRM-600 " + ,"any",cdattach,"cd",SC_MORE_LUS }, #endif NCD #if NBLL > 0 { T_PROCESSOR,T_FIXED,"AEG ","READER " @@ -198,6 +188,7 @@ struct scsi_switch *scsi_switch; predef = scsi_get_predef(scsibus ,targ ,lun + ,scsi_switch ,&maybe_more); bestmatch = scsi_probedev(unit ,targ @@ -254,8 +245,9 @@ struct scsi_switch *scsi_switch; * given a target and lu, check if there is a * * predefined device for that address * \***********************************************/ -struct predefined *scsi_get_predef(unit,target,lu,maybe_more) +struct predefined *scsi_get_predef(unit,target,lu,scsi_switch,maybe_more) int unit,target,lu,*maybe_more; +struct scsi_switch *scsi_switch; { int upto,numents; @@ -270,7 +262,9 @@ int unit,target,lu,*maybe_more; if(pd[upto].lu != lu) continue; - printf(" dev%d,lu%d: %s - PRECONFIGURED -\n" + printf("%s%d targ %d lun %d: <%s> - PRECONFIGURED -\n" + ,scsi_switch->name + ,unit ,target ,lu ,pd[upto].devname); @@ -455,17 +449,30 @@ int *maybe_more; strncpy(model,"unknown",16); strncpy(version,"????",4); } - printf(" dev%d,lu%d: type %d:%d(%s%s),%s '%s%s%s' scsi%d\n" + printf("%s%d targ %d lun %d: type %d(%s) %s <%s%s%s> SCSI%d\n" + ,scsi_switch->name + ,unit ,target ,lu - ,qualifier,type - ,dtype,qtype + ,type + ,dtype ,remov?"removable":"fixed" ,manu ,model ,version ,inqbuf.version & SID_ANSII ); + if(qtype[0]) + { + printf("%s%d targ %d lun %d: qulaifier %d(%s)\n" + ,scsi_switch->name + ,unit + ,target + ,lu + ,qualifier + ,qtype + ); + } /***********************************************\ * Try make as good a match as possible with * * available sub drivers * diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h index c36efde..004787e 100644 --- a/sys/scsi/scsiconf.h +++ b/sys/scsi/scsiconf.h @@ -12,17 +12,9 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE - * -------------------- ----- ---------------------- - * CURRENT PATCH LEVEL: 1 00098 - * -------------------- ----- ---------------------- - * - * 16 Feb 93 Julian Elischer ADDED for SCSI system - * - */ - -/* * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 + * + * $Id$ */ /***********************************************\ @@ -32,6 +24,7 @@ \***********************************************/ struct scsi_switch { + char *name; /* name of scsi bus controller */ int (*scsi_cmd)(); void (*scsi_minphys)(); int (*open_target_lu)(); diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index af85d87..15d229b 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -12,19 +12,9 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE - * -------------------- ----- ---------------------- - * CURRENT PATCH LEVEL: 1 00098 - * -------------------- ----- ---------------------- - * - * 16 Feb 93 Julian Elischer ADDED for SCSI system - * - */ - -static char rev[] = "$Revision: 1.5 $"; - -/* * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 + * + * $Id$ */ #define SPLSD splbio @@ -181,14 +171,10 @@ struct scsi_switch *scsi_switch; * request must specify this. * \*******************************************************/ sd_get_parms(unit, SCSI_NOSLEEP | SCSI_NOMASK); - printf(" sd%d: %dMB, cyls %d, heads %d, secs %d, bytes/sec %d\n", + printf("sd%d: %dMB (%d total sec), %d cyl, %d head, %d sec, bytes/sec %d\n", unit, - ( dp->cyls - * dp->heads - * dp->sectors - * dp->secsiz - ) - / (1024 * 1024), + dp->disksize / ((1024L * 1024L) / dp->secsiz), + dp->disksize, dp->cyls, dp->heads, dp->sectors, @@ -822,7 +808,7 @@ unsigned char unit; } /*******************************************************\ - * all the generic bisklabel extraction routine * + * all the generic disklabel extraction routine * \*******************************************************/ if(errstring = readdisklabel(makedev(0 ,(unit<<UNITSHIFT )+3) , sdstrategy @@ -870,7 +856,7 @@ sd_size(unit, flags) 2000, flags) != 0) { - printf("could not get size of unit %d\n", unit); + printf("sd0%: could not get size\n", unit); return(0); } else { size = rdcap.addr_0 + 1 ; @@ -1016,7 +1002,7 @@ int sd_get_parms(unit, flags) 2000, flags) != 0) { - printf("could not mode sense (3) for unit %d\n", unit); + printf("sd%d: could not mode sense (3)\n", unit); return(ENXIO); } printf("unit %d: %d trk/zone, %d alt_sec/zone, %d alt_trk/zone, %d alt_trk/lun\n", @@ -1053,18 +1039,22 @@ int sd_get_parms(unit, flags) 2000, flags) != 0) { - printf("could not mode sense (4) for unit %d\n", unit); + printf("sd%d: could not mode sense (4)", unit); printf(" using ficticious geometry\n"); - /* use adaptec standard ficticious geometry */ + /* + * use adaptec standard ficticious geometry + * this depends on controllers and mode (ie, 1542C in + * extended bios translation is different + */ sectors = sd_size(unit, flags); disk_parms->heads = 64; disk_parms->sectors = 32; disk_parms->cyls = sectors/(64 * 32); disk_parms->secsiz = SECSIZE; + disk_parms->disksize = sectors; } else { - if (sd_debug) { printf(" %d cyls, %d heads, %d precomp, %d red_write, %d land_zone\n", @@ -1085,8 +1075,8 @@ int sd_get_parms(unit, flags) disk_parms->secsiz = _3btol(&scsi_sense.blk_desc.blklen); sectors = sd_size(unit, flags); - sectors /= disk_parms->cyls; - sectors /= disk_parms->heads; + disk_parms->disksize = sectors; + sectors /= (disk_parms->cyls * disk_parms->heads); disk_parms->sectors = sectors; /* dubious on SCSI*/ } @@ -1446,13 +1436,142 @@ sdsize(dev_t dev) return((int)sd->disklabel.d_partitions[part].p_size); } -sddump() +#ifdef SCSIDUMP +#include <vm/vm.h> +/***********************************************************************\ +* dump all of physical memory into the partition specified, starting * +* at offset 'dumplo' into the partition. * +\***********************************************************************/ +static struct scsi_xfer sx; +#define MAXTRANSFER 8 /* 1 page at a time */ +int +sddump(dev_t dev) /* dump core after a system crash */ { - printf("sddump() -- not implemented\n"); - return(-1); -} + register struct sd_data *sd; /* disk unit to do the IO */ + long num; /* number of sectors to write */ + int unit, part, sdc; + long blkoff, blknum, blkcnt; + long nblocks; + char *addr; + struct scsi_rw_big cmd; + extern int Maxmem; + static sddoingadump = 0 ; + extern caddr_t CADDR1; /* map the page we are about to write, here*/ + struct scsi_xfer *xs = &sx; + int retval; + + addr = (char *) 0; /* starting address */ + + /* toss any characters present prior to dump */ + while (sgetc(1)) + ; + + /* size of memory to dump */ + num = Maxmem; + unit = UNIT(dev); /* eventually support floppies? */ + part = PARTITION(dev); /* file system */ + /* check for acceptable drive number */ + if (unit >= NSD) return(ENXIO); /* 31 Jul 92*/ + + sd = sd_data+unit; + /* was it ever initialized etc. ? */ + if (!(sd->flags & SDINIT)) return (ENXIO); + if (sd->flags & SDVALID != SDVALID) return (ENXIO) ; + if (sd->flags & SDWRITEPROT) return (ENXIO); + /* Convert to disk sectors */ + num = (u_long) num * NBPG / sd->disklabel.d_secsize; + /* check if controller active */ + if (sddoingadump) return(EFAULT); + nblocks = sd->disklabel.d_partitions[part].p_size; + blkoff = sd->disklabel.d_partitions[part].p_offset; + /* check transfer bounds against partition size */ + if ((dumplo < 0) || ((dumplo + num) > nblocks)) + return(EINVAL); + + sddoingadump = 1 ; + + blknum = dumplo + blkoff; + while (num > 0) + { + if (blkcnt > MAXTRANSFER) blkcnt = MAXTRANSFER; + pmap_enter( kernel_pmap, + CADDR1, + trunc_page(addr), + VM_PROT_READ, + TRUE); +#ifndef NOT_TRUSTED + /*******************************************************\ + * Fill out the scsi command * + \*******************************************************/ + bzero(&cmd, sizeof(cmd)); + cmd.op_code = WRITE_BIG; + cmd.addr_3 = (blknum & 0xff000000) >> 24; + cmd.addr_2 = (blknum & 0xff0000) >> 16; + cmd.addr_1 = (blknum & 0xff00) >> 8; + cmd.addr_0 = blknum & 0xff; + cmd.length2 = (blkcnt & 0xff00) >> 8; + cmd.length1 = (blkcnt & 0xff); + /*******************************************************\ + * Fill out the scsi_xfer structure * + * Note: we cannot sleep as we may be an interrupt * + \*******************************************************/ + bzero(xs, sizeof(sx)); + xs->flags |= SCSI_NOMASK|SCSI_NOSLEEP|INUSE; + xs->adapter = sd->ctlr; + xs->targ = sd->targ; + xs->lu = sd->lu; + xs->retries = SD_RETRIES; + xs->timeout = 10000;/* 10000 millisecs for a disk !*/ + xs->cmd = (struct scsi_generic *)&cmd; + xs->cmdlen = sizeof(cmd); + xs->resid = blkcnt * 512; + xs->when_done = 0; + xs->done_arg = unit; + xs->done_arg2 = (int)xs; + xs->error = XS_NOERROR; + xs->bp = 0; + xs->data = (u_char *)CADDR1; + xs->datalen = blkcnt * 512; + /*******************************************************\ + * Pass all this info to the scsi driver. * + \*******************************************************/ + retval = (*(sd->sc_sw->scsi_cmd))(xs); + switch(retval) + { + case SUCCESSFULLY_QUEUED: + case HAD_ERROR: + return(ENXIO); /* we said not to sleep! */ + case COMPLETE: + break; + default: + return(ENXIO); /* we said not to sleep! */ + } +#else NOT_TRUSTED + printf ("sd%d: dump addr 0x%x, blk %d\n",unit,addr,blknum); +#endif + + if ((unsigned)addr % (1024*1024) == 0) printf("%d ", num/2048) ; + /* update block count */ + num -= MAXTRANSFER; + blknum += MAXTRANSFER ; + (int) addr += 512 * MAXTRANSFER; + + /* operator aborting dump? */ + if (sgetc(1)) + return(EINTR); + } + return(0); +} +#else /* No SCSIDUMP CODE */ +sddump() +{ + printf("\nsddump() -- not implemented\n"); + DELAY(20000000); /* 100 seconds */ + return(-1); +} +#endif diff --git a/sys/scsi/st.c b/sys/scsi/st.c index 5b9e8ea..e355967 100644 --- a/sys/scsi/st.c +++ b/sys/scsi/st.c @@ -12,21 +12,12 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * - * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE - * -------------------- ----- ---------------------- - * CURRENT PATCH LEVEL: 1 00098 - * -------------------- ----- ---------------------- - * - * 16 Feb 93 Julian Elischer ADDED for SCSI system - */ - -/* * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 * major changes by Julian Elischer (julian@jules.dialix.oz.au) May 1993 + * + * $Id$ */ - /* * To do: * work out some better way of guessing what a good timeout is going @@ -247,17 +238,17 @@ struct scsi_switch *scsi_switch; { if(st_test_ready(unit,SCSI_NOSLEEP | SCSI_NOMASK | SCSI_SILENT)) { - printf("\tst%d: tape present: %d blocks of %d bytes\n", + printf("st%d: tape present: %d blocks of %d bytes\n", unit, st->numblks, st->media_blksiz); } else { - printf("\tst%d: drive empty\n", unit); + printf("st%d: drive empty\n", unit); } } else { - printf("\tst%d: drive offline\n", unit); + printf("st%d: drive offline\n", unit); } /*******************************************************\ * Set up the bufs for this device * @@ -308,7 +299,7 @@ int unit; if (scsi_inquire(st->ctlr, st->targ, st->lu, st->sc_sw, &inqbuf, SCSI_NOSLEEP | SCSI_NOMASK | SCSI_SILENT) != COMPLETE) { - printf(" st%d: couldn't get device type, using default\n", unit); + printf("st%d: couldn't get device type, using default\n", unit); return; } if((inqbuf.version & SID_ANSII) == 0) @@ -346,7 +337,7 @@ int unit; if ((strcmp(manu, finger->manu) == 0 ) && (strcmp(model2, finger->model) == 0 )) { - printf(" st%d: %s is a known rogue\n", unit,finger->name); + printf("st%d: %s is a known rogue\n", unit,finger->name); st->modes[0] = finger->modes[0]; st->modes[1] = finger->modes[1]; st->modes[2] = finger->modes[2]; @@ -426,12 +417,12 @@ stopen(dev) #endif if(!(st_test_ready(unit,0))) { - printf("st%d not ready\n",unit); + printf("st%d: not ready\n",unit); return(EIO); } if(!(st_test_ready(unit,0))) /* first may get 'unit attn' */ { - printf("st%d not ready\n",unit); + printf("st%d: not ready\n",unit); return(EIO); } @@ -1113,7 +1104,7 @@ struct scsi_xfer *xs; { /* don't wake the job, ok? */ return; } - printf("device busy"); + printf("st%d: device busy\n", unit); xs->flags |= ITSDONE; } @@ -1219,7 +1210,8 @@ caddr_t arg; } else { - printf("rewind failed, unit still loaded\n"); + printf("st%d: rewind failed, unit still loaded\n", + unit); } break; case MTNOP: /* no operation, sets status only */ @@ -1399,7 +1391,7 @@ int unit,flags; flags | SCSI_DATA_IN) != 0) { if(!(flags & SCSI_SILENT)) - printf("could not get blk limits for unit %d\n", unit); + printf("st%d: could not get blk limits\n", unit); st->flags &= ~ST_INFO_VALID; return(FALSE); } @@ -1489,7 +1481,7 @@ int unit,flags; flags | SCSI_DATA_IN) != 0) { if(!(flags & SCSI_SILENT)) - printf("could not mode sense for unit %d\n", unit); + printf("st%d: could not mode sense\n", unit); st->flags &= ~ST_INFO_VALID; return(FALSE); } @@ -1589,7 +1581,7 @@ int unit,flags,dsty_code; flags | SCSI_DATA_OUT) != 0) { if(!(flags & SCSI_SILENT)) - printf("could not mode select for unit %d\n", unit); + printf("st%d: could not mode select\n", unit); st->flags &= ~ST_INFO_VALID; return(FALSE); } @@ -1619,7 +1611,7 @@ int unit,number,what,flags; flags) != 0) { if(!(flags & SCSI_SILENT)) - printf("could not space st%d\n", unit); + printf("st%d: could not space\n", unit); st_data[unit].flags &= ~ST_INFO_VALID; return(FALSE); } @@ -1646,7 +1638,7 @@ int unit,number,flags; flags) != 0) { if(!(flags & SCSI_SILENT)) - printf("could not write_filemarks st%d\n", unit); + printf("st%d: could not write_filemarks\n", unit); st_data[unit].flags &= ~ST_INFO_VALID; return(FALSE); } @@ -1703,7 +1695,7 @@ int unit,type,flags; flags) != 0) { if(!(flags & SCSI_SILENT)) - printf("cannot prevent/allow on st%d\n", unit); + printf("st%d: cannot prevent/allow\n", unit); st_data[unit].flags &= ~ST_INFO_VALID; return(FALSE); } @@ -1730,7 +1722,7 @@ int unit,immed,flags; flags) != 0) { if(!(flags & SCSI_SILENT)) - printf("could not rewind st%d\n", unit); + printf("st%d: could not rewind\n", unit); st_data[unit].flags &= ~ST_INFO_VALID; return(FALSE); } @@ -1965,7 +1957,7 @@ struct scsi_xfer *xs; } else { /* makes no sense.. complain */ - printf("BAD length error?"); + printf("st%d: BAD length error?\n", unit); } }/* there may be some other error. check the rest */ @@ -1982,22 +1974,19 @@ struct scsi_xfer *xs; printf("st%d: soft error(corrected) ", unit); if(sense->error_code & SSD_ERRCODE_VALID) { - printf("block no. %d (decimal)\n", + printf("block no. %d (decimal)", (sense->ext.extended.info[0] <<24)| (sense->ext.extended.info[1] <<16)| (sense->ext.extended.info[2] <<8)| (sense->ext.extended.info[3] )); } - else - { - printf("\n"); - } + printf("\n"); } if(!(sense->ext.extended.flags & SSD_ILI)) xs->resid = 0; /* XXX check this */ return(ESUCCESS); case 0x2: - if(!silent) printf("st%d: not ready\n ", unit); + if(!silent) printf("st%d: not ready\n", unit); return(ENODEV); case 0x3: if(!silent) @@ -2005,27 +1994,24 @@ struct scsi_xfer *xs; printf("st%d: medium error ", unit); if(sense->error_code & SSD_ERRCODE_VALID) { - printf("block no. %d (decimal)\n", + printf("block no. %d (decimal)", (sense->ext.extended.info[0] <<24)| (sense->ext.extended.info[1] <<16)| (sense->ext.extended.info[2] <<8)| (sense->ext.extended.info[3] )); } - else - { - printf("\n"); - } + printf("\n"); } return(EIO); case 0x4: - if(!silent) printf("st%d: non-media hardware failure\n ", + if(!silent) printf("st%d: non-media hardware failure\n", unit); return(EIO); case 0x5: - if(!silent) printf("st%d: illegal request\n ", unit); + if(!silent) printf("st%d: illegal request\n", unit); return(EINVAL); case 0x6: - if(!silent) printf("st%d: Unit attention.\n ", unit); + if(!silent) printf("st%d: Unit attention.\n", unit); st_data[unit].flags &= ~(ST_AT_FILEMARK|ST_AT_EOM); st_data[unit].flags &= ~ST_INFO_VALID; if (st_data[unit].flags & ST_OPEN) /* TEMP!!!! */ @@ -2035,96 +2021,79 @@ struct scsi_xfer *xs; case 0x7: if(!silent) { - printf("st%d: attempted protection violation " - , unit); + printf("st%d: attempted protection violation", + unit); if(sense->error_code & SSD_ERRCODE_VALID) { - printf("block no. %d (decimal)\n", + printf(" block no. %d (decimal)", (sense->ext.extended.info[0] <<24)| (sense->ext.extended.info[1] <<16)| (sense->ext.extended.info[2] <<8)| (sense->ext.extended.info[3] )); } - else - { - printf("\n"); - } + printf("\n"); } return(EACCES); case 0x8: if(!silent) { - printf("st%d: fixed block wrong size \n " - , unit); + printf("st%d: fixed block wrong size", + unit); if(sense->error_code & SSD_ERRCODE_VALID) { - printf("requested size: %d (decimal)\n", + printf(" requested size: %d (decimal)", (sense->ext.extended.info[0] <<24)| (sense->ext.extended.info[1] <<16)| (sense->ext.extended.info[2] <<8)| (sense->ext.extended.info[3] )); } - else - { - printf("\n"); - } + printf("\n"); } return(EIO); case 0x9: - if(!silent) printf("st%d: vendor unique\n", - unit); + if(!silent) printf("st%d: vendor unique\n", unit); return(EIO); case 0xa: - if(!silent) printf("st%d: copy aborted\n ", - unit); + if(!silent) printf("st%d: copy aborted\n", unit); return(EIO); case 0xb: - if(!silent) printf("st%d: command aborted\n ", - unit); + if(!silent) printf("st%d: command aborted\n", unit); return(EIO); case 0xc: if(!silent) { - printf("st%d: search returned\n ", unit); + printf("st%d: search returned", unit); if(sense->error_code & SSD_ERRCODE_VALID) { - printf("block no. %d (decimal)\n", + printf(" block no. %d (decimal)", (sense->ext.extended.info[0] <<24)| (sense->ext.extended.info[1] <<16)| (sense->ext.extended.info[2] <<8)| (sense->ext.extended.info[3] )); } - else - { - printf("\n"); - } + printf("\n"); } return(ESUCCESS); case 0xd: - if(!silent) printf("st%d: volume overflow\n ", - unit); + if(!silent) printf("st%d: volume overflow\n ", unit); return(ENOSPC); case 0xe: if(!silent) { - printf("st%d: verify miscompare\n ", unit); + printf("st%d: verify miscompare", unit); if(sense->error_code & SSD_ERRCODE_VALID) { - printf("block no. %d (decimal)\n", + printf(" block no. %d (decimal)", (sense->ext.extended.info[0] <<24)| (sense->ext.extended.info[1] <<16)| (sense->ext.extended.info[2] <<8)| (sense->ext.extended.info[3] )); } - else - { - printf("\n"); - } + printf("\n"); } return(EIO); case 0xf: - if(!silent) printf("st%d: unknown error key\n ", - unit); + if(!silent) printf("st%d: unknown error key\n", unit); return(EIO); } break; @@ -2134,14 +2103,20 @@ struct scsi_xfer *xs; \***************************************************************/ default: { - if(!silent) printf("st%d: error code %d\n", + if(!silent) printf("st%d: error code %d", unit, sense->error_code & SSD_ERRCODE); - if(sense->error_code & SSD_ERRCODE_VALID) - if(!silent) printf("block no. %d (decimal)\n", - (sense->ext.unextended.blockhi <<16), - + (sense->ext.unextended.blockmed <<8), - + (sense->ext.unextended.blocklow )); + if(sense->error_code & SSD_ERRCODE_VALID) + { + if(!silent) + { + printf(" block no. %d (decimal)", + (sense->ext.unextended.blockhi <<16), + + (sense->ext.unextended.blockmed <<8), + + (sense->ext.unextended.blocklow )); + } + printf("\n"); + } } return(EIO); } |