qcdm: GSM MCC, MNC, LAC and CI don't seem to valid in WCDMA mode
So don't bother trying to parse them.
This commit is contained in:
@@ -1738,6 +1738,13 @@ qcdm_cmd_gsm_subsys_state_info_result (const char *buf, size_t len, int *out_err
|
|||||||
if (imxi_to_bcd_string (rsp->imsi, imxi, sizeof (imxi)))
|
if (imxi_to_bcd_string (rsp->imsi, imxi, sizeof (imxi)))
|
||||||
qcdm_result_add_string (result, QCDM_CMD_GSM_SUBSYS_STATE_INFO_ITEM_IMSI, imxi);
|
qcdm_result_add_string (result, QCDM_CMD_GSM_SUBSYS_STATE_INFO_ITEM_IMSI, imxi);
|
||||||
|
|
||||||
|
qcdm_result_add_u8 (result, QCDM_CMD_GSM_SUBSYS_STATE_INFO_ITEM_CM_CALL_STATE, rsp->cm_call_state);
|
||||||
|
qcdm_result_add_u8 (result, QCDM_CMD_GSM_SUBSYS_STATE_INFO_ITEM_CM_OP_MODE, rsp->cm_opmode);
|
||||||
|
qcdm_result_add_u8 (result, QCDM_CMD_GSM_SUBSYS_STATE_INFO_ITEM_CM_SYS_MODE, rsp->cm_sysmode);
|
||||||
|
|
||||||
|
/* MCC/MNC, LAC, and CI don't seem to be valid when the modem is not in GSM mode */
|
||||||
|
if ( rsp->cm_sysmode == QCDM_CMD_CM_SUBSYS_STATE_INFO_SYSTEM_MODE_GSM
|
||||||
|
|| rsp->cm_sysmode == QCDM_CMD_CM_SUBSYS_STATE_INFO_SYSTEM_MODE_GW) {
|
||||||
/* Quick convert BCD LAI into MCC/MNC/LAC */
|
/* Quick convert BCD LAI into MCC/MNC/LAC */
|
||||||
mcc = (rsp->lai[0] & 0xF) * 100;
|
mcc = (rsp->lai[0] & 0xF) * 100;
|
||||||
mcc += ((rsp->lai[0] >> 4) & 0xF) * 10;
|
mcc += ((rsp->lai[0] >> 4) & 0xF) * 10;
|
||||||
@@ -1755,10 +1762,7 @@ qcdm_cmd_gsm_subsys_state_info_result (const char *buf, size_t len, int *out_err
|
|||||||
le16toh (*(u_int16_t *)(&rsp->lai[3])));
|
le16toh (*(u_int16_t *)(&rsp->lai[3])));
|
||||||
|
|
||||||
qcdm_result_add_u32 (result, QCDM_CMD_GSM_SUBSYS_STATE_INFO_ITEM_CELLID, le16toh (rsp->cellid));
|
qcdm_result_add_u32 (result, QCDM_CMD_GSM_SUBSYS_STATE_INFO_ITEM_CELLID, le16toh (rsp->cellid));
|
||||||
|
}
|
||||||
qcdm_result_add_u8 (result, QCDM_CMD_GSM_SUBSYS_STATE_INFO_ITEM_CM_CALL_STATE, rsp->cm_call_state);
|
|
||||||
qcdm_result_add_u8 (result, QCDM_CMD_GSM_SUBSYS_STATE_INFO_ITEM_CM_OP_MODE, rsp->cm_opmode);
|
|
||||||
qcdm_result_add_u8 (result, QCDM_CMD_GSM_SUBSYS_STATE_INFO_ITEM_CM_SYS_MODE, rsp->cm_sysmode);
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user