diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2011-01-01 20:32:19 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2011-01-01 20:32:19 +0000 |
commit | 58ae486afb4855565ea982e9e02d89e2a623b85d (patch) | |
tree | 62ec473535e366b0380e4006ff95c0f3e18bdc6d /sys | |
parent | 25ac652a8e006039c713396c0af30b341fc0d6f1 (diff) |
Implement READ CAPACITY (16).
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sparc64/dev/vdsk.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/sys/arch/sparc64/dev/vdsk.c b/sys/arch/sparc64/dev/vdsk.c index 5dd6103a0f6..08f6305c552 100644 --- a/sys/arch/sparc64/dev/vdsk.c +++ b/sys/arch/sparc64/dev/vdsk.c @@ -1,6 +1,6 @@ -/* $OpenBSD: vdsk.c,v 1.25 2010/10/12 00:53:32 krw Exp $ */ +/* $OpenBSD: vdsk.c,v 1.26 2011/01/01 20:32:18 kettenis Exp $ */ /* - * Copyright (c) 2009 Mark Kettenis + * Copyright (c) 2009, 2011 Mark Kettenis * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -203,6 +203,7 @@ void vdsk_dev_free(struct scsi_link *); void vdsk_scsi_inq(struct scsi_xfer *); void vdsk_scsi_inquiry(struct scsi_xfer *); void vdsk_scsi_capacity(struct scsi_xfer *); +void vdsk_scsi_capacity16(struct scsi_xfer *); void vdsk_scsi_done(struct scsi_xfer *, int); int @@ -936,6 +937,9 @@ vdsk_scsi_cmd(struct scsi_xfer *xs) case READ_CAPACITY: vdsk_scsi_capacity(xs); return; + case READ_CAPACITY_16: + vdsk_scsi_capacity16(xs); + return; case TEST_UNIT_READY: case START_STOP: @@ -1109,6 +1113,22 @@ vdsk_scsi_capacity(struct scsi_xfer *xs) } void +vdsk_scsi_capacity16(struct scsi_xfer *xs) +{ + struct vdsk_softc *sc = xs->sc_link->adapter_softc; + struct scsi_read_cap_data_16 rcd; + + bzero(&rcd, sizeof(rcd)); + + _lto8b(sc->sc_vdisk_size - 1, rcd.addr); + _lto4b(sc->sc_vdisk_block_size, rcd.length); + + bcopy(&rcd, xs->data, MIN(sizeof(rcd), xs->datalen)); + + vdsk_scsi_done(xs, XS_NOERROR); +} + +void vdsk_scsi_done(struct scsi_xfer *xs, int error) { xs->error = error; |