xref: /illumos-gate/usr/src/uts/i86pc/sys/biosdisk.h (revision 03831d35)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_BIOSDISK_H
28 #define	_SYS_BIOSDISK_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/types.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 typedef union device_path {
39 	struct {			/* ATA or ATAPI or SATA */
40 		unsigned char 	chan;	/* 0 or 1 */
41 		unsigned char 	lun;	/* for ATAPI only */
42 	} ata;
43 	struct {
44 		unsigned short	target;
45 		uint32_t	lun_lo;
46 		uint32_t	lun_hi;
47 	} scsi;
48 	struct {
49 		uint64_t	usb_serial_id;
50 	} usb;
51 	struct {
52 		uint64_t	eui;
53 	} s1394;
54 	struct {
55 		uint64_t	wwid;
56 		uint64_t	lun;
57 	} fibre;
58 	struct {
59 		uint64_t	id_tag;
60 	} i2o;
61 
62 	struct {
63 		uint32_t	raid_array_num;
64 	} raid;
65 	unsigned char pad[16];		/* total length */
66 } device_path_t;
67 
68 
69 typedef union interface_path {
70 		struct {
71 			unsigned short 	baseport;
72 		} isa;
73 		struct {		/* PCI or PCIX */
74 			unsigned char bus;
75 			unsigned char device;
76 			unsigned char function;
77 			unsigned char channel;
78 		} pci;
79 		char 	pad[8];
80 } interface_path_t;
81 
82 /*
83  * Structure for Int 13 function 48 (EDD 3.0)
84  *
85  * from T13/1484D Revision 2
86  */
87 
88 #pragma pack(1)
89 typedef struct int13_fn48_result {
90 	unsigned short		buflen;
91 	unsigned short		flags;
92 	uint32_t		ncyl;
93 	uint32_t		nhead;
94 	uint32_t		spt;
95 	uint32_t 		nsect_lo;
96 	uint32_t		nsect_hi;
97 	unsigned short		bps;
98 	uint32_t		dpte;
99 	unsigned short		magic;		/* BEDD if Path info there */
100 	unsigned char		pathinfo_len;
101 	unsigned char		res1;
102 	unsigned short		res2;
103 	char			bustype[4];	/* offset 36 */
104 	char			interface_type[8];
105 	interface_path_t	interfacepath;
106 	device_path_t		devicepath;
107 	unsigned char		res3;
108 	unsigned char		checksum;	/* offset 73 */
109 } fn48_t;
110 #pragma pack()
111 
112 typedef struct biosdev_data {
113 	uchar_t			first_block_valid;
114 	uchar_t			first_block[512];
115 	uchar_t			edd_valid;
116 	fn48_t			fn48_dev_params;
117 } biosdev_data_t;
118 
119 #ifdef __cplusplus
120 }
121 #endif
122 
123 #endif /* _SYS_BIOSDISK_H */
124