3 /*==========================================================================
\r
5 Diagnostic Packet Definitions
\r
7 Description: Packet definitions between the diagnostic subsystem
\r
8 and the external device.
\r
10 !!! NOTE: All member structures of diag packets must be PACK.
\r
12 !!! WARNING: Each command code number is part of the externalized
\r
13 diagnostic command interface. This number *MUST* be assigned
\r
14 by a member of QCT's tools development team.
\r
16 Copyright (c) 2001-2010 by QUALCOMM, Incorporated. All Rights Reserved.
\r
17 ===========================================================================*/
\r
19 /*===========================================================================
\r
23 $Header: //source/qcom/qct/core/pkg/2H09/halcyon_modem/rel/LA2.0/AMSS/products/7x30/core/services/diag/LSM/common/src/diagdiag_v.h#1 $
\r
25 when who what, where, why
\r
26 -------- --- ----------------------------------------------------------
\r
27 07/10/10 vs Moved definitions of diagpeek/poke to public header
\r
28 04/20/10 is Remove support for DIAG_GET_PROPERTY_F, DIAG_PUT_PROPERTY_F,
\r
29 DIAG_GET_PERM_PROPERTY_F, and DIAG_PUT_PERM_PROPERTY_F.
\r
30 04/05/10 JV Added test cases for QSR messages in the stress test
\r
31 03/02/10 JV New command to enable/disable data aggregation
\r
32 02/25/10 JV New command to flush diagbuf.
\r
33 12/15/09 JV Mainlining code under the 'DEBUG_DIAG_TEST' feature
\r
34 12/07/09 cahn Added Delayed Response to DIAG Health.
\r
35 11/12/09 cahn Added variable length log types for DIAG stress test.
\r
36 11/04/09 cahn DIAG Health
\r
37 09/20/09 sg Added diagdiag_tbl_init prototype
\r
38 09/15/09 cahn Added loopback on individual processors.
\r
39 09/10/09 JV Added protptype for diagdiag_init().
\r
40 08/05/09 JV Removed the CUST_H featurization around the inclusion of
\r
42 07/31/09 JV Merged Q6 diag code back to mainline
\r
43 07/14/09 mad Featurized includion of customer.h and feature.h.
\r
44 Featured out FEATURE_QUERY pkt/response.
\r
45 06/11/09 JV Added command code for Q6 stress test
\r
46 05/07/09 vk moved declerations into diagdiag.h that were being referred from
\r
48 01/14/09 vg Fixed type added during the public and private headerfile
\r
50 10/03/08 vg Updated code to use PACK() vs. PACKED
\r
51 05/17/05 as Added Dual processor Diag support.
\r
52 06/15/04 gr Added support for getting and setting the event mask.
\r
53 05/18/04 as Removed support for DIAG_USER_CMD_F & DIAG_PERM_USER_CMD_F
\r
54 01/07/03 djm add RPC support for WCDMA_PLT
\r
55 08/20/02 lad Moved DIAG_DLOAD_F packet def to dloaddiag.h.
\r
56 Moved DIAG_SERIAL_CHG_F definition to diagcomm_sio.c.
\r
57 01/28/02 as Support for DIAG_LOG_ON_DEMAND_F (log on demand).
\r
58 09/18/01 jal Support for DIAG_CONTROL_F (mode reset/offline)
\r
59 08/20/01 jal Support for Diag packet: DIAG_TS_F (timestamp),
\r
60 DIAG_SPC_F (service programming code), DIAG_DLOAD_F
\r
61 (start downloader), DIAG_OUTP_F/DIAG_OUTPW_F (IO
\r
62 port byte/word output), DIAG_INP_F/DIAG_INPW_F (IO
\r
63 port byte/word input)
\r
64 06/27/01 lad Use of constants in message response packet.
\r
65 Added packet definition for DIAG_LOG_CONFIG_F. This
\r
66 replaces extended logmask processing.
\r
67 Cleaned up DIAG_STREAMING_CONFIG_F and added subcmd to
\r
69 04/06/01 lad Added packet definitions for the following:
\r
71 DIAG_STREAMING_CONFIG_F
\r
75 02/23/01 lad Created file.
\r
77 ===========================================================================*/
\r
81 #ifndef FEATURE_WINCE
\r
82 #include "customer.h"
\r
83 #include "feature.h"
\r
86 #include "diagcmd.h"
\r
87 #include "diagpkt.h"
\r
88 #include "log_codes.h"
\r
91 #include "diagdiag.h"
\r
94 /*===========================================================================
\r
96 PACKET DIAG_BAD_CMD_F
\r
101 DIAG_BAD_SPC_MODE_F
\r
103 PURPOSE Sent by DMSS when it detects an erroneous packet from DM. Errors
\r
104 include command code out of bounds, bad length... Includes the
\r
105 first DIAG_MAX_ERR bytes of the offending input packet.
\r
106 Also includes when an nv_read/write is attempted before the correct
\r
107 SPC has been entered.
\r
109 ============================================================================*/
\r
112 void diagdiag_init (void);
\r
113 void diagdiag_tbl_init (void);
\r
115 /* -------------------------------------------------------------------------
\r
116 ** Packet Definitions
\r
117 ** ------------------------------------------------------------------------- */
\r
118 #if defined(T_WINNT) || defined(FEATURE_WINCE)
\r
119 #error code not present
\r
122 /*==========================================================================
\r
126 PURPOSE RPC Processing Request
\r
128 ============================================================================*/
\r
129 DIAGPKT_REQ_DEFINE( DIAG_RPC_F )
\r
131 /* It's just the command code */
\r
135 DIAGPKT_DEFINE_RSP_AS_REQ( DIAG_RPC_F )
\r
137 /*===========================================================================
\r
139 PACKET DIAG_DIAG_VER_F
\r
140 PURPOSE Sent by DM to request the version of the diag
\r
142 ===========================================================================*/
\r
143 DIAGPKT_REQ_DEFINE(DIAG_DIAG_VER_F)
\r
146 DIAGPKT_RSP_DEFINE(DIAG_DIAG_VER_F)
\r
147 word ver; /* diag version */
\r
150 /*===========================================================================
\r
152 PACKET DIAG_PASSWORD_F
\r
153 PURPOSE Sent by external device to enter the Security Password,
\r
154 to then allow operations protected by security. This response
\r
155 indicates whether the correct Password was given or not.
\r
157 NOTE If the incorrect password is entered, DIAG will POWER DOWN
\r
160 ===========================================================================*/
\r
161 #define DIAG_PASSWORD_SIZE 8
\r
162 DIAGPKT_REQ_DEFINE(DIAG_PASSWORD_F)
\r
163 byte password[DIAG_PASSWORD_SIZE]; /* The security password */
\r
166 DIAGPKT_RSP_DEFINE(DIAG_PASSWORD_F)
\r
167 boolean password_ok; /* TRUE if Security Password entered correctly */
\r
170 /* Logging Services */
\r
172 /*===========================================================================
\r
174 PACKET DIAG_LOG_CONFIG_F
\r
175 PURPOSE Sent by the DM to set the equipment ID logging mask in the DMSS.
\r
176 This is necessary to use logging services with MS Equip ID != 1.
\r
178 !!!Note that the log mask is now sanely ordered LSB to MSB using little endian
\r
179 32-bit integer arrays. This is not the same way the mask was done in
\r
180 DIAG_EXT_LOGMASK_F.
\r
183 'equipment ID' - the 4-bit equipment identifier
\r
184 'item ID' - the 12-bit ID that specifies the log item within this equip ID
\r
185 'code' - the entire 16-bit log code (contains both equip and item ID)
\r
187 ===========================================================================*/
\r
189 LOG_CONFIG_DISABLE_OP = 0,
\r
190 LOG_CONFIG_RETRIEVE_ID_RANGES_OP = 1,
\r
191 LOG_CONFIG_RETRIEVE_VALID_MASK_OP = 2,
\r
192 LOG_CONFIG_SET_MASK_OP = 3,
\r
193 LOG_CONFIG_GET_LOGMASK_OP = 4
\r
194 } log_config_command_ops_enum_type;
\r
196 /* Logging config return status types.
\r
197 * (*) denotes applicable to all commands
\r
200 LOG_CONFIG_SUCCESS_S = 0, /* Operation Sucessful */
\r
201 LOG_CONFIG_INVALID_EQUIP_ID_S = 1, /* (*) Specified invalid equipment ID */
\r
202 LOG_CONFIG_NO_VALID_MASK_S = 2 /* Valid mask not available for this ID */
\r
203 } log_config_status_enum_type;
\r
205 /* Operation data */
\r
206 /* DISABLE OP: LOG_CONFIG_DISAPLE_OP -no no supporting data */
\r
208 /* These member structures are not packed intentionally. Each data member will
\r
209 * align on a 32-bit boundary.
\r
211 typedef PACK(struct) {
\r
216 } log_config_range_type;
\r
218 typedef PACK(struct) {
\r
219 log_config_range_type code_range; /* range of log codes */
\r
221 byte mask[1]; /* Array of 8 bit masks of size (num_bits + 7) / 8 */
\r
222 } log_config_mask_type;
\r
224 /* ID_RANGE_OP response type */
\r
225 typedef PACK(struct) {
\r
226 uint32 last_item[16]; /* The last item for each of the 16 equip IDs */
\r
227 } log_config_ranges_rsp_type;
\r
229 /* VALID_MASK_OP request type */
\r
230 typedef PACK(struct) {
\r
232 } log_config_valid_mask_req_type;
\r
234 /* VALID_MASK_OP response type */
\r
235 typedef log_config_mask_type log_config_valid_mask_rsp_type;
\r
237 /* SET_MASK_OP request type */
\r
238 typedef log_config_mask_type log_config_set_mask_req_type;
\r
240 /* GET_MASK_OP response type */
\r
241 typedef log_config_mask_type log_config_get_mask_rsp_type;
\r
243 /* SET_MASK_OP response type */
\r
244 typedef log_config_mask_type log_config_set_mask_rsp_type;
\r
246 /* This is not packed. We use uint32 which is always aligned */
\r
247 typedef PACK(union) {
\r
248 /* LOG_CONFIG_DISABLE_OP */
\r
249 /* no additional data */
\r
251 /* LOG_CONFIG_RETRIEVE_ID_RANGES_OP */
\r
252 /* no additional data */
\r
254 /* LOG_CONFIG_RETRIEVE_VALID_MASK_OP */
\r
255 log_config_valid_mask_req_type valid_mask;
\r
257 /* LOG_CONFIG_SET_MASK_OP */
\r
258 log_config_set_mask_req_type set_mask;
\r
260 /* LOG_CONFIG_GET_MASK_OP */
\r
261 /* no additional data */
\r
263 } log_config_op_req_type;
\r
265 typedef PACK(union) {
\r
266 /* LOG_CONFIG_DISABLE_OP */
\r
267 /* no additional data */
\r
269 /* LOG_CONFIG_RETRIEVE_ID_RANGES_OP */
\r
270 log_config_ranges_rsp_type ranges;
\r
272 /* LOG_CONFIG_RETRIEVE_VALID_MASK_OP */
\r
273 log_config_valid_mask_rsp_type valid_mask;
\r
275 /* LOG_CONFIG_SET_MASK_OP */
\r
276 log_config_set_mask_rsp_type set_mask;
\r
278 /* LOG_CONFIG_GET_MASK_OP */
\r
279 log_config_get_mask_rsp_type get_mask;
\r
281 } log_config_op_rsp_type;
\r
284 DIAGPKT_REQ_DEFINE(DIAG_LOG_CONFIG_F)
\r
286 byte pad[3]; /* Force following items to be on 32-bit boundary */
\r
288 uint32 operation; /* See log_config_command_ops_enum_type */
\r
290 uint32 op_data[1]; /* Pointer to operation data */
\r
294 DIAGPKT_RSP_DEFINE(DIAG_LOG_CONFIG_F)
\r
296 byte pad[3]; /* Force following items to be on 32-bit boundary */
\r
298 uint32 operation; /* See log_config_command_ops_enum_type */
\r
302 uint32 op_data[1]; /* Pointer to operation data */
\r
307 /* Number of bits in a log mask.
\r
309 #define DIAG_EXT_LOGMASK_NUM_BITS (LOG_1X_LAST_C & 0x0FFF)
\r
311 /* Max # of bytes in a valid log mask.
\r
313 #define DIAG_EXT_LOGMASK_NUM_BYTES ((DIAG_EXT_LOGMASK_NUM_BITS / 8) + 1)
\r
315 /*===========================================================================
\r
317 PACKET DIAG_EXT_LOGMASK_F
\r
318 PURPOSE Sent by the DM to set the logging mask in the DMSS. This is
\r
319 necessary for logmasks > 32 bits.
\r
321 ===========================================================================*/
\r
322 DIAGPKT_REQ_DEFINE(DIAG_EXT_LOGMASK_F)
\r
323 word num_bits; /* Number of valid bits */
\r
324 byte mask[DIAG_EXT_LOGMASK_NUM_BYTES]; /* mask to use */
\r
327 DIAGPKT_RSP_DEFINE(DIAG_EXT_LOGMASK_F)
\r
328 word num_valid_bits; /* Number of valid bits */
\r
329 byte valid_mask[DIAG_EXT_LOGMASK_NUM_BYTES]; /* mask of valid log codes */
\r
332 /*===========================================================================
\r
335 PURPOSE Encapsulates a log record.
\r
337 ===========================================================================*/
\r
342 uint8 more; /* Indicates how many log entries, not including the one
\r
343 returned with this packet, are queued up in the Mobile
\r
344 Station. If DIAG_DIAGVER >= 8, this should be set to 0 */
\r
345 uint16 len; /* Indicates the length, in bytes, of the following log entry */
\r
346 uint8 log[1]; /* Contains the log entry data. */
\r
351 /* -------------------------------------------------------------------------
\r
352 ** Legacy (but still supported) packet definitions for logging services.
\r
353 ** ------------------------------------------------------------------------- */
\r
354 /*===========================================================================
\r
356 PACKET DIAG_LOGMASK_F
\r
357 PURPOSE Sent by the DM to set the 32-bit logging mask in the DMSS.
\r
358 Note: this is the legacy logging mask format.
\r
360 ===========================================================================*/
\r
361 DIAGPKT_REQ_DEFINE(DIAG_LOGMASK_F)
\r
362 uint32 mask; /* 32-bit log mask */
\r
365 DIAGPKT_RSP_DEFINE(DIAG_LOGMASK_F)
\r
368 #ifndef FEATURE_WINCE
\r
369 /*===========================================================================
\r
371 PACKET DIAG_FEATURE_QUERY_F
\r
372 PURPOSE Sent by external device to query the phone for a bit mask detailing
\r
373 which phone features are turned on.
\r
375 ===========================================================================*/
\r
376 DIAGPKT_REQ_DEFINE(DIAG_FEATURE_QUERY_F)
\r
379 DIAGPKT_RSP_DEFINE(DIAG_FEATURE_QUERY_F)
\r
380 word feature_mask_size; /* Size of the following Mask */
\r
381 byte feature_mask[FEATURE_MASK_LENGTH]; /* Space for the largest possible
\r
386 /*===========================================================================
\r
388 PACKET DIAG_EVENT_REPORT_F
\r
389 PURPOSE Sent by the DM to configure static event reporting in the DMSS.
\r
391 ===========================================================================*/
\r
392 /*--------------------------------------
\r
393 Special bit flags in the event ID.
\r
394 --------------------------------------*/
\r
395 #define EVENT_PAY_LENGTH 0x3
\r
396 #define EVENT_PAY_TWO_BYTE 0x2
\r
397 #define EVENT_PAY_ONE_BYTE 0x1
\r
398 #define EVENT_PAY_NONE 0x0
\r
400 /* Bitfields may not be ANSI, but all our compilers
\r
401 ** recognize it and *should* optimize it.
\r
402 ** Not that bit-packed structures are only as long as they need to be.
\r
403 ** Even though we call it uint32, it is a 16 bit structure.
\r
408 uint16 reserved : 1;
\r
409 uint16 payload_len : 2; /* payload length (0, 1, 2, see payload) */
\r
410 uint16 time_trunc_flag : 1;
\r
413 typedef PACK(struct)
\r
415 uint16 id; /* event_id_type id; */
\r
420 /* Used in lieu of event_type if 'time_trunc_flag' is set in event_id_type */
\r
421 typedef PACK(struct)
\r
423 uint16 id; /* event_id_type id; */
\r
425 } event_trunc_type;
\r
427 /* The event payload follows the event_type structure */
\r
431 uint8 payload[1]; /* 'length' bytes */
\r
432 } event_payload_type;
\r
434 typedef PACK(struct)
\r
436 uint16 id; /* event_id_type id; */
\r
446 } event_drop_trunc_type;
\r
452 // uint16 watermark; /* Maximum size (in bytes) of a event report */
\r
453 // uint16 stale_timer; /* Time (in ms) to allow event buffer to accumulate */
\r
455 } event_cfg_req_type;
\r
457 typedef PACK(struct)
\r
462 } event_cfg_rsp_type;
\r
464 typedef PACK(struct)
\r
467 uint16 length; /* Number of bytes to follow */
\r
468 uint8 events[1]; /* Series of 'event_type' structures, 'length' bytes long */
\r
471 /*===========================================================================
\r
473 PACKET DIAG_STREAMING_CONFIG_F
\r
474 PURPOSE Sent by the DM to configure and tweak streaming diag output services.
\r
476 ===========================================================================*/
\r
478 DIAG_READ_NICE_C = 0, /* Read "Nice" values for LOG and MSG services */
\r
479 DIAG_WRITE_NICE_C = 1, /* Write "Nice" values for LOG and MSG services */
\r
480 DIAG_READ_PRI_C = 2, /* Read "priority" values for LOG and MSG services */
\r
481 DIAG_WRITE_PRI_C = 3, /* Write "priority" values for LOG and MSG services */
\r
482 DIAG_BUF_SIZE_C = 4 /* Return size (in bytes) of output buffer */
\r
484 } diag_streaming_config_subcommand_enum_type;
\r
486 typedef PACK(struct) {
\r
487 uint16 code; /* MSG_LVL value or Log code */
\r
491 } diagpkt_streaming_config_entry_type;
\r
493 typedef PACK(struct) {
\r
495 /* Number of entries in the following array */
\r
498 /* # of log codes + 5 Message Levels is the number max $ in this array */
\r
499 diagpkt_streaming_config_entry_type entry[1];
\r
501 } diagpkt_streaming_config_entry_list_type;
\r
504 /*==========================================================================
\r
508 PURPOSE Sent from the DM to the DMSS to request the IS-95/IS-2000 time.
\r
510 ============================================================================*/
\r
511 DIAGPKT_REQ_DEFINE(DIAG_TS_F)
\r
513 /* It's just the command code */
\r
517 DIAGPKT_RSP_DEFINE(DIAG_TS_F)
\r
519 qword ts; /* Time Stamp */
\r
523 #ifdef FEATURE_TECHNICS_DIAG
\r
524 /*===========================================================================
\r
526 PACKET diag_encrypt_test_req_type
\r
528 ID DIAG_ENCRYPT_TEST_F
\r
530 PURPOSE Sent by DM to cause a keypress input to the handset interface.
\r
532 RESPONSE Diag queues a keypress to hsi and echos the request packet.
\r
534 ===========================================================================*/
\r
535 DIAGPKT_REQ_DEFINE( DIAG_ENCRYPT_TEST_F )
\r
542 DIAGPKT_DEFINE_RSP_AS_REQ( DIAG_ENCRYPT_TEST_F )
\r
544 /*===========================================================================
\r
546 PACKET diag_manufacture_test_req_type
\r
548 ID DIAG_MANUFACTURE_TEST_F
\r
550 PURPOSE Sent by DM to cause a keypress input to the handset interface.
\r
552 RESPONSE Diag queues a keypress to hsi and echos the request packet.
\r
554 ===========================================================================*/
\r
555 DIAGPKT_REQ_DEFINE( DIAG_MANUFACTURE_TEST_F )
\r
562 DIAGPKT_DEFINE_RSP_AS_REQ( DIAG_MANUFACTURE_TEST_F )
\r
564 /*===========================================================================
\r
566 PACKET diag_manufacture_test_req_type
\r
568 ID DIAG_FACTORY_TEST_F
\r
570 PURPOSE Sent by DM to cause a keypress input to the handset interface.
\r
572 RESPONSE Diag queues a keypress to hsi and echos the request packet.
\r
574 ===========================================================================*/
\r
575 DIAGPKT_REQ_DEFINE( DIAG_FACTORY_TEST_F )
\r
582 DIAGPKT_DEFINE_RSP_AS_REQ( DIAG_FACTORY_TEST_F )
\r
585 /*==========================================================================
\r
589 PURPOSE Request sent from the DM to the DMSS to send a byte to an
\r
592 ============================================================================*/
\r
593 DIAGPKT_REQ_DEFINE( DIAG_OUTP_F )
\r
595 word port; /* number of port to output to */
\r
596 byte data; /* data to write to port */
\r
600 DIAGPKT_DEFINE_RSP_AS_REQ( DIAG_OUTP_F )
\r
603 /*==========================================================================
\r
605 PACKET DIAG_OUTPW_F
\r
607 PURPOSE Request sent from the DM to the DMSS to send a 16-bit word to an
\r
610 ============================================================================*/
\r
611 DIAGPKT_REQ_DEFINE( DIAG_OUTPW_F )
\r
613 word port; /* number of port to output to */
\r
614 word data; /* data to write to port */
\r
618 DIAGPKT_DEFINE_RSP_AS_REQ( DIAG_OUTPW_F )
\r
622 /*==========================================================================
\r
626 PURPOSE Request sent from the DM to the DMSS to read a byte to an
\r
629 ============================================================================*/
\r
630 DIAGPKT_REQ_DEFINE( DIAG_INP_F )
\r
632 word port; /* number of port to output to */
\r
636 DIAGPKT_RSP_DEFINE( DIAG_INP_F )
\r
638 word port; /* number of port to output to */
\r
639 byte data; /* data to write to port */
\r
644 /*==========================================================================
\r
648 PURPOSE Request sent from the DM to the DMSS to read a 16-bit word from an
\r
651 ============================================================================*/
\r
652 DIAGPKT_REQ_DEFINE( DIAG_INPW_F )
\r
654 word port; /* number of port to output to */
\r
658 DIAGPKT_RSP_DEFINE( DIAG_INPW_F )
\r
660 word port; /* number of port to output to */
\r
661 word data; /* data to write to port */
\r
667 /*==========================================================================
\r
669 PACKET DIAG_LOG_ON_DEMAND_F
\r
671 PURPOSE Request sent from the user to register a function pointer and
\r
672 log_code with the diagnostic service for every log that needs
\r
673 logging on demand support.
\r
675 ============================================================================*/
\r
676 DIAGPKT_REQ_DEFINE( DIAG_LOG_ON_DEMAND_F )
\r
678 uint16 log_code; /* The log_code to be sent */
\r
683 DIAGPKT_RSP_DEFINE( DIAG_LOG_ON_DEMAND_F )
\r
685 uint16 log_code; /* The log_code sent */
\r
686 uint8 status; /* status returned from the function pointer */
\r
690 /* Diagnostic extensions */
\r
692 ** The maximum number of properties and callback functions. These are not
\r
693 ** used to determine the size of any data structure; they are used merely
\r
694 ** to guard against infinite loops caused by corruption of the callback
\r
695 ** and properties tables.
\r
697 #define DIAG_MAX_NUM_PROPS 20
\r
698 #define DIAG_MAX_NUM_FUNCS 20
\r
700 typedef void (*diag_cb_func_type) (
\r
701 unsigned char *data_ptr,
\r
702 unsigned short data_len,
\r
703 unsigned char *rsp_ptr,
\r
704 unsigned short *rsp_len_ptr
\r
710 diag_cb_func_type address;
\r
711 } diag_cb_struct_type;
\r
717 } diag_prop_struct_type;
\r
721 DIAG_EXTN_INVALID_GUID = 1,
\r
722 DIAG_EXTN_INVALID_SIZE,
\r
723 DIAG_EXTN_INVALID_ADDRESS,
\r
724 DIAG_EXTN_INVALID_NAME,
\r
725 DIAG_EXTN_INVALID_DATA
\r
726 } diag_extn_err_type;
\r
728 /* Need to use PACKED not PACK() */
\r
729 PACKED typedef unsigned long diag_guid_type[ 4 ];
\r
731 /*===========================================================================
\r
733 PACKET DIAG_GET_GUID_F
\r
735 PURPOSE Sent by the DM to retrieve the GUID (globally unique identifier)
\r
736 for the current build. This is stored during the build process.
\r
738 ===========================================================================*/
\r
739 DIAGPKT_REQ_DEFINE(DIAG_GET_GUID_F)
\r
742 DIAGPKT_RSP_DEFINE(DIAG_GET_GUID_F)
\r
743 diag_guid_type guid; /* Globally unique identifier */
\r
746 #define DIAG_MAX_PROPERTY_NAME_SIZE 40
\r
748 // Required DIAG Health Definitions
\r
749 #define MAX_VALUE_UINT32 4294967295UL // Overflow
\r
750 #define DIAGBUF_ALLOC_REQUEST_OTHER 0x0
\r
751 #define DIAGBUF_ALLOC_REQUEST_LOG 0x1
\r
752 #define DIAGBUF_ALLOC_REQUEST_MSG 0x2
\r
753 #define DIAGBUF_ALLOC_REQUEST_DELAY 0x3
\r
756 /*--------------------------------------------------------------------------
\r
757 Command Codes between the Diagnostic Monitor and the mobile. These command
\r
758 codes are used for stress testing.
\r
759 ----------------------------------------------------------------------------*/
\r
761 #define DIAGDIAG_START_STRESS_TEST_MODEM_F 0x0000
\r
762 #define DIAGDIAG_CMD_REQUEST_F 0x0001
\r
763 #define DIAGDIAG_ADD_EVENT_LISTENER_F 0x0002
\r
764 #define DIAGDIAG_REMOVE_EVENT_LISTENER_F 0x0003
\r
765 #define DIAGDIAG_ADD_LOG_LISTENER_F 0x0004
\r
766 #define DIAGDIAG_REMOVE_LOG_LISTENER_F 0x0005
\r
767 #define DIAGDIAG_START_STRESS_TEST_APPS_F 0x0006
\r
768 #define DIAGDIAG_START_STRESS_TEST_QDSP_F 0x0007
\r
769 // Processor Loopback Command Codes
\r
770 #define DIAGDIAG_STRESS_TEST_SUBSYS_LOOPBACK_APP 0x0028 /* 40 */
\r
771 #define DIAGDIAG_STRESS_TEST_SUBSYS_LOOPBACK_MODEM 0x0029 /* 41 */
\r
772 #define DIAGDIAG_STRESS_TEST_SUBSYS_LOOPBACK_Q6 0x002A /* 42 */
\r
773 // DIAG Health on APPs
\r
774 #define DIAGDIAG_RESET_DROP_COUNT_LOG_APP 0x002B /* 43 */
\r
775 #define DIAGDIAG_GET_DROP_COUNT_LOG_APP 0x002C /* 44 */
\r
776 #define DIAGDIAG_RESET_DROP_COUNT_EVENT_APP 0x002D /* 45 */
\r
777 #define DIAGDIAG_GET_DROP_COUNT_EVENT_APP 0x002E /* 46 */
\r
778 #define DIAGDIAG_RESET_DROP_COUNT_F3_APP 0x002F /* 47 */
\r
779 #define DIAGDIAG_GET_DROP_COUNT_F3_APP 0x0030 /* 48 */
\r
780 #define DIAGDIAG_GET_ALLOC_COUNT_LOG_APP 0x0031 /* 49 */
\r
781 #define DIAGDIAG_GET_ALLOC_COUNT_EVENT_APP 0x0032 /* 50 */
\r
782 #define DIAGDIAG_GET_ALLOC_COUNT_F3_APP 0x0033 /* 51 */
\r
783 #define DIAGDIAG_RESET_DROP_COUNT_DELAY_APP 0x0046 /* 70 */
\r
784 #define DIAGDIAG_GET_DROP_COUNT_DELAY_APP 0x0047 /* 71 */
\r
785 #define DIAGDIAG_GET_ALLOC_COUNT_DELAY_APP 0x0048 /* 72 */
\r
786 // DIAG Health on MODEM
\r
787 #define DIAGDIAG_RESET_DROP_COUNT_LOG_MODEM 0x0034 /* 52 */
\r
788 #define DIAGDIAG_GET_DROP_COUNT_LOG_MODEM 0x0035 /* 53 */
\r
789 #define DIAGDIAG_RESET_DROP_COUNT_EVENT_MODEM 0x0036 /* 54 */
\r
790 #define DIAGDIAG_GET_DROP_COUNT_EVENT_MODEM 0x0037 /* 55 */
\r
791 #define DIAGDIAG_RESET_DROP_COUNT_F3_MODEM 0x0038 /* 56 */
\r
792 #define DIAGDIAG_GET_DROP_COUNT_F3_MODEM 0x0039 /* 57 */
\r
793 #define DIAGDIAG_GET_ALLOC_COUNT_LOG_MODEM 0x003A /* 58 */
\r
794 #define DIAGDIAG_GET_ALLOC_COUNT_EVENT_MODEM 0x003B /* 59 */
\r
795 #define DIAGDIAG_GET_ALLOC_COUNT_F3_MODEM 0x003C /* 60 */
\r
796 #define DIAGDIAG_RESET_DROP_COUNT_DELAY_MODEM 0x0050 /* 80 */
\r
797 #define DIAGDIAG_GET_DROP_COUNT_DELAY_MODEM 0x0051 /* 81 */
\r
798 #define DIAGDIAG_GET_ALLOC_COUNT_DELAY_MODEM 0x0052 /* 82 */
\r
799 // DIAG Health on QDSP6
\r
800 #define DIAGDIAG_RESET_DROP_COUNT_LOG_Q6 0x003D /* 61 */
\r
801 #define DIAGDIAG_GET_DROP_COUNT_LOG_Q6 0x003E /* 62 */
\r
802 #define DIAGDIAG_RESET_DROP_COUNT_EVENT_Q6 0x003F /* 63 */
\r
803 #define DIAGDIAG_GET_DROP_COUNT_EVENT_Q6 0x0040 /* 64 */
\r
804 #define DIAGDIAG_RESET_DROP_COUNT_F3_Q6 0x0041 /* 65 */
\r
805 #define DIAGDIAG_GET_DROP_COUNT_F3_Q6 0x0042 /* 66 */
\r
806 #define DIAGDIAG_GET_ALLOC_COUNT_LOG_Q6 0x0043 /* 67 */
\r
807 #define DIAGDIAG_GET_ALLOC_COUNT_EVENT_Q6 0x0044 /* 68 */
\r
808 #define DIAGDIAG_GET_ALLOC_COUNT_F3_Q6 0x0045 /* 69 */
\r
809 #define DIAGDIAG_RESET_DROP_COUNT_DELAY_Q6 0x005A /* 90 */
\r
810 #define DIAGDIAG_GET_DROP_COUNT_DELAY_Q6 0x005B /* 91 */
\r
811 #define DIAGDIAG_GET_ALLOC_COUNT_DELAY_Q6 0x005C /* 92 */
\r
813 #define DIAG_FLUSH_BUFFER 0x005D /* 93 */
\r
814 #define DIAG_CHANGE_THRESHOLD 0x005E /* 94 */
\r
815 /* NOTE: Subsystem command codes 100-102 are used for the user-level app */
\r
817 /*==========================================================================
\r
819 PACKET DIAGDIAG_STRESS_TEST
\r
821 PURPOSE Request sent from the DM to the DMSS to stress test events.
\r
823 ============================================================================*/
\r
825 DIAGDIAG_STRESS_TEST_MSG = 0,
\r
826 DIAGDIAG_STRESS_TEST_MSG_1 = 1,
\r
827 DIAGDIAG_STRESS_TEST_MSG_2 = 2,
\r
828 DIAGDIAG_STRESS_TEST_MSG_3 = 3,
\r
829 DIAGDIAG_STRESS_TEST_MSG_4 = 4,
\r
830 DIAGDIAG_STRESS_TEST_MSG_5 = 5,
\r
831 DIAGDIAG_STRESS_TEST_MSG_6 = 6,
\r
832 DIAGDIAG_STRESS_TEST_MSG_STR = 7,
\r
833 DIAGDIAG_STRESS_TEST_MSG_PSEUDO_RANDOM = 8,
\r
834 DIAGDIAG_STRESS_TEST_MSG_LOW = 9,
\r
835 DIAGDIAG_STRESS_TEST_MSG_MED = 10,
\r
836 DIAGDIAG_STRESS_TEST_MSG_HIGH = 11,
\r
837 DIAGDIAG_STRESS_TEST_MSG_ERROR = 12,
\r
838 DIAGDIAG_STRESS_TEST_MSG_FATAL = 13,
\r
839 DIAGDIAG_STRESS_TEST_ERR = 14,
\r
840 DIAGDIAG_STRESS_TEST_ERR_FATAL = 15,
\r
841 DIAGDIAG_STRESS_TEST_LOG = 16,
\r
842 DIAGDIAG_STRESS_TEST_EVENT_NO_PAYLOAD = 17,
\r
843 DIAGDIAG_STRESS_TEST_EVENT_WITH_PAYLOAD = 18,
\r
844 DIAGDIAG_STRESS_TEST_ERR_FATAL_ISR = 19, /* test panic mode from ISR */
\r
845 DIAGDIAG_STRESS_TEST_CMD_REQ = 20,
\r
846 /* Reserved space up to 39 */
\r
847 DIAGDIAG_STRESS_TEST_LOG_64 = 40,
\r
848 DIAGDIAG_STRESS_TEST_LOG_128 = 41,
\r
849 DIAGDIAG_STRESS_TEST_LOG_256 = 42,
\r
850 /* Log of 512 is test type 16 */
\r
851 DIAGDIAG_STRESS_TEST_LOG_1K = 43,
\r
852 DIAGDIAG_STRESS_TEST_LOG_2K = 44,
\r
853 DIAGDIAG_STRESS_TEST_LOG_4K = 45,
\r
854 DIAGDIAG_STRESS_TEST_LOG_6K = 46,
\r
855 /* Test cases for QSR messages */
\r
856 DIAGDIAG_STRESS_TEST_QSR_MSG = 47,
\r
857 DIAGDIAG_STRESS_TEST_QSR_MSG_1 = 48,
\r
858 DIAGDIAG_STRESS_TEST_QSR_MSG_2 = 49,
\r
859 DIAGDIAG_STRESS_TEST_QSR_MSG_3 = 50,
\r
860 DIAGDIAG_STRESS_TEST_QSR_MSG_4 = 51,
\r
861 DIAGDIAG_STRESS_TEST_QSR_MSG_5 = 52,
\r
862 DIAGDIAG_STRESS_TEST_QSR_MSG_6 = 53,
\r
863 DIAGDIAG_STRESS_TEST_QSR_MSG_LOW = 54,
\r
864 DIAGDIAG_STRESS_TEST_QSR_MSG_MED = 55,
\r
865 DIAGDIAG_STRESS_TEST_QSR_MSG_HIGH = 56,
\r
866 DIAGDIAG_STRESS_TEST_QSR_MSG_ERROR = 57,
\r
867 DIAGDIAG_STRESS_TEST_QSR_MSG_FATAL = 58,
\r
869 } diag_stress_test_type_enum_type;
\r
872 EXPLICIT_PRI = 0, /* Priority given by the user */
\r
873 RELATIVE_PRI = 1 /* relative priority is relative to DIAG_PRI */
\r
874 } diag_stress_pri_type_enum_type;
\r
877 uint8 test_type; /* Decides if it is log, msg or event*/
\r
878 uint8 pri_type; /* External or relative priority */
\r
879 int16 pri; /* Priority at which the task is created */
\r
880 } diag_task_priority_type;
\r
883 diag_task_priority_type priority; /* refer to diag_task_priority_type above*/
\r
884 int num_iterations; /* the number of times the test_type should be called */
\r
885 int sleep_duration; /* Sleep time in milliseconds */
\r
886 int num_iterations_before_sleep; /*After NUM_ITERATIONS_BEFORE_SLEEP iterations, sleep */
\r
887 } diag_per_task_test_info;
\r
890 diagpkt_subsys_header_type header; /* Sub System header */
\r
891 int num_tasks; /* Number of tasks, to be started */
\r
892 diag_per_task_test_info test[1]; /* Place holder for per task info */
\r
893 } DIAGDIAG_STRESS_TEST_req_type;
\r
895 typedef DIAGDIAG_STRESS_TEST_req_type DIAGDIAG_STRESS_TEST_rsp_type;
\r
898 uint16 pri_type; /* External or relative priority */
\r
899 int16 pri; /* Priority at which the task is created */
\r
900 } diag_priority_type;
\r
903 /*==========================================================================
\r
905 PACKET DIAGDIAG_CMD_REQUEST
\r
907 PURPOSE Request sent from the DM to the DMSS to test command request.
\r
908 ============================================================================*/
\r
911 diagpkt_subsys_header_type header; /* Sub System header */
\r
912 uint32 length; /* length of the packet */
\r
913 diag_priority_type priority;
\r
914 byte req[64]; /* Packet sent */
\r
915 } diagdiag_cmd_req_type;
\r
917 typedef diagdiag_cmd_req_type diagdiag_cmd_rsp_type;
\r
920 /*==========================================================================
\r
922 PACKET DIAGDIAG_LOG_EVENT_LISTENER
\r
924 PURPOSE Request sent from the DM to the DMSS to test log and event listeners.
\r
925 This type is used for adding and removing log and event listeners.
\r
926 ============================================================================*/
\r
929 diagpkt_subsys_header_type header; /* Sub System header */
\r
931 uint32 id; /* log code or event id */
\r
932 uint32 param; /* Will be printed by debug message */
\r
933 } diag_log_event_listener_req_type;
\r
935 typedef diag_log_event_listener_req_type diag_log_event_listener_rsp_type;
\r
937 /* Functions required for DIAG Health */
\r
938 void diagbuf_reset_drop_count_log( void );
\r
939 uint32 diagbuf_get_drop_count_log( void );
\r
940 void event_reset_drop_count_event( void );
\r
941 uint32 event_get_drop_count_event( void );
\r
942 void diagbuf_reset_drop_count_f3( void );
\r
943 uint32 diagbuf_get_drop_count_f3( void );
\r
944 uint32 diagbuf_get_alloc_count_log( void );
\r
945 uint32 event_get_alloc_count_event( void );
\r
946 uint32 diagbuf_get_alloc_count_f3( void );
\r
947 void diagbuf_reset_drop_count_delay( void );
\r
948 uint32 diagbuf_get_drop_count_delay( void );
\r
949 uint32 diagbuf_get_alloc_count_delay( void );
\r
952 /* Structures required for DIAG Health */
\r
954 diagpkt_subsys_header_type header;
\r
955 uint32 drop_count; // Also used for alloc_count
\r
956 } diag_health_response_type;
\r
959 /*==========================================================================
\r
961 PACKET DIAG_EVENT_MASK_GET_F
\r
963 PURPOSE Request sent from the DM to the DMSS to retrieve the event mask.
\r
964 ============================================================================*/
\r
967 diagpkt_header_type header;
\r
970 } event_mask_get_req_type;
\r
973 diagpkt_header_type header;
\r
976 uint16 numbits; /* number of bits in the mask */
\r
977 unsigned char mask[1]; /* size of this field = (numbits + 7)/8 */
\r
978 } event_mask_get_rsp_type;
\r
980 /*==========================================================================
\r
982 PACKET DIAG_EVENT_MASK_SET_F
\r
984 PURPOSE Request sent from the DM to the DMSS to set the event mask.
\r
985 ============================================================================*/
\r
988 diagpkt_header_type header;
\r
991 uint16 numbits; /* number of bits in the mask */
\r
992 unsigned char mask[1]; /* size of this field = (numbits + 7)/8 */
\r
993 } event_mask_set_req_type;
\r
996 diagpkt_header_type header;
\r
999 uint16 numbits; /* number of bits in the mask */
\r
1000 unsigned char mask[1]; /* size of this field = (numbits + 7)/8 */
\r
1001 } event_mask_set_rsp_type;
\r
1005 diagpkt_subsys_header_type header;
\r
1006 uint8 enable_aggregation;
\r
1009 } diagdiag_change_threshold_req_type;
\r
1014 diagpkt_subsys_header_type header;
\r
1015 } diagdiag_change_threshold_rsp_type;
\r
1017 /* Error codes for the above two packets.
\r
1019 #define EVENT_MASK_GENERAL_FAILURE 1
\r
1020 #define EVENT_MASK_ARRAY_TOO_SMALL 2
\r
1021 #define EVENT_MASK_ARRAY_TOO_BIG 3
\r
1023 #if defined(T_WINNT) || defined(FEATURE_WINCE)
\r
1024 #error code not present
\r
1027 extern osal_mutex_arg_t diagdiag_memop_tbl_mutex;
\r
1029 #endif /*DIAGDIAG_V_H*/
\r