X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/4dc78b4651f006bf0404c8ec7db85651bcee7c2e..04ac67cc3cac14cd601daacd0592121ec0b84012:/lincan/src/ioctl.c diff --git a/lincan/src/ioctl.c b/lincan/src/ioctl.c index e6dee36..d3582d0 100644 --- a/lincan/src/ioctl.c +++ b/lincan/src/ioctl.c @@ -46,12 +46,12 @@ long can_ioctl(struct file *file, unsigned int cmd, unsigned long arg) struct msgobj_t *obj; struct canchip_t *chip; struct canque_ends_t *qends; - + if(!canuser || (canuser->magic != CAN_USER_MAGIC)){ CANMSG("can_ioctl: bad canuser magic\n"); return -ENODEV; } - + obj = canuser->msgobj; if (obj == NULL) { CANMSG("Could not assign buffer structure\n"); @@ -92,14 +92,14 @@ long can_ioctl(struct file *file, unsigned int cmd, unsigned long arg) case CONF_FILTER: { /* In- and output buffer re-initialization */ - + if(canuser->rx_edge0){ canque_set_filt(canuser->rx_edge0, arg, ~0, 0); } break; } - + case CANQUE_FILTER: { struct canfilt_t canfilt; int ret; @@ -110,11 +110,11 @@ long can_ioctl(struct file *file, unsigned int cmd, unsigned long arg) } break; } - + case CANRTR_READ: { int ret; struct canmsg_t rtr_msg; - + ret = copy_from_user(&rtr_msg, (void*)arg, sizeof(struct canmsg_t)); if(ret) return -EFAULT; ret = can_ioctl_remote_read(canuser, &rtr_msg, rtr_msg.id, 0); @@ -135,11 +135,11 @@ long can_ioctl(struct file *file, unsigned int cmd, unsigned long arg) } break; } - + case CONF_BAUDPARAMS: { struct can_baudparams_t params; int ret; - + ret = copy_from_user(¶ms, (void*)arg, sizeof(struct can_baudparams_t)); if(ret) return -EFAULT; @@ -162,7 +162,7 @@ long can_ioctl(struct file *file, unsigned int cmd, unsigned long arg) CANMSG("Not a valid ioctl command\n"); return -EINVAL; } - + } return 0;