# HG changeset patch # User Florian Pose # Date 1224086909 0 # Node ID 19f9e9b6cf2c0f8a5d1a77604204613ebe21582a # Parent 11f4b6e10d743c4e48c2a9c408328511746a3607 Fixed VoE data reading in userspace. diff -r 11f4b6e10d74 -r 19f9e9b6cf2c lib/voe_handler.c --- a/lib/voe_handler.c Wed Oct 15 10:32:54 2008 +0000 +++ b/lib/voe_handler.c Wed Oct 15 16:08:29 2008 +0000 @@ -36,7 +36,11 @@ /*****************************************************************************/ +#include +#include #include +#include +#include #include "voe_handler.h" #include "slave_config.h" @@ -55,9 +59,9 @@ data.vendor_id = &vendor_id; data.vendor_type = &vendor_type; - if (ioctl(voe->config->master->fd, EC_IOCTL_VOE_SEND_HEADER, &data) == -1) { - fprintf(stderr, "Failed to set VoE send header.\n"); - } + if (ioctl(voe->config->master->fd, EC_IOCTL_VOE_SEND_HEADER, &data) == -1) + fprintf(stderr, "Failed to set VoE send header: %s\n", + strerror(errno)); } /*****************************************************************************/ @@ -72,9 +76,9 @@ data.vendor_id = vendor_id; data.vendor_type = vendor_type; - if (ioctl(voe->config->master->fd, EC_IOCTL_VOE_REC_HEADER, &data) == -1) { - fprintf(stderr, "Failed to get received VoE header.\n"); - } + if (ioctl(voe->config->master->fd, EC_IOCTL_VOE_REC_HEADER, &data) == -1) + fprintf(stderr, "Failed to get received VoE header: %s\n", + strerror(errno)); } /*****************************************************************************/ @@ -100,9 +104,9 @@ data.config_index = voe->config->index; data.voe_index = voe->index; - if (ioctl(voe->config->master->fd, EC_IOCTL_VOE_READ, &data) == -1) { - fprintf(stderr, "Failed to initiate VoE reading.\n"); - } + if (ioctl(voe->config->master->fd, EC_IOCTL_VOE_READ, &data) == -1) + fprintf(stderr, "Failed to initiate VoE reading: %s\n", + strerror(errno)); } /*****************************************************************************/ @@ -116,9 +120,9 @@ data.size = size; data.data = voe->data; - if (ioctl(voe->config->master->fd, EC_IOCTL_VOE_WRITE, &data) == -1) { - fprintf(stderr, "Failed to initiate VoE reading.\n"); - } + if (ioctl(voe->config->master->fd, EC_IOCTL_VOE_WRITE, &data) == -1) + fprintf(stderr, "Failed to initiate VoE writing: %s\n", + strerror(errno)); } /*****************************************************************************/ @@ -132,7 +136,8 @@ data.size = 0; if (ioctl(voe->config->master->fd, EC_IOCTL_VOE_EXEC, &data) == -1) { - fprintf(stderr, "Failed to initiate VoE reading.\n"); + fprintf(stderr, "Failed to execute VoE handler: %s\n", + strerror(errno)); return EC_REQUEST_ERROR; } @@ -149,8 +154,10 @@ voe->mem_size = data.size; } + data.data = voe->data; + if (ioctl(voe->config->master->fd, EC_IOCTL_VOE_DATA, &data) == -1) { - fprintf(stderr, "Failed to get VoE data!\n"); + fprintf(stderr, "Failed to get VoE data: %s\n", strerror(errno)); return EC_REQUEST_ERROR; } voe->data_size = data.size;