Lines Matching defs:ccb_h
776 ccb.ccb_h.func_code = XPT_GDEV_TYPE;
777 xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
818 switch(ccb->ccb_h.func_code) {
847 if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE)
849 if ((ccb->ccb_h.flags & CAM_DATA_MASK) != CAM_DATA_VADDR)
853 dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK;
857 if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE)
859 if ((ccb->ccb_h.flags & CAM_DATA_MASK) != CAM_DATA_VADDR)
863 dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK;
867 if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE)
872 dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK;
875 dirs[1] = ccb->ccb_h.flags & CAM_DIR_MASK;
889 if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE)
891 if ((ccb->ccb_h.flags & CAM_DATA_MASK) != CAM_DATA_VADDR)
895 dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK;
942 ccb->ccb_h.func_code != XPT_MMC_IO) {
1018 switch (ccb->ccb_h.func_code) {
1039 dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK;
1045 dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK;
1051 dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK;
1054 dirs[1] = ccb->ccb_h.flags & CAM_DIR_MASK;
1070 dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK;
1127 xpt_setup_ccb(&ccb->ccb_h,
1128 ccb->ccb_h.path,
1130 ccb->ccb_h.func_code = XPT_GDEVLIST;
1185 xpt_path_assert(done_ccb->ccb_h.path, MA_OWNED);
1186 done_ccb->ccb_h.cbfcnp = cam_periph_done_panic;
1187 wakeup(&done_ccb->ccb_h.cbfcnp);
1194 if ((ccb->ccb_h.func_code & XPT_FC_QUEUED) != 0) {
1195 while (ccb->ccb_h.cbfcnp != cam_periph_done_panic)
1196 xpt_path_sleep(ccb->ccb_h.path, &ccb->ccb_h.cbfcnp,
1199 KASSERT(ccb->ccb_h.pinfo.index == CAM_UNQUEUED_INDEX &&
1200 (ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_INPROG,
1202 "status=%#x, index=%d", __func__, ccb, ccb->ccb_h.func_code,
1203 ccb->ccb_h.status, ccb->ccb_h.pinfo.index));
1208 * callback function (ccb->ccb_h.cbfcnp), it will be overwritten and lost.
1225 xpt_path_assert(ccb->ccb_h.path, MA_OWNED);
1226 KASSERT((ccb->ccb_h.flags & CAM_UNLOCKED) == 0,
1228 ccb->ccb_h.func_code, ccb->ccb_h.flags));
1235 (ccb->ccb_h.func_code == XPT_SCSI_IO ||
1236 ccb->ccb_h.func_code == XPT_ATA_IO ||
1237 ccb->ccb_h.func_code == XPT_NVME_IO)) {
1259 ccb->ccb_h.cbfcnp = cam_periph_done;
1268 if (cam_sim_pollable(ccb->ccb_h.path->bus->sim))
1275 ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
1282 timeout = ccb->ccb_h.timeout * 10;
1286 if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP)
1294 ccb->ccb_h.cbfcnp = cam_periph_done;
1301 if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
1302 cam_release_devq(ccb->ccb_h.path,
1307 ccb->ccb_h.status &= ~CAM_DEV_QFRZN;
1315 if (ccb->ccb_h.func_code == XPT_SCSI_IO) {
1318 } else if (ccb->ccb_h.func_code == XPT_ATA_IO) {
1321 } else if (ccb->ccb_h.func_code == XPT_NVME_IO) {
1329 ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE) ?
1330 DEVSTAT_NO_DATA : (ccb->ccb_h.flags & CAM_DIR_OUT) ?
1340 struct ccb_hdr ccb_h;
1343 memset(&ccb_h, 0, sizeof(ccb_h));
1344 xpt_setup_ccb(&ccb_h, path, /*priority*/1);
1345 ccb_h.func_code = XPT_NOOP;
1346 ccb_h.flags = CAM_DEV_QFREEZE;
1347 xpt_action((union ccb *)&ccb_h);
1360 xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NORMAL);
1361 crs.ccb_h.func_code = XPT_REL_SIMQ;
1362 crs.ccb_h.flags = getcount_only ? CAM_DEV_QFREEZE : 0;
1382 status = done_ccb->ccb_h.status;
1401 cam_release_devq(done_ccb->ccb_h.path,
1403 done_ccb->ccb_h.status &=
1414 if (done_ccb->ccb_h.status & CAM_DEV_QFRZN) {
1415 cam_release_devq(done_ccb->ccb_h.path, 0, 0, 0, 0);
1416 done_ccb->ccb_h.status &= ~CAM_DEV_QFRZN;
1427 xpt_async(AC_INQ_CHANGED, done_ccb->ccb_h.path, NULL);
1434 if (error != 0 && done_ccb->ccb_h.retry_count == 0)
1447 saved_ccb = (union ccb *)done_ccb->ccb_h.saved_ccb_ptr;
1448 KASSERT(saved_ccb->ccb_h.func_code == XPT_SCSI_IO,
1450 __func__, saved_ccb->ccb_h.func_code));
1451 KASSERT(done_ccb->ccb_h.func_code == XPT_SCSI_IO,
1453 __func__, done_ccb->ccb_h.func_code));
1454 saved_ccb->ccb_h.periph_links = done_ccb->ccb_h.periph_links;
1455 done_flags = done_ccb->ccb_h.alloc_flags;
1457 done_ccb->ccb_h.alloc_flags = done_flags;
1459 if (done_ccb->ccb_h.cbfcnp != camperiphdone)
1462 done_ccb->ccb_h.retry_count = 0;
1467 cam_release_devq(done_ccb->ccb_h.path, 0, 0, 0, 0);
1494 xpt_setup_ccb(&cgds.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
1495 cgds.ccb_h.func_code = XPT_GDEV_STATS;
1566 xpt_setup_ccb(&cgds.ccb_h,
1567 ccb->ccb_h.path,
1569 cgds.ccb_h.func_code = XPT_GDEV_STATS;
1619 periph = xpt_path_periph(ccb->ccb_h.path);
1624 ccb->ccb_h.retry_count > 0) {
1626 ccb->ccb_h.retry_count--;
1656 if (ccb->ccb_h.func_code == XPT_SCSI_IO && ccb->csio.bio != NULL)
1660 periph = xpt_path_periph(ccb->ccb_h.path);
1661 recoveryccb = (ccb->ccb_h.cbfcnp == camperiphdone);
1686 xpt_setup_ccb(&cgd.ccb_h, ccb->ccb_h.path, CAM_PRIORITY_NORMAL);
1687 cgd.ccb_h.func_code = XPT_GDEV_TYPE;
1724 if (ccb->ccb_h.retry_count > 0 &&
1726 ccb->ccb_h.retry_count--;
1747 ccb->ccb_h.status &= ~CAM_DEV_QFRZN;
1749 KASSERT(ccb->ccb_h.func_code == XPT_SCSI_IO,
1751 __func__, ccb->ccb_h.func_code));
1752 flags = orig_ccb->ccb_h.alloc_flags;
1754 orig_ccb->ccb_h.alloc_flags = flags;
1850 ccb->ccb_h.pinfo.priority--;
1851 ccb->ccb_h.flags |= CAM_DEV_QFREEZE;
1852 ccb->ccb_h.saved_ccb_ptr = orig_ccb;
1881 periph = xpt_path_periph(ccb->ccb_h.path);
1883 status = ccb->ccb_h.status;
1890 switch (ccb->ccb_h.status & CAM_STATUS_MASK) {
1929 if (ccb->ccb_h.retry_count > 0 &&
1931 ccb->ccb_h.retry_count--;
2005 } else if (ccb->ccb_h.retry_count == 0) {
2012 ccb->ccb_h.retry_count--;
2019 CAM_DEBUGGED(ccb->ccb_h.path, CAM_DEBUG_INFO))
2029 xpt_print(ccb->ccb_h.path, "Error %d, %s\n",
2032 xpt_print(ccb->ccb_h.path, "%s\n", action_string);
2034 xpt_print(ccb->ccb_h.path,
2036 ccb->ccb_h.retry_count);
2055 lun_id = xpt_path_lun_id(ccb->ccb_h.path);
2059 xpt_path_path_id(ccb->ccb_h.path),
2060 xpt_path_target_id(ccb->ccb_h.path),
2073 xpt_async(AC_UNIT_ATTENTION, orig_ccb->ccb_h.path, orig_ccb);
2078 xpt_path_path_id(ccb->ccb_h.path),
2079 xpt_path_target_id(ccb->ccb_h.path),
2083 scan_ccb->ccb_h.path = newpath;
2084 scan_ccb->ccb_h.func_code = XPT_SCAN_TGT;
2098 ccb->ccb_h.status &= ~CAM_DEV_QFRZN;
2102 cam_release_devq(ccb->ccb_h.path,
2129 periph = xpt_path_periph(ccb->ccb_h.path);
2135 xpt_setup_ccb(&cgd->ccb_h, ccb->ccb_h.path,
2137 cgd->ccb_h.func_code = XPT_GDEV_TYPE;
2140 if (cgd->ccb_h.status == CAM_REQ_CMP)
2145 sbuf_printf(&sb, "cam_status=\"0x%x\" ", ccb->ccb_h.status);
2147 switch (ccb->ccb_h.status & CAM_STATUS_MASK) {
2149 sbuf_printf(&sb, "timeout=%d ", ccb->ccb_h.timeout);
2181 switch (ccb->ccb_h.func_code) {