From da6bf32cfc0bd4b4cf46422e6653a6a3cb4877a1 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Sat, 15 Dec 2012 19:13:47 +0100 Subject: Permit explicit board name instead of device name Change-Id: I7ed51c0a35061daeaac302c8bac90a1c3b577e1d Signed-off-by: Paul Kocialkowski --- Android.mk | 12 ++++++------ samsung-ipc/ipc.c | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Android.mk b/Android.mk index 3cf1c57..1c78f8e 100644 --- a/Android.mk +++ b/Android.mk @@ -13,22 +13,22 @@ LOCAL_LDFLAGS += -lcrypto ifeq ($(TARGET_DEVICE),crespo) LOCAL_CFLAGS += -DDEVICE_IPC_V4 - samsung-ipc_device := crespo + board_name := herring endif ifeq ($(TARGET_DEVICE),galaxys2) LOCAL_CFLAGS += -DDEVICE_IPC_V4 - samsung-ipc_device := galaxys2 + board_name := smdk4210 endif ifeq ($(TARGET_DEVICE),galaxysmtd) LOCAL_CFLAGS += -DDEVICE_IPC_V4 - samsung-ipc_device := aries + board_name := aries endif ifeq ($(TARGET_DEVICE),galaxytab) LOCAL_CFLAGS += -DDEVICE_IPC_V4 - samsung-ipc_device := aries + board_name := gt-p1000 endif ifeq ($(TARGET_DEVICE),h1) @@ -37,7 +37,7 @@ endif ifeq ($(TARGET_DEVICE),maguro) LOCAL_CFLAGS += -DDEVICE_IPC_V4 - samsung-ipc_device := maguro + board_name := tuna endif ifeq ($(DEBUG),true) @@ -69,7 +69,7 @@ samsung-ipc_files := \ samsung-ipc/device/maguro/maguro_ipc.c LOCAL_SRC_FILES := $(samsung-ipc_files) -LOCAL_CFLAGS += -DIPC_DEVICE_EXPLICIT=\"$(samsung-ipc_device)\" +LOCAL_CFLAGS += -DIPC_BOARD_NAME_EXPLICIT=\"$(board_name)\" LOCAL_SHARED_LIBRARIES := libutils LOCAL_C_INCLUDES += $(LOCAL_PATH)/include \ diff --git a/samsung-ipc/ipc.c b/samsung-ipc/ipc.c index b6b6b1b..efba73a 100644 --- a/samsung-ipc/ipc.c +++ b/samsung-ipc/ipc.c @@ -64,17 +64,17 @@ void ipc_client_log(struct ipc_client *client, const char *message, ...) int ipc_device_detect(void) { - char *device = NULL; + char *board_name = NULL; char *kernel_version = NULL; int index = -1; int i; -#ifdef IPC_DEVICE_EXPLICIT - device = strdup(IPC_DEVICE_EXPLICIT); +#ifdef IPC_BOARD_NAME_EXPLICIT + board_name = strdup(IPC_BOARD_NAME_EXPLICIT); #else char buf[4096]; - // gather device type from /proc/cpuinfo + // gather board name type from /proc/cpuinfo int fd = open("/proc/cpuinfo", O_RDONLY); int bytesread = read(fd, buf, 4096); close(fd); @@ -96,7 +96,7 @@ int ipc_device_detect(void) str[i] = tmp; } - device = strdup(pch); + board_name = strdup(pch); } pch = strtok(NULL, "\n"); } @@ -115,7 +115,7 @@ int ipc_device_detect(void) for (i=0 ; i < ipc_devices_count ; i++) { - if (strstr(device, ipc_devices[i].board_name) != NULL) + if (strstr(board_name, ipc_devices[i].board_name) != NULL) { if (ipc_devices[i].kernel_version != NULL) { @@ -134,8 +134,8 @@ int ipc_device_detect(void) } } - if (device != NULL) - free(device); + if (board_name != NULL) + free(board_name); if (kernel_version != NULL) free(kernel_version); @@ -143,7 +143,7 @@ int ipc_device_detect(void) return index; } -struct ipc_client* ipc_client_new(int client_type) +struct ipc_client *ipc_client_new(int client_type) { struct ipc_client *client; int device_index = -1; @@ -156,7 +156,7 @@ struct ipc_client* ipc_client_new(int client_type) if (client_type < 0 || client_type > IPC_CLIENT_TYPE_RFS) return NULL; - client = (struct ipc_client*) malloc(sizeof(struct ipc_client)); + client = (struct ipc_client *) malloc(sizeof(struct ipc_client)); memset(client, 0, sizeof(struct ipc_client)); client->type = client_type; -- cgit v1.1