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/gdt_common.c | |
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/gdt_common.c')
-rw-r--r-- | sys/dev/ic/gdt_common.c | 48 |
1 files changed, 3 insertions, 45 deletions
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); } |