Lines Matching refs:bccb
96 struct bt_ccb *bccb);
100 struct bt_ccb *bccb);
102 struct bt_ccb *bccb);
105 btccbvtop(struct bt_softc *bt, struct bt_ccb *bccb) in btccbvtop() argument
108 + (u_int32_t)((caddr_t)bccb - (caddr_t)bt->bt_ccb_array)); in btccbvtop()
119 btsensepaddr(struct bt_softc *bt, struct bt_ccb *bccb) in btsensepaddr() argument
123 index = (u_int)(bccb - bt->bt_ccb_array); in btsensepaddr()
129 btsensevaddr(struct bt_softc *bt, struct bt_ccb *bccb) in btsensevaddr() argument
133 index = (u_int)(bccb - bt->bt_ccb_array); in btsensevaddr()
139 struct bt_ccb *bccb);
142 static void btdone(struct bt_softc *bt, struct bt_ccb *bccb,
1072 btfreeccb(struct bt_softc *bt, struct bt_ccb *bccb) in btfreeccb() argument
1077 if ((bccb->flags & BCCB_ACTIVE) != 0) in btfreeccb()
1078 LIST_REMOVE(&bccb->ccb->ccb_h, sim_links.le); in btfreeccb()
1080 && (bccb->ccb->ccb_h.status & CAM_RELEASE_SIMQ) == 0) { in btfreeccb()
1081 bccb->ccb->ccb_h.status |= CAM_RELEASE_SIMQ; in btfreeccb()
1084 bccb->flags = BCCB_FREE; in btfreeccb()
1085 SLIST_INSERT_HEAD(&bt->free_bt_ccbs, bccb, links); in btfreeccb()
1092 struct bt_ccb* bccb; in btgetccb() local
1096 if ((bccb = SLIST_FIRST(&bt->free_bt_ccbs)) != NULL) { in btgetccb()
1101 bccb = SLIST_FIRST(&bt->free_bt_ccbs); in btgetccb()
1102 if (bccb != NULL) { in btgetccb()
1108 return (bccb); in btgetccb()
1126 struct bt_ccb *bccb; in btaction() local
1132 if ((bccb = btgetccb(bt)) == NULL) { in btaction()
1141 hccb = &bccb->hccb; in btaction()
1146 bccb->ccb = ccb; in btaction()
1147 ccb->ccb_h.ccb_bccb_ptr = bccb; in btaction()
1171 btfreeccb(bt, bccb); in btaction()
1191 btfreeccb(bt, bccb); in btaction()
1201 hccb->sense_addr = btsensepaddr(bt, bccb); in btaction()
1211 bccb->dmamap, in btaction()
1214 bccb, in btaction()
1234 btexecuteccb(bccb, NULL, 0, 0); in btaction()
1394 struct bt_ccb *bccb; in btexecuteccb() local
1398 bccb = (struct bt_ccb *)arg; in btexecuteccb()
1399 ccb = bccb->ccb; in btexecuteccb()
1411 btfreeccb(bt, bccb); in btexecuteccb()
1424 sg = bccb->sg_list; in btexecuteccb()
1433 bccb->hccb.opcode = INITIATOR_SG_CCB_WRESID; in btexecuteccb()
1434 bccb->hccb.data_len = sizeof(bt_sg_t) * nseg; in btexecuteccb()
1435 bccb->hccb.data_addr = bccb->sg_list_phys; in btexecuteccb()
1437 bccb->hccb.data_len = bccb->sg_list->len; in btexecuteccb()
1438 bccb->hccb.data_addr = bccb->sg_list->addr; in btexecuteccb()
1446 bus_dmamap_sync(bt->buffer_dmat, bccb->dmamap, op); in btexecuteccb()
1449 bccb->hccb.opcode = INITIATOR_CCB; in btexecuteccb()
1450 bccb->hccb.data_len = 0; in btexecuteccb()
1451 bccb->hccb.data_addr = 0; in btexecuteccb()
1460 bus_dmamap_unload(bt->buffer_dmat, bccb->dmamap); in btexecuteccb()
1461 btfreeccb(bt, bccb); in btexecuteccb()
1466 bccb->flags = BCCB_ACTIVE; in btexecuteccb()
1470 callout_reset_sbt(&bccb->timer, SBT_1MS * ccb->ccb_h.timeout, 0, in btexecuteccb()
1471 bttimeout, bccb, 0); in btexecuteccb()
1474 bt->cur_outbox->ccb_addr = btccbvtop(bt, bccb); in btexecuteccb()
1487 callout_stop(&bccb->timer); in btexecuteccb()
1489 bus_dmamap_unload(bt->buffer_dmat, bccb->dmamap); in btexecuteccb()
1490 btfreeccb(bt, bccb); in btexecuteccb()
1544 btdone(struct bt_softc *bt, struct bt_ccb *bccb, bt_mbi_comp_code_t comp_code) in btdone() argument
1549 ccb = bccb->ccb; in btdone()
1550 csio = &bccb->ccb->csio; in btdone()
1552 if ((bccb->flags & BCCB_ACTIVE) == 0) { in btdone()
1555 (void *)bccb); in btdone()
1566 bus_dmamap_sync(bt->buffer_dmat, bccb->dmamap, op); in btdone()
1567 bus_dmamap_unload(bt->buffer_dmat, bccb->dmamap); in btdone()
1570 if (bccb == bt->recovery_bccb) { in btdone()
1586 bccb->hccb.target_id, in btdone()
1600 == bccb->hccb.target_id) { in btdone()
1615 callout_stop(&bccb->timer); in btdone()
1631 (void *)bccb, comp_code, bccb->hccb.btstat, in btdone()
1632 bccb->hccb.sdstat); in btdone()
1635 switch(bccb->hccb.btstat) { in btdone()
1637 if (bccb->hccb.data_len == 0) { in btdone()
1642 bccb->hccb.sdstat = SCSI_STATUS_QUEUE_FULL; in btdone()
1643 } else if (bccb->hccb.data_len < 0) { in btdone()
1653 csio->scsi_status = bccb->hccb.sdstat; in btdone()
1662 *btsensevaddr(bt, bccb); in btdone()
1671 csio->resid = bccb->hccb.data_len; in btdone()
1741 if ((bccb->flags & BCCB_DEVICE_RESET) == 0) in btdone()
1758 if ((bccb->flags & BCCB_RELEASE_SIMQ) != 0) in btdone()
1760 btfreeccb(bt, bccb); in btdone()
1766 if ((bccb->flags & BCCB_RELEASE_SIMQ) != 0) in btdone()
1768 btfreeccb(bt, bccb); in btdone()
2297 struct bt_ccb *bccb; in bttimeout() local
2301 bccb = (struct bt_ccb *)arg; in bttimeout()
2302 ccb = bccb->ccb; in bttimeout()
2306 printf("CCB %p - timed out\n", (void *)bccb); in bttimeout()
2308 if ((bccb->flags & BCCB_ACTIVE) == 0) { in bttimeout()
2311 (void *)bccb); in bttimeout()
2325 if ((bccb->flags & BCCB_DEVICE_RESET) == 0) { in bttimeout()
2328 if ((bccb->flags & BCCB_RELEASE_SIMQ) == 0) { in bttimeout()
2330 bccb->flags |= BCCB_RELEASE_SIMQ; in bttimeout()
2343 if ((bccb->flags & BCCB_DEVICE_RESET) != 0 in bttimeout()
2345 || ((bccb->hccb.tag_enable == TRUE) in bttimeout()
2374 bccb->flags |= BCCB_DEVICE_RESET; in bttimeout()
2375 callout_reset(&bccb->timer, 2 * hz, bttimeout, bccb); in bttimeout()