X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fatapi.h;h=27bed29013c38b629e9376f839022c63013fac07;hb=bb96a58c91406a06af87c21d76d1f08872667ea5;hp=78e0751255fff2d924e877bfa269465579aafd97;hpb=7b22bd6ad6a5bb413fd38e9ed7df668e34c052bb;p=palacios.git diff --git a/palacios/src/devices/atapi.h b/palacios/src/devices/atapi.h index 78e0751..27bed29 100644 --- a/palacios/src/devices/atapi.h +++ b/palacios/src/devices/atapi.h @@ -436,6 +436,19 @@ static int atapi_inquiry(struct vm_device * dev, struct ide_channel * channel) { } +static int atapi_cmd_is_data_op(uint8_t cmd) { + switch (cmd) { + case 0x28: // read (10) + case 0xa8: // read (12) + case 0x2a: // write (10) + case 0xaa: // write (12) + return 1; + default: + return 0; + } +} + + static int atapi_handle_packet(struct vm_device * dev, struct ide_channel * channel) { struct ide_drive * drive = get_selected_drive(channel); uint8_t cmd = drive->data_buf[0]; @@ -456,6 +469,10 @@ static int atapi_handle_packet(struct vm_device * dev, struct ide_channel * chan atapi_req_sense(dev, channel); break; + case 0x1e: // lock door + atapi_cmd_nop(dev, channel); + break; + case 0x28: // read(10) if (atapi_read10(dev, channel) == -1) { PrintError("IDE: Error in ATAPI read (%x)\n", cmd); @@ -518,7 +535,7 @@ static int atapi_handle_packet(struct vm_device * dev, struct ide_channel * chan case 0x2b: // seek - case 0x1e: // lock door + case 0x42: // read sub-channel