Lines Matching defs:mpt

47 #include <dev/mpt/mpt.h>
95 .d_name = "mpt",
98 static MALLOC_DEFINE(M_MPTUSER, "mpt_user", "Buffers for mpt(4) ioctls");
103 mpt_user_probe(struct mpt_softc *mpt)
111 mpt_user_attach(struct mpt_softc *mpt)
116 MPT_LOCK(mpt);
118 error = mpt_register_handler(mpt, MPT_HANDLER_REPLY, handler,
120 MPT_UNLOCK(mpt);
122 mpt_prt(mpt, "Unable to register user handler!\n");
125 unit = device_get_unit(mpt->dev);
126 mpt->cdev = make_dev(&mpt_cdevsw, unit, UID_ROOT, GID_OPERATOR, 0640,
127 "mpt%d", unit);
128 if (mpt->cdev == NULL) {
129 MPT_LOCK(mpt);
130 mpt_deregister_handler(mpt, MPT_HANDLER_REPLY, handler,
132 MPT_UNLOCK(mpt);
135 mpt->cdev->si_drv1 = mpt;
140 mpt_user_enable(struct mpt_softc *mpt)
147 mpt_user_ready(struct mpt_softc *mpt)
153 mpt_user_event(struct mpt_softc *mpt, request_t *req,
162 mpt_user_reset(struct mpt_softc *mpt, int type)
168 mpt_user_detach(struct mpt_softc *mpt)
173 destroy_dev(mpt->cdev);
175 MPT_LOCK(mpt);
177 mpt_deregister_handler(mpt, MPT_HANDLER_REPLY, handler,
179 MPT_UNLOCK(mpt);
197 mpt_alloc_buffer(struct mpt_softc *mpt, struct mpt_page_memory *page_mem,
208 error = mpt_dma_tag_create(mpt, mpt->parent_dmat, 1, 0,
219 mi.mpt = mpt;
247 mpt_user_read_cfg_header(struct mpt_softc *mpt,
255 req = mpt_get_request(mpt, TRUE);
257 mpt_prt(mpt, "mpt_user_read_cfg_header: Get request failed!\n");
267 error = mpt_issue_cfg_req(mpt, req, &params, /*addr*/0, /*len*/0,
276 mpt_prt(mpt, "read_cfg_header timed out\n");
286 mpt_free_request(mpt, req);
291 mpt_user_read_cfg_page(struct mpt_softc *mpt, struct mpt_cfg_page_req *page_req,
299 req = mpt_get_request(mpt, TRUE);
301 mpt_prt(mpt, "mpt_user_read_cfg_page: Get request failed!\n");
314 error = mpt_issue_cfg_req(mpt, req, &params, mpt_page->paddr,
317 mpt_prt(mpt, "mpt_user_read_cfg_page timed out\n");
325 mpt_free_request(mpt, req);
330 mpt_user_read_extcfg_header(struct mpt_softc *mpt,
338 req = mpt_get_request(mpt, TRUE);
340 mpt_prt(mpt, "mpt_user_read_extcfg_header: Get request failed!\n");
352 error = mpt_issue_cfg_req(mpt, req, &params, /*addr*/0, /*len*/0,
361 mpt_prt(mpt, "mpt_user_read_extcfg_header timed out\n");
374 mpt_free_request(mpt, req);
379 mpt_user_read_extcfg_page(struct mpt_softc *mpt,
387 req = mpt_get_request(mpt, TRUE);
389 mpt_prt(mpt, "mpt_user_read_extcfg_page: Get request failed!\n");
404 error = mpt_issue_cfg_req(mpt, req, &params, mpt_page->paddr,
407 mpt_prt(mpt, "mpt_user_read_extcfg_page timed out\n");
415 mpt_free_request(mpt, req);
420 mpt_user_write_cfg_page(struct mpt_softc *mpt,
433 mpt_prt(mpt, "page type 0x%x not changeable\n",
445 req = mpt_get_request(mpt, TRUE);
469 error = mpt_issue_cfg_req(mpt, req, &params, mpt_page->paddr,
472 mpt_prt(mpt, "mpt_write_cfg_page timed out\n");
479 mpt_free_request(mpt, req);
484 mpt_user_reply_handler(struct mpt_softc *mpt, request_t *req,
497 (((uint8_t *)req->req_vbuf) + MPT_RQSL(mpt));
506 TAILQ_REMOVE(&mpt->request_pending_list, req, links);
514 mpt_free_request(mpt, req);
527 mpt_user_raid_action(struct mpt_softc *mpt, struct mpt_raid_action *raid_act,
536 req = mpt_get_request(mpt, TRUE);
562 mpt_check_doorbell(mpt);
563 mpt_send_cmd(mpt, req);
565 error = mpt_wait_req(mpt, req, REQ_STATE_DONE, REQ_STATE_DONE, TRUE,
571 mpt_prt(mpt, "mpt_user_raid_action timed out\n");
577 mpt_free_request(mpt, req);
582 (((uint8_t *)req->req_vbuf) + MPT_RQSL(mpt));
590 mpt_free_request(mpt, req);
597 struct mpt_softc *mpt;
612 mpt = dev->si_drv1;
667 MPT_LOCK(mpt);
668 error = mpt_user_read_cfg_header(mpt, page_req);
669 MPT_UNLOCK(mpt);
675 error = mpt_alloc_buffer(mpt, &mpt_page, page_req->len);
682 MPT_LOCK(mpt);
683 error = mpt_user_read_cfg_page(mpt, page_req, &mpt_page);
684 MPT_UNLOCK(mpt);
693 MPT_LOCK(mpt);
694 error = mpt_user_read_extcfg_header(mpt, ext_page_req);
695 MPT_UNLOCK(mpt);
701 error = mpt_alloc_buffer(mpt, &mpt_page, ext_page_req->len);
708 MPT_LOCK(mpt);
709 error = mpt_user_read_extcfg_page(mpt, ext_page_req, &mpt_page);
710 MPT_UNLOCK(mpt);
720 error = mpt_alloc_buffer(mpt, &mpt_page, page_req->len);
726 MPT_LOCK(mpt);
727 error = mpt_user_write_cfg_page(mpt, page_req, &mpt_page);
728 MPT_UNLOCK(mpt);
735 error = mpt_alloc_buffer(mpt, &mpt_page, raid_act->len);
743 MPT_LOCK(mpt);
744 error = mpt_user_raid_action(mpt, raid_act, &mpt_page);
745 MPT_UNLOCK(mpt);