diff options
author | Andy Grover <agrover@redhat.com> | 2015-05-19 17:44:38 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-05-30 22:57:33 -0400 |
commit | cf87edc6022d1fe7efa6b8ce1a99f2ef6a1b27f9 (patch) | |
tree | f2993803793d54c8c0e3548f48fd157e95777ee3 /Documentation | |
parent | 5a7125c64def3b21f8147eca8b54949a60963942 (diff) |
target/user: Update example code for new ABI requirements
We now require that the userspace handler set a bit if the command is not
handled.
Update calls to tcmu_hdr_get_op for v2.
Signed-off-by: Andy Grover <agrover@redhat.com>
Reviewed-by: Ilias Tsitsimpis <iliastsi@arrikto.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/target/tcmu-design.txt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Documentation/target/tcmu-design.txt b/Documentation/target/tcmu-design.txt index c80bf1ed8981..b495108c433c 100644 --- a/Documentation/target/tcmu-design.txt +++ b/Documentation/target/tcmu-design.txt | |||
@@ -324,7 +324,7 @@ int handle_device_events(int fd, void *map) | |||
324 | /* Process events from cmd ring until we catch up with cmd_head */ | 324 | /* Process events from cmd ring until we catch up with cmd_head */ |
325 | while (ent != (void *)mb + mb->cmdr_off + mb->cmd_head) { | 325 | while (ent != (void *)mb + mb->cmdr_off + mb->cmd_head) { |
326 | 326 | ||
327 | if (tcmu_hdr_get_op(&ent->hdr) == TCMU_OP_CMD) { | 327 | if (tcmu_hdr_get_op(ent->hdr.len_op) == TCMU_OP_CMD) { |
328 | uint8_t *cdb = (void *)mb + ent->req.cdb_off; | 328 | uint8_t *cdb = (void *)mb + ent->req.cdb_off; |
329 | bool success = true; | 329 | bool success = true; |
330 | 330 | ||
@@ -339,8 +339,12 @@ int handle_device_events(int fd, void *map) | |||
339 | ent->rsp.scsi_status = SCSI_CHECK_CONDITION; | 339 | ent->rsp.scsi_status = SCSI_CHECK_CONDITION; |
340 | } | 340 | } |
341 | } | 341 | } |
342 | else if (tcmu_hdr_get_op(ent->hdr.len_op) != TCMU_OP_PAD) { | ||
343 | /* Tell the kernel we didn't handle unknown opcodes */ | ||
344 | ent->hdr.uflags |= TCMU_UFLAG_UNKNOWN_OP; | ||
345 | } | ||
342 | else { | 346 | else { |
343 | /* Do nothing for PAD entries */ | 347 | /* Do nothing for PAD entries except update cmd_tail */ |
344 | } | 348 | } |
345 | 349 | ||
346 | /* update cmd_tail */ | 350 | /* update cmd_tail */ |