Deleted Added
full compact
scsi_da.h (273072) scsi_da.h (276835)
1/*
2 * Structures and definitions for SCSI commands to Direct Access Devices
3 */
4
5/*-
6 * Some lines of this file come from a file of the name "scsi.h"
7 * distributed by OSF as part of mach2.5,
8 * so the following disclaimer has been kept.

--- 32 unchanged lines hidden (view full) ---

41 * organisations permission to use or modify this software.
42 *
43 * TFS supplies this software to be publicly redistributed
44 * on the understanding that TFS is not responsible for the correct
45 * functioning of this software in any circumstances.
46 *
47 * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
48 *
1/*
2 * Structures and definitions for SCSI commands to Direct Access Devices
3 */
4
5/*-
6 * Some lines of this file come from a file of the name "scsi.h"
7 * distributed by OSF as part of mach2.5,
8 * so the following disclaimer has been kept.

--- 32 unchanged lines hidden (view full) ---

41 * organisations permission to use or modify this software.
42 *
43 * TFS supplies this software to be publicly redistributed
44 * on the understanding that TFS is not responsible for the correct
45 * functioning of this software in any circumstances.
46 *
47 * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
48 *
49 * $FreeBSD: head/sys/cam/scsi/scsi_da.h 273072 2014-10-14 08:30:02Z mav $
49 * $FreeBSD: head/sys/cam/scsi/scsi_da.h 276835 2015-01-08 16:58:40Z ken $
50 */
51
52#ifndef _SCSI_SCSI_DA_H
53#define _SCSI_SCSI_DA_H 1
54
55#include <sys/cdefs.h>
56
57struct scsi_rezero_unit

--- 35 unchanged lines hidden (view full) ---

93struct scsi_read_defect_data_10
94{
95 uint8_t opcode;
96 uint8_t byte2;
97#define SRDD10_GLIST 0x08
98#define SRDD10_PLIST 0x10
99#define SRDD10_DLIST_FORMAT_MASK 0x07
100#define SRDD10_BLOCK_FORMAT 0x00
50 */
51
52#ifndef _SCSI_SCSI_DA_H
53#define _SCSI_SCSI_DA_H 1
54
55#include <sys/cdefs.h>
56
57struct scsi_rezero_unit

--- 35 unchanged lines hidden (view full) ---

93struct scsi_read_defect_data_10
94{
95 uint8_t opcode;
96 uint8_t byte2;
97#define SRDD10_GLIST 0x08
98#define SRDD10_PLIST 0x10
99#define SRDD10_DLIST_FORMAT_MASK 0x07
100#define SRDD10_BLOCK_FORMAT 0x00
101#define SRDD10_EXT_BFI_FORMAT 0x01
102#define SRDD10_EXT_PHYS_FORMAT 0x02
103#define SRDD10_LONG_BLOCK_FORMAT 0x03
101#define SRDD10_BYTES_FROM_INDEX_FORMAT 0x04
102#define SRDD10_PHYSICAL_SECTOR_FORMAT 0x05
104#define SRDD10_BYTES_FROM_INDEX_FORMAT 0x04
105#define SRDD10_PHYSICAL_SECTOR_FORMAT 0x05
106#define SRDD10_VENDOR_FORMAT 0x06
103 uint8_t format;
104 uint8_t reserved[4];
105 uint8_t alloc_length[2];
106#define SRDD10_MAX_LENGTH 0xffff
107 uint8_t control;
108};
109
110struct scsi_sanitize

--- 22 unchanged lines hidden (view full) ---

133};
134
135struct scsi_read_defect_data_12
136{
137 uint8_t opcode;
138#define SRDD12_GLIST 0x08
139#define SRDD12_PLIST 0x10
140#define SRDD12_DLIST_FORMAT_MASK 0x07
107 uint8_t format;
108 uint8_t reserved[4];
109 uint8_t alloc_length[2];
110#define SRDD10_MAX_LENGTH 0xffff
111 uint8_t control;
112};
113
114struct scsi_sanitize

--- 22 unchanged lines hidden (view full) ---

