block: Rename disk_op_s->drive_gf to drive_fl
Now that the drive_s struct does not need to be in the f-segment, rename references to drive_gf in the generic drive code to drive_fl. This is just variable renames - no code changes. Tested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
04db972290
commit
e5a0b61637
36
src/block.c
36
src/block.c
|
@ -298,7 +298,7 @@ map_floppy_drive(struct drive_s *drive)
|
|||
|
||||
// Fill in EDD info
|
||||
static int
|
||||
fill_generic_edd(struct segoff_s edd, struct drive_s *drive_gf
|
||||
fill_generic_edd(struct segoff_s edd, struct drive_s *drive_fl
|
||||
, u32 dpte_so, u8 bus_iface, u32 iface_path, u32 device_path)
|
||||
{
|
||||
u16 seg = edd.seg;
|
||||
|
@ -312,12 +312,12 @@ fill_generic_edd(struct segoff_s edd, struct drive_s *drive_gf
|
|||
|
||||
// EDD 1.x
|
||||
|
||||
u8 type = GET_FLATPTR(drive_gf->type);
|
||||
u16 npc = GET_FLATPTR(drive_gf->pchs.cylinder);
|
||||
u16 nph = GET_FLATPTR(drive_gf->pchs.head);
|
||||
u16 nps = GET_FLATPTR(drive_gf->pchs.sector);
|
||||
u64 lba = GET_FLATPTR(drive_gf->sectors);
|
||||
u16 blksize = GET_FLATPTR(drive_gf->blksize);
|
||||
u8 type = GET_FLATPTR(drive_fl->type);
|
||||
u16 npc = GET_FLATPTR(drive_fl->pchs.cylinder);
|
||||
u16 nph = GET_FLATPTR(drive_fl->pchs.head);
|
||||
u16 nps = GET_FLATPTR(drive_fl->pchs.sector);
|
||||
u64 lba = GET_FLATPTR(drive_fl->sectors);
|
||||
u16 blksize = GET_FLATPTR(drive_fl->blksize);
|
||||
|
||||
dprintf(DEBUG_HDL_13, "disk_1348 size=%d t=%d chs=%d,%d,%d lba=%d bs=%d\n"
|
||||
, size, type, npc, nph, nps, (u32)lba, blksize);
|
||||
|
@ -467,19 +467,19 @@ fill_ata_edd(struct segoff_s edd, struct drive_s *drive_gf)
|
|||
|
||||
// Fill Extended Disk Drive (EDD) "Get drive parameters" info for a drive
|
||||
int noinline
|
||||
fill_edd(struct segoff_s edd, struct drive_s *drive_gf)
|
||||
fill_edd(struct segoff_s edd, struct drive_s *drive_fl)
|
||||
{
|
||||
switch (GET_FLATPTR(drive_gf->type)) {
|
||||
switch (GET_FLATPTR(drive_fl->type)) {
|
||||
case DTYPE_ATA:
|
||||
case DTYPE_ATA_ATAPI:
|
||||
return fill_ata_edd(edd, drive_gf);
|
||||
return fill_ata_edd(edd, drive_fl);
|
||||
case DTYPE_VIRTIO_BLK:
|
||||
case DTYPE_VIRTIO_SCSI:
|
||||
return fill_generic_edd(
|
||||
edd, drive_gf, 0xffffffff, EDD_PCI | EDD_SCSI
|
||||
, edd_pci_path(GET_FLATPTR(drive_gf->cntl_id), 0), 0);
|
||||
edd, drive_fl, 0xffffffff, EDD_PCI | EDD_SCSI
|
||||
, edd_pci_path(GET_FLATPTR(drive_fl->cntl_id), 0), 0);
|
||||
default:
|
||||
return fill_generic_edd(edd, drive_gf, 0, 0, 0, 0);
|
||||
return fill_generic_edd(edd, drive_fl, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -527,7 +527,7 @@ default_process_op(struct disk_op_s *op)
|
|||
static int
|
||||
process_op_both(struct disk_op_s *op)
|
||||
{
|
||||
switch (GET_FLATPTR(op->drive_gf->type)) {
|
||||
switch (GET_FLATPTR(op->drive_fl->type)) {
|
||||
case DTYPE_ATA_ATAPI:
|
||||
return ata_atapi_process_op(op);
|
||||
case DTYPE_USB:
|
||||
|
@ -556,7 +556,7 @@ int VISIBLE32FLAT
|
|||
process_op_32(struct disk_op_s *op)
|
||||
{
|
||||
ASSERT32FLAT();
|
||||
switch (op->drive_gf->type) {
|
||||
switch (op->drive_fl->type) {
|
||||
case DTYPE_VIRTIO_BLK:
|
||||
return virtio_blk_process_op(op);
|
||||
case DTYPE_AHCI:
|
||||
|
@ -585,7 +585,7 @@ static int
|
|||
process_op_16(struct disk_op_s *op)
|
||||
{
|
||||
ASSERT16();
|
||||
switch (GET_FLATPTR(op->drive_gf->type)) {
|
||||
switch (GET_FLATPTR(op->drive_fl->type)) {
|
||||
case DTYPE_FLOPPY:
|
||||
return floppy_process_op(op);
|
||||
case DTYPE_ATA:
|
||||
|
@ -604,11 +604,11 @@ int
|
|||
process_op(struct disk_op_s *op)
|
||||
{
|
||||
dprintf(DEBUG_HDL_13, "disk_op d=%p lba=%d buf=%p count=%d cmd=%d\n"
|
||||
, op->drive_gf, (u32)op->lba, op->buf_fl
|
||||
, op->drive_fl, (u32)op->lba, op->buf_fl
|
||||
, op->count, op->command);
|
||||
|
||||
int ret, origcount = op->count;
|
||||
if (origcount * GET_FLATPTR(op->drive_gf->blksize) > 64*1024) {
|
||||
if (origcount * GET_FLATPTR(op->drive_fl->blksize) > 64*1024) {
|
||||
op->count = 0;
|
||||
return DISK_RET_EBOUNDARY;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
struct disk_op_s {
|
||||
void *buf_fl;
|
||||
struct drive_s *drive_gf;
|
||||
struct drive_s *drive_fl;
|
||||
u8 command;
|
||||
u16 count;
|
||||
union {
|
||||
|
@ -112,7 +112,7 @@ void map_floppy_drive(struct drive_s *drive);
|
|||
void map_hd_drive(struct drive_s *drive);
|
||||
void map_cd_drive(struct drive_s *drive);
|
||||
struct int13dpt_s;
|
||||
int fill_edd(struct segoff_s edd, struct drive_s *drive_gf);
|
||||
int fill_edd(struct segoff_s edd, struct drive_s *drive_fl);
|
||||
void block_setup(void);
|
||||
int default_process_op(struct disk_op_s *op);
|
||||
int process_op(struct disk_op_s *op);
|
||||
|
|
|
@ -31,7 +31,7 @@ cdemu_read(struct disk_op_s *op)
|
|||
{
|
||||
struct drive_s *drive_gf = GET_LOW(emulated_drive_gf);
|
||||
struct disk_op_s dop;
|
||||
dop.drive_gf = drive_gf;
|
||||
dop.drive_fl = drive_gf;
|
||||
dop.command = op->command;
|
||||
dop.lba = GET_LOW(CDEmu.ilba) + op->lba / 4;
|
||||
|
||||
|
@ -136,8 +136,8 @@ cdrom_boot(struct drive_s *drive)
|
|||
struct disk_op_s dop;
|
||||
int cdid = getDriveId(EXTTYPE_CD, drive);
|
||||
memset(&dop, 0, sizeof(dop));
|
||||
dop.drive_gf = drive;
|
||||
if (!dop.drive_gf || cdid < 0)
|
||||
dop.drive_fl = drive;
|
||||
if (!dop.drive_fl || cdid < 0)
|
||||
return 1;
|
||||
|
||||
int ret = scsi_is_ready(&dop);
|
||||
|
|
218
src/disk.c
218
src/disk.c
|
@ -67,10 +67,10 @@ __disk_stub(struct bregs *regs, int lineno, const char *fname)
|
|||
|
||||
// Get the cylinders/heads/sectors for the given drive.
|
||||
static struct chs_s
|
||||
getLCHS(struct drive_s *drive_gf)
|
||||
getLCHS(struct drive_s *drive_fl)
|
||||
{
|
||||
struct chs_s res = { };
|
||||
if (CONFIG_CDROM_EMU && drive_gf == GET_GLOBAL(cdemu_drive_gf)) {
|
||||
if (CONFIG_CDROM_EMU && drive_fl == GET_GLOBAL(cdemu_drive_gf)) {
|
||||
// Emulated drive - get info from CDEmu. (It's not possible to
|
||||
// populate the geometry directly in the driveid because the
|
||||
// geometry is only known after the bios segment is made
|
||||
|
@ -81,9 +81,9 @@ getLCHS(struct drive_s *drive_gf)
|
|||
res.sector = sptcyl & 0x3f;
|
||||
return res;
|
||||
}
|
||||
res.cylinder = GET_FLATPTR(drive_gf->lchs.cylinder);
|
||||
res.head = GET_FLATPTR(drive_gf->lchs.head);
|
||||
res.sector = GET_FLATPTR(drive_gf->lchs.sector);
|
||||
res.cylinder = GET_FLATPTR(drive_fl->lchs.cylinder);
|
||||
res.head = GET_FLATPTR(drive_fl->lchs.head);
|
||||
res.sector = GET_FLATPTR(drive_fl->lchs.sector);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -117,10 +117,10 @@ send_disk_op(struct disk_op_s *op)
|
|||
|
||||
// Perform read/write/verify using old-style chs accesses
|
||||
static void noinline
|
||||
basic_access(struct bregs *regs, struct drive_s *drive_gf, u16 command)
|
||||
basic_access(struct bregs *regs, struct drive_s *drive_fl, u16 command)
|
||||
{
|
||||
struct disk_op_s dop;
|
||||
dop.drive_gf = drive_gf;
|
||||
dop.drive_fl = drive_fl;
|
||||
dop.command = command;
|
||||
|
||||
u8 count = regs->al;
|
||||
|
@ -135,7 +135,7 @@ basic_access(struct bregs *regs, struct drive_s *drive_gf, u16 command)
|
|||
}
|
||||
dop.count = count;
|
||||
|
||||
struct chs_s chs = getLCHS(drive_gf);
|
||||
struct chs_s chs = getLCHS(drive_fl);
|
||||
u16 nlc=chs.cylinder, nlh=chs.head, nls=chs.sector;
|
||||
|
||||
// sanity check on cyl heads, sec
|
||||
|
@ -160,15 +160,15 @@ basic_access(struct bregs *regs, struct drive_s *drive_gf, u16 command)
|
|||
|
||||
// Perform read/write/verify using new-style "int13ext" accesses.
|
||||
static void noinline
|
||||
extended_access(struct bregs *regs, struct drive_s *drive_gf, u16 command)
|
||||
extended_access(struct bregs *regs, struct drive_s *drive_fl, u16 command)
|
||||
{
|
||||
struct disk_op_s dop;
|
||||
struct int13ext_s *param_far = (struct int13ext_s*)(regs->si+0);
|
||||
// Get lba and check.
|
||||
dop.lba = GET_FARVAR(regs->ds, param_far->lba);
|
||||
dop.command = command;
|
||||
dop.drive_gf = drive_gf;
|
||||
if (dop.lba >= GET_FLATPTR(drive_gf->sectors)) {
|
||||
dop.drive_fl = drive_fl;
|
||||
if (dop.lba >= GET_FLATPTR(drive_fl->sectors)) {
|
||||
warn_invalid(regs);
|
||||
disk_ret(regs, DISK_RET_EPARAM);
|
||||
return;
|
||||
|
@ -196,10 +196,10 @@ extended_access(struct bregs *regs, struct drive_s *drive_gf, u16 command)
|
|||
|
||||
// disk controller reset
|
||||
static void
|
||||
disk_1300(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1300(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
struct disk_op_s dop;
|
||||
dop.drive_gf = drive_gf;
|
||||
dop.drive_fl = drive_fl;
|
||||
dop.command = CMD_RESET;
|
||||
dop.count = 0;
|
||||
int status = send_disk_op(&dop);
|
||||
|
@ -208,7 +208,7 @@ disk_1300(struct bregs *regs, struct drive_s *drive_gf)
|
|||
|
||||
// read disk status
|
||||
static void
|
||||
disk_1301(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1301(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
u8 v;
|
||||
if (regs->dl < EXTSTART_HD)
|
||||
|
@ -223,32 +223,32 @@ disk_1301(struct bregs *regs, struct drive_s *drive_gf)
|
|||
|
||||
// read disk sectors
|
||||
static void
|
||||
disk_1302(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1302(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
basic_access(regs, drive_gf, CMD_READ);
|
||||
basic_access(regs, drive_fl, CMD_READ);
|
||||
}
|
||||
|
||||
// write disk sectors
|
||||
static void
|
||||
disk_1303(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1303(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
basic_access(regs, drive_gf, CMD_WRITE);
|
||||
basic_access(regs, drive_fl, CMD_WRITE);
|
||||
}
|
||||
|
||||
// verify disk sectors
|
||||
static void
|
||||
disk_1304(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1304(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
basic_access(regs, drive_gf, CMD_VERIFY);
|
||||
basic_access(regs, drive_fl, CMD_VERIFY);
|
||||
}
|
||||
|
||||
// format disk track
|
||||
static void noinline
|
||||
disk_1305(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1305(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
debug_stub(regs);
|
||||
|
||||
struct chs_s chs = getLCHS(drive_gf);
|
||||
struct chs_s chs = getLCHS(drive_fl);
|
||||
u16 nlc=chs.cylinder, nlh=chs.head, nls=chs.sector;
|
||||
|
||||
u8 count = regs->al;
|
||||
|
@ -261,7 +261,7 @@ disk_1305(struct bregs *regs, struct drive_s *drive_gf)
|
|||
}
|
||||
|
||||
struct disk_op_s dop;
|
||||
dop.drive_gf = drive_gf;
|
||||
dop.drive_fl = drive_fl;
|
||||
dop.command = CMD_FORMAT;
|
||||
dop.lba = (((u32)cylinder * (u32)nlh) + (u32)head) * (u32)nls;
|
||||
dop.count = count;
|
||||
|
@ -272,10 +272,10 @@ disk_1305(struct bregs *regs, struct drive_s *drive_gf)
|
|||
|
||||
// read disk drive parameters
|
||||
static void noinline
|
||||
disk_1308(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1308(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
// Get logical geometry from table
|
||||
struct chs_s chs = getLCHS(drive_gf);
|
||||
struct chs_s chs = getLCHS(drive_fl);
|
||||
u16 nlc=chs.cylinder, nlh=chs.head, nls=chs.sector;
|
||||
nlc--;
|
||||
nlh--;
|
||||
|
@ -284,10 +284,10 @@ disk_1308(struct bregs *regs, struct drive_s *drive_gf)
|
|||
// Floppy
|
||||
count = GET_GLOBAL(FloppyCount);
|
||||
|
||||
if (CONFIG_CDROM_EMU && drive_gf == GET_GLOBAL(cdemu_drive_gf))
|
||||
if (CONFIG_CDROM_EMU && drive_fl == GET_GLOBAL(cdemu_drive_gf))
|
||||
regs->bx = GET_LOW(CDEmu.media) * 2;
|
||||
else
|
||||
regs->bx = GET_FLATPTR(drive_gf->floppy_type);
|
||||
regs->bx = GET_FLATPTR(drive_fl->floppy_type);
|
||||
|
||||
// set es & di to point to 11 byte diskette param table in ROM
|
||||
regs->es = SEG_BIOS;
|
||||
|
@ -323,33 +323,33 @@ disk_1308(struct bregs *regs, struct drive_s *drive_gf)
|
|||
|
||||
// initialize drive parameters
|
||||
static void
|
||||
disk_1309(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1309(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
DISK_STUB(regs);
|
||||
}
|
||||
|
||||
// seek to specified cylinder
|
||||
static void
|
||||
disk_130c(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_130c(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
DISK_STUB(regs);
|
||||
}
|
||||
|
||||
// alternate disk reset
|
||||
static void
|
||||
disk_130d(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_130d(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
DISK_STUB(regs);
|
||||
}
|
||||
|
||||
// check drive ready
|
||||
static void
|
||||
disk_1310(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1310(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
// should look at 40:8E also???
|
||||
|
||||
struct disk_op_s dop;
|
||||
dop.drive_gf = drive_gf;
|
||||
dop.drive_fl = drive_fl;
|
||||
dop.command = CMD_ISREADY;
|
||||
dop.count = 0;
|
||||
int status = send_disk_op(&dop);
|
||||
|
@ -358,21 +358,21 @@ disk_1310(struct bregs *regs, struct drive_s *drive_gf)
|
|||
|
||||
// recalibrate
|
||||
static void
|
||||
disk_1311(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1311(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
DISK_STUB(regs);
|
||||
}
|
||||
|
||||
// controller internal diagnostic
|
||||
static void
|
||||
disk_1314(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1314(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
DISK_STUB(regs);
|
||||
}
|
||||
|
||||
// read disk drive size
|
||||
static void noinline
|
||||
disk_1315(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1315(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
disk_ret(regs, DISK_RET_SUCCESS);
|
||||
if (regs->dl < EXTSTART_HD || regs->dl >= EXTSTART_CD) {
|
||||
|
@ -383,7 +383,7 @@ disk_1315(struct bregs *regs, struct drive_s *drive_gf)
|
|||
// Hard drive
|
||||
|
||||
// Get logical geometry from table
|
||||
struct chs_s chs = getLCHS(drive_gf);
|
||||
struct chs_s chs = getLCHS(drive_fl);
|
||||
u16 nlc=chs.cylinder, nlh=chs.head, nls=chs.sector;
|
||||
|
||||
// Compute sector count seen by int13
|
||||
|
@ -394,7 +394,7 @@ disk_1315(struct bregs *regs, struct drive_s *drive_gf)
|
|||
}
|
||||
|
||||
static void
|
||||
disk_1316(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1316(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
if (regs->dl >= EXTSTART_HD) {
|
||||
// Hard drive
|
||||
|
@ -406,7 +406,7 @@ disk_1316(struct bregs *regs, struct drive_s *drive_gf)
|
|||
|
||||
// IBM/MS installation check
|
||||
static void
|
||||
disk_1341(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1341(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
regs->bx = 0xaa55; // install check
|
||||
regs->cx = 0x0007; // ext disk access and edd, removable supported
|
||||
|
@ -416,23 +416,23 @@ disk_1341(struct bregs *regs, struct drive_s *drive_gf)
|
|||
|
||||
// IBM/MS extended read
|
||||
static void
|
||||
disk_1342(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1342(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
extended_access(regs, drive_gf, CMD_READ);
|
||||
extended_access(regs, drive_fl, CMD_READ);
|
||||
}
|
||||
|
||||
// IBM/MS extended write
|
||||
static void
|
||||
disk_1343(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1343(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
extended_access(regs, drive_gf, CMD_WRITE);
|
||||
extended_access(regs, drive_fl, CMD_WRITE);
|
||||
}
|
||||
|
||||
// IBM/MS verify
|
||||
static void
|
||||
disk_1344(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1344(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
extended_access(regs, drive_gf, CMD_VERIFY);
|
||||
extended_access(regs, drive_fl, CMD_VERIFY);
|
||||
}
|
||||
|
||||
// Locks for removable devices
|
||||
|
@ -440,7 +440,7 @@ u8 CDRom_locks[BUILD_MAX_EXTDRIVE] VARLOW;
|
|||
|
||||
// lock
|
||||
static void
|
||||
disk_134500(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_134500(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
int cdid = regs->dl - EXTSTART_CD;
|
||||
u8 locks = GET_LOW(CDRom_locks[cdid]);
|
||||
|
@ -456,7 +456,7 @@ disk_134500(struct bregs *regs, struct drive_s *drive_gf)
|
|||
|
||||
// unlock
|
||||
static void
|
||||
disk_134501(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_134501(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
int cdid = regs->dl - EXTSTART_CD;
|
||||
u8 locks = GET_LOW(CDRom_locks[cdid]);
|
||||
|
@ -473,7 +473,7 @@ disk_134501(struct bregs *regs, struct drive_s *drive_gf)
|
|||
|
||||
// status
|
||||
static void
|
||||
disk_134502(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_134502(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
int cdid = regs->dl - EXTSTART_CD;
|
||||
u8 locks = GET_LOW(CDRom_locks[cdid]);
|
||||
|
@ -482,14 +482,14 @@ disk_134502(struct bregs *regs, struct drive_s *drive_gf)
|
|||
}
|
||||
|
||||
static void
|
||||
disk_1345XX(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1345XX(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
disk_ret_unimplemented(regs, DISK_RET_EPARAM);
|
||||
}
|
||||
|
||||
// IBM/MS lock/unlock drive
|
||||
static void
|
||||
disk_1345(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1345(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
if (regs->dl < EXTSTART_CD) {
|
||||
// Always success for HD
|
||||
|
@ -498,16 +498,16 @@ disk_1345(struct bregs *regs, struct drive_s *drive_gf)
|
|||
}
|
||||
|
||||
switch (regs->al) {
|
||||
case 0x00: disk_134500(regs, drive_gf); break;
|
||||
case 0x01: disk_134501(regs, drive_gf); break;
|
||||
case 0x02: disk_134502(regs, drive_gf); break;
|
||||
default: disk_1345XX(regs, drive_gf); break;
|
||||
case 0x00: disk_134500(regs, drive_fl); break;
|
||||
case 0x01: disk_134501(regs, drive_fl); break;
|
||||
case 0x02: disk_134502(regs, drive_fl); break;
|
||||
default: disk_1345XX(regs, drive_fl); break;
|
||||
}
|
||||
}
|
||||
|
||||
// IBM/MS eject media
|
||||
static void noinline
|
||||
disk_1346(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1346(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
if (regs->dl < EXTSTART_CD) {
|
||||
// Volume Not Removable
|
||||
|
@ -541,22 +541,22 @@ disk_1346(struct bregs *regs, struct drive_s *drive_gf)
|
|||
|
||||
// IBM/MS extended seek
|
||||
static void
|
||||
disk_1347(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1347(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
extended_access(regs, drive_gf, CMD_SEEK);
|
||||
extended_access(regs, drive_fl, CMD_SEEK);
|
||||
}
|
||||
|
||||
// IBM/MS get drive parameters
|
||||
static void
|
||||
disk_1348(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1348(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
int ret = fill_edd(SEGOFF(regs->ds, regs->si), drive_gf);
|
||||
int ret = fill_edd(SEGOFF(regs->ds, regs->si), drive_fl);
|
||||
disk_ret(regs, ret);
|
||||
}
|
||||
|
||||
// IBM/MS extended media change
|
||||
static void
|
||||
disk_1349(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_1349(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
if (regs->dl < EXTSTART_CD) {
|
||||
// Always success for HD
|
||||
|
@ -569,56 +569,56 @@ disk_1349(struct bregs *regs, struct drive_s *drive_gf)
|
|||
}
|
||||
|
||||
static void
|
||||
disk_134e01(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_134e01(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
disk_ret(regs, DISK_RET_SUCCESS);
|
||||
}
|
||||
|
||||
static void
|
||||
disk_134e03(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_134e03(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
disk_ret(regs, DISK_RET_SUCCESS);
|
||||
}
|
||||
|
||||
static void
|
||||
disk_134e04(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_134e04(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
disk_ret(regs, DISK_RET_SUCCESS);
|
||||
}
|
||||
|
||||
static void
|
||||
disk_134e06(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_134e06(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
disk_ret(regs, DISK_RET_SUCCESS);
|
||||
}
|
||||
|
||||
static void
|
||||
disk_134eXX(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_134eXX(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
disk_ret(regs, DISK_RET_EPARAM);
|
||||
}
|
||||
|
||||
// IBM/MS set hardware configuration
|
||||
static void
|
||||
disk_134e(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_134e(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
switch (regs->al) {
|
||||
case 0x01: disk_134e01(regs, drive_gf); break;
|
||||
case 0x03: disk_134e03(regs, drive_gf); break;
|
||||
case 0x04: disk_134e04(regs, drive_gf); break;
|
||||
case 0x06: disk_134e06(regs, drive_gf); break;
|
||||
default: disk_134eXX(regs, drive_gf); break;
|
||||
case 0x01: disk_134e01(regs, drive_fl); break;
|
||||
case 0x03: disk_134e03(regs, drive_fl); break;
|
||||
case 0x04: disk_134e04(regs, drive_fl); break;
|
||||
case 0x06: disk_134e06(regs, drive_fl); break;
|
||||
default: disk_134eXX(regs, drive_fl); break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
disk_13XX(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_13XX(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
disk_ret_unimplemented(regs, DISK_RET_EPARAM);
|
||||
}
|
||||
|
||||
static void
|
||||
disk_13(struct bregs *regs, struct drive_s *drive_gf)
|
||||
disk_13(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
//debug_stub(regs);
|
||||
|
||||
|
@ -626,37 +626,37 @@ disk_13(struct bregs *regs, struct drive_s *drive_gf)
|
|||
SET_BDA(disk_interrupt_flag, 0);
|
||||
|
||||
switch (regs->ah) {
|
||||
case 0x00: disk_1300(regs, drive_gf); break;
|
||||
case 0x01: disk_1301(regs, drive_gf); break;
|
||||
case 0x02: disk_1302(regs, drive_gf); break;
|
||||
case 0x03: disk_1303(regs, drive_gf); break;
|
||||
case 0x04: disk_1304(regs, drive_gf); break;
|
||||
case 0x05: disk_1305(regs, drive_gf); break;
|
||||
case 0x08: disk_1308(regs, drive_gf); break;
|
||||
case 0x09: disk_1309(regs, drive_gf); break;
|
||||
case 0x0c: disk_130c(regs, drive_gf); break;
|
||||
case 0x0d: disk_130d(regs, drive_gf); break;
|
||||
case 0x10: disk_1310(regs, drive_gf); break;
|
||||
case 0x11: disk_1311(regs, drive_gf); break;
|
||||
case 0x14: disk_1314(regs, drive_gf); break;
|
||||
case 0x15: disk_1315(regs, drive_gf); break;
|
||||
case 0x16: disk_1316(regs, drive_gf); break;
|
||||
case 0x41: disk_1341(regs, drive_gf); break;
|
||||
case 0x42: disk_1342(regs, drive_gf); break;
|
||||
case 0x43: disk_1343(regs, drive_gf); break;
|
||||
case 0x44: disk_1344(regs, drive_gf); break;
|
||||
case 0x45: disk_1345(regs, drive_gf); break;
|
||||
case 0x46: disk_1346(regs, drive_gf); break;
|
||||
case 0x47: disk_1347(regs, drive_gf); break;
|
||||
case 0x48: disk_1348(regs, drive_gf); break;
|
||||
case 0x49: disk_1349(regs, drive_gf); break;
|
||||
case 0x4e: disk_134e(regs, drive_gf); break;
|
||||
default: disk_13XX(regs, drive_gf); break;
|
||||
case 0x00: disk_1300(regs, drive_fl); break;
|
||||
case 0x01: disk_1301(regs, drive_fl); break;
|
||||
case 0x02: disk_1302(regs, drive_fl); break;
|
||||
case 0x03: disk_1303(regs, drive_fl); break;
|
||||
case 0x04: disk_1304(regs, drive_fl); break;
|
||||
case 0x05: disk_1305(regs, drive_fl); break;
|
||||
case 0x08: disk_1308(regs, drive_fl); break;
|
||||
case 0x09: disk_1309(regs, drive_fl); break;
|
||||
case 0x0c: disk_130c(regs, drive_fl); break;
|
||||
case 0x0d: disk_130d(regs, drive_fl); break;
|
||||
case 0x10: disk_1310(regs, drive_fl); break;
|
||||
case 0x11: disk_1311(regs, drive_fl); break;
|
||||
case 0x14: disk_1314(regs, drive_fl); break;
|
||||
case 0x15: disk_1315(regs, drive_fl); break;
|
||||
case 0x16: disk_1316(regs, drive_fl); break;
|
||||
case 0x41: disk_1341(regs, drive_fl); break;
|
||||
case 0x42: disk_1342(regs, drive_fl); break;
|
||||
case 0x43: disk_1343(regs, drive_fl); break;
|
||||
case 0x44: disk_1344(regs, drive_fl); break;
|
||||
case 0x45: disk_1345(regs, drive_fl); break;
|
||||
case 0x46: disk_1346(regs, drive_fl); break;
|
||||
case 0x47: disk_1347(regs, drive_fl); break;
|
||||
case 0x48: disk_1348(regs, drive_fl); break;
|
||||
case 0x49: disk_1349(regs, drive_fl); break;
|
||||
case 0x4e: disk_134e(regs, drive_fl); break;
|
||||
default: disk_13XX(regs, drive_fl); break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
floppy_13(struct bregs *regs, struct drive_s *drive_gf)
|
||||
floppy_13(struct bregs *regs, struct drive_s *drive_fl)
|
||||
{
|
||||
// Only limited commands are supported on floppies.
|
||||
switch (regs->ah) {
|
||||
|
@ -669,9 +669,9 @@ floppy_13(struct bregs *regs, struct drive_s *drive_gf)
|
|||
case 0x08:
|
||||
case 0x15:
|
||||
case 0x16:
|
||||
disk_13(regs, drive_gf);
|
||||
disk_13(regs, drive_fl);
|
||||
break;
|
||||
default: disk_13XX(regs, drive_gf); break;
|
||||
default: disk_13XX(regs, drive_fl); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -707,21 +707,21 @@ handle_legacy_disk(struct bregs *regs, u8 extdrive)
|
|||
}
|
||||
|
||||
if (extdrive < EXTSTART_HD) {
|
||||
struct drive_s *drive_gf = getDrive(EXTTYPE_FLOPPY, extdrive);
|
||||
if (!drive_gf)
|
||||
struct drive_s *drive_fl = getDrive(EXTTYPE_FLOPPY, extdrive);
|
||||
if (!drive_fl)
|
||||
goto fail;
|
||||
floppy_13(regs, drive_gf);
|
||||
floppy_13(regs, drive_fl);
|
||||
return;
|
||||
}
|
||||
|
||||
struct drive_s *drive_gf;
|
||||
struct drive_s *drive_fl;
|
||||
if (extdrive >= EXTSTART_CD)
|
||||
drive_gf = getDrive(EXTTYPE_CD, extdrive - EXTSTART_CD);
|
||||
drive_fl = getDrive(EXTTYPE_CD, extdrive - EXTSTART_CD);
|
||||
else
|
||||
drive_gf = getDrive(EXTTYPE_HD, extdrive - EXTSTART_HD);
|
||||
if (!drive_gf)
|
||||
drive_fl = getDrive(EXTTYPE_HD, extdrive - EXTSTART_HD);
|
||||
if (!drive_fl)
|
||||
goto fail;
|
||||
disk_13(regs, drive_gf);
|
||||
disk_13(regs, drive_fl);
|
||||
return;
|
||||
|
||||
fail:
|
||||
|
|
|
@ -217,7 +217,7 @@ int ahci_atapi_process_op(struct disk_op_s *op)
|
|||
return 0;
|
||||
|
||||
struct ahci_port_s *port_gf = container_of(
|
||||
op->drive_gf, struct ahci_port_s, drive);
|
||||
op->drive_fl, struct ahci_port_s, drive);
|
||||
struct ahci_cmd_s *cmd = port_gf->cmd;
|
||||
|
||||
if (op->command == CMD_WRITE || op->command == CMD_FORMAT)
|
||||
|
@ -237,7 +237,7 @@ static int
|
|||
ahci_disk_readwrite_aligned(struct disk_op_s *op, int iswrite)
|
||||
{
|
||||
struct ahci_port_s *port_gf = container_of(
|
||||
op->drive_gf, struct ahci_port_s, drive);
|
||||
op->drive_fl, struct ahci_port_s, drive);
|
||||
struct ahci_cmd_s *cmd = port_gf->cmd;
|
||||
int rc;
|
||||
|
||||
|
|
26
src/hw/ata.c
26
src/hw/ata.c
|
@ -271,15 +271,15 @@ fail:
|
|||
****************************************************************/
|
||||
|
||||
// Transfer 'op->count' blocks (of 'blocksize' bytes) to/from drive
|
||||
// 'op->drive_gf'.
|
||||
// 'op->drive_fl'.
|
||||
static int
|
||||
ata_pio_transfer(struct disk_op_s *op, int iswrite, int blocksize)
|
||||
{
|
||||
dprintf(16, "ata_pio_transfer id=%p write=%d count=%d bs=%d buf=%p\n"
|
||||
, op->drive_gf, iswrite, op->count, blocksize, op->buf_fl);
|
||||
, op->drive_fl, iswrite, op->count, blocksize, op->buf_fl);
|
||||
|
||||
struct atadrive_s *adrive_gf = container_of(
|
||||
op->drive_gf, struct atadrive_s, drive);
|
||||
op->drive_fl, struct atadrive_s, drive);
|
||||
struct ata_channel_s *chan_gf = GET_GLOBALFLAT(adrive_gf->chan_gf);
|
||||
u16 iobase1 = GET_GLOBALFLAT(chan_gf->iobase1);
|
||||
u16 iobase2 = GET_GLOBALFLAT(chan_gf->iobase2);
|
||||
|
@ -289,14 +289,14 @@ ata_pio_transfer(struct disk_op_s *op, int iswrite, int blocksize)
|
|||
for (;;) {
|
||||
if (iswrite) {
|
||||
// Write data to controller
|
||||
dprintf(16, "Write sector id=%p dest=%p\n", op->drive_gf, buf_fl);
|
||||
dprintf(16, "Write sector id=%p dest=%p\n", op->drive_fl, buf_fl);
|
||||
if (CONFIG_ATA_PIO32)
|
||||
outsl_fl(iobase1, buf_fl, blocksize / 4);
|
||||
else
|
||||
outsw_fl(iobase1, buf_fl, blocksize / 2);
|
||||
} else {
|
||||
// Read data from controller
|
||||
dprintf(16, "Read sector id=%p dest=%p\n", op->drive_gf, buf_fl);
|
||||
dprintf(16, "Read sector id=%p dest=%p\n", op->drive_fl, buf_fl);
|
||||
if (CONFIG_ATA_PIO32)
|
||||
insl_fl(iobase1, buf_fl, blocksize / 4);
|
||||
else
|
||||
|
@ -366,7 +366,7 @@ ata_try_dma(struct disk_op_s *op, int iswrite, int blocksize)
|
|||
// Need minimum alignment of 1.
|
||||
return -1;
|
||||
struct atadrive_s *adrive_gf = container_of(
|
||||
op->drive_gf, struct atadrive_s, drive);
|
||||
op->drive_fl, struct atadrive_s, drive);
|
||||
struct ata_channel_s *chan_gf = GET_GLOBALFLAT(adrive_gf->chan_gf);
|
||||
u16 iomaster = GET_GLOBALFLAT(chan_gf->iomaster);
|
||||
if (! iomaster)
|
||||
|
@ -413,10 +413,10 @@ ata_dma_transfer(struct disk_op_s *op)
|
|||
{
|
||||
if (! CONFIG_ATA_DMA)
|
||||
return -1;
|
||||
dprintf(16, "ata_dma_transfer id=%p buf=%p\n", op->drive_gf, op->buf_fl);
|
||||
dprintf(16, "ata_dma_transfer id=%p buf=%p\n", op->drive_fl, op->buf_fl);
|
||||
|
||||
struct atadrive_s *adrive_gf = container_of(
|
||||
op->drive_gf, struct atadrive_s, drive);
|
||||
op->drive_fl, struct atadrive_s, drive);
|
||||
struct ata_channel_s *chan_gf = GET_GLOBALFLAT(adrive_gf->chan_gf);
|
||||
u16 iomaster = GET_GLOBALFLAT(chan_gf->iomaster);
|
||||
|
||||
|
@ -466,7 +466,7 @@ static int
|
|||
ata_pio_cmd_data(struct disk_op_s *op, int iswrite, struct ata_pio_command *cmd)
|
||||
{
|
||||
struct atadrive_s *adrive_gf = container_of(
|
||||
op->drive_gf, struct atadrive_s, drive);
|
||||
op->drive_fl, struct atadrive_s, drive);
|
||||
struct ata_channel_s *chan_gf = GET_GLOBALFLAT(adrive_gf->chan_gf);
|
||||
u16 iobase1 = GET_GLOBALFLAT(chan_gf->iobase1);
|
||||
u16 iobase2 = GET_GLOBALFLAT(chan_gf->iobase2);
|
||||
|
@ -495,7 +495,7 @@ ata_dma_cmd_data(struct disk_op_s *op, struct ata_pio_command *cmd)
|
|||
if (! CONFIG_ATA_DMA)
|
||||
return -1;
|
||||
struct atadrive_s *adrive_gf = container_of(
|
||||
op->drive_gf, struct atadrive_s, drive);
|
||||
op->drive_fl, struct atadrive_s, drive);
|
||||
int ret = send_cmd(adrive_gf, cmd);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
@ -559,7 +559,7 @@ ata_process_op(struct disk_op_s *op)
|
|||
return 0;
|
||||
|
||||
struct atadrive_s *adrive_gf = container_of(
|
||||
op->drive_gf, struct atadrive_s, drive);
|
||||
op->drive_fl, struct atadrive_s, drive);
|
||||
switch (op->command) {
|
||||
case CMD_READ:
|
||||
return ata_readwrite(op, 0);
|
||||
|
@ -597,7 +597,7 @@ ata_atapi_process_op(struct disk_op_s *op)
|
|||
return default_process_op(op);
|
||||
|
||||
struct atadrive_s *adrive_gf = container_of(
|
||||
op->drive_gf, struct atadrive_s, drive);
|
||||
op->drive_fl, struct atadrive_s, drive);
|
||||
struct ata_channel_s *chan_gf = GET_GLOBALFLAT(adrive_gf->chan_gf);
|
||||
u16 iobase1 = GET_GLOBALFLAT(chan_gf->iobase1);
|
||||
u16 iobase2 = GET_GLOBALFLAT(chan_gf->iobase2);
|
||||
|
@ -667,7 +667,7 @@ send_ata_identity(struct atadrive_s *adrive, u16 *buffer, int command)
|
|||
|
||||
struct disk_op_s dop;
|
||||
memset(&dop, 0, sizeof(dop));
|
||||
dop.drive_gf = &adrive->drive;
|
||||
dop.drive_fl = &adrive->drive;
|
||||
dop.count = 1;
|
||||
dop.lba = 1;
|
||||
dop.buf_fl = MAKE_FLATPTR(GET_SEG(SS), buffer);
|
||||
|
|
|
@ -117,7 +117,7 @@ scsi_fill_cmd(struct disk_op_s *op, void *cdbcmd, int maxcdb)
|
|||
: CDB_CMD_WRITE_10);
|
||||
cmd->lba = cpu_to_be32(op->lba);
|
||||
cmd->count = cpu_to_be16(op->count);
|
||||
return GET_FLATPTR(op->drive_gf->blksize);
|
||||
return GET_FLATPTR(op->drive_fl->blksize);
|
||||
case CMD_SCSI:
|
||||
if (MODESEGMENT)
|
||||
return -1;
|
||||
|
@ -141,7 +141,7 @@ int
|
|||
scsi_is_ready(struct disk_op_s *op)
|
||||
{
|
||||
ASSERT32FLAT();
|
||||
dprintf(6, "scsi_is_ready (drive=%p)\n", op->drive_gf);
|
||||
dprintf(6, "scsi_is_ready (drive=%p)\n", op->drive_fl);
|
||||
|
||||
/* Retry TEST UNIT READY for 5 seconds unless MEDIUM NOT PRESENT is
|
||||
* reported by the device. If the device reports "IN PROGRESS",
|
||||
|
@ -223,7 +223,7 @@ int scsi_rep_luns_scan(struct drive_s *tmp_drive, scsi_add_lun add_lun)
|
|||
.command = CDB_CMD_REPORT_LUNS,
|
||||
};
|
||||
struct disk_op_s op = {
|
||||
.drive_gf = tmp_drive,
|
||||
.drive_fl = tmp_drive,
|
||||
.command = CMD_SCSI,
|
||||
.count = 1,
|
||||
.cdbcmd = &cdb,
|
||||
|
@ -284,7 +284,7 @@ scsi_drive_setup(struct drive_s *drive, const char *s, int prio)
|
|||
ASSERT32FLAT();
|
||||
struct disk_op_s dop;
|
||||
memset(&dop, 0, sizeof(dop));
|
||||
dop.drive_gf = drive;
|
||||
dop.drive_fl = drive;
|
||||
struct cdbres_inquiry data;
|
||||
int ret = cdb_get_inquiry(&dop, &data);
|
||||
if (ret)
|
||||
|
|
|
@ -83,7 +83,7 @@ esp_scsi_process_op(struct disk_op_s *op)
|
|||
if (!CONFIG_ESP_SCSI)
|
||||
return DISK_RET_EBADTRACK;
|
||||
struct esp_lun_s *llun_gf =
|
||||
container_of(op->drive_gf, struct esp_lun_s, drive);
|
||||
container_of(op->drive_fl, struct esp_lun_s, drive);
|
||||
u16 target = GET_GLOBALFLAT(llun_gf->target);
|
||||
u16 lun = GET_GLOBALFLAT(llun_gf->lun);
|
||||
u8 cdbcmd[16];
|
||||
|
|
|
@ -473,7 +473,7 @@ floppy_dma_cmd(struct disk_op_s *op, int count, int command, u8 *param)
|
|||
return DISK_RET_EBOUNDARY;
|
||||
|
||||
// Invoke floppy controller
|
||||
u8 floppyid = GET_GLOBALFLAT(op->drive_gf->cntl_id);
|
||||
u8 floppyid = GET_GLOBALFLAT(op->drive_fl->cntl_id);
|
||||
ret = floppy_drive_pio(floppyid, command, param);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
@ -506,11 +506,11 @@ lba2chs(struct disk_op_s *op)
|
|||
struct chs_s res = { };
|
||||
|
||||
u32 tmp = op->lba;
|
||||
u16 nls = GET_GLOBALFLAT(op->drive_gf->lchs.sector);
|
||||
u16 nls = GET_GLOBALFLAT(op->drive_fl->lchs.sector);
|
||||
res.sector = (tmp % nls) + 1;
|
||||
|
||||
tmp /= nls;
|
||||
u16 nlh = GET_GLOBALFLAT(op->drive_gf->lchs.head);
|
||||
u16 nlh = GET_GLOBALFLAT(op->drive_fl->lchs.head);
|
||||
res.head = tmp % nlh;
|
||||
|
||||
tmp /= nlh;
|
||||
|
@ -538,12 +538,12 @@ static int
|
|||
floppy_read(struct disk_op_s *op)
|
||||
{
|
||||
struct chs_s chs = lba2chs(op);
|
||||
int ret = floppy_prep(op->drive_gf, chs.cylinder);
|
||||
int ret = floppy_prep(op->drive_fl, chs.cylinder);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
// send read-normal-data command to controller
|
||||
u8 floppyid = GET_GLOBALFLAT(op->drive_gf->cntl_id);
|
||||
u8 floppyid = GET_GLOBALFLAT(op->drive_fl->cntl_id);
|
||||
u8 param[8];
|
||||
param[0] = (chs.head << 2) | floppyid; // HD DR1 DR2
|
||||
param[1] = chs.cylinder;
|
||||
|
@ -561,12 +561,12 @@ static int
|
|||
floppy_write(struct disk_op_s *op)
|
||||
{
|
||||
struct chs_s chs = lba2chs(op);
|
||||
int ret = floppy_prep(op->drive_gf, chs.cylinder);
|
||||
int ret = floppy_prep(op->drive_fl, chs.cylinder);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
// send write-normal-data command to controller
|
||||
u8 floppyid = GET_GLOBALFLAT(op->drive_gf->cntl_id);
|
||||
u8 floppyid = GET_GLOBALFLAT(op->drive_fl->cntl_id);
|
||||
u8 param[8];
|
||||
param[0] = (chs.head << 2) | floppyid; // HD DR1 DR2
|
||||
param[1] = chs.cylinder;
|
||||
|
@ -584,7 +584,7 @@ static int
|
|||
floppy_verify(struct disk_op_s *op)
|
||||
{
|
||||
struct chs_s chs = lba2chs(op);
|
||||
int ret = floppy_prep(op->drive_gf, chs.cylinder);
|
||||
int ret = floppy_prep(op->drive_fl, chs.cylinder);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
@ -597,12 +597,12 @@ static int
|
|||
floppy_format(struct disk_op_s *op)
|
||||
{
|
||||
struct chs_s chs = lba2chs(op);
|
||||
int ret = floppy_prep(op->drive_gf, chs.cylinder);
|
||||
int ret = floppy_prep(op->drive_fl, chs.cylinder);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
// send format-track command to controller
|
||||
u8 floppyid = GET_GLOBALFLAT(op->drive_gf->cntl_id);
|
||||
u8 floppyid = GET_GLOBALFLAT(op->drive_fl->cntl_id);
|
||||
u8 param[7];
|
||||
param[0] = (chs.head << 2) | floppyid; // HD DR1 DR2
|
||||
param[1] = FLOPPY_SIZE_CODE;
|
||||
|
|
|
@ -57,7 +57,7 @@ lsi_scsi_process_op(struct disk_op_s *op)
|
|||
if (!CONFIG_LSI_SCSI)
|
||||
return DISK_RET_EBADTRACK;
|
||||
struct lsi_lun_s *llun_gf =
|
||||
container_of(op->drive_gf, struct lsi_lun_s, drive);
|
||||
container_of(op->drive_fl, struct lsi_lun_s, drive);
|
||||
u16 target = GET_GLOBALFLAT(llun_gf->target);
|
||||
u16 lun = GET_GLOBALFLAT(llun_gf->lun);
|
||||
u8 cdbcmd[16];
|
||||
|
|
|
@ -167,7 +167,7 @@ megasas_process_op(struct disk_op_s *op)
|
|||
if (blocksize < 0)
|
||||
return default_process_op(op);
|
||||
struct megasas_lun_s *mlun_gf =
|
||||
container_of(op->drive_gf, struct megasas_lun_s, drive);
|
||||
container_of(op->drive_fl, struct megasas_lun_s, drive);
|
||||
struct megasas_cmd_frame *frame = GET_GLOBALFLAT(mlun_gf->frame);
|
||||
u16 pci_id = GET_GLOBALFLAT(mlun_gf->pci_id);
|
||||
int i;
|
||||
|
|
|
@ -188,7 +188,7 @@ mpt_scsi_process_op(struct disk_op_s *op)
|
|||
return default_process_op(op);
|
||||
|
||||
struct mpt_lun_s *llun_gf =
|
||||
container_of(op->drive_gf, struct mpt_lun_s, drive);
|
||||
container_of(op->drive_fl, struct mpt_lun_s, drive);
|
||||
u16 target = GET_GLOBALFLAT(llun_gf->target);
|
||||
u16 lun = GET_GLOBALFLAT(llun_gf->lun);
|
||||
u32 iobase = GET_GLOBALFLAT(llun_gf->iobase);
|
||||
|
|
|
@ -601,7 +601,7 @@ nvme_process_op(struct disk_op_s *op)
|
|||
if (!CONFIG_NVME)
|
||||
return DISK_RET_SUCCESS;
|
||||
|
||||
struct nvme_namespace *ns = container_of(op->drive_gf, struct nvme_namespace,
|
||||
struct nvme_namespace *ns = container_of(op->drive_fl, struct nvme_namespace,
|
||||
drive);
|
||||
|
||||
switch (op->command) {
|
||||
|
|
|
@ -213,7 +213,7 @@ pvscsi_process_op(struct disk_op_s *op)
|
|||
if (!CONFIG_PVSCSI)
|
||||
return DISK_RET_EBADTRACK;
|
||||
struct pvscsi_lun_s *plun =
|
||||
container_of(op->drive_gf, struct pvscsi_lun_s, drive);
|
||||
container_of(op->drive_fl, struct pvscsi_lun_s, drive);
|
||||
struct pvscsi_ring_dsc_s *ring_dsc = plun->ring_dsc;
|
||||
struct PVSCSIRingsState *s = ring_dsc->ring_state;
|
||||
u32 req_entries = s->reqNumEntriesLog2;
|
||||
|
|
|
@ -62,7 +62,7 @@ ramdisk_setup(void)
|
|||
static int
|
||||
ramdisk_copy(struct disk_op_s *op, int iswrite)
|
||||
{
|
||||
u32 offset = GET_GLOBALFLAT(op->drive_gf->cntl_id);
|
||||
u32 offset = GET_GLOBALFLAT(op->drive_fl->cntl_id);
|
||||
offset += (u32)op->lba * DISK_SECTOR_SIZE;
|
||||
u64 opd = GDT_DATA | GDT_LIMIT(0xfffff) | GDT_BASE((u32)op->buf_fl);
|
||||
u64 ramd = GDT_DATA | GDT_LIMIT(0xfffff) | GDT_BASE(offset);
|
||||
|
|
|
@ -266,7 +266,7 @@ static int
|
|||
sdcard_readwrite(struct disk_op_s *op, int iswrite)
|
||||
{
|
||||
struct sddrive_s *drive = container_of(
|
||||
op->drive_gf, struct sddrive_s, drive);
|
||||
op->drive_fl, struct sddrive_s, drive);
|
||||
int cmd = iswrite ? SC_WRITE_SINGLE : SC_READ_SINGLE;
|
||||
if (op->count > 1)
|
||||
cmd = iswrite ? SC_WRITE_MULTIPLE : SC_READ_MULTIPLE;
|
||||
|
|
|
@ -69,9 +69,9 @@ usb_process_op(struct disk_op_s *op)
|
|||
return 0;
|
||||
|
||||
dprintf(16, "usb_cmd_data id=%p write=%d count=%d buf=%p\n"
|
||||
, op->drive_gf, 0, op->count, op->buf_fl);
|
||||
, op->drive_fl, 0, op->count, op->buf_fl);
|
||||
struct usbdrive_s *udrive_gf = container_of(
|
||||
op->drive_gf, struct usbdrive_s, drive);
|
||||
op->drive_fl, struct usbdrive_s, drive);
|
||||
|
||||
// Setup command block wrapper.
|
||||
struct cbw_s cbw;
|
||||
|
|
|
@ -98,7 +98,7 @@ uas_process_op(struct disk_op_s *op)
|
|||
return DISK_RET_EBADTRACK;
|
||||
|
||||
struct uasdrive_s *drive_gf = container_of(
|
||||
op->drive_gf, struct uasdrive_s, drive);
|
||||
op->drive_fl, struct uasdrive_s, drive);
|
||||
|
||||
uas_ui ui;
|
||||
memset(&ui, 0, sizeof(ui));
|
||||
|
|
|
@ -33,7 +33,7 @@ static int
|
|||
virtio_blk_op(struct disk_op_s *op, int write)
|
||||
{
|
||||
struct virtiodrive_s *vdrive_gf =
|
||||
container_of(op->drive_gf, struct virtiodrive_s, drive);
|
||||
container_of(op->drive_fl, struct virtiodrive_s, drive);
|
||||
struct vring_virtqueue *vq = vdrive_gf->vq;
|
||||
struct virtio_blk_outhdr hdr = {
|
||||
.type = write ? VIRTIO_BLK_T_OUT : VIRTIO_BLK_T_IN,
|
||||
|
|
|
@ -39,7 +39,7 @@ virtio_scsi_process_op(struct disk_op_s *op)
|
|||
if (! CONFIG_VIRTIO_SCSI)
|
||||
return 0;
|
||||
struct virtio_lun_s *vlun =
|
||||
container_of(op->drive_gf, struct virtio_lun_s, drive);
|
||||
container_of(op->drive_fl, struct virtio_lun_s, drive);
|
||||
struct vp_device *vp = vlun->vp;
|
||||
struct vring_virtqueue *vq = vlun->vq;
|
||||
struct virtio_scsi_req_cmd req;
|
||||
|
|
Loading…
Reference in New Issue