qcdm: fill out some operating modes

This commit is contained in:
Dan Williams
2012-01-05 12:31:13 -06:00
parent 62d26479ff
commit 11fbcc9010
3 changed files with 45 additions and 10 deletions

View File

@@ -319,7 +319,14 @@ QcdmResult *qcdm_cmd_nv_set_hdr_rev_pref_result (const char *buf,
/* Values for QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_OPERATING_MODE */
enum {
QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_ONLINE = 5
QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_POWER_OFF = 0,
QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_FIELD_TEST_MODE = 1,
QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_OFFLINE = 2,
QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_OFFLINE_AMPS = 3,
QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_OFFLINE_CDMA = 4,
QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_ONLINE = 5,
QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_LOW_POWER_MODE = 6,
QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_RESET = 7
};
/* Values for QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_SYSTEM_MODE */

View File

@@ -294,6 +294,17 @@ struct DMCmdSwVersionRsp {
} __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 {
u_int8_t code;

View File

@@ -909,6 +909,31 @@ test_com_pilot_sets (void *f, void *data)
qcdm_result_unref (result);
}
static const char *
operating_mode_to_string (guint32 mode)
{
switch (mode) {
case QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_POWER_OFF:
return "powering off";
case QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_FIELD_TEST_MODE:
return "field test mode";
case QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_OFFLINE:
return "offline";
case QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_OFFLINE_AMPS:
return "online (AMPS)";
case QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_OFFLINE_CDMA:
return "online (CDMA)";
case QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_ONLINE:
return "online";
case QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_LOW_POWER_MODE:
return "low power mode";
case QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_RESET:
return "reset";
default:
return "unknown";
}
}
void
test_com_cm_subsys_state_info (void *f, void *data)
{
@@ -945,15 +970,7 @@ test_com_cm_subsys_state_info (void *f, void *data)
n32 = 0;
detail = NULL;
qcdm_result_get_u32 (result, QCDM_CMD_CM_SUBSYS_STATE_INFO_ITEM_OPERATING_MODE, &n32);
switch (n32) {
case QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_ONLINE:
detail = "online";
break;
default:
detail = "unknown";
break;
}
g_message ("%s: Operating Mode: %u (%s)", __func__, n32, detail);
g_message ("%s: Operating Mode: %u (%s)", __func__, n32, operating_mode_to_string (n32));
n32 = 0;
detail = NULL;