summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-05-25 07:14:15 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-05-25 07:14:15 +0000
commit2014563ea8b47daed909546f316297c8b794803f (patch)
tree96696126e1f723b42eb778b5fc38ba21ac60c28d
parent14473beeb2d06584c30c59fb1dd22ecc237b2b75 (diff)
parent4ad1622ea5cae3c0d70d5a5728f1457822dc2e42 (diff)
downloadhikey-2014563ea8b47daed909546f316297c8b794803f.tar.gz
release-request-33b11ddd-d658-45bf-bdb2-acceb024fe39-for-git_oc-release-4042766 snap-temp-L87400000067730042
Change-Id: I3ccb05463ee74a208dcd75cde6adb91f9166076a
-rw-r--r--BoardConfigCommon.mk2
-rw-r--r--bootloader/EFI/BOOT/grub.cfg10
-rw-r--r--device-common.mk7
-rw-r--r--gralloc/alloc_device.cpp37
-rw-r--r--gralloc/framebuffer_device.cpp24
-rw-r--r--gralloc/gralloc_module.cpp4
-rw-r--r--gralloc/gralloc_priv.h34
-rw-r--r--hikey/BoardConfig.mk4
-rw-r--r--manifest.xml18
-rw-r--r--sepolicy/surfaceflinger.te1
-rw-r--r--wpan/uim/uim.c39
-rw-r--r--wpan/uim/uim.h4
12 files changed, 123 insertions, 61 deletions
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index 3b744b32..f9a11922 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -37,6 +37,8 @@ TARGET_USERIMAGES_USE_EXT4 := true
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
TARGET_USE_PAN_DISPLAY := true
+SF_START_GRAPHICS_ALLOCATOR_SERVICE := true
+
# enable to use the CPUSETS feature
ENABLE_CPUSETS := true
ENABLE_SCHEDBOOST := true
diff --git a/bootloader/EFI/BOOT/grub.cfg b/bootloader/EFI/BOOT/grub.cfg
index d5b166d0..096a1470 100644
--- a/bootloader/EFI/BOOT/grub.cfg
+++ b/bootloader/EFI/BOOT/grub.cfg
@@ -3,35 +3,35 @@ set timeout=1
menuentry 'AOSP' {
search.fs_label boot root
set root=($root)
- linux /kernel console=ttyFIQ0 androidboot.console=ttyFIQ0 androidboot.hardware=hikey firmware_class.path=/system/etc/firmware efi=noruntime
+ linux /kernel console=ttyFIQ0 androidboot.console=ttyFIQ0 androidboot.hardware=hikey firmware_class.path=/system/etc/firmware efi=noruntime printk.devkmsg=on
initrd /ramdisk.img
devicetree /hi6220-hikey.dtb
}
menuentry 'AOSP-DEBUG' {
search.fs_label boot root
set root=($root)
- linux /kernel earlycon=pl011,0xf7113000 no_console_suspend=1 console=ttyFIQ0 androidboot.console=ttyFIQ0 sysrq_always_enabled androidboot.hardware=hikey firmware_class.path=/system/etc/firmware efi=noruntime
+ linux /kernel earlycon=pl011,0xf7113000 no_console_suspend=1 console=ttyFIQ0 androidboot.console=ttyFIQ0 sysrq_always_enabled androidboot.hardware=hikey firmware_class.path=/system/etc/firmware efi=noruntime printk.devkmsg=on
initrd /ramdisk.img
devicetree /hi6220-hikey.dtb
}
menuentry 'AOSP-CONSOLE' {
search.fs_label boot root
set root=($root)
- linux /kernel console=ttyAMA3,115200 androidboot.console=ttyAMA3 fiq_debugger.disable=Y androidboot.hardware=hikey firmware_class.path=/system/etc/firmware efi=noruntime
+ linux /kernel console=ttyAMA3,115200 androidboot.console=ttyAMA3 fiq_debugger.disable=Y androidboot.hardware=hikey firmware_class.path=/system/etc/firmware efi=noruntime printk.devkmsg=on
initrd /ramdisk.img
devicetree /hi6220-hikey.dtb
}
menuentry 'AOSP@720P' {
search.fs_label boot root
set root=($root)
- linux /kernel console=ttyFIQ0 androidboot.console=ttyFIQ0 androidboot.hardware=hikey firmware_class.path=/system/etc/firmware efi=noruntime video=HDMI-A-1:1280x720@60
+ linux /kernel console=ttyFIQ0 androidboot.console=ttyFIQ0 androidboot.hardware=hikey firmware_class.path=/system/etc/firmware efi=noruntime video=HDMI-A-1:1280x720@60 printk.devkmsg=on
initrd /ramdisk.img
devicetree /hi6220-hikey.dtb
}
menuentry 'AOSP@SVGA' {
search.fs_label boot root
set root=($root)
- linux /kernel console=ttyFIQ0 androidboot.console=ttyFIQ0 androidboot.hardware=hikey firmware_class.path=/system/etc/firmware efi=noruntime video=HDMI-A-1:800x600@60
+ linux /kernel console=ttyFIQ0 androidboot.console=ttyFIQ0 androidboot.hardware=hikey firmware_class.path=/system/etc/firmware efi=noruntime video=HDMI-A-1:800x600@60 printk.devkmsg=on
initrd /ramdisk.img
devicetree /hi6220-hikey.dtb
}
diff --git a/device-common.mk b/device-common.mk
index 45501d1d..0dc2ec2a 100644
--- a/device-common.mk
+++ b/device-common.mk
@@ -53,6 +53,11 @@ PRODUCT_COPY_FILES += system/core/rootdir/init.zygote64_32.rc:root/init.zygote64
PRODUCT_PACKAGES += libGLES_android
+# Graphics HAL
+PRODUCT_PACKAGES += \
+ android.hardware.graphics.allocator@2.0-impl \
+ android.hardware.graphics.mapper@2.0-impl
+
PRODUCT_PACKAGES += TIInit_11.8.32.bts \
wl18xx-fw-4.bin \
wl18xx-conf.bin
@@ -84,7 +89,7 @@ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \
frameworks/native/data/etc/android.hardware.bluetooth.xml:system/etc/permissions/android.hardware.bluetooth.xml \
frameworks/native/data/etc/android.hardware.bluetooth_le.xml:system/etc/permissions/android.hardware.bluetooth_le.xml \
- device/linaro/hikey/manifest.xml:vendor/manifest.xml \
+ device/linaro/hikey/manifest.xml:system/vendor/manifest.xml \
device/linaro/hikey/wpa_supplicant.conf:system/etc/wifi/wpa_supplicant.conf \
device/linaro/hikey/audio/audio_policy.conf:system/etc/audio_policy.conf
diff --git a/gralloc/alloc_device.cpp b/gralloc/alloc_device.cpp
index 3ef099f2..cef58511 100644
--- a/gralloc/alloc_device.cpp
+++ b/gralloc/alloc_device.cpp
@@ -128,17 +128,19 @@ static int gralloc_alloc_buffer(alloc_device_t *dev, size_t size, int usage, buf
return -1;
}
+ // we do not need ion_hnd once we have shared_fd
+ if (0 != ion_free(m->ion_client, ion_hnd))
+ {
+ AWAR("ion_free( %d ) failed", m->ion_client);
+ }
+ ion_hnd = ION_INVALID_HANDLE;
+
cpu_ptr = (unsigned char *)mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, shared_fd, 0);
if (MAP_FAILED == cpu_ptr)
{
AERR("ion_map( %d ) failed", m->ion_client);
- if (0 != ion_free(m->ion_client, ion_hnd))
- {
- AERR("ion_free( %d ) failed", m->ion_client);
- }
-
close(shared_fd);
return -1;
}
@@ -148,7 +150,6 @@ static int gralloc_alloc_buffer(alloc_device_t *dev, size_t size, int usage, buf
if (NULL != hnd)
{
hnd->share_fd = shared_fd;
- hnd->ion_hnd = ion_hnd;
*pHandle = hnd;
return 0;
}
@@ -165,13 +166,6 @@ static int gralloc_alloc_buffer(alloc_device_t *dev, size_t size, int usage, buf
AERR("munmap failed for base:%p size: %lu", cpu_ptr, (unsigned long)size);
}
- ret = ion_free(m->ion_client, ion_hnd);
-
- if (0 != ret)
- {
- AERR("ion_free( %d ) failed", m->ion_client);
- }
-
return -1;
}
#endif
@@ -306,9 +300,10 @@ static int gralloc_alloc_framebuffer_locked(alloc_device_t *dev, size_t size, in
vaddr = (void *)((uintptr_t)vaddr + bufferSize);
}
+ int fbdev_fd = m->framebuffer->shallow_fbdev_fd;
// The entire framebuffer memory is already mapped, now create a buffer object for parts of this memory
private_handle_t *hnd = new private_handle_t(private_handle_t::PRIV_FLAGS_FRAMEBUFFER, usage, size, vaddr,
- 0, dup(m->framebuffer->fd), (uintptr_t)vaddr - (uintptr_t) m->framebuffer->base);
+ 0, fbdev_fd, (uintptr_t)vaddr - (uintptr_t) m->framebuffer->base);
#if GRALLOC_ARM_UMP_MODULE
hnd->ump_id = m->framebuffer->ump_id;
@@ -330,7 +325,7 @@ static int gralloc_alloc_framebuffer_locked(alloc_device_t *dev, size_t size, in
#ifdef FBIOGET_DMABUF
struct fb_dmabuf_export fb_dma_buf;
- if (ioctl(m->framebuffer->fd, FBIOGET_DMABUF, &fb_dma_buf) == 0)
+ if (ioctl(fbdev_fd, FBIOGET_DMABUF, &fb_dma_buf) == 0)
{
AINF("framebuffer accessed with dma buf (fd 0x%x)\n", (int)fb_dma_buf.fd);
hnd->share_fd = fb_dma_buf.fd;
@@ -338,6 +333,12 @@ static int gralloc_alloc_framebuffer_locked(alloc_device_t *dev, size_t size, in
#endif
}
+
+ // correct numFds/numInts when there is no dmabuf fd
+ if (hnd->share_fd < 0) {
+ hnd->numFds--;
+ hnd->numInts++;
+ }
#endif
*pHandle = hnd;
@@ -518,7 +519,6 @@ static int alloc_device_free(alloc_device_t *dev, buffer_handle_t handle)
const size_t bufferSize = m->finfo.line_length * m->info.yres;
int index = ((uintptr_t)hnd->base - (uintptr_t)m->framebuffer->base) / bufferSize;
m->bufferMask &= ~(1 << index);
- close(hnd->fd);
#if GRALLOC_ARM_UMP_MODULE
@@ -560,11 +560,6 @@ static int alloc_device_free(alloc_device_t *dev, buffer_handle_t handle)
close(hnd->share_fd);
- if (0 != ion_free(m->ion_client, hnd->ion_hnd))
- {
- AERR("Failed to ion_free( ion_client: %d ion_hnd: %p )", m->ion_client, (void *)(uintptr_t)hnd->ion_hnd);
- }
-
memset((void *)hnd, 0, sizeof(*hnd));
#else
AERR("Can't free dma_buf memory for handle:0x%x. Not supported.", (unsigned int)hnd);
diff --git a/gralloc/framebuffer_device.cpp b/gralloc/framebuffer_device.cpp
index cfc480fa..3f74e8df 100644
--- a/gralloc/framebuffer_device.cpp
+++ b/gralloc/framebuffer_device.cpp
@@ -94,9 +94,11 @@ static int fb_post(struct framebuffer_device_t *dev, buffer_handle_t buffer)
#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
#define S3CFB_SET_VSYNC_INT _IOW('F', 206, unsigned int)
- if (ioctl(m->framebuffer->fd, FBIOPAN_DISPLAY, &m->info) == -1)
+ int fbdev_fd = m->framebuffer->shallow_fbdev_fd;
+
+ if (ioctl(fbdev_fd, FBIOPAN_DISPLAY, &m->info) == -1)
{
- AERR("FBIOPAN_DISPLAY failed for fd: %d", m->framebuffer->fd);
+ AERR("FBIOPAN_DISPLAY failed for fd: %d", fbdev_fd);
m->base.unlock(&m->base, buffer);
return 0;
}
@@ -106,9 +108,9 @@ static int fb_post(struct framebuffer_device_t *dev, buffer_handle_t buffer)
// enable VSYNC
interrupt = 1;
- if (ioctl(m->framebuffer->fd, S3CFB_SET_VSYNC_INT, &interrupt) < 0)
+ if (ioctl(fbdev_fd, S3CFB_SET_VSYNC_INT, &interrupt) < 0)
{
- // AERR("S3CFB_SET_VSYNC_INT enable failed for fd: %d", m->framebuffer->fd);
+ // AERR("S3CFB_SET_VSYNC_INT enable failed for fd: %d", fbdev_fd);
return 0;
}
@@ -118,9 +120,9 @@ static int fb_post(struct framebuffer_device_t *dev, buffer_handle_t buffer)
#endif
int crtc = 0;
- if (ioctl(m->framebuffer->fd, FBIO_WAITFORVSYNC, &crtc) < 0)
+ if (ioctl(fbdev_fd, FBIO_WAITFORVSYNC, &crtc) < 0)
{
- AERR("FBIO_WAITFORVSYNC failed for fd: %d", m->framebuffer->fd);
+ AERR("FBIO_WAITFORVSYNC failed for fd: %d", fbdev_fd);
#ifdef MALI_VSYNC_EVENT_REPORT_ENABLE
gralloc_mali_vsync_report(MALI_VSYNC_EVENT_END_WAIT);
#endif
@@ -133,9 +135,9 @@ static int fb_post(struct framebuffer_device_t *dev, buffer_handle_t buffer)
// disable VSYNC
interrupt = 0;
- if (ioctl(m->framebuffer->fd, S3CFB_SET_VSYNC_INT, &interrupt) < 0)
+ if (ioctl(fbdev_fd, S3CFB_SET_VSYNC_INT, &interrupt) < 0)
{
- AERR("S3CFB_SET_VSYNC_INT disable failed for fd: %d", m->framebuffer->fd);
+ AERR("S3CFB_SET_VSYNC_INT disable failed for fd: %d", fbdev_fd);
return 0;
}
}
@@ -146,9 +148,9 @@ static int fb_post(struct framebuffer_device_t *dev, buffer_handle_t buffer)
gralloc_mali_vsync_report(MALI_VSYNC_EVENT_BEGIN_WAIT);
#endif
- if (ioctl(m->framebuffer->fd, FBIOPUT_VSCREENINFO, &m->info) == -1)
+ if (ioctl(fbdev_fd, FBIOPUT_VSCREENINFO, &m->info) == -1)
{
- AERR("FBIOPUT_VSCREENINFO failed for fd: %d", m->framebuffer->fd);
+ AERR("FBIOPUT_VSCREENINFO failed for fd: %d", fbdev_fd);
#ifdef MALI_VSYNC_EVENT_REPORT_ENABLE
gralloc_mali_vsync_report(MALI_VSYNC_EVENT_END_WAIT);
#endif
@@ -383,7 +385,7 @@ int init_frame_buffer_locked(struct private_module_t *module)
// Create a "fake" buffer object for the entire frame buffer memory, and store it in the module
module->framebuffer = new private_handle_t(private_handle_t::PRIV_FLAGS_FRAMEBUFFER, 0, fbSize, vaddr,
- 0, dup(fd), 0);
+ 0, fd, 0);
module->numBuffers = info.yres_virtual / info.yres;
module->bufferMask = 0;
diff --git a/gralloc/gralloc_module.cpp b/gralloc/gralloc_module.cpp
index cdcbc5b9..70d2c69b 100644
--- a/gralloc/gralloc_module.cpp
+++ b/gralloc/gralloc_module.cpp
@@ -96,7 +96,9 @@ static int gralloc_register_buffer(gralloc_module_t const *module, buffer_handle
if (hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER)
{
- AERR("Can't register buffer 0x%p as it is a framebuffer", handle);
+ AINF("Register framebuffer 0x%p is no-op", handle);
+ retval = 0;
+
}
else if (hnd->flags & private_handle_t::PRIV_FLAGS_USES_UMP)
{
diff --git a/gralloc/gralloc_priv.h b/gralloc/gralloc_priv.h
index 57977258..36159606 100644
--- a/gralloc/gralloc_priv.h
+++ b/gralloc/gralloc_priv.h
@@ -182,11 +182,11 @@ struct private_handle_t
#endif
// Following members is for framebuffer only
- int fd;
+ int shallow_fbdev_fd; // shallow copy, not dup'ed
int offset;
#if GRALLOC_ARM_DMA_BUF_MODULE
- ion_user_handle_t ion_hnd;
+ ion_user_handle_t ion_hnd_UNUSED;
#endif
#if GRALLOC_ARM_DMA_BUF_MODULE
@@ -219,11 +219,11 @@ struct private_handle_t
yuv_info(MALI_YUV_NO_INFO),
ump_id((int)secure_id),
ump_mem_handle((int)handle),
- fd(0),
+ shallow_fbdev_fd(0),
offset(0)
#if GRALLOC_ARM_DMA_BUF_MODULE
,
- ion_hnd(ION_INVALID_HANDLE)
+ ion_hnd_UNUSED(ION_INVALID_HANDLE)
#endif
{
@@ -253,9 +253,9 @@ struct private_handle_t
ump_id((int)UMP_INVALID_SECURE_ID),
ump_mem_handle((int)UMP_INVALID_MEMORY_HANDLE),
#endif
- fd(0),
+ shallow_fbdev_fd(0),
offset(0),
- ion_hnd(ION_INVALID_HANDLE)
+ ion_hnd_UNUSED(ION_INVALID_HANDLE)
{
version = sizeof(native_handle);
@@ -286,11 +286,11 @@ struct private_handle_t
ump_id((int)UMP_INVALID_SECURE_ID),
ump_mem_handle((int)UMP_INVALID_MEMORY_HANDLE),
#endif
- fd(fb_file),
+ shallow_fbdev_fd(fb_file),
offset(fb_offset)
#if GRALLOC_ARM_DMA_BUF_MODULE
,
- ion_hnd(ION_INVALID_HANDLE)
+ ion_hnd_UNUSED(ION_INVALID_HANDLE)
#endif
{
@@ -313,9 +313,21 @@ struct private_handle_t
{
const private_handle_t *hnd = (const private_handle_t *)h;
- if (!h || h->version != sizeof(native_handle) || h->numFds != sNumFds ||
- h->numInts != (sizeof(private_handle_t) - sizeof(native_handle)) / sizeof(int) - sNumFds ||
- hnd->magic != sMagic)
+ if (!h || h->version != sizeof(native_handle) || hnd->magic != sMagic)
+ {
+ return -EINVAL;
+ }
+
+ int numFds = sNumFds;
+ int numInts = (sizeof(private_handle_t) - sizeof(native_handle)) / sizeof(int) - sNumFds;
+#if GRALLOC_ARM_DMA_BUF_MODULE
+ if (hnd->share_fd < 0) {
+ numFds--;
+ numInts++;
+ }
+#endif
+
+ if (h->numFds != numFds || h->numInts != numInts)
{
return -EINVAL;
}
diff --git a/hikey/BoardConfig.mk b/hikey/BoardConfig.mk
index d10a51cd..f4529901 100644
--- a/hikey/BoardConfig.mk
+++ b/hikey/BoardConfig.mk
@@ -7,6 +7,10 @@ else
BOARD_KERNEL_CMDLINE := console=ttyFIQ0 androidboot.console=ttyFIQ0 androidboot.hardware=hikey firmware_class.path=/system/etc/firmware efi=noruntime
endif
+## printk.devkmsg only has meaning for kernel 4.9 and later
+## it would be ignored by kernel 4.1 and kernel 4.4
+BOARD_KERNEL_CMDLINE += printk.devkmsg=on
+
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736
ifeq ($(TARGET_USERDATAIMAGE_4GB), true)
BOARD_USERDATAIMAGE_PARTITION_SIZE := 1595915776
diff --git a/manifest.xml b/manifest.xml
index 6d489e94..95a1fe72 100644
--- a/manifest.xml
+++ b/manifest.xml
@@ -9,6 +9,24 @@
</interface>
</hal>
<hal format="hidl">
+ <name>android.hardware.graphics.allocator</name>
+ <transport>hwbinder</transport>
+ <version>2.0</version>
+ <interface>
+ <name>IAllocator</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.graphics.mapper</name>
+ <transport arch="32+64">passthrough</transport>
+ <version>2.0</version>
+ <interface>
+ <name>IMapper</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
<name>android.hardware.wifi.supplicant</name>
<transport>hwbinder</transport>
<version>1.0</version>
diff --git a/sepolicy/surfaceflinger.te b/sepolicy/surfaceflinger.te
new file mode 100644
index 00000000..f53f2b46
--- /dev/null
+++ b/sepolicy/surfaceflinger.te
@@ -0,0 +1 @@
+hal_server_domain(surfaceflinger, hal_graphics_allocator)
diff --git a/wpan/uim/uim.c b/wpan/uim/uim.c
index a9dde00c..7f78f0c9 100644
--- a/wpan/uim/uim.c
+++ b/wpan/uim/uim.c
@@ -42,6 +42,12 @@ static int dev_fd;
char uim_bd_address[BD_ADDR_LEN];
bdaddr_t *bd_addr;
+/* kim Sysfs path */
+static char *sysfs_install_entry = INSTALL_SYSFS_ENTRY;
+static char *sysfs_dev_name = DEV_NAME_SYSFS;
+static char *sysfs_baud_rate = BAUD_RATE_SYSFS;
+static char *sysfs_flow_ctrl = FLOW_CTRL_SYSFS;
+
/*****************************************************************************/
#ifdef UIM_DEBUG
/* Function to Read the firmware version
@@ -65,6 +71,14 @@ void read_firmware_version(int dev_fd)
}
#endif
+void sysfs_entry_fallback(void)
+{
+ sysfs_install_entry = INSTALL_SYSFS_ENTRY_OLD;
+ sysfs_dev_name = DEV_NAME_SYSFS_OLD;
+ sysfs_baud_rate = BAUD_RATE_SYSFS_OLD;
+ sysfs_flow_ctrl = FLOW_CTRL_SYSFS_OLD;
+}
+
/*****************************************************************************/
/* Function to read the HCI event from the given file descriptor
*
@@ -283,9 +297,9 @@ int st_uart_config(unsigned char install)
if (install == '1') {
memset(buf, 0, UART_DEV_NAME_LEN);
- fd = open(DEV_NAME_SYSFS, O_RDONLY);
+ fd = open(sysfs_dev_name, O_RDONLY);
if (fd < 0) {
- UIM_ERR("Can't open %s", DEV_NAME_SYSFS);
+ UIM_ERR("Can't open %s", sysfs_dev_name);
return -1;
}
len = read(fd, buf, UART_DEV_NAME_LEN);
@@ -298,9 +312,9 @@ int st_uart_config(unsigned char install)
close(fd);
memset(buf, 0, UART_DEV_NAME_LEN);
- fd = open(BAUD_RATE_SYSFS, O_RDONLY);
+ fd = open(sysfs_baud_rate, O_RDONLY);
if (fd < 0) {
- UIM_ERR("Can't open %s", BAUD_RATE_SYSFS);
+ UIM_ERR("Can't open %s", sysfs_baud_rate);
return -1;
}
len = read(fd, buf, UART_DEV_NAME_LEN);
@@ -313,9 +327,9 @@ int st_uart_config(unsigned char install)
sscanf((const char*)buf, "%d", &cust_baud_rate);
memset(buf, 0, UART_DEV_NAME_LEN);
- fd = open(FLOW_CTRL_SYSFS, O_RDONLY);
+ fd = open(sysfs_flow_ctrl, O_RDONLY);
if (fd < 0) {
- UIM_ERR("Can't open %s", FLOW_CTRL_SYSFS);
+ UIM_ERR("Can't open %s", sysfs_flow_ctrl);
close(fd);
return -1;
}
@@ -486,14 +500,17 @@ int main(int argc, char *argv[])
/* sysfs entry may get populated after service is started so we retry if it fails*/
while (trials > 0) {
- st_fd = open(INSTALL_SYSFS_ENTRY, O_RDONLY);
+ st_fd = open(sysfs_install_entry, O_RDONLY);
if(st_fd > 0)
break;
- usleep(500000);
+ if (trials == 3)
+ sysfs_entry_fallback();
+ else
+ usleep(500000);
--trials;
}
if (st_fd < 0) {
- UIM_DBG("unable to open %s(%s)", INSTALL_SYSFS_ENTRY, strerror(errno));
+ UIM_DBG("unable to open %s(%s)", sysfs_install_entry, strerror(errno));
return -1;
}
@@ -525,9 +542,9 @@ RE_POLL:
}
close(st_fd);
- st_fd = open(INSTALL_SYSFS_ENTRY, O_RDONLY);
+ st_fd = open(sysfs_install_entry, O_RDONLY);
if (st_fd < 0) {
- UIM_DBG("unable to open %s (%s)", INSTALL_SYSFS_ENTRY, strerror(errno));
+ UIM_DBG("unable to open %s (%s)", sysfs_install_entry, strerror(errno));
return -1;
}
diff --git a/wpan/uim/uim.h b/wpan/uim/uim.h
index c88d9cc4..dc9c5b17 100644
--- a/wpan/uim/uim.h
+++ b/wpan/uim/uim.h
@@ -69,6 +69,10 @@
#define BAUD_RATE_SYSFS "/sys/devices/platform/kim/baud_rate"
#define FLOW_CTRL_SYSFS "/sys/devices/platform/kim/flow_cntrl"
+#define INSTALL_SYSFS_ENTRY_OLD "/sys/devices/kim/install"
+#define DEV_NAME_SYSFS_OLD "/sys/devices/kim/dev_name"
+#define BAUD_RATE_SYSFS_OLD "/sys/devices/kim/baud_rate"
+#define FLOW_CTRL_SYSFS_OLD "/sys/devices/kim/flow_cntrl"
#define VERBOSE
/*Debug logs*/