cam_xpt.c (249466) | cam_xpt.c (249468) |
---|---|
1/*- 2 * Implementation of the Common Access Method Transport (XPT) layer. 3 * 4 * Copyright (c) 1997, 1998, 1999 Justin T. Gibbs. 5 * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 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 30#include <sys/cdefs.h> | 1/*- 2 * Implementation of the Common Access Method Transport (XPT) layer. 3 * 4 * Copyright (c) 1997, 1998, 1999 Justin T. Gibbs. 5 * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 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 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/cam/cam_xpt.c 249466 2013-04-14 09:28:14Z mav $"); | 31__FBSDID("$FreeBSD: head/sys/cam/cam_xpt.c 249468 2013-04-14 09:55:48Z mav $"); |
32 33#include <sys/param.h> 34#include <sys/bus.h> 35#include <sys/systm.h> 36#include <sys/types.h> 37#include <sys/malloc.h> 38#include <sys/kernel.h> 39#include <sys/time.h> --- 406 unchanged lines hidden (view full) --- 446 ccb = xpt_alloc_ccb(); 447 448 CAM_SIM_LOCK(bus->sim); 449 450 /* 451 * Create a path using the bus, target, and lun the 452 * user passed in. 453 */ | 32 33#include <sys/param.h> 34#include <sys/bus.h> 35#include <sys/systm.h> 36#include <sys/types.h> 37#include <sys/malloc.h> 38#include <sys/kernel.h> 39#include <sys/time.h> --- 406 unchanged lines hidden (view full) --- 446 ccb = xpt_alloc_ccb(); 447 448 CAM_SIM_LOCK(bus->sim); 449 450 /* 451 * Create a path using the bus, target, and lun the 452 * user passed in. 453 */ |
454 if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, | 454 if (xpt_create_path(&ccb->ccb_h.path, NULL, |
455 inccb->ccb_h.path_id, 456 inccb->ccb_h.target_id, 457 inccb->ccb_h.target_lun) != 458 CAM_REQ_CMP){ 459 error = EINVAL; 460 CAM_SIM_UNLOCK(bus->sim); 461 xpt_free_ccb(ccb); 462 break; --- 19 unchanged lines hidden (view full) --- 482 */ 483 484 CAM_SIM_LOCK(bus->sim); 485 486 /* 487 * Create a path using the bus, target, and lun the 488 * user passed in. 489 */ | 455 inccb->ccb_h.path_id, 456 inccb->ccb_h.target_id, 457 inccb->ccb_h.target_lun) != 458 CAM_REQ_CMP){ 459 error = EINVAL; 460 CAM_SIM_UNLOCK(bus->sim); 461 xpt_free_ccb(ccb); 462 break; --- 19 unchanged lines hidden (view full) --- 482 */ 483 484 CAM_SIM_LOCK(bus->sim); 485 486 /* 487 * Create a path using the bus, target, and lun the 488 * user passed in. 489 */ |
490 if (xpt_create_path(&ccb.ccb_h.path, xpt_periph, | 490 if (xpt_create_path(&ccb.ccb_h.path, NULL, |
491 inccb->ccb_h.path_id, 492 inccb->ccb_h.target_id, 493 inccb->ccb_h.target_lun) != 494 CAM_REQ_CMP){ 495 error = EINVAL; 496 CAM_SIM_UNLOCK(bus->sim); 497 break; 498 } --- 2414 unchanged lines hidden (view full) --- 2913 oldsim = xpt_path_sim(oldpath); 2914 CAM_SIM_UNLOCK(xpt_path_sim(start_ccb->ccb_h.path)); 2915 CAM_SIM_LOCK(oldsim); 2916 xpt_free_path(oldpath); 2917 CAM_SIM_UNLOCK(oldsim); 2918 CAM_SIM_LOCK(xpt_path_sim(start_ccb->ccb_h.path)); 2919 } 2920 if (start_ccb->cdbg.flags != CAM_DEBUG_NONE) { | 491 inccb->ccb_h.path_id, 492 inccb->ccb_h.target_id, 493 inccb->ccb_h.target_lun) != 494 CAM_REQ_CMP){ 495 error = EINVAL; 496 CAM_SIM_UNLOCK(bus->sim); 497 break; 498 } --- 2414 unchanged lines hidden (view full) --- 2913 oldsim = xpt_path_sim(oldpath); 2914 CAM_SIM_UNLOCK(xpt_path_sim(start_ccb->ccb_h.path)); 2915 CAM_SIM_LOCK(oldsim); 2916 xpt_free_path(oldpath); 2917 CAM_SIM_UNLOCK(oldsim); 2918 CAM_SIM_LOCK(xpt_path_sim(start_ccb->ccb_h.path)); 2919 } 2920 if (start_ccb->cdbg.flags != CAM_DEBUG_NONE) { |
2921 if (xpt_create_path(&cam_dpath, xpt_periph, | 2921 if (xpt_create_path(&cam_dpath, NULL, |
2922 start_ccb->ccb_h.path_id, 2923 start_ccb->ccb_h.target_id, 2924 start_ccb->ccb_h.target_lun) != 2925 CAM_REQ_CMP) { 2926 start_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; 2927 } else { 2928 cam_dflags = start_ccb->cdbg.flags; 2929 start_ccb->ccb_h.status = CAM_REQ_CMP; --- 1705 unchanged lines hidden (view full) --- 4635xpt_config(void *arg) 4636{ 4637 /* 4638 * Now that interrupts are enabled, go find our devices 4639 */ 4640 4641 /* Setup debugging path */ 4642 if (cam_dflags != CAM_DEBUG_NONE) { | 2922 start_ccb->ccb_h.path_id, 2923 start_ccb->ccb_h.target_id, 2924 start_ccb->ccb_h.target_lun) != 2925 CAM_REQ_CMP) { 2926 start_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; 2927 } else { 2928 cam_dflags = start_ccb->cdbg.flags; 2929 start_ccb->ccb_h.status = CAM_REQ_CMP; --- 1705 unchanged lines hidden (view full) --- 4635xpt_config(void *arg) 4636{ 4637 /* 4638 * Now that interrupts are enabled, go find our devices 4639 */ 4640 4641 /* Setup debugging path */ 4642 if (cam_dflags != CAM_DEBUG_NONE) { |
4643 if (xpt_create_path_unlocked(&cam_dpath, xpt_periph, | 4643 if (xpt_create_path_unlocked(&cam_dpath, NULL, |
4644 CAM_DEBUG_BUS, CAM_DEBUG_TARGET, 4645 CAM_DEBUG_LUN) != CAM_REQ_CMP) { 4646 printf("xpt_config: xpt_create_path() failed for debug" 4647 " target %d:%d:%d, debugging disabled\n", 4648 CAM_DEBUG_BUS, CAM_DEBUG_TARGET, CAM_DEBUG_LUN); 4649 cam_dflags = CAM_DEBUG_NONE; 4650 } 4651 } else --- 320 unchanged lines hidden --- | 4644 CAM_DEBUG_BUS, CAM_DEBUG_TARGET, 4645 CAM_DEBUG_LUN) != CAM_REQ_CMP) { 4646 printf("xpt_config: xpt_create_path() failed for debug" 4647 " target %d:%d:%d, debugging disabled\n", 4648 CAM_DEBUG_BUS, CAM_DEBUG_TARGET, CAM_DEBUG_LUN); 4649 cam_dflags = CAM_DEBUG_NONE; 4650 } 4651 } else --- 320 unchanged lines hidden --- |