Lines Matching refs:scp

1073 		scb->scp		= NULL;  in megaraid_alloc_cmd_packets()
1274 megaraid_alloc_scb(adapter_t *adapter, struct scsi_cmnd *scp) in megaraid_alloc_scb() argument
1294 scb->scp = scp; in megaraid_alloc_scb()
1318 scb->scp = NULL; in megaraid_dealloc_scb()
1341 struct scsi_cmnd *scp; in megaraid_mbox_mksgl() local
1346 scp = scb->scp; in megaraid_mbox_mksgl()
1349 sgcnt = scsi_dma_map(scp); in megaraid_mbox_mksgl()
1358 scsi_for_each_sg(scp, sgl, sgcnt, i) { in megaraid_mbox_mksgl()
1437 static int megaraid_queue_command_lck(struct scsi_cmnd *scp) in megaraid_queue_command_lck() argument
1444 adapter = SCP2ADAPTER(scp); in megaraid_queue_command_lck()
1445 scp->result = 0; in megaraid_queue_command_lck()
1456 scb = megaraid_mbox_build_cmd(adapter, scp, &if_busy); in megaraid_queue_command_lck()
1458 done(scp); in megaraid_queue_command_lck()
1480 megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy) in DEF_SCSI_QCMD()
1500 MRAID_GET_DEVICE_MAP(adapter, scp, channel, target, islogical); in DEF_SCSI_QCMD()
1506 switch (scp->cmnd[0]) { in DEF_SCSI_QCMD()
1513 scp->result = (DID_OK << 16); in DEF_SCSI_QCMD()
1517 if (!(scb = megaraid_alloc_scb(adapter, scp))) { in DEF_SCSI_QCMD()
1518 scp->result = (DID_ERROR << 16); in DEF_SCSI_QCMD()
1523 scb->dma_direction = scp->sc_data_direction; in DEF_SCSI_QCMD()
1543 sgl = scsi_sglist(scp); in DEF_SCSI_QCMD()
1547 memset(vaddr, 0, scp->cmnd[4]); in DEF_SCSI_QCMD()
1555 scp->result = (DID_OK << 16); in DEF_SCSI_QCMD()
1563 if (!(rdev->last_disp & (1L << SCP2CHANNEL(scp)))) { in DEF_SCSI_QCMD()
1568 SCP2CHANNEL(scp))); in DEF_SCSI_QCMD()
1573 rdev->last_disp |= (1L << SCP2CHANNEL(scp)); in DEF_SCSI_QCMD()
1576 if (scp->cmnd[1] & MEGA_SCSI_INQ_EVPD) { in DEF_SCSI_QCMD()
1577 scsi_build_sense(scp, 0, ILLEGAL_REQUEST, in DEF_SCSI_QCMD()
1589 if (SCP2LUN(scp)) { in DEF_SCSI_QCMD()
1590 scp->result = (DID_BAD_TARGET << 16); in DEF_SCSI_QCMD()
1594 scp->result = (DID_BAD_TARGET << 16); in DEF_SCSI_QCMD()
1600 if (!(scb = megaraid_alloc_scb(adapter, scp))) { in DEF_SCSI_QCMD()
1601 scp->result = (DID_ERROR << 16); in DEF_SCSI_QCMD()
1618 pthru->cdblen = scp->cmd_len; in DEF_SCSI_QCMD()
1619 memcpy(pthru->cdb, scp->cmnd, scp->cmd_len); in DEF_SCSI_QCMD()
1622 scb->dma_direction = scp->sc_data_direction; in DEF_SCSI_QCMD()
1624 pthru->dataxferlen = scsi_bufflen(scp); in DEF_SCSI_QCMD()
1645 if (!(scb = megaraid_alloc_scb(adapter, scp))) { in DEF_SCSI_QCMD()
1646 scp->result = (DID_ERROR << 16); in DEF_SCSI_QCMD()
1661 mbox->cmd = (scp->cmnd[0] & 0x02) ? MBOXCMD_LWRITE64: in DEF_SCSI_QCMD()
1667 if (scp->cmd_len == 6) { in DEF_SCSI_QCMD()
1668 mbox->numsectors = (uint32_t)scp->cmnd[4]; in DEF_SCSI_QCMD()
1670 ((uint32_t)scp->cmnd[1] << 16) | in DEF_SCSI_QCMD()
1671 ((uint32_t)scp->cmnd[2] << 8) | in DEF_SCSI_QCMD()
1672 (uint32_t)scp->cmnd[3]; in DEF_SCSI_QCMD()
1680 else if (scp->cmd_len == 10) { in DEF_SCSI_QCMD()
1682 (uint32_t)scp->cmnd[8] | in DEF_SCSI_QCMD()
1683 ((uint32_t)scp->cmnd[7] << 8); in DEF_SCSI_QCMD()
1685 ((uint32_t)scp->cmnd[2] << 24) | in DEF_SCSI_QCMD()
1686 ((uint32_t)scp->cmnd[3] << 16) | in DEF_SCSI_QCMD()
1687 ((uint32_t)scp->cmnd[4] << 8) | in DEF_SCSI_QCMD()
1688 (uint32_t)scp->cmnd[5]; in DEF_SCSI_QCMD()
1694 else if (scp->cmd_len == 12) { in DEF_SCSI_QCMD()
1696 ((uint32_t)scp->cmnd[2] << 24) | in DEF_SCSI_QCMD()
1697 ((uint32_t)scp->cmnd[3] << 16) | in DEF_SCSI_QCMD()
1698 ((uint32_t)scp->cmnd[4] << 8) | in DEF_SCSI_QCMD()
1699 (uint32_t)scp->cmnd[5]; in DEF_SCSI_QCMD()
1702 ((uint32_t)scp->cmnd[6] << 24) | in DEF_SCSI_QCMD()
1703 ((uint32_t)scp->cmnd[7] << 16) | in DEF_SCSI_QCMD()
1704 ((uint32_t)scp->cmnd[8] << 8) | in DEF_SCSI_QCMD()
1705 (uint32_t)scp->cmnd[9]; in DEF_SCSI_QCMD()
1713 scp->result = (DID_ERROR << 16); in DEF_SCSI_QCMD()
1717 scb->dma_direction = scp->sc_data_direction; in DEF_SCSI_QCMD()
1734 scp->result = (DID_BAD_TARGET << 16); in DEF_SCSI_QCMD()
1741 if (!(scb = megaraid_alloc_scb(adapter, scp))) { in DEF_SCSI_QCMD()
1742 scp->result = (DID_ERROR << 16); in DEF_SCSI_QCMD()
1751 ccb->raw_mbox[2] = (scp->cmnd[0] == RESERVE) ? in DEF_SCSI_QCMD()
1755 scb->dma_direction = scp->sc_data_direction; in DEF_SCSI_QCMD()
1760 scp->result = (DID_BAD_TARGET << 16); in DEF_SCSI_QCMD()
1767 if (target > 15 || SCP2LUN(scp) > 7) { in DEF_SCSI_QCMD()
1768 scp->result = (DID_BAD_TARGET << 16); in DEF_SCSI_QCMD()
1776 (SCP2CHANNEL(scp) == adapter->max_channel -1)) { in DEF_SCSI_QCMD()
1787 if (!(rdev->last_disp & (1L << SCP2CHANNEL(scp)))) { in DEF_SCSI_QCMD()
1793 adapter->host->host_no, ss, SCP2CHANNEL(scp), in DEF_SCSI_QCMD()
1799 rdev->last_disp |= (1L << SCP2CHANNEL(scp)); in DEF_SCSI_QCMD()
1804 scp->result = (DID_BAD_TARGET << 16); in DEF_SCSI_QCMD()
1809 if (!(scb = megaraid_alloc_scb(adapter, scp))) { in DEF_SCSI_QCMD()
1810 scp->result = (DID_ERROR << 16); in DEF_SCSI_QCMD()
1818 scb->dma_direction = scp->sc_data_direction; in DEF_SCSI_QCMD()
1826 megaraid_mbox_prepare_epthru(adapter, scb, scp); in DEF_SCSI_QCMD()
1835 megaraid_mbox_prepare_pthru(adapter, scb, scp); in DEF_SCSI_QCMD()
1934 struct scsi_cmnd *scp) in megaraid_mbox_prepare_pthru() argument
1952 pthru->logdrv = SCP2LUN(scp); in megaraid_mbox_prepare_pthru()
1954 pthru->cdblen = scp->cmd_len; in megaraid_mbox_prepare_pthru()
1956 memcpy(pthru->cdb, scp->cmnd, scp->cmd_len); in megaraid_mbox_prepare_pthru()
1958 if (scsi_bufflen(scp)) { in megaraid_mbox_prepare_pthru()
1959 pthru->dataxferlen = scsi_bufflen(scp); in megaraid_mbox_prepare_pthru()
1983 struct scsi_cmnd *scp) in megaraid_mbox_prepare_epthru() argument
2001 epthru->logdrv = SCP2LUN(scp); in megaraid_mbox_prepare_epthru()
2003 epthru->cdblen = scp->cmd_len; in megaraid_mbox_prepare_epthru()
2005 memcpy(epthru->cdb, scp->cmnd, scp->cmd_len); in megaraid_mbox_prepare_epthru()
2007 if (scsi_bufflen(scp)) { in megaraid_mbox_prepare_epthru()
2008 epthru->dataxferlen = scsi_bufflen(scp); in megaraid_mbox_prepare_epthru()
2177 struct scsi_cmnd *scp; in megaraid_mbox_dpc() local
2208 scp = scb->scp; in megaraid_mbox_dpc()
2218 scb->sno, scb->state, scp)); in megaraid_mbox_dpc()
2254 islogical = MRAID_IS_LOGICAL(adapter, scp); in megaraid_mbox_dpc()
2255 if (scp->cmnd[0] == INQUIRY && status == 0 && islogical == 0 in megaraid_mbox_dpc()
2258 sgl = scsi_sglist(scp); in megaraid_mbox_dpc()
2290 scp->result = (DID_OK << 16); in megaraid_mbox_dpc()
2299 memcpy(scp->sense_buffer, pthru->reqsensearea, in megaraid_mbox_dpc()
2302 scp->result = SAM_STAT_CHECK_CONDITION; in megaraid_mbox_dpc()
2307 memcpy(scp->sense_buffer, in megaraid_mbox_dpc()
2310 scp->result = SAM_STAT_CHECK_CONDITION; in megaraid_mbox_dpc()
2312 scsi_build_sense(scp, 0, in megaraid_mbox_dpc()
2319 scp->result = DID_BUS_BUSY << 16 | status; in megaraid_mbox_dpc()
2328 if (scp->cmnd[0] == TEST_UNIT_READY) { in megaraid_mbox_dpc()
2329 scp->result = DID_ERROR << 16 | in megaraid_mbox_dpc()
2337 if (status == 1 && (scp->cmnd[0] == RESERVE || in megaraid_mbox_dpc()
2338 scp->cmnd[0] == RELEASE)) { in megaraid_mbox_dpc()
2340 scp->result = DID_ERROR << 16 | in megaraid_mbox_dpc()
2344 scp->result = DID_BAD_TARGET << 16 | status; in megaraid_mbox_dpc()
2353 scsi_dma_unmap(scp); in megaraid_mbox_dpc()
2362 scsi_done(scp); in megaraid_mbox_dpc()
2377 megaraid_abort_handler(struct scsi_cmnd *scp) in megaraid_abort_handler() argument
2388 adapter = SCP2ADAPTER(scp); in megaraid_abort_handler()
2393 scp->cmnd[0], SCP2CHANNEL(scp), in megaraid_abort_handler()
2394 SCP2TARGET(scp), SCP2LUN(scp))); in megaraid_abort_handler()
2411 if (scb->scp == scp) { // Found command in megaraid_abort_handler()
2419 scp->result = (DID_ABORT << 16); in megaraid_abort_handler()
2420 scsi_done(scp); in megaraid_abort_handler()
2439 if (scb->scp == scp) { // Found command in megaraid_abort_handler()
2449 scp->result = (DID_ABORT << 16); in megaraid_abort_handler()
2450 scsi_done(scp); in megaraid_abort_handler()
2472 if (scb->scp == scp) { in megaraid_abort_handler()
2515 megaraid_reset_handler(struct scsi_cmnd *scp) in megaraid_reset_handler() argument
2528 adapter = SCP2ADAPTER(scp); in megaraid_reset_handler()
2559 if (scb->scp == scp) { // Found command in megaraid_reset_handler()
2569 scb->scp->result = (DID_RESET << 16); in megaraid_reset_handler()
2570 scsi_done(scb->scp); in megaraid_reset_handler()
3306 struct scsi_cmnd *scp; in megaraid_mbox_display_scb() local
3313 scp = scb->scp; in megaraid_mbox_display_scb()
3326 if (!scp) return; in megaraid_mbox_display_scb()
3330 for (i = 0; i < scp->cmd_len; i++) { in megaraid_mbox_display_scb()
3331 con_log(level, ("%#2.02x ", scp->cmnd[i])); in megaraid_mbox_display_scb()
3441 scb->scp = NULL; in megaraid_cmm_register()
3691 scb->scp = NULL; in megaraid_mbox_mm_done()