summaryrefslogtreecommitdiff
path: root/libqcdm/src/dm-commands.h
diff options
context:
space:
mode:
Diffstat (limited to 'libqcdm/src/dm-commands.h')
-rw-r--r--libqcdm/src/dm-commands.h368
1 files changed, 241 insertions, 127 deletions
diff --git a/libqcdm/src/dm-commands.h b/libqcdm/src/dm-commands.h
index d43f401..cc254bb 100644
--- a/libqcdm/src/dm-commands.h
+++ b/libqcdm/src/dm-commands.h
@@ -111,26 +111,49 @@ enum {
DIAG_CMD_RAM_RW = 112, /* Calibration RAM control using DM */
DIAG_CMD_CPU_RW = 113, /* Calibration CPU control using DM */
DIAG_CMD_SET_FTM_TEST_MODE = 114, /* Field (or Factory?) Test Mode */
+ DIAG_CMD_LOG_CONFIG = 115, /* New logging config command */
+ DIAG_CMD_EXT_BUILD_ID = 124,
+ DIAG_CMD_EXT_MESSAGE_CONFIG= 125,
+ DIAG_CMD_EVENT_GET_MASK = 129,
+ DIAG_CMD_EVENT_SET_MASK = 130
};
/* Subsystem IDs used with DIAG_CMD_SUBSYS; these often obsolete many of
* the original DM commands.
*/
enum {
+ DIAG_SUBSYS_WCDMA = 4,
DIAG_SUBSYS_HDR = 5, /* High Data Rate (ie, EVDO) */
+ DIAG_SUBSYS_GSM = 8,
+ DIAG_SUBSYS_UMTS = 9,
+ DIAG_SUBSYS_OS = 12,
DIAG_SUBSYS_GPS = 13,
- DIAG_SUBSYS_SMS = 14,
+ DIAG_SUBSYS_SMS = 14, /* Wireless Messaging Service */
DIAG_SUBSYS_CM = 15, /* Call manager */
+ DIAG_SUBSYS_FS = 19, /* File System (EFS2) */
DIAG_SUBSYS_NW_CONTROL_6500 = 50, /* for Novatel Wireless MSM6500-based devices */
DIAG_SUBSYS_ZTE = 101, /* for ZTE EVDO devices */
DIAG_SUBSYS_NW_CONTROL_6800 = 250 /* for Novatel Wireless MSM6800-based devices */
};
+/* WCDMA subsystem command codes */
+enum {
+ DIAG_SUBSYS_WCDMA_CALL_START = 12, /* Starts a call */
+ DIAG_SUBSYS_WCDMA_CALL_END = 13, /* Ends an ongoing call */
+ DIAG_SUBSYS_WCDMA_STATE_INFO = 15, /* Gets WCDMA state */
+};
+
/* HDR subsystem command codes */
enum {
DIAG_SUBSYS_HDR_STATE_INFO = 8, /* Gets EVDO state */
};
+/* GSM subsystem command codes */
+enum {
+ DIAG_SUBSYS_GSM_STATE_INFO = 1, /* Gets GSM state */
+};
+
+/* CM subsystem command codes */
enum {
DIAG_SUBSYS_CM_STATE_INFO = 0, /* Gets Call Manager state */
};
@@ -211,140 +234,153 @@ enum {
/* Generic DM command header */
struct DMCmdHeader {
- guint8 code;
+ u_int8_t code;
} __attribute__ ((packed));
typedef struct DMCmdHeader DMCmdHeader;
/* DIAG_CMD_SUBSYS */
struct DMCmdSubsysHeader {
- guint8 code;
- guint8 subsys_id;
- guint16 subsys_cmd;
+ u_int8_t code;
+ u_int8_t subsys_id;
+ u_int16_t subsys_cmd;
} __attribute__ ((packed));
typedef struct DMCmdSubsysHeader DMCmdSubsysHeader;
/* DIAG_CMD_NV_READ / DIAG_CMD_NV_WRITE */
struct DMCmdNVReadWrite {
- guint8 code;
- guint16 nv_item;
- guint8 data[128];
- guint16 status;
+ u_int8_t code;
+ u_int16_t nv_item;
+ u_int8_t data[128];
+ u_int16_t status;
} __attribute__ ((packed));
typedef struct DMCmdNVReadWrite DMCmdNVReadWrite;
/* DIAG_CMD_VERSION_INFO */
struct DMCmdVersionInfoRsp {
- guint8 code;
+ u_int8_t code;
char comp_date[11];
char comp_time[8];
char rel_date[11];
char rel_time[8];
char model[8];
- guint8 scm;
- guint8 mob_cai_rev;
- guint8 mob_model;
- guint16 mob_firmware_rev;
- guint8 slot_cycle_index;
- guint8 msm_ver;
- guint8 _unknown;
+ u_int8_t scm;
+ u_int8_t mob_cai_rev;
+ u_int8_t mob_model;
+ u_int16_t mob_firmware_rev;
+ u_int8_t slot_cycle_index;
+ u_int8_t msm_ver;
+ u_int8_t _unknown;
} __attribute__ ((packed));
typedef struct DMCmdVersionInfoRsp DMCmdVersionInfoRsp;
/* DIAG_CMD_ESN */
struct DMCmdEsnRsp {
- guint8 code;
- guint8 esn[4];
+ u_int8_t code;
+ u_int8_t esn[4];
} __attribute__ ((packed));
typedef struct DMCmdEsnRsp DMCmdEsnRsp;
/* DIAG_CMD_STATUS */
struct DMCmdStatusRsp {
- guint8 code;
- guint8 _unknown[3];
- guint8 esn[4];
- guint16 rf_mode;
- guint8 min1_analog[4];
- guint8 min1_cdma[4];
- guint8 min2_analog[2];
- guint8 min2_cdma[2];
- guint8 _unknown1;
- guint16 cdma_rx_state;
- guint8 good_frames;
- guint16 analog_corrected_frames;
- guint16 analog_bad_frames;
- guint16 analog_word_syncs;
- guint16 entry_reason;
- guint16 curr_chan;
- guint8 cdma_code_chan;
- guint16 pilot_base;
- guint16 sid;
- guint16 nid;
- guint16 analog_locaid;
- guint16 analog_rssi;
- guint8 analog_power;
+ u_int8_t code;
+ u_int8_t _unknown[3];
+ u_int8_t esn[4];
+ u_int16_t rf_mode;
+ u_int8_t min1_analog[4];
+ u_int8_t min1_cdma[4];
+ u_int8_t min2_analog[2];
+ u_int8_t min2_cdma[2];
+ u_int8_t _unknown1;
+ u_int16_t cdma_rx_state;
+ u_int8_t good_frames;
+ u_int16_t analog_corrected_frames;
+ u_int16_t analog_bad_frames;
+ u_int16_t analog_word_syncs;
+ u_int16_t entry_reason;
+ u_int16_t curr_chan;
+ u_int8_t cdma_code_chan;
+ u_int16_t pilot_base;
+ u_int16_t sid;
+ u_int16_t nid;
+ u_int16_t analog_locaid;
+ u_int16_t analog_rssi;
+ u_int8_t analog_power;
} __attribute__ ((packed));
typedef struct DMCmdStatusRsp DMCmdStatusRsp;
/* DIAG_CMD_SW_VERSION */
struct DMCmdSwVersionRsp {
- guint8 code;
- char version[20];
+ u_int8_t code;
+ char version[31];
char comp_date[11];
+ u_int8_t _unknown1[2];
char comp_time[8];
+ u_int8_t _unknown2[2];
} __attribute__ ((packed));
typedef struct DMCmdSwVersionRsp DMCmdSwVersionRsp;
+typedef enum {
+ DM_OPER_MODE_POWER_OFF = 0,
+ DM_OPER_MODE_FIELD_TEST_MODE = 1,
+ DM_OPER_MODE_OFFLINE = 2,
+ DM_OPER_MODE_OFFLINE_AMPS = 3,
+ DM_OPER_MODE_OFFLINE_CDMA = 4,
+ DM_OPER_MODE_ONLINE = 5,
+ DM_OPER_MODE_LOW_POWER_MODE = 6,
+ DM_OPER_MODE_RESETTING = 7,
+} DMOperMode;
+
/* DIAG_CMD_STATUS_SNAPSHOT */
struct DMCmdStatusSnapshotRsp {
- guint8 code;
- guint8 esn[4];
- guint8 imsi_s1[4];
- guint8 imsi_s2[2];
- guint8 imsi_s[8];
- guint8 imsi_11_12;
- guint16 mcc;
- guint8 imsi_addr_num;
- guint16 sid;
- guint16 nid;
- guint8 prev;
- guint8 prev_in_use;
- guint8 mob_prev;
- guint8 band_class;
- guint16 frequency;
- guint8 oper_mode;
- guint8 state;
- guint8 sub_state;
+ u_int8_t code;
+ u_int8_t esn[4];
+ u_int8_t imsi_s1[4];
+ u_int8_t imsi_s2[2];
+ u_int8_t imsi_s[8];
+ u_int8_t imsi_11_12;
+ u_int16_t mcc;
+ u_int8_t imsi_addr_num;
+ u_int16_t sid;
+ u_int16_t nid;
+ u_int8_t prev;
+ u_int8_t prev_in_use;
+ u_int8_t mob_prev;
+ u_int8_t band_class;
+ u_int16_t frequency;
+ u_int8_t oper_mode;
+ u_int8_t state;
+ u_int8_t sub_state;
} __attribute__ ((packed));
typedef struct DMCmdStatusSnapshotRsp DMCmdStatusSnapshotRsp;
/* DIAG_SUBSYS_CM_STATE_INFO subsys command */
struct DMCmdSubsysCMStateInfoRsp {
DMCmdSubsysHeader header;
- guint32 call_state;
- guint32 oper_mode;
- guint32 system_mode;
- guint32 mode_pref;
- guint32 band_pref;
- guint32 roam_pref;
- guint32 srv_domain_pref;
- guint32 acq_order_pref;
- guint32 hybrid_pref;
- guint32 network_sel_mode_pref;
+ u_int32_t call_state;
+ u_int32_t oper_mode;
+ u_int32_t system_mode;
+ u_int32_t mode_pref;
+ u_int32_t band_pref;
+ u_int32_t roam_pref;
+ u_int32_t srv_domain_pref;
+ u_int32_t acq_order_pref;
+ u_int32_t hybrid_pref;
+ u_int32_t network_sel_mode_pref;
} __attribute__ ((packed));
typedef struct DMCmdSubsysCMStateInfoRsp DMCmdSubsysCMStateInfoRsp;
/* DIAG_SUBSYS_HDR_STATE_INFO subsys command */
struct DMCmdSubsysHDRStateInfoRsp {
DMCmdSubsysHeader header;
- guint8 at_state;
- guint8 session_state;
- guint8 almp_state;
- guint8 init_state;
- guint8 idle_state;
- guint8 connected_state;
- guint8 route_update_state;
- guint8 overhead_msg_state;
- guint8 hdr_hybrid_mode;
+ u_int8_t at_state;
+ u_int8_t session_state;
+ u_int8_t almp_state;
+ u_int8_t init_state;
+ u_int8_t idle_state;
+ u_int8_t connected_state;
+ u_int8_t route_update_state;
+ u_int8_t overhead_msg_state;
+ u_int8_t hdr_hybrid_mode;
} __attribute__ ((packed));
typedef struct DMCmdSubsysHDRStateInfoRsp DMCmdSubsysHDRStateInfoRsp;
@@ -352,94 +388,172 @@ typedef struct DMCmdSubsysHDRStateInfoRsp DMCmdSubsysHDRStateInfoRsp;
/* DIAG_SUBSYS_ZTE_STATUS subsys command */
struct DMCmdSubsysZteStatusRsp {
DMCmdSubsysHeader header;
- guint8 _unknown1[8];
- guint8 signal_ind;
- guint8 _unknown2;
+ u_int8_t _unknown1[8];
+ u_int8_t signal_ind;
+ u_int8_t _unknown2;
} __attribute__ ((packed));
typedef struct DMCmdSubsysZteStatusRsp DMCmdSubsysZteStatusRsp;
/* DIAG_CMD_PILOT_SETS command */
struct DMCmdPilotSetsSet {
- guint16 pn_offset;
- guint16 ecio;
+ u_int16_t pn_offset;
+ u_int16_t ecio;
} __attribute__ ((packed));
typedef struct DMCmdPilotSetsSet DMCmdPilotSetsSet;
struct DMCmdPilotSetsRsp {
- guint8 code;
- guint16 pilot_inc;
- guint8 active_count;
- guint8 candidate_count;
- guint8 neighbor_count;
+ u_int8_t code;
+ u_int16_t pilot_inc;
+ u_int8_t active_count;
+ u_int8_t candidate_count;
+ u_int8_t neighbor_count;
DMCmdPilotSetsSet sets[52];
} __attribute__ ((packed));
typedef struct DMCmdPilotSetsRsp DMCmdPilotSetsRsp;
+struct DMCmdLog {
+ u_int8_t code;
+ u_int8_t more;
+ u_int16_t len;
+ u_int16_t _unknown2; /* contains same value as len */
+ u_int16_t log_code;
+ u_int64_t timestamp;
+ u_int8_t data[0];
+} __attribute__ ((packed));
+typedef struct DMCmdLog DMCmdLog;
+
struct DMCmdExtLogMask {
- guint8 code;
+ u_int8_t code;
/* Bit number of highest '1' in 'mask'; set to 0 to get current mask. */
- guint16 len;
+ u_int16_t len;
/* Bitfield of log messages to receive */
- guint8 mask[512];
+ u_int8_t mask[512];
} __attribute__ ((packed));
typedef struct DMCmdExtLogMask DMCmdExtLogMask;
struct DMCmdEventReport {
- guint8 code;
- guint8 on;
+ u_int8_t code;
+ u_int8_t on;
} __attribute__ ((packed));
typedef struct DMCmdEventReport DMCmdEventReport;
struct DMCmdEventReportRsp {
- guint8 code;
- guint16 len;
- guint16 event_id;
- guint8 data[0];
+ u_int8_t code;
+ u_int16_t len;
+ u_int16_t event_id;
+ u_int8_t data[0];
} __attribute__ ((packed));
typedef struct DMCmdEventReportRsp DMCmdEventReportRsp;
/* DIAG_SUBSYS_NW_CONTROL_* subsys command */
struct DMCmdSubsysNwSnapshotReq {
DMCmdSubsysHeader hdr;
- guint8 technology; /* DIAG_SUBSYS_NW_CONTROL_MODEM_SNAPSHOT_TECH_* */
- guint32 snapshot_mask;
+ u_int8_t technology; /* DIAG_SUBSYS_NW_CONTROL_MODEM_SNAPSHOT_TECH_* */
+ u_int32_t snapshot_mask;
} __attribute__ ((packed));
typedef struct DMCmdSubsysNwSnapshotReq DMCmdSubsysNwSnapshotReq;
/* DIAG_SUBSYS_NW_CONTROL_MODEM_SNAPSHOT response */
struct DMCmdSubsysNwSnapshotRsp {
DMCmdSubsysHeader hdr;
- guint8 response_code;
- guint32 bitfield1;
- guint32 bitfield2;
- guint8 data[100];
+ u_int8_t response_code;
+ u_int32_t bitfield1;
+ u_int32_t bitfield2;
+ u_int8_t data[100];
} __attribute__ ((packed));
typedef struct DMCmdSubsysNwSnapshotRsp DMCmdSubsysNwSnapshotRsp;
struct DMCmdSubsysNwSnapshotCdma {
- guint32 rssi;
- guint32 battery_level;
- guint8 call_info;
- guint8 new_sms_ind;
- guint8 missed_calls;
- guint32 voicemail_ind;
- guint8 pkt_call_ctrl_state;
- guint8 mip_rrp_err_code;
- guint8 cur_packet_zone_id;
- guint8 prev;
- guint8 band_class;
- guint8 eri;
- guint8 eri_alert_id;
- guint32 cur_call_total_time;
- guint32 cur_call_active_time;
- guint32 cur_call_tx_ip_bytes;
- guint32 cur_call_rx_ip_bytes;
- guint8 connection_status;
- guint16 dominant_pn;
- guint8 wdisable_mask;
- guint8 hdr_rev;
+ u_int32_t rssi;
+ u_int32_t battery_level;
+ u_int8_t call_info;
+ u_int8_t new_sms_ind;
+ u_int8_t missed_calls;
+ u_int32_t voicemail_ind;
+ u_int8_t pkt_call_ctrl_state;
+ u_int8_t mip_rrp_err_code;
+ u_int8_t cur_packet_zone_id;
+ u_int8_t prev;
+ u_int8_t band_class;
+ u_int8_t eri;
+ u_int8_t eri_alert_id;
+ u_int32_t cur_call_total_time;
+ u_int32_t cur_call_active_time;
+ u_int32_t cur_call_tx_ip_bytes;
+ u_int32_t cur_call_rx_ip_bytes;
+ u_int8_t connection_status;
+ u_int16_t dominant_pn;
+ u_int8_t wdisable_mask;
+ u_int8_t hdr_rev;
} __attribute__ ((packed));
typedef struct DMCmdSubsysNwSnapshotCdma DMCmdSubsysNwSnapshotCdma;
+enum {
+ DIAG_CMD_LOG_CONFIG_OP_GET_RANGE = 0x01,
+ DIAG_CMD_LOG_CONFIG_OP_SET_MASK = 0x03,
+ DIAG_CMD_LOG_CONFIG_OP_GET_MASK = 0x04,
+};
+
+struct DMCmdLogConfig {
+ u_int8_t code;
+ u_int8_t pad[3];
+ u_int32_t op;
+ u_int32_t equipid;
+ u_int32_t num_items;
+ u_int8_t mask[0];
+} __attribute__ ((packed));
+typedef struct DMCmdLogConfig DMCmdLogConfig;
+
+struct DMCmdLogConfigRsp {
+ u_int8_t code;
+ u_int8_t pad[3];
+ u_int32_t op;
+ u_int32_t result; /* 0 = success */
+ u_int32_t equipid;
+ union {
+ u_int32_t get_range_items[16];
+ struct {
+ u_int32_t num_items;
+ u_int8_t mask[0];
+ } get_set_items;
+ } u;
+} __attribute__ ((packed));
+typedef struct DMCmdLogConfigRsp DMCmdLogConfigRsp;
+
+/* DIAG_SUBSYS_WCDMA_CALL_START command */
+struct DMCmdSubsysWcdmaCallStart {
+ DMCmdSubsysHeader hdr;
+ u_int8_t number_len;
+ u_int8_t number_digits[32];
+ u_int8_t amr_rate; /* default to 7 */
+} __attribute__ ((packed));
+typedef struct DMCmdSubsysWcdmaCallStart DMCmdSubsysWcdmaCallStart;
+
+/* DIAG_SUBSYS_WCDMA_STATE_INFO response */
+struct DMCmdSubsysWcdmaStateInfoRsp {
+ DMCmdSubsysHeader hdr;
+ u_int8_t imei_len;
+ u_int8_t imei[8];
+ u_int8_t imsi_len;
+ u_int8_t imsi[8];
+ u_int8_t l1_state;
+} __attribute__ ((packed));
+typedef struct DMCmdSubsysWcdmaStateInfoRsp DMCmdSubsysWcdmaStateInfoRsp;
+
+/* DIAG_SUBSYS_GSM_STATE_INFO response */
+struct DMCmdSubsysGsmStateInfoRsp {
+ DMCmdSubsysHeader hdr;
+ u_int8_t imei_len;
+ u_int8_t imei[8];
+ u_int8_t imsi_len;
+ u_int8_t imsi[8];
+ u_int8_t lai[5];
+ u_int16_t cellid;
+ u_int8_t cm_call_state;
+ u_int8_t cm_opmode;
+ u_int8_t cm_sysmode;
+} __attribute__ ((packed));
+typedef struct DMCmdSubsysGsmStateInfoRsp DMCmdSubsysGsmStateInfoRsp;
+
#endif /* LIBQCDM_DM_COMMANDS_H */