www.usr.com/support/gpl/USR9113_release1.0.tar.gz
[bcm963xx.git] / bcmdrivers / broadcom / include / bcm963xx / DiagDef.h
1 /*
2 <:copyright-broadcom 
3  
4  Copyright (c) 2002 Broadcom Corporation 
5  All Rights Reserved 
6  No portions of this material may be reproduced in any form without the 
7  written permission of: 
8           Broadcom Corporation 
9           16215 Alton Parkway 
10           Irvine, California 92619 
11  All information contained in this document is Broadcom Corporation 
12  company private, proprietary, and trade secret. 
13  
14 :>
15 */
16
17 /*******************************************************************
18  * DiagDef.h
19  *
20  *      Description:
21  *              Diag definitions
22  *
23  * $Revision: 1.23 $
24  *
25  * $Id: DiagDef.h,v 1.23 2005/07/14 23:43:20 ilyas Exp $
26  *
27  * $Log: DiagDef.h,v $
28  * Revision 1.23  2005/07/14 23:43:20  ilyas
29  * Added command to start data logging
30  *
31  * Revision 1.22  2004/10/16 23:43:19  ilyas
32  * Added playback resume command
33  *
34  * Revision 1.21  2004/10/16 23:24:08  ilyas
35  * Improved FileRead command support for LOG file playback (RecordTest on the board)
36  *
37  * Revision 1.20  2004/04/28 16:52:32  ilyas
38  * Added GDB frame processing
39  *
40  * Revision 1.19  2004/03/10 22:26:53  ilyas
41  * Added command-line parameter for IP port number.
42  * Added proxy remote termination
43  *
44  * Revision 1.18  2004/01/24 23:41:37  ilyas
45  * Added DIAG_DEBUG_CMD_LOG_SAMPLES debug command
46  *
47  * Revision 1.17  2003/11/19 02:25:45  ilyas
48  * Added definitions for LOG frame retransmission, time, ADSL2 plots
49  *
50  * Revision 1.16  2003/11/14 18:46:05  ilyas
51  * Added G992p3 debug commands
52  *
53  * Revision 1.15  2003/10/02 19:50:41  ilyas
54  * Added support for buffering data for AnnexI and statistical counters
55  *
56  * Revision 1.14  2003/09/03 19:45:11  ilyas
57  * To refuse connection with older protocol versions
58  *
59  * Revision 1.13  2003/08/30 00:12:39  ilyas
60  * Added support for running chip test regressions via DslDiags
61  *
62  * Revision 1.12  2003/08/12 00:19:28  ilyas
63  * Improved image downloading protocol.
64  * Added DEBUG command support
65  *
66  * Revision 1.11  2003/04/11 00:37:24  ilyas
67  * Added DiagProtoFrame definition
68  *
69  * Revision 1.10  2003/03/25 00:10:07  ilyas
70  * Added command for "long" BERT test
71  *
72  * Revision 1.9  2003/01/30 03:29:32  ilyas
73  * Added PHY_CFG support and fixed printing showtime counters
74  *
75  * Revision 1.8  2002/12/16 20:56:38  ilyas
76  * Added support for binary statuses
77  *
78  * Revision 1.7  2002/12/06 20:19:13  ilyas
79  * Added support for binary statuses and scrambled status strings
80  *
81  * Revision 1.6  2002/11/05 00:18:27  ilyas
82  * Added configuration dialog box for Eye tone selection.
83  * Added Centillium CRC workaround to AnnexC config dialog
84  * Bit allocation update on bit swap messages
85  *
86  * Revision 1.5  2002/07/30 23:23:43  ilyas
87  * Implemented DIAG configuration command for AnnexA and AnnexC
88  *
89  * Revision 1.4  2002/07/30 22:47:15  ilyas
90  * Added DIAG command for configuration
91  *
92  * Revision 1.3  2002/07/15 23:52:51  ilyas
93  * iAdded switch RJ11 pair command
94  *
95  * Revision 1.2  2002/04/25 17:55:51  ilyas
96  * Added mibGet command
97  *
98  * Revision 1.1  2002/04/02 22:56:39  ilyas
99  * Support DIAG connection at any time; BERT commands
100  *
101  *
102  ******************************************************************/
103
104 #define LOG_PROTO_ID                            "*L"
105
106 #define DIAG_PARTY_ID_MASK                      0x01
107 #define LOG_PARTY_CLIENT                        0x01
108 #define LOG_PARTY_SERVER                        0x00
109
110 #define DIAG_DATA_MASK                          0x0E
111 #define DIAG_DATA_LOG                           0x02
112 #define DIAG_DATA_EYE                           0x04
113 #define DIAG_DATA_LOG_TIME                      0x08
114 #define DIAG_DATA_GUI_ID                        0x10    
115
116 #define DIAG_DATA_EX                            0x80
117 #define DIAG_PARTY_ID_MASK_EX           (DIAG_DATA_EX | DIAG_PARTY_ID_MASK)
118 #define LOG_PARTY_SERVER_EX                     (DIAG_DATA_EX | LOG_PARTY_SERVER)
119
120 #define DIAG_ACK_FRAME_ACK_MASK         0x000000FF
121 #define DIAG_ACK_FRAME_RCV_SHIFT        8
122 #define DIAG_ACK_FRAME_RCV_MASK         0x0000FF00
123 #define DIAG_ACK_FRAME_RCV_PRESENT      0x00010000
124 #define DIAG_ACK_TIMEOUT                        -1
125 #define DIAG_ACK_LEN_INDICATION         -1
126 #define LOG_CMD_CFG_PHY2                        235
127 #define LOG_CMD_GDB                                     236
128 #define LOG_CMD_PROXY                           237
129 #define LOG_CMD_RETR                            238
130 #define LOG_CMD_DEBUG                           239
131 #define LOG_CMD_BERT_EX                         240
132 #define LOG_CMD_CFG_PHY                         241
133 #define LOG_CMD_RESET                           242
134 #define LOG_CMD_SCRAMBLED_STRING        243
135 #define LOG_CMD_EYE_CFG                         244
136 #define LOG_CMD_CONFIG_A                        245
137 #define LOG_CMD_CONFIG_C                        246
138 #define LOG_CMD_SWITCH_RJ11_PAIR        247
139 #define LOG_CMD_MIB_GET                         248
140 #define LOG_CMD_LOG_STOP                        249
141 #define LOG_CMD_PING_REQ                        250
142 #define LOG_CMD_PING_RSP                        251
143 #define LOG_CMD_DISCONNECT                      252
144 #define LOG_CMD_STRING_DATA                     253
145 #define LOG_CMD_TEST_DATA                       254
146 #define LOG_CMD_CONNECT                         255
147
148 typedef struct _LogProtoHeader {
149         unsigned char   logProtoId[2];
150         unsigned char   logPartyId;
151         unsigned char   logCommmand;
152 } LogProtoHeader;
153
154 #define LOG_FILE_PORT                   5100
155 #define LOG_FILE_PORT2                  5099
156 #define LOG_MAX_BUF_SIZE                1400
157 #define LOG_MAX_DATA_SIZE               (LOG_MAX_BUF_SIZE - sizeof(LogProtoHeader))
158
159 typedef struct {
160         LogProtoHeader  diagHdr;
161         unsigned char   diagData[LOG_MAX_DATA_SIZE];
162 } DiagProtoFrame;
163
164 #define DIAG_PROXY_TERMINATE                            1
165
166 #define DIAG_DEBUG_CMD_READ_MEM                         1
167 #define DIAG_DEBUG_CMD_SET_MEM                          2
168 #define DIAG_DEBUG_CMD_RESET_CONNECTION         3
169 #define DIAG_DEBUG_CMD_RESET_PHY                        4
170 #define DIAG_DEBUG_CMD_RESET_CHIP                       5
171 #define DIAG_DEBUG_CMD_EXEC_FUNC                        6
172 #define DIAG_DEBUG_CMD_EXEC_ADSL_FUNC           7
173 #define DIAG_DEBUG_CMD_WRITE_FILE                       8
174 #define DIAG_DEBUG_CMD_G992P3_DEBUG                     9
175 #define DIAG_DEBUG_CMD_G992P3_DIAG_MODE         10
176 #define DIAG_DEBUG_CMD_CLEAR_TIME                       11
177 #define DIAG_DEBUG_CMD_PRINT_TIME                       12
178 #define DIAG_DEBUG_CMD_LOG_SAMPLES                      13
179
180 #define DIAG_DEBUG_CMD_PLAYBACK_STOP            14
181 #define DIAG_DEBUG_CMD_PLAYBACK_RESUME          15
182
183 #define DIAG_DEBUG_CMD_LOG_DATA                         16
184 #define DIAG_DEBUG_CMD_CLEAREOC_LOOPBACK    17
185 #define DIAG_DEBUG_CMD_ANNEXM_CFG                       18
186
187 #define DIAG_DEBUG_CMD_PRINT_STAT                       21
188 #define DIAG_DEBUG_CMD_CLEAR_STAT                       22
189
190 typedef struct {
191         unsigned short  cmd;
192         unsigned short  cmdId;
193         unsigned long   param1;
194         unsigned long   param2;
195         unsigned char   diagData[1];
196 } DiagDebugData;
197
198 #define DIAG_TEST_CMD_LOAD                                      101
199 #define DIAG_TEST_CMD_READ                                      102
200 #define DIAG_TEST_CMD_WRITE                                     103
201 #define DIAG_TEST_CMD_APPEND                            104
202 #define DIAG_TEST_CMD_TEST_COMPLETE                     105
203
204 #define DIAG_TEST_FILENAME_LEN                          64
205
206 typedef struct {
207         unsigned short  cmd;
208         unsigned short  cmdId;
209         unsigned long   offset;
210         unsigned long   len;
211         unsigned long   bufPtr;
212         char                    fileName[DIAG_TEST_FILENAME_LEN];
213 } DiagTestData;
214
215 typedef struct {
216         unsigned long   frStart;
217         unsigned long   frNum;
218 } DiagLogRetrData;