// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 Red Hat, Inc.
-// Copyright (C) 2004 eCosCentric, Ltd.
+// Copyright (C) 2004, 2006 eCosCentric, Ltd.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// ----------------------------------------------------------------------------
+// No h/w controller structure is needed in this driver, but the address of the
+// second argument is taken anyway.
+DISK_CONTROLLER(ide_disk_controller, ide_disk_controller);
+
#ifdef CYGVAR_DEVS_DISK_IDE_DISK0
IDE_DISK_INSTANCE(0, 0, 0, true, CYGDAT_IO_DISK_IDE_DISK0_NAME);
#endif
for (j = 0, c=0 ; j < (CYGDAT_DEVS_DISK_IDE_SECTOR_SIZE / sizeof(cyg_uint16));
j++) {
HAL_IDE_READ_UINT16(ctlr, IDE_REG_DATA, p);
- if (c++<len) *b++=p&0xff;
- if (c++<len) *b++=(p>>8)&0xff;
+ if (c++<(len*512)) *b++=p&0xff;
+ if (c++<(len*512)) *b++=(p>>8)&0xff;
}
return 1;
}
//
for (j = 0, c=0 ; j < (CYGDAT_DEVS_DISK_IDE_SECTOR_SIZE / sizeof(cyg_uint16));
j++) {
- p = (c++<len) ? *b++ : 0;
- p |= (c++<len) ? (*b++<<8) : 0;
+ p = (c++<(len*512)) ? *b++ : 0;
+ p |= (c++<(len*512)) ? (*b++<<8) : 0;
HAL_IDE_WRITE_UINT16(ctlr, IDE_REG_DATA, p);
}
return 1;
ident.sectors_num = ide_idData->num_sectors;
ident.lba_sectors_num = ide_idData->lba_total_sectors[1] << 16 |
ide_idData->lba_total_sectors[0];
+ ident.phys_block_size = 1;
+ ident.max_transfer = 512;
D("\tSerial : %s\n", ident.serial);
D("\tFirmware rev. : %s\n", ident.firmware_rev);