1/*
2 * Copyright 2004-2006, Axel D��rfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef KERNEL_BOOT_DISK_IDENTIFIER_H
6#define KERNEL_BOOT_DISK_IDENTIFIER_H
7
8
9#include <SupportDefs.h>
10
11
12enum bus_types {
13	UNKNOWN_BUS,
14	LEGACY_BUS,
15	PCI_BUS,
16};
17
18enum device_types {
19	UNKNOWN_DEVICE,
20	ATA_DEVICE,
21	ATAPI_DEVICE,
22	SCSI_DEVICE,
23	USB_DEVICE,
24	FIREWIRE_DEVICE,
25	FIBRE_DEVICE,
26};
27
28#define NUM_DISK_CHECK_SUMS 5
29
30typedef struct disk_identifier {
31	int32				bus_type;
32	int32				device_type;
33
34	union {
35		struct {
36			uint16		base_address;
37		} _PACKED legacy;
38		struct {
39			uint8		bus;
40			uint8		slot;
41			uint8		function;
42		} _PACKED pci;
43	} bus;
44	union {
45		struct {
46			bool		master;
47		} _PACKED ata;
48		struct {
49			bool		master;
50			uint8		logical_unit;
51		} _PACKED atapi;
52		struct {
53			uint8		logical_unit;
54		} _PACKED scsi;
55		struct {
56			uint8		tbd;
57		} _PACKED usb;
58		struct {
59			uint64		guid;
60		} _PACKED firewire;
61		struct {
62			uint64		wwd;
63		} _PACKED fibre;
64		struct {
65			off_t		size;
66			struct {
67				off_t	offset;
68				uint32	sum;
69			} _PACKED check_sums[NUM_DISK_CHECK_SUMS];
70		} _PACKED unknown;
71	} device;
72} _PACKED disk_identifier;
73
74#endif	/* KERNEL_BOOT_DISK_IDENTIFIER_H */
75