X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/4cf24de229090b1ab6279570a564d224e13dd706..786c7d54e8d820e89997e507c29ea716c0d55fd9:/lincan/src/open.c diff --git a/lincan/src/open.c b/lincan/src/open.c index 862a297..f9ff108 100644 --- a/lincan/src/open.c +++ b/lincan/src/open.c @@ -18,7 +18,12 @@ #endif #include +#include +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) #include +#else +#include +#endif #include #include "../include/main.h" @@ -78,7 +83,7 @@ int can_open(struct inode *inode, struct file *file) fifo->rx_size = MAX_BUF_LENGTH * sizeof(struct canmsg_t); fifo->tx_size = fifo->rx_size; -#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,2,19)) +#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,3,0)) init_waitqueue(&fifo->readq); init_waitqueue(&fifo->writeq); #else @@ -89,12 +94,13 @@ int can_open(struct inode *inode, struct file *file) fifo->rx_in_progress = 0; fifo->tx_in_progress = 0; - fifo->head = fifo->tail = 0; //TEMP!! + chip->flags |= BUFFERS_ALLOCATED; if (chip->chipspecops->pre_read_config(chip,obj)<0) CANMSG("Error initializing chip for receiving\n"); +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,50)) MOD_INC_USE_COUNT; - +#endif return 0; }