summaryrefslogtreecommitdiffstats
path: root/helium
diff options
context:
space:
mode:
authorSatish kumar sugasi <ssugas@codeaurora.org>2015-09-30 18:27:43 -0700
committerSatish kumar sugasi <ssugas@codeaurora.org>2016-05-12 22:31:36 -0700
commit84e51de2ea1b5d2e34dfa2a6801bc92ce49b0750 (patch)
treec742a64e7309de86a915948fe9eedf24789b0fa6 /helium
parentb0ba3c88ab9f195b9540c3618f2572ff792d6b72 (diff)
downloadandroid_hardware_qcom_fm-84e51de2ea1b5d2e34dfa2a6801bc92ce49b0750.tar.gz
android_hardware_qcom_fm-84e51de2ea1b5d2e34dfa2a6801bc92ce49b0750.tar.bz2
android_hardware_qcom_fm-84e51de2ea1b5d2e34dfa2a6801bc92ce49b0750.zip
FM : Changes to add new hci commands for ftm
This include adding support to read RDS group counters and other diagnoistic hci commands used for FTM app. Change-Id: I56656dc9d427a32f0385f586535d3421ff4f49b0
Diffstat (limited to 'helium')
-rw-r--r--helium/radio-helium.h20
-rw-r--r--helium/radio_helium_hal.c40
-rw-r--r--helium/radio_helium_hal_cmds.c28
3 files changed, 87 insertions, 1 deletions
diff --git a/helium/radio-helium.h b/helium/radio-helium.h
index 430ddbf..9952884 100644
--- a/helium/radio-helium.h
+++ b/helium/radio-helium.h
@@ -159,6 +159,7 @@ typedef void (*rt_plus_cb)(char *rt_plus);
typedef void (*ert_cb)(char *ert);
typedef void (*disable_cb)();
typedef void (*callback_thread_event)(unsigned int evt);
+typedef void (*rds_grp_cntrs_cb)(char *rds_params);
typedef struct {
size_t size;
@@ -177,6 +178,7 @@ typedef struct {
rt_plus_cb rt_plus_update_cb;
ert_cb ert_update_cb;
disable_cb disabled_cb;
+ rds_grp_cntrs_cb rds_grp_cntrs_rsp_cb;
callback_thread_event thread_evt_cb;
} fm_vendor_callbacks_t;
@@ -387,6 +389,18 @@ struct hci_fm_search_rds_station_req {
short srch_pi;
} ;
+struct hci_fm_rds_grp_cntrs_params {
+ int totalRdsSBlockErrors;
+ int totalRdsGroups;
+ int totalRdsGroup0;
+ int totalRdsGroup2;
+ int totalRdsBlockB;
+ int totalRdsProcessedGroup0;
+ int totalRdsProcessedGroup2;
+ int totalRdsGroupFiltered;
+ int totalRdsChangeFiltered;
+} ;
+
struct hci_fm_search_station_list_req {
char srch_list_mode;
char srch_list_dir;
@@ -623,6 +637,12 @@ struct hci_fm_conf_rsp {
struct hci_fm_recv_conf_req recv_conf_rsp;
} ;
+struct hci_fm_rds_grp_cntrs_rsp {
+ char status;
+ struct hci_fm_rds_grp_cntrs_params recv_rds_grp_cntrs_rsp;
+} ;
+
+
struct hci_fm_get_trans_conf_rsp {
char status;
struct hci_fm_trans_conf_req_struct trans_conf_rsp;
diff --git a/helium/radio_helium_hal.c b/helium/radio_helium_hal.c
index 2a3dc80..0c68972 100644
--- a/helium/radio_helium_hal.c
+++ b/helium/radio_helium_hal.c
@@ -119,6 +119,23 @@ static void hci_cc_rsp(char *ev_buff)
radio_hci_req_complete(status);
}
+static void hci_cc_rds_grp_cntrs_rsp(char *ev_buff)
+{
+ char status;
+ if (ev_buff == NULL) {
+ ALOGE("%s:%s, buffer is null\n", LOG_TAG, __func__);
+ return;
+ }
+ status = ev_buff[0];
+ ALOGE("%s:%s, status =%d\n", LOG_TAG, __func__,status);
+ if(status < 0)
+ {
+ ALOGE("%s:%s, read rds_grp_cntrs failed status=%d\n", LOG_TAG, __func__,status);
+ }
+ jni_cb->rds_grp_cntrs_rsp_cb(&ev_buff[1]);
+}
+
+
static inline void hci_cmd_complete_event(char *buff)
{
uint16_t opcode;
@@ -169,6 +186,9 @@ static inline void hci_cmd_complete_event(char *buff)
case hci_common_cmd_op_pack(HCI_OCF_FM_SET_SPUR_TABLE):
hci_cc_rsp(pbuf);
break;
+ case hci_status_param_op_pack(HCI_OCF_FM_READ_GRP_COUNTERS):
+ hci_cc_rds_grp_cntrs_rsp(pbuf);
+ break;
/* case hci_common_cmd_op_pack(HCI_OCF_FM_GET_SPUR_TABLE):
hci_cc_get_spur_tbl(buff);
break;
@@ -463,7 +483,7 @@ static void hci_ev_rt_plus_tag(char *buff)
data = malloc(len);
if (data != NULL) {
data[0] = len;
- ALOGE("%s:%s: data length=%d\n", LOG_TAG, __func__,data[0]);
+ ALOGI("%s:%s: data length=%d\n", LOG_TAG, __func__,data[0]);
data[1] = buff[RDS_PTYPE];
data[2] = buff[RDS_PID_LOWER];
data[3] = buff[RDS_PID_HIGHER];
@@ -948,6 +968,24 @@ static int set_fm_ctrl(int cmd, int val)
goto END;
}
break;
+
+ case HCI_FM_HELIUM_RDS_GRP_COUNTERS:
+ ALOGD("%s: rds_grp counter read value=%d ", LOG_TAG,val);
+ ret = hci_fm_get_rds_grpcounters_req(val);
+ if (ret < 0) {
+ radio->g_rds_grp_proc_ps = saved_val;
+ goto END;
+ }
+ break;
+
+ case HCI_FM_HELIUM_SET_NOTCH_FILTER:
+ ALOGD("%s: set notch filter notch=%d ", LOG_TAG,val);
+ ret = hci_fm_set_notch_filter_req(val);
+ if (ret < 0) {
+ goto END;
+ }
+ break;
+
case HCI_FM_HELIUM_RDSD_BUF:
radio->rds_grp.rds_buf_size = val;
break;
diff --git a/helium/radio_helium_hal_cmds.c b/helium/radio_helium_hal_cmds.c
index 8e69e4b..1d422d1 100644
--- a/helium/radio_helium_hal_cmds.c
+++ b/helium/radio_helium_hal_cmds.c
@@ -161,6 +161,34 @@ int hci_fm_set_recv_conf_req (struct hci_fm_recv_conf_req *conf)
return send_fm_cmd_pkt(opcode, sizeof((*conf)), conf);
}
+int hci_fm_get_program_service_req ()
+{
+ uint16_t opcode = 0;
+
+ opcode = hci_opcode_pack(HCI_OGF_FM_RECV_CTRL_CMD_REQ,
+ HCI_OCF_FM_GET_PROGRAM_SERVICE_REQ);
+ return send_fm_cmd_pkt(opcode, 0, NULL);
+}
+
+int hci_fm_get_rds_grpcounters_req (int val)
+{
+ uint16_t opcode = 0;
+
+ opcode = hci_opcode_pack(HCI_OGF_FM_STATUS_PARAMETERS_CMD_REQ,
+ HCI_OCF_FM_READ_GRP_COUNTERS);
+ return send_fm_cmd_pkt(opcode, sizeof(val), &val);
+}
+
+int hci_fm_set_notch_filter_req (int val)
+{
+ uint16_t opcode = 0;
+
+ opcode = hci_opcode_pack(HCI_OGF_FM_RECV_CTRL_CMD_REQ,
+ HCI_OCF_FM_EN_NOTCH_CTRL);
+ return send_fm_cmd_pkt(opcode, sizeof(val), &val);
+}
+
+
int helium_set_sig_threshold_req(char th)
{
uint16_t opcode = 0;