aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-04-04 19:11:17 +0200
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-06-27 18:40:30 +0200
commit971ddcbf609b34819238cb96f485aae57502b3d1 (patch)
tree419ac0ead119be1d0592ad623c286cbe8138b618
parent9517ec3cd4afb7da43b9b2d76fc35e41da3bd416 (diff)
downloadhardware_replicant_libsamsung-ipc-971ddcbf609b34819238cb96f485aae57502b3d1.tar.gz
hardware_replicant_libsamsung-ipc-971ddcbf609b34819238cb96f485aae57502b3d1.tar.bz2
hardware_replicant_libsamsung-ipc-971ddcbf609b34819238cb96f485aae57502b3d1.zip
includes: protocol.h: switch to Linux code style
This contains no functional changes. The commented out code if any has also been preserved as it could be relevant to the understanding of the code. It will be kept until we understand why the code has been commented. In that case we either need to remove it completely or to replace it by a comment explaining why not having that code was necessary. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
-rw-r--r--include/protocol.h82
1 files changed, 40 insertions, 42 deletions
diff --git a/include/protocol.h b/include/protocol.h
index d44871d..8f3b5f6 100644
--- a/include/protocol.h
+++ b/include/protocol.h
@@ -28,68 +28,66 @@
*/
/* Requests */
-#define IPC_TYPE_EXEC 0x01
-#define IPC_TYPE_GET 0x02
-#define IPC_TYPE_SET 0x03
-#define IPC_TYPE_CFRM 0x04
-#define IPC_TYPE_EVENT 0x05
+#define IPC_TYPE_EXEC 0x01
+#define IPC_TYPE_GET 0x02
+#define IPC_TYPE_SET 0x03
+#define IPC_TYPE_CFRM 0x04
+#define IPC_TYPE_EVENT 0x05
/* Responses */
-#define IPC_TYPE_INDI 0x01
-#define IPC_TYPE_RESP 0x02
-#define IPC_TYPE_NOTI 0x03
+#define IPC_TYPE_INDI 0x01
+#define IPC_TYPE_RESP 0x02
+#define IPC_TYPE_NOTI 0x03
/*
* Groups
*/
-#define IPC_GROUP_PWR 0x01
-#define IPC_GROUP_CALL 0x02
-#define IPC_GROUP_SMS 0x04
-#define IPC_GROUP_SEC 0x05
-#define IPC_GROUP_PB 0x06
-#define IPC_GROUP_DISP 0x07
-#define IPC_GROUP_NET 0x08
-#define IPC_GROUP_SND 0x09
-#define IPC_GROUP_MISC 0x0A
-#define IPC_GROUP_SVC 0x0B
-#define IPC_GROUP_SS 0x0C
-#define IPC_GROUP_GPRS 0x0D
-#define IPC_GROUP_SAT 0x0E
-#define IPC_GROUP_CFG 0x0F
-#define IPC_GROUP_IMEI 0x10
-#define IPC_GROUP_GPS 0x11
-#define IPC_GROUP_SAP 0x12
-#define IPC_GROUP_RFS 0x42
-#define IPC_GROUP_GEN 0x80
+#define IPC_GROUP_PWR 0x01
+#define IPC_GROUP_CALL 0x02
+#define IPC_GROUP_SMS 0x04
+#define IPC_GROUP_SEC 0x05
+#define IPC_GROUP_PB 0x06
+#define IPC_GROUP_DISP 0x07
+#define IPC_GROUP_NET 0x08
+#define IPC_GROUP_SND 0x09
+#define IPC_GROUP_MISC 0x0A
+#define IPC_GROUP_SVC 0x0B
+#define IPC_GROUP_SS 0x0C
+#define IPC_GROUP_GPRS 0x0D
+#define IPC_GROUP_SAT 0x0E
+#define IPC_GROUP_CFG 0x0F
+#define IPC_GROUP_IMEI 0x10
+#define IPC_GROUP_GPS 0x11
+#define IPC_GROUP_SAP 0x12
+#define IPC_GROUP_RFS 0x42
+#define IPC_GROUP_GEN 0x80
/*
* Macros
*/
-#define IPC_COMMAND(group, index) ((group << 8) | index)
-#define IPC_GROUP(command) (command >> 8)
-#define IPC_INDEX(command) (command & 0xff)
+#define IPC_COMMAND(group, index) ((group << 8) | index)
+#define IPC_GROUP(command) (command >> 8)
+#define IPC_INDEX(command) (command & 0xff)
/*
* Structures
*/
struct ipc_fmt_header {
- unsigned short length;
- unsigned char mseq;
- unsigned char aseq;
- unsigned char group;
- unsigned char index;
- unsigned char type;
+ unsigned short length;
+ unsigned char mseq;
+ unsigned char aseq;
+ unsigned char group;
+ unsigned char index;
+ unsigned char type;
} __attribute__((__packed__));
struct ipc_rfs_header {
- unsigned int length;
- unsigned char index;
- unsigned char id;
+ unsigned int length;
+ unsigned char index;
+ unsigned char id;
} __attribute__((__packed__));
-#endif
-
-// vim:ts=4:sw=4:expandtab
+#endif /* __SAMSUNG_IPC_PROTOCOL_H__ */