ibmhawkreg.h revision 1.1.4.2 1 1.1.4.2 rmind /* $NetBSD: ibmhawkreg.h,v 1.1.4.2 2011/03/05 20:53:10 rmind Exp $ */
2 1.1.4.2 rmind
3 1.1.4.2 rmind /*-
4 1.1.4.2 rmind * Copyright (c) 2011 The NetBSD Foundation, Inc.
5 1.1.4.2 rmind * All rights reserved.
6 1.1.4.2 rmind *
7 1.1.4.2 rmind * This code is derived from software contributed to The NetBSD Foundation
8 1.1.4.2 rmind * by Juergen Hannken-Illjes.
9 1.1.4.2 rmind *
10 1.1.4.2 rmind * Redistribution and use in source and binary forms, with or without
11 1.1.4.2 rmind * modification, are permitted provided that the following conditions
12 1.1.4.2 rmind * are met:
13 1.1.4.2 rmind * 1. Redistributions of source code must retain the above copyright
14 1.1.4.2 rmind * notice, this list of conditions and the following disclaimer.
15 1.1.4.2 rmind * 2. Redistributions in binary form must reproduce the above copyright
16 1.1.4.2 rmind * notice, this list of conditions and the following disclaimer in the
17 1.1.4.2 rmind * documentation and/or other materials provided with the distribution.
18 1.1.4.2 rmind *
19 1.1.4.2 rmind * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 1.1.4.2 rmind * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 1.1.4.2 rmind * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 1.1.4.2 rmind * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 1.1.4.2 rmind * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 1.1.4.2 rmind * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 1.1.4.2 rmind * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 1.1.4.2 rmind * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 1.1.4.2 rmind * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 1.1.4.2 rmind * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.1.4.2 rmind * POSSIBILITY OF SUCH DAMAGE.
30 1.1.4.2 rmind */
31 1.1.4.2 rmind
32 1.1.4.2 rmind #define IBMHAWK_MAX_CPU 2
33 1.1.4.2 rmind #define IBMHAWK_MAX_VOLTAGE 7
34 1.1.4.2 rmind #define IBMHAWK_MAX_FAN 6
35 1.1.4.2 rmind
36 1.1.4.2 rmind typedef union ibmhawk_response {
37 1.1.4.2 rmind struct {
38 1.1.4.2 rmind uint8_t unknown1;
39 1.1.4.2 rmind uint8_t numcpus;
40 1.1.4.2 rmind uint8_t unknown2[5];
41 1.1.4.2 rmind uint8_t numfans;
42 1.1.4.2 rmind } resp_equip;
43 1.1.4.2 rmind #define IHR_EQUIP 0x51
44 1.1.4.2 rmind #define ihr_numcpus resp_equip.numcpus
45 1.1.4.2 rmind #define ihr_numfans resp_equip.numfans
46 1.1.4.2 rmind struct {
47 1.1.4.2 rmind uint8_t unknown[4];
48 1.1.4.2 rmind uint16_t rpm[IBMHAWK_MAX_FAN];
49 1.1.4.2 rmind } resp_fan;
50 1.1.4.2 rmind #define IHR_FANRPM 0xa2
51 1.1.4.2 rmind #define ihr_fanrpm resp_fan.rpm
52 1.1.4.2 rmind struct {
53 1.1.4.2 rmind char name[16];
54 1.1.4.2 rmind } resp_name;
55 1.1.4.2 rmind #define IHR_NAME 0x14
56 1.1.4.2 rmind #define ihr_name resp_name.name
57 1.1.4.2 rmind struct {
58 1.1.4.2 rmind uint8_t unknown1[4];
59 1.1.4.2 rmind uint8_t ambient;
60 1.1.4.2 rmind uint8_t cpu[IBMHAWK_MAX_CPU];
61 1.1.4.2 rmind uint8_t unknown2[2];
62 1.1.4.2 rmind } resp_temp;
63 1.1.4.2 rmind #define IHR_TEMP 0xa4
64 1.1.4.2 rmind #define ihr_t_ambient resp_temp.ambient
65 1.1.4.2 rmind #define ihr_t_cpu resp_temp.cpu
66 1.1.4.2 rmind struct {
67 1.1.4.2 rmind uint8_t warn_reset;
68 1.1.4.2 rmind uint8_t warn;
69 1.1.4.2 rmind uint8_t soft;
70 1.1.4.2 rmind uint8_t hard;
71 1.1.4.2 rmind } resp_temp_thresh;
72 1.1.4.2 rmind #define IHR_TEMP_THR 0xe0
73 1.1.4.2 rmind #define ihr_t_warn_thr resp_temp_thresh.warn
74 1.1.4.2 rmind #define ihr_t_soft_thr resp_temp_thresh.soft
75 1.1.4.2 rmind struct {
76 1.1.4.2 rmind uint8_t unknown[2];
77 1.1.4.2 rmind uint16_t voltage[IBMHAWK_MAX_VOLTAGE];
78 1.1.4.2 rmind } resp_volt;
79 1.1.4.2 rmind #define IHR_VOLT 0xa6
80 1.1.4.2 rmind #define ihr_v_voltage resp_volt.voltage
81 1.1.4.2 rmind struct {
82 1.1.4.2 rmind uint16_t voltage[IBMHAWK_MAX_VOLTAGE*2];
83 1.1.4.2 rmind } resp_volt_thresh;
84 1.1.4.2 rmind #define IHR_VOLT_THR 0xea
85 1.1.4.2 rmind #define ihr_v_voltage_thr resp_volt_thresh.voltage
86 1.1.4.2 rmind } ibmhawk_response_t __packed;
87