Lines Matching refs:cm

212 typedef void mps_command_callback_t(struct mps_softc *, struct mps_command *cm);
514 mps_free_command(struct mps_softc *sc, struct mps_command *cm) in mps_free_command() argument
518 if (cm->cm_reply != NULL) in mps_free_command()
519 mps_free_reply(sc, cm->cm_reply_data); in mps_free_command()
520 cm->cm_reply = NULL; in mps_free_command()
521 cm->cm_flags = 0; in mps_free_command()
522 cm->cm_complete = NULL; in mps_free_command()
523 cm->cm_complete_data = NULL; in mps_free_command()
524 cm->cm_ccb = NULL; in mps_free_command()
525 cm->cm_targ = NULL; in mps_free_command()
526 cm->cm_max_segs = 0; in mps_free_command()
527 cm->cm_lun = 0; in mps_free_command()
528 cm->cm_state = MPS_CM_STATE_FREE; in mps_free_command()
529 cm->cm_data = NULL; in mps_free_command()
530 cm->cm_length = 0; in mps_free_command()
531 cm->cm_out_len = 0; in mps_free_command()
532 cm->cm_sglsize = 0; in mps_free_command()
533 cm->cm_sge = NULL; in mps_free_command()
535 TAILQ_FOREACH_MUTABLE(chain, &cm->cm_chain_list, chain_link, chain_temp) { in mps_free_command()
536 TAILQ_REMOVE(&cm->cm_chain_list, chain, chain_link); in mps_free_command()
539 TAILQ_INSERT_TAIL(&sc->req_list, cm, cm_link); in mps_free_command()
545 struct mps_command *cm; in mps_alloc_command() local
547 cm = TAILQ_FIRST(&sc->req_list); in mps_alloc_command()
548 if (cm == NULL) in mps_alloc_command()
551 TAILQ_REMOVE(&sc->req_list, cm, cm_link); in mps_alloc_command()
552 KASSERT(cm->cm_state == MPS_CM_STATE_FREE, ("mps: Allocating busy command")); in mps_alloc_command()
553 cm->cm_state = MPS_CM_STATE_BUSY; in mps_alloc_command()
554 return (cm); in mps_alloc_command()
558 mps_free_high_priority_command(struct mps_softc *sc, struct mps_command *cm) in mps_free_high_priority_command() argument
562 if (cm->cm_reply != NULL) in mps_free_high_priority_command()
563 mps_free_reply(sc, cm->cm_reply_data); in mps_free_high_priority_command()
564 cm->cm_reply = NULL; in mps_free_high_priority_command()
565 cm->cm_flags = 0; in mps_free_high_priority_command()
566 cm->cm_complete = NULL; in mps_free_high_priority_command()
567 cm->cm_complete_data = NULL; in mps_free_high_priority_command()
568 cm->cm_ccb = NULL; in mps_free_high_priority_command()
569 cm->cm_targ = NULL; in mps_free_high_priority_command()
570 cm->cm_lun = 0; in mps_free_high_priority_command()
571 cm->cm_state = MPS_CM_STATE_FREE; in mps_free_high_priority_command()
572 TAILQ_FOREACH_MUTABLE(chain, &cm->cm_chain_list, chain_link, chain_temp) { in mps_free_high_priority_command()
573 TAILQ_REMOVE(&cm->cm_chain_list, chain, chain_link); in mps_free_high_priority_command()
576 TAILQ_INSERT_TAIL(&sc->high_priority_req_list, cm, cm_link); in mps_free_high_priority_command()
582 struct mps_command *cm; in mps_alloc_high_priority_command() local
584 cm = TAILQ_FIRST(&sc->high_priority_req_list); in mps_alloc_high_priority_command()
585 if (cm == NULL) in mps_alloc_high_priority_command()
588 TAILQ_REMOVE(&sc->high_priority_req_list, cm, cm_link); in mps_alloc_high_priority_command()
589 KASSERT(cm->cm_state == MPS_CM_STATE_FREE, ("mps: Allocating busy command")); in mps_alloc_high_priority_command()
590 cm->cm_state = MPS_CM_STATE_BUSY; in mps_alloc_high_priority_command()
591 return (cm); in mps_alloc_high_priority_command()
700 void mpi_init_sge(struct mps_command *cm, void *req, void *sge);
706 int mps_map_command(struct mps_softc *sc, struct mps_command *cm);
707 int mps_wait_command(struct mps_softc *sc, struct mps_command *cm, int timeout);
708 int mps_request_polled(struct mps_softc *sc, struct mps_command *cm);