xref: /haiku/headers/private/kernel/boot/disk_identifier.h (revision 4f00613311d0bd6b70fa82ce19931c41f071ea4e)
1 /*
2  * Copyright 2004, 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 
12 enum bus_types {
13 	UNKNOWN_BUS,
14 	LEGACY_BUS,
15 	PCI_BUS,
16 };
17 
18 enum 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 typedef struct disk_identifier {
29 	int32				bus_type;
30 	int32				device_type;
31 
32 	union {
33 		struct {
34 			uint16		base_address;
35 		} legacy;
36 		struct {
37 			uint8		bus;
38 			uint8		slot;
39 			uint8		function;
40 		} pci;
41 	} bus;
42 	union {
43 		struct {
44 			bool		master;
45 		} ata;
46 		struct {
47 			bool		master;
48 			uint8		logical_unit;
49 		} atapi;
50 		struct {
51 			uint8		logical_unit;
52 		} scsi;
53 		struct {
54 			uint8		tbd;
55 		} usb;
56 		struct {
57 			uint64		guid;
58 		} firewire;
59 		struct {
60 			uint64		wwd;
61 		} fibre;
62 		struct {
63 			off_t		size;
64 			struct {
65 				off_t	offset;
66 				uint32	sum;
67 			} check_sums[5];
68 		} unknown;
69 	} device;
70 } disk_identifier;
71 
72 #endif	/* KERNEL_BOOT_DISK_IDENTIFIER_H */
73