Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
HardenedBSD
HardenedBSD
Commits
3386347f
Commit
3386347f
authored
Jun 17, 2021
by
Emmanuel Vadot
Browse files
mmc_sim: Make XPT_MMC_GET_TRAN_SETTINGS fully async
Sponsored by: Diablotin Systems
parent
6506efea
Changes
1
Hide whitespace changes
Inline
Side-by-side
sys/cam/mmc/mmc_sim.c
View file @
3386347f
...
...
@@ -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
;
...
...
HardenedBSD Services
@hardenedbsd-services
mentioned in commit
e1891351
·
Jul 22, 2021
mentioned in commit
e1891351
mentioned in commit e1891351cf10232871f95569156400d376fe8422
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment