cam_xpt.c (03e3511b4785684311cab4f49c3f7de5d7a1cfe5) | cam_xpt.c (d05caa00c57ff92069fd5e1991bfbff2ee836722) |
---|---|
1/* 2 * Implementation of the Common Access Method Transport (XPT) layer. 3 * 4 * Copyright (c) 1997, 1998 Justin T. Gibbs. 5 * Copyright (c) 1997, 1998 Kenneth D. Merry. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 12 unchanged lines hidden (view full) --- 21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * | 1/* 2 * Implementation of the Common Access Method Transport (XPT) layer. 3 * 4 * Copyright (c) 1997, 1998 Justin T. Gibbs. 5 * Copyright (c) 1997, 1998 Kenneth D. Merry. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 12 unchanged lines hidden (view full) --- 21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * |
29 * $Id: cam_xpt.c,v 1.13 1998/09/24 22:43:54 gibbs Exp $ | 29 * $Id: cam_xpt.c,v 1.14 1998/09/25 22:35:56 gibbs Exp $ |
30 */ 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/types.h> 34#include <sys/malloc.h> 35#include <sys/device.h> 36#include <sys/kernel.h> 37#include <sys/conf.h> --- 2474 unchanged lines hidden (view full) --- 2512xpt_action(union ccb *start_ccb) 2513{ 2514 CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("xpt_action\n")); 2515 2516 start_ccb->ccb_h.status = CAM_REQ_INPROG; 2517 2518 switch (start_ccb->ccb_h.func_code) { 2519 case XPT_SCSI_IO: | 30 */ 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/types.h> 34#include <sys/malloc.h> 35#include <sys/device.h> 36#include <sys/kernel.h> 37#include <sys/conf.h> --- 2474 unchanged lines hidden (view full) --- 2512xpt_action(union ccb *start_ccb) 2513{ 2514 CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("xpt_action\n")); 2515 2516 start_ccb->ccb_h.status = CAM_REQ_INPROG; 2517 2518 switch (start_ccb->ccb_h.func_code) { 2519 case XPT_SCSI_IO: |
2520 { 2521#ifdef CAMDEBUG 2522 char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1]; 2523 struct cam_path *path; 2524 2525 path = start_ccb->ccb_h.path; 2526#endif 2527 |
|
2520 /* 2521 * For the sake of compatibility with SCSI-1 2522 * devices that may not understand the identify 2523 * message, we include lun information in the 2524 * second byte of all commands. SCSI-1 specifies 2525 * that luns are a 3 bit value and reserves only 3 2526 * bits for lun information in the CDB. Later 2527 * revisions of the SCSI spec allow for more than 8 --- 10 unchanged lines hidden (view full) --- 2538 && (start_ccb->ccb_h.flags & CAM_CDB_POINTER) == 0) { 2539 2540 start_ccb->csio.cdb_io.cdb_bytes[1] |= 2541 start_ccb->ccb_h.target_lun << 5; 2542 } 2543 start_ccb->csio.scsi_status = SCSI_STATUS_OK; 2544 start_ccb->csio.sense_resid = 0; 2545 start_ccb->csio.resid = 0; | 2528 /* 2529 * For the sake of compatibility with SCSI-1 2530 * devices that may not understand the identify 2531 * message, we include lun information in the 2532 * second byte of all commands. SCSI-1 specifies 2533 * that luns are a 3 bit value and reserves only 3 2534 * bits for lun information in the CDB. Later 2535 * revisions of the SCSI spec allow for more than 8 --- 10 unchanged lines hidden (view full) --- 2546 && (start_ccb->ccb_h.flags & CAM_CDB_POINTER) == 0) { 2547 2548 start_ccb->csio.cdb_io.cdb_bytes[1] |= 2549 start_ccb->ccb_h.target_lun << 5; 2550 } 2551 start_ccb->csio.scsi_status = SCSI_STATUS_OK; 2552 start_ccb->csio.sense_resid = 0; 2553 start_ccb->csio.resid = 0; |
2554 CAM_DEBUG(path, CAM_DEBUG_CDB,("%s. CDB: %s\n", 2555 scsi_op_desc(start_ccb->csio.cdb_io.cdb_bytes[0], 2556 &path->device->inq_data), 2557 scsi_cdb_string(start_ccb->csio.cdb_io.cdb_bytes, 2558 cdb_str))); |
|
2546 /* FALLTRHOUGH */ | 2559 /* FALLTRHOUGH */ |
2560 } |
|
2547 case XPT_TARGET_IO: 2548 case XPT_CONT_TARGET_IO: 2549 case XPT_ENG_EXEC: 2550 { 2551 struct cam_path *path; 2552 int s; 2553 int runq; 2554 --- 3226 unchanged lines hidden --- | 2561 case XPT_TARGET_IO: 2562 case XPT_CONT_TARGET_IO: 2563 case XPT_ENG_EXEC: 2564 { 2565 struct cam_path *path; 2566 int s; 2567 int runq; 2568 --- 3226 unchanged lines hidden --- |