]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/src/ioctl.c
Separated normal read and RTR assisted read transfer.
[lincan.git] / lincan / src / ioctl.c
index caa35170a81bc14a06a28211cba943d5aee0c830..63aaea10188e1495f1024a8787c60d916d82b38a 100644 (file)
@@ -20,7 +20,7 @@ int can_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned
        unsigned btr0=0, btr1=0;
        struct canuser_t *canuser = (struct canuser_t*)(file->private_data);
        struct msgobj_t *obj;
        unsigned btr0=0, btr1=0;
        struct canuser_t *canuser = (struct canuser_t*)(file->private_data);
        struct msgobj_t *obj;
-       struct chip_t *chip;
+       struct canchip_t *chip;
        struct canque_ends_t *qends;
        
        if(!canuser || (canuser->magic != CAN_USER_MAGIC)){
        struct canque_ends_t *qends;
        
        if(!canuser || (canuser->magic != CAN_USER_MAGIC)){
@@ -84,6 +84,16 @@ int can_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned
                        }
                        break;
                }
                        }
                        break;
                }
+               
+               case CANRTR_READ: {
+                       int ret;
+                       struct canmsg_t rtr_msg;
+                       
+                       copy_from_user(&rtr_msg, (void*)arg, sizeof(struct canmsg_t));
+                       ret = can_ioctl_remote_read(canuser, &rtr_msg, rtr_msg.id, 0);
+                       if(ret<0) return ret;
+                       copy_to_user((void*)arg, &rtr_msg, sizeof(struct canmsg_t));
+               }
 
                case CONF_BAUD: {
                        channel = arg & 0xff;
 
                case CONF_BAUD: {
                        channel = arg & 0xff;