diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-09-15 05:33:40 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-09-15 05:33:40 +0000 |
commit | cb660437247a96c63bdbe14d1d66781852072ec6 (patch) | |
tree | ae2d972a113d40e3a1d33db3310e2b355ff929c9 /sys/dev/ic | |
parent | ddac5be5e6b01dfa7468abf3893fe72916c2c631 (diff) |
Don't fake MODE SENSE page 4 info inside raid drivers, just let sd
fake a geometry. Page 4 info does not get used for size information.
Eliminate now unused union scsi_disk_pages.
ok marco@ mickey@ pre-lock.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/aac.c | 47 | ||||
-rw-r--r-- | sys/dev/ic/ami.c | 51 | ||||
-rw-r--r-- | sys/dev/ic/amivar.h | 4 | ||||
-rw-r--r-- | sys/dev/ic/cac.c | 46 | ||||
-rw-r--r-- | sys/dev/ic/gdt_common.c | 48 | ||||
-rw-r--r-- | sys/dev/ic/twe.c | 60 | ||||
-rw-r--r-- | sys/dev/ic/twevar.h | 4 |
7 files changed, 19 insertions, 241 deletions
diff --git a/sys/dev/ic/aac.c b/sys/dev/ic/aac.c index cb9da97fdad..3373f80911e 100644 --- a/sys/dev/ic/aac.c +++ b/sys/dev/ic/aac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aac.c,v 1.23 2005/08/24 01:19:47 krw Exp $ */ +/* $OpenBSD: aac.c,v 1.24 2005/09/15 05:33:39 krw Exp $ */ /*- * Copyright (c) 2000 Michael Smith @@ -812,11 +812,6 @@ aac_internal_cache_cmd(xs) struct aac_softc *sc = link->adapter_softc; struct scsi_inquiry_data inq; struct scsi_sense_data sd; - struct { - struct scsi_mode_header hd; - struct scsi_blk_desc bd; - union scsi_disk_pages dp; - } mpd; struct scsi_read_cap_data rcd; u_int8_t target = link->target; @@ -860,42 +855,6 @@ aac_internal_cache_cmd(xs) aac_copy_internal_data(xs, (u_int8_t *)&inq, sizeof inq); break; - case MODE_SENSE: - AAC_DPRINTF(AAC_D_CMD, ("MODE SENSE tgt %d ", target)); - - bzero(&mpd, sizeof mpd); - switch (((struct scsi_mode_sense *)xs->cmd)->page) { - case 4: - /* scsi_disk.h says this should be 0x16 */ - mpd.dp.rigid_geometry.pg_length = 0x16; - mpd.hd.data_length = sizeof mpd.hd - - sizeof mpd.hd.data_length + sizeof mpd.bd + - sizeof mpd.dp.rigid_geometry; - mpd.hd.blk_desc_len = sizeof mpd.bd; - - /* XXX */ - mpd.hd.dev_spec = 0; - _lto3b(AAC_BLOCK_SIZE, mpd.bd.blklen); - mpd.dp.rigid_geometry.pg_code = 4; - _lto3b(sc->sc_hdr[target].hd_size / - sc->sc_hdr[target].hd_heads / - sc->sc_hdr[target].hd_secs, - mpd.dp.rigid_geometry.ncyl); - mpd.dp.rigid_geometry.nheads = - sc->sc_hdr[target].hd_heads; - aac_copy_internal_data(xs, (u_int8_t *)&mpd, - sizeof mpd); - break; - - default: - printf("%s: mode sense page %d not simulated\n", - sc->sc_dev.dv_xname, - ((struct scsi_mode_sense *)xs->cmd)->page); - xs->error = XS_DRIVER_STUFFUP; - return (0); - } - break; - case READ_CAPACITY: AAC_DPRINTF(AAC_D_CMD, ("READ CAPACITY tgt %d ", target)); bzero(&rcd, sizeof rcd); @@ -905,8 +864,8 @@ aac_internal_cache_cmd(xs) break; default: - printf("aac_internal_cache_cmd got bad opcode: %d\n", - xs->cmd->opcode); + AAC_DPRINTF(AAC_D_CMD, ("unsupported scsi command %#x tgt %d ", + xs->cmd->opcode, target)); xs->error = XS_DRIVER_STUFFUP; return (0); } diff --git a/sys/dev/ic/ami.c b/sys/dev/ic/ami.c index 62f81f966d4..0732ce225a7 100644 --- a/sys/dev/ic/ami.c +++ b/sys/dev/ic/ami.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ami.c,v 1.73 2005/08/31 18:27:31 marco Exp $ */ +/* $OpenBSD: ami.c,v 1.74 2005/09/15 05:33:39 krw Exp $ */ /* * Copyright (c) 2001 Michael Shalayeff @@ -313,13 +313,6 @@ ami_copyhds(sc, sizes, props, stats) sc->sc_hdr[i].hd_size = letoh32(sizes[i]); sc->sc_hdr[i].hd_prop = props[i]; sc->sc_hdr[i].hd_stat = stats[i]; - if (sc->sc_hdr[i].hd_size > 0x200000) { - sc->sc_hdr[i].hd_heads = 255; - sc->sc_hdr[i].hd_secs = 63; - } else { - sc->sc_hdr[i].hd_heads = 64; - sc->sc_hdr[i].hd_secs = 32; - } } } @@ -1500,11 +1493,6 @@ ami_scsi_cmd(xs) struct ami_iocmd *cmd; struct scsi_inquiry_data inq; struct scsi_sense_data sd; - struct { - struct scsi_mode_header hd; - struct scsi_blk_desc bd; - union scsi_disk_pages dp; - } mpd; struct scsi_read_cap_data rcd; u_int8_t target = link->target; u_int32_t blockno, blockcnt; @@ -1571,40 +1559,6 @@ ami_scsi_cmd(xs) ami_copy_internal_data(xs, &inq, sizeof inq); break; - case MODE_SENSE: - AMI_DPRINTF(AMI_D_CMD, ("MODE SENSE tgt %d ", target)); - - bzero(&mpd, sizeof mpd); - switch (((struct scsi_mode_sense *)xs->cmd)->page) { - case 4: - /* scsi_disk.h says this should be 0x16 */ - mpd.dp.rigid_geometry.pg_length = 0x16; - mpd.hd.data_length = sizeof mpd.hd - - sizeof mpd.hd.data_length + sizeof mpd.bd + - sizeof mpd.dp.rigid_geometry; - mpd.hd.blk_desc_len = sizeof mpd.bd; - - mpd.hd.dev_spec = 0; /* writeprotect ? XXX */ - _lto3b(AMI_SECTOR_SIZE, mpd.bd.blklen); - mpd.dp.rigid_geometry.pg_code = 4; - _lto3b(sc->sc_hdr[target].hd_size / - sc->sc_hdr[target].hd_heads / - sc->sc_hdr[target].hd_secs, - mpd.dp.rigid_geometry.ncyl); - mpd.dp.rigid_geometry.nheads = - sc->sc_hdr[target].hd_heads; - ami_copy_internal_data(xs, (u_int8_t *)&mpd, - sizeof mpd); - break; - - default: - printf("%s: mode sense page %d not simulated\n", - sc->sc_dev.dv_xname, - ((struct scsi_mode_sense *)xs->cmd)->page); - xs->error = XS_DRIVER_STUFFUP; - } - break; - case READ_CAPACITY: AMI_DPRINTF(AMI_D_CMD, ("READ CAPACITY tgt %d ", target)); bzero(&rcd, sizeof rcd); @@ -1727,7 +1681,8 @@ ami_scsi_cmd(xs) return (SUCCESSFULLY_QUEUED); default: - AMI_DPRINTF(AMI_D_CMD, ("unknown opc %d ", xs->cmd->opcode)); + AMI_DPRINTF(AMI_D_CMD, ("unsupported scsi command %#x tgt %d ", + xs->cmd->opcode, target)); xs->error = XS_DRIVER_STUFFUP; } diff --git a/sys/dev/ic/amivar.h b/sys/dev/ic/amivar.h index 13bc4b085a7..6c057e88224 100644 --- a/sys/dev/ic/amivar.h +++ b/sys/dev/ic/amivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: amivar.h,v 1.21 2005/08/31 17:59:09 marco Exp $ */ +/* $OpenBSD: amivar.h,v 1.22 2005/09/15 05:33:39 krw Exp $ */ /* * Copyright (c) 2001 Michael Shalayeff @@ -114,8 +114,6 @@ struct ami_softc { struct { u_int8_t hd_present; u_int8_t hd_is_logdrv; - u_int8_t hd_heads; - u_int8_t hd_secs; u_int8_t hd_prop; u_int8_t hd_stat; u_int32_t hd_size; diff --git a/sys/dev/ic/cac.c b/sys/dev/ic/cac.c index 8f62ca6e133..3b22d069c97 100644 --- a/sys/dev/ic/cac.c +++ b/sys/dev/ic/cac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cac.c,v 1.19 2005/07/03 22:31:27 krw Exp $ */ +/* $OpenBSD: cac.c,v 1.20 2005/09/15 05:33:39 krw Exp $ */ /* $NetBSD: cac.c,v 1.15 2000/11/08 19:20:35 ad Exp $ */ /* @@ -558,11 +558,6 @@ cac_scsi_cmd(xs) struct cac_drive_info *dinfo; struct scsi_inquiry_data inq; struct scsi_sense_data sd; - struct { - struct scsi_mode_header hd; - struct scsi_blk_desc bd; - union scsi_disk_pages dp; - } mpd; struct scsi_read_cap_data rcd; u_int8_t target = link->target; u_int32_t blockno, blockcnt, size; @@ -624,43 +619,6 @@ cac_scsi_cmd(xs) cac_copy_internal_data(xs, &inq, sizeof inq); break; - case MODE_SENSE: - if (cac_get_dinfo(sc, target)) { - xs->error = XS_DRIVER_STUFFUP; - break; - } - bzero(&mpd, sizeof mpd); - switch (((struct scsi_mode_sense *)xs->cmd)->page) { - case 4: - /* scsi_disk.h says this should be 0x16 */ - mpd.dp.rigid_geometry.pg_length = 0x16; - mpd.hd.data_length = sizeof mpd.hd - - sizeof mpd.hd.data_length + sizeof mpd.bd + - sizeof mpd.dp.rigid_geometry; - mpd.hd.blk_desc_len = sizeof mpd.bd; - - /* XXX */ - mpd.hd.dev_spec = 0; - _lto3b(CAC_SECTOR_SIZE, mpd.bd.blklen); - mpd.dp.rigid_geometry.pg_code = 4; - _lto3b(CAC_GET2(dinfo->ncylinders), - mpd.dp.rigid_geometry.ncyl); - mpd.dp.rigid_geometry.nheads = - CAC_GET1(dinfo->nheads); - cac_copy_internal_data(xs, (u_int8_t *)&mpd, - sizeof mpd); - break; - - default: - printf("%s: mode sense page %d not simulated\n", - sc->sc_dv.dv_xname, - ((struct scsi_mode_sense *)xs->cmd)->page); - xs->error = XS_DRIVER_STUFFUP; - splx(s); - return (TRY_AGAIN_LATER); - } - break; - case READ_CAPACITY: if (cac_get_dinfo(sc, target)) { xs->error = XS_DRIVER_STUFFUP; @@ -748,6 +706,8 @@ cac_scsi_cmd(xs) return (SUCCESSFULLY_QUEUED); default: + SC_DEBUG(link, SDEV_DB1, ("unsupported scsi command %#x " + "tgt %d ", xs->cmd->opcode, target)); xs->error = XS_DRIVER_STUFFUP; } splx(s); diff --git a/sys/dev/ic/gdt_common.c b/sys/dev/ic/gdt_common.c index ea4e81c3170..1265fe729cc 100644 --- a/sys/dev/ic/gdt_common.c +++ b/sys/dev/ic/gdt_common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gdt_common.c,v 1.29 2005/07/03 22:31:27 krw Exp $ */ +/* $OpenBSD: gdt_common.c,v 1.30 2005/09/15 05:33:39 krw Exp $ */ /* * Copyright (c) 1999, 2000, 2003 Niklas Hallqvist. All rights reserved. @@ -853,11 +853,6 @@ gdt_internal_cache_cmd(xs) struct gdt_softc *gdt = link->adapter_softc; struct scsi_inquiry_data inq; struct scsi_sense_data sd; - struct { - struct scsi_mode_header hd; - struct scsi_blk_desc bd; - union scsi_disk_pages dp; - } mpd; struct scsi_read_cap_data rcd; u_int8_t target = link->target; @@ -902,43 +897,6 @@ gdt_internal_cache_cmd(xs) gdt_copy_internal_data(xs, (u_int8_t *)&inq, sizeof inq); break; - case MODE_SENSE: - GDT_DPRINTF(GDT_D_CMD, ("MODE SENSE tgt %d ", target)); - - bzero(&mpd, sizeof mpd); - switch (((struct scsi_mode_sense *)xs->cmd)->page) { - case 4: - /* scsi_disk.h says this should be 0x16 */ - mpd.dp.rigid_geometry.pg_length = 0x16; - mpd.hd.data_length = sizeof mpd.hd - - sizeof mpd.hd.data_length + sizeof mpd.bd + - sizeof mpd.dp.rigid_geometry; - mpd.hd.blk_desc_len = sizeof mpd.bd; - - /* XXX */ - mpd.hd.dev_spec = - (gdt->sc_hdr[target].hd_devtype & 2) ? 0x80 : 0; - _lto3b(GDT_SECTOR_SIZE, mpd.bd.blklen); - mpd.dp.rigid_geometry.pg_code = 4; - _lto3b(gdt->sc_hdr[target].hd_size / - gdt->sc_hdr[target].hd_heads / - gdt->sc_hdr[target].hd_secs, - mpd.dp.rigid_geometry.ncyl); - mpd.dp.rigid_geometry.nheads = - gdt->sc_hdr[target].hd_heads; - gdt_copy_internal_data(xs, (u_int8_t *)&mpd, - sizeof mpd); - break; - - default: - printf("%s: mode sense page %d not simulated\n", - gdt->sc_dev.dv_xname, - ((struct scsi_mode_sense *)xs->cmd)->page); - xs->error = XS_DRIVER_STUFFUP; - return (0); - } - break; - case READ_CAPACITY: GDT_DPRINTF(GDT_D_CMD, ("READ CAPACITY tgt %d ", target)); bzero(&rcd, sizeof rcd); @@ -948,8 +906,8 @@ gdt_internal_cache_cmd(xs) break; default: - printf("gdt_internal_cache_cmd got bad opcode: %d\n", - xs->cmd->opcode); + GDT_DPRINTF(GDT_D_CMD, ("unsupported scsi command %#x tgt %d ", + xs->cmd->opcode, target)); xs->error = XS_DRIVER_STUFFUP; return (0); } diff --git a/sys/dev/ic/twe.c b/sys/dev/ic/twe.c index 6ae6c8a1748..6596b7d8c2d 100644 --- a/sys/dev/ic/twe.c +++ b/sys/dev/ic/twe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: twe.c,v 1.23 2005/07/03 22:31:27 krw Exp $ */ +/* $OpenBSD: twe.c,v 1.24 2005/09/15 05:33:39 krw Exp $ */ /* * Copyright (c) 2000-2002 Michael Shalayeff. All rights reserved. @@ -372,17 +372,8 @@ twe_attach(sc) sc->sc_hdr[i].hd_present = 1; sc->sc_hdr[i].hd_devtype = 0; sc->sc_hdr[i].hd_size = letoh32(*(u_int32_t *)cap->data); - /* this is evil. they never learn */ - if (sc->sc_hdr[i].hd_size > 0x200000) { - sc->sc_hdr[i].hd_secs = 63; - sc->sc_hdr[i].hd_heads = 255; - } else { - sc->sc_hdr[i].hd_secs = 32; - sc->sc_hdr[i].hd_heads = 64; - } - TWE_DPRINTF(TWE_D_MISC, ("twed%d: size=%d secs=%d heads=%d\n", - i, sc->sc_hdr[i].hd_size, sc->sc_hdr[i].hd_secs, - sc->sc_hdr[i].hd_heads)); + TWE_DPRINTF(TWE_D_MISC, ("twed%d: size=%d\n", + i, sc->sc_hdr[i].hd_size)); } if (!nunits) @@ -789,11 +780,6 @@ twe_scsi_cmd(xs) struct twe_cmd *cmd; struct scsi_inquiry_data inq; struct scsi_sense_data sd; - struct { - struct scsi_mode_header hd; - struct scsi_blk_desc bd; - union scsi_disk_pages dp; - } mpd; struct scsi_read_cap_data rcd; u_int8_t target = link->target; u_int32_t blockno, blockcnt; @@ -852,43 +838,6 @@ twe_scsi_cmd(xs) twe_copy_internal_data(xs, &inq, sizeof inq); break; - case MODE_SENSE: - TWE_DPRINTF(TWE_D_CMD, ("MODE SENSE tgt %d ", target)); - - bzero(&mpd, sizeof mpd); - switch (((struct scsi_mode_sense *)xs->cmd)->page) { - case 4: - /* scsi_disk.h says this should be 0x16 */ - mpd.dp.rigid_geometry.pg_length = 0x16; - mpd.hd.data_length = sizeof mpd.hd - - sizeof mpd.hd.data_length + sizeof mpd.bd + - sizeof mpd.dp.rigid_geometry; - mpd.hd.blk_desc_len = sizeof mpd.bd; - - /* XXX */ - mpd.hd.dev_spec = - (sc->sc_hdr[target].hd_devtype & 2) ? 0x80 : 0; - _lto3b(TWE_SECTOR_SIZE, mpd.bd.blklen); - mpd.dp.rigid_geometry.pg_code = 4; - _lto3b(sc->sc_hdr[target].hd_size / - sc->sc_hdr[target].hd_heads / - sc->sc_hdr[target].hd_secs, - mpd.dp.rigid_geometry.ncyl); - mpd.dp.rigid_geometry.nheads = - sc->sc_hdr[target].hd_heads; - twe_copy_internal_data(xs, (u_int8_t *)&mpd, - sizeof mpd); - break; - - default: - printf("%s: mode sense page %d not simulated\n", - sc->sc_dev.dv_xname, - ((struct scsi_mode_sense *)xs->cmd)->page); - xs->error = XS_DRIVER_STUFFUP; - return (TRY_AGAIN_LATER); - } - break; - case READ_CAPACITY: TWE_DPRINTF(TWE_D_CMD, ("READ CAPACITY tgt %d ", target)); bzero(&rcd, sizeof rcd); @@ -989,7 +938,8 @@ twe_scsi_cmd(xs) return (SUCCESSFULLY_QUEUED); default: - TWE_DPRINTF(TWE_D_CMD, ("unknown opc %d ", xs->cmd->opcode)); + TWE_DPRINTF(TWE_D_CMD, ("unsupported scsi command %#x tgt %d ", + xs->cmd->opcode, target)); xs->error = XS_DRIVER_STUFFUP; } diff --git a/sys/dev/ic/twevar.h b/sys/dev/ic/twevar.h index 44a67027053..5ffce90ed99 100644 --- a/sys/dev/ic/twevar.h +++ b/sys/dev/ic/twevar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: twevar.h,v 1.6 2003/06/02 19:24:22 mickey Exp $ */ +/* $OpenBSD: twevar.h,v 1.7 2005/09/15 05:33:39 krw Exp $ */ /* * Copyright (c) 2000 Michael Shalayeff @@ -75,8 +75,6 @@ struct twe_softc { int hd_present; int hd_devtype; int hd_lock; - int hd_secs; - int hd_heads; int hd_size; } sc_hdr[TWE_MAX_UNITS]; }; |