scsi_low.c (198356) | scsi_low.c (203108) |
---|---|
1/* $NecBSD: scsi_low.c,v 1.24.10.8 2001/06/26 07:39:44 honda Exp $ */ 2/* $NetBSD$ */ 3 4#include <sys/cdefs.h> | 1/* $NecBSD: scsi_low.c,v 1.24.10.8 2001/06/26 07:39:44 honda Exp $ */ 2/* $NetBSD$ */ 3 4#include <sys/cdefs.h> |
5__FBSDID("$FreeBSD: head/sys/cam/scsi/scsi_low.c 198356 2009-10-22 06:13:07Z brueffer $"); | 5__FBSDID("$FreeBSD: head/sys/cam/scsi/scsi_low.c 203108 2010-01-28 08:41:30Z mav $"); |
6 7#define SCSI_LOW_STATICS 8#define SCSI_LOW_DEBUG 9#define SCSI_LOW_NEGOTIATE_BEFORE_SENSE 10#define SCSI_LOW_START_UP_CHECK 11 12/* #define SCSI_LOW_INFO_DETAIL */ 13 --- 876 unchanged lines hidden (view full) --- 890/************************************************************** 891 * SCSI INTERFACE (CAM) 892 **************************************************************/ 893#define SCSI_LOW_MALLOC(size) malloc((size), M_SCSILOW, M_NOWAIT) 894#define SCSI_LOW_FREE(pt) free((pt), M_SCSILOW) 895#define SCSI_LOW_ALLOC_CCB(flags) scsi_low_get_ccb() 896 897static void scsi_low_poll_cam(struct cam_sim *); | 6 7#define SCSI_LOW_STATICS 8#define SCSI_LOW_DEBUG 9#define SCSI_LOW_NEGOTIATE_BEFORE_SENSE 10#define SCSI_LOW_START_UP_CHECK 11 12/* #define SCSI_LOW_INFO_DETAIL */ 13 --- 876 unchanged lines hidden (view full) --- 890/************************************************************** 891 * SCSI INTERFACE (CAM) 892 **************************************************************/ 893#define SCSI_LOW_MALLOC(size) malloc((size), M_SCSILOW, M_NOWAIT) 894#define SCSI_LOW_FREE(pt) free((pt), M_SCSILOW) 895#define SCSI_LOW_ALLOC_CCB(flags) scsi_low_get_ccb() 896 897static void scsi_low_poll_cam(struct cam_sim *); |
898static void scsi_low_cam_rescan_callback(struct cam_periph *, union ccb *); 899static void scsi_low_rescan_bus_cam(struct scsi_low_softc *); | |
900void scsi_low_scsi_action_cam(struct cam_sim *, union ccb *); 901 902static int scsi_low_attach_cam(struct scsi_low_softc *); 903static int scsi_low_world_start_cam(struct scsi_low_softc *); 904static int scsi_low_dettach_cam(struct scsi_low_softc *); 905static int scsi_low_ccb_setup_cam(struct scsi_low_softc *, struct slccb *); 906static int scsi_low_done_cam(struct scsi_low_softc *, struct slccb *); 907static void scsi_low_timeout_cam(struct scsi_low_softc *, int, int); --- 41 unchanged lines hidden (view full) --- 949 if (slp->sl_si.si_poll_count ++ >= 950 SCSI_LOW_CAM_POLL_HZ / SCSI_LOW_TIMEOUT_HZ) 951 { 952 slp->sl_si.si_poll_count = 0; 953 scsi_low_timeout_check(slp); 954 } 955} 956 | 898void scsi_low_scsi_action_cam(struct cam_sim *, union ccb *); 899 900static int scsi_low_attach_cam(struct scsi_low_softc *); 901static int scsi_low_world_start_cam(struct scsi_low_softc *); 902static int scsi_low_dettach_cam(struct scsi_low_softc *); 903static int scsi_low_ccb_setup_cam(struct scsi_low_softc *, struct slccb *); 904static int scsi_low_done_cam(struct scsi_low_softc *, struct slccb *); 905static void scsi_low_timeout_cam(struct scsi_low_softc *, int, int); --- 41 unchanged lines hidden (view full) --- 947 if (slp->sl_si.si_poll_count ++ >= 948 SCSI_LOW_CAM_POLL_HZ / SCSI_LOW_TIMEOUT_HZ) 949 { 950 slp->sl_si.si_poll_count = 0; 951 scsi_low_timeout_check(slp); 952 } 953} 954 |
957static void 958scsi_low_cam_rescan_callback(periph, ccb) 959 struct cam_periph *periph; 960 union ccb *ccb; 961{ 962 963 xpt_free_path(ccb->ccb_h.path); 964 xpt_free_ccb(ccb); 965} 966 967static void 968scsi_low_rescan_bus_cam(slp) 969 struct scsi_low_softc *slp; 970{ 971 struct cam_path *path; 972 union ccb *ccb; 973 cam_status status; 974 975 status = xpt_create_path(&path, xpt_periph, 976 cam_sim_path(slp->sl_si.sim), -1, 0); 977 if (status != CAM_REQ_CMP) 978 return; 979 980 ccb = xpt_alloc_ccb(); 981 bzero(ccb, sizeof(union ccb)); 982 xpt_setup_ccb(&ccb->ccb_h, path, 5); 983 ccb->ccb_h.func_code = XPT_SCAN_BUS; 984 ccb->ccb_h.cbfcnp = scsi_low_cam_rescan_callback; 985 ccb->crcn.flags = CAM_FLAG_NONE; 986 xpt_action(ccb); 987} 988 | |
989void 990scsi_low_scsi_action_cam(sim, ccb) 991 struct cam_sim *sim; 992 union ccb *ccb; 993{ 994 struct scsi_low_softc *slp = SIM2SLP(sim); 995 struct targ_info *ti; 996 struct lun_info *li; --- 374 unchanged lines hidden (view full) --- 1371 return 0; 1372} 1373 1374static int 1375scsi_low_world_start_cam(slp) 1376 struct scsi_low_softc *slp; 1377{ 1378 | 955void 956scsi_low_scsi_action_cam(sim, ccb) 957 struct cam_sim *sim; 958 union ccb *ccb; 959{ 960 struct scsi_low_softc *slp = SIM2SLP(sim); 961 struct targ_info *ti; 962 struct lun_info *li; --- 374 unchanged lines hidden (view full) --- 1337 return 0; 1338} 1339 1340static int 1341scsi_low_world_start_cam(slp) 1342 struct scsi_low_softc *slp; 1343{ 1344 |
1379 if (!cold) 1380 scsi_low_rescan_bus_cam(slp); | |
1381 return 0; 1382} 1383 1384static int 1385scsi_low_dettach_cam(slp) 1386 struct scsi_low_softc *slp; 1387{ 1388 --- 3467 unchanged lines hidden --- | 1345 return 0; 1346} 1347 1348static int 1349scsi_low_dettach_cam(slp) 1350 struct scsi_low_softc *slp; 1351{ 1352 --- 3467 unchanged lines hidden --- |