Deleted Added
full compact
scsi_cmds.c (107178) scsi_cmds.c (109345)
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 107178 2002-11-22 22:55:51Z njl $
28 * $FreeBSD: head/share/examples/scsi_target/scsi_cmds.c 109345 2003-01-16 00:24:29Z njl $
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>

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

120int
121tcmd_handle(struct ccb_accept_tio *atio, struct ccb_scsiio *ctio, io_ops event)
122{
123 static struct targ_cdb_handlers *last_cmd;
124 struct initiator_state *istate;
125 struct atio_descr *a_descr;
126 int ret;
127
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>

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

120int
121tcmd_handle(struct ccb_accept_tio *atio, struct ccb_scsiio *ctio, io_ops event)
122{
123 static struct targ_cdb_handlers *last_cmd;
124 struct initiator_state *istate;
125 struct atio_descr *a_descr;
126 int ret;
127
128 warnx("tcmd_handle atio %p ctio %p atioflags %#x", atio, ctio,
129 atio->ccb_h.flags);
128 if (debug) {
129 warnx("tcmd_handle atio %p ctio %p atioflags %#x", atio, ctio,
130 atio->ccb_h.flags);
131 }
130 ret = 0;
131 a_descr = (struct atio_descr *)atio->ccb_h.targ_descr;
132
133 /* Do a full lookup if one-behind cache failed */
134 if (last_cmd == NULL || last_cmd->cmd != a_descr->cdb[0]) {
135 struct targ_cdb_handlers *h;
136
137 for (h = cdb_handlers; h->cmd != ILLEGAL_CDB; h++) {

--- 527 unchanged lines hidden ---
132 ret = 0;
133 a_descr = (struct atio_descr *)atio->ccb_h.targ_descr;
134
135 /* Do a full lookup if one-behind cache failed */
136 if (last_cmd == NULL || last_cmd->cmd != a_descr->cdb[0]) {
137 struct targ_cdb_handlers *h;
138
139 for (h = cdb_handlers; h->cmd != ILLEGAL_CDB; h++) {

--- 527 unchanged lines hidden ---