Lines Matching refs:ccb_h
692 if (xpt_create_path(&ccb->ccb_h.path, NULL, in fsl_sata_phy_check_events()
729 if ((ccb->ccb_h.func_code & XPT_FC_QUEUED) == 0 || in fsl_sata_done()
735 STAILQ_INSERT_TAIL(&ch->doneq, &ccb->ccb_h, sim_links.stqe); in fsl_sata_done()
742 struct ccb_hdr *ccb_h; in fsl_sata_intr() local
761 while ((ccb_h = STAILQ_FIRST(&tmp_doneq)) != NULL) { in fsl_sata_intr()
763 xpt_done_direct((union ccb *)ccb_h); in fsl_sata_intr()
827 fccb->ccb_h.status = CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ; in fsl_sata_intr_main()
828 if (!(fccb->ccb_h.status & CAM_DEV_QFRZN)) { in fsl_sata_intr_main()
829 xpt_freeze_devq(fccb->ccb_h.path, 1); in fsl_sata_intr_main()
830 fccb->ccb_h.status |= CAM_DEV_QFRZN; in fsl_sata_intr_main()
839 else if ((der & (1 << ch->slot[i].ccb->ccb_h.target_id)) != 0) in fsl_sata_intr_main()
855 int t = ccb->ccb_h.target_id; in fsl_sata_check_collision()
857 if ((ccb->ccb_h.func_code == XPT_ATA_IO) && in fsl_sata_check_collision()
870 if ((ccb->ccb_h.func_code == XPT_ATA_IO) && in fsl_sata_check_collision()
889 CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, in fsl_sata_begin_transaction()
890 ("fsl_sata_begin_transaction func_code=0x%x\n", ccb->ccb_h.func_code)); in fsl_sata_begin_transaction()
893 if ((ccb->ccb_h.func_code == XPT_ATA_IO) && in fsl_sata_begin_transaction()
895 tags = ch->curr[ccb->ccb_h.target_id].tags; in fsl_sata_begin_transaction()
915 ch->numrslotspd[ccb->ccb_h.target_id]++; in fsl_sata_begin_transaction()
916 if ((ccb->ccb_h.func_code == XPT_ATA_IO) && in fsl_sata_begin_transaction()
919 ch->numtslotspd[ccb->ccb_h.target_id]++; in fsl_sata_begin_transaction()
920 ch->taggedtarget = ccb->ccb_h.target_id; in fsl_sata_begin_transaction()
922 if ((ccb->ccb_h.func_code == XPT_ATA_IO) && in fsl_sata_begin_transaction()
925 if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { in fsl_sata_begin_transaction()
934 CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, in fsl_sata_begin_transaction()
980 ((slot->ccb->ccb_h.flags & CAM_DIR_IN) ? in fsl_sata_dmasetprd()
993 int port = ccb->ccb_h.target_id & 0x0f; in fsl_sata_execute_transaction()
999 CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, in fsl_sata_execute_transaction()
1000 ("fsl_sata_execute_transaction func_code=0x%x\n", ccb->ccb_h.func_code)); in fsl_sata_execute_transaction()
1014 if ((ccb->ccb_h.func_code == XPT_ATA_IO) && in fsl_sata_execute_transaction()
1029 (ccb->ccb_h.func_code == XPT_SCSI_IO ? FSL_SATA_CMD_ATAPI : 0) | in fsl_sata_execute_transaction()
1041 if (ccb->ccb_h.func_code == XPT_ATA_IO && in fsl_sata_execute_transaction()
1043 int count, timeout = ccb->ccb_h.timeout * 100; in fsl_sata_execute_transaction()
1080 callout_reset_sbt(&slot->timeout, SBT_1MS * ccb->ccb_h.timeout / 2, in fsl_sata_execute_transaction()
1117 SBT_1MS * slot->ccb->ccb_h.timeout / 2, 0, in fsl_sata_rearm_timeout()
1143 SBT_1MS * slot->ccb->ccb_h.timeout / 2, 0, in fsl_sata_timeout()
1149 slot->slot, slot->ccb->ccb_h.target_id & 0x0f); in fsl_sata_timeout()
1155 fccb->ccb_h.status = CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ; in fsl_sata_timeout()
1156 if (!(fccb->ccb_h.status & CAM_DEV_QFRZN)) { in fsl_sata_timeout()
1157 xpt_freeze_devq(fccb->ccb_h.path, 1); in fsl_sata_timeout()
1158 fccb->ccb_h.status |= CAM_DEV_QFRZN; in fsl_sata_timeout()
1186 if (ccb->ccb_h.func_code == XPT_ATA_IO) { in fsl_sata_end_transaction()
1217 (ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { in fsl_sata_end_transaction()
1222 if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { in fsl_sata_end_transaction()
1227 if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { in fsl_sata_end_transaction()
1229 (ccb->ccb_h.flags & CAM_DIR_IN) ? in fsl_sata_end_transaction()
1237 !(ccb->ccb_h.status & CAM_DEV_QFRZN)) { in fsl_sata_end_transaction()
1238 xpt_freeze_devq(ccb->ccb_h.path, 1); in fsl_sata_end_transaction()
1239 ccb->ccb_h.status |= CAM_DEV_QFRZN; in fsl_sata_end_transaction()
1242 ccb->ccb_h.status &= ~CAM_STATUS_MASK; in fsl_sata_end_transaction()
1245 ccb->ccb_h.status |= CAM_REQ_CMP; in fsl_sata_end_transaction()
1246 if (ccb->ccb_h.func_code == XPT_SCSI_IO) in fsl_sata_end_transaction()
1251 ccb->ccb_h.status |= CAM_REQ_INVALID; in fsl_sata_end_transaction()
1254 ccb->ccb_h.status |= CAM_REQUEUE_REQ; in fsl_sata_end_transaction()
1258 if (ccb->ccb_h.func_code == XPT_SCSI_IO) { in fsl_sata_end_transaction()
1259 ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR; in fsl_sata_end_transaction()
1262 ccb->ccb_h.status |= CAM_ATA_STATUS_ERROR; in fsl_sata_end_transaction()
1269 ccb->ccb_h.status &= ~CAM_STATUS_MASK; in fsl_sata_end_transaction()
1270 ccb->ccb_h.status |= CAM_RELEASE_SIMQ; in fsl_sata_end_transaction()
1272 ccb->ccb_h.status |= CAM_UNCOR_PARITY; in fsl_sata_end_transaction()
1277 ccb->ccb_h.status &= ~CAM_STATUS_MASK; in fsl_sata_end_transaction()
1278 ccb->ccb_h.status |= CAM_RELEASE_SIMQ; in fsl_sata_end_transaction()
1280 ccb->ccb_h.status |= CAM_CMD_TIMEOUT; in fsl_sata_end_transaction()
1284 ccb->ccb_h.status |= CAM_REQ_CMP_ERR; in fsl_sata_end_transaction()
1294 ch->numrslotspd[ccb->ccb_h.target_id]--; in fsl_sata_end_transaction()
1296 if ((ccb->ccb_h.func_code == XPT_ATA_IO) && in fsl_sata_end_transaction()
1299 ch->numtslotspd[ccb->ccb_h.target_id]--; in fsl_sata_end_transaction()
1310 if ((ccb->ccb_h.func_code == XPT_ATA_IO) && in fsl_sata_end_transaction()
1319 if (ccb->ccb_h.recovery_type == RECOVERY_READ_LOG) { in fsl_sata_end_transaction()
1322 } else if (ccb->ccb_h.recovery_type == RECOVERY_REQUEST_SENSE) { in fsl_sata_end_transaction()
1326 ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_SCSI_STATUS_ERROR && in fsl_sata_end_transaction()
1327 (ccb->ccb_h.flags & CAM_DIS_AUTOSENSE) == 0)) { in fsl_sata_end_transaction()
1387 ch->hold[i]->ccb_h.status &= ~CAM_STATUS_MASK; in fsl_sata_issue_recovery()
1388 ch->hold[i]->ccb_h.status |= CAM_RESRC_UNAVAIL; in fsl_sata_issue_recovery()
1396 ccb->ccb_h = ch->hold[i]->ccb_h; /* Reuse old header. */ in fsl_sata_issue_recovery()
1397 if (ccb->ccb_h.func_code == XPT_ATA_IO) { in fsl_sata_issue_recovery()
1399 ccb->ccb_h.recovery_type = RECOVERY_READ_LOG; in fsl_sata_issue_recovery()
1400 ccb->ccb_h.func_code = XPT_ATA_IO; in fsl_sata_issue_recovery()
1401 ccb->ccb_h.flags = CAM_DIR_IN; in fsl_sata_issue_recovery()
1402 ccb->ccb_h.timeout = 1000; /* 1s should be enough. */ in fsl_sata_issue_recovery()
1422 ccb->ccb_h.recovery_type = RECOVERY_REQUEST_SENSE; in fsl_sata_issue_recovery()
1423 ccb->ccb_h.recovery_slot = i; in fsl_sata_issue_recovery()
1424 ccb->ccb_h.func_code = XPT_SCSI_IO; in fsl_sata_issue_recovery()
1425 ccb->ccb_h.flags = CAM_DIR_IN; in fsl_sata_issue_recovery()
1426 ccb->ccb_h.status = 0; in fsl_sata_issue_recovery()
1427 ccb->ccb_h.timeout = 1000; /* 1s should be enough. */ in fsl_sata_issue_recovery()
1452 if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP && in fsl_sata_process_read_log()
1457 if (ch->hold[i]->ccb_h.func_code != XPT_ATA_IO) in fsl_sata_process_read_log()
1473 ch->hold[i]->ccb_h.status &= ~CAM_STATUS_MASK; in fsl_sata_process_read_log()
1474 ch->hold[i]->ccb_h.status |= CAM_REQUEUE_REQ; in fsl_sata_process_read_log()
1481 if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) in fsl_sata_process_read_log()
1489 if (ch->hold[i]->ccb_h.func_code != XPT_ATA_IO) in fsl_sata_process_read_log()
1508 i = ccb->ccb_h.recovery_slot; in fsl_sata_process_request_sense()
1509 if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { in fsl_sata_process_request_sense()
1510 ch->hold[i]->ccb_h.status |= CAM_AUTOSNS_VALID; in fsl_sata_process_request_sense()
1512 ch->hold[i]->ccb_h.status &= ~CAM_STATUS_MASK; in fsl_sata_process_request_sense()
1513 ch->hold[i]->ccb_h.status |= CAM_AUTOSENSE_FAIL; in fsl_sata_process_request_sense()
1583 fccb->ccb_h.status = CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ; in fsl_sata_reset()
1584 if (!(fccb->ccb_h.status & CAM_DEV_QFRZN)) { in fsl_sata_reset()
1585 xpt_freeze_devq(fccb->ccb_h.path, 1); in fsl_sata_reset()
1586 fccb->ccb_h.status |= CAM_DEV_QFRZN; in fsl_sata_reset()
1649 fis[1] = (ccb->ccb_h.target_id & 0x0f); in fsl_sata_setup_fis()
1650 if (ccb->ccb_h.func_code == XPT_SCSI_IO) { in fsl_sata_setup_fis()
1653 if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE && in fsl_sata_setup_fis()
1654 ch->curr[ccb->ccb_h.target_id].mode >= ATA_DMA) in fsl_sata_setup_fis()
1662 bcopy((ccb->ccb_h.flags & CAM_CDB_POINTER) ? in fsl_sata_setup_fis()
1696 if (ccb->ccb_h.target_id > 15) { in fsl_sata_check_ids()
1697 ccb->ccb_h.status = CAM_TID_INVALID; in fsl_sata_check_ids()
1701 if (ccb->ccb_h.target_lun != 0) { in fsl_sata_check_ids()
1702 ccb->ccb_h.status = CAM_LUN_INVALID; in fsl_sata_check_ids()
1714 CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, in fsl_sataaction()
1715 ("fsl_sataaction func_code=0x%x\n", ccb->ccb_h.func_code)); in fsl_sataaction()
1718 switch (ccb->ccb_h.func_code) { in fsl_sataaction()
1726 ccb->ccb_h.target_id > 0 && ccb->ccb_h.target_id < 15)) { in fsl_sataaction()
1727 ccb->ccb_h.status = CAM_SEL_TIMEOUT; in fsl_sataaction()
1730 ccb->ccb_h.recovery_type = RECOVERY_NONE; in fsl_sataaction()
1743 ccb->ccb_h.status = CAM_REQ_INVALID; in fsl_sataaction()
1753 d = &ch->curr[ccb->ccb_h.target_id]; in fsl_sataaction()
1755 d = &ch->user[ccb->ccb_h.target_id]; in fsl_sataaction()
1768 ccb->ccb_h.status = CAM_REQ_CMP; in fsl_sataaction()
1781 d = &ch->curr[ccb->ccb_h.target_id]; in fsl_sataaction()
1783 d = &ch->user[ccb->ccb_h.target_id]; in fsl_sataaction()
1791 (ccb->ccb_h.target_id == 15 || in fsl_sataaction()
1792 (ccb->ccb_h.target_id == 0 && !ch->pm_present))) { in fsl_sataaction()
1806 ch->user[ccb->ccb_h.target_id].caps; in fsl_sataaction()
1824 ccb->ccb_h.status = CAM_REQ_CMP; in fsl_sataaction()
1830 ccb->ccb_h.status = CAM_REQ_CMP; in fsl_sataaction()
1834 ccb->ccb_h.status = CAM_REQ_INVALID; in fsl_sataaction()
1871 cpi->ccb_h.status = CAM_REQ_CMP; in fsl_sataaction()
1875 ccb->ccb_h.status = CAM_REQ_INVALID; in fsl_sataaction()