1 /* $FreeBSD: src/sys/dev/asr/sys_info.h,v 1.1.2.2 2001/08/23 05:21:29 scottl Exp $ */ 2 /* $DragonFly: src/sys/dev/raid/asr/sys_info.h,v 1.2 2003/06/17 04:28:22 dillon Exp $ */ 3 /* 4 * Copyright (c) 1996-1999 Distributed Processing Technology Corporation 5 * All rights reserved. 6 * 7 * Redistribution and use in source form, with or without modification, are 8 * permitted provided that redistributions of source code must retain the 9 * above copyright notice, this list of conditions and the following disclaimer. 10 * 11 * This software is provided `as is' by Distributed Processing Technology and 12 * any express or implied warranties, including, but not limited to, the 13 * implied warranties of merchantability and fitness for a particular purpose, 14 * are disclaimed. In no event shall Distributed Processing Technology be 15 * liable for any direct, indirect, incidental, special, exemplary or 16 * consequential damages (including, but not limited to, procurement of 17 * substitute goods or services; loss of use, data, or profits; or business 18 * interruptions) however caused and on any theory of liability, whether in 19 * contract, strict liability, or tort (including negligence or otherwise) 20 * arising in any way out of the use of this driver software, even if advised 21 * of the possibility of such damage. 22 * 23 */ 24 25 #ifndef __SYS_INFO_H 26 #define __SYS_INFO_H 27 28 /*File - SYS_INFO.H 29 **************************************************************************** 30 * 31 *Description: 32 * 33 * This file contains structure definitions for the OS dependent 34 *layer system information buffers. 35 * 36 *Copyright Distributed Processing Technology, Corp. 37 * 140 Candace Dr. 38 * Maitland, Fl. 32751 USA 39 * Phone: (407) 830-5522 Fax: (407) 260-5366 40 * All Rights Reserved 41 * 42 *Author: Don Kemper 43 *Date: 5/10/94 44 * 45 *Editors: 46 * 47 *Remarks: 48 * 49 * 50 *****************************************************************************/ 51 52 53 /*Include Files ------------------------------------------------------------- */ 54 55 #if (defined(KERNEL) && defined(__bsdi__)) 56 # include "i386/isa/dpt_osd_util.h" 57 #elif ((defined(KERNEL) || defined(_KERNEL)) && defined(__FreeBSD__)) 58 # if (KERN_VERSION < 3) 59 # include "i386/isa/dpt_osd_util.h" 60 # else 61 # include "dev/asr/osd_util.h" 62 # endif 63 #else 64 # include "osd_util.h" 65 #endif 66 67 #ifndef NO_PACK 68 #if defined (_DPT_AIX) 69 #pragma options align=packed 70 #else 71 #pragma pack(1) 72 #endif /* aix */ 73 #endif // no unpack 74 75 76 /*struct - driveParam_S - start 77 *=========================================================================== 78 * 79 *Description: 80 * 81 * This structure defines the drive parameters seen during 82 *booting. 83 * 84 *---------------------------------------------------------------------------*/ 85 86 #ifdef __cplusplus 87 struct driveParam_S { 88 #else 89 typedef struct { 90 #endif 91 92 uSHORT cylinders; /* Upto 1024 */ 93 uCHAR heads; /* Upto 255 */ 94 uCHAR sectors; /* Upto 63 */ 95 96 #ifdef __cplusplus 97 98 //---------- Portability Additions ----------- in sp_sinfo.cpp 99 #ifdef DPT_PORTABLE 100 uSHORT netInsert(dptBuffer_S *buffer); 101 uSHORT netExtract(dptBuffer_S *buffer); 102 #endif // DPT PORTABLE 103 //-------------------------------------------- 104 105 }; 106 #else 107 } driveParam_S; 108 #endif 109 /*driveParam_S - end */ 110 111 112 /*struct - sysInfo_S - start 113 *=========================================================================== 114 * 115 *Description: 116 * 117 * This structure defines the command system information that 118 *should be returned by every OS dependent layer. 119 * 120 *---------------------------------------------------------------------------*/ 121 122 /*flags - bit definitions */ 123 #define SI_CMOS_Valid 0x0001 124 #define SI_NumDrivesValid 0x0002 125 #define SI_ProcessorValid 0x0004 126 #define SI_MemorySizeValid 0x0008 127 #define SI_DriveParamsValid 0x0010 128 #define SI_SmartROMverValid 0x0020 129 #define SI_OSversionValid 0x0040 130 #define SI_OSspecificValid 0x0080 /* 1 if OS structure returned */ 131 #define SI_BusTypeValid 0x0100 132 133 #define SI_ALL_VALID 0x0FFF /* All Std SysInfo is valid */ 134 #define SI_NO_SmartROM 0x8000 135 136 /*busType - definitions */ 137 #define SI_ISA_BUS 0x00 138 #define SI_MCA_BUS 0x01 139 #define SI_EISA_BUS 0x02 140 #define SI_PCI_BUS 0x04 141 142 #ifdef __cplusplus 143 struct sysInfo_S { 144 #else 145 typedef struct { 146 #endif 147 148 uCHAR drive0CMOS; /* CMOS Drive 0 Type */ 149 uCHAR drive1CMOS; /* CMOS Drive 1 Type */ 150 uCHAR numDrives; /* 0040:0075 contents */ 151 uCHAR processorFamily; /* Same as DPTSIG's definition */ 152 uCHAR processorType; /* Same as DPTSIG's definition */ 153 uCHAR smartROMMajorVersion; 154 uCHAR smartROMMinorVersion; /* SmartROM version */ 155 uCHAR smartROMRevision; 156 uSHORT flags; /* See bit definitions above */ 157 uSHORT conventionalMemSize; /* in KB */ 158 uLONG extendedMemSize; /* in KB */ 159 uLONG osType; /* Same as DPTSIG's definition */ 160 uCHAR osMajorVersion; 161 uCHAR osMinorVersion; /* The OS version */ 162 uCHAR osRevision; 163 #ifdef _SINIX_ADDON 164 uCHAR busType; /* See defininitions above */ 165 uSHORT osSubRevision; 166 uCHAR pad[2]; /* For alignment */ 167 #else 168 uCHAR osSubRevision; 169 uCHAR busType; /* See defininitions above */ 170 uCHAR pad[3]; /* For alignment */ 171 #endif 172 driveParam_S drives[16]; /* SmartROM Logical Drives */ 173 174 #ifdef __cplusplus 175 176 //---------- Portability Additions ----------- in sp_sinfo.cpp 177 #ifdef DPT_PORTABLE 178 uSHORT netInsert(dptBuffer_S *buffer); 179 uSHORT netExtract(dptBuffer_S *buffer); 180 #endif // DPT PORTABLE 181 //-------------------------------------------- 182 183 }; 184 #else 185 } sysInfo_S; 186 #endif 187 /*sysInfo_S - end */ 188 189 190 /*struct - DOS_Info_S - start 191 *=========================================================================== 192 * 193 *Description: 194 * 195 * This structure defines the system information specific to a 196 *DOS workstation. 197 * 198 *---------------------------------------------------------------------------*/ 199 200 /*flags - bit definitions */ 201 #define DI_DOS_HIGH 0x01 /* DOS is loaded high */ 202 #define DI_DPMI_VALID 0x02 /* DPMI version is valid */ 203 204 #ifdef __cplusplus 205 struct DOS_Info_S { 206 #else 207 typedef struct { 208 #endif 209 210 uCHAR flags; /* See bit definitions above */ 211 uSHORT driverLocation; /* SmartROM BIOS address */ 212 uSHORT DOS_version; 213 uSHORT DPMI_version; 214 215 #ifdef __cplusplus 216 217 //---------- Portability Additions ----------- in sp_sinfo.cpp 218 #ifdef DPT_PORTABLE 219 uSHORT netInsert(dptBuffer_S *buffer); 220 uSHORT netExtract(dptBuffer_S *buffer); 221 #endif // DPT PORTABLE 222 //-------------------------------------------- 223 224 }; 225 #else 226 } DOS_Info_S; 227 #endif 228 /*DOS_Info_S - end */ 229 230 231 /*struct - Netware_Info_S - start 232 *=========================================================================== 233 * 234 *Description: 235 * 236 * This structure defines the system information specific to a 237 *Netware machine. 238 * 239 *---------------------------------------------------------------------------*/ 240 241 #ifdef __cplusplus 242 struct Netware_Info_S { 243 #else 244 typedef struct { 245 #endif 246 247 uCHAR driverName[13]; /* ie PM12NW31.DSK */ 248 uCHAR serverName[48]; 249 uCHAR netwareVersion; /* The Netware OS version */ 250 uCHAR netwareSubVersion; 251 uCHAR netwareRevision; 252 uSHORT maxConnections; /* Probably 250 or 1000 */ 253 uSHORT connectionsInUse; 254 uSHORT maxVolumes; 255 uCHAR unused; 256 uCHAR SFTlevel; 257 uCHAR TTSlevel; 258 259 uCHAR clibMajorVersion; /* The CLIB.NLM version */ 260 uCHAR clibMinorVersion; 261 uCHAR clibRevision; 262 263 #ifdef __cplusplus 264 265 //---------- Portability Additions ----------- in sp_sinfo.cpp 266 #ifdef DPT_PORTABLE 267 uSHORT netInsert(dptBuffer_S *buffer); 268 uSHORT netExtract(dptBuffer_S *buffer); 269 #endif // DPT PORTABLE 270 //-------------------------------------------- 271 272 }; 273 #else 274 } Netware_Info_S; 275 #endif 276 /*Netware_Info_S - end */ 277 278 279 /*struct - OS2_Info_S - start 280 *=========================================================================== 281 * 282 *Description: 283 * 284 * This structure defines the system information specific to an 285 *OS/2 machine. 286 * 287 *---------------------------------------------------------------------------*/ 288 289 #ifdef __cplusplus 290 struct OS2_Info_S { 291 #else 292 typedef struct { 293 #endif 294 295 uCHAR something; 296 297 #ifdef __cplusplus 298 299 //---------- Portability Additions ----------- in sp_sinfo.cpp 300 #ifdef DPT_PORTABLE 301 uSHORT netInsert(dptBuffer_S *buffer); 302 uSHORT netExtract(dptBuffer_S *buffer); 303 #endif // DPT PORTABLE 304 //-------------------------------------------- 305 306 }; 307 #else 308 } OS2_Info_S; 309 #endif 310 /*OS2_Info_S - end */ 311 312 313 /*struct - WinNT_Info_S - start 314 *=========================================================================== 315 * 316 *Description: 317 * 318 * This structure defines the system information specific to a 319 *Windows NT machine. 320 * 321 *---------------------------------------------------------------------------*/ 322 323 #ifdef __cplusplus 324 struct WinNT_Info_S { 325 #else 326 typedef struct { 327 #endif 328 329 uCHAR something; 330 331 #ifdef __cplusplus 332 333 //---------- Portability Additions ----------- in sp_sinfo.cpp 334 #ifdef DPT_PORTABLE 335 uSHORT netInsert(dptBuffer_S *buffer); 336 uSHORT netExtract(dptBuffer_S *buffer); 337 #endif // DPT PORTABLE 338 //-------------------------------------------- 339 340 }; 341 #else 342 } WinNT_Info_S; 343 #endif 344 /*WinNT_Info_S - end */ 345 346 347 /*struct - SCO_Info_S - start 348 *=========================================================================== 349 * 350 *Description: 351 * 352 * This structure defines the system information specific to an 353 *SCO UNIX machine. 354 * 355 *---------------------------------------------------------------------------*/ 356 357 #ifdef __cplusplus 358 struct SCO_Info_S { 359 #else 360 typedef struct { 361 #endif 362 363 uCHAR something; 364 365 #ifdef __cplusplus 366 367 //---------- Portability Additions ----------- in sp_sinfo.cpp 368 #ifdef DPT_PORTABLE 369 uSHORT netInsert(dptBuffer_S *buffer); 370 uSHORT netExtract(dptBuffer_S *buffer); 371 #endif // DPT PORTABLE 372 //-------------------------------------------- 373 374 }; 375 #else 376 } SCO_Info_S; 377 #endif 378 /*SCO_Info_S - end */ 379 380 381 /*struct - USL_Info_S - start 382 *=========================================================================== 383 * 384 *Description: 385 * 386 * This structure defines the system information specific to a 387 *USL UNIX machine. 388 * 389 *---------------------------------------------------------------------------*/ 390 391 #ifdef __cplusplus 392 struct USL_Info_S { 393 #else 394 typedef struct { 395 #endif 396 397 uCHAR something; 398 399 #ifdef __cplusplus 400 401 //---------- Portability Additions ----------- in sp_sinfo.cpp 402 #ifdef DPT_PORTABLE 403 uSHORT netInsert(dptBuffer_S *buffer); 404 uSHORT netExtract(dptBuffer_S *buffer); 405 #endif // DPT PORTABLE 406 //-------------------------------------------- 407 408 }; 409 #else 410 } USL_Info_S; 411 #endif 412 /*USL_Info_S - end */ 413 414 415 /* Restore default structure packing */ 416 #ifndef NO_UNPACK 417 #if defined (_DPT_AIX) 418 #pragma options align=reset 419 #elif defined (UNPACK_FOUR) 420 #pragma pack(4) 421 #else 422 #pragma pack() 423 #endif /* aix */ 424 #endif // no unpack 425 426 #ifdef DPT_MEASURE_PERFORMANCE 427 typedef struct dpt_metrics { 428 u_int32_t command_count[256]; /* We assume MAX 256 SCSI commands */ 429 u_int32_t max_command_time[256]; 430 u_int32_t min_command_time[256]; 431 432 u_int32_t min_intr_time; 433 u_int32_t max_intr_time; 434 u_int32_t max_intr_gap; 435 u_int32_t max_ht_time; 436 u_int32_t aborted_interrupts; 437 u_int32_t spurious_interrupts; 438 u_int32_t aborted_requests; 439 u_int32_t retried_requests; 440 441 u_int32_t max_waiting_count; 442 u_int32_t max_submit_count; 443 u_int32_t max_complete_count; 444 445 u_int32_t min_waiting_time; 446 u_int32_t min_submit_time; 447 u_int32_t min_complete_time; 448 449 u_int32_t max_waiting_time; 450 u_int32_t max_submit_time; 451 u_int32_t max_complete_time; 452 453 u_int32_t command_collisions; 454 u_int32_t command_too_busy; 455 u_int32_t max_eata_tries; 456 u_int32_t min_eata_tries; 457 458 u_int32_t read_by_size_count[10]; 459 u_int32_t write_by_size_count[10]; 460 u_int32_t read_by_size_min_time[10]; 461 u_int32_t read_by_size_max_time[10]; 462 struct timeval read_by_size_total_time[10]; 463 u_int32_t write_by_size_min_time[10]; 464 u_int32_t write_by_size_max_time[10]; 465 struct timeval write_by_size_total_time[10]; 466 467 #define SIZE_512 0 468 #define SIZE_1K 1 469 #define SIZE_2K 2 470 #define SIZE_4K 3 471 #define SIZE_8K 4 472 #define SIZE_16K 5 473 #define SIZE_32K 6 474 #define SIZE_64K 7 475 #define SIZE_BIGGER 8 476 #define SIZE_OTHER 9 477 478 struct timeval intr_started; 479 } dpt_perf_t; 480 #endif 481 482 #endif // __SYS_INFO_H 483 484