Lines Matching refs:dccb
115 struct dpt_ccb *dccb);
117 struct dpt_ccb *dccb);
135 static int dpt_get_conf(dpt_softc_t *dpt, dpt_ccb_t *dccb,
138 static void dpt_detect_cache(dpt_softc_t *dpt, dpt_ccb_t *dccb,
155 static void dptprocesserror(dpt_softc_t *dpt, dpt_ccb_t *dccb,
205 struct dpt_ccb* dccb; in dptgetccb() local
209 if ((dccb = SLIST_FIRST(&dpt->free_dccb_list)) != NULL) { in dptgetccb()
214 dccb = SLIST_FIRST(&dpt->free_dccb_list); in dptgetccb()
215 if (dccb == NULL) in dptgetccb()
223 return (dccb); in dptgetccb()
227 dptfreeccb(struct dpt_softc *dpt, struct dpt_ccb *dccb) in dptfreeccb() argument
232 if ((dccb->state & DCCB_ACTIVE) != 0) in dptfreeccb()
233 LIST_REMOVE(&dccb->ccb->ccb_h, sim_links.le); in dptfreeccb()
234 if ((dccb->state & DCCB_RELEASE_SIMQ) != 0) in dptfreeccb()
235 dccb->ccb->ccb_h.status |= CAM_RELEASE_SIMQ; in dptfreeccb()
237 && (dccb->ccb->ccb_h.status & CAM_RELEASE_SIMQ) == 0) { in dptfreeccb()
238 dccb->ccb->ccb_h.status |= CAM_RELEASE_SIMQ; in dptfreeccb()
241 dccb->state = DCCB_FREE; in dptfreeccb()
242 SLIST_INSERT_HEAD(&dpt->free_dccb_list, dccb, links); in dptfreeccb()
247 dptccbvtop(struct dpt_softc *dpt, struct dpt_ccb *dccb) in dptccbvtop() argument
250 + (u_int32_t)((caddr_t)dccb - (caddr_t)dpt->dpt_dccbs)); in dptccbvtop()
379 dpt_get_conf(dpt_softc_t *dpt, dpt_ccb_t *dccb, u_int32_t dccb_busaddr, in dpt_get_conf() argument
390 cp = &dccb->eata_ccb; in dpt_get_conf()
478 dpt_detect_cache(dpt_softc_t *dpt, dpt_ccb_t *dccb, u_int32_t dccb_busaddr, in dpt_detect_cache() argument
497 cp = &dccb->eata_ccb; in dpt_detect_cache()
609 struct dpt_ccb *dccb; in dptexecuteccb() local
613 dccb = (struct dpt_ccb *)arg; in dptexecuteccb()
614 ccb = dccb->ccb; in dptexecuteccb()
628 dptfreeccb(dpt, dccb); in dptexecuteccb()
641 sg = dccb->sg_list; in dptexecuteccb()
650 dccb->eata_ccb.scatter = 1; in dptexecuteccb()
651 dccb->eata_ccb.cp_dataDMA = dccb->sg_busaddr; in dptexecuteccb()
652 dccb->eata_ccb.cp_datalen = in dptexecuteccb()
655 dccb->eata_ccb.cp_dataDMA = dccb->sg_list[0].seg_addr; in dptexecuteccb()
656 dccb->eata_ccb.cp_datalen = dccb->sg_list[0].seg_len; in dptexecuteccb()
664 bus_dmamap_sync(dpt->buffer_dmat, dccb->dmamap, op); in dptexecuteccb()
667 dccb->eata_ccb.cp_dataDMA = 0; in dptexecuteccb()
668 dccb->eata_ccb.cp_datalen = 0; in dptexecuteccb()
677 bus_dmamap_unload(dpt->buffer_dmat, dccb->dmamap); in dptexecuteccb()
678 dptfreeccb(dpt, dccb); in dptexecuteccb()
683 dccb->state |= DCCB_ACTIVE; in dptexecuteccb()
686 callout_reset_sbt(&dccb->timer, SBT_1MS * ccb->ccb_h.timeout, 0, in dptexecuteccb()
687 dpttimeout, dccb, 0); in dptexecuteccb()
688 if (dpt_send_eata_command(dpt, &dccb->eata_ccb, in dptexecuteccb()
689 dccb->eata_ccb.cp_busaddr, in dptexecuteccb()
693 bus_dmamap_unload(dpt->buffer_dmat, dccb->dmamap); in dptexecuteccb()
694 dptfreeccb(dpt, dccb); in dptexecuteccb()
723 struct dpt_ccb *dccb; in dpt_action() local
734 if ((dccb = dptgetccb(dpt)) == NULL) { in dpt_action()
741 eccb = &dccb->eata_ccb; in dpt_action()
744 dccb->ccb = ccb; in dpt_action()
745 ccb->ccb_h.ccb_dccb_ptr = dccb; in dpt_action()
775 eccb->cp_msg[1] = dccb->tag; in dpt_action()
789 dptfreeccb(dpt, dccb); in dpt_action()
806 dccb->dmamap, in dpt_action()
809 dccb, /*flags*/0); in dpt_action()
818 dccb->state |= CAM_RELEASE_SIMQ; in dpt_action()
830 dptexecuteccb(dccb, NULL, 0, 0); in dpt_action()
1128 dpt_ccb_t *dccb; in dpt_init() local
1177 dccb = (struct dpt_ccb *)(uintptr_t)(volatile void *)&dpt->sp[1]; in dpt_init()
1178 bzero(dccb, sizeof(*dccb)); in dpt_init()
1180 dccb->eata_ccb.cp_dataDMA = in dpt_init()
1181 htonl(sg_map->sg_physaddr + sizeof(dpt_sp_t) + sizeof(*dccb)); in dpt_init()
1182 dccb->eata_ccb.cp_busaddr = ~0; in dpt_init()
1183 dccb->eata_ccb.cp_statDMA = htonl(dpt->sp_physaddr); in dpt_init()
1184 dccb->eata_ccb.cp_reqDMA = htonl(dpt->sp_physaddr + sizeof(*dccb) in dpt_init()
1188 bzero(&dccb[1], sizeof(conf)); /* data area */ in dpt_init()
1189 retval = dpt_get_conf(dpt, dccb, sg_map->sg_physaddr + sizeof(dpt_sp_t), in dpt_init()
1196 bcopy(&dccb[1], &conf, sizeof(conf)); in dpt_init()
1198 bzero(&dccb[1], sizeof(dpt->board_data)); in dpt_init()
1199 retval = dpt_get_conf(dpt, dccb, sg_map->sg_physaddr + sizeof(dpt_sp_t), in dpt_init()
1205 bcopy(&dccb[1], &dpt->board_data, sizeof(dpt->board_data)); in dpt_init()
1207 dpt_detect_cache(dpt, dccb, sg_map->sg_physaddr + sizeof(dpt_sp_t), in dpt_init()
1208 (u_int8_t *)&dccb[1]); in dpt_init()
1487 dpt_ccb_t *dccb; in dpt_intr_locked() local
1511 dccb = dptccbptov(dpt, dpt->sp->ccb_busaddr); in dpt_intr_locked()
1520 dccb->transaction_id); in dpt_intr_locked()
1559 ccb = dccb->ccb; in dpt_intr_locked()
1560 callout_stop(&dccb->timer); in dpt_intr_locked()
1568 bus_dmamap_sync(dpt->buffer_dmat, dccb->dmamap, op); in dpt_intr_locked()
1569 bus_dmamap_unload(dpt->buffer_dmat, dccb->dmamap); in dpt_intr_locked()
1582 bcopy(&dccb->sense_data, &ccb->csio.sense_data, in dpt_intr_locked()
1592 dptfreeccb(dpt, dccb); in dpt_intr_locked()
1595 dptprocesserror(dpt, dccb, ccb, hba_stat, scsi_stat, in dpt_intr_locked()
1602 dptprocesserror(dpt_softc_t *dpt, dpt_ccb_t *dccb, union ccb *ccb, in dptprocesserror() argument
1659 dptfreeccb(dpt, dccb); in dptprocesserror()
1666 struct dpt_ccb *dccb; in dpttimeout() local
1670 dccb = (struct dpt_ccb *)arg; in dpttimeout()
1671 ccb = dccb->ccb; in dpttimeout()
1675 printf("CCB %p - timed out\n", (void *)dccb); in dpttimeout()
1685 if ((dccb->state & DCCB_ACTIVE) == 0) { in dpttimeout()
1688 (void *)dccb); in dpttimeout()
1693 dpt_send_immediate(dpt, &dccb->eata_ccb, dccb->eata_ccb.cp_busaddr, in dpttimeout()
1739 dpt_ccb_t dccb, *dccbp;
1746 dccb.xs = NULL;
1747 dccb.flags = 0;
1748 dccb.state = DPT_CCB_STATE_NEW;
1749 dccb.std_callback = NULL;
1750 dccb.wrbuff_callback = NULL;
1752 ccb = &dccb.eata_ccb;
1777 if ((result = dpt_send_eata_command(dpt, &dccb.eata_ccb,
1783 if ((result = dpt_send_eata_command(dpt, &dccb.eata_ccb,