X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fatapi.h;h=ec613d7f5627fea0db304e6af368b4e8f8bfcd8d;hb=7ddf7f8c9b007c3405146e001d9f3689723f7d4d;hp=acc90ffe2c6853025bdbc9e864f9d1597b1a5a84;hpb=6661dd1d2aa547ae248e816dcd4201bcbcb7fee0;p=palacios.git diff --git a/palacios/src/devices/atapi.h b/palacios/src/devices/atapi.h index acc90ff..ec613d7 100644 --- a/palacios/src/devices/atapi.h +++ b/palacios/src/devices/atapi.h @@ -191,15 +191,25 @@ static int atapi_read10(struct vm_device * dev, struct ide_channel * channel) { drive->current_lba = lba; // Update the request length value in the cylinder registers - + drive->transfer_length = xfer_len * ATAPI_BLOCK_SIZE; + drive->transfer_index = 0; + + if (channel->features.dma) { + + if (channel->dma_status.active == 1) { + if (dma_read(dev, channel) == -1) { + PrintError("Error in DMA read for CD Read10 command\n"); + return -1; + } + } + return 0; + } + if (atapi_read_chunk(dev, channel) == -1) { PrintError("IDE: Could not read initial chunk from CD\n"); return -1; } - drive->transfer_length = xfer_len * ATAPI_BLOCK_SIZE; - drive->transfer_index = 0; - // Length of ATAPI buffer sits in cylinder registers // This is weird... The host sets this value to say what it would like to transfer, // if it is larger than the correct size, the device shrinks it to the correct size