@@ -2332,6 +2332,32 @@ struct qmi_device *qmi_device_new_qrtr(void)
return &qrtr->super;
}
+struct qmi_service *qmi_qrtr_node_get_service(struct qmi_device *device,
+ uint32_t type)
+{
+ struct service_family *family;
+ const struct qmi_service_info *info;
+
+ if (!device)
+ return NULL;
+
+ if (type == QMI_SERVICE_CONTROL)
+ return NULL;
+
+ family = l_hashmap_lookup(device->family_list, L_UINT_TO_PTR(type));
+ if (family)
+ goto done;
+
+ info = __find_service_info_by_type(device, type);
+ if (!info)
+ return NULL;
+
+ family = service_family_create(device, info, 0);
+ l_hashmap_insert(device->family_list, L_UINT_TO_PTR(type), family);
+done:
+ return service_create(family);
+}
+
struct qmi_param *qmi_param_new(void)
{
return l_new(struct qmi_param, 1);
@@ -58,9 +58,9 @@ enum qmi_data_endpoint_type {
typedef void (*qmi_destroy_func_t)(void *user_data);
-
struct qmi_device;
struct qmi_result;
+struct qmi_service;
typedef void (*qmi_debug_func_t)(const char *str, void *user_data);
typedef void (*qmi_shutdown_func_t)(void *user_data);
@@ -90,6 +90,9 @@ bool qmi_device_set_expected_data_format(struct qmi_device *device,
struct qmi_device *qmi_device_new_qmux(const char *device);
struct qmi_device *qmi_device_new_qrtr(void);
+struct qmi_service *qmi_qrtr_node_get_service(struct qmi_device *device,
+ uint32_t type);
+
struct qmi_param;
struct qmi_param *qmi_param_new(void);
@@ -128,8 +131,6 @@ void qmi_result_print_tlvs(struct qmi_result *result);
int qmi_error_to_ofono_cme(int qmi_error);
-struct qmi_service;
-
typedef void (*qmi_create_func_t)(struct qmi_service *service, void *user_data);
bool qmi_service_create_shared(struct qmi_device *device,