diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2019-11-25 17:02:58 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2019-11-25 17:02:58 +0000 |
commit | a953a9c661f8233ff66d4438e89f2c37587b057d (patch) | |
tree | 2b36af4bbc32020b13c2336424fd491e0d592da3 /sys/scsi/scsi_disk.h | |
parent | 05726ffdd317da21b9651c7f65e862e65fff315c (diff) |
Move struct scsi_read_cap_data and struct scsi_read_cap_data_16 to
scsi_all.h.
Add scsi_read_cap_10() and scsi_read_cap_16() functions to
scsi_base.c, i.e. move logic to do actual READ_CAPACITY commands out
of sd_read_cap() and sd_read_cap_16().
This will allow the READ_CAPACITY code to be reused by cd(4).
Return -1 for errors where the error code is just discarded, reducing
ENOMEM, ENXIO, EIO uses.
No intentional functional change.
Diffstat (limited to 'sys/scsi/scsi_disk.h')
-rw-r--r-- | sys/scsi/scsi_disk.h | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/sys/scsi/scsi_disk.h b/sys/scsi/scsi_disk.h index 706217b3511..0f56fdd62d8 100644 --- a/sys/scsi/scsi_disk.h +++ b/sys/scsi/scsi_disk.h @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_disk.h,v 1.38 2019/09/27 23:07:42 krw Exp $ */ +/* $OpenBSD: scsi_disk.h,v 1.39 2019/11/25 17:02:57 krw Exp $ */ /* $NetBSD: scsi_disk.h,v 1.10 1996/07/05 16:19:05 christos Exp $ */ /* @@ -304,35 +304,6 @@ struct scsi_synchronize_cache { #define UNMAP 0x42 -struct scsi_read_cap_data { - u_int8_t addr[4]; - u_int8_t length[4]; -}; - -struct scsi_read_cap_data_16 { - u_int8_t addr[8]; - u_int8_t length[4]; - u_int8_t p_type_prot; -#define RC16_PROT_EN 0x01 /* Protection type is 0 when 0 */ -#define RC16_PROT_P_TYPE 0x0e -#define RC16_P_TYPE_1 0x00 /* Protection type 1 */ -#define RC16_P_TYPE_2 0x02 /* Protection type 2 */ -#define RC16_P_TYPE_3 0x04 /* Protection type 3 */ -#define RC16_BASIS 0x30 /* Meaning of addr */ -#define RC16_BASIS_HIGH 0x00 /* highest LBA of zone */ -#define RC16_BASIS_LAST 0x10 /* last LBA on unit */ - u_int8_t logical_per_phys; /* Logical Blks Per Physical Blk Exp */ -#define RC16_LBPPB_EXPONENT 0x0f /* 2**N LB per PB, 0 means unknown */ -#define RC16_PIIPLB_EXPONENT 0xf0 /* 2**N Prot info intervals per LB */ - u_int8_t lowest_aligned[2]; -#define RC16_LALBA 0x3fff /* lowest aligned LBA */ -#define RC16_LBPRZ 0x4000 /* unmapped LBA returns all zeros */ -#define READ_CAP_16_TPRZ 0x4000 /* XXX old name used in driver(s) */ -#define RC16_LBPME 0x8000 /* LB provisioning management enabled */ -#define READ_CAP_16_TPE 0x8000 /* XXX old name used in driver(s) */ - u_int8_t reserved[16]; -}; - struct scsi_reassign_blocks_data { u_int8_t reserved[2]; u_int8_t length[2]; |