6 #include <libubox/uloop.h>
7 #include <libubox/ustream.h>
9 #include "qmi-message.h"
12 void dump_packet(const char *prefix
, void *ptr
, int len
);
14 static inline void dump_packet(const char *prefix
, void *ptr
, int len
)
19 #define __qmi_services \
20 __qmi_service(QMI_SERVICE_WDS), \
21 __qmi_service(QMI_SERVICE_DMS), \
22 __qmi_service(QMI_SERVICE_NAS), \
23 __qmi_service(QMI_SERVICE_QOS), \
24 __qmi_service(QMI_SERVICE_WMS), \
25 __qmi_service(QMI_SERVICE_PDS), \
26 __qmi_service(QMI_SERVICE_AUTH), \
27 __qmi_service(QMI_SERVICE_AT), \
28 __qmi_service(QMI_SERVICE_VOICE), \
29 __qmi_service(QMI_SERVICE_CAT2), \
30 __qmi_service(QMI_SERVICE_UIM), \
31 __qmi_service(QMI_SERVICE_PBM), \
32 __qmi_service(QMI_SERVICE_LOC), \
33 __qmi_service(QMI_SERVICE_SAR), \
34 __qmi_service(QMI_SERVICE_RMTFS), \
35 __qmi_service(QMI_SERVICE_CAT), \
36 __qmi_service(QMI_SERVICE_RMS), \
37 __qmi_service(QMI_SERVICE_OMA)
39 #define __qmi_service(_n) __##_n
50 typedef void (*request_cb
)(struct qmi_dev
*qmi
, struct qmi_request
*req
, struct qmi_msg
*msg
);
61 } service_data
[__QMI_SERVICE_LAST
];
63 uint32_t service_connected
;
64 uint32_t service_keep_cid
;
65 uint32_t service_release_cid
;
71 struct list_head list
;
83 extern bool cancel_all_requests
;
84 int qmi_device_open(struct qmi_dev
*qmi
, const char *path
);
85 void qmi_device_close(struct qmi_dev
*qmi
);
87 int qmi_request_start(struct qmi_dev
*qmi
, struct qmi_request
*req
, struct qmi_msg
*msg
, request_cb cb
);
88 void qmi_request_cancel(struct qmi_dev
*qmi
, struct qmi_request
*req
);
89 int qmi_request_wait(struct qmi_dev
*qmi
, struct qmi_request
*req
);
91 static inline bool qmi_request_pending(struct qmi_request
*req
)
96 int qmi_service_connect(struct qmi_dev
*qmi
, QmiService svc
, int client_id
);
97 int qmi_service_get_client_id(struct qmi_dev
*qmi
, QmiService svc
);
98 int qmi_service_release_client_id(struct qmi_dev
*qmi
, QmiService svc
);
99 QmiService
qmi_service_get_by_name(const char *str
);
100 const char *qmi_get_error_str(int code
);