root / lab4 / .minix-src / include / sys / tape.h @ 13
History | View | Annotate | Download (2.69 KB)
1 |
/* $NetBSD: tape.h,v 1.3 2005/12/26 18:41:36 perry Exp $ */
|
---|---|
2 |
|
3 |
/*-
|
4 |
* Copyright (c) 2005 The NetBSD Foundation, Inc.
|
5 |
* All rights reserved.
|
6 |
*
|
7 |
* This code is derived from software contributed to The NetBSD Foundation
|
8 |
* by Brett Lymn
|
9 |
*
|
10 |
* Redistribution and use in source and binary forms, with or without
|
11 |
* modification, are permitted provided that the following conditions
|
12 |
* are met:
|
13 |
* 1. Redistributions of source code must retain the above copyright
|
14 |
* notice, this list of conditions and the following disclaimer.
|
15 |
* 2. Neither the name of The NetBSD Foundation nor the names of its
|
16 |
* contributors may be used to endorse or promote products derived
|
17 |
* from this software without specific prior written permission.
|
18 |
*
|
19 |
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
20 |
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
21 |
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
22 |
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
23 |
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
24 |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
25 |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
26 |
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
27 |
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
28 |
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
29 |
* POSSIBILITY OF SUCH DAMAGE.
|
30 |
*/
|
31 |
|
32 |
#ifndef _SYS_TAPE_H_
|
33 |
#define _SYS_TAPE_H_
|
34 |
|
35 |
#include <sys/queue.h> |
36 |
|
37 |
#define TAPENAMELEN 16 |
38 |
|
39 |
/* The following structure is 64-bit alignment safe */
|
40 |
struct tape_sysctl {
|
41 |
char name[TAPENAMELEN];
|
42 |
int32_t busy; |
43 |
int32_t pad; |
44 |
uint64_t xfer; |
45 |
uint64_t bytes; |
46 |
uint32_t attachtime_sec; |
47 |
uint32_t attachtime_usec; |
48 |
uint32_t timestamp_sec; |
49 |
uint32_t timestamp_usec; |
50 |
uint32_t time_sec; |
51 |
uint32_t time_usec; |
52 |
uint64_t rxfer; |
53 |
uint64_t rbytes; |
54 |
uint64_t wxfer; |
55 |
uint64_t wbytes; |
56 |
}; |
57 |
|
58 |
/*
|
59 |
* Statistics for the tape device - in a separate structure so userland can
|
60 |
* see them.
|
61 |
*/
|
62 |
|
63 |
struct tape {
|
64 |
char *name; /* name of drive */ |
65 |
int busy; /* drive is busy */ |
66 |
uint64_t rxfer; /* total number of read transfers */
|
67 |
uint64_t wxfer; /* total number of write transfers */
|
68 |
uint64_t rbytes; /* total bytes read */
|
69 |
uint64_t wbytes; /* total bytes written */
|
70 |
struct timeval attachtime; /* time tape was attached */ |
71 |
struct timeval timestamp; /* timestamp of last unbusy */ |
72 |
struct timeval time; /* total time spent busy */ |
73 |
|
74 |
TAILQ_ENTRY(tape) link; |
75 |
}; |
76 |
|
77 |
/* Head of the tape stats list, define here so userland can get at it */
|
78 |
TAILQ_HEAD(tapelist_head, tape); /* the tapelist is a TAILQ */
|
79 |
|
80 |
#endif
|
81 |
|