4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _SYS_BIOSDISK_H
27 #define _SYS_BIOSDISK_H
29 #include <sys/types.h>
35 typedef union device_path
{
36 struct { /* ATA or ATAPI or SATA */
37 unsigned char chan
; /* 0 or 1 */
38 unsigned char lun
; /* for ATAPI only */
41 unsigned short target
;
46 uint64_t usb_serial_id
;
60 uint32_t raid_array_num
;
62 unsigned char pad
[16]; /* total length */
66 typedef union interface_path
{
68 unsigned short baseport
;
70 struct { /* PCI or PCIX */
73 unsigned char function
;
74 unsigned char channel
;
80 * Structure for Int 13 function 48 (EDD 3.0)
82 * from T13/1484D Revision 2
86 typedef struct int13_fn48_result
{
87 unsigned short buflen
;
96 unsigned short magic
; /* BEDD if Path info there */
97 unsigned char pathinfo_len
;
100 char bustype
[4]; /* offset 36 */
101 char interface_type
[8];
102 interface_path_t interfacepath
;
103 device_path_t devicepath
;
105 unsigned char checksum
; /* offset 73 */
108 typedef struct int13_fn4b_result
{
109 uint8_t pkt_size
; /* Packet size (== 0x13) */
111 uint8_t boot_mtype
; /* Boot media type: see defines below */
120 uint8_t cyl_0_7
; /* Bits 0-7 of the 9-bit cylinder cnt */
122 * Bits 0-5: Sector count
123 * 6-7: High 2 bits of the 9-bit cylinder count
125 uint8_t sec_0_5_and_cyl_8_9
;
131 typedef struct biosdev_data
{
132 uchar_t first_block_valid
;
133 uchar_t first_block
[512];
135 fn48_t fn48_dev_params
;
139 * Definitions for boot_mtype in fn4b_t
141 #define BOOT_MTYPE_MASK 0xF
142 #define BOOT_MTYPE(x) ((x) & BOOT_MTYPE_MASK)
143 #define BOOT_MTYPE_NO_EMUL 0
144 #define BOOT_MTYPE_1_2M_FLOPPY 1
145 #define BOOT_MTYPE_1_44M_FLOPPY 2
146 #define BOOT_MTYPE_2_88M_FLOPPY 3
147 #define BOOT_MTYPE_HARD_DISK 4
148 #define BOOT_MTYPE_INTF_MASK 0xC0
149 #define BOOT_MTYPE_INTF_ATAPI 0x40
150 #define BOOT_MTYPE_INTF_SCSI 0x80
151 #define BOOT_MTYPE_IS_ATAPI(x) \
152 (((x) & BOOT_MTYPE_INTF_MASK) == BOOT_MTYPE_INTF_ATAPI)
153 #define BOOT_MTYPE_IS_SCSI(x) \
154 (((x) & BOOT_MTYPE_INTF_MASK) == BOOT_MTYPE_INTF_SCSI)
160 #endif /* _SYS_BIOSDISK_H */