diff options
-rw-r--r-- | include/radio.h | 12 | ||||
-rw-r--r-- | samsung-ipc/device/crespo/crespo_ipc.c | 2 | ||||
-rw-r--r-- | samsung-ipc/device/h1/h1_ipc.c | 13 | ||||
-rw-r--r-- | samsung-ipc/ipc.c | 6 | ||||
-rw-r--r-- | samsung-ipc/ipc_private.h | 4 | ||||
-rw-r--r-- | vapi/samsung-ipc-1.0.vapi | 2 |
6 files changed, 16 insertions, 23 deletions
diff --git a/include/radio.h b/include/radio.h index 1d5ce0e..d1c842e 100644 --- a/include/radio.h +++ b/include/radio.h @@ -39,7 +39,7 @@ struct ipc_header { unsigned char group, index, type; } __attribute__((__packed__)); -struct ipc_request { +struct ipc_message_info { unsigned char mseq; unsigned char aseq; unsigned char group; @@ -49,14 +49,6 @@ struct ipc_request { unsigned char *data; }; -struct ipc_response { - unsigned char mseq, aseq; - unsigned short command; - unsigned char type; - unsigned int data_length; - unsigned char *data; -}; - struct ipc_client; struct ipc_handlers; @@ -84,7 +76,7 @@ int ipc_client_close(struct ipc_client *client); int ipc_client_power_on(struct ipc_client *client); int ipc_client_power_off(struct ipc_client *client); -int ipc_client_recv(struct ipc_client *client, struct ipc_response *response); +int ipc_client_recv(struct ipc_client *client, struct ipc_message_info *response); /* Convenience functions for ipc_send */ void ipc_client_send(struct ipc_client *client, const unsigned short command, const char type, unsigned char *data, diff --git a/samsung-ipc/device/crespo/crespo_ipc.c b/samsung-ipc/device/crespo/crespo_ipc.c index cce64eb..4cca4c0 100644 --- a/samsung-ipc/device/crespo/crespo_ipc.c +++ b/samsung-ipc/device/crespo/crespo_ipc.c @@ -294,7 +294,7 @@ exit: return rc; } -int crespo_ipc_client_send(struct ipc_client *client, struct ipc_request *request) +int crespo_ipc_client_send(struct ipc_client *client, struct ipc_message_info *request) { struct modem_io modem_data; struct ipc_header reqhdr; diff --git a/samsung-ipc/device/h1/h1_ipc.c b/samsung-ipc/device/h1/h1_ipc.c index 49408ba..59d2a95 100644 --- a/samsung-ipc/device/h1/h1_ipc.c +++ b/samsung-ipc/device/h1/h1_ipc.c @@ -68,7 +68,7 @@ int h1_ipc_power_off() return 0; } -int h1_ipc_send(struct ipc_client *client, struct ipc_request *request) +int h1_ipc_send(struct ipc_client *client, struct ipc_message_info *request) { struct hdlc_header *hdlc; unsigned char *frame; @@ -104,7 +104,7 @@ int h1_ipc_send(struct ipc_client *client, struct ipc_request *request) return 0; } -int h1_ipc_recv(struct ipc_client *client, struct ipc_response *response) +int h1_ipc_recv(struct ipc_client *client, struct ipc_message_info *response) { unsigned char buf[4]; unsigned char *data; @@ -126,12 +126,13 @@ int h1_ipc_recv(struct ipc_client *client, struct ipc_response *response) ipc = (struct ipc_header*)data; response->mseq = ipc->mseq; response->aseq = ipc->aseq; - response->command = IPC_COMMAND(ipc); + response->group = ipc->group; + response->index = ipc->index; response->type = ipc->type; - response->data_length = (ipc->length - sizeof(*ipc)); + response->length = (ipc->length - sizeof(*ipc)); - response->data = (unsigned char*)malloc(response->data_length); - memcpy(response->data, (data + sizeof(*ipc)), response->data_length); + response->data = (unsigned char*)malloc(response->length); + memcpy(response->data, (data + sizeof(*ipc)), response->length); return 0; } diff --git a/samsung-ipc/ipc.c b/samsung-ipc/ipc.c index 15335a2..97a0b18 100644 --- a/samsung-ipc/ipc.c +++ b/samsung-ipc/ipc.c @@ -210,7 +210,7 @@ int ipc_client_power_off(struct ipc_client *client) return client->handlers->power_off(NULL); } -int _ipc_client_send(struct ipc_client *client, struct ipc_request *request) +int _ipc_client_send(struct ipc_client *client, struct ipc_message_info *request) { if (client == NULL || client->ops == NULL || @@ -234,7 +234,7 @@ inline void ipc_client_send_exec(struct ipc_client *client, const unsigned short /* Wrapper for ipc_send */ void ipc_client_send(struct ipc_client *client, const unsigned short command, const char type, unsigned char *data, const int length, unsigned char mseq) { - struct ipc_request request; + struct ipc_message_info request; request.mseq = mseq; request.aseq = 0xff; @@ -247,7 +247,7 @@ void ipc_client_send(struct ipc_client *client, const unsigned short command, co _ipc_client_send(client, &request); } -int ipc_client_recv(struct ipc_client *client, struct ipc_response *response) +int ipc_client_recv(struct ipc_client *client, struct ipc_message_info *response) { if (client == NULL || client->ops == NULL || diff --git a/samsung-ipc/ipc_private.h b/samsung-ipc/ipc_private.h index 4891772..4e05119 100644 --- a/samsung-ipc/ipc_private.h +++ b/samsung-ipc/ipc_private.h @@ -29,8 +29,8 @@ void ipc_client_log(struct ipc_client *client, const char *message, ...); struct ipc_ops { int (*bootstrap)(struct ipc_client *client); - int (*send)(struct ipc_client *client, struct ipc_request*); - int (*recv)(struct ipc_client *client, struct ipc_response*); + int (*send)(struct ipc_client *client, struct ipc_message_info *); + int (*recv)(struct ipc_client *client, struct ipc_message_info *); }; struct ipc_handlers { diff --git a/vapi/samsung-ipc-1.0.vapi b/vapi/samsung-ipc-1.0.vapi index 9c98faf..3e68252 100644 --- a/vapi/samsung-ipc-1.0.vapi +++ b/vapi/samsung-ipc-1.0.vapi @@ -971,7 +971,7 @@ namespace SamsungIpc public uint8 type; } - [CCode (cname = "struct ipc_request", destroy_function = "", free_function = "")] + [CCode (cname = "struct ipc_message_info", destroy_function = "", free_function = "")] public struct Request { public uint8 mseq; |