137};
138
139struct scsi_read_defect_data_12
140{
141 uint8_t opcode;
142#define SRDD12_GLIST 0x08
143#define SRDD12_PLIST 0x10
144#define SRDD12_DLIST_FORMAT_MASK 0x07
141#define SRDD12_BLOCK_FORMAT 0x00
142#define SRDD12_BYTES_FROM_INDEX_FORMAT 0x04
143#define SRDD12_PHYSICAL_SECTOR_FORMAT 0x05
145#define SRDD12_BLOCK_FORMAT SRDD10_BLOCK_FORMAT
146#define SRDD12_BYTES_FROM_INDEX_FORMAT SRDD10_BYTES_FROM_INDEX_FORMAT
147#define SRDD12_PHYSICAL_SECTOR_FORMAT SRDD10_PHYSICAL_SECTOR_FORMAT
144 uint8_t format;
145 uint8_t address_descriptor_index[4];
146 uint8_t alloc_length[4];
148 uint8_t format;
149 uint8_t address_descriptor_index[4];
150 uint8_t alloc_length[4];
151#define SRDD12_MAX_LENGTH 0xffffffff
147 uint8_t reserved;
148 uint8_t control;
149};
150
151
152/*
153 * Opcodes
154 */

--- 165 unchanged lines hidden (view full) ---

320#define SRDDH10_GLIST 0x08
321#define SRDDH10_PLIST 0x10
322#define SRDDH10_DLIST_FORMAT_MASK 0x07
323#define SRDDH10_BLOCK_FORMAT 0x00
324#define SRDDH10_BYTES_FROM_INDEX_FORMAT 0x04
325#define SRDDH10_PHYSICAL_SECTOR_FORMAT 0x05
326 u_int8_t format;
327 u_int8_t length[2];
152 uint8_t reserved;
153 uint8_t control;
154};
155
156
157/*
158 * Opcodes
159 */

--- 165 unchanged lines hidden (view full) ---

