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