# BRCM_VERSION=3
[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.2 $
24  *
25  * $Id: DiagDef.h,v 1.2 2005/04/29 06:59:26 echo Exp $
26  *
27  * $Log: DiagDef.h,v $
28  * Revision 1.2  2005/04/29 06:59:26  echo
29  * *** empty log message ***
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
115 #define DIAG_DATA_EX                            0x80
116 #define DIAG_PARTY_ID_MASK_EX           (DIAG_DATA_EX | DIAG_PARTY_ID_MASK)
117 #define LOG_PARTY_SERVER_EX                     (DIAG_DATA_EX | LOG_PARTY_SERVER)
118
119 #define DIAG_ACK_FRAME_ACK_MASK         0x000000FF
120 #define DIAG_ACK_FRAME_RCV_SHIFT        8
121 #define DIAG_ACK_FRAME_RCV_MASK         0x0000FF00
122 #define DIAG_ACK_FRAME_RCV_PRESENT      0x00010000
123 #define DIAG_ACK_TIMEOUT                        -1
124 #define DIAG_ACK_LEN_INDICATION         -1
125
126 #define LOG_CMD_GDB                                     236
127 #define LOG_CMD_PROXY                           237
128 #define LOG_CMD_RETR                            238
129 #define LOG_CMD_DEBUG                           239
130 #define LOG_CMD_BERT_EX                         240
131 #define LOG_CMD_CFG_PHY                         241
132 #define LOG_CMD_RESET                           242
133 #define LOG_CMD_SCRAMBLED_STRING        243
134 #define LOG_CMD_EYE_CFG                         244
135 #define LOG_CMD_CONFIG_A                        245
136 #define LOG_CMD_CONFIG_C                        246
137 #define LOG_CMD_SWITCH_RJ11_PAIR        247
138 #define LOG_CMD_MIB_GET                         248
139 #define LOG_CMD_LOG_STOP                        249
140 #define LOG_CMD_PING_REQ                        250
141 #define LOG_CMD_PING_RSP                        251
142 #define LOG_CMD_DISCONNECT                      252
143 #define LOG_CMD_STRING_DATA                     253
144 #define LOG_CMD_TEST_DATA                       254
145 #define LOG_CMD_CONNECT                         255
146
147 typedef struct _LogProtoHeader {
148         unsigned char   logProtoId[2];
149         unsigned char   logPartyId;
150         unsigned char   logCommmand;
151 } LogProtoHeader;
152
153 #define LOG_FILE_PORT                   5100
154 #define LOG_MAX_BUF_SIZE                1400
155 #define LOG_MAX_DATA_SIZE               (LOG_MAX_BUF_SIZE - sizeof(LogProtoHeader))
156
157 typedef struct {
158         LogProtoHeader  diagHdr;
159         unsigned char   diagData[LOG_MAX_DATA_SIZE];
160 } DiagProtoFrame;
161
162 #define DIAG_PROXY_TERMINATE                            1
163
164 #define DIAG_DEBUG_CMD_READ_MEM                         1
165 #define DIAG_DEBUG_CMD_SET_MEM                          2
166 #define DIAG_DEBUG_CMD_RESET_CONNECTION         3
167 #define DIAG_DEBUG_CMD_RESET_PHY                        4
168 #define DIAG_DEBUG_CMD_RESET_CHIP                       5
169 #define DIAG_DEBUG_CMD_EXEC_FUNC                        6
170 #define DIAG_DEBUG_CMD_EXEC_ADSL_FUNC           7
171 #define DIAG_DEBUG_CMD_WRITE_FILE                       8
172 #define DIAG_DEBUG_CMD_G992P3_DEBUG                     9
173 #define DIAG_DEBUG_CMD_G992P3_DIAG_MODE         10
174 #define DIAG_DEBUG_CMD_CLEAR_TIME                       11
175 #define DIAG_DEBUG_CMD_PRINT_TIME                       12
176 #define DIAG_DEBUG_CMD_LOG_SAMPLES                      13
177
178 #define DIAG_DEBUG_CMD_PLAYBACK_STOP            14
179 #define DIAG_DEBUG_CMD_PLAYBACK_RESUME          15
180
181 #define DIAG_DEBUG_CMD_PRINT_STAT                       21
182 #define DIAG_DEBUG_CMD_CLEAR_STAT                       22
183
184 typedef struct {
185         unsigned short  cmd;
186         unsigned short  cmdId;
187         unsigned long   param1;
188         unsigned long   param2;
189         unsigned char   diagData[1];
190 } DiagDebugData;
191
192 #define DIAG_TEST_CMD_LOAD                                      101
193 #define DIAG_TEST_CMD_READ                                      102
194 #define DIAG_TEST_CMD_WRITE                                     103
195 #define DIAG_TEST_CMD_APPEND                            104
196 #define DIAG_TEST_CMD_TEST_COMPLETE                     105
197
198 #define DIAG_TEST_FILENAME_LEN                          64
199
200 typedef struct {
201         unsigned short  cmd;
202         unsigned short  cmdId;
203         unsigned long   offset;
204         unsigned long   len;
205         unsigned long   bufPtr;
206         char                    fileName[DIAG_TEST_FILENAME_LEN];
207 } DiagTestData;
208
209 typedef struct {
210         unsigned long   frStart;
211         unsigned long   frNum;
212 } DiagLogRetrData;