mirror of
https://github.com/linux-msm/hexagonrpc.git
synced 2026-10-07 15:29:50 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b4c7bffaf | ||
|
|
00b5f80608 | ||
|
|
9ea9bed77b | ||
|
|
23585daf67 |
No files matched your search
@@ -12,7 +12,7 @@ which lines were entered by the user.
|
||||
- libqrtr
|
||||
- meson or make
|
||||
- protobuf-c
|
||||
- qmic (https://github.com/andersson/qmic)
|
||||
- qmic (optional for regenerating QMI, at https://github.com/andersson/qmic)
|
||||
|
||||
# Installation
|
||||
|
||||
|
||||
@@ -110,6 +110,7 @@ static int mapped_openat(struct hexagonfs_fd *dir,
|
||||
|
||||
ctx->dir = NULL;
|
||||
|
||||
fd->is_assigned = false;
|
||||
fd->up = dir;
|
||||
fd->ops = &hexagonfs_mapped_ops;
|
||||
fd->data = ctx;
|
||||
@@ -227,7 +228,7 @@ static int mapped_or_empty_from_dirent(void *dirent_data, bool dir, void **fd_da
|
||||
|
||||
ret = mapped_from_dirent(dirent_data, dir, fd_data);
|
||||
if (ret)
|
||||
fd_data = NULL;
|
||||
*fd_data = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -69,6 +70,7 @@ static int virt_dir_openat(struct hexagonfs_fd *dir,
|
||||
if (fd == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
fd->is_assigned = false;
|
||||
fd->up = dir;
|
||||
fd->ops = ent->ops;
|
||||
|
||||
|
||||
@@ -73,6 +73,14 @@ static struct fastrpc_io_buffer *allocate_outbufs(const struct fastrpc_function_
|
||||
off_t off;
|
||||
uint32_t *sizes;
|
||||
|
||||
/*
|
||||
* POSIX allows malloc to return a non-NULL pointer to a zero-size area
|
||||
* in memory. Since the code below assumes non-zero size if the pointer
|
||||
* is non-NULL, exit early if we do not need to allocate anything.
|
||||
*/
|
||||
if (out_count == 0)
|
||||
return NULL;
|
||||
|
||||
out_count = def->out_bufs + (def->out_nums && 1);
|
||||
out = malloc(sizeof(struct fastrpc_io_buffer) * out_count);
|
||||
if (out == NULL)
|
||||
|
||||
+12
-5
@@ -19,10 +19,17 @@
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
qmic = find_program('qmic')
|
||||
qmic = find_program('qmic', required : false)
|
||||
wrapper = files('qmic_wrapper.sh')
|
||||
|
||||
qmi = custom_target('qmi_sns_client',
|
||||
command : [wrapper, qmic, '@INPUT@', '@OUTDIR@'],
|
||||
input : 'sns_client.qmi',
|
||||
output : ['qmi_sns_client.c', 'qmi_sns_client.h'])
|
||||
if qmic.found()
|
||||
qmi = custom_target('qmi_sns_client',
|
||||
command : [wrapper, qmic, '@INPUT@', '@OUTDIR@'],
|
||||
input : 'sns_client.qmi',
|
||||
output : ['qmi_sns_client.c', 'qmi_sns_client.h'])
|
||||
else
|
||||
qmi = custom_target('qmi_sns_client',
|
||||
command : ['cp', '@INPUT@', '@OUTDIR@'],
|
||||
input : ['qmi_sns_client.c', 'qmi_sns_client.h'],
|
||||
output : ['qmi_sns_client.c', 'qmi_sns_client.h'])
|
||||
endif
|
||||
@@ -0,0 +1,81 @@
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include "qmi_sns_client.h"
|
||||
|
||||
struct qmi_elem_info sns_client_req_msg_v01_ei[] = {
|
||||
{
|
||||
.data_type = QMI_DATA_LEN,
|
||||
.elem_len = 1,
|
||||
.elem_size = sizeof(uint16_t),
|
||||
.tlv_type = 1,
|
||||
.offset = offsetof(struct sns_client_req_msg_v01, payload_len),
|
||||
},
|
||||
{
|
||||
.data_type = QMI_UNSIGNED_1_BYTE,
|
||||
.elem_len = 65535,
|
||||
.elem_size = sizeof(uint8_t),
|
||||
.array_type = VAR_LEN_ARRAY,
|
||||
.tlv_type = 1,
|
||||
.offset = offsetof(struct sns_client_req_msg_v01, payload),
|
||||
},
|
||||
{
|
||||
.data_type = QMI_UNSIGNED_1_BYTE,
|
||||
.elem_len = 1,
|
||||
.elem_size = sizeof(uint8_t),
|
||||
.tlv_type = 16,
|
||||
.offset = offsetof(struct sns_client_req_msg_v01, unkfield_1),
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
struct qmi_elem_info sns_client_resp_msg_v01_ei[] = {
|
||||
{
|
||||
.data_type = QMI_UNSIGNED_4_BYTE,
|
||||
.elem_len = 1,
|
||||
.elem_size = sizeof(uint32_t),
|
||||
.tlv_type = 2,
|
||||
.offset = offsetof(struct sns_client_resp_msg_v01, unkfield_2),
|
||||
},
|
||||
{
|
||||
.data_type = QMI_UNSIGNED_8_BYTE,
|
||||
.elem_len = 1,
|
||||
.elem_size = sizeof(uint64_t),
|
||||
.tlv_type = 16,
|
||||
.offset = offsetof(struct sns_client_resp_msg_v01, client_id),
|
||||
},
|
||||
{
|
||||
.data_type = QMI_UNSIGNED_4_BYTE,
|
||||
.elem_len = 1,
|
||||
.elem_size = sizeof(uint32_t),
|
||||
.tlv_type = 17,
|
||||
.offset = offsetof(struct sns_client_resp_msg_v01, result),
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
struct qmi_elem_info sns_client_report_ind_msg_v01_ei[] = {
|
||||
{
|
||||
.data_type = QMI_UNSIGNED_8_BYTE,
|
||||
.elem_len = 1,
|
||||
.elem_size = sizeof(uint64_t),
|
||||
.tlv_type = 1,
|
||||
.offset = offsetof(struct sns_client_report_ind_msg_v01, client_id),
|
||||
},
|
||||
{
|
||||
.data_type = QMI_DATA_LEN,
|
||||
.elem_len = 1,
|
||||
.elem_size = sizeof(uint16_t),
|
||||
.tlv_type = 2,
|
||||
.offset = offsetof(struct sns_client_report_ind_msg_v01, payload_len),
|
||||
},
|
||||
{
|
||||
.data_type = QMI_UNSIGNED_1_BYTE,
|
||||
.elem_len = 65535,
|
||||
.elem_size = sizeof(uint8_t),
|
||||
.array_type = VAR_LEN_ARRAY,
|
||||
.tlv_type = 2,
|
||||
.offset = offsetof(struct sns_client_report_ind_msg_v01, payload),
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#ifndef __QMI_SNS_CLIENT_H__
|
||||
#define __QMI_SNS_CLIENT_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "libqrtr.h"
|
||||
|
||||
#define SNS_CLIENT_REQ_V01 32
|
||||
#define SNS_CLIENT_RESP_V01 32
|
||||
#define SNS_CLIENT_IND_V01_SMALL 33
|
||||
#define SNS_CLIENT_IND_V01_LARGE 34
|
||||
|
||||
struct sns_client_req_msg_v01 {
|
||||
uint32_t payload_len;
|
||||
uint8_t payload[65535];
|
||||
uint8_t unkfield_1;
|
||||
};
|
||||
|
||||
struct sns_client_resp_msg_v01 {
|
||||
uint32_t unkfield_2;
|
||||
uint64_t client_id;
|
||||
uint32_t result;
|
||||
};
|
||||
|
||||
struct sns_client_report_ind_msg_v01 {
|
||||
uint64_t client_id;
|
||||
uint32_t payload_len;
|
||||
uint8_t payload[65535];
|
||||
};
|
||||
|
||||
extern struct qmi_elem_info sns_client_req_msg_v01_ei[];
|
||||
extern struct qmi_elem_info sns_client_resp_msg_v01_ei[];
|
||||
extern struct qmi_elem_info sns_client_report_ind_msg_v01_ei[];
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user