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