Index: sys/cam/cam_ccb.h =================================================================== --- sys/cam/cam_ccb.h +++ sys/cam/cam_ccb.h @@ -1299,7 +1299,6 @@ #define CAM_TIME_INFINITY 0xFFFFFFFF /* Infinite timeout */ #define CAM_SUCCESS 0 /* For signaling general success */ -#define CAM_FAILURE 1 /* For signaling general failure */ #define CAM_FALSE 0 #define CAM_TRUE 1 Index: sys/cam/cam_xpt.c =================================================================== --- sys/cam/cam_xpt.c +++ sys/cam/cam_xpt.c @@ -930,9 +930,9 @@ if (xpt_sim == NULL) return (ENOMEM); - if ((status = xpt_bus_register(xpt_sim, NULL, 0)) != CAM_SUCCESS) { - printf("xpt_init: xpt_bus_register failed with status %#x," - " failing attach\n", status); + if ((error = xpt_bus_register(xpt_sim, NULL, 0)) != CAM_SUCCESS) { + printf("xpt_init: xpt_bus_register failed with errno %d," + " failing attach\n", error); return (EINVAL); } @@ -3999,8 +3999,8 @@ * information specified by the user. Once interrupt services are * available, the bus will be probed. */ -int32_t -xpt_bus_register(struct cam_sim *sim, device_t parent, u_int32_t bus) +int +xpt_bus_register(struct cam_sim *sim, device_t parent, uint32_t bus) { struct cam_eb *new_bus; struct cam_eb *old_bus; @@ -4013,7 +4013,7 @@ M_CAMXPT, M_NOWAIT|M_ZERO); if (new_bus == NULL) { /* Couldn't satisfy request */ - return (CAM_RESRC_UNAVAIL); + return (ENOMEM); } mtx_init(&new_bus->eb_mtx, "CAM bus lock", NULL, MTX_DEF); @@ -4051,7 +4051,7 @@ CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); if (status != CAM_REQ_CMP) { xpt_release_bus(new_bus); - return (CAM_RESRC_UNAVAIL); + return (ENOMEM); } xpt_path_inq(&cpi, path); @@ -4070,7 +4070,7 @@ "No transport found for %d\n", cpi.transport); xpt_release_bus(new_bus); free(path, M_CAMXPT); - return (CAM_RESRC_UNAVAIL); + return (EINVAL); } } @@ -4099,7 +4099,7 @@ return (CAM_SUCCESS); } -int32_t +int xpt_bus_deregister(path_id_t pathid) { struct cam_path bus_path; @@ -4108,7 +4108,7 @@ status = xpt_compile_path(&bus_path, NULL, pathid, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); if (status != CAM_REQ_CMP) - return (status); + return (ENOMEM); xpt_async(AC_LOST_DEVICE, &bus_path, NULL); xpt_async(AC_PATH_DEREGISTERED, &bus_path, NULL); @@ -4117,7 +4117,7 @@ xpt_release_bus(bus_path.bus); xpt_release_path(&bus_path); - return (CAM_REQ_CMP); + return (CAM_SUCCESS); } static path_id_t Index: sys/cam/cam_xpt_sim.h =================================================================== --- sys/cam/cam_xpt_sim.h +++ sys/cam/cam_xpt_sim.h @@ -39,9 +39,9 @@ /* Functions accessed by SIM drivers */ #ifdef _KERNEL -int32_t xpt_bus_register(struct cam_sim *sim, device_t parent, - u_int32_t bus); -int32_t xpt_bus_deregister(path_id_t path_id); +int xpt_bus_register(struct cam_sim *sim, device_t parent, + uint32_t bus); +int xpt_bus_deregister(path_id_t path_id); u_int32_t xpt_freeze_simq(struct cam_sim *sim, u_int count); void xpt_release_simq(struct cam_sim *sim, int run_queue); u_int32_t xpt_freeze_devq(struct cam_path *path, u_int count); Index: sys/dev/iscsi/iscsi.c =================================================================== --- sys/dev/iscsi/iscsi.c +++ sys/dev/iscsi/iscsi.c @@ -1506,8 +1506,7 @@ return (ENOMEM); } - error = xpt_bus_register(is->is_sim, NULL, 0); - if (error != 0) { + if (xpt_bus_register(is->is_sim, NULL, 0) != 0) { ISCSI_SESSION_UNLOCK(is); ISCSI_SESSION_WARN(is, "failed to register bus"); iscsi_session_terminate(is); Index: sys/dev/smartpqi/smartpqi_cam.c =================================================================== --- sys/dev/smartpqi/smartpqi_cam.c +++ sys/dev/smartpqi/smartpqi_cam.c @@ -1204,7 +1204,7 @@ { int max_transactions; union ccb *ccb = NULL; - cam_status status = 0; + int error; struct ccb_setasync csa; struct cam_sim *sim; @@ -1231,9 +1231,9 @@ softs->os_specific.sim = sim; mtx_lock(&softs->os_specific.cam_lock); - status = xpt_bus_register(sim, softs->os_specific.pqi_dev, 0); - if (status != CAM_SUCCESS) { - DBG_ERR("xpt_bus_register failed status=%d\n", status); + error = xpt_bus_register(sim, softs->os_specific.pqi_dev, 0); + if (error != CAM_SUCCESS) { + DBG_ERR("xpt_bus_register failed errno %d\n", error); cam_sim_free(softs->os_specific.sim, FALSE); cam_simq_free(softs->os_specific.devq); mtx_unlock(&softs->os_specific.cam_lock);