From 296cbdb15b09515dfc612222bf6353b843955f99 Mon Sep 17 00:00:00 2001 From: "Rodney W. Grimes" Date: Sat, 21 Aug 1993 20:01:59 +0000 Subject: [PATCH] Fixed printf's so that they announce them selfs correctly (ie aha%d: before every error message and every probe message). --- sys/i386/eisa/aha1742.c | 34 +++----- sys/i386/isa/aha1542.c | 105 ++++++---------------- sys/i386/isa/aha1742.c | 34 +++----- sys/i386/isa/bt742a.c | 110 +++++------------------ sys/i386/isa/ultra14f.c | 37 +++----- sys/scsi/README | 7 -- sys/scsi/cd.c | 103 ++++++++++------------ sys/scsi/ch.c | 140 ++++++++++++------------------ sys/scsi/scsi_all.h | 37 +------- sys/scsi/scsi_cd.h | 15 +--- sys/scsi/scsi_changer.h | 17 +--- sys/scsi/scsi_disk.h | 33 +------ sys/scsi/scsi_tape.h | 44 +--------- sys/scsi/scsiconf.c | 45 ++++++---- sys/scsi/scsiconf.h | 13 +-- sys/scsi/sd.c | 187 ++++++++++++++++++++++++++++++++-------- sys/scsi/st.c | 143 +++++++++++++----------------- 17 files changed, 445 insertions(+), 659 deletions(-) diff --git a/sys/i386/eisa/aha1742.c b/sys/i386/eisa/aha1742.c index b4e4d98fac1c..cba9260bea1b 100644 --- a/sys/i386/eisa/aha1742.c +++ b/sys/i386/eisa/aha1742.c @@ -12,14 +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 * commenced: Sun Sep 27 18:14:01 PDT 1992 + * + * $Id$ */ #include @@ -329,6 +324,7 @@ int ahb_debug = 0; struct scsi_switch ahb_switch = { + "ahb", ahb_scsi_cmd, ahbminphys, 0, @@ -516,7 +512,6 @@ struct isa_dev *dev; #ifdef __386BSD__ /* 386BSD */ dev->id_irq = (1 << ahb_data[unit].vect); dev->id_drq = -1; /* use EISA dma */ - printf("\n **"); #endif __386BSD__ ahb_unit++; @@ -531,11 +526,6 @@ struct isa_dev *dev; { int unit = dev->dev_unit; - -#ifdef __386BSD__ - printf(" probing for scsi devices**\n"); -#endif __386BSD__ - /***********************************************\ * ask the adapter what subunits are present * \***********************************************/ @@ -543,9 +533,6 @@ struct isa_dev *dev; #if defined(OSF) ahb_attached[unit]=1; #endif /* defined(OSF) */ -#ifdef __386BSD__ - printf("ahb%d",unit); -#endif __386BSD__ return; } @@ -621,9 +608,13 @@ ahbintr(unit) ahb_data[unit].immed_ecb = 0; break; case AHB_ASN: /* for target mode */ + printf("ahb%d: Unexpected ASN interrupt(%x)\n", + unit, mboxval); ecb = 0; break; case AHB_HW_ERR: + printf("ahb%d: Hardware error interrupt(%x)\n", + unit, mboxval); ecb = 0; break; case AHB_ECB_RECOVERED: @@ -876,8 +867,8 @@ int unit; * level * \***********************************************/ #ifdef __386BSD__ - printf("ahb%d reading board settings, ",unit); -#define PRNT(x) + printf("ahb%d: reading board settings, ",unit); +#define PRNT(x) printf(x) #else __386BSD__ printf("ahb%d:",unit); #define PRNT(x) printf(x) @@ -914,6 +905,9 @@ int unit; printf("illegal int setting\n"); return(EIO); } +#ifdef __386BSD__ + printf("\n"); +#endif __386BSD__ outb(port + INTDEF ,(intdef | INTEN)); /* make sure we can interrupt */ /* who are we on the scsi bus */ ahb_data[unit].our_id = (inb(port + SCSIDEF) & HSCSIID); @@ -988,12 +982,12 @@ struct scsi_xfer *xs; if(xs->bp) flags |= (SCSI_NOSLEEP); /* just to be sure */ if(flags & ITSDONE) { - printf("Already done?"); + printf("ahb%d: Already done?",unit); xs->flags &= ~ITSDONE; } if(!(flags & INUSE)) { - printf("Not in use?"); + printf("ahb%d: Not in use?",unit); xs->flags |= INUSE; } if (!(ecb = ahb_get_ecb(unit,flags))) diff --git a/sys/i386/isa/aha1542.c b/sys/i386/isa/aha1542.c index b5107393e946..9678e3e40560 100644 --- a/sys/i386/isa/aha1542.c +++ b/sys/i386/isa/aha1542.c @@ -12,57 +12,13 @@ * 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 + * $Id$ */ /* * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 */ -/* - * HISTORY - * $Log: aha1542.c,v $ - * Revision 1.4 93/08/07 13:17:25 julian - * replaced private timeout stuff with system timeout calls - * - * Revision 1.3 93/05/22 16:51:18 root - * set up dev->dev_pic before it's needed for OSF - * - * Revision 1.2 93/05/07 11:40:27 root - * fixed SLEEPTIME calculation - * - * Revision 1.1 93/05/07 11:14:03 root - * Initial revision - * - * Revision 1.6 1992/08/24 21:01:58 jason - * many changes and bugfixes for osf1 - * - * Revision 1.5 1992/07/31 01:22:03 julian - * support improved scsi.h layout - * - * Revision 1.4 1992/07/25 03:11:26 julian - * check each request fro sane flags. - * - * Revision 1.3 1992/07/24 00:52:45 julian - * improved timeout handling. - * added support for two arguments to the sd_done (or equiv) call so that - * they can pre-queue several arguments. - * slightly clean up error handling - * - * Revision 1.2 1992/07/17 22:03:54 julian - * upgraded the timeout code. - * added support for UIO-based i/o (as used for pmem operations) - * - * Revision 1.1 1992/05/27 00:51:12 balsup - * machkern/cor merge - */ - /* * a FEW lines in this driver come from a MACH adaptec-disk driver * so the copyright below is included: @@ -420,6 +376,7 @@ long int aha_adapter_info(); struct scsi_switch aha_switch = { + "aha", aha_scsi_cmd, ahaminphys, 0, @@ -484,7 +441,8 @@ u_char args; } if (!i) { - printf("aha_cmd: aha1542 host not idle(0x%x)\n",sts); + printf("aha%d: aha_cmd, host not idle(0x%x)\n", + unit,sts); return(ENXIO); } } @@ -514,7 +472,7 @@ u_char args; } if (i >= wait) { - printf("aha_cmd: aha1542 cmd/data port full\n"); + printf("aha%d: aha_cmd, cmd/data port full\n",unit); outb(AHA_CTRL_STAT_PORT, AHA_SRST); return(ENXIO); } @@ -535,7 +493,8 @@ u_char args; } if (i >= wait) { - printf("aha_cmd: aha1542 cmd/data port empty %d\n",ocnt); + printf("aha%d: aha_cmd, cmd/data port empty %d\n", + unit,ocnt); return(ENXIO); } oc = inb(AHA_CMD_DATA_PORT); @@ -556,7 +515,7 @@ u_char args; } if (!i) { - printf("aha_cmd: aha1542 host not finished(0x%x)\n",sts); + printf("aha%d: aha_cmd, host not finished(0x%x)\n",unit,sts); return(ENXIO); } outb(AHA_CTRL_STAT_PORT, AHA_IRST); @@ -587,7 +546,7 @@ struct isa_dev *dev; aha_base[unit] = dev->dev_addr; if(unit >= NAHA) { - printf("aha: unit number (%d) too high\n",unit); + printf("aha%d: unit number too high\n",unit); return(0); } /***********************************************\ @@ -630,11 +589,8 @@ struct isa_dev *dev; else panic("Unable to add aha interrupt handler"); #endif /* !defined(OSF) */ -#ifdef __386BSD__ - printf("\n **"); -#else __386BSD__ - printf("port=%x spl=%d\n", - dev->dev_addr, dev->dev_spl); +#ifndef __386BSD__ + printf("port=%x spl=%d\n", dev->dev_addr, dev->dev_spl); #endif __386BSD__ ahaunit ++; return(1); @@ -648,9 +604,6 @@ struct isa_dev *dev; { int unit = dev->dev_unit; -#ifdef __386BSD__ - printf(" probing for scsi devices**\n"); -#endif __386BSD__ /***********************************************\ * ask the adapter what subunits are present * \***********************************************/ @@ -658,14 +611,9 @@ struct isa_dev *dev; #if defined(OSF) aha_attached[unit]=1; #endif /* defined(OSF) */ -#ifdef __386BSD__ - printf("aha%d",unit); -#endif __386BSD__ return; - } - /***********************************************\ * Return some information to the caller about * * the adapter and it's capabilities * @@ -860,7 +808,7 @@ struct aha_ccb *ccb; \***********************************************/ if(!(xs->flags & INUSE)) { - printf("exiting but not in use! "); + printf("aha%d: exiting but not in use!\n",unit); Debugger(); } if ( ( ccb->host_stat != AHA_OK @@ -964,12 +912,13 @@ int unit; * level * \***********************************************/ #ifdef __386BSD__ - printf("aha%d reading board settings, ",unit); -#define PRNT(x) + printf("aha%d: reading board settings, ",unit); +#define PRNT(x) printf(x) #else __386BSD__ printf("aha%d:",unit); #define PRNT(x) printf(x) #endif __386BSD__ + DELAY(1000); /* for Bustek 545 */ aha_cmd(unit,0, sizeof(conf), 0 ,&conf, AHA_CONF_GET); switch(conf.chan) { @@ -1129,13 +1078,13 @@ struct scsi_xfer *xs; flags = xs->flags; if(!(flags & INUSE)) { - printf("not in use!"); + printf("aha%d: not in use!\n",unit); Debugger(); xs->flags |= INUSE; } if(flags & ITSDONE) { - printf("Already done! check device retry code "); + printf("aha%d: Already done! check device retry code\n",unit); Debugger(); xs->flags &= ~ITSDONE; } @@ -1147,7 +1096,7 @@ struct scsi_xfer *xs; } if (ccb->mbx->cmd != AHA_MBO_FREE) - printf("MBO not free\n"); + printf("aha%d: MBO not free\n",unit); /***********************************************\ * Put all the arguments for the xfer in the ccb * @@ -1266,7 +1215,7 @@ struct scsi_xfer *xs; #endif /*AHADEBUG*/ if (datalen) { /* there's still data, must have run out of segs! */ - printf("aha_scsi_cmd%d: more than %d DMA segs\n", + printf("aha%d: aha_scsi_cmd, more than %d DMA segs\n", unit,AHA_NSEG); xs->error = XS_DRIVER_STUFFUP; aha_free_ccb(unit,ccb,flags); @@ -1358,7 +1307,7 @@ struct scsi_xfer *xs; if (!count) { if (!(xs->flags & SCSI_SILENT)) - printf("cmd fail\n"); + printf("aha%d: cmd fail\n",unit); aha_abortmbx(ccb->mbx); count = delaycount * 2000 / AHA_SCSI_TIMEOUT_FUDGE; while((!done) && count) @@ -1380,7 +1329,7 @@ struct scsi_xfer *xs; } if(!count) { - printf("abort failed in wait\n"); + printf("aha%d: abort failed in wait\n",unit); ccb->mbx->cmd = AHA_MBO_FREE; } aha_free_ccb(unit,ccb,flags); @@ -1431,7 +1380,7 @@ int unit; { speed++; } - printf("%d nSEC ok, use ",retval); + printf("%d nSEC ok, using ",retval); retval2 = aha_bus_speed_check(unit,speed); if(retval2 == HAD_ERROR) /* retval is slowest already */ { @@ -1440,12 +1389,12 @@ int unit; } if(retval2) { - printf("%d nSEC ",retval2); + printf("%d nSEC\n",retval2); return(retval2); } else { - printf(".. slower failed, abort.\n",retval); + printf(".. slower failed, abort\n",retval); return(0); } @@ -1530,8 +1479,7 @@ aha_timeout(struct aha_ccb *ccb) int s = splbio(); unit = ccb->xfer->adapter; - printf("aha%d: device %d timed out ",unit - ,ccb->xfer->targ); + printf("aha%d: device %d timed out ",unit ,ccb->xfer->targ); /***************************************\ * If The ccb's mbx is not free, then * @@ -1539,8 +1487,7 @@ aha_timeout(struct aha_ccb *ccb) \***************************************/ if(ccb->mbx->cmd != AHA_MBO_FREE) { - printf("aha%d not taking commands!\n" - ,unit); + printf("aha%d: not taking commands!\n",unit); Debugger(); } /***************************************\ diff --git a/sys/i386/isa/aha1742.c b/sys/i386/isa/aha1742.c index b4e4d98fac1c..cba9260bea1b 100644 --- a/sys/i386/isa/aha1742.c +++ b/sys/i386/isa/aha1742.c @@ -12,14 +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 * commenced: Sun Sep 27 18:14:01 PDT 1992 + * + * $Id$ */ #include @@ -329,6 +324,7 @@ int ahb_debug = 0; struct scsi_switch ahb_switch = { + "ahb", ahb_scsi_cmd, ahbminphys, 0, @@ -516,7 +512,6 @@ struct isa_dev *dev; #ifdef __386BSD__ /* 386BSD */ dev->id_irq = (1 << ahb_data[unit].vect); dev->id_drq = -1; /* use EISA dma */ - printf("\n **"); #endif __386BSD__ ahb_unit++; @@ -531,11 +526,6 @@ struct isa_dev *dev; { int unit = dev->dev_unit; - -#ifdef __386BSD__ - printf(" probing for scsi devices**\n"); -#endif __386BSD__ - /***********************************************\ * ask the adapter what subunits are present * \***********************************************/ @@ -543,9 +533,6 @@ struct isa_dev *dev; #if defined(OSF) ahb_attached[unit]=1; #endif /* defined(OSF) */ -#ifdef __386BSD__ - printf("ahb%d",unit); -#endif __386BSD__ return; } @@ -621,9 +608,13 @@ ahbintr(unit) ahb_data[unit].immed_ecb = 0; break; case AHB_ASN: /* for target mode */ + printf("ahb%d: Unexpected ASN interrupt(%x)\n", + unit, mboxval); ecb = 0; break; case AHB_HW_ERR: + printf("ahb%d: Hardware error interrupt(%x)\n", + unit, mboxval); ecb = 0; break; case AHB_ECB_RECOVERED: @@ -876,8 +867,8 @@ int unit; * level * \***********************************************/ #ifdef __386BSD__ - printf("ahb%d reading board settings, ",unit); -#define PRNT(x) + printf("ahb%d: reading board settings, ",unit); +#define PRNT(x) printf(x) #else __386BSD__ printf("ahb%d:",unit); #define PRNT(x) printf(x) @@ -914,6 +905,9 @@ int unit; printf("illegal int setting\n"); return(EIO); } +#ifdef __386BSD__ + printf("\n"); +#endif __386BSD__ outb(port + INTDEF ,(intdef | INTEN)); /* make sure we can interrupt */ /* who are we on the scsi bus */ ahb_data[unit].our_id = (inb(port + SCSIDEF) & HSCSIID); @@ -988,12 +982,12 @@ struct scsi_xfer *xs; if(xs->bp) flags |= (SCSI_NOSLEEP); /* just to be sure */ if(flags & ITSDONE) { - printf("Already done?"); + printf("ahb%d: Already done?",unit); xs->flags &= ~ITSDONE; } if(!(flags & INUSE)) { - printf("Not in use?"); + printf("ahb%d: Not in use?",unit); xs->flags |= INUSE; } if (!(ecb = ahb_get_ecb(unit,flags))) diff --git a/sys/i386/isa/bt742a.c b/sys/i386/isa/bt742a.c index d6d49fffd38b..2fc4d3c59358 100644 --- a/sys/i386/isa/bt742a.c +++ b/sys/i386/isa/bt742a.c @@ -12,68 +12,7 @@ * 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 - */ - -/* - * HISTORY - * $Log: bt742a.c,v $ - * Revision 1.12 93/08/07 13:20:44 julian - * replace private timeout stuff with system timeout calls. - * - * Revision 1.11 93/05/27 13:39:52 root - * Enable mail box round-robin scheme by new host adapter command appeared - * at FirmWare V3.31 ( This release is shipped without testing at V3.31 ) - * - * Revision 1.10 93/05/22 16:38:22 root - * under OSF, the dev_pic must be set up before it's used. - * was only done ifndef OSF. - * - * Revision 1.9 93/05/07 11:37:24 root - * fix SLEEPTIME calculation. - * - * Revision 1.8 93/05/07 11:27:00 root - * Merge with 1.7.1 - * - * Revision 1.7.1 1993/01/01 04:01:02 amurai - * Basically this modification fixes 'doesn't take command' issue - * that occured on FirmWare V3.30 - * - Using IN/OUT mail box as round-robin for reducing I/O bus cycle - * and interrupts. - * - Print out routine are ifdef'ed rather than just 'if (flags)' - * for perfomance. - * - * Revision 1.7 1992/08/24 22:40:16 jason - * BIG_DMA ifdef for 512 dma segments instead of 128 segments - * - * Revision 1.6 1992/08/24 21:01:58 jason - * many changes and bugfixes for osf1 - * - * Revision 1.5 1992/07/31 01:22:03 julian - * support improved scsi.h layout - * - * Revision 1.4 1992/07/25 03:11:26 julian - * check each request fro sane flags. - * - * Revision 1.3 1992/07/24 00:52:45 julian - * improved timeout handling. - * added support for two arguments to the sd_done (or equiv) call so that - * they can pre-queue several arguments. - * slightly clean up error handling - * - * Revision 1.2 1992/07/17 22:03:54 julian - * upgraded the timeout code. - * added support for UIO-based i/o (as used for pmem operations) - * - * Revision 1.1 1992/05/27 00:51:12 balsup - * machkern/cor merge - * + * $Id$ */ /* @@ -462,6 +401,7 @@ long int bt_adapter_info(); struct scsi_switch bt_switch = { + "bt", bt_scsi_cmd, btminphys, 0, @@ -524,7 +464,7 @@ u_char args; } if (!i) { - printf("bt_cmd: bt742a host not idle(0x%x)\n",sts); + printf("bt%d: bt_cmd, host not idle(0x%x)\n",unit,sts); return(ENXIO); } } @@ -554,7 +494,7 @@ u_char args; } if (i >= wait) { - printf("bt_cmd: bt742a cmd/data port full\n"); + printf("bt%d: bt_cmd, cmd/data port full\n",unit); outb(BT_CTRL_STAT_PORT, BT_SRST); return(ENXIO); } @@ -575,7 +515,8 @@ u_char args; } if (i >= wait) { - printf("bt_cmd: bt742a cmd/data port empty %d\n",ocnt); + printf("bt%d: bt_cmd, cmd/data port empty %d\n", + unit,ocnt); return(ENXIO); } oc = inb(BT_CMD_DATA_PORT); @@ -596,7 +537,7 @@ u_char args; } if (!i) { - printf("bt_cmd: bt742a host not finished(0x%x)\n",sts); + printf("bt%d: bt_cmd, host not finished(0x%x)\n",unit,sts); return(ENXIO); } outb(BT_CTRL_STAT_PORT, BT_IRST); @@ -627,7 +568,7 @@ struct isa_dev *dev; bt_base[unit] = dev->dev_addr; if(unit >= NBT) { - printf("bt: unit number (%d) too high\n",unit); + printf("bt%d: unit number too high\n",unit); return(0); } /***********************************************\ @@ -664,7 +605,6 @@ struct isa_dev *dev; #ifdef __386BSD__ /* 386BSD */ dev->id_irq = (1 << bt_int[unit]); dev->id_drq = bt_dma[unit]; - printf("\n **"); #endif __386BSD__ btunit++; @@ -680,10 +620,6 @@ struct isa_dev *dev; int unit = dev->dev_unit; -#ifdef __386BSD__ - printf(" probing for scsi devices**\n"); -#endif __386BSD__ - /***********************************************\ * ask the adapter what subunits are present * \***********************************************/ @@ -691,9 +627,6 @@ struct isa_dev *dev; #if defined(OSF) bt_attached[unit]=1; #endif /* defined(OSF) */ -#ifdef __386BSD__ - printf("bt%d",unit); -#endif __386BSD__ return; } @@ -732,7 +665,7 @@ btintr(unit) /* Mail Box out empty ? */ if ( stat & BT_MBOA ) { - printf("Available Free mbo post\n"); + printf("bt%d: Available Free mbo post\n",unit); /* Disable MBO available interrupt */ outb(BT_CMD_DATA_PORT,BT_MBO_INTR_EN); wait = BT_CMD_TIMEOUT_FUDGE * delaycount; @@ -743,7 +676,7 @@ btintr(unit) } if (i >= wait) { - printf("bt_intr: bt742a cmd/data port full\n"); + printf("bt%d: bt_intr, cmd/data port full\n",unit); outb(BT_CTRL_STAT_PORT, BT_SRST); return 1; } @@ -831,7 +764,7 @@ AGAIN: bt_nextmbx( wmbi, wmbx, mbi ); } if ( !found ) { - printf("bt%02d: mbi at 0x%08x should be found, stat=%02x..resync\n", + printf("bt%d: mbi at 0x%08x should be found, stat=%02x..resync\n", unit, wmbi, stat ); } else { found = 0; @@ -968,7 +901,7 @@ BT_MBO *bt_send_mbo( int unit, } if (i >= wait) { - printf("bt_send_mbo: bt742a cmd/data port full\n"); + printf("bt%d: bt_send_mbo, cmd/data port full\n",unit); outb(BT_CTRL_STAT_PORT, BT_SRST); return( (BT_MBO *)0 ); } @@ -1114,7 +1047,7 @@ int unit; * level * \***********************************************/ #ifdef __386BSD__ - printf("bt%d board settings,",unit); + printf("bt%d reading board settings, ",unit); #define PRNT(x) printf(x) #else __386BSD__ printf("bt%d:",unit); @@ -1205,7 +1138,8 @@ int unit; * Initilize Mail Box stat to Free * \***********************************************/ if ( bt_ccb_free[unit] != (struct bt_ccb *)0 ) { - printf("bt_ccb_free is NOT initialized but init here\n "); + printf("bt%d: bt_ccb_free is NOT initialized but init here\n", + unit); bt_ccb_free[unit] = (struct bt_ccb *)0; } for (i=0; i < BT_CCB_SIZE; i++) { @@ -1330,12 +1264,12 @@ struct scsi_xfer *xs; if(xs->bp) flags |= (SCSI_NOSLEEP); /* just to be sure */ if(flags & ITSDONE) { - printf("Already done?"); + printf("bt%d: Already done?\n",unit); xs->flags &= ~ITSDONE; } if(!(flags & INUSE)) { - printf("Not in use?"); + printf("bt%d: Not in use?\n",unit); xs->flags |= INUSE; } if (!(ccb = bt_get_ccb(unit,flags))) @@ -1465,7 +1399,7 @@ struct scsi_xfer *xs; #endif if (datalen) { /* there's still data, must have run out of segs! */ - printf("bt_scsi_cmd%d: more than %d DMA segs\n", + printf("bt%d: bt_scsi_cmd, more than %d DMA segs\n", unit,BT_NSEG); xs->error = XS_DRIVER_STUFFUP; bt_free_ccb(unit,ccb,flags); @@ -1610,7 +1544,7 @@ bt_timeout(struct bt_ccb *ccb) int s = splbio(); unit = ccb->xfer->adapter; - printf("bt%d:%d device timed out\n",unit + printf("bt%d: %d device timed out\n",unit ,ccb->xfer->targ); #ifdef UTEST if(bt_debug & BT_SHOWCCBS) @@ -1624,7 +1558,7 @@ bt_timeout(struct bt_ccb *ccb) if((struct bt_ccb *)PHYSTOKV(ccb->mbx->ccb_addr)==ccb && ccb->mbx->cmd != BT_MBO_FREE ) { - printf("bt%d not taking commands!\n" + printf("bt%d: not taking commands!\n" ,unit); Debugger(); } @@ -1635,14 +1569,14 @@ bt_timeout(struct bt_ccb *ccb) \***************************************/ if(ccb->flags == CCB_ABORTED) /* abort timed out */ { - printf("Abort Operation has timed out.\n"); + printf("bt%d: Abort Operation has timed out\n",unit); ccb->xfer->retries = 0; /* I MEAN IT ! */ ccb->host_stat = BT_ABORTED; bt_done(unit,ccb); } else /* abort the operation that has timed out */ { - printf("Try to abort\n"); + printf("bt%d: Try to abort\n",unit); bt_send_mbo( unit, ~SCSI_NOMASK, BT_MBO_ABORT, ccb ); /* 2 secs for the abort */ diff --git a/sys/i386/isa/ultra14f.c b/sys/i386/isa/ultra14f.c index 17807436f20a..13c93f603f91 100644 --- a/sys/i386/isa/ultra14f.c +++ b/sys/i386/isa/ultra14f.c @@ -15,15 +15,10 @@ * 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 * commenced: Sun Sep 27 18:14:01 PDT 1992 * slight mod to make work with 34F as well: Wed Jun 2 18:05:48 WST 1993 + * + * $Id$ */ #include @@ -302,6 +297,7 @@ int uha_debug = 0; struct scsi_switch uha_switch = { + "uha", uha_scsi_cmd, uhaminphys, 0, @@ -396,7 +392,7 @@ retry: } if ((int)cheat != PHYSTOKV(inl(port + UHA_ICM0))) { - printf("discarding %x ",inl(port + UHA_ICM0)); + printf("uha%d: discarding %x\n",unit,inl(port + UHA_ICM0)); outb(port + UHA_SINT, UHA_ICM_ACK); spinwait(50); goto retry; @@ -419,7 +415,7 @@ struct isa_dev *dev; uha_data[unit].baseport = dev->dev_addr; if(unit >= NUHA) { - printf("uha: unit number (%d) too high\n",unit); + printf("uha%d: unit number too high\n",unit); return(0); } @@ -448,10 +444,6 @@ struct isa_dev *dev; int unit = dev->dev_unit; -#ifdef __386BSD__ - printf(" probing for scsi devices**\n"); -#endif __386BSD__ - /***********************************************\ * ask the adapter what subunits are present * \***********************************************/ @@ -460,10 +452,6 @@ struct isa_dev *dev; #if defined(OSF) uha_attached[unit]=1; #endif /* defined(OSF) */ - -#ifdef __386BSD__ - printf("uha%d",unit); -#endif __386BSD__ return; } @@ -725,10 +713,10 @@ int unit; model = inb(port + UHA_ID0); submodel = inb(port + UHA_ID1); if ((model != 0x56) & (submodel != 0x40)) - { printf("ultrastor 14f not responding\n"); + { printf("uha%d: not responding\n",unit); return(ENXIO); } - printf("uha%d reading board settings, ",unit); + printf("uha%d: reading board settings, ",unit); config_reg1 = inb(port + UHA_CONF1); config_reg2 = inb(port + UHA_CONF2); @@ -866,12 +854,12 @@ struct scsi_xfer *xs; if(xs->bp) flags |= (SCSI_NOSLEEP); /* just to be sure */ if(flags & ITSDONE) { - printf("Already done?"); + printf("uha%d: Already done?",unit); xs->flags &= ~ITSDONE; } if(!(flags & INUSE)) { - printf("Not in use?"); + printf("uha%d: Not in use?",unit); xs->flags |= INUSE; } if (!(mscp = uha_get_mscp(unit,flags))) @@ -1058,7 +1046,7 @@ cheat = mscp; #endif /*UHADEBUG*/ if (datalen) { /* there's still data, must have run out of segs! */ - printf("uha_scsi_cmd%d: more than %d DMA segs\n", + printf("uha%d: uha_scsi_cmd, more than %d DMA segs\n", unit,UHA_NSEG); xs->error = XS_DRIVER_STUFFUP; uha_free_mscp(unit,mscp,flags); @@ -1113,10 +1101,11 @@ cheat = mscp; { if(uha_poll(unit,xs->timeout)) { - if (!(xs->flags & SCSI_SILENT)) printf("cmd fail\n"); + if (!(xs->flags & SCSI_SILENT)) + printf("uha%d: cmd fail\n",unit); if(!(uha_abort(unit,mscp))) { - printf("abort failed in wait\n"); + printf("uha%d: abort failed in wait\n",unit); uha_free_mscp(unit,mscp,flags); } xs->error = XS_DRIVER_STUFFUP; diff --git a/sys/scsi/README b/sys/scsi/README index 16e0998eb292..dfeeb17194fd 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 879b0f735a85..d387c047aa36 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 ba7cdcd62632..a76d522b3dc0 100644 --- a/sys/scsi/ch.c +++ b/sys/scsi/ch.c @@ -1,16 +1,7 @@ /* - */ -/* - * HISTORY - * + * Written by Julian Elischer (julian@tfs.com) * - * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE - * -------------------- ----- ---------------------- - * CURRENT PATCH LEVEL: 1 00098 - * -------------------- ----- ---------------------- - * - * 16 Feb 93 Julian Elischer ADDED for SCSI system - * + * $Id$ */ #include @@ -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 2a1b6a6ad842..3f1c348ebe84 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 b5758c898438..eb9bfac8fc7f 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. * - * - * 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$ */ + /* * 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 172f9c382e13..4cadd3221aa6 100644 --- a/sys/scsi/scsi_changer.h +++ b/sys/scsi/scsi_changer.h @@ -1,15 +1,3 @@ -/* - * 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 38e53c556650..a4eebf575205 100644 --- a/sys/scsi/scsi_disk.h +++ b/sys/scsi/scsi_disk.h @@ -1,31 +1,3 @@ -/* - * 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 e43aa8305aec..96d14a68f6f5 100644 --- a/sys/scsi/scsi_tape.h +++ b/sys/scsi/scsi_tape.h @@ -1,37 +1,3 @@ -/* - * 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 04aec868927d..f70180507e56 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 #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 c36efde535c8..004787e6d4bd 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 af85d878f941..15d229b5e95a 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<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); } +#ifdef SCSIDUMP +#include +/***********************************************************************\ +* 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 */ +{ + 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("sddump() -- not implemented\n"); - return(-1); + 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 5b9e8ea168e7..e3559674a0b2 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); }