mmc_sim: Make XPT_MMC_GET_TRAN_SETTINGS fully async
Sponsored by: Diablotin Systems
This commit is contained in:
parent
6506efea63
commit
3386347f65
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user