]>
glassweightruler.freedombox.rocks Git - Ventoy.git/blob - Plugson/src/Core/ventoy_disk.h
1 /******************************************************************************
4 * Copyright (c) 2021, longpanda <admin@ventoy.net>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 3 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #ifndef __VENTOY_DISK_H__
21 #define __VENTOY_DISK_H__
24 typedef struct ventoy_disk
30 char cur_capacity
[64];
32 char cur_ventoy_ver
[64];
38 #if defined(_MSC_VER) || defined(WIN32)
46 VTOY_DEVICE_UNKNOWN
= 0,
73 /* from <linux/major.h> */
80 #define SCSI_CDROM_MAJOR 11
81 #define SCSI_DISK0_MAJOR 8
82 #define SCSI_DISK1_MAJOR 65
83 #define SCSI_DISK2_MAJOR 66
84 #define SCSI_DISK3_MAJOR 67
85 #define SCSI_DISK4_MAJOR 68
86 #define SCSI_DISK5_MAJOR 69
87 #define SCSI_DISK6_MAJOR 70
88 #define SCSI_DISK7_MAJOR 71
89 #define SCSI_DISK8_MAJOR 128
90 #define SCSI_DISK9_MAJOR 129
91 #define SCSI_DISK10_MAJOR 130
92 #define SCSI_DISK11_MAJOR 131
93 #define SCSI_DISK12_MAJOR 132
94 #define SCSI_DISK13_MAJOR 133
95 #define SCSI_DISK14_MAJOR 134
96 #define SCSI_DISK15_MAJOR 135
97 #define COMPAQ_SMART2_MAJOR 72
98 #define COMPAQ_SMART2_MAJOR1 73
99 #define COMPAQ_SMART2_MAJOR2 74
100 #define COMPAQ_SMART2_MAJOR3 75
101 #define COMPAQ_SMART2_MAJOR4 76
102 #define COMPAQ_SMART2_MAJOR5 77
103 #define COMPAQ_SMART2_MAJOR6 78
104 #define COMPAQ_SMART2_MAJOR7 79
105 #define COMPAQ_SMART_MAJOR 104
106 #define COMPAQ_SMART_MAJOR1 105
107 #define COMPAQ_SMART_MAJOR2 106
108 #define COMPAQ_SMART_MAJOR3 107
109 #define COMPAQ_SMART_MAJOR4 108
110 #define COMPAQ_SMART_MAJOR5 109
111 #define COMPAQ_SMART_MAJOR6 110
112 #define COMPAQ_SMART_MAJOR7 111
113 #define DAC960_MAJOR 48
114 #define ATARAID_MAJOR 114
115 #define I2O_MAJOR1 80
116 #define I2O_MAJOR2 81
117 #define I2O_MAJOR3 82
118 #define I2O_MAJOR4 83
119 #define I2O_MAJOR5 84
120 #define I2O_MAJOR6 85
121 #define I2O_MAJOR7 86
122 #define I2O_MAJOR8 87
124 #define DASD_MAJOR 94
125 #define VIODASD_MAJOR 112
126 #define AOE_MAJOR 152
127 #define SX8_MAJOR1 160
128 #define SX8_MAJOR2 161
129 #define XVD_MAJOR 202
130 #define SDMMC_MAJOR 179
133 #define BLKEXT_MAJOR 259
136 #define SCSI_BLK_MAJOR(M) ( \
137 (M) == SCSI_DISK0_MAJOR \
138 || (M) == SCSI_CDROM_MAJOR \
139 || ((M) >= SCSI_DISK1_MAJOR && (M) <= SCSI_DISK7_MAJOR) \
140 || ((M) >= SCSI_DISK8_MAJOR && (M) <= SCSI_DISK15_MAJOR))
142 #define IDE_BLK_MAJOR(M) \
143 ((M) == IDE0_MAJOR || \
144 (M) == IDE1_MAJOR || \
145 (M) == IDE2_MAJOR || \
146 (M) == IDE3_MAJOR || \
147 (M) == IDE4_MAJOR || \
150 #define SX8_BLK_MAJOR(M) ((M) >= SX8_MAJOR1 && (M) <= SX8_MAJOR2)
151 #define I2O_BLK_MAJOR(M) ((M) >= I2O_MAJOR1 && (M) <= I2O_MAJOR8)
152 #define CPQARRAY_BLK_MAJOR(M) \
153 (((M) >= COMPAQ_SMART2_MAJOR && (M) <= COMPAQ_SMART2_MAJOR7) || \
154 (COMPAQ_SMART_MAJOR <= (M) && (M) <= COMPAQ_SMART_MAJOR7))
158 int ventoy_disk_init(void);
159 void ventoy_disk_exit(void);
160 int ventoy_get_disk_info(char **argv
);
161 const ventoy_disk
* ventoy_get_disk_list(int *num
);
162 const ventoy_disk
* ventoy_get_disk_node(int id
);
163 int CheckRuntimeEnvironment(char Letter
, ventoy_disk
*disk
);
165 #endif /* __VENTOY_DISK_H__ */