• Home
  • Raw
  • Download

Lines Matching refs:scb

377 	scb_t	*scb;  in megaraid_queue_lck()  local
396 scb = mega_build_cmd(adapter, scmd, &busy); in megaraid_queue_lck()
397 if (!scb) in megaraid_queue_lck()
400 scb->state |= SCB_PENDQ; in megaraid_queue_lck()
401 list_add_tail(&scb->list, &adapter->pending_list); in megaraid_queue_lck()
431 scb_t *scb; in DEF_SCSI_QCMD() local
436 scb = list_entry(head->next, scb_t, list); in DEF_SCSI_QCMD()
440 scb->state = SCB_ACTIVE; in DEF_SCSI_QCMD()
441 scb->cmd = cmd; in DEF_SCSI_QCMD()
442 scb->dma_type = MEGA_DMA_TYPE_NONE; in DEF_SCSI_QCMD()
444 return scb; in DEF_SCSI_QCMD()
526 scb_t *scb; in mega_build_cmd() local
644 if(!(scb = mega_allocate_scb(adapter, cmd))) { in mega_build_cmd()
649 scb->raw_mbox[0] = MEGA_CLUSTER_CMD; in mega_build_cmd()
650 scb->raw_mbox[2] = MEGA_RESERVATION_STATUS; in mega_build_cmd()
651 scb->raw_mbox[3] = ldrv_num; in mega_build_cmd()
653 scb->dma_direction = DMA_NONE; in mega_build_cmd()
655 return scb; in mega_build_cmd()
692 if(!(scb = mega_allocate_scb(adapter, cmd))) { in mega_build_cmd()
696 pthru = scb->pthru; in mega_build_cmd()
698 mbox = (mbox_t *)scb->raw_mbox; in mega_build_cmd()
699 memset(mbox, 0, sizeof(scb->raw_mbox)); in mega_build_cmd()
717 scb->dma_direction = DMA_FROM_DEVICE; in mega_build_cmd()
719 pthru->numsgelements = mega_build_sglist(adapter, scb, in mega_build_cmd()
722 mbox->m_out.xferaddr = scb->pthru_dma_addr; in mega_build_cmd()
724 return scb; in mega_build_cmd()
734 if(!(scb = mega_allocate_scb(adapter, cmd))) { in mega_build_cmd()
738 mbox = (mbox_t *)scb->raw_mbox; in mega_build_cmd()
740 memset(mbox, 0, sizeof(scb->raw_mbox)); in mega_build_cmd()
847 scb->dma_direction = DMA_FROM_DEVICE; in mega_build_cmd()
850 scb->dma_direction = DMA_TO_DEVICE; in mega_build_cmd()
854 mbox->m_out.numsgelements = mega_build_sglist(adapter, scb, in mega_build_cmd()
857 return scb; in mega_build_cmd()
874 if(!(scb = mega_allocate_scb(adapter, cmd))) { in mega_build_cmd()
879 scb->raw_mbox[0] = MEGA_CLUSTER_CMD; in mega_build_cmd()
880 scb->raw_mbox[2] = ( *cmd->cmnd == RESERVE ) ? in mega_build_cmd()
883 scb->raw_mbox[3] = ldrv_num; in mega_build_cmd()
885 scb->dma_direction = DMA_NONE; in mega_build_cmd()
887 return scb; in mega_build_cmd()
902 if(!(scb = mega_allocate_scb(adapter, cmd))) { in mega_build_cmd()
907 mbox = (mbox_t *)scb->raw_mbox; in mega_build_cmd()
908 memset(mbox, 0, sizeof(scb->raw_mbox)); in mega_build_cmd()
912 mega_prepare_extpassthru(adapter, scb, cmd, in mega_build_cmd()
917 mbox->m_out.xferaddr = scb->epthru_dma_addr; in mega_build_cmd()
922 pthru = mega_prepare_passthru(adapter, scb, cmd, in mega_build_cmd()
933 mbox->m_out.xferaddr = scb->pthru_dma_addr; in mega_build_cmd()
936 return scb; in mega_build_cmd()
953 mega_prepare_passthru(adapter_t *adapter, scb_t *scb, struct scsi_cmnd *cmd, in mega_prepare_passthru() argument
958 pthru = scb->pthru; in mega_prepare_passthru()
979 scb->dma_direction = DMA_BIDIRECTIONAL; in mega_prepare_passthru()
997 pthru->numsgelements = mega_build_sglist(adapter, scb, in mega_prepare_passthru()
1017 mega_prepare_extpassthru(adapter_t *adapter, scb_t *scb, in mega_prepare_extpassthru() argument
1023 epthru = scb->epthru; in mega_prepare_extpassthru()
1043 scb->dma_direction = DMA_BIDIRECTIONAL; in mega_prepare_extpassthru()
1060 epthru->numsgelements = mega_build_sglist(adapter, scb, in mega_prepare_extpassthru()
1071 scb_t *scb; in __mega_runpendq() local
1077 scb = list_entry(pos, scb_t, list); in __mega_runpendq()
1079 if( !(scb->state & SCB_ISSUED) ) { in __mega_runpendq()
1081 if( issue_scb(adapter, scb) != 0 ) in __mega_runpendq()
1100 issue_scb(adapter_t *adapter, scb_t *scb) in issue_scb() argument
1116 memcpy((char *)&mbox->m_out, (char *)scb->raw_mbox, in issue_scb()
1119 mbox->m_out.cmdid = scb->idx; /* Set cmdid */ in issue_scb()
1145 scb->state |= SCB_ISSUED; in issue_scb()
1424 scb_t *scb; in mega_cmd_done() local
1445 scb = &adapter->int_scb; in mega_cmd_done()
1447 list_del_init(&scb->list); in mega_cmd_done()
1448 scb->state = SCB_FREE; in mega_cmd_done()
1453 scb = &adapter->scb_list[cmdid]; in mega_cmd_done()
1458 if( !(scb->state & SCB_ISSUED) || scb->cmd == NULL ) { in mega_cmd_done()
1461 cmdid, scb->state, scb->cmd); in mega_cmd_done()
1469 if( scb->state & SCB_ABORT ) { in mega_cmd_done()
1473 scb->idx); in mega_cmd_done()
1475 scb->cmd->result = (DID_ABORT << 16); in mega_cmd_done()
1477 list_add_tail(SCSI_LIST(scb->cmd), in mega_cmd_done()
1480 mega_free_scb(adapter, scb); in mega_cmd_done()
1488 if( scb->state & SCB_RESET ) { in mega_cmd_done()
1492 scb->idx); in mega_cmd_done()
1494 scb->cmd->result = (DID_RESET << 16); in mega_cmd_done()
1496 list_add_tail(SCSI_LIST(scb->cmd), in mega_cmd_done()
1499 mega_free_scb (adapter, scb); in mega_cmd_done()
1504 cmd = scb->cmd; in mega_cmd_done()
1505 pthru = scb->pthru; in mega_cmd_done()
1506 epthru = scb->epthru; in mega_cmd_done()
1507 mbox = (mbox_t *)scb->raw_mbox; in mega_cmd_done()
1639 mega_free_scb(adapter, scb); in mega_cmd_done()
1675 mega_free_scb(adapter_t *adapter, scb_t *scb) in mega_free_scb() argument
1677 switch( scb->dma_type ) { in mega_free_scb()
1683 scsi_dma_unmap(scb->cmd); in mega_free_scb()
1692 list_del_init(&scb->list); in mega_free_scb()
1695 scb->state = SCB_FREE; in mega_free_scb()
1696 scb->cmd = NULL; in mega_free_scb()
1698 list_add(&scb->list, &adapter->free_list); in mega_free_scb()
1722 mega_build_sglist(adapter_t *adapter, scb_t *scb, u32 *buf, u32 *len) in mega_build_sglist() argument
1729 cmd = scb->cmd; in mega_build_sglist()
1738 scb->dma_type = MEGA_SGLIST; in mega_build_sglist()
1746 scb->dma_h_bulkdata = sg_dma_address(sg); in mega_build_sglist()
1747 *buf = (u32)scb->dma_h_bulkdata; in mega_build_sglist()
1754 scb->sgl64[idx].address = sg_dma_address(sg); in mega_build_sglist()
1755 *len += scb->sgl64[idx].length = sg_dma_len(sg); in mega_build_sglist()
1757 scb->sgl[idx].address = sg_dma_address(sg); in mega_build_sglist()
1758 *len += scb->sgl[idx].length = sg_dma_len(sg); in mega_build_sglist()
1763 *buf = scb->sgl_dma_addr; in mega_build_sglist()
1813 scb_t *scb; in mega_free_sgl() local
1818 scb = &adapter->scb_list[i]; in mega_free_sgl()
1820 if( scb->sgl64 ) { in mega_free_sgl()
1823 scb->sgl64, scb->sgl_dma_addr); in mega_free_sgl()
1825 scb->sgl64 = NULL; in mega_free_sgl()
1828 if( scb->pthru ) { in mega_free_sgl()
1830 sizeof(mega_passthru), scb->pthru, in mega_free_sgl()
1831 scb->pthru_dma_addr); in mega_free_sgl()
1833 scb->pthru = NULL; in mega_free_sgl()
1836 if( scb->epthru ) { in mega_free_sgl()
1839 scb->epthru, scb->epthru_dma_addr); in mega_free_sgl()
1841 scb->epthru = NULL; in mega_free_sgl()
1939 scb_t *scb; in megaraid_abort_and_reset() local
1951 scb = list_entry(pos, scb_t, list); in megaraid_abort_and_reset()
1953 if (scb->cmd == cmd) { /* Found command */ in megaraid_abort_and_reset()
1955 scb->state |= aor; in megaraid_abort_and_reset()
1963 if( scb->state & SCB_ISSUED ) { in megaraid_abort_and_reset()
1968 scb->idx); in megaraid_abort_and_reset()
1981 scb->idx); in megaraid_abort_and_reset()
1983 mega_free_scb(adapter, scb); in megaraid_abort_and_reset()
2873 scb_t *scb; in mega_init_scb() local
2878 scb = &adapter->scb_list[i]; in mega_init_scb()
2880 scb->sgl64 = NULL; in mega_init_scb()
2881 scb->sgl = NULL; in mega_init_scb()
2882 scb->pthru = NULL; in mega_init_scb()
2883 scb->epthru = NULL; in mega_init_scb()
2888 scb = &adapter->scb_list[i]; in mega_init_scb()
2890 scb->idx = i; in mega_init_scb()
2892 scb->sgl64 = dma_alloc_coherent(&adapter->dev->dev, in mega_init_scb()
2894 &scb->sgl_dma_addr, GFP_KERNEL); in mega_init_scb()
2896 scb->sgl = (mega_sglist *)scb->sgl64; in mega_init_scb()
2898 if( !scb->sgl ) { in mega_init_scb()
2904 scb->pthru = dma_alloc_coherent(&adapter->dev->dev, in mega_init_scb()
2906 &scb->pthru_dma_addr, GFP_KERNEL); in mega_init_scb()
2908 if( !scb->pthru ) { in mega_init_scb()
2914 scb->epthru = dma_alloc_coherent(&adapter->dev->dev, in mega_init_scb()
2916 &scb->epthru_dma_addr, GFP_KERNEL); in mega_init_scb()
2918 if( !scb->epthru ) { in mega_init_scb()
2926 scb->dma_type = MEGA_DMA_TYPE_NONE; in mega_init_scb()
2933 scb->state = SCB_FREE; in mega_init_scb()
2934 scb->cmd = NULL; in mega_init_scb()
2935 list_add(&scb->list, &adapter->free_list); in mega_init_scb()
3794 scb_t *scb; in mega_del_logdrv() local
3822 scb = list_entry(pos, scb_t, list); in mega_del_logdrv()
3823 if (scb->pthru->logdrv < 0x80 ) in mega_del_logdrv()
3824 scb->pthru->logdrv += 0x80; in mega_del_logdrv()
4079 scb_t *scb; in mega_internal_command() local
4089 scb = &adapter->int_scb; in mega_internal_command()
4090 memset(scb, 0, sizeof(scb_t)); in mega_internal_command()
4092 scb->idx = CMDID_INT_CMDS; in mega_internal_command()
4093 scb->state |= SCB_ACTIVE | SCB_PENDQ; in mega_internal_command()
4095 memcpy(scb->raw_mbox, mc, sizeof(megacmd_t)); in mega_internal_command()
4101 scb->pthru = pthru; in mega_internal_command()
4104 list_add_tail(&scb->list, &adapter->pending_list); in mega_internal_command()