X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fatapi.h;h=acc90ffe2c6853025bdbc9e864f9d1597b1a5a84;hp=3407101c780264d2813abbe0799cfc660e82576c;hb=6661dd1d2aa547ae248e816dcd4201bcbcb7fee0;hpb=4659d019e2f65b9397e2289a9add28a3adf47cf8 diff --git a/palacios/src/devices/atapi.h b/palacios/src/devices/atapi.h index 3407101..acc90ff 100644 --- a/palacios/src/devices/atapi.h +++ b/palacios/src/devices/atapi.h @@ -128,10 +128,10 @@ static void atapi_cmd_nop(struct vm_device * dev, struct ide_channel * channel) static int atapi_read_chunk(struct vm_device * dev, struct ide_channel * channel) { struct ide_drive * drive = get_selected_drive(channel); - int ret = drive->cd_ops->read(drive->data_buf, ATAPI_BLOCK_SIZE, drive->cd_state.current_lba, drive->private_data); - + int ret = drive->cd_ops->read(drive->data_buf, 1, drive->current_lba, drive->private_data); + if (ret == -1) { - PrintError("IDE: Error reading CD block (LBA=%x)\n", drive->cd_state.current_lba); + PrintError("IDE: Error reading CD block (LBA=%p)\n", (void *)(addr_t)(drive->current_lba)); return -1; } @@ -147,7 +147,7 @@ static int atapi_update_data_buf(struct vm_device * dev, struct ide_channel * ch case 0xa8: // read(12) // Update lba address to point to next block - drive->cd_state.current_lba++; + drive->current_lba++; // read the next block return atapi_read_chunk(dev, channel); @@ -188,7 +188,7 @@ static int atapi_read10(struct vm_device * dev, struct ide_channel * channel) { // PrintDebug("Reading %d blocks from LBA 0x%x\n", xfer_len, lba); - drive->cd_state.current_lba = lba; + drive->current_lba = lba; // Update the request length value in the cylinder registers