Lines Matching refs:cm

195 typedef void mps_command_callback_t(struct mps_softc *, struct mps_command *cm);
545 mps_free_command(struct mps_softc *sc, struct mps_command *cm) in mps_free_command() argument
549 KASSERT(cm->cm_state == MPS_CM_STATE_BUSY, in mps_free_command()
550 ("state not busy: %u\n", cm->cm_state)); in mps_free_command()
552 if (cm->cm_reply != NULL) in mps_free_command()
553 mps_free_reply(sc, cm->cm_reply_data); in mps_free_command()
554 cm->cm_reply = NULL; in mps_free_command()
555 cm->cm_flags = 0; in mps_free_command()
556 cm->cm_complete = NULL; in mps_free_command()
557 cm->cm_complete_data = NULL; in mps_free_command()
558 cm->cm_ccb = NULL; in mps_free_command()
559 cm->cm_targ = NULL; in mps_free_command()
560 cm->cm_max_segs = 0; in mps_free_command()
561 cm->cm_lun = 0; in mps_free_command()
562 cm->cm_state = MPS_CM_STATE_FREE; in mps_free_command()
563 cm->cm_data = NULL; in mps_free_command()
564 cm->cm_length = 0; in mps_free_command()
565 cm->cm_out_len = 0; in mps_free_command()
566 cm->cm_sglsize = 0; in mps_free_command()
567 cm->cm_sge = NULL; in mps_free_command()
569 TAILQ_FOREACH_SAFE(chain, &cm->cm_chain_list, chain_link, chain_temp) { in mps_free_command()
570 TAILQ_REMOVE(&cm->cm_chain_list, chain, chain_link); in mps_free_command()
573 TAILQ_INSERT_TAIL(&sc->req_list, cm, cm_link); in mps_free_command()
579 struct mps_command *cm; in mps_alloc_command() local
581 cm = TAILQ_FIRST(&sc->req_list); in mps_alloc_command()
582 if (cm == NULL) in mps_alloc_command()
585 KASSERT(cm->cm_state == MPS_CM_STATE_FREE, in mps_alloc_command()
586 ("mps: Allocating busy command: %u\n", cm->cm_state)); in mps_alloc_command()
588 TAILQ_REMOVE(&sc->req_list, cm, cm_link); in mps_alloc_command()
589 cm->cm_state = MPS_CM_STATE_BUSY; in mps_alloc_command()
590 cm->cm_timeout_handler = NULL; in mps_alloc_command()
591 return (cm); in mps_alloc_command()
595 mps_free_high_priority_command(struct mps_softc *sc, struct mps_command *cm) in mps_free_high_priority_command() argument
599 KASSERT(cm->cm_state == MPS_CM_STATE_BUSY, in mps_free_high_priority_command()
600 ("state not busy: %u\n", cm->cm_state)); in mps_free_high_priority_command()
602 if (cm->cm_reply != NULL) in mps_free_high_priority_command()
603 mps_free_reply(sc, cm->cm_reply_data); in mps_free_high_priority_command()
604 cm->cm_reply = NULL; in mps_free_high_priority_command()
605 cm->cm_flags = 0; in mps_free_high_priority_command()
606 cm->cm_complete = NULL; in mps_free_high_priority_command()
607 cm->cm_complete_data = NULL; in mps_free_high_priority_command()
608 cm->cm_ccb = NULL; in mps_free_high_priority_command()
609 cm->cm_targ = NULL; in mps_free_high_priority_command()
610 cm->cm_lun = 0; in mps_free_high_priority_command()
611 cm->cm_state = MPS_CM_STATE_FREE; in mps_free_high_priority_command()
612 TAILQ_FOREACH_SAFE(chain, &cm->cm_chain_list, chain_link, chain_temp) { in mps_free_high_priority_command()
613 TAILQ_REMOVE(&cm->cm_chain_list, chain, chain_link); in mps_free_high_priority_command()
616 TAILQ_INSERT_TAIL(&sc->high_priority_req_list, cm, cm_link); in mps_free_high_priority_command()
622 struct mps_command *cm; in mps_alloc_high_priority_command() local
624 cm = TAILQ_FIRST(&sc->high_priority_req_list); in mps_alloc_high_priority_command()
625 if (cm == NULL) in mps_alloc_high_priority_command()
628 KASSERT(cm->cm_state == MPS_CM_STATE_FREE, in mps_alloc_high_priority_command()
629 ("mps: Allocating high priority busy command: %u\n", cm->cm_state)); in mps_alloc_high_priority_command()
631 TAILQ_REMOVE(&sc->high_priority_req_list, cm, cm_link); in mps_alloc_high_priority_command()
632 cm->cm_state = MPS_CM_STATE_BUSY; in mps_alloc_high_priority_command()
633 cm->cm_timeout_handler = NULL; in mps_alloc_high_priority_command()
634 cm->cm_desc.HighPriority.RequestFlags = in mps_alloc_high_priority_command()
636 return (cm); in mps_alloc_high_priority_command()
757 void mpi_init_sge(struct mps_command *cm, void *req, void *sge);
763 int mps_map_command(struct mps_softc *sc, struct mps_command *cm);
764 int mps_wait_command(struct mps_softc *sc, struct mps_command **cm, int timeout,