📄 diagdiag.h
字号:
#ifndef DIAGDIAG_H
#define DIAGDIAG_H
/*==========================================================================
Diagnostic Packet Definitions
Description: Packet definitions between the diagnostic subsystem
and the external device.
!!! NOTE: All member structures of diag packets must be PACKED.
!!! WARNING: Each command code number is part of the externalized
diagnostic command interface. This number *MUST* be assigned
by a member of QCT's tools development team.
Copyright (c) 2001 by QUALCOMM, Incorporated. All Rights Reserved.
===========================================================================*/
/* <EJECT> */
/*===========================================================================
Edit History
$Header: //depot/asic/msmshared/services/diag/MSMSHARED_DIAG_1.1/diagdiag.h#2 $
when who what, where, why
-------- --- ----------------------------------------------------------
06/15/04 gr Added support for getting and setting the event mask.
05/18/04 as Removed support for DIAG_USER_CMD_F & DIAG_PERM_USER_CMD_F
01/07/03 djm add RPC support for WCDMA_PLT
08/20/02 lad Moved DIAG_DLOAD_F packet def to dloaddiag.h.
Moved DIAG_SERIAL_CHG_F definition to diagcomm_sio.c.
01/28/02 as Support for DIAG_LOG_ON_DEMAND_F (log on demand).
09/18/01 jal Support for DIAG_CONTROL_F (mode reset/offline)
08/20/01 jal Support for Diag packet: DIAG_TS_F (timestamp),
DIAG_SPC_F (service programming code), DIAG_DLOAD_F
(start downloader), DIAG_OUTP_F/DIAG_OUTPW_F (IO
port byte/word output), DIAG_INP_F/DIAG_INPW_F (IO
port byte/word input)
06/27/01 lad Use of constants in message response packet.
Added packet definition for DIAG_LOG_CONFIG_F. This
replaces extended logmask processing.
Cleaned up DIAG_STREAMING_CONFIG_F and added subcmd to
get diagbuf size.
04/06/01 lad Added packet definitions for the following:
Peek/Poke
DIAG_STREAMING_CONFIG_F
Debug messages
Log services
Event services
02/23/01 lad Created file.
===========================================================================*/
#include "comdef.h"
#include "customer.h"
#include "diagcmd.h"
#include "diagpkt.h"
#include "log_codes.h"
#include "feature.h"
#include "qw.h"
#include "diag.h"
/* Type to hold security code. The security code is fixed length and is */
/* stored as ASCII string. */
#define DIAGPKT_SEC_CODE_SIZE 6 /* 6 digit security code */
typedef PACKED struct {
byte digits[DIAGPKT_SEC_CODE_SIZE]; /* Security code array */
} diagpkt_sec_code_type;
/* -------------------------------------------------------------------------
** Packet Definitions
** ------------------------------------------------------------------------- */
#if defined(T_WINNT)
#error code not present
#endif
/*==========================================================================
PACKET DIAG_RPC_F
PURPOSE RPC Processing Request
============================================================================*/
DIAGPKT_REQ_DEFINE( DIAG_RPC_F )
/* It's just the command code */
DIAGPKT_REQ_END
DIAGPKT_DEFINE_RSP_AS_REQ( DIAG_RPC_F )
/*==========================================================================
PACKETS DIAG_PEEKB_F
DIAG_PEEKW_F
DIAG_PEEKD_F
PURPOSE Sent from the DM to the DMSS to request a read of a block of data.
The cmd_code specifies byte, word or dword.
============================================================================*/
DIAGPKT_REQ_DEFINE(DIAG_PEEKB_F)
byte *ptr; /* starting address for peek operation */
word length; /* number of bytes, words, or dwords to be
returned */
DIAGPKT_REQ_END
typedef DIAG_PEEKB_F_req_type DIAG_PEEKW_F_req_type;
typedef DIAG_PEEKB_F_req_type DIAG_PEEKD_F_req_type;
typedef DIAG_PEEKB_F_req_type diag_peek_req_type;
#define DIAG_MAX_PEEK_B 16
/* Maximum number of bytes that can be requested in one Peekb request */
DIAGPKT_RSP_DEFINE(DIAG_PEEKB_F)
byte *ptr; /* starting address for peek operation */
word length; /* number of bytes to be returned */
byte data[DIAG_MAX_PEEK_B]; /* bytes from memory */
DIAGPKT_RSP_END
#define DIAG_MAX_PEEK_W 8
/* Maximum number of words that can be requested in one Peekw request */
/* Peekw Response type */
DIAGPKT_RSP_DEFINE(DIAG_PEEKW_F)
word *ptr; /* starting address for peek operation */
word length; /* number of words to be returned */
word data[DIAG_MAX_PEEK_W]; /* words from memory */
DIAGPKT_RSP_END
#define DIAG_MAX_PEEK_D 4
/* Maximum number of dwords that can be requested in one Peekd request */
DIAGPKT_RSP_DEFINE(DIAG_PEEKD_F)
dword *ptr; /* starting address for peek operation */
word length; /* number of dwords to be returned */
dword data[DIAG_MAX_PEEK_D]; /* dwords from memory */
DIAGPKT_RSP_END
typedef DIAG_PEEKB_F_rsp_type diag_peekb_rsp_type;
typedef DIAG_PEEKW_F_rsp_type diag_peekw_rsp_type;
typedef DIAG_PEEKD_F_rsp_type diag_peekd_rsp_type;
/*===========================================================================
PACKET DIAG_POKEB_F
DIAG_POKEW_F
DIAG_POKED_F
PURPOSE Sent by the DM to the DMSS to request that a block of data be
written starting at a specified address.
============================================================================*/
#define DIAG_MAX_POKE_B 4
/* Maximum number of bytes allowed for one pokeb request */
DIAGPKT_REQ_DEFINE(DIAG_POKEB_F)
byte *ptr; /* starting address for poke operation */
byte length; /* number of bytes to be poked */
byte data[DIAG_MAX_POKE_B]; /* bytes to be placed at the addr address */
DIAGPKT_REQ_END
typedef DIAG_POKEB_F_req_type DIAG_POKEB_F_rsp_type;
#define DIAG_MAX_POKE_W 2
/* Maximum number of words allowed for one pokew request */
DIAGPKT_REQ_DEFINE(DIAG_POKEW_F)
word *ptr; /* starting address for poke operation */
byte length; /* number of words to be poked */
word data[DIAG_MAX_POKE_W]; /* words to be placed at the addr address */
DIAGPKT_REQ_END
typedef DIAG_POKEW_F_req_type DIAG_POKEW_F_rsp_type;
#define DIAG_MAX_POKE_D 2
/* Maximum number of dwords allowed for one poked request this is 2 to
allow possible growth to handle qwords. */
DIAGPKT_REQ_DEFINE(DIAG_POKED_F)
dword *ptr; /* starting address for poke operation */
byte length; /* number of dwords to be poked */
dword data[DIAG_MAX_POKE_D]; /* dword to be placed at the addr address */
DIAGPKT_REQ_END
typedef DIAG_POKED_F_req_type DIAG_POKED_F_rsp_type;
/*===========================================================================
PACKET DIAG_BAD_CMD_F
DIAG_BAD_PARM_F
DIAG_BAD_LEN_F
DIAG_BAD_VOC_F
DIAG_BAD_MODE_F
DIAG_BAD_SPC_MODE_F
PURPOSE Sent by DMSS when it detects an erroneous packet from DM. Errors
include command code out of bounds, bad length... Includes the
first DIAG_MAX_ERR bytes of the offending input packet.
Also includes when an nv_read/write is attempted before the correct
SPC has been entered.
============================================================================*/
#define DIAGPKT_MAX_ERR 16
/* maximum number of bytes (starting with the first byte of the packet )
from the received packet which will be echoed back to the
Diagnostic Monitor if an error is detected in the packet */
/* Type to communicate an error in a received packet */
DIAGPKT_RSP_DEFINE(DIAG_BAD_CMD_F)
byte pkt[DIAGPKT_MAX_ERR]; /* first 16 bytes of received packet */
DIAGPKT_RSP_END
/*===========================================================================
PACKET DIAG_DIAG_VER_F
PURPOSE Sent by DM to request the version of the diag
===========================================================================*/
DIAGPKT_REQ_DEFINE(DIAG_DIAG_VER_F)
DIAGPKT_REQ_END
DIAGPKT_RSP_DEFINE(DIAG_DIAG_VER_F)
word ver; /* diag version */
DIAGPKT_RSP_END
/*===========================================================================
PACKET DIAG_PASSWORD_F
PURPOSE Sent by external device to enter the Security Password,
to then allow operations protected by security. This response
indicates whether the correct Password was given or not.
NOTE If the incorrect password is entered, DIAG will POWER DOWN
the phone.
===========================================================================*/
#define DIAG_PASSWORD_SIZE 8
DIAGPKT_REQ_DEFINE(DIAG_PASSWORD_F)
byte password[DIAG_PASSWORD_SIZE]; /* The security password */
DIAGPKT_REQ_END
DIAGPKT_RSP_DEFINE(DIAG_PASSWORD_F)
boolean password_ok; /* TRUE if Security Password entered correctly */
DIAGPKT_RSP_END
/*===========================================================================
PACKET DIAG_ERR_CLEAR_F
PURPOSE Sent by the DM to clear the requested buffered error records
===========================================================================*/
DIAGPKT_REQ_DEFINE(DIAG_ERR_CLEAR_F)
byte rec; /* record id, or -1 (0xFF) for all */
DIAGPKT_REQ_END
typedef DIAG_ERR_CLEAR_F_req_type DIAG_ERR_CLEAR_F_rsp_type;
/*===========================================================================
PACKET DIAG_ERR_READ_F
PURPOSE Sent by the DM to request the buffered error records
===========================================================================*/
DIAGPKT_REQ_DEFINE(DIAG_ERR_READ_F)
DIAGPKT_REQ_END
DIAGPKT_RSP_DEFINE(DIAG_ERR_READ_F)
word log_cnt; /* how many logged */
word ignore_cnt; /* how many ignored */
PACKED struct {
byte address; /* Storage address 0 to */
/* ERR_MAX_LOG-1 */
byte err_count; /* Number of occurances */
/* (0=empty,FF=full) */
byte file_name[8];
/* File name string */
word line_num; /* Line number in file */
boolean fatal; /* TRUE if fatal error */
} err_logs[ 20 ];
DIAGPKT_RSP_END
/* Logging Services */
/*===========================================================================
PACKET DIAG_LOG_CONFIG_F
PURPOSE Sent by the DM to set the equipment ID logging mask in the DMSS.
This is necessary to use logging services with MS Equip ID != 1.
!!!Note that the log mask is now sanely ordered LSB to MSB using little endian
32-bit integer arrays. This is not the same way the mask was done in
DIAG_EXT_LOGMASK_F.
TERMINOLOGY:
'equipment ID' - the 4-bit equipment identifier
'item ID' - the 12-bit ID that specifies the log item within this equip ID
'code' - the entire 16-bit log code (contains both equip and item ID)
===========================================================================*/
typedef enum {
LOG_CONFIG_DISABLE_OP = 0,
LOG_CONFIG_RETRIEVE_ID_RANGES_OP = 1,
LOG_CONFIG_RETRIEVE_VALID_MASK_OP = 2,
LOG_CONFIG_SET_MASK_OP = 3,
LOG_CONFIG_GET_LOGMASK_OP = 4
} log_config_command_ops_enum_type;
/* Logging config return status types.
* (*) denotes applicable to all commands
*/
typedef enum {
LOG_CONFIG_SUCCESS_S = 0, /* Operation Sucessful */
LOG_CONFIG_INVALID_EQUIP_ID_S = 1, /* (*) Specified invalid equipment ID */
LOG_CONFIG_NO_VALID_MASK_S = 2 /* Valid mask not available for this ID */
} log_config_status_enum_type;
/* Operation data */
/* DISABLE OP: LOG_CONFIG_DISAPLE_OP -no no supporting data */
/* These member structures are not packed intentionally. Each data member will
* align on a 32-bit boundary.
*/
typedef PACKED struct {
uint32 equip_id;
uint32 last_item;
} log_config_range_type;
typedef PACKED struct {
log_config_range_type code_range; /* range of log codes */
byte mask[1]; /* Array of 8 bit masks of size (num_bits + 7) / 8 */
} log_config_mask_type;
/* ID_RANGE_OP response type */
typedef PACKED struct {
uint32 last_item[16]; /* The last item for each of the 16 equip IDs */
} log_config_ranges_rsp_type;
/* VALID_MASK_OP request type */
typedef PACKED struct {
uint32 equip_id;
} log_config_valid_mask_req_type;
/* VALID_MASK_OP response type */
typedef log_config_mask_type log_config_valid_mask_rsp_type;
/* SET_MASK_OP request type */
typedef log_config_mask_type log_config_set_mask_req_type;
/* GET_MASK_OP response type */
typedef log_config_mask_type log_config_get_mask_rsp_type;
/* SET_MASK_OP response type */
typedef log_config_mask_type log_config_set_mask_rsp_type;
/* This is not packed. We use uint32 which is always aligned */
typedef PACKED union {
/* LOG_CONFIG_DISABLE_OP */
/* no additional data */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -