@@ -988,8 +988,11 @@ bool qmi_qmux_device_get_service_version(struct qmi_device *device,
return true;
}
-bool qmi_device_has_service(struct qmi_device *device, uint16_t type)
+bool qmi_qmux_device_has_service(struct qmi_device *device, uint16_t type)
{
+ if (!device)
+ return false;
+
return __find_service_info_by_type(device, type);
}
@@ -2266,6 +2269,14 @@ done:
return service_create(family);
}
+bool qmi_qrtr_node_has_service(struct qmi_device *device, uint16_t type)
+{
+ if (!device)
+ return false;
+
+ return __find_service_info_by_type(device, type);
+}
+
struct qmi_param *qmi_param_new(void)
{
return l_new(struct qmi_param, 1);
@@ -81,6 +81,7 @@ bool qmi_qmux_device_create_client(struct qmi_device *device,
bool qmi_qmux_device_get_service_version(struct qmi_device *device,
uint16_t type,
uint16_t *major, uint16_t *minor);
+bool qmi_qmux_device_has_service(struct qmi_device *device, uint16_t type);
void qmi_device_set_debug(struct qmi_device *device,
qmi_debug_func_t func, void *user_data);
@@ -90,8 +91,6 @@ int qmi_device_discover(struct qmi_device *device, qmi_discover_func_t func,
int qmi_device_shutdown(struct qmi_device *device, qmi_shutdown_func_t func,
void *user_data, qmi_destroy_func_t destroy);
-bool qmi_device_has_service(struct qmi_device *device, uint16_t type);
-
enum qmi_device_expected_data_format qmi_device_get_expected_data_format(
struct qmi_device *device);
bool qmi_device_set_expected_data_format(struct qmi_device *device,
@@ -104,6 +103,7 @@ int qmi_qrtr_node_lookup(struct qmi_device *device,
void *user_data, qmi_destroy_func_t destroy);
struct qmi_service *qmi_qrtr_node_get_service(struct qmi_device *device,
uint32_t type);
+bool qmi_qrtr_node_has_service(struct qmi_device *device, uint16_t type);
struct qmi_param;
@@ -446,19 +446,19 @@ static void discover_cb(void *user_data)
DBG("");
- if (qmi_device_has_service(data->device, QMI_SERVICE_DMS))
+ if (qmi_qmux_device_has_service(data->device, QMI_SERVICE_DMS))
data->features |= GOBI_DMS;
- if (qmi_device_has_service(data->device, QMI_SERVICE_NAS))
+ if (qmi_qmux_device_has_service(data->device, QMI_SERVICE_NAS))
data->features |= GOBI_NAS;
- if (qmi_device_has_service(data->device, QMI_SERVICE_WDS))
+ if (qmi_qmux_device_has_service(data->device, QMI_SERVICE_WDS))
data->features |= GOBI_WDS;
- if (qmi_device_has_service(data->device, QMI_SERVICE_WDA))
+ if (qmi_qmux_device_has_service(data->device, QMI_SERVICE_WDA))
data->features |= GOBI_WDA;
- if (qmi_device_has_service(data->device, QMI_SERVICE_PDS))
+ if (qmi_qmux_device_has_service(data->device, QMI_SERVICE_PDS))
data->features |= GOBI_PDS;
- if (qmi_device_has_service(data->device, QMI_SERVICE_UIM))
+ if (qmi_qmux_device_has_service(data->device, QMI_SERVICE_UIM))
data->features |= GOBI_UIM;
- if (qmi_device_has_service(data->device, QMI_SERVICE_VOICE))
+ if (qmi_qmux_device_has_service(data->device, QMI_SERVICE_VOICE))
data->features |= GOBI_VOICE;
if (qmi_qmux_device_get_service_version(data->device, QMI_SERVICE_WMS,
@@ -186,10 +186,10 @@ static void lookup_done(void *user_data)
DBG("");
- if (!qmi_device_has_service(node, QMI_SERVICE_DMS) ||
- !qmi_device_has_service(node, QMI_SERVICE_UIM) ||
- !qmi_device_has_service(node, QMI_SERVICE_WDS) ||
- !qmi_device_has_service(node, QMI_SERVICE_NAS))
+ if (!qmi_qrtr_node_has_service(node, QMI_SERVICE_DMS) ||
+ !qmi_qrtr_node_has_service(node, QMI_SERVICE_UIM) ||
+ !qmi_qrtr_node_has_service(node, QMI_SERVICE_WDS) ||
+ !qmi_qrtr_node_has_service(node, QMI_SERVICE_NAS))
goto error;
data->dms = qmi_qrtr_node_get_service(node, QMI_SERVICE_DMS);
@@ -381,7 +381,7 @@ static void qrtrqmi_post_sim(struct ofono_modem *modem)
ofono_sms_create(modem, 0, "qmimodem", wms);
- if (qmi_device_has_service(node, QMI_SERVICE_UIM))
+ if (qmi_qrtr_node_has_service(node, QMI_SERVICE_UIM))
mw = ofono_message_waiting_create(modem);
if (mw)