• Home
  • Raw
  • Download

Lines Matching refs:scb

209 #define IPS_DMA_DIR(scb) ((!scb->scsi_cmd || ips_is_passthru(scb->scsi_cmd) || \  argument
210 DMA_NONE == scb->scsi_cmd->sc_data_direction) ? \
212 scb->scsi_cmd->sc_data_direction)
644 ips_scb_t *scb; in ips_release() local
667 scb = &ha->scbs[ha->max_cmds - 1]; in ips_release()
669 ips_init_scb(ha, scb); in ips_release()
671 scb->timeout = ips_cmd_timeout; in ips_release()
672 scb->cdb[0] = IPS_CMD_FLUSH; in ips_release()
674 scb->cmd.flush_cache.op_code = IPS_CMD_FLUSH; in ips_release()
675 scb->cmd.flush_cache.command_id = IPS_COMMAND_ID(ha, scb); in ips_release()
676 scb->cmd.flush_cache.state = IPS_NORM_STATE; in ips_release()
677 scb->cmd.flush_cache.reserved = 0; in ips_release()
678 scb->cmd.flush_cache.reserved2 = 0; in ips_release()
679 scb->cmd.flush_cache.reserved3 = 0; in ips_release()
680 scb->cmd.flush_cache.reserved4 = 0; in ips_release()
685 if (ips_send_wait(ha, scb, ips_cmd_timeout, IPS_INTR_ON) == IPS_FAILURE) in ips_release()
718 ips_scb_t *scb; in ips_halt() local
736 scb = &ha->scbs[ha->max_cmds - 1]; in ips_halt()
738 ips_init_scb(ha, scb); in ips_halt()
740 scb->timeout = ips_cmd_timeout; in ips_halt()
741 scb->cdb[0] = IPS_CMD_FLUSH; in ips_halt()
743 scb->cmd.flush_cache.op_code = IPS_CMD_FLUSH; in ips_halt()
744 scb->cmd.flush_cache.command_id = IPS_COMMAND_ID(ha, scb); in ips_halt()
745 scb->cmd.flush_cache.state = IPS_NORM_STATE; in ips_halt()
746 scb->cmd.flush_cache.reserved = 0; in ips_halt()
747 scb->cmd.flush_cache.reserved2 = 0; in ips_halt()
748 scb->cmd.flush_cache.reserved3 = 0; in ips_halt()
749 scb->cmd.flush_cache.reserved4 = 0; in ips_halt()
754 if (ips_send_wait(ha, scb, ips_cmd_timeout, IPS_INTR_ON) == in ips_halt()
837 ips_scb_t *scb; in __ips_eh_reset() local
891 scb = &ha->scbs[ha->max_cmds - 1]; in __ips_eh_reset()
893 ips_init_scb(ha, scb); in __ips_eh_reset()
895 scb->timeout = ips_cmd_timeout; in __ips_eh_reset()
896 scb->cdb[0] = IPS_CMD_FLUSH; in __ips_eh_reset()
898 scb->cmd.flush_cache.op_code = IPS_CMD_FLUSH; in __ips_eh_reset()
899 scb->cmd.flush_cache.command_id = IPS_COMMAND_ID(ha, scb); in __ips_eh_reset()
900 scb->cmd.flush_cache.state = IPS_NORM_STATE; in __ips_eh_reset()
901 scb->cmd.flush_cache.reserved = 0; in __ips_eh_reset()
902 scb->cmd.flush_cache.reserved2 = 0; in __ips_eh_reset()
903 scb->cmd.flush_cache.reserved3 = 0; in __ips_eh_reset()
904 scb->cmd.flush_cache.reserved4 = 0; in __ips_eh_reset()
907 ret = ips_send_wait(ha, scb, ips_cmd_timeout, IPS_INTR_IORL); in __ips_eh_reset()
937 while ((scb = ips_removeq_scb_head(&ha->scb_activelist))) { in __ips_eh_reset()
938 scb->scsi_cmd->result = DID_ERROR << 16; in __ips_eh_reset()
939 scb->scsi_cmd->scsi_done(scb->scsi_cmd); in __ips_eh_reset()
940 ips_freescb(ha, scb); in __ips_eh_reset()
966 while ((scb = ips_removeq_scb_head(&ha->scb_activelist))) { in __ips_eh_reset()
967 scb->scsi_cmd->result = DID_ERROR << 16; in __ips_eh_reset()
968 scb->scsi_cmd->scsi_done(scb->scsi_cmd); in __ips_eh_reset()
969 ips_freescb(ha, scb); in __ips_eh_reset()
995 while ((scb = ips_removeq_scb_head(&ha->scb_activelist))) { in __ips_eh_reset()
996 scb->scsi_cmd->result = DID_RESET << 16; in __ips_eh_reset()
997 scb->scsi_cmd->scsi_done(scb->scsi_cmd); in __ips_eh_reset()
998 ips_freescb(ha, scb); in __ips_eh_reset()
1268 ips_scb_t *scb; in ips_intr_copperhead() local
1306 scb = (ips_scb_t *) sp->scb_addr; in ips_intr_copperhead()
1312 (*scb->callback) (ha, scb); in ips_intr_copperhead()
1332 ips_scb_t *scb; in ips_intr_morpheus() local
1376 scb = (ips_scb_t *) sp->scb_addr; in ips_intr_morpheus()
1382 (*scb->callback) (ha, scb); in ips_intr_morpheus()
1557 ips_make_passthru(ips_ha_t *ha, struct scsi_cmnd *SC, ips_scb_t *scb, int intr) in ips_make_passthru() argument
1627 ret = ips_flash_copperhead(ha, pt, scb); in ips_make_passthru()
1632 if (ips_usrcmd(ha, pt, scb)) in ips_make_passthru()
1651 ips_flash_copperhead(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) in ips_flash_copperhead() argument
1658 if (ips_usrcmd(ha, pt, scb)) in ips_flash_copperhead()
1665 scb->scsi_cmd->result = DID_OK << 16; in ips_flash_copperhead()
1671 return ips_flash_bios(ha, pt, scb); in ips_flash_copperhead()
1709 return ips_flash_bios(ha, pt, scb); in ips_flash_copperhead()
1711 return ips_flash_firmware(ha, pt, scb); in ips_flash_copperhead()
1722 ips_flash_bios(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) in ips_flash_bios() argument
1787 ips_scb_t * scb, int indx, unsigned int e_len) in ips_fill_scb_sg_single() argument
1792 if ((scb->data_len + e_len) > ha->max_xfer) { in ips_fill_scb_sg_single()
1793 e_len = ha->max_xfer - scb->data_len; in ips_fill_scb_sg_single()
1794 scb->breakup = indx; in ips_fill_scb_sg_single()
1795 ++scb->sg_break; in ips_fill_scb_sg_single()
1798 scb->breakup = 0; in ips_fill_scb_sg_single()
1799 scb->sg_break = 0; in ips_fill_scb_sg_single()
1802 scb->sg_list.enh_list[indx].address_lo = in ips_fill_scb_sg_single()
1804 scb->sg_list.enh_list[indx].address_hi = in ips_fill_scb_sg_single()
1806 scb->sg_list.enh_list[indx].length = cpu_to_le32(e_len); in ips_fill_scb_sg_single()
1808 scb->sg_list.std_list[indx].address = in ips_fill_scb_sg_single()
1810 scb->sg_list.std_list[indx].length = cpu_to_le32(e_len); in ips_fill_scb_sg_single()
1813 ++scb->sg_len; in ips_fill_scb_sg_single()
1814 scb->data_len += e_len; in ips_fill_scb_sg_single()
1824 ips_flash_firmware(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) in ips_flash_firmware() argument
1841 sg_list.list = scb->sg_list.list; in ips_flash_firmware()
1842 cmd_busaddr = scb->scb_busaddr; in ips_flash_firmware()
1844 memcpy(&scb->cmd, &pt->CoppCP.cmd, sizeof (IPS_IOCTL_CMD)); in ips_flash_firmware()
1846 scb->sg_list.list = sg_list.list; in ips_flash_firmware()
1847 scb->scb_busaddr = cmd_busaddr; in ips_flash_firmware()
1848 scb->bus = scb->scsi_cmd->device->channel; in ips_flash_firmware()
1849 scb->target_id = scb->scsi_cmd->device->id; in ips_flash_firmware()
1850 scb->lun = scb->scsi_cmd->device->lun; in ips_flash_firmware()
1851 scb->sg_len = 0; in ips_flash_firmware()
1852 scb->data_len = 0; in ips_flash_firmware()
1853 scb->flags = 0; in ips_flash_firmware()
1854 scb->op_code = 0; in ips_flash_firmware()
1855 scb->callback = ipsintr_done; in ips_flash_firmware()
1856 scb->timeout = ips_cmd_timeout; in ips_flash_firmware()
1858 scb->data_len = ha->flash_datasize; in ips_flash_firmware()
1859 scb->data_busaddr = in ips_flash_firmware()
1860 dma_map_single(&ha->pcidev->dev, ha->flash_data, scb->data_len, in ips_flash_firmware()
1861 IPS_DMA_DIR(scb)); in ips_flash_firmware()
1862 scb->flags |= IPS_SCB_MAP_SINGLE; in ips_flash_firmware()
1863 scb->cmd.flashfw.command_id = IPS_COMMAND_ID(ha, scb); in ips_flash_firmware()
1864 scb->cmd.flashfw.buffer_addr = cpu_to_le32(scb->data_busaddr); in ips_flash_firmware()
1866 scb->timeout = pt->TimeOut; in ips_flash_firmware()
1867 scb->scsi_cmd->result = DID_OK << 16; in ips_flash_firmware()
1897 ips_usrcmd(ips_ha_t * ha, ips_passthru_t * pt, ips_scb_t * scb) in ips_usrcmd() argument
1904 if ((!scb) || (!pt) || (!ha)) in ips_usrcmd()
1908 sg_list.list = scb->sg_list.list; in ips_usrcmd()
1909 cmd_busaddr = scb->scb_busaddr; in ips_usrcmd()
1911 memcpy(&scb->cmd, &pt->CoppCP.cmd, sizeof (IPS_IOCTL_CMD)); in ips_usrcmd()
1912 memcpy(&scb->dcdb, &pt->CoppCP.dcdb, sizeof (IPS_DCDB_TABLE)); in ips_usrcmd()
1915 scb->sg_list.list = sg_list.list; in ips_usrcmd()
1916 scb->scb_busaddr = cmd_busaddr; in ips_usrcmd()
1917 scb->bus = scb->scsi_cmd->device->channel; in ips_usrcmd()
1918 scb->target_id = scb->scsi_cmd->device->id; in ips_usrcmd()
1919 scb->lun = scb->scsi_cmd->device->lun; in ips_usrcmd()
1920 scb->sg_len = 0; in ips_usrcmd()
1921 scb->data_len = 0; in ips_usrcmd()
1922 scb->flags = 0; in ips_usrcmd()
1923 scb->op_code = 0; in ips_usrcmd()
1924 scb->callback = ipsintr_done; in ips_usrcmd()
1925 scb->timeout = ips_cmd_timeout; in ips_usrcmd()
1926 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_usrcmd()
1929 if ((scb->cmd.basic_io.op_code == IPS_CMD_READ_SG) || in ips_usrcmd()
1930 (scb->cmd.basic_io.op_code == IPS_CMD_WRITE_SG) || in ips_usrcmd()
1931 (scb->cmd.basic_io.op_code == IPS_CMD_DCDB_SG)) in ips_usrcmd()
1935 scb->data_len = pt->CmdBSize; in ips_usrcmd()
1936 scb->data_busaddr = ha->ioctl_busaddr + sizeof (ips_passthru_t); in ips_usrcmd()
1938 scb->data_busaddr = 0L; in ips_usrcmd()
1941 if (scb->cmd.dcdb.op_code == IPS_CMD_DCDB) in ips_usrcmd()
1942 scb->cmd.dcdb.dcdb_address = cpu_to_le32(scb->scb_busaddr + in ips_usrcmd()
1943 (unsigned long) &scb-> in ips_usrcmd()
1945 (unsigned long) scb); in ips_usrcmd()
1948 if (scb->cmd.dcdb.op_code == IPS_CMD_DCDB) in ips_usrcmd()
1949 scb->dcdb.buffer_pointer = in ips_usrcmd()
1950 cpu_to_le32(scb->data_busaddr); in ips_usrcmd()
1952 scb->cmd.basic_io.sg_addr = in ips_usrcmd()
1953 cpu_to_le32(scb->data_busaddr); in ips_usrcmd()
1958 scb->timeout = pt->TimeOut; in ips_usrcmd()
1961 scb->dcdb.cmd_attribute |= IPS_TIMEOUT10; in ips_usrcmd()
1963 scb->dcdb.cmd_attribute |= IPS_TIMEOUT60; in ips_usrcmd()
1965 scb->dcdb.cmd_attribute |= IPS_TIMEOUT20M; in ips_usrcmd()
1969 scb->scsi_cmd->result = DID_OK << 16; in ips_usrcmd()
1985 ips_cleanup_passthru(ips_ha_t * ha, ips_scb_t * scb) in ips_cleanup_passthru() argument
1991 if ((!scb) || (!scb->scsi_cmd) || (!scsi_sglist(scb->scsi_cmd))) { in ips_cleanup_passthru()
2000 if (scb->cmd.dcdb.op_code == IPS_CMD_DCDB) /* Copy DCDB Back to Caller's Area */ in ips_cleanup_passthru()
2001 memcpy(&pt->CoppCP.dcdb, &scb->dcdb, sizeof (IPS_DCDB_TABLE)); in ips_cleanup_passthru()
2003 pt->BasicStatus = scb->basic_status; in ips_cleanup_passthru()
2004 pt->ExtendedStatus = scb->extended_status; in ips_cleanup_passthru()
2008 (scb->cmd.flashfw.op_code == IPS_CMD_DOWNLOAD || in ips_cleanup_passthru()
2009 scb->cmd.flashfw.op_code == IPS_CMD_RW_BIOSFW)) in ips_cleanup_passthru()
2012 ips_scmd_buf_write(scb->scsi_cmd, ha->ioctl_data, ha->ioctl_datasize); in ips_cleanup_passthru()
2230 ips_scb_t *scb; in ips_get_bios_version() local
2329 scb = &ha->scbs[ha->max_cmds - 1]; in ips_get_bios_version()
2331 ips_init_scb(ha, scb); in ips_get_bios_version()
2333 scb->timeout = ips_cmd_timeout; in ips_get_bios_version()
2334 scb->cdb[0] = IPS_CMD_RW_BIOSFW; in ips_get_bios_version()
2336 scb->cmd.flashfw.op_code = IPS_CMD_RW_BIOSFW; in ips_get_bios_version()
2337 scb->cmd.flashfw.command_id = IPS_COMMAND_ID(ha, scb); in ips_get_bios_version()
2338 scb->cmd.flashfw.type = 1; in ips_get_bios_version()
2339 scb->cmd.flashfw.direction = 0; in ips_get_bios_version()
2340 scb->cmd.flashfw.count = cpu_to_le32(0x800); in ips_get_bios_version()
2341 scb->cmd.flashfw.total_packets = 1; in ips_get_bios_version()
2342 scb->cmd.flashfw.packet_num = 0; in ips_get_bios_version()
2343 scb->data_len = 0x1000; in ips_get_bios_version()
2344 scb->cmd.flashfw.buffer_addr = ha->ioctl_busaddr; in ips_get_bios_version()
2348 ips_send_wait(ha, scb, ips_cmd_timeout, in ips_get_bios_version()
2351 || ((scb->basic_status & IPS_GSC_STATUS_MASK) > 1)) { in ips_get_bios_version()
2524 ips_scb_t *scb; in ips_next() local
2560 (ha->copp_waitlist.head) && (scb = ips_getscb(ha))) { in ips_next()
2566 scb->scsi_cmd = item->scsi_cmd; in ips_next()
2569 ret = ips_make_passthru(ha, scb->scsi_cmd, scb, intr); in ips_next()
2575 if (scb->scsi_cmd) { in ips_next()
2576 scb->scsi_cmd->result = DID_ERROR << 16; in ips_next()
2577 scb->scsi_cmd->scsi_done(scb->scsi_cmd); in ips_next()
2580 ips_freescb(ha, scb); in ips_next()
2583 if (scb->scsi_cmd) { in ips_next()
2584 scb->scsi_cmd->result = DID_OK << 16; in ips_next()
2585 scb->scsi_cmd->scsi_done(scb->scsi_cmd); in ips_next()
2588 ips_freescb(ha, scb); in ips_next()
2599 ret = ips_send_cmd(ha, scb); in ips_next()
2602 ips_putq_scb_head(&ha->scb_activelist, scb); in ips_next()
2608 if (scb->scsi_cmd) { in ips_next()
2609 scb->scsi_cmd->result = DID_ERROR << 16; in ips_next()
2612 ips_freescb(ha, scb); in ips_next()
2615 ips_freescb(ha, scb); in ips_next()
2628 while ((p) && (scb = ips_getscb(ha))) { in ips_next()
2633 ips_freescb(ha, scb); in ips_next()
2647 scb->target_id = SC->device->id; in ips_next()
2648 scb->lun = SC->device->lun; in ips_next()
2649 scb->bus = SC->device->channel; in ips_next()
2650 scb->scsi_cmd = SC; in ips_next()
2651 scb->breakup = 0; in ips_next()
2652 scb->data_len = 0; in ips_next()
2653 scb->callback = ipsintr_done; in ips_next()
2654 scb->timeout = ips_cmd_timeout; in ips_next()
2655 memset(&scb->cmd, 0, 16); in ips_next()
2658 memcpy(scb->cdb, SC->cmnd, SC->cmd_len); in ips_next()
2660 scb->sg_count = scsi_dma_map(SC); in ips_next()
2661 BUG_ON(scb->sg_count < 0); in ips_next()
2662 if (scb->sg_count) { in ips_next()
2666 scb->flags |= IPS_SCB_MAP_SG; in ips_next()
2668 scsi_for_each_sg(SC, sg, scb->sg_count, i) { in ips_next()
2670 (ha, sg_dma_address(sg), scb, i, in ips_next()
2674 scb->dcdb.transfer_length = scb->data_len; in ips_next()
2676 scb->data_busaddr = 0L; in ips_next()
2677 scb->sg_len = 0; in ips_next()
2678 scb->data_len = 0; in ips_next()
2679 scb->dcdb.transfer_length = 0; in ips_next()
2682 scb->dcdb.cmd_attribute = in ips_next()
2683 ips_command_direction[scb->scsi_cmd->cmnd[0]]; in ips_next()
2687 if ((scb->scsi_cmd->cmnd[0] == WRITE_BUFFER) && in ips_next()
2688 (scb->data_len == 0)) in ips_next()
2689 scb->dcdb.cmd_attribute = 0; in ips_next()
2691 if (!(scb->dcdb.cmd_attribute & 0x3)) in ips_next()
2692 scb->dcdb.transfer_length = 0; in ips_next()
2694 if (scb->data_len >= IPS_MAX_XFER) { in ips_next()
2695 scb->dcdb.cmd_attribute |= IPS_TRANSFER64K; in ips_next()
2696 scb->dcdb.transfer_length = 0; in ips_next()
2701 ret = ips_send_cmd(ha, scb); in ips_next()
2705 ips_putq_scb_head(&ha->scb_activelist, scb); in ips_next()
2708 if (scb->scsi_cmd) { in ips_next()
2709 scb->scsi_cmd->result = DID_ERROR << 16; in ips_next()
2710 scb->scsi_cmd->scsi_done(scb->scsi_cmd); in ips_next()
2713 if (scb->bus) in ips_next()
2714 ha->dcdb_active[scb->bus - 1] &= in ips_next()
2715 ~(1 << scb->target_id); in ips_next()
2717 ips_freescb(ha, scb); in ips_next()
2720 if (scb->scsi_cmd) in ips_next()
2721 scb->scsi_cmd->scsi_done(scb->scsi_cmd); in ips_next()
2723 if (scb->bus) in ips_next()
2724 ha->dcdb_active[scb->bus - 1] &= in ips_next()
2725 ~(1 << scb->target_id); in ips_next()
2727 ips_freescb(ha, scb); in ips_next()
3084 ipsintr_blocking(ips_ha_t * ha, ips_scb_t * scb) in ipsintr_blocking() argument
3088 ips_freescb(ha, scb); in ipsintr_blocking()
3089 if ((ha->waitflag == TRUE) && (ha->cmd_in_progress == scb->cdb[0])) { in ipsintr_blocking()
3106 ipsintr_done(ips_ha_t * ha, ips_scb_t * scb) in ipsintr_done() argument
3110 if (!scb) { in ipsintr_done()
3117 if (scb->scsi_cmd == NULL) { in ipsintr_done()
3125 ips_done(ha, scb); in ipsintr_done()
3138 ips_done(ips_ha_t * ha, ips_scb_t * scb) in ips_done() argument
3144 if (!scb) in ips_done()
3147 if ((scb->scsi_cmd) && (ips_is_passthru(scb->scsi_cmd))) { in ips_done()
3148 ips_cleanup_passthru(ha, scb); in ips_done()
3156 if ((scb->breakup) || (scb->sg_break)) { in ips_done()
3161 scb->data_len = 0; in ips_done()
3163 sg = scsi_sglist(scb->scsi_cmd); in ips_done()
3166 sg_dma_index = scb->breakup; in ips_done()
3167 for (i = 0; i < scb->breakup; i++) in ips_done()
3173 scb, ips_sg_index++, in ips_done()
3176 for (; sg_dma_index < scsi_sg_count(scb->scsi_cmd); in ips_done()
3181 scb, ips_sg_index++, in ips_done()
3186 scb->dcdb.transfer_length = scb->data_len; in ips_done()
3187 scb->dcdb.cmd_attribute |= in ips_done()
3188 ips_command_direction[scb->scsi_cmd->cmnd[0]]; in ips_done()
3190 if (!(scb->dcdb.cmd_attribute & 0x3)) in ips_done()
3191 scb->dcdb.transfer_length = 0; in ips_done()
3193 if (scb->data_len >= IPS_MAX_XFER) { in ips_done()
3194 scb->dcdb.cmd_attribute |= IPS_TRANSFER64K; in ips_done()
3195 scb->dcdb.transfer_length = 0; in ips_done()
3198 ret = ips_send_cmd(ha, scb); in ips_done()
3202 if (scb->scsi_cmd) { in ips_done()
3203 scb->scsi_cmd->result = DID_ERROR << 16; in ips_done()
3204 scb->scsi_cmd->scsi_done(scb->scsi_cmd); in ips_done()
3207 ips_freescb(ha, scb); in ips_done()
3210 if (scb->scsi_cmd) { in ips_done()
3211 scb->scsi_cmd->result = DID_ERROR << 16; in ips_done()
3212 scb->scsi_cmd->scsi_done(scb->scsi_cmd); in ips_done()
3215 ips_freescb(ha, scb); in ips_done()
3225 if (scb->bus) { in ips_done()
3226 ha->dcdb_active[scb->bus - 1] &= ~(1 << scb->target_id); in ips_done()
3229 scb->scsi_cmd->scsi_done(scb->scsi_cmd); in ips_done()
3231 ips_freescb(ha, scb); in ips_done()
3244 ips_map_status(ips_ha_t * ha, ips_scb_t * scb, ips_stat_t * sp) in ips_map_status() argument
3254 if (scb->bus) { in ips_map_status()
3258 scb->scsi_cmd->device->channel, in ips_map_status()
3259 scb->scsi_cmd->device->id, scb->scsi_cmd->device->lun, in ips_map_status()
3260 scb->basic_status, scb->extended_status, in ips_map_status()
3261 scb->extended_status == in ips_map_status()
3262 IPS_ERR_CKCOND ? scb->dcdb.sense_info[2] & 0xf : 0, in ips_map_status()
3263 scb->extended_status == in ips_map_status()
3264 IPS_ERR_CKCOND ? scb->dcdb.sense_info[12] : 0, in ips_map_status()
3265 scb->extended_status == in ips_map_status()
3266 IPS_ERR_CKCOND ? scb->dcdb.sense_info[13] : 0); in ips_map_status()
3273 switch (scb->basic_status & IPS_GSC_STATUS_MASK) { in ips_map_status()
3286 switch (scb->extended_status) { in ips_map_status()
3288 if (scb->bus) in ips_map_status()
3294 if ((scb->cmd.dcdb.op_code == IPS_CMD_EXTENDED_DCDB) || in ips_map_status()
3295 (scb->cmd.dcdb.op_code == in ips_map_status()
3297 tapeDCDB = (IPS_DCDB_TABLE_TAPE *) & scb->dcdb; in ips_map_status()
3301 (uint32_t) scb->dcdb.transfer_length; in ips_map_status()
3304 if ((scb->bus) && (transfer_len < scb->data_len)) { in ips_map_status()
3309 if (scb->scsi_cmd->cmnd[0] == INQUIRY) { in ips_map_status()
3310 ips_scmd_buf_read(scb->scsi_cmd, in ips_map_status()
3324 if (scb->bus) in ips_map_status()
3335 if (scb->bus) { in ips_map_status()
3336 if ((scb->cmd.dcdb.op_code == in ips_map_status()
3338 || (scb->cmd.dcdb.op_code == in ips_map_status()
3341 (IPS_DCDB_TABLE_TAPE *) & scb->dcdb; in ips_map_status()
3342 memcpy(scb->scsi_cmd->sense_buffer, in ips_map_status()
3346 memcpy(scb->scsi_cmd->sense_buffer, in ips_map_status()
3347 scb->dcdb.sense_info, in ips_map_status()
3364 scb->scsi_cmd->result = device_error | (errcode << 16); in ips_map_status()
3381 ips_send_wait(ips_ha_t * ha, ips_scb_t * scb, int timeout, int intr) in ips_send_wait() argument
3389 ha->cmd_in_progress = scb->cdb[0]; in ips_send_wait()
3391 scb->callback = ipsintr_blocking; in ips_send_wait()
3392 ret = ips_send_cmd(ha, scb); in ips_send_wait()
3447 ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) in ips_send_cmd() argument
3459 if (!scb->scsi_cmd) { in ips_send_cmd()
3462 if (scb->bus > 0) { in ips_send_cmd()
3466 (ha->cmd_in_progress == scb->cdb[0])) { in ips_send_cmd()
3472 } else if ((scb->bus == 0) && (!ips_is_passthru(scb->scsi_cmd))) { in ips_send_cmd()
3476 switch (scb->scsi_cmd->cmnd[0]) { in ips_send_cmd()
3482 scb->scsi_cmd->result = DID_ERROR << 16; in ips_send_cmd()
3486 scb->scsi_cmd->result = DID_OK << 16; in ips_send_cmd()
3491 if (scb->target_id == IPS_ADAPTER_ID) { in ips_send_cmd()
3496 if (scb->scsi_cmd->cmnd[0] == TEST_UNIT_READY) in ips_send_cmd()
3497 scb->scsi_cmd->result = DID_OK << 16; in ips_send_cmd()
3499 if (scb->scsi_cmd->cmnd[0] == INQUIRY) { in ips_send_cmd()
3525 ips_scmd_buf_write(scb->scsi_cmd, in ips_send_cmd()
3529 scb->scsi_cmd->result = DID_OK << 16; in ips_send_cmd()
3532 scb->cmd.logical_info.op_code = IPS_CMD_GET_LD_INFO; in ips_send_cmd()
3533 scb->cmd.logical_info.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3534 scb->cmd.logical_info.reserved = 0; in ips_send_cmd()
3535 scb->cmd.logical_info.reserved2 = 0; in ips_send_cmd()
3536 scb->data_len = sizeof (IPS_LD_INFO); in ips_send_cmd()
3537 scb->data_busaddr = ha->logical_drive_info_dma_addr; in ips_send_cmd()
3538 scb->flags = 0; in ips_send_cmd()
3539 scb->cmd.logical_info.buffer_addr = scb->data_busaddr; in ips_send_cmd()
3546 ips_reqsen(ha, scb); in ips_send_cmd()
3547 scb->scsi_cmd->result = DID_OK << 16; in ips_send_cmd()
3552 if (!scb->sg_len) { in ips_send_cmd()
3553 scb->cmd.basic_io.op_code = in ips_send_cmd()
3554 (scb->scsi_cmd->cmnd[0] == in ips_send_cmd()
3556 scb->cmd.basic_io.enhanced_sg = 0; in ips_send_cmd()
3557 scb->cmd.basic_io.sg_addr = in ips_send_cmd()
3558 cpu_to_le32(scb->data_busaddr); in ips_send_cmd()
3560 scb->cmd.basic_io.op_code = in ips_send_cmd()
3561 (scb->scsi_cmd->cmnd[0] == in ips_send_cmd()
3564 scb->cmd.basic_io.enhanced_sg = in ips_send_cmd()
3566 scb->cmd.basic_io.sg_addr = in ips_send_cmd()
3567 cpu_to_le32(scb->sg_busaddr); in ips_send_cmd()
3570 scb->cmd.basic_io.segment_4G = 0; in ips_send_cmd()
3571 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3572 scb->cmd.basic_io.log_drv = scb->target_id; in ips_send_cmd()
3573 scb->cmd.basic_io.sg_count = scb->sg_len; in ips_send_cmd()
3575 if (scb->cmd.basic_io.lba) in ips_send_cmd()
3576 le32_add_cpu(&scb->cmd.basic_io.lba, in ips_send_cmd()
3577 le16_to_cpu(scb->cmd.basic_io. in ips_send_cmd()
3580 scb->cmd.basic_io.lba = in ips_send_cmd()
3581 (((scb->scsi_cmd-> in ips_send_cmd()
3582 cmnd[1] & 0x1f) << 16) | (scb->scsi_cmd-> in ips_send_cmd()
3584 (scb->scsi_cmd->cmnd[3])); in ips_send_cmd()
3586 scb->cmd.basic_io.sector_count = in ips_send_cmd()
3587 cpu_to_le16(scb->data_len / IPS_BLKSIZE); in ips_send_cmd()
3589 if (le16_to_cpu(scb->cmd.basic_io.sector_count) == 0) in ips_send_cmd()
3590 scb->cmd.basic_io.sector_count = in ips_send_cmd()
3598 if (!scb->sg_len) { in ips_send_cmd()
3599 scb->cmd.basic_io.op_code = in ips_send_cmd()
3600 (scb->scsi_cmd->cmnd[0] == in ips_send_cmd()
3602 scb->cmd.basic_io.enhanced_sg = 0; in ips_send_cmd()
3603 scb->cmd.basic_io.sg_addr = in ips_send_cmd()
3604 cpu_to_le32(scb->data_busaddr); in ips_send_cmd()
3606 scb->cmd.basic_io.op_code = in ips_send_cmd()
3607 (scb->scsi_cmd->cmnd[0] == in ips_send_cmd()
3610 scb->cmd.basic_io.enhanced_sg = in ips_send_cmd()
3612 scb->cmd.basic_io.sg_addr = in ips_send_cmd()
3613 cpu_to_le32(scb->sg_busaddr); in ips_send_cmd()
3616 scb->cmd.basic_io.segment_4G = 0; in ips_send_cmd()
3617 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3618 scb->cmd.basic_io.log_drv = scb->target_id; in ips_send_cmd()
3619 scb->cmd.basic_io.sg_count = scb->sg_len; in ips_send_cmd()
3621 if (scb->cmd.basic_io.lba) in ips_send_cmd()
3622 le32_add_cpu(&scb->cmd.basic_io.lba, in ips_send_cmd()
3623 le16_to_cpu(scb->cmd.basic_io. in ips_send_cmd()
3626 scb->cmd.basic_io.lba = in ips_send_cmd()
3627 ((scb->scsi_cmd->cmnd[2] << 24) | (scb-> in ips_send_cmd()
3631 (scb->scsi_cmd->cmnd[4] << 8) | scb-> in ips_send_cmd()
3634 scb->cmd.basic_io.sector_count = in ips_send_cmd()
3635 cpu_to_le16(scb->data_len / IPS_BLKSIZE); in ips_send_cmd()
3637 if (cpu_to_le16(scb->cmd.basic_io.sector_count) == 0) { in ips_send_cmd()
3643 scb->scsi_cmd->result = DID_OK << 16; in ips_send_cmd()
3651 scb->scsi_cmd->result = DID_OK << 16; in ips_send_cmd()
3655 scb->cmd.basic_io.op_code = IPS_CMD_ENQUIRY; in ips_send_cmd()
3656 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3657 scb->cmd.basic_io.segment_4G = 0; in ips_send_cmd()
3658 scb->cmd.basic_io.enhanced_sg = 0; in ips_send_cmd()
3659 scb->data_len = sizeof (*ha->enq); in ips_send_cmd()
3660 scb->cmd.basic_io.sg_addr = ha->enq_busaddr; in ips_send_cmd()
3665 scb->cmd.logical_info.op_code = IPS_CMD_GET_LD_INFO; in ips_send_cmd()
3666 scb->cmd.logical_info.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3667 scb->cmd.logical_info.reserved = 0; in ips_send_cmd()
3668 scb->cmd.logical_info.reserved2 = 0; in ips_send_cmd()
3669 scb->cmd.logical_info.reserved3 = 0; in ips_send_cmd()
3670 scb->data_len = sizeof (IPS_LD_INFO); in ips_send_cmd()
3671 scb->data_busaddr = ha->logical_drive_info_dma_addr; in ips_send_cmd()
3672 scb->flags = 0; in ips_send_cmd()
3673 scb->cmd.logical_info.buffer_addr = scb->data_busaddr; in ips_send_cmd()
3685 scb->scsi_cmd->result = DID_OK << 16; in ips_send_cmd()
3692 sp = (char *) scb->scsi_cmd->sense_buffer; in ips_send_cmd()
3701 scb->scsi_cmd->result = device_error | (DID_OK << 16); in ips_send_cmd()
3710 if (scb->bus > 0) { in ips_send_cmd()
3714 if (ha->conf->dev[scb->bus - 1][scb->target_id].ucState == 0) { in ips_send_cmd()
3715 scb->scsi_cmd->result = DID_NO_CONNECT << 16; in ips_send_cmd()
3719 ha->dcdb_active[scb->bus - 1] |= (1 << scb->target_id); in ips_send_cmd()
3720 scb->cmd.dcdb.command_id = IPS_COMMAND_ID(ha, scb); in ips_send_cmd()
3721 scb->cmd.dcdb.dcdb_address = cpu_to_le32(scb->scb_busaddr + in ips_send_cmd()
3722 (unsigned long) &scb-> in ips_send_cmd()
3724 (unsigned long) scb); in ips_send_cmd()
3725 scb->cmd.dcdb.reserved = 0; in ips_send_cmd()
3726 scb->cmd.dcdb.reserved2 = 0; in ips_send_cmd()
3727 scb->cmd.dcdb.reserved3 = 0; in ips_send_cmd()
3728 scb->cmd.dcdb.segment_4G = 0; in ips_send_cmd()
3729 scb->cmd.dcdb.enhanced_sg = 0; in ips_send_cmd()
3731 TimeOut = scb->scsi_cmd->request->timeout; in ips_send_cmd()
3734 if (!scb->sg_len) { in ips_send_cmd()
3735 scb->cmd.dcdb.op_code = IPS_CMD_EXTENDED_DCDB; in ips_send_cmd()
3737 scb->cmd.dcdb.op_code = in ips_send_cmd()
3739 scb->cmd.dcdb.enhanced_sg = in ips_send_cmd()
3743 tapeDCDB = (IPS_DCDB_TABLE_TAPE *) & scb->dcdb; /* Use Same Data Area as Old DCDB Struct */ in ips_send_cmd()
3745 ((scb->bus - 1) << 4) | scb->target_id; in ips_send_cmd()
3758 tapeDCDB->cdb_length = scb->scsi_cmd->cmd_len; in ips_send_cmd()
3760 tapeDCDB->transfer_length = scb->data_len; in ips_send_cmd()
3761 if (scb->cmd.dcdb.op_code == IPS_CMD_EXTENDED_DCDB_SG) in ips_send_cmd()
3763 cpu_to_le32(scb->sg_busaddr); in ips_send_cmd()
3766 cpu_to_le32(scb->data_busaddr); in ips_send_cmd()
3767 tapeDCDB->sg_count = scb->sg_len; in ips_send_cmd()
3771 memcpy(tapeDCDB->scsi_cdb, scb->scsi_cmd->cmnd, in ips_send_cmd()
3772 scb->scsi_cmd->cmd_len); in ips_send_cmd()
3774 if (!scb->sg_len) { in ips_send_cmd()
3775 scb->cmd.dcdb.op_code = IPS_CMD_DCDB; in ips_send_cmd()
3777 scb->cmd.dcdb.op_code = IPS_CMD_DCDB_SG; in ips_send_cmd()
3778 scb->cmd.dcdb.enhanced_sg = in ips_send_cmd()
3782 scb->dcdb.device_address = in ips_send_cmd()
3783 ((scb->bus - 1) << 4) | scb->target_id; in ips_send_cmd()
3784 scb->dcdb.cmd_attribute |= IPS_DISCONNECT_ALLOWED; in ips_send_cmd()
3788 scb->dcdb.cmd_attribute |= IPS_TIMEOUT10; /* TimeOut is 10 Seconds */ in ips_send_cmd()
3790 scb->dcdb.cmd_attribute |= IPS_TIMEOUT60; /* TimeOut is 60 Seconds */ in ips_send_cmd()
3792 scb->dcdb.cmd_attribute |= IPS_TIMEOUT20M; /* TimeOut is 20 Minutes */ in ips_send_cmd()
3795 scb->dcdb.transfer_length = scb->data_len; in ips_send_cmd()
3796 if (scb->dcdb.cmd_attribute & IPS_TRANSFER64K) in ips_send_cmd()
3797 scb->dcdb.transfer_length = 0; in ips_send_cmd()
3798 if (scb->cmd.dcdb.op_code == IPS_CMD_DCDB_SG) in ips_send_cmd()
3799 scb->dcdb.buffer_pointer = in ips_send_cmd()
3800 cpu_to_le32(scb->sg_busaddr); in ips_send_cmd()
3802 scb->dcdb.buffer_pointer = in ips_send_cmd()
3803 cpu_to_le32(scb->data_busaddr); in ips_send_cmd()
3804 scb->dcdb.cdb_length = scb->scsi_cmd->cmd_len; in ips_send_cmd()
3805 scb->dcdb.sense_length = sizeof (scb->dcdb.sense_info); in ips_send_cmd()
3806 scb->dcdb.sg_count = scb->sg_len; in ips_send_cmd()
3807 scb->dcdb.reserved = 0; in ips_send_cmd()
3808 memcpy(scb->dcdb.scsi_cdb, scb->scsi_cmd->cmnd, in ips_send_cmd()
3809 scb->scsi_cmd->cmd_len); in ips_send_cmd()
3810 scb->dcdb.scsi_status = 0; in ips_send_cmd()
3811 scb->dcdb.reserved2[0] = 0; in ips_send_cmd()
3812 scb->dcdb.reserved2[1] = 0; in ips_send_cmd()
3813 scb->dcdb.reserved2[2] = 0; in ips_send_cmd()
3817 return ((*ha->func.issue) (ha, scb)); in ips_send_cmd()
3832 ips_scb_t *scb; in ips_chkstatus() local
3841 scb = &ha->scbs[pstatus->fields.command_id]; in ips_chkstatus()
3842 scb->basic_status = basic_status = in ips_chkstatus()
3844 scb->extended_status = ext_status = pstatus->fields.extended_status; in ips_chkstatus()
3848 sp->scb_addr = (void *) scb; in ips_chkstatus()
3851 ips_removeq_scb(&ha->scb_activelist, scb); in ips_chkstatus()
3853 if (!scb->scsi_cmd) in ips_chkstatus()
3860 scb->cdb[0], in ips_chkstatus()
3861 scb->cmd.basic_io.command_id, in ips_chkstatus()
3862 scb->bus, scb->target_id, scb->lun); in ips_chkstatus()
3864 if ((scb->scsi_cmd) && (ips_is_passthru(scb->scsi_cmd))) in ips_chkstatus()
3873 if (scb->bus == 0) { in ips_chkstatus()
3879 scb->cmd.basic_io.op_code, in ips_chkstatus()
3883 switch (scb->scsi_cmd->cmnd[0]) { in ips_chkstatus()
3896 if (!ips_online(ha, scb)) { in ips_chkstatus()
3902 if (ips_online(ha, scb)) { in ips_chkstatus()
3903 ips_inquiry(ha, scb); in ips_chkstatus()
3910 ips_reqsen(ha, scb); in ips_chkstatus()
3922 if (!ips_online(ha, scb) in ips_chkstatus()
3923 || !ips_msense(ha, scb)) { in ips_chkstatus()
3929 if (ips_online(ha, scb)) in ips_chkstatus()
3930 ips_rdcap(ha, scb); in ips_chkstatus()
3955 scb->scsi_cmd->result = errcode << 16; in ips_chkstatus()
3958 if (scb->scsi_cmd->cmnd[0] == INQUIRY) { in ips_chkstatus()
3959 ips_scmd_buf_read(scb->scsi_cmd, in ips_chkstatus()
3962 scb->scsi_cmd->result = DID_TIME_OUT << 16; in ips_chkstatus()
3966 if (scb->bus == 0) { in ips_chkstatus()
3970 scb->cmd.basic_io.op_code, basic_status, in ips_chkstatus()
3974 ips_map_status(ha, scb, sp); in ips_chkstatus()
3988 ips_online(ips_ha_t * ha, ips_scb_t * scb) in ips_online() argument
3992 if (scb->target_id >= IPS_MAX_LD) in ips_online()
3995 if ((scb->basic_status & IPS_GSC_STATUS_MASK) > 1) { in ips_online()
4000 if (ha->logical_drive_info->drive_info[scb->target_id].state != in ips_online()
4002 && ha->logical_drive_info->drive_info[scb->target_id].state != in ips_online()
4004 && ha->logical_drive_info->drive_info[scb->target_id].state != in ips_online()
4006 && ha->logical_drive_info->drive_info[scb->target_id].state != in ips_online()
4023 ips_inquiry(ips_ha_t * ha, ips_scb_t * scb) in ips_inquiry() argument
4043 ips_scmd_buf_write(scb->scsi_cmd, &inquiry, sizeof (inquiry)); in ips_inquiry()
4058 ips_rdcap(ips_ha_t * ha, ips_scb_t * scb) in ips_rdcap() argument
4064 if (scsi_bufflen(scb->scsi_cmd) < 8) in ips_rdcap()
4070 drive_info[scb->target_id].sector_count) - 1); in ips_rdcap()
4073 ips_scmd_buf_write(scb->scsi_cmd, &cap, sizeof (cap)); in ips_rdcap()
4088 ips_msense(ips_ha_t * ha, ips_scb_t * scb) in ips_msense() argument
4097 if (le32_to_cpu(ha->enq->ulDriveSize[scb->target_id]) > 0x400000 && in ips_msense()
4107 (le32_to_cpu(ha->enq->ulDriveSize[scb->target_id]) - in ips_msense()
4114 switch (scb->scsi_cmd->cmnd[2] & 0x3f) { in ips_msense()
4164 ips_scmd_buf_write(scb->scsi_cmd, &mdata, sizeof (mdata)); in ips_msense()
4179 ips_reqsen(ips_ha_t * ha, ips_scb_t * scb) in ips_reqsen() argument
4193 ips_scmd_buf_write(scb->scsi_cmd, &reqsen, sizeof (reqsen)); in ips_reqsen()
4364 ips_init_scb(ips_ha_t * ha, ips_scb_t * scb) in ips_init_scb() argument
4370 if (scb == NULL) in ips_init_scb()
4373 sg_list.list = scb->sg_list.list; in ips_init_scb()
4374 cmd_busaddr = scb->scb_busaddr; in ips_init_scb()
4375 sg_busaddr = scb->sg_busaddr; in ips_init_scb()
4377 memset(scb, 0, sizeof (ips_scb_t)); in ips_init_scb()
4387 scb->scb_busaddr = cmd_busaddr; in ips_init_scb()
4388 scb->sg_busaddr = sg_busaddr; in ips_init_scb()
4389 scb->sg_list.list = sg_list.list; in ips_init_scb()
4392 scb->cmd.basic_io.cccr = cpu_to_le32((uint32_t) IPS_BIT_ILE); in ips_init_scb()
4393 scb->cmd.basic_io.ccsar = cpu_to_le32(ha->adapt->hw_status_start in ips_init_scb()
4411 ips_scb_t *scb; in ips_getscb() local
4415 if ((scb = ha->scb_freelist) == NULL) { in ips_getscb()
4420 ha->scb_freelist = scb->q_next; in ips_getscb()
4421 scb->flags = 0; in ips_getscb()
4422 scb->q_next = NULL; in ips_getscb()
4424 ips_init_scb(ha, scb); in ips_getscb()
4426 return (scb); in ips_getscb()
4441 ips_freescb(ips_ha_t * ha, ips_scb_t * scb) in ips_freescb() argument
4445 if (scb->flags & IPS_SCB_MAP_SG) in ips_freescb()
4446 scsi_dma_unmap(scb->scsi_cmd); in ips_freescb()
4447 else if (scb->flags & IPS_SCB_MAP_SINGLE) in ips_freescb()
4448 dma_unmap_single(&ha->pcidev->dev, scb->data_busaddr, in ips_freescb()
4449 scb->data_len, IPS_DMA_DIR(scb)); in ips_freescb()
4452 if (IPS_COMMAND_ID(ha, scb) < (ha->max_cmds - 1)) { in ips_freescb()
4453 scb->q_next = ha->scb_freelist; in ips_freescb()
4454 ha->scb_freelist = scb; in ips_freescb()
4554 ips_scb_t *scb; in ips_flush_and_reset() local
4561 scb = dma_alloc_coherent(&ha->pcidev->dev, sizeof(ips_scb_t), in ips_flush_and_reset()
4563 if (scb) { in ips_flush_and_reset()
4564 memset(scb, 0, sizeof(ips_scb_t)); in ips_flush_and_reset()
4565 ips_init_scb(ha, scb); in ips_flush_and_reset()
4566 scb->scb_busaddr = command_dma; in ips_flush_and_reset()
4568 scb->timeout = ips_cmd_timeout; in ips_flush_and_reset()
4569 scb->cdb[0] = IPS_CMD_FLUSH; in ips_flush_and_reset()
4571 scb->cmd.flush_cache.op_code = IPS_CMD_FLUSH; in ips_flush_and_reset()
4572scb->cmd.flush_cache.command_id = IPS_MAX_CMDS; /* Use an ID that would otherwise not exist */ in ips_flush_and_reset()
4573 scb->cmd.flush_cache.state = IPS_NORM_STATE; in ips_flush_and_reset()
4574 scb->cmd.flush_cache.reserved = 0; in ips_flush_and_reset()
4575 scb->cmd.flush_cache.reserved2 = 0; in ips_flush_and_reset()
4576 scb->cmd.flush_cache.reserved3 = 0; in ips_flush_and_reset()
4577 scb->cmd.flush_cache.reserved4 = 0; in ips_flush_and_reset()
4579 ret = ips_send_cmd(ha, scb); /* Send the Flush Command */ in ips_flush_and_reset()
4597 dma_free_coherent(&ha->pcidev->dev, sizeof(ips_scb_t), scb, command_dma); in ips_flush_and_reset()
5270 ips_issue_copperhead(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_copperhead() argument
5277 if (scb->scsi_cmd) { in ips_issue_copperhead()
5281 scb->cdb[0], in ips_issue_copperhead()
5282 scb->cmd.basic_io.command_id, in ips_issue_copperhead()
5283 scb->bus, scb->target_id, scb->lun); in ips_issue_copperhead()
5286 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_copperhead()
5308 outl(scb->scb_busaddr, ha->io_addr + IPS_REG_CCSAR); in ips_issue_copperhead()
5324 ips_issue_copperhead_memio(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_copperhead_memio() argument
5331 if (scb->scsi_cmd) { in ips_issue_copperhead_memio()
5335 scb->cdb[0], in ips_issue_copperhead_memio()
5336 scb->cmd.basic_io.command_id, in ips_issue_copperhead_memio()
5337 scb->bus, scb->target_id, scb->lun); in ips_issue_copperhead_memio()
5340 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_copperhead_memio()
5361 writel(scb->scb_busaddr, ha->mem_ptr + IPS_REG_CCSAR); in ips_issue_copperhead_memio()
5377 ips_issue_i2o(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_i2o() argument
5382 if (scb->scsi_cmd) { in ips_issue_i2o()
5386 scb->cdb[0], in ips_issue_i2o()
5387 scb->cmd.basic_io.command_id, in ips_issue_i2o()
5388 scb->bus, scb->target_id, scb->lun); in ips_issue_i2o()
5391 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_i2o()
5394 outl(scb->scb_busaddr, ha->io_addr + IPS_REG_I2O_INMSGQ); in ips_issue_i2o()
5409 ips_issue_i2o_memio(ips_ha_t * ha, ips_scb_t * scb) in ips_issue_i2o_memio() argument
5414 if (scb->scsi_cmd) { in ips_issue_i2o_memio()
5418 scb->cdb[0], in ips_issue_i2o_memio()
5419 scb->cmd.basic_io.command_id, in ips_issue_i2o_memio()
5420 scb->bus, scb->target_id, scb->lun); in ips_issue_i2o_memio()
5423 ips_name, ha->host_num, scb->cmd.basic_io.command_id); in ips_issue_i2o_memio()
5426 writel(scb->scb_busaddr, ha->mem_ptr + IPS_REG_I2O_INMSGQ); in ips_issue_i2o_memio()
5656 ips_scb_t *scb; in ips_read_adapter_status() local
5661 scb = &ha->scbs[ha->max_cmds - 1]; in ips_read_adapter_status()
5663 ips_init_scb(ha, scb); in ips_read_adapter_status()
5665 scb->timeout = ips_cmd_timeout; in ips_read_adapter_status()
5666 scb->cdb[0] = IPS_CMD_ENQUIRY; in ips_read_adapter_status()
5668 scb->cmd.basic_io.op_code = IPS_CMD_ENQUIRY; in ips_read_adapter_status()
5669 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_read_adapter_status()
5670 scb->cmd.basic_io.sg_count = 0; in ips_read_adapter_status()
5671 scb->cmd.basic_io.lba = 0; in ips_read_adapter_status()
5672 scb->cmd.basic_io.sector_count = 0; in ips_read_adapter_status()
5673 scb->cmd.basic_io.log_drv = 0; in ips_read_adapter_status()
5674 scb->data_len = sizeof (*ha->enq); in ips_read_adapter_status()
5675 scb->cmd.basic_io.sg_addr = ha->enq_busaddr; in ips_read_adapter_status()
5679 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_read_adapter_status()
5681 || ((scb->basic_status & IPS_GSC_STATUS_MASK) > 1)) in ips_read_adapter_status()
5699 ips_scb_t *scb; in ips_read_subsystem_parameters() local
5704 scb = &ha->scbs[ha->max_cmds - 1]; in ips_read_subsystem_parameters()
5706 ips_init_scb(ha, scb); in ips_read_subsystem_parameters()
5708 scb->timeout = ips_cmd_timeout; in ips_read_subsystem_parameters()
5709 scb->cdb[0] = IPS_CMD_GET_SUBSYS; in ips_read_subsystem_parameters()
5711 scb->cmd.basic_io.op_code = IPS_CMD_GET_SUBSYS; in ips_read_subsystem_parameters()
5712 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_read_subsystem_parameters()
5713 scb->cmd.basic_io.sg_count = 0; in ips_read_subsystem_parameters()
5714 scb->cmd.basic_io.lba = 0; in ips_read_subsystem_parameters()
5715 scb->cmd.basic_io.sector_count = 0; in ips_read_subsystem_parameters()
5716 scb->cmd.basic_io.log_drv = 0; in ips_read_subsystem_parameters()
5717 scb->data_len = sizeof (*ha->subsys); in ips_read_subsystem_parameters()
5718 scb->cmd.basic_io.sg_addr = ha->ioctl_busaddr; in ips_read_subsystem_parameters()
5722 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_read_subsystem_parameters()
5724 || ((scb->basic_status & IPS_GSC_STATUS_MASK) > 1)) in ips_read_subsystem_parameters()
5743 ips_scb_t *scb; in ips_read_config() local
5753 scb = &ha->scbs[ha->max_cmds - 1]; in ips_read_config()
5755 ips_init_scb(ha, scb); in ips_read_config()
5757 scb->timeout = ips_cmd_timeout; in ips_read_config()
5758 scb->cdb[0] = IPS_CMD_READ_CONF; in ips_read_config()
5760 scb->cmd.basic_io.op_code = IPS_CMD_READ_CONF; in ips_read_config()
5761 scb->cmd.basic_io.command_id = IPS_COMMAND_ID(ha, scb); in ips_read_config()
5762 scb->data_len = sizeof (*ha->conf); in ips_read_config()
5763 scb->cmd.basic_io.sg_addr = ha->ioctl_busaddr; in ips_read_config()
5767 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_read_config()
5769 || ((scb->basic_status & IPS_GSC_STATUS_MASK) > 1)) { in ips_read_config()
5778 if ((scb->basic_status & IPS_GSC_STATUS_MASK) == in ips_read_config()
5801 ips_scb_t *scb; in ips_readwrite_page5() local
5806 scb = &ha->scbs[ha->max_cmds - 1]; in ips_readwrite_page5()
5808 ips_init_scb(ha, scb); in ips_readwrite_page5()
5810 scb->timeout = ips_cmd_timeout; in ips_readwrite_page5()
5811 scb->cdb[0] = IPS_CMD_RW_NVRAM_PAGE; in ips_readwrite_page5()
5813 scb->cmd.nvram.op_code = IPS_CMD_RW_NVRAM_PAGE; in ips_readwrite_page5()
5814 scb->cmd.nvram.command_id = IPS_COMMAND_ID(ha, scb); in ips_readwrite_page5()
5815 scb->cmd.nvram.page = 5; in ips_readwrite_page5()
5816 scb->cmd.nvram.write = write; in ips_readwrite_page5()
5817 scb->cmd.nvram.reserved = 0; in ips_readwrite_page5()
5818 scb->cmd.nvram.reserved2 = 0; in ips_readwrite_page5()
5819 scb->data_len = sizeof (*ha->nvram); in ips_readwrite_page5()
5820 scb->cmd.nvram.buffer_addr = ha->ioctl_busaddr; in ips_readwrite_page5()
5826 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_readwrite_page5()
5828 || ((scb->basic_status & IPS_GSC_STATUS_MASK) > 1)) { in ips_readwrite_page5()
5851 ips_scb_t *scb; in ips_clear_adapter() local
5856 scb = &ha->scbs[ha->max_cmds - 1]; in ips_clear_adapter()
5858 ips_init_scb(ha, scb); in ips_clear_adapter()
5860 scb->timeout = ips_reset_timeout; in ips_clear_adapter()
5861 scb->cdb[0] = IPS_CMD_CONFIG_SYNC; in ips_clear_adapter()
5863 scb->cmd.config_sync.op_code = IPS_CMD_CONFIG_SYNC; in ips_clear_adapter()
5864 scb->cmd.config_sync.command_id = IPS_COMMAND_ID(ha, scb); in ips_clear_adapter()
5865 scb->cmd.config_sync.channel = 0; in ips_clear_adapter()
5866 scb->cmd.config_sync.source_target = IPS_POCL; in ips_clear_adapter()
5867 scb->cmd.config_sync.reserved = 0; in ips_clear_adapter()
5868 scb->cmd.config_sync.reserved2 = 0; in ips_clear_adapter()
5869 scb->cmd.config_sync.reserved3 = 0; in ips_clear_adapter()
5873 ips_send_wait(ha, scb, ips_reset_timeout, intr)) == IPS_FAILURE) in ips_clear_adapter()
5875 || ((scb->basic_status & IPS_GSC_STATUS_MASK) > 1)) in ips_clear_adapter()
5879 ips_init_scb(ha, scb); in ips_clear_adapter()
5881 scb->cdb[0] = IPS_CMD_ERROR_TABLE; in ips_clear_adapter()
5882 scb->timeout = ips_reset_timeout; in ips_clear_adapter()
5884 scb->cmd.unlock_stripe.op_code = IPS_CMD_ERROR_TABLE; in ips_clear_adapter()
5885 scb->cmd.unlock_stripe.command_id = IPS_COMMAND_ID(ha, scb); in ips_clear_adapter()
5886 scb->cmd.unlock_stripe.log_drv = 0; in ips_clear_adapter()
5887 scb->cmd.unlock_stripe.control = IPS_CSL; in ips_clear_adapter()
5888 scb->cmd.unlock_stripe.reserved = 0; in ips_clear_adapter()
5889 scb->cmd.unlock_stripe.reserved2 = 0; in ips_clear_adapter()
5890 scb->cmd.unlock_stripe.reserved3 = 0; in ips_clear_adapter()
5894 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) in ips_clear_adapter()
5896 || ((scb->basic_status & IPS_GSC_STATUS_MASK) > 1)) in ips_clear_adapter()
5914 ips_scb_t *scb; in ips_ffdc_reset() local
5918 scb = &ha->scbs[ha->max_cmds - 1]; in ips_ffdc_reset()
5920 ips_init_scb(ha, scb); in ips_ffdc_reset()
5922 scb->timeout = ips_cmd_timeout; in ips_ffdc_reset()
5923 scb->cdb[0] = IPS_CMD_FFDC; in ips_ffdc_reset()
5924 scb->cmd.ffdc.op_code = IPS_CMD_FFDC; in ips_ffdc_reset()
5925 scb->cmd.ffdc.command_id = IPS_COMMAND_ID(ha, scb); in ips_ffdc_reset()
5926 scb->cmd.ffdc.reset_count = ha->reset_count; in ips_ffdc_reset()
5927 scb->cmd.ffdc.reset_type = 0x80; in ips_ffdc_reset()
5930 ips_fix_ffdc_time(ha, scb, ha->last_ffdc); in ips_ffdc_reset()
5933 ips_send_wait(ha, scb, ips_cmd_timeout, intr); in ips_ffdc_reset()
5948 ips_scb_t *scb; in ips_ffdc_time() local
5954 scb = &ha->scbs[ha->max_cmds - 1]; in ips_ffdc_time()
5956 ips_init_scb(ha, scb); in ips_ffdc_time()
5958 scb->timeout = ips_cmd_timeout; in ips_ffdc_time()
5959 scb->cdb[0] = IPS_CMD_FFDC; in ips_ffdc_time()
5960 scb->cmd.ffdc.op_code = IPS_CMD_FFDC; in ips_ffdc_time()
5961 scb->cmd.ffdc.command_id = IPS_COMMAND_ID(ha, scb); in ips_ffdc_time()
5962 scb->cmd.ffdc.reset_count = 0; in ips_ffdc_time()
5963 scb->cmd.ffdc.reset_type = 0; in ips_ffdc_time()
5966 ips_fix_ffdc_time(ha, scb, ha->last_ffdc); in ips_ffdc_time()
5969 ips_send_wait(ha, scb, ips_cmd_timeout, IPS_FFDC); in ips_ffdc_time()
5981 ips_fix_ffdc_time(ips_ha_t * ha, ips_scb_t * scb, time64_t current_time) in ips_fix_ffdc_time() argument
5989 scb->cmd.ffdc.hour = tm.tm_hour; in ips_fix_ffdc_time()
5990 scb->cmd.ffdc.minute = tm.tm_min; in ips_fix_ffdc_time()
5991 scb->cmd.ffdc.second = tm.tm_sec; in ips_fix_ffdc_time()
5992 scb->cmd.ffdc.yearH = (tm.tm_year + 1900) / 100; in ips_fix_ffdc_time()
5993 scb->cmd.ffdc.yearL = tm.tm_year % 100; in ips_fix_ffdc_time()
5994 scb->cmd.ffdc.month = tm.tm_mon + 1; in ips_fix_ffdc_time()
5995 scb->cmd.ffdc.day = tm.tm_mday; in ips_fix_ffdc_time()