325#define SRDDH10_GLIST 0x08
326#define SRDDH10_PLIST 0x10
327#define SRDDH10_DLIST_FORMAT_MASK 0x07
328#define SRDDH10_BLOCK_FORMAT 0x00
329#define SRDDH10_BYTES_FROM_INDEX_FORMAT 0x04
330#define SRDDH10_PHYSICAL_SECTOR_FORMAT 0x05
331 u_int8_t format;
332 u_int8_t length[2];
333#define SRDDH10_MAX_LENGTH SRDD10_MAX_LENGTH - \
334 sizeof(struct scsi_read_defect_data_hdr_10)
328};
329
330struct scsi_defect_desc_block
331{
332 u_int8_t address[4];
333};
334
335};
336
337struct scsi_defect_desc_block
338{
339 u_int8_t address[4];
340};
341
342struct scsi_defect_desc_long_block
343{
344 u_int8_t address[8];
345};
346
335struct scsi_defect_desc_bytes_from_index
336{
337 u_int8_t cylinder[3];
338 u_int8_t head;
347struct scsi_defect_desc_bytes_from_index
348{
349 u_int8_t cylinder[3];
350 u_int8_t head;
351#define SDD_EXT_BFI_MADS 0x80000000
352#define SDD_EXT_BFI_FLAG_MASK 0xf0000000
353#define SDD_EXT_BFI_ENTIRE_TRACK 0x0fffffff
339 u_int8_t bytes_from_index[4];
340};
341
342struct scsi_defect_desc_phys_sector
343{
344 u_int8_t cylinder[3];
345 u_int8_t head;
354 u_int8_t bytes_from_index[4];
355};
356
357struct scsi_defect_desc_phys_sector
358{
359 u_int8_t cylinder[3];
360 u_int8_t head;
361#define SDD_EXT_PHYS_MADS 0x80000000
362#define SDD_EXT_PHYS_FLAG_MASK 0xf0000000
363#define SDD_EXT_PHYS_ENTIRE_TRACK 0x0fffffff
346 u_int8_t sector[4];
347};
348
349struct scsi_read_defect_data_hdr_12
350{
351 u_int8_t reserved;
352#define SRDDH12_GLIST 0x08
353#define SRDDH12_PLIST 0x10
354#define SRDDH12_DLIST_FORMAT_MASK 0x07
355#define SRDDH12_BLOCK_FORMAT 0x00
356#define SRDDH12_BYTES_FROM_INDEX_FORMAT 0x04
357#define SRDDH12_PHYSICAL_SECTOR_FORMAT 0x05
358 u_int8_t format;
359 u_int8_t generation[2];
360 u_int8_t length[4];
364 u_int8_t sector[4];
365};
366
367struct scsi_read_defect_data_hdr_12
368{
369 u_int8_t reserved;
370#define SRDDH12_GLIST 0x08
371#define SRDDH12_PLIST 0x10
372#define SRDDH12_DLIST_FORMAT_MASK 0x07
373#define SRDDH12_BLOCK_FORMAT 0x00
374#define SRDDH12_BYTES_FROM_INDEX_FORMAT 0x04
375#define SRDDH12_PHYSICAL_SECTOR_FORMAT 0x05
376 u_int8_t format;
377 u_int8_t generation[2];
378 u_int8_t length[4];
379#define SRDDH12_MAX_LENGTH SRDD12_MAX_LENGTH - \
380 sizeof(struct scsi_read_defect_data_hdr_12)
361};
362
363union disk_pages /* this is the structure copied from osf */
364{
365 struct format_device_page {
366 u_int8_t pg_code; /* page code (should be 3) */
367#define SMS_FORMAT_DEVICE_PAGE 0x03 /* only 6 bits valid */
368 u_int8_t pg_length; /* page length (should be 0x16) */

--- 162 unchanged lines hidden (view full) ---

531#define SMS_RWER_LBPERE 0x80
532 u_int8_t write_retry_count;
533 u_int8_t reserved2;
534 u_int8_t recovery_time_limit[2];
535};
536
537__BEGIN_DECLS
538/*
381};
382
383union disk_pages /* this is the structure copied from osf */
384{
385 struct format_device_page {
386 u_int8_t pg_code; /* page code (should be 3) */
387#define SMS_FORMAT_DEVICE_PAGE 0x03 /* only 6 bits valid */
388 u_int8_t pg_length; /* page length (should be 0x16) */

--- 162 unchanged lines hidden (view full) ---

551#define SMS_RWER_LBPERE 0x80
552 u_int8_t write_retry_count;
553 u_int8_t reserved2;
554 u_int8_t recovery_time_limit[2];
555};
556
557__BEGIN_DECLS
558/*
539 * XXX This is only left out of the kernel build to silence warnings. If,
540 * for some reason this function is used in the kernel, the ifdefs should
541 * be moved so it is included both in the kernel and userland.
559 * XXX These are only left out of the kernel build to silence warnings. If,
560 * for some reason these functions are used in the kernel, the ifdefs should
561 * be moved so they are included both in the kernel and userland.
542 */
543#ifndef _KERNEL
544void scsi_format_unit(struct ccb_scsiio *csio, u_int32_t retries,
545 void (*cbfcnp)(struct cam_periph *, union ccb *),
546 u_int8_t tag_action, u_int8_t byte2, u_int16_t ileave,
547 u_int8_t *data_ptr, u_int32_t dxfer_len,
548 u_int8_t sense_len, u_int32_t timeout);
549
562 */
563#ifndef _KERNEL
564void scsi_format_unit(struct ccb_scsiio *csio, u_int32_t retries,
565 void (*cbfcnp)(struct cam_periph *, union ccb *),
566 u_int8_t tag_action, u_int8_t byte2, u_int16_t ileave,
567 u_int8_t *data_ptr, u_int32_t dxfer_len,
568 u_int8_t sense_len, u_int32_t timeout);
569
570void scsi_read_defects(struct ccb_scsiio *csio, uint32_t retries,
571 void (*cbfcnp)(struct cam_periph *, union ccb *),
572 uint8_t tag_action, uint8_t list_format,
573 uint32_t addr_desc_index, uint8_t *data_ptr,
574 uint32_t dxfer_len, int minimum_cmd_size,
575 uint8_t sense_len, uint32_t timeout);
576
550void scsi_sanitize(struct ccb_scsiio *csio, u_int32_t retries,
551 void (*cbfcnp)(struct cam_periph *, union ccb *),
552 u_int8_t tag_action, u_int8_t byte2, u_int16_t control,
553 u_int8_t *data_ptr, u_int32_t dxfer_len, u_int8_t sense_len,
554 u_int32_t timeout);
555
556#endif /* !_KERNEL */
557__END_DECLS
558
559#endif /* _SCSI_SCSI_DA_H */
577void scsi_sanitize(struct ccb_scsiio *csio, u_int32_t retries,
578 void (*cbfcnp)(struct cam_periph *, union ccb *),
579 u_int8_t tag_action, u_int8_t byte2, u_int16_t control,
580 u_int8_t *data_ptr, u_int32_t dxfer_len, u_int8_t sense_len,
581 u_int32_t timeout);
582
583#endif /* !_KERNEL */
584__END_DECLS
585
586#endif /* _SCSI_SCSI_DA_H */