Deleted Added
full compact
scsi_cmds.c (124309) scsi_cmds.c (156981)
1/*
2 * SCSI Disk Emulator
3 *
4 * Copyright (c) 2002 Nate Lawson.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
1/*
2 * SCSI Disk Emulator
3 *
4 * Copyright (c) 2002 Nate Lawson.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $FreeBSD: head/share/examples/scsi_target/scsi_cmds.c 124309 2004-01-09 19:33:21Z njl $
28 * $FreeBSD: head/share/examples/scsi_target/scsi_cmds.c 156981 2006-03-22 01:30:07Z mjacob $
29 */
30
31#include <stdio.h>
32#include <stddef.h>
33#include <stdarg.h>
34#include <stdlib.h>
35#include <string.h>
36#include <err.h>

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

43#include <cam/cam_ccb.h>
44#include <cam/scsi/scsi_all.h>
45#include <cam/scsi/scsi_targetio.h>
46#include "scsi_target.h"
47
48typedef int targ_start_func(struct ccb_accept_tio *, struct ccb_scsiio *);
49typedef void targ_done_func(struct ccb_accept_tio *, struct ccb_scsiio *,
50 io_ops);
29 */
30
31#include <stdio.h>
32#include <stddef.h>
33#include <stdarg.h>
34#include <stdlib.h>
35#include <string.h>
36#include <err.h>

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

43#include <cam/cam_ccb.h>
44#include <cam/scsi/scsi_all.h>
45#include <cam/scsi/scsi_targetio.h>
46#include "scsi_target.h"
47
48typedef int targ_start_func(struct ccb_accept_tio *, struct ccb_scsiio *);
49typedef void targ_done_func(struct ccb_accept_tio *, struct ccb_scsiio *,
50 io_ops);
51#ifndef REPORT_LUNS
52#define REPORT_LUNS 0xa0
53#endif
51
52struct targ_cdb_handlers {
53 u_int8_t cmd;
54 targ_start_func *start;
55 targ_done_func *done;
56#define ILLEGAL_CDB 0xFF
57};
58

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

82 { INQUIRY, tcmd_inquiry, NULL },
83 { REQUEST_SENSE, tcmd_req_sense, NULL },
84 { READ_CAPACITY, tcmd_rd_cap, NULL },
85 { TEST_UNIT_READY, tcmd_null_ok, NULL },
86 { START_STOP_UNIT, tcmd_null_ok, NULL },
87 { SYNCHRONIZE_CACHE, tcmd_null_ok, NULL },
88 { MODE_SENSE_6, tcmd_illegal_req, NULL },
89 { MODE_SELECT_6, tcmd_illegal_req, NULL },
54
55struct targ_cdb_handlers {
56 u_int8_t cmd;
57 targ_start_func *start;
58 targ_done_func *done;
59#define ILLEGAL_CDB 0xFF
60};
61

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

85 { INQUIRY, tcmd_inquiry, NULL },
86 { REQUEST_SENSE, tcmd_req_sense, NULL },
87 { READ_CAPACITY, tcmd_rd_cap, NULL },
88 { TEST_UNIT_READY, tcmd_null_ok, NULL },
89 { START_STOP_UNIT, tcmd_null_ok, NULL },
90 { SYNCHRONIZE_CACHE, tcmd_null_ok, NULL },
91 { MODE_SENSE_6, tcmd_illegal_req, NULL },
92 { MODE_SELECT_6, tcmd_illegal_req, NULL },
90 /* XXX REPORT_LUNS should be handled here. */
93 { REPORT_LUNS, tcmd_illegal_req, NULL },
91#ifdef READ_16
92 { READ_16, tcmd_rdwr, tcmd_rdwr_done },
93 { WRITE_16, tcmd_rdwr, tcmd_rdwr_done },
94 { SERVICE_ACTION_IN, tcmd_rd_cap16, NULL },
95#endif
96 { ILLEGAL_CDB, NULL, NULL }
97};
98

--- 662 unchanged lines hidden ---
94#ifdef READ_16
95 { READ_16, tcmd_rdwr, tcmd_rdwr_done },
96 { WRITE_16, tcmd_rdwr, tcmd_rdwr_done },
97 { SERVICE_ACTION_IN, tcmd_rd_cap16, NULL },
98#endif
99 { ILLEGAL_CDB, NULL, NULL }
100};
101

--- 662 unchanged lines hidden ---