Lines Matching refs:ccb_h

612 		if (xpt_create_path(&ccb->ccb_h.path, NULL,  in mvs_phy_check_events()
776 ch->slot[i].ccb->ccb_h.target_id != port) in mvs_ch_intr()
866 if (ccb->ccb_h.func_code == XPT_ATA_IO) { /* ATA PIO */ in mvs_legacy_intr()
869 if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { in mvs_legacy_intr()
871 if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { in mvs_legacy_intr()
891 if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) { in mvs_legacy_intr()
906 if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) in mvs_legacy_intr()
931 if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { in mvs_legacy_intr()
946 ch->curr[ccb->ccb_h.target_id].bytecount); in mvs_legacy_intr()
951 if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) { in mvs_legacy_intr()
972 ch->curr[ccb->ccb_h.target_id].bytecount); in mvs_legacy_intr()
979 if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { in mvs_legacy_intr()
985 else if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) { in mvs_legacy_intr()
1088 if (ccb->ccb_h.func_code == XPT_ATA_IO) { in mvs_check_collision()
1101 ch->taggedtarget != ccb->ccb_h.target_id) in mvs_check_collision()
1187 if (ccb->ccb_h.func_code == XPT_ATA_IO && in mvs_begin_transaction()
1194 if ((ccb->ccb_h.func_code == XPT_ATA_IO) && in mvs_begin_transaction()
1197 tag = ffs(~ch->otagspd[ccb->ccb_h.target_id]) - 1; in mvs_begin_transaction()
1212 ch->numrslotspd[ccb->ccb_h.target_id]++; in mvs_begin_transaction()
1213 if (ccb->ccb_h.func_code == XPT_ATA_IO) { in mvs_begin_transaction()
1215 ch->otagspd[ccb->ccb_h.target_id] |= (1 << slot->tag); in mvs_begin_transaction()
1217 ch->numtslotspd[ccb->ccb_h.target_id]++; in mvs_begin_transaction()
1218 ch->taggedtarget = ccb->ccb_h.target_id; in mvs_begin_transaction()
1232 uint8_t *cdb = (ccb->ccb_h.flags & CAM_CDB_POINTER) ? in mvs_begin_transaction()
1236 if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE && in mvs_begin_transaction()
1237 ch->curr[ccb->ccb_h.target_id].mode >= ATA_DMA && in mvs_begin_transaction()
1292 ((slot->ccb->ccb_h.flags & CAM_DIR_IN) ? in mvs_dmasetprd()
1307 int port = ccb->ccb_h.target_id & 0x0f; in mvs_legacy_execute_transaction()
1313 if (ccb->ccb_h.func_code == XPT_ATA_IO) { in mvs_legacy_execute_transaction()
1334 if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) in mvs_legacy_execute_transaction()
1337 if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) { in mvs_legacy_execute_transaction()
1394 (uint16_t *)((ccb->ccb_h.flags & CAM_CDB_POINTER) ? in mvs_legacy_execute_transaction()
1404 (((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) ? in mvs_legacy_execute_transaction()
1409 callout_reset_sbt(&slot->timeout, SBT_1MS * ccb->ccb_h.timeout, 0, in mvs_legacy_execute_transaction()
1423 int port = ccb->ccb_h.target_id & 0x0f; in mvs_execute_transaction()
1433 ((ccb->ccb_h.flags & CAM_DIR_IN) ? MVS_CRQB2E_READ : 0) | in mvs_execute_transaction()
1472 ((ccb->ccb_h.flags & CAM_DIR_IN) ? MVS_CRQB_READ : 0) | in mvs_execute_transaction()
1524 callout_reset_sbt(&slot->timeout, SBT_1MS * ccb->ccb_h.timeout, 0, in mvs_execute_transaction()
1563 SBT_1MS * slot->ccb->ccb_h.timeout / 2, 0, in mvs_rearm_timeout()
1615 if (ccb->ccb_h.func_code == XPT_ATA_IO) { in mvs_end_transaction()
1624 if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE && in mvs_end_transaction()
1629 if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { in mvs_end_transaction()
1631 (ccb->ccb_h.flags & CAM_DIR_IN) ? in mvs_end_transaction()
1640 !(ccb->ccb_h.status & CAM_DEV_QFRZN)) { in mvs_end_transaction()
1641 xpt_freeze_devq(ccb->ccb_h.path, 1); in mvs_end_transaction()
1642 ccb->ccb_h.status |= CAM_DEV_QFRZN; in mvs_end_transaction()
1645 ccb->ccb_h.status &= ~CAM_STATUS_MASK; in mvs_end_transaction()
1648 ccb->ccb_h.status |= CAM_REQ_CMP; in mvs_end_transaction()
1649 if (ccb->ccb_h.func_code == XPT_SCSI_IO) in mvs_end_transaction()
1654 ccb->ccb_h.status |= CAM_REQ_INVALID; in mvs_end_transaction()
1657 ccb->ccb_h.status |= CAM_REQUEUE_REQ; in mvs_end_transaction()
1661 if (ccb->ccb_h.func_code == XPT_SCSI_IO) { in mvs_end_transaction()
1662 ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR; in mvs_end_transaction()
1665 ccb->ccb_h.status |= CAM_ATA_STATUS_ERROR; in mvs_end_transaction()
1672 ccb->ccb_h.status &= ~CAM_STATUS_MASK; in mvs_end_transaction()
1673 ccb->ccb_h.status |= CAM_RELEASE_SIMQ; in mvs_end_transaction()
1675 ccb->ccb_h.status |= CAM_UNCOR_PARITY; in mvs_end_transaction()
1680 ccb->ccb_h.status &= ~CAM_STATUS_MASK; in mvs_end_transaction()
1681 ccb->ccb_h.status |= CAM_RELEASE_SIMQ; in mvs_end_transaction()
1683 ccb->ccb_h.status |= CAM_CMD_TIMEOUT; in mvs_end_transaction()
1687 ccb->ccb_h.status |= CAM_REQ_CMP_ERR; in mvs_end_transaction()
1697 ch->numrslotspd[ccb->ccb_h.target_id]--; in mvs_end_transaction()
1698 if (ccb->ccb_h.func_code == XPT_ATA_IO) { in mvs_end_transaction()
1700 ch->otagspd[ccb->ccb_h.target_id] &= ~(1 << slot->tag); in mvs_end_transaction()
1702 ch->numtslotspd[ccb->ccb_h.target_id]--; in mvs_end_transaction()
1720 if (ccb->ccb_h.recovery_type == RECOVERY_READ_LOG) { in mvs_end_transaction()
1723 } else if (ccb->ccb_h.recovery_type == RECOVERY_REQUEST_SENSE) { in mvs_end_transaction()
1727 ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_SCSI_STATUS_ERROR && in mvs_end_transaction()
1728 (ccb->ccb_h.flags & CAM_DIS_AUTOSENSE) == 0)) { in mvs_end_transaction()
1790 ch->hold[i]->ccb_h.status &= ~CAM_STATUS_MASK; in mvs_issue_recovery()
1791 ch->hold[i]->ccb_h.status |= CAM_RESRC_UNAVAIL; in mvs_issue_recovery()
1799 xpt_setup_ccb(&ccb->ccb_h, ch->hold[i]->ccb_h.path, in mvs_issue_recovery()
1800 ch->hold[i]->ccb_h.pinfo.priority); in mvs_issue_recovery()
1801 if (ch->hold[i]->ccb_h.func_code == XPT_ATA_IO) { in mvs_issue_recovery()
1803 ccb->ccb_h.recovery_type = RECOVERY_READ_LOG; in mvs_issue_recovery()
1804 ccb->ccb_h.func_code = XPT_ATA_IO; in mvs_issue_recovery()
1805 ccb->ccb_h.flags = CAM_DIR_IN; in mvs_issue_recovery()
1806 ccb->ccb_h.timeout = 1000; /* 1s should be enough. */ in mvs_issue_recovery()
1826 ccb->ccb_h.recovery_type = RECOVERY_REQUEST_SENSE; in mvs_issue_recovery()
1827 ccb->ccb_h.recovery_slot = i; in mvs_issue_recovery()
1828 ccb->ccb_h.func_code = XPT_SCSI_IO; in mvs_issue_recovery()
1829 ccb->ccb_h.flags = CAM_DIR_IN; in mvs_issue_recovery()
1830 ccb->ccb_h.status = 0; in mvs_issue_recovery()
1831 ccb->ccb_h.timeout = 1000; /* 1s should be enough. */ in mvs_issue_recovery()
1857 if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP && in mvs_process_read_log()
1862 if (ch->hold[i]->ccb_h.target_id != ccb->ccb_h.target_id) in mvs_process_read_log()
1878 ch->hold[i]->ccb_h.status &= ~CAM_STATUS_MASK; in mvs_process_read_log()
1879 ch->hold[i]->ccb_h.status |= CAM_REQUEUE_REQ; in mvs_process_read_log()
1886 if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) in mvs_process_read_log()
1895 if (ch->hold[i]->ccb_h.target_id != ccb->ccb_h.target_id) in mvs_process_read_log()
1915 i = ccb->ccb_h.recovery_slot; in mvs_process_request_sense()
1916 if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { in mvs_process_request_sense()
1917 ch->hold[i]->ccb_h.status |= CAM_AUTOSNS_VALID; in mvs_process_request_sense()
1919 ch->hold[i]->ccb_h.status &= ~CAM_STATUS_MASK; in mvs_process_request_sense()
1920 ch->hold[i]->ccb_h.status |= CAM_AUTOSENSE_FAIL; in mvs_process_request_sense()
1955 fccb->ccb_h.status = CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ; in mvs_requeue_frozen()
1956 if (!(fccb->ccb_h.status & CAM_DEV_QFRZN)) { in mvs_requeue_frozen()
1957 xpt_freeze_devq(fccb->ccb_h.path, 1); in mvs_requeue_frozen()
1958 fccb->ccb_h.status |= CAM_DEV_QFRZN; in mvs_requeue_frozen()
2110 int port = ccb->ccb_h.target_id & 0x0f; in mvs_softreset()
2119 ccb->ccb_h.status &= ~CAM_STATUS_MASK; in mvs_softreset()
2121 if ((i = mvs_wait(dev, 0, ATA_S_BUSY, ccb->ccb_h.timeout)) < 0) { in mvs_softreset()
2122 ccb->ccb_h.status |= CAM_CMD_TIMEOUT; in mvs_softreset()
2127 ccb->ccb_h.status |= CAM_ATA_STATUS_ERROR; in mvs_softreset()
2129 ccb->ccb_h.status |= CAM_REQ_CMP; in mvs_softreset()
2147 mvs_wait(dev, 0, ATA_S_BUSY | ATA_S_DRQ, ccb->ccb_h.timeout); in mvs_softreset()
2232 if (ccb->ccb_h.target_id > ((ch->quirks & MVS_Q_GENI) ? 0 : 15)) { in mvs_check_ids()
2233 ccb->ccb_h.status = CAM_TID_INVALID; in mvs_check_ids()
2237 if (ccb->ccb_h.target_lun != 0) { in mvs_check_ids()
2238 ccb->ccb_h.status = CAM_LUN_INVALID; in mvs_check_ids()
2245 KASSERT(ccb->ccb_h.func_code != XPT_ATA_IO || in mvs_check_ids()
2257 CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("mvsaction func_code=%x\n", in mvsaction()
2258 ccb->ccb_h.func_code)); in mvsaction()
2262 switch (ccb->ccb_h.func_code) { in mvsaction()
2270 ccb->ccb_h.target_id > 0 && ccb->ccb_h.target_id < 15)) { in mvsaction()
2271 ccb->ccb_h.status = CAM_SEL_TIMEOUT; in mvsaction()
2274 ccb->ccb_h.recovery_type = RECOVERY_NONE; in mvsaction()
2287 ccb->ccb_h.status = CAM_REQ_INVALID; in mvsaction()
2297 d = &ch->curr[ccb->ccb_h.target_id]; in mvsaction()
2299 d = &ch->user[ccb->ccb_h.target_id]; in mvsaction()
2316 ccb->ccb_h.status = CAM_REQ_CMP; in mvsaction()
2329 d = &ch->curr[ccb->ccb_h.target_id]; in mvsaction()
2331 d = &ch->user[ccb->ccb_h.target_id]; in mvsaction()
2339 (ccb->ccb_h.target_id == 15 || in mvsaction()
2340 (ccb->ccb_h.target_id == 0 && !ch->pm_present))) { in mvsaction()
2353 ch->user[ccb->ccb_h.target_id].caps; in mvsaction()
2374 ccb->ccb_h.status = CAM_REQ_CMP; in mvsaction()
2380 ccb->ccb_h.status = CAM_REQ_CMP; in mvsaction()
2384 ccb->ccb_h.status = CAM_REQ_INVALID; in mvsaction()
2425 cpi->ccb_h.status = CAM_REQ_CMP; in mvsaction()
2429 ccb->ccb_h.status = CAM_REQ_INVALID; in mvsaction()