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