@@ -329,6 +329,17 @@ static int scsi_req_length(SCSIRequest *req, uint8_t *cmd)
case PERSISTENT_RESERVE_IN:
req->cmd.xfer = cmd[8] | (cmd[7] << 8);
break;
+ case MAINTENANCE_OUT:
+ case MAINTENANCE_IN:
+ if (req->dev->type != TYPE_ROM) {
+ /* Used for MI_REPORT_TARGET_PGS, MO_SET_TARGET_PGS et al. */
+ req->cmd.xfer = cmd[9] | (cmd[8] << 8) |
+ (cmd[7] << 16) | (cmd[6] << 24);
+ } else {
+ /* GPCMD_REPORT_KEY and GPCMD_SEND_KEY from multi media commands */
+ req->cmd.xfer = cmd[9] | (cmd[8] << 8);
+ }
+ break;
}
Do you have a problem with leaving this reassignment in for TYPE_ROM..?