diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2009-09-12 19:35:04 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2009-09-12 19:35:04 -0400 |
commit | 36c93a5e97931eedab98350d12d8a5ee7d8872bb (patch) | |
tree | 6f41287867be60097d4e7efc42ca42b41a7bbfdc /src/ata.c | |
parent | 51fd0a17153a8c94c97f9a80afd6e238fb542e3b (diff) | |
download | seabios-hppa-36c93a5e97931eedab98350d12d8a5ee7d8872bb.zip seabios-hppa-36c93a5e97931eedab98350d12d8a5ee7d8872bb.tar.gz seabios-hppa-36c93a5e97931eedab98350d12d8a5ee7d8872bb.tar.bz2 |
Unify cd emulation access and main disk access code.
Add a new backend driver for cd emulation (DTYPE_CDEMU). This backend
driver now does the work of scheduling mis-sized reads.
Add mechanism for obtaining emulated drive geometry.
Extend disk_1308() to support cdrom emulation.
Use regular disk_13*() calls even for cdemu.
Also, unify the X_SECTOR_SIZE definitions.
Diffstat (limited to 'src/ata.c')
-rw-r--r-- | src/ata.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -18,9 +18,6 @@ #include "disk.h" // struct ata_s #include "ata.h" // ATA_CB_STAT -#define IDE_SECTOR_SIZE 512 -#define CDROM_SECTOR_SIZE 2048 - #define IDE_TIMEOUT 32000 //32 seconds max for IDE ops struct ata_channel_s ATA_channels[CONFIG_MAX_ATA_INTERFACES] VAR16VISIBLE; @@ -352,7 +349,7 @@ ata_cmd_data(struct disk_op_s *op, int iswrite, int command) int ret = send_cmd(op->driveid, &cmd); if (ret) return ret; - return ata_transfer(op, iswrite, IDE_SECTOR_SIZE); + return ata_transfer(op, iswrite, DISK_SECTOR_SIZE); } int @@ -547,7 +544,7 @@ static int init_drive_atapi(int driveid, u16 *buffer) { // Send an IDENTIFY_DEVICE_PACKET command to device - memset(buffer, 0, IDE_SECTOR_SIZE); + memset(buffer, 0, DISK_SECTOR_SIZE); struct disk_op_s dop; memset(&dop, 0, sizeof(dop)); dop.driveid = driveid; @@ -594,7 +591,7 @@ static int init_drive_ata(int driveid, u16 *buffer) { // Send an IDENTIFY_DEVICE command to device - memset(buffer, 0, IDE_SECTOR_SIZE); + memset(buffer, 0, DISK_SECTOR_SIZE); struct disk_op_s dop; memset(&dop, 0, sizeof(dop)); dop.driveid = driveid; @@ -608,7 +605,7 @@ init_drive_ata(int driveid, u16 *buffer) // Success - setup as ATA. extract_identify(driveid, buffer); SET_GLOBAL(Drives.drives[driveid].type, DTYPE_ATA); - SET_GLOBAL(Drives.drives[driveid].blksize, IDE_SECTOR_SIZE); + SET_GLOBAL(Drives.drives[driveid].blksize, DISK_SECTOR_SIZE); SET_GLOBAL(Drives.drives[driveid].pchs.cylinders, buffer[1]); SET_GLOBAL(Drives.drives[driveid].pchs.heads, buffer[3]); |