Lines Matching defs:acmd
1163 struct scsa_cmd *acmd;
1179 acmd = PKT2CMD(pkt);
1185 acmd->cmd_pkt = pkt;
1186 acmd->cmd_flags = 0;
1187 acmd->cmd_scblen = statuslen;
1188 acmd->cmd_cdblen = cmdlen;
1189 acmd->cmd_dmahandle = NULL;
1190 acmd->cmd_ncookies = 0;
1191 acmd->cmd_cookie = 0;
1192 acmd->cmd_cookiecnt = 0;
1193 acmd->cmd_nwin = 0;
1205 acmd = PKT2CMD(pkt);
1211 if (acmd->cmd_dmahandle == NULL) {
1577 struct scsa_cmd *acmd = PKT2CMD(pkt);
1581 if (acmd->cmd_flags & CFLAG_DMAVALID) {
1582 acmd->cmd_flags &= ~CFLAG_DMAVALID;
1584 (void) ddi_dma_unbind_handle(acmd->cmd_dmahandle);
1586 ddi_dma_free_handle(&acmd->cmd_dmahandle);
1588 acmd->cmd_dmahandle = NULL;
1611 register struct scsa_cmd *acmd = PKT2CMD(pkt);
1615 if (acmd->cmd_flags & CFLAG_DMAVALID) {
1616 acmd->cmd_flags &= ~CFLAG_DMAVALID;
1618 (void) ddi_dma_unbind_handle(acmd->cmd_dmahandle);
1620 ddi_dma_free_handle(&acmd->cmd_dmahandle);
1622 acmd->cmd_dmahandle = NULL;
1652 register struct scsa_cmd *acmd = PKT2CMD(pkt);
1654 if (acmd->cmd_flags & CFLAG_DMAVALID) {
1655 (void) ddi_dma_sync(acmd->cmd_dmahandle, acmd->cmd_dma_offset,
1656 acmd->cmd_dma_len, (acmd->cmd_flags & CFLAG_DMASEND) ?
2711 struct scsa_cmd *acmd;
2773 acmd = cmd->cmd;
2774 pkt = CMD2PKT(acmd);
2776 if (acmd->cmd_flags & CFLAG_DMAVALID) {
2777 if (acmd->cmd_flags & CFLAG_CONSISTENT) {
2778 (void) ddi_dma_sync(acmd->cmd_dmahandle,
2779 acmd->cmd_dma_offset,
2780 acmd->cmd_dma_len,
2793 pkt->pkt_cdbp[0], ((acmd->islogical) ? "LD" : "PD"),
2794 acmd->cmd_dmacount, hdr->context));
2799 if (acmd->cmd_dmacount != 0) {
2800 bp_mapin(acmd->cmd_buf);
2802 acmd->cmd_buf->b_un.b_addr;
2805 if (acmd->islogical &&
2864 acmd->cmd_scblen -
2919 if (acmd->cmd_dmahandle) {
2921 acmd->cmd_dmahandle) != DDI_SUCCESS) {
3103 struct scsa_cmd *acmd = PKT2CMD(pkt);
3105 acmd->cmd_buf = bp;
3108 acmd->cmd_flags &= ~CFLAG_DMASEND;
3111 acmd->cmd_flags |= CFLAG_DMASEND;
3116 acmd->cmd_flags |= CFLAG_CONSISTENT;
3132 cb, 0, &acmd->cmd_dmahandle)) != DDI_SUCCESS) {
3150 i = ddi_dma_buf_bind_handle(acmd->cmd_dmahandle, bp, dma_flags,
3151 cb, 0, &acmd->cmd_dmacookies[0], &acmd->cmd_ncookies);
3161 if (ddi_dma_numwin(acmd->cmd_dmahandle, &acmd->cmd_nwin) ==
3167 if (ddi_dma_getwin(acmd->cmd_dmahandle, acmd->cmd_curwin,
3168 &acmd->cmd_dma_offset, &acmd->cmd_dma_len,
3169 &acmd->cmd_dmacookies[0], &acmd->cmd_ncookies) ==
3178 acmd->cmd_nwin = 1;
3179 acmd->cmd_dma_len = 0;
3180 acmd->cmd_dma_offset = 0;
3184 acmd->cmd_dmacount = 0;
3186 acmd->cmd_dmacount +=
3187 acmd->cmd_dmacookies[i++].dmac_size;
3190 i == acmd->cmd_ncookies)
3193 ddi_dma_nextcookie(acmd->cmd_dmahandle,
3194 &acmd->cmd_dmacookies[i]);
3197 acmd->cmd_cookie = i;
3198 acmd->cmd_cookiecnt = i;
3200 acmd->cmd_flags |= CFLAG_DMAVALID;
3202 if (bp->b_bcount >= acmd->cmd_dmacount) {
3203 pkt->pkt_resid = bp->b_bcount - acmd->cmd_dmacount;
3229 ddi_dma_free_handle(&acmd->cmd_dmahandle);
3230 acmd->cmd_dmahandle = NULL;
3231 acmd->cmd_flags &= ~CFLAG_DMAVALID;
3247 struct scsa_cmd *acmd = PKT2CMD(pkt);
3253 if (acmd->cmd_cookie == acmd->cmd_ncookies) {
3254 if (acmd->cmd_curwin == acmd->cmd_nwin && acmd->cmd_nwin == 1) {
3259 if (++acmd->cmd_curwin >= acmd->cmd_nwin) {
3263 if (ddi_dma_getwin(acmd->cmd_dmahandle, acmd->cmd_curwin,
3264 &acmd->cmd_dma_offset, &acmd->cmd_dma_len,
3265 &acmd->cmd_dmacookies[0], &acmd->cmd_ncookies) ==
3270 acmd->cmd_cookie = 0;
3273 ddi_dma_nextcookie(acmd->cmd_dmahandle,
3274 &acmd->cmd_dmacookies[0]);
3279 acmd->cmd_dmacount += acmd->cmd_dmacookies[i++].dmac_size;
3280 acmd->cmd_cookie++;
3283 acmd->cmd_cookie == acmd->cmd_ncookies) {
3287 ddi_dma_nextcookie(acmd->cmd_dmahandle,
3288 &acmd->cmd_dmacookies[i]);
3291 acmd->cmd_cookiecnt = i;
3293 if (bp->b_bcount >= acmd->cmd_dmacount) {
3294 pkt->pkt_resid = bp->b_bcount - acmd->cmd_dmacount;
3316 struct scsa_cmd *acmd = PKT2CMD(pkt);
3321 acmd->islogical = MEGADRV_IS_LOGICAL(ap);
3322 acmd->device_id = MAP_DEVICE_ID(instance, ap);
3331 cmd->cmd = acmd;
3334 if (acmd->cmd_flags & CFLAG_DMASEND) {
3337 if (acmd->cmd_flags & CFLAG_CONSISTENT) {
3338 (void) ddi_dma_sync(acmd->cmd_dmahandle,
3339 acmd->cmd_dma_offset, acmd->cmd_dma_len,
3342 } else if (acmd->cmd_flags & ~CFLAG_DMASEND) {
3345 if (acmd->cmd_flags & CFLAG_CONSISTENT) {
3346 (void) ddi_dma_sync(acmd->cmd_dmahandle,
3347 acmd->cmd_dma_offset, acmd->cmd_dma_len,
3371 if (acmd->islogical) {
3382 ldio->target_id = acmd->device_id;
3395 ldio->access_byte = (acmd->cmd_cdblen != 6) ?
3397 ldio->sge_count = acmd->cmd_cookiecnt;
3402 if (acmd->cmd_cdblen == CDB_GROUP0) {
3411 } else if (acmd->cmd_cdblen == CDB_GROUP1) {
3421 } else if (acmd->cmd_cdblen == CDB_GROUP2) {
3433 } else if (acmd->cmd_cdblen == CDB_GROUP3) {
3460 pthru->cmd = (acmd->islogical) ?
3464 pthru->target_id = acmd->device_id;
3466 pthru->cdb_len = acmd->cmd_cdblen;
3469 pthru->data_xfer_len = acmd->cmd_dmacount;
3470 pthru->sge_count = acmd->cmd_cookiecnt;
3480 bcopy(pkt->pkt_cdbp, pthru->cdb, acmd->cmd_cdblen);
3490 for (i = 0; i < acmd->cmd_cookiecnt; i++, mfi_sgl++) {
3491 mfi_sgl->phys_addr = acmd->cmd_dmacookies[i].dmac_laddress;
3492 mfi_sgl->length = acmd->cmd_dmacookies[i].dmac_size;
3495 sge_bytes = sizeof (struct megasas_sge64)*acmd->cmd_cookiecnt;