diff options
Diffstat (limited to 'sys/dev/ic/ncr53c9x.c')
-rw-r--r-- | sys/dev/ic/ncr53c9x.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/dev/ic/ncr53c9x.c b/sys/dev/ic/ncr53c9x.c index 1b71cb673fe..7cbef588576 100644 --- a/sys/dev/ic/ncr53c9x.c +++ b/sys/dev/ic/ncr53c9x.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ncr53c9x.c,v 1.51 2011/08/29 17:25:28 miod Exp $ */ +/* $OpenBSD: ncr53c9x.c,v 1.52 2011/11/08 18:18:41 krw Exp $ */ /* $NetBSD: ncr53c9x.c,v 1.56 2000/11/30 14:41:46 thorpej Exp $ */ /* @@ -802,6 +802,21 @@ ncr53c9x_scsi_cmd(xs) NCR_CMDS(("[0x%x, %d]->%d ", (int)xs->cmd->opcode, xs->cmdlen, sc_link->target)); + /* + * Commands larger than 12 bytes seem to confuse the chip + * (at least on FAS366 flavours). + */ + if (xs->cmdlen > 12) { + memset(&xs->sense, 0, sizeof(xs->sense)); + /* sense data borrowed from gdt(4) */ + xs->sense.error_code = SSD_ERRCODE_VALID | SSD_ERRCODE_CURRENT; + xs->sense.flags = SKEY_ILLEGAL_REQUEST; + xs->sense.add_sense_code = 0x20; /* illcmd */ + xs->error = XS_SENSE; + scsi_done(xs); + return; + } + flags = xs->flags; ti = &sc->sc_tinfo[sc_link->target]; li = TINFO_LUN(ti, lun); |