Lines Matching refs:bccb
97 struct bt_ccb *bccb);
101 struct bt_ccb *bccb);
103 struct bt_ccb *bccb);
106 btccbvtop(struct bt_softc *bt, struct bt_ccb *bccb) in btccbvtop() argument
109 + (u_int32_t)((caddr_t)bccb - (caddr_t)bt->bt_ccb_array)); in btccbvtop()
120 btsensepaddr(struct bt_softc *bt, struct bt_ccb *bccb) in btsensepaddr() argument
124 index = (u_int)(bccb - bt->bt_ccb_array); in btsensepaddr()
130 btsensevaddr(struct bt_softc *bt, struct bt_ccb *bccb) in btsensevaddr() argument
134 index = (u_int)(bccb - bt->bt_ccb_array); in btsensevaddr()
140 struct bt_ccb *bccb);
143 static void btdone(struct bt_softc *bt, struct bt_ccb *bccb,
1057 btfreeccb(struct bt_softc *bt, struct bt_ccb *bccb) in btfreeccb() argument
1062 if ((bccb->flags & BCCB_ACTIVE) != 0) in btfreeccb()
1063 LIST_REMOVE(&bccb->ccb->ccb_h, sim_links.le); in btfreeccb()
1065 && (bccb->ccb->ccb_h.status & CAM_RELEASE_SIMQ) == 0) { in btfreeccb()
1066 bccb->ccb->ccb_h.status |= CAM_RELEASE_SIMQ; in btfreeccb()
1069 bccb->flags = BCCB_FREE; in btfreeccb()
1070 SLIST_INSERT_HEAD(&bt->free_bt_ccbs, bccb, links); in btfreeccb()
1077 struct bt_ccb* bccb; in btgetccb() local
1081 if ((bccb = SLIST_FIRST(&bt->free_bt_ccbs)) != NULL) { in btgetccb()
1086 bccb = SLIST_FIRST(&bt->free_bt_ccbs); in btgetccb()
1087 if (bccb != NULL) { in btgetccb()
1093 return (bccb); in btgetccb()
1111 struct bt_ccb *bccb; in btaction() local
1117 if ((bccb = btgetccb(bt)) == NULL) { in btaction()
1126 hccb = &bccb->hccb; in btaction()
1131 bccb->ccb = ccb; in btaction()
1132 ccb->ccb_h.ccb_bccb_ptr = bccb; in btaction()
1156 btfreeccb(bt, bccb); in btaction()
1176 btfreeccb(bt, bccb); in btaction()
1186 hccb->sense_addr = btsensepaddr(bt, bccb); in btaction()
1196 bccb->dmamap, in btaction()
1199 bccb, in btaction()
1219 btexecuteccb(bccb, NULL, 0, 0); in btaction()
1375 struct bt_ccb *bccb; in btexecuteccb() local
1379 bccb = (struct bt_ccb *)arg; in btexecuteccb()
1380 ccb = bccb->ccb; in btexecuteccb()
1392 btfreeccb(bt, bccb); in btexecuteccb()
1405 sg = bccb->sg_list; in btexecuteccb()
1414 bccb->hccb.opcode = INITIATOR_SG_CCB_WRESID; in btexecuteccb()
1415 bccb->hccb.data_len = sizeof(bt_sg_t) * nseg; in btexecuteccb()
1416 bccb->hccb.data_addr = bccb->sg_list_phys; in btexecuteccb()
1418 bccb->hccb.data_len = bccb->sg_list->len; in btexecuteccb()
1419 bccb->hccb.data_addr = bccb->sg_list->addr; in btexecuteccb()
1427 bus_dmamap_sync(bt->buffer_dmat, bccb->dmamap, op); in btexecuteccb()
1430 bccb->hccb.opcode = INITIATOR_CCB; in btexecuteccb()
1431 bccb->hccb.data_len = 0; in btexecuteccb()
1432 bccb->hccb.data_addr = 0; in btexecuteccb()
1441 bus_dmamap_unload(bt->buffer_dmat, bccb->dmamap); in btexecuteccb()
1442 btfreeccb(bt, bccb); in btexecuteccb()
1447 bccb->flags = BCCB_ACTIVE; in btexecuteccb()
1451 callout_reset_sbt(&bccb->timer, SBT_1MS * ccb->ccb_h.timeout, 0, in btexecuteccb()
1452 bttimeout, bccb, 0); in btexecuteccb()
1455 bt->cur_outbox->ccb_addr = btccbvtop(bt, bccb); in btexecuteccb()
1468 callout_stop(&bccb->timer); in btexecuteccb()
1470 bus_dmamap_unload(bt->buffer_dmat, bccb->dmamap); in btexecuteccb()
1471 btfreeccb(bt, bccb); in btexecuteccb()
1525 btdone(struct bt_softc *bt, struct bt_ccb *bccb, bt_mbi_comp_code_t comp_code) in btdone() argument
1530 ccb = bccb->ccb; in btdone()
1531 csio = &bccb->ccb->csio; in btdone()
1533 if ((bccb->flags & BCCB_ACTIVE) == 0) { in btdone()
1536 (void *)bccb); in btdone()
1547 bus_dmamap_sync(bt->buffer_dmat, bccb->dmamap, op); in btdone()
1548 bus_dmamap_unload(bt->buffer_dmat, bccb->dmamap); in btdone()
1551 if (bccb == bt->recovery_bccb) { in btdone()
1567 bccb->hccb.target_id, in btdone()
1581 == bccb->hccb.target_id) { in btdone()
1596 callout_stop(&bccb->timer); in btdone()
1612 (void *)bccb, comp_code, bccb->hccb.btstat, in btdone()
1613 bccb->hccb.sdstat); in btdone()
1616 switch(bccb->hccb.btstat) { in btdone()
1618 if (bccb->hccb.data_len == 0) { in btdone()
1623 bccb->hccb.sdstat = SCSI_STATUS_QUEUE_FULL; in btdone()
1624 } else if (bccb->hccb.data_len < 0) { in btdone()
1634 csio->scsi_status = bccb->hccb.sdstat; in btdone()
1643 *btsensevaddr(bt, bccb); in btdone()
1652 csio->resid = bccb->hccb.data_len; in btdone()
1722 if ((bccb->flags & BCCB_DEVICE_RESET) == 0) in btdone()
1739 if ((bccb->flags & BCCB_RELEASE_SIMQ) != 0) in btdone()
1741 btfreeccb(bt, bccb); in btdone()
1747 if ((bccb->flags & BCCB_RELEASE_SIMQ) != 0) in btdone()
1749 btfreeccb(bt, bccb); in btdone()
2278 struct bt_ccb *bccb; in bttimeout() local
2282 bccb = (struct bt_ccb *)arg; in bttimeout()
2283 ccb = bccb->ccb; in bttimeout()
2287 printf("CCB %p - timed out\n", (void *)bccb); in bttimeout()
2289 if ((bccb->flags & BCCB_ACTIVE) == 0) { in bttimeout()
2292 (void *)bccb); in bttimeout()
2306 if ((bccb->flags & BCCB_DEVICE_RESET) == 0) { in bttimeout()
2309 if ((bccb->flags & BCCB_RELEASE_SIMQ) == 0) { in bttimeout()
2311 bccb->flags |= BCCB_RELEASE_SIMQ; in bttimeout()
2324 if ((bccb->flags & BCCB_DEVICE_RESET) != 0 in bttimeout()
2326 || ((bccb->hccb.tag_enable == TRUE) in bttimeout()
2355 bccb->flags |= BCCB_DEVICE_RESET; in bttimeout()
2356 callout_reset(&bccb->timer, 2 * hz, bttimeout, bccb); in bttimeout()