Lines Matching refs:ccb_h

340 	struct ccb_hdr *ccb_h;  in cleanup()  local
350 while ((ccb_h = TAILQ_FIRST(&pending_queue)) != NULL) { in cleanup()
351 TAILQ_REMOVE(&pending_queue, ccb_h, periph_links.tqe); in cleanup()
352 free_ccb((union ccb *)ccb_h); in cleanup()
354 while ((ccb_h = TAILQ_FIRST(&work_queue)) != NULL) { in cleanup()
355 TAILQ_REMOVE(&work_queue, ccb_h, periph_links.tqe); in cleanup()
356 free_ccb((union ccb *)ccb_h); in cleanup()
385 atio->ccb_h.func_code = XPT_ACCEPT_TARGET_IO; in init_ccbs()
386 atio->ccb_h.targ_descr = a_descr; in init_ccbs()
394 inot->ccb_h.func_code = XPT_IMMEDIATE_NOTIFY; in init_ccbs()
428 struct ccb_hdr *ccb_h; in request_loop() local
465 ctio->ccb_h.targ_descr; in request_loop()
493 if ((ccb_h = TAILQ_FIRST(&work_queue)) != NULL) { in request_loop()
496 ccb = (union ccb *)ccb_h; in request_loop()
497 switch (ccb_h->func_code) { in request_loop()
507 ccb_h->func_code); in request_loop()
513 if ((ccb_h->status & CAM_DEV_QFRZN) != 0) { in request_loop()
523 TAILQ_REMOVE(&work_queue, ccb_h, in request_loop()
560 TAILQ_REMOVE(&pending_queue, &ccb->ccb_h, periph_links.tqe); in handle_read()
562 switch (ccb->ccb_h.func_code) { in handle_read()
570 a_descr = (struct atio_descr *)atio->ccb_h.targ_descr; in handle_read()
573 a_descr->flags = atio->ccb_h.flags & in handle_read()
576 if ((atio->ccb_h.flags & CAM_CDB_POINTER) == 0) in handle_read()
582 TAILQ_INSERT_TAIL(&work_queue, &ccb->ccb_h, in handle_read()
592 c_descr = (struct ctio_descr *)ctio->ccb_h.targ_descr; in handle_read()
602 TAILQ_INSERT_HEAD(&work_queue, &ccb->ccb_h, in handle_read()
607 ccb->ccb_h.func_code); in handle_read()
626 a_descr = (struct atio_descr *)atio->ccb_h.targ_descr; in work_atio()
634 ctio->ccb_h.flags = a_descr->flags; in work_atio()
638 c_descr = (struct ctio_descr *)ctio->ccb_h.targ_descr; in work_atio()
665 status = atio->ccb_h.status & CAM_STATUS_MASK; in work_atio()
673 TAILQ_REMOVE(&work_queue, &atio->ccb_h, periph_links.tqe); in work_atio()
690 struct ccb_hdr *ccb_h; in queue_io() local
694 c_descr = (struct ctio_descr *)ctio->ccb_h.targ_descr; in queue_io()
698 ioq = &((struct atio_descr *)c_descr->atio->ccb_h.targ_descr)->cmplt_io; in queue_io()
701 TAILQ_INSERT_HEAD(ioq, &ctio->ccb_h, periph_links.tqe); in queue_io()
705 TAILQ_FOREACH_REVERSE(ccb_h, ioq, io_queue, periph_links.tqe) { in queue_io()
707 (struct ctio_descr *)ccb_h->targ_descr; in queue_io()
713 if (ccb_h) { in queue_io()
714 TAILQ_INSERT_AFTER(ioq, ccb_h, &ctio->ccb_h, periph_links.tqe); in queue_io()
716 TAILQ_INSERT_HEAD(ioq, &ctio->ccb_h, periph_links.tqe); in queue_io()
728 struct ccb_hdr *ccb_h; in run_queue() local
734 a_descr = (struct atio_descr *)atio->ccb_h.targ_descr; in run_queue()
736 while ((ccb_h = TAILQ_FIRST(&a_descr->cmplt_io)) != NULL) { in run_queue()
740 ctio = (struct ccb_scsiio *)ccb_h; in run_queue()
741 c_descr = (struct ctio_descr *)ctio->ccb_h.targ_descr; in run_queue()
743 if (ctio->ccb_h.status == CAM_REQ_ABORTED) { in run_queue()
744 TAILQ_REMOVE(&a_descr->cmplt_io, ccb_h, in run_queue()
756 sent_status = (ccb_h->flags & CAM_SEND_STATUS) != 0; in run_queue()
759 TAILQ_REMOVE(&a_descr->cmplt_io, ccb_h, in run_queue()
769 warnx("IO %p:%p out of order %s", ccb_h, in run_queue()
786 status = inot->ccb_h.status; in work_inot()
823 TAILQ_REMOVE(&work_queue, &inot->ccb_h, periph_links.tqe); in work_inot()
833 warnx("sending ccb (%#x)", ccb->ccb_h.func_code); in send_ccb()
834 ccb->ccb_h.pinfo.priority = priority; in send_ccb()
836 TAILQ_INSERT_TAIL(&pending_queue, &ccb->ccb_h, in send_ccb()
841 ccb->ccb_h.status = CAM_PROVIDE_FAIL; in send_ccb()
879 ctio->ccb_h.func_code = XPT_CONT_TARGET_IO; in get_ctio()
880 ctio->ccb_h.retry_count = 2; in get_ctio()
881 ctio->ccb_h.timeout = CAM_TIME_INFINITY; in get_ctio()
883 ctio->ccb_h.targ_descr = c_descr; in get_ctio()
897 switch (ccb->ccb_h.func_code) { in free_ccb()
902 c_descr = (struct ctio_descr *)ccb->ccb_h.targ_descr; in free_ccb()
908 free(ccb->ccb_h.targ_descr); in free_ccb()
925 cpi.ccb_h.func_code = XPT_PATH_INQ; in get_sim_flags()
927 status = cpi.ccb_h.status & CAM_STATUS_MASK; in get_sim_flags()
950 crs.ccb_h.func_code = XPT_REL_SIMQ; in rel_simq()
963 struct ccb_hdr *ccb_h; in abort_all_pending() local
969 cab.ccb_h.func_code = XPT_ABORT; in abort_all_pending()
970 TAILQ_FOREACH(ccb_h, &pending_queue, periph_links.tqe) { in abort_all_pending()
972 warnx("Aborting pending CCB %p\n", ccb_h); in abort_all_pending()
973 cab.abort_ccb = (union ccb *)ccb_h; in abort_all_pending()
975 if (cab.ccb_h.status != CAM_REQ_CMP) { in abort_all_pending()
977 cab.ccb_h.status); in abort_all_pending()