diff options
Diffstat (limited to 'drivers/net/sk98lin/h/ski2c.h')
-rw-r--r-- | drivers/net/sk98lin/h/ski2c.h | 174 |
1 files changed, 0 insertions, 174 deletions
diff --git a/drivers/net/sk98lin/h/ski2c.h b/drivers/net/sk98lin/h/ski2c.h deleted file mode 100644 index 6a63f4a15de6..000000000000 --- a/drivers/net/sk98lin/h/ski2c.h +++ /dev/null | |||
@@ -1,174 +0,0 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * Name: ski2c.h | ||
4 | * Project: Gigabit Ethernet Adapters, TWSI-Module | ||
5 | * Version: $Revision: 1.35 $ | ||
6 | * Date: $Date: 2003/10/20 09:06:30 $ | ||
7 | * Purpose: Defines to access Voltage and Temperature Sensor | ||
8 | * | ||
9 | ******************************************************************************/ | ||
10 | |||
11 | /****************************************************************************** | ||
12 | * | ||
13 | * (C)Copyright 1998-2002 SysKonnect. | ||
14 | * (C)Copyright 2002-2003 Marvell. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or modify | ||
17 | * it under the terms of the GNU General Public License as published by | ||
18 | * the Free Software Foundation; either version 2 of the License, or | ||
19 | * (at your option) any later version. | ||
20 | * | ||
21 | * The information in this file is provided "AS IS" without warranty. | ||
22 | * | ||
23 | ******************************************************************************/ | ||
24 | |||
25 | /* | ||
26 | * SKI2C.H contains all I2C specific defines | ||
27 | */ | ||
28 | |||
29 | #ifndef _SKI2C_H_ | ||
30 | #define _SKI2C_H_ | ||
31 | |||
32 | typedef struct s_Sensor SK_SENSOR; | ||
33 | |||
34 | #include "h/skgei2c.h" | ||
35 | |||
36 | /* | ||
37 | * Define the I2C events. | ||
38 | */ | ||
39 | #define SK_I2CEV_IRQ 1 /* IRQ happened Event */ | ||
40 | #define SK_I2CEV_TIM 2 /* Timeout event */ | ||
41 | #define SK_I2CEV_CLEAR 3 /* Clear MIB Values */ | ||
42 | |||
43 | /* | ||
44 | * Define READ and WRITE Constants. | ||
45 | */ | ||
46 | #define I2C_READ 0 | ||
47 | #define I2C_WRITE 1 | ||
48 | #define I2C_BURST 1 | ||
49 | #define I2C_SINGLE 0 | ||
50 | |||
51 | #define SKERR_I2C_E001 (SK_ERRBASE_I2C+0) | ||
52 | #define SKERR_I2C_E001MSG "Sensor index unknown" | ||
53 | #define SKERR_I2C_E002 (SKERR_I2C_E001+1) | ||
54 | #define SKERR_I2C_E002MSG "TWSI: transfer does not complete" | ||
55 | #define SKERR_I2C_E003 (SKERR_I2C_E002+1) | ||
56 | #define SKERR_I2C_E003MSG "LM80: NAK on device send" | ||
57 | #define SKERR_I2C_E004 (SKERR_I2C_E003+1) | ||
58 | #define SKERR_I2C_E004MSG "LM80: NAK on register send" | ||
59 | #define SKERR_I2C_E005 (SKERR_I2C_E004+1) | ||
60 | #define SKERR_I2C_E005MSG "LM80: NAK on device (2) send" | ||
61 | #define SKERR_I2C_E006 (SKERR_I2C_E005+1) | ||
62 | #define SKERR_I2C_E006MSG "Unknown event" | ||
63 | #define SKERR_I2C_E007 (SKERR_I2C_E006+1) | ||
64 | #define SKERR_I2C_E007MSG "LM80 read out of state" | ||
65 | #define SKERR_I2C_E008 (SKERR_I2C_E007+1) | ||
66 | #define SKERR_I2C_E008MSG "Unexpected sensor read completed" | ||
67 | #define SKERR_I2C_E009 (SKERR_I2C_E008+1) | ||
68 | #define SKERR_I2C_E009MSG "WARNING: temperature sensor out of range" | ||
69 | #define SKERR_I2C_E010 (SKERR_I2C_E009+1) | ||
70 | #define SKERR_I2C_E010MSG "WARNING: voltage sensor out of range" | ||
71 | #define SKERR_I2C_E011 (SKERR_I2C_E010+1) | ||
72 | #define SKERR_I2C_E011MSG "ERROR: temperature sensor out of range" | ||
73 | #define SKERR_I2C_E012 (SKERR_I2C_E011+1) | ||
74 | #define SKERR_I2C_E012MSG "ERROR: voltage sensor out of range" | ||
75 | #define SKERR_I2C_E013 (SKERR_I2C_E012+1) | ||
76 | #define SKERR_I2C_E013MSG "ERROR: couldn't init sensor" | ||
77 | #define SKERR_I2C_E014 (SKERR_I2C_E013+1) | ||
78 | #define SKERR_I2C_E014MSG "WARNING: fan sensor out of range" | ||
79 | #define SKERR_I2C_E015 (SKERR_I2C_E014+1) | ||
80 | #define SKERR_I2C_E015MSG "ERROR: fan sensor out of range" | ||
81 | #define SKERR_I2C_E016 (SKERR_I2C_E015+1) | ||
82 | #define SKERR_I2C_E016MSG "TWSI: active transfer does not complete" | ||
83 | |||
84 | /* | ||
85 | * Define Timeout values | ||
86 | */ | ||
87 | #define SK_I2C_TIM_LONG 2000000L /* 2 seconds */ | ||
88 | #define SK_I2C_TIM_SHORT 100000L /* 100 milliseconds */ | ||
89 | #define SK_I2C_TIM_WATCH 1000000L /* 1 second */ | ||
90 | |||
91 | /* | ||
92 | * Define trap and error log hold times | ||
93 | */ | ||
94 | #ifndef SK_SEN_ERR_TR_HOLD | ||
95 | #define SK_SEN_ERR_TR_HOLD (4*SK_TICKS_PER_SEC) | ||
96 | #endif | ||
97 | #ifndef SK_SEN_ERR_LOG_HOLD | ||
98 | #define SK_SEN_ERR_LOG_HOLD (60*SK_TICKS_PER_SEC) | ||
99 | #endif | ||
100 | #ifndef SK_SEN_WARN_TR_HOLD | ||
101 | #define SK_SEN_WARN_TR_HOLD (15*SK_TICKS_PER_SEC) | ||
102 | #endif | ||
103 | #ifndef SK_SEN_WARN_LOG_HOLD | ||
104 | #define SK_SEN_WARN_LOG_HOLD (15*60*SK_TICKS_PER_SEC) | ||
105 | #endif | ||
106 | |||
107 | /* | ||
108 | * Defines for SenType | ||
109 | */ | ||
110 | #define SK_SEN_UNKNOWN 0 | ||
111 | #define SK_SEN_TEMP 1 | ||
112 | #define SK_SEN_VOLT 2 | ||
113 | #define SK_SEN_FAN 3 | ||
114 | |||
115 | /* | ||
116 | * Define for the SenErrorFlag | ||
117 | */ | ||
118 | #define SK_SEN_ERR_NOT_PRESENT 0 /* Error Flag: Sensor not present */ | ||
119 | #define SK_SEN_ERR_OK 1 /* Error Flag: O.K. */ | ||
120 | #define SK_SEN_ERR_WARN 2 /* Error Flag: Warning */ | ||
121 | #define SK_SEN_ERR_ERR 3 /* Error Flag: Error */ | ||
122 | #define SK_SEN_ERR_FAULTY 4 /* Error Flag: Faulty */ | ||
123 | |||
124 | /* | ||
125 | * Define the Sensor struct | ||
126 | */ | ||
127 | struct s_Sensor { | ||
128 | char *SenDesc; /* Description */ | ||
129 | int SenType; /* Voltage or Temperature */ | ||
130 | SK_I32 SenValue; /* Current value of the sensor */ | ||
131 | SK_I32 SenThreErrHigh; /* High error Threshhold of this sensor */ | ||
132 | SK_I32 SenThreWarnHigh; /* High warning Threshhold of this sensor */ | ||
133 | SK_I32 SenThreErrLow; /* Lower error Threshold of the sensor */ | ||
134 | SK_I32 SenThreWarnLow; /* Lower warning Threshold of the sensor */ | ||
135 | int SenErrFlag; /* Sensor indicated an error */ | ||
136 | SK_BOOL SenInit; /* Is sensor initialized ? */ | ||
137 | SK_U64 SenErrCts; /* Error trap counter */ | ||
138 | SK_U64 SenWarnCts; /* Warning trap counter */ | ||
139 | SK_U64 SenBegErrTS; /* Begin error timestamp */ | ||
140 | SK_U64 SenBegWarnTS; /* Begin warning timestamp */ | ||
141 | SK_U64 SenLastErrTrapTS; /* Last error trap timestamp */ | ||
142 | SK_U64 SenLastErrLogTS; /* Last error log timestamp */ | ||
143 | SK_U64 SenLastWarnTrapTS; /* Last warning trap timestamp */ | ||
144 | SK_U64 SenLastWarnLogTS; /* Last warning log timestamp */ | ||
145 | int SenState; /* Sensor State (see HW specific include) */ | ||
146 | int (*SenRead)(SK_AC *pAC, SK_IOC IoC, struct s_Sensor *pSen); | ||
147 | /* Sensors read function */ | ||
148 | SK_U16 SenReg; /* Register Address for this sensor */ | ||
149 | SK_U8 SenDev; /* Device Selection for this sensor */ | ||
150 | }; | ||
151 | |||
152 | typedef struct s_I2c { | ||
153 | SK_SENSOR SenTable[SK_MAX_SENSORS]; /* Sensor Table */ | ||
154 | int CurrSens; /* Which sensor is currently queried */ | ||
155 | int MaxSens; /* Max. number of sensors */ | ||
156 | int TimerMode; /* Use the timer also to watch the state machine */ | ||
157 | int InitLevel; /* Initialized Level */ | ||
158 | #ifndef SK_DIAG | ||
159 | int DummyReads; /* Number of non-checked dummy reads */ | ||
160 | SK_TIMER SenTimer; /* Sensors timer */ | ||
161 | #endif /* !SK_DIAG */ | ||
162 | } SK_I2C; | ||
163 | |||
164 | extern int SkI2cInit(SK_AC *pAC, SK_IOC IoC, int Level); | ||
165 | #ifdef SK_DIAG | ||
166 | extern SK_U32 SkI2cRead(SK_AC *pAC, SK_IOC IoC, int Dev, int Size, int Reg, | ||
167 | int Burst); | ||
168 | #else /* !SK_DIAG */ | ||
169 | extern int SkI2cEvent(SK_AC *pAC, SK_IOC IoC, SK_U32 Event, SK_EVPARA Para); | ||
170 | extern void SkI2cWaitIrq(SK_AC *pAC, SK_IOC IoC); | ||
171 | extern void SkI2cIsr(SK_AC *pAC, SK_IOC IoC); | ||
172 | #endif /* !SK_DIAG */ | ||
173 | #endif /* n_SKI2C_H */ | ||
174 | |||