📄 diagdiag.h
字号:
/* LOG_CONFIG_RETRIEVE_ID_RANGES_OP */
/* no additional data */
/* LOG_CONFIG_RETRIEVE_VALID_MASK_OP */
log_config_valid_mask_req_type valid_mask;
/* LOG_CONFIG_SET_MASK_OP */
log_config_set_mask_req_type set_mask;
/* LOG_CONFIG_GET_MASK_OP */
/* no additional data */
} log_config_op_req_type;
typedef PACKED union {
/* LOG_CONFIG_DISABLE_OP */
/* no additional data */
/* LOG_CONFIG_RETRIEVE_ID_RANGES_OP */
log_config_ranges_rsp_type ranges;
/* LOG_CONFIG_RETRIEVE_VALID_MASK_OP */
log_config_valid_mask_rsp_type valid_mask;
/* LOG_CONFIG_SET_MASK_OP */
log_config_set_mask_rsp_type set_mask;
/* LOG_CONFIG_GET_MASK_OP */
log_config_get_mask_rsp_type get_mask;
} log_config_op_rsp_type;
DIAGPKT_REQ_DEFINE(DIAG_LOG_CONFIG_F)
byte pad[3]; /* Force following items to be on 32-bit boundary */
uint32 operation; /* See log_config_command_ops_enum_type */
uint32 op_data[1]; /* Pointer to operation data */
DIAGPKT_REQ_END
DIAGPKT_RSP_DEFINE(DIAG_LOG_CONFIG_F)
byte pad[3]; /* Force following items to be on 32-bit boundary */
uint32 operation; /* See log_config_command_ops_enum_type */
uint32 status;
uint32 op_data[1]; /* Pointer to operation data */
DIAGPKT_RSP_END
/* Number of bits in a log mask.
*/
#define DIAG_EXT_LOGMASK_NUM_BITS (LOG_1X_LAST_C & 0x0FFF)
/* Max # of bytes in a valid log mask.
*/
#define DIAG_EXT_LOGMASK_NUM_BYTES ((DIAG_EXT_LOGMASK_NUM_BITS / 8) + 1)
/*===========================================================================
PACKET DIAG_EXT_LOGMASK_F
PURPOSE Sent by the DM to set the logging mask in the DMSS. This is
necessary for logmasks > 32 bits.
===========================================================================*/
DIAGPKT_REQ_DEFINE(DIAG_EXT_LOGMASK_F)
word num_bits; /* Number of valid bits */
byte mask[DIAG_EXT_LOGMASK_NUM_BYTES]; /* mask to use */
DIAGPKT_REQ_END
DIAGPKT_RSP_DEFINE(DIAG_EXT_LOGMASK_F)
word num_valid_bits; /* Number of valid bits */
byte valid_mask[DIAG_EXT_LOGMASK_NUM_BYTES]; /* mask of valid log codes */
DIAGPKT_RSP_END
/*===========================================================================
PACKET DIAG_LOG_F
PURPOSE Encapsulates a log record.
===========================================================================*/
typedef struct
{
uint8 cmd_code;
uint8 more; /* Indicates how many log entries, not including the one
returned with this packet, are queued up in the Mobile
Station. If DIAG_DIAGVER >= 8, this should be set to 0 */
uint16 len; /* Indicates the length, in bytes, of the following log entry */
uint8 log[1]; /* Contains the log entry data. */
}
diag_log_rsp_type;
/* -------------------------------------------------------------------------
** Legacy (but still supported) packet definitions for logging services.
** ------------------------------------------------------------------------- */
/*===========================================================================
PACKET DIAG_LOGMASK_F
PURPOSE Sent by the DM to set the 32-bit logging mask in the DMSS.
Note: this is the legacy logging mask format.
===========================================================================*/
DIAGPKT_REQ_DEFINE(DIAG_LOGMASK_F)
uint32 mask; /* 32-bit log mask */
DIAGPKT_REQ_END
DIAGPKT_RSP_DEFINE(DIAG_LOGMASK_F)
DIAGPKT_RSP_END
/*===========================================================================
PACKET DIAG_SUBSYS_CMD_F
PURPOSE This is a wrapper command to dispatch diag commands to various
subsystems in the DMSS. This allows new diag commands to be
developed in those subsystems without requiring a change to diag
code.
The use of this command allows subsystems to manage their own
diagnostics content.
===========================================================================*/
DIAGPKT_REQ_DEFINE(DIAG_SUBSYS_CMD_F)
uint8 subsys_id;
uint16 subsys_cmd_code;
uint8 pkt[1]; /* The subsystem's request. Variable length. */
DIAGPKT_REQ_END
DIAGPKT_RSP_DEFINE(DIAG_SUBSYS_CMD_F)
uint8 subsys_id;
uint16 subsys_cmd_code;
uint8 pkt[1]; /* The subsystem's response. Variable length. */
DIAGPKT_RSP_END
/*===========================================================================
PACKET DIAG_FEATURE_QUERY_F
PURPOSE Sent by external device to query the phone for a bit mask detailing
which phone features are turned on.
===========================================================================*/
DIAGPKT_REQ_DEFINE(DIAG_FEATURE_QUERY_F)
DIAGPKT_REQ_END
DIAGPKT_RSP_DEFINE(DIAG_FEATURE_QUERY_F)
word feature_mask_size; /* Size of the following Mask */
byte feature_mask[FEATURE_MASK_LENGTH]; /* Space for the largest possible
feature mask */
DIAGPKT_RSP_END
/*===========================================================================
PACKET DIAG_EVENT_REPORT_F
PURPOSE Sent by the DM to configure static event reporting in the DMSS.
===========================================================================*/
/*--------------------------------------
Special bit flags in the event ID.
--------------------------------------*/
#define EVENT_PAY_LENGTH 0x3
#define EVENT_PAY_TWO_BYTE 0x2
#define EVENT_PAY_ONE_BYTE 0x1
#define EVENT_PAY_NONE 0x0
/* Bitfields may not be ANSI, but all our compilers
** recognize it and *should* optimize it.
** Not that bit-packed structures are only as long as they need to be.
** Even though we call it uint32, it is a 16 bit structure.
*/
typedef struct
{
uint16 id : 12;
uint16 reserved : 1;
uint16 payload_len : 2; /* payload length (0, 1, 2, see payload) */
uint16 time_trunc_flag : 1;
} event_id_type;
typedef PACKED struct
{
uint16 id; /* event_id_type id; */
qword ts;
} event_type;
/* Used in lieu of event_type if 'time_trunc_flag' is set in event_id_type */
typedef PACKED struct
{
uint16 id; /* event_id_type id; */
uint16 trunc_ts;
} event_trunc_type;
/* The event payload follows the event_type structure */
typedef struct
{
uint8 length;
uint8 payload[1]; /* 'length' bytes */
} event_payload_type;
typedef PACKED struct
{
uint16 id; /* event_id_type id; */
qword ts;
uint32 drop_cnt;
} event_drop_type;
typedef struct
{
event_id_type id;
uint16 ts;
uint32 drop_cnt;
} event_drop_trunc_type;
typedef struct
{
uint8 cmd_code;
uint8 enable;
// uint16 watermark; /* Maximum size (in bytes) of a event report */
// uint16 stale_timer; /* Time (in ms) to allow event buffer to accumulate */
} event_cfg_req_type;
typedef PACKED struct
{
uint8 cmd_code;
uint16 length;
} event_cfg_rsp_type;
typedef PACKED struct
{
uint8 cmd_code;
uint16 length; /* Number of bytes to follow */
uint8 events[1]; /* Series of 'event_type' structures, 'length' bytes long */
} event_rpt_type;
/*===========================================================================
PACKET DIAG_STREAMING_CONFIG_F
PURPOSE Sent by the DM to configure and tweak streaming diag output services.
===========================================================================*/
typedef enum {
DIAG_READ_NICE_C = 0, /* Read "Nice" values for LOG and MSG services */
DIAG_WRITE_NICE_C = 1, /* Write "Nice" values for LOG and MSG services */
DIAG_READ_PRI_C = 2, /* Read "priority" values for LOG and MSG services */
DIAG_WRITE_PRI_C = 3, /* Write "priority" values for LOG and MSG services */
DIAG_BUF_SIZE_C = 4 /* Return size (in bytes) of output buffer */
} diag_streaming_config_subcommand_enum_type;
typedef PACKED struct {
uint16 code; /* MSG_LVL value or Log code */
int16 val;
} diagpkt_streaming_config_entry_type;
typedef PACKED struct {
/* Number of entries in the following array */
uint8 num_entries;
/* # of log codes + 5 Message Levels is the number max $ in this array */
diagpkt_streaming_config_entry_type entry[1];
} diagpkt_streaming_config_entry_list_type;
/*==========================================================================
PACKET DIAG_TS_F
PURPOSE Sent from the DM to the DMSS to request the IS-95/IS-2000 time.
============================================================================*/
DIAGPKT_REQ_DEFINE(DIAG_TS_F)
/* It's just the command code */
DIAGPKT_REQ_END
DIAGPKT_RSP_DEFINE(DIAG_TS_F)
qword ts; /* Time Stamp */
DIAGPKT_RSP_END
/*==========================================================================
PACKET DIAG_SPC_F
PURPOSE Request sent from the DM to the DMSS to enter the Service
Programming Code (SPC), enabling service programming. Response
indicates whether or not the SPC was accepted as correct.
============================================================================*/
DIAGPKT_REQ_DEFINE( DIAG_SPC_F )
diagpkt_sec_code_type sec_code;
DIAGPKT_REQ_END
DIAGPKT_RSP_DEFINE( DIAG_SPC_F )
boolean sec_code_ok;
DIAGPKT_RSP_END
/*==========================================================================
PACKET DIAG_OUTP_F
PURPOSE Request sent from the DM to the DMSS to send a byte to an
IO port
============================================================================*/
DIAGPKT_REQ_DEFINE( DIAG_OUTP_F )
word port; /* number of port to output to */
byte data; /* data to write to port */
DIAGPKT_REQ_END
DIAGPKT_DEFINE_RSP_AS_REQ( DIAG_OUTP_F )
/*==========================================================================
PACKET DIAG_OUTPW_F
PURPOSE Request sent from the DM to the DMSS to send a 16-bit word to an
IO port
============================================================================*/
DIAGPKT_REQ_DEFINE( DIAG_OUTPW_F )
word port; /* number of port to output to */
word data; /* data to write to port */
DIAGPKT_REQ_END
DIAGPKT_DEFINE_RSP_AS_REQ( DIAG_OUTPW_F )
/*==========================================================================
PACKET DIAG_INP_F
PURPOSE Request sent from the DM to the DMSS to read a byte to an
IO port
============================================================================*/
DIAGPKT_REQ_DEFINE( DIAG_INP_F )
word port; /* number of port to output to */
DIAGPKT_REQ_END
DIAGPKT_RSP_DEFINE( DIAG_INP_F )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -