#include "types.h" // u8
#include "config.h" // CONFIG_MAX_ATA_INTERFACES
+#include "disk.h" // struct drive_s
struct ata_channel_s {
u16 iobase1;
u16 iobase2;
u16 iomaster;
u8 irq;
+ u8 chanid;
int pci_bdf;
+ struct pci_device *pci_tmp;
+};
+
+struct atadrive_s {
+ struct drive_s drive;
+ struct ata_channel_s *chan_gf;
+ u8 slave;
};
// ata.c
-extern struct ata_channel_s ATA_channels[CONFIG_MAX_ATA_INTERFACES];
+char *ata_extract_model(char *model, u32 size, u16 *buffer);
+int ata_extract_version(u16 *buffer);
int cdrom_read(struct disk_op_s *op);
-int ata_cmd_packet(struct drive_s *drive_g, u8 *cmdbuf, u8 cmdlen
- , u32 length, void *buf_fl);
+int atapi_cmd_data(struct disk_op_s *op, void *cdbcmd, u16 blocksize);
void ata_setup(void);
int process_ata_op(struct disk_op_s *op);
int process_atapi_op(struct disk_op_s *op);
-void describe_ata(struct drive_s *drive_g);
-void describe_atapi(struct drive_s *drive_g);
// Global defines -- ATA register and register bits.
// command block & control block regs
#define ATA_CMD_READ_NATIVE_MAX_ADDRESS 0xF8
#define ATA_CMD_SET_MAX 0xF9
-#define ATA_CMD_REQUEST_SENSE 0x03
-
#endif // ata.h