Date: Sat, 19 Jun 2021 17:15:43 GMT From: Emmanuel Vadot <manu@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 3386347f65cd - main - mmc_sim: Make XPT_MMC_GET_TRAN_SETTINGS fully async Message-ID: <202106191715.15JHFhiI027018@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=3386347f65cdcd7c36feec216af05f188f82cf2c commit 3386347f65cdcd7c36feec216af05f188f82cf2c Author: Emmanuel Vadot <manu@FreeBSD.org> AuthorDate: 2021-06-17 18:09:52 +0000 Commit: Emmanuel Vadot <manu@FreeBSD.org> CommitDate: 2021-06-19 17:15:25 +0000 mmc_sim: Make XPT_MMC_GET_TRAN_SETTINGS fully async Sponsored by: Diablotin Systems --- sys/cam/mmc/mmc_sim.c | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/sys/cam/mmc/mmc_sim.c b/sys/cam/mmc/mmc_sim.c index 1500e3f6f1cd..b9a6a852c07f 100644 --- a/sys/cam/mmc/mmc_sim.c +++ b/sys/cam/mmc/mmc_sim.c @@ -63,11 +63,25 @@ mmc_sim_task(void *arg, int pending) return; cts = &mmc_sim->ccb->cts; - rv = MMC_SIM_SET_TRAN_SETTINGS(mmc_sim->dev, &cts->proto_specific.mmc); - if (rv != 0) - mmc_sim->ccb->ccb_h.status = CAM_REQ_INVALID; - else - mmc_sim->ccb->ccb_h.status = CAM_REQ_CMP; + switch (mmc_sim->ccb->ccb_h.func_code) { + case XPT_MMC_GET_TRAN_SETTINGS: + rv = MMC_SIM_GET_TRAN_SETTINGS(mmc_sim->dev, &cts->proto_specific.mmc); + if (rv != 0) + mmc_sim->ccb->ccb_h.status = CAM_REQ_INVALID; + else + mmc_sim->ccb->ccb_h.status = CAM_REQ_CMP; + break; + case XPT_MMC_SET_TRAN_SETTINGS: + rv = MMC_SIM_SET_TRAN_SETTINGS(mmc_sim->dev, &cts->proto_specific.mmc); + if (rv != 0) + mmc_sim->ccb->ccb_h.status = CAM_REQ_INVALID; + else + mmc_sim->ccb->ccb_h.status = CAM_REQ_CMP; + break; + default: + panic("Unsupported ccb func %x\n", mmc_sim->ccb->ccb_h.func_code); + break; + } xpt_done(mmc_sim->ccb); mmc_sim->ccb = NULL; @@ -108,7 +122,6 @@ mmc_cam_sim_default_action(struct cam_sim *sim, union ccb *ccb) } break; case XPT_GET_TRAN_SETTINGS: - case XPT_MMC_GET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts; @@ -125,6 +138,15 @@ mmc_cam_sim_default_action(struct cam_sim *sim, union ccb *ccb) } break; } + case XPT_MMC_GET_TRAN_SETTINGS: + { + ccb->ccb_h.status = CAM_SIM_QUEUED; + mmc_sim->ccb = ccb; + taskqueue_enqueue(taskqueue_thread, &mmc_sim->sim_task); + return; + /* NOTREACHED */ + break; + } case XPT_SET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202106191715.15JHFhiI027018>