2004-11-15 20:59:15 +03:00
|
|
|
/*
|
2006-03-27 18:50:37 +04:00
|
|
|
* Copyright 2004-2006, Axel Dörfler, axeld@pinc-software.de.
|
2004-11-15 20:59:15 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef KERNEL_BOOT_DISK_IDENTIFIER_H
|
|
|
|
#define KERNEL_BOOT_DISK_IDENTIFIER_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
|
|
|
|
|
|
|
enum bus_types {
|
|
|
|
UNKNOWN_BUS,
|
|
|
|
LEGACY_BUS,
|
|
|
|
PCI_BUS,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum device_types {
|
|
|
|
UNKNOWN_DEVICE,
|
|
|
|
ATA_DEVICE,
|
|
|
|
ATAPI_DEVICE,
|
|
|
|
SCSI_DEVICE,
|
|
|
|
USB_DEVICE,
|
|
|
|
FIREWIRE_DEVICE,
|
|
|
|
FIBRE_DEVICE,
|
|
|
|
};
|
|
|
|
|
2006-03-27 18:50:37 +04:00
|
|
|
#define NUM_DISK_CHECK_SUMS 5
|
|
|
|
|
2004-11-15 20:59:15 +03:00
|
|
|
typedef struct disk_identifier {
|
|
|
|
int32 bus_type;
|
|
|
|
int32 device_type;
|
|
|
|
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
uint16 base_address;
|
2012-07-20 20:14:17 +04:00
|
|
|
} _PACKED legacy;
|
2004-11-15 20:59:15 +03:00
|
|
|
struct {
|
|
|
|
uint8 bus;
|
|
|
|
uint8 slot;
|
|
|
|
uint8 function;
|
2012-07-20 20:14:17 +04:00
|
|
|
} _PACKED pci;
|
2004-11-15 20:59:15 +03:00
|
|
|
} bus;
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
bool master;
|
2012-07-20 20:14:17 +04:00
|
|
|
} _PACKED ata;
|
2004-11-15 20:59:15 +03:00
|
|
|
struct {
|
|
|
|
bool master;
|
|
|
|
uint8 logical_unit;
|
2012-07-20 20:14:17 +04:00
|
|
|
} _PACKED atapi;
|
2004-11-15 20:59:15 +03:00
|
|
|
struct {
|
|
|
|
uint8 logical_unit;
|
2012-07-20 20:14:17 +04:00
|
|
|
} _PACKED scsi;
|
2004-11-15 20:59:15 +03:00
|
|
|
struct {
|
|
|
|
uint8 tbd;
|
2012-07-20 20:14:17 +04:00
|
|
|
} _PACKED usb;
|
2004-11-15 20:59:15 +03:00
|
|
|
struct {
|
|
|
|
uint64 guid;
|
2012-07-20 20:14:17 +04:00
|
|
|
} _PACKED firewire;
|
2004-11-15 20:59:15 +03:00
|
|
|
struct {
|
|
|
|
uint64 wwd;
|
2012-07-20 20:14:17 +04:00
|
|
|
} _PACKED fibre;
|
2004-11-15 20:59:15 +03:00
|
|
|
struct {
|
|
|
|
off_t size;
|
|
|
|
struct {
|
|
|
|
off_t offset;
|
|
|
|
uint32 sum;
|
2012-07-20 20:14:17 +04:00
|
|
|
} _PACKED check_sums[NUM_DISK_CHECK_SUMS];
|
|
|
|
} _PACKED unknown;
|
2004-11-15 20:59:15 +03:00
|
|
|
} device;
|
2012-07-20 20:14:17 +04:00
|
|
|
} _PACKED disk_identifier;
|
2004-11-15 20:59:15 +03:00
|
|
|
|
|
|
|
#endif /* KERNEL_BOOT_DISK_IDENTIFIER_H */
|