3 #define ACME_ROADRUNNER 1 /* 504MB classic IDE drive */
4 #define ACME_COYOTE 2 /* 20MB early IDE drive */
5 #define ACME_NEMESIS 3 /* 20MB LBA capable drive */
6 #define ACME_ULTRASONICUS 4 /* 40MB LBA capable drive */
7 #define ACME_ACCELLERATTI 5 /* 128MB LBA capable drive */
8 #define ACME_ZIPPIBUS 6 /* 256MB LBA capable drive */
10 #define MAX_DRIVE_TYPE 6
14 #define ide_feature_w 1
15 #define ide_sec_count 2
22 #define ide_dev_head 6
24 #define ide_status_r 7
25 #define ide_command_w 7
27 #define ide_devctrl_w 8
28 #define ide_data_latch 9
38 struct ide_drive *drive;
42 struct ide_controller *controller;
43 struct ide_taskfile taskfile;
44 unsigned int present:1, intrq:1, failed:1, lba:1, eightbit:1;
46 uint8_t heads, sectors;
48 uint16_t identify[256];
54 uint8_t header_present;
57 struct ide_controller {
58 struct ide_drive drive[2];
68 //extern ide_controller idectrl;
69 extern const uint8_t ide_magic[9];
71 void ide_reset_begin(struct ide_controller *c);
72 uint8_t ide_read8(struct ide_controller *c, uint8_t r);
73 void ide_write8(struct ide_controller *c, uint8_t r, uint8_t v);
74 uint16_t ide_read16(struct ide_controller *c, uint8_t r);
75 void ide_write16(struct ide_controller *c, uint8_t r, uint16_t v);
76 uint8_t ide_read_latched(struct ide_controller *c, uint8_t r);
77 void ide_write_latched(struct ide_controller *c, uint8_t r, uint8_t v);
79 struct ide_controller *ide_allocate(const char *name);
80 int ide_attach(struct ide_controller *c, int drive, int fd);
81 int ide_attach_hdf(struct ide_controller *c, int drive, int fd);
82 int ide_make_ident(uint16_t c, uint8_t h, uint8_t s, char *name, uint16_t *target);
83 void ide_detach(struct ide_drive *d);
84 void ide_free(struct ide_controller *c);
86 int ide_make_drive(uint8_t type, int fd);