add ahci support
[seabios.git] / src / disk.h
index ac5748ec655952917190accdd22cabe4ea2397e4..c1ba6ae44c0ad468fbd4c618865da83e8c661722 100644 (file)
@@ -173,20 +173,18 @@ struct chs_s {
 };
 
 struct drive_s {
-    u8  type;         // Detected type of drive (ata/atapi/none)
-    u8  removable;    // Removable device flag
-    u16 blksize;      // block size
-    u32 cntl_id;
-    u32 cntl_info;
-    u8  floppy_type;  // Type of floppy (only for floppy drives).
-
-    char model[41];
-
-    u8  translation;  // type of translation
-    struct chs_s  lchs;         // Logical CHS
-    struct chs_s  pchs;         // Physical CHS
-
-    u64 sectors;      // Total sectors count
+    u8 type;            // Driver type (DTYPE_*)
+    u8 floppy_type;     // Type of floppy (only for floppy drives).
+    struct chs_s lchs;  // Logical CHS
+    u64 sectors;        // Total sectors count
+    char *desc;         // Drive description (only available during POST)
+    u32 cntl_id;        // Unique id for a given driver type.
+    u8 removable;       // Is media removable (currently unused)
+
+    // Info for EDD calls
+    u8 translation;     // type of translation
+    u16 blksize;        // block size
+    struct chs_s pchs;  // Physical CHS
 };
 
 #define DISK_SECTOR_SIZE  512
@@ -198,6 +196,11 @@ struct drive_s {
 #define DTYPE_ATAPI    0x03
 #define DTYPE_RAMDISK  0x04
 #define DTYPE_CDEMU    0x05
+#define DTYPE_USB      0x06
+#define DTYPE_VIRTIO   0x07
+#define DTYPE_AHCI     0x08
+
+#define MAXDESCSIZE 80
 
 #define TRANSLATION_NONE  0
 #define TRANSLATION_LBA   1
@@ -205,14 +208,10 @@ struct drive_s {
 #define TRANSLATION_RECHS 3
 
 struct drives_s {
-    // info on each internally handled drive
-    struct drive_s drives[CONFIG_MAX_DRIVES];
-    u8 drivecount;
-    //
-    // map between bios floppy/hd/cd id and driveid index into drives[]
+    // map between bios floppy/hd/cd id and drive_s struct
     u8 floppycount;
     u8 cdcount;
-    u8 idmap[3][CONFIG_MAX_EXTDRIVE];
+    struct drive_s *idmap[3][CONFIG_MAX_EXTDRIVE];
 };
 
 #define EXTTYPE_FLOPPY 0
@@ -230,34 +229,29 @@ struct drives_s {
 // block.c
 extern struct drives_s Drives;
 struct drive_s *getDrive(u8 exttype, u8 extdriveoffset);
-struct drive_s *allocDrive(void);
 void setup_translation(struct drive_s *drive_g);
 void map_floppy_drive(struct drive_s *drive_g);
 void map_hd_drive(struct drive_s *drive_g);
 void map_cd_drive(struct drive_s *drive_g);
-void describe_drive(struct drive_s *drive_g);
 int process_op(struct disk_op_s *op);
 int send_disk_op(struct disk_op_s *op);
-void drive_setup(void);
 
 // floppy.c
 extern struct floppy_ext_dbt_s diskette_param_table2;
 void floppy_setup(void);
 struct drive_s *addFloppy(int floppyid, int ftype, int driver);
-void describe_floppy(struct drive_s *drive_g);
 int find_floppy_type(u32 size);
 int process_floppy_op(struct disk_op_s *op);
 void floppy_tick(void);
 
 // cdrom.c
-extern struct drive_s *cdemu_drive;
+extern struct drive_s *cdemu_drive_gf;
 int process_cdemu_op(struct disk_op_s *op);
 void cdemu_setup(void);
 void cdemu_134b(struct bregs *regs);
 int cdrom_boot(int cdid);
 
 // ramdisk.c
-void describe_ramdisk(struct drive_s *drive_g);
 void ramdisk_setup(void);
 int process_ramdisk_op(struct disk_op_s *op);