Lines Matching defs:acmd
1265 struct scsa_cmd *acmd;
1281 acmd = PKT2CMD(pkt);
1287 acmd->cmd_pkt = pkt;
1288 acmd->cmd_flags = 0;
1289 acmd->cmd_scblen = statuslen;
1290 acmd->cmd_cdblen = cmdlen;
1291 acmd->cmd_dmahandle = NULL;
1292 acmd->cmd_ncookies = 0;
1293 acmd->cmd_cookie = 0;
1294 acmd->cmd_cookiecnt = 0;
1295 acmd->cmd_nwin = 0;
1307 acmd = PKT2CMD(pkt);
1313 if (acmd->cmd_dmahandle == NULL) {
1591 struct scsa_cmd *acmd = PKT2CMD(pkt);
1595 if (acmd->cmd_flags & CFLAG_DMAVALID) {
1596 acmd->cmd_flags &= ~CFLAG_DMAVALID;
1598 (void) ddi_dma_unbind_handle(acmd->cmd_dmahandle);
1600 ddi_dma_free_handle(&acmd->cmd_dmahandle);
1602 acmd->cmd_dmahandle = NULL;
1613 register struct scsa_cmd *acmd = PKT2CMD(pkt);
1617 if (acmd->cmd_flags & CFLAG_DMAVALID) {
1618 acmd->cmd_flags &= ~CFLAG_DMAVALID;
1620 (void) ddi_dma_unbind_handle(acmd->cmd_dmahandle);
1622 ddi_dma_free_handle(&acmd->cmd_dmahandle);
1624 acmd->cmd_dmahandle = NULL;
1632 register struct scsa_cmd *acmd = PKT2CMD(pkt);
1636 if (acmd->cmd_flags & CFLAG_DMAVALID) {
1637 (void) ddi_dma_sync(acmd->cmd_dmahandle, acmd->cmd_dma_offset,
1638 acmd->cmd_dma_len, (acmd->cmd_flags & CFLAG_DMASEND) ?
3261 struct scsa_cmd *acmd;
3327 acmd = cmd->cmd;
3328 pkt = CMD2PKT(acmd);
3330 if (acmd->cmd_flags & CFLAG_DMAVALID) {
3331 if (acmd->cmd_flags & CFLAG_CONSISTENT) {
3332 (void) ddi_dma_sync(acmd->cmd_dmahandle,
3333 acmd->cmd_dma_offset,
3334 acmd->cmd_dma_len,
3347 pkt->pkt_cdbp[0], ((acmd->islogical) ? "LD" : "PD"),
3348 acmd->cmd_dmacount, hdr->context));
3350 uint_t, acmd->cmd_cdblen, ulong_t,
3351 acmd->cmd_dmacount);
3356 if (acmd->cmd_dmacount != 0) {
3357 bp_mapin(acmd->cmd_buf);
3359 acmd->cmd_buf->b_un.b_addr;
3362 if (acmd->islogical &&
3425 acmd->cmd_scblen -
3478 if (acmd->cmd_dmahandle) {
3480 acmd->cmd_dmahandle) != DDI_SUCCESS) {
3682 struct scsa_cmd *acmd = PKT2CMD(pkt);
3684 acmd->cmd_buf = bp;
3687 acmd->cmd_flags &= ~CFLAG_DMASEND;
3690 acmd->cmd_flags |= CFLAG_DMASEND;
3695 acmd->cmd_flags |= CFLAG_CONSISTENT;
3711 cb, 0, &acmd->cmd_dmahandle)) != DDI_SUCCESS) {
3729 i = ddi_dma_buf_bind_handle(acmd->cmd_dmahandle, bp, dma_flags,
3730 cb, 0, &acmd->cmd_dmacookies[0], &acmd->cmd_ncookies);
3740 if (ddi_dma_numwin(acmd->cmd_dmahandle, &acmd->cmd_nwin) ==
3746 if (ddi_dma_getwin(acmd->cmd_dmahandle, acmd->cmd_curwin,
3747 &acmd->cmd_dma_offset, &acmd->cmd_dma_len,
3748 &acmd->cmd_dmacookies[0], &acmd->cmd_ncookies) ==
3757 acmd->cmd_nwin = 1;
3758 acmd->cmd_dma_len = 0;
3759 acmd->cmd_dma_offset = 0;
3763 acmd->cmd_dmacount = 0;
3765 acmd->cmd_dmacount +=
3766 acmd->cmd_dmacookies[i++].dmac_size;
3769 i == acmd->cmd_ncookies)
3772 ddi_dma_nextcookie(acmd->cmd_dmahandle,
3773 &acmd->cmd_dmacookies[i]);
3776 acmd->cmd_cookie = i;
3777 acmd->cmd_cookiecnt = i;
3779 acmd->cmd_flags |= CFLAG_DMAVALID;
3781 if (bp->b_bcount >= acmd->cmd_dmacount) {
3782 pkt->pkt_resid = bp->b_bcount - acmd->cmd_dmacount;
3808 ddi_dma_free_handle(&acmd->cmd_dmahandle);
3809 acmd->cmd_dmahandle = NULL;
3810 acmd->cmd_flags &= ~CFLAG_DMAVALID;
3826 struct scsa_cmd *acmd = PKT2CMD(pkt);
3832 if (acmd->cmd_cookie == acmd->cmd_ncookies) {
3833 if (acmd->cmd_curwin == acmd->cmd_nwin && acmd->cmd_nwin == 1) {
3838 if (++acmd->cmd_curwin >= acmd->cmd_nwin) {
3842 if (ddi_dma_getwin(acmd->cmd_dmahandle, acmd->cmd_curwin,
3843 &acmd->cmd_dma_offset, &acmd->cmd_dma_len,
3844 &acmd->cmd_dmacookies[0], &acmd->cmd_ncookies) ==
3849 acmd->cmd_cookie = 0;
3852 ddi_dma_nextcookie(acmd->cmd_dmahandle,
3853 &acmd->cmd_dmacookies[0]);
3858 acmd->cmd_dmacount += acmd->cmd_dmacookies[i++].dmac_size;
3859 acmd->cmd_cookie++;
3862 acmd->cmd_cookie == acmd->cmd_ncookies) {
3866 ddi_dma_nextcookie(acmd->cmd_dmahandle,
3867 &acmd->cmd_dmacookies[i]);
3870 acmd->cmd_cookiecnt = i;
3872 if (bp->b_bcount >= acmd->cmd_dmacount) {
3873 pkt->pkt_resid = bp->b_bcount - acmd->cmd_dmacount;
3896 struct scsa_cmd *acmd = PKT2CMD(pkt);
3901 acmd->islogical = MRDRV_IS_LOGICAL(ap);
3902 acmd->device_id = MAP_DEVICE_ID(instance, ap);
3921 cmd->cmd = acmd;
3923 ulong_t, acmd->cmd_dmacount, ulong_t, acmd->cmd_dma_len);
3926 if (acmd->cmd_flags & CFLAG_DMASEND) {
3929 if (acmd->cmd_flags & CFLAG_CONSISTENT) {
3930 (void) ddi_dma_sync(acmd->cmd_dmahandle,
3931 acmd->cmd_dma_offset, acmd->cmd_dma_len,
3934 } else if (acmd->cmd_flags & ~CFLAG_DMASEND) {
3937 if (acmd->cmd_flags & CFLAG_CONSISTENT) {
3938 (void) ddi_dma_sync(acmd->cmd_dmahandle,
3939 acmd->cmd_dma_offset, acmd->cmd_dma_len,
3966 if (acmd->islogical) {
3978 ddi_put8(acc_handle, &ldio->target_id, acmd->device_id);
3992 (acmd->cmd_cdblen != 6) ? pkt->pkt_cdbp[1] : 0);
3994 acmd->cmd_cookiecnt);
4004 if (acmd->cmd_cdblen == CDB_GROUP0) {
4013 } else if (acmd->cmd_cdblen == CDB_GROUP1) {
4023 } else if (acmd->cmd_cdblen == CDB_GROUP2) {
4035 } else if (acmd->cmd_cdblen == CDB_GROUP3) {
4085 ddi_put8(acc_handle, &pthru->cmd, (acmd->islogical) ?
4089 ddi_put8(acc_handle, &pthru->target_id, acmd->device_id);
4091 ddi_put8(acc_handle, &pthru->cdb_len, acmd->cmd_cdblen);
4095 acmd->cmd_dmacount);
4096 ddi_put8(acc_handle, &pthru->sge_count, acmd->cmd_cookiecnt);
4111 (uint8_t *)pthru->cdb, acmd->cmd_cdblen, DDI_DEV_AUTOINCR);
4120 for (i = 0; i < acmd->cmd_cookiecnt; i++, mfi_sgl_ieee++) {
4122 acmd->cmd_dmacookies[i].dmac_laddress);
4124 acmd->cmd_dmacookies[i].dmac_size);
4126 sge_bytes = sizeof (struct mrsas_sge_ieee)*acmd->cmd_cookiecnt;
4128 for (i = 0; i < acmd->cmd_cookiecnt; i++, mfi_sgl++) {
4130 acmd->cmd_dmacookies[i].dmac_laddress);
4132 acmd->cmd_dmacookies[i].dmac_size);
4134 sge_bytes = sizeof (struct mrsas_sge64)*acmd->cmd_cookiecnt;
6470 struct scsa_cmd *acmd;
6476 acmd = PKT2CMD(pkt);
6477 bp = acmd->cmd_buf;
6478 if ((!bp) && bp->b_un.b_addr && bp->b_bcount && acmd->cmd_dmacount) {