Initial import from FreeBSD RELENG_4:
[games.git] / sys / net / i4b / layer1 / ihfc / i4b_ihfc_drv.h
1 /*
2  * Copyright (c) 2000 Hans Petter Selasky. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23  * SUCH DAMAGE.
24  *
25  *---------------------------------------------------------------------------
26  *
27  *      i4b_ihfc_drv.h - include file for the HFC-1/S/SP driver
28  *      -------------------------------------------------------
29  *
30  *      last edit-date: [Wed Jul 19 09:40:55 2000]
31  *
32  *      $Id: i4b_ihfc_drv.h,v 1.7 2000/09/19 13:50:36 hm Exp $
33  *
34  * $FreeBSD: src/sys/i4b/layer1/ihfc/i4b_ihfc_drv.h,v 1.1.2.1 2001/08/10 14:08:37 obrien Exp $
35  *
36  *---------------------------------------------------------------------------*/
37 #ifndef I4B_IHFC_DRV_H_
38 #define I4B_IHFC_DRV_H_
39
40 /*---------------------------------------------------------------------------*
41  *      Ramptables related fifo                                 (HFC-1/S/SP)
42  *
43  *      The HFC-SP chip only uses ihfc_xxx[2] values for D-channel!
44  *      NOTE: These tables are not used anymore.
45  *---------------------------------------------------------------------------*
46  * 
47  *             w - write, r - read:   D1_w  D1_r  B1_w  B1_r  B2_w  B2_r
48  * const u_char ihfc_readtable[6]  = {0xa6, 0xa7, 0xbc, 0xbd, 0xbe, 0xbf};
49  * const u_char ihfc_writetable[6] = {0x96, 0x97, 0xac, 0xad, 0xae, 0xaf};
50  * const u_char ihfc_f1inctable[6] = {0x92, 0x93, 0xa8, 0xa9, 0xaa, 0xab};      
51  * const u_char ihfc_f2inctable[6] = {0xa2, 0xa3, 0xb8, 0xb9, 0xba, 0xbb};
52  * 
53  * const        struct { u_char z1L, z1H, z2L, z2H, f1, f2, dummy; } 
54  *      ihfc_countertable[6] = {
55  *      {0x90, 0x94, 0x98, 0x9c, 0x9a, 0x9e, 0x00},     D1_w
56  *      {0x91, 0x95, 0x99, 0x9d, 0x9b, 0x9f, 0x00},     D1_r
57  *      {0x80, 0x84, 0x88, 0x8c, 0xb0, 0xb4, 0x00},     B1_w
58  *      {0x81, 0x85, 0x89, 0x8d, 0xb1, 0xb5, 0x00},     B1_r
59  *      {0x82, 0x86, 0x8a, 0x8e, 0xb2, 0xb6, 0x00},     B2_w
60  *      {0x83, 0x87, 0x8b, 0x8f, 0xb3, 0xb7, 0x00}      B2_r
61  *      };
62  *---------------------------------------------------------------------------*/
63
64 /*---------------------------------------------------------------------------*
65  *      Ramptables related to configuration                     (HFC-1/S/SP)
66  *
67  *      NOTE: Write registers only
68  *---------------------------------------------------------------------------*/
69 const u_char ihfc_configtable[11] =
70 {
71         0x18, 0x19, 0x1a,       /* cirm, ctmt, int_m1           */
72         0x1b, 0x2e, 0x37,       /* int_m2, mst_mode, clkdel     */
73         0x31, 0x2f, 0x32,       /* sctrl, connect, test/sctrl_e */
74         0x33, 0x00              /* sctrl_r                      */
75 };
76 const u_char isac_configtable[9] =
77 {
78         0x39, 0x30, 0x3b,       /* adf2, spcr, sqxr     */
79         0x38, 0x37, 0x22,       /* adf1, stcr, mode     */
80         0x20, 0x2b, 0x00        /* mask, star2          */
81 };
82
83 /*---------------------------------------------------------------------------*
84  *      Ramptables related to statemachine                      (HFC-1/S/SP)
85  *
86  * state:
87  *      0 = deactivated
88  *      1 = pending
89  *      2 = syncronized
90  *      3 = activated
91  *      4 = error
92  *      5 = reset
93  *     -1 = illegal
94  *---------------------------------------------------------------------------*/
95
96 const struct ihfc_FSMtable { u_char state, *string; } 
97
98         ihfc_TEtable[16] =      /* HFC-S/SP     - TE */
99 {
100         { 0x05 ,"Reset"                                 },
101         { 0xff , 0                                      },
102         { 0x01 ,"Sensing"                               },
103         { 0x00 ,"Deactivated"                           },
104         { 0x01 ,"Awaiting signal"                       },
105         { 0x01 ,"Identifying input"                     },
106         { 0x02 ,"Syncronized"                           },
107         { 0x03 ,"Activated"                             },
108         { 0x04 ,"Lost framing"                          },
109         { 0xff , 0                                      },
110         { 0xff , 0                                      },
111         { 0xff , 0                                      },
112         { 0xff , 0                                      },
113         { 0xff , 0                                      },
114         { 0xff , 0                                      },
115         { 0xff , 0                                      }
116 }, 
117         ihfc_NTtable[16] =      /* HFC-S/SP     - NT */
118 {
119         { 0x05 ,"Reset"                                 },
120         { 0x00 ,"Deactive"                              },
121         { 0x02 ,"Pending activation"                    },
122         { 0x03 ,"Active"                                },
123         { 0x01 ,"Pending deactivation"                  },
124         { 0xff , 0                                      },
125         { 0xff , 0                                      },
126         { 0xff , 0                                      },
127         { 0xff , 0                                      },
128         { 0xff , 0                                      },
129         { 0xff , 0                                      },
130         { 0xff , 0                                      },
131         { 0xff , 0                                      },
132         { 0xff , 0                                      },
133         { 0xff , 0                                      },
134         { 0xff , 0                                      }
135 },
136         ihfc_TEtable2[16] =     /* HFC-1/ISAC   - TE */
137 {
138         { 0x00 ,"Deactivate request"                    },
139         { 0xff , 0                                      },
140         { 0xff , 0                                      },
141         { 0xff , 0                                      },
142         { 0x01 ,"Level detected"                        },
143         { 0xff , 0                                      },
144         { 0x04 ,"Error indication"                      },
145         { 0x00 ,"Power-up"                              },
146         { 0x02 ,"Activate request downstream"           },
147         { 0xff , 0                                      },
148         { 0x00 ,"Test indication"                       },
149         { 0x00 ,"Awake test indication"                 },
150         { 0x03 ,"Activate ind. with priority class 8"   },
151         { 0x03 ,"Activate ind. with priority class 10"  },
152         { 0xff , 0                                      },
153         { 0x00 ,"Deactivate indication downstream"      }
154 };
155
156 /*---------------------------------------------------------------------------*
157  *      Ramptable related to ISAC EXIR                          (HFC-1)
158  *
159  *      cmd: command to execute, if any.
160  *
161  *---------------------------------------------------------------------------*/
162 const struct ihfc_EXIRtable { u_char cmd, *string; }
163
164         ihfc_EXIRtable[8] =
165 {
166         { 0x00 ,"Watchdog Timer Overflow"               },
167         { 0x00 ,"Subscriber Awake"                      },
168         { 0x00 ,"Monitor Status"                        },
169         { 0x00 ,"Rx Sync Xfer Overflow"                 },
170         { 0xc0 ,"Rx Frame Overflow"                     }, /* RMC + RRES */
171         { 0x00 ,"Protocol Error"                        },
172         { 0x01 ,"Tx Data Underrun"                      }, /* XRES */
173         { 0x01 ,"Tx Message Repeat"                     }, /* XRES */
174 };
175
176 /*---------------------------------------------------------------------------*
177  *      Ramptables related to S/Q - channel                     (HFC-1/S/SP)
178  *
179  *      From TE's viewpoint:
180  *      Q: commands to NT
181  *      S: indications from NT
182  *
183  *      From NT's viewpoint:
184  *      Q: indications from TE
185  *      S: commands to TE
186  *      
187  *      cmd: not used
188  *---------------------------------------------------------------------------*/
189 const struct ihfc_SQtable { u_char cmd, *string; }
190
191         ihfc_Qtable[16] =
192 {
193         { 0x00, "Loss of Power indication"              },
194         { 0x00, "ST request"                            },
195         { 0x00, 0                                       },
196         { 0x00, "LoopBack request (B1/B2)"              },
197         { 0x00, 0                                       },
198         { 0x00, 0                                       },
199         { 0x00, 0                                       },
200         { 0x00, "LoopBack request (B1)"                 },
201         { 0x00, 0                                       },
202         { 0x00, 0                                       },
203         { 0x00, 0                                       },
204         { 0x00, "LoopBack request (B2)"                 },
205         { 0x00, "V-DCE slave mode"                      },
206         { 0x00, "V-DTE slave mode"                      },
207         { 0x00, 0                                       },
208         { 0x00, "Idle"                                  }
209 },
210         ihfc_Stable[16] =
211 {
212         { 0x00, "Idle"                                  },
213         { 0x00, "ST Fail"                               },
214         { 0x00, "ST Pass"                               },
215         { 0x00, "Disruptive Operation Indication"       },
216         { 0x00, "DTSE-OUT"                              },
217         { 0x00, "V-DCE master mode"                     },
218         { 0x00, "ST Indication"                         },
219         { 0x00, "DTSE-IN"                               },
220         { 0x00, "LoopBack indication (B1/B2)"           },
221         { 0x00, "Loss of Received Signal indication"    },
222         { 0x00, "LoopBack indication (B2)"              },
223         { 0x00, "DTSE-IN and OUT"                       },
224         { 0x00, "LoopBack indication (B1)"              },
225         { 0x00, "Loss of power indication"              }
226 };
227
228
229 #endif /* I4B_IHFC_DRV_H_ */
230