iPXE
bios_disks.h
Go to the documentation of this file.
00001 #ifndef BIOS_DISKS_H
00002 #define BIOS_DISKS_H
00003 
00004 #include "dev.h"
00005 
00006 /*
00007  * Constants
00008  *
00009  */
00010 
00011 #define BIOS_DISK_MAX_NAME_LEN  6
00012 
00013 struct bios_disk_sector {
00014         char data[512];
00015 };
00016 
00017 /*
00018  * The location of a BIOS disk
00019  *
00020  */
00021 struct bios_disk_loc {
00022         uint8_t drive;
00023 };
00024 
00025 /*
00026  * A physical BIOS disk device
00027  *
00028  */
00029 struct bios_disk_device {
00030         char name[BIOS_DISK_MAX_NAME_LEN];
00031         uint8_t drive;
00032         uint8_t type;
00033 };
00034 
00035 /*
00036  * A BIOS disk driver, with a valid device ID range and naming
00037  * function.
00038  *
00039  */
00040 struct bios_disk_driver {
00041         void ( *fill_drive_name ) ( char *buf, uint8_t drive );
00042         uint8_t min_drive;
00043         uint8_t max_drive;
00044 };
00045 
00046 /*
00047  * Define a BIOS disk driver
00048  *
00049  */
00050 #define BIOS_DISK_DRIVER( _name, _fill_drive_name, _min_drive, _max_drive )   \
00051         static struct bios_disk_driver _name = {                              \
00052                 .fill_drive_name = _fill_drive_name,                          \
00053                 .min_drive = _min_drive,                                      \
00054                 .max_drive = _max_drive,                                      \
00055         }
00056 
00057 /*
00058  * Functions in bios_disks.c
00059  *
00060  */
00061 
00062 
00063 /*
00064  * bios_disk bus global definition
00065  *
00066  */
00067 extern struct bus_driver bios_disk_driver;
00068 
00069 #endif /* BIOS_DISKS_H */