]> rtime.felk.cvut.cz Git - lincan.git/commitdiff
Update remote request code prototype to compile with latest kernels.
authorPavel Pisa <pisa@cmp.felk.cvut.cz>
Sat, 25 Jul 2015 20:54:51 +0000 (22:54 +0200)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Sat, 25 Jul 2015 20:54:51 +0000 (22:54 +0200)
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
lincan/include/main.h
lincan/src/i82527.c
lincan/src/ioctl_remote.c

index 5b4e0e0dbb1633aa4c383b80b558c1f28bac047b..663f81f8bb64f2e86e8540438dd6e9fa34457b49 100644 (file)
@@ -397,6 +397,7 @@ struct mem_addr {
 /* Structure for the RTR queue */
 struct rtr_id {
        unsigned long id;
 /* Structure for the RTR queue */
 struct rtr_id {
        unsigned long id;
+       int ready_fl;
        struct canmsg_t *rtr_message;
        wait_queue_head_t rtr_wq;
        struct rtr_id *next;
        struct canmsg_t *rtr_message;
        wait_queue_head_t rtr_wq;
        struct rtr_id *next;
index 635dfc7b7f8d5fd93488e91e6719078cd0ede6d0..6445f5d1bafbe2dc56a5a2404b839a350aaaf718 100644 (file)
@@ -750,6 +750,7 @@ void i82527_irq_rtr_handler(struct canchip_t *chip, struct msgobj_t *obj,
 
        can_spin_unlock(&hardware_p->rtr_lock);
 
 
        can_spin_unlock(&hardware_p->rtr_lock);
 
+       rtr_search->ready_fl = 1;
        if (waitqueue_active(&rtr_search->rtr_wq))
                wake_up(&rtr_search->rtr_wq);
 }
        if (waitqueue_active(&rtr_search->rtr_wq))
                wake_up(&rtr_search->rtr_wq);
 }
index 5ba89f8ad00ef61cd6633982c62043ebfa2d8a9b..8c3dd77f03638d3012f6db384df5d2d2b19aca24 100644 (file)
@@ -46,6 +46,7 @@ int can_ioctl_remote_read(struct canuser_t *canuser, struct canmsg_t *rtr_msg,
        struct rtr_id *rtr_current, *new_rtr_entry;
        struct msgobj_t *obj;
        struct canchip_t *chip;
        struct rtr_id *rtr_current, *new_rtr_entry;
        struct msgobj_t *obj;
        struct canchip_t *chip;
+       int err;
        /*struct canque_ends_t *qends;*/
 
        DEBUGMSG("Remote transmission request\n");
        /*struct canque_ends_t *qends;*/
 
        DEBUGMSG("Remote transmission request\n");
@@ -84,6 +85,7 @@ int can_ioctl_remote_read(struct canuser_t *canuser, struct canmsg_t *rtr_msg,
        }
        init_waitqueue_head(&new_rtr_entry->rtr_wq);
        new_rtr_entry->id = rtr_id;
        }
        init_waitqueue_head(&new_rtr_entry->rtr_wq);
        new_rtr_entry->id = rtr_id;
+       new_rtr_entry->ready_fl = 0;
        new_rtr_entry->rtr_message = rtr_msg;
        new_rtr_entry->next=NULL;
 
        new_rtr_entry->rtr_message = rtr_msg;
        new_rtr_entry->next=NULL;
 
@@ -92,7 +94,8 @@ int can_ioctl_remote_read(struct canuser_t *canuser, struct canmsg_t *rtr_msg,
        /* Send remote transmission request */
        chip->chipspecops->remote_request(chip,obj);
        obj->ret = 0;
        /* Send remote transmission request */
        chip->chipspecops->remote_request(chip,obj);
        obj->ret = 0;
-       interruptible_sleep_on(&new_rtr_entry->rtr_wq);
+
+       err = wait_event_interruptible(new_rtr_entry->rtr_wq, new_rtr_entry->ready_fl);
 
        can_spin_lock_irqsave(&hardware_p->rtr_lock, flags);
        if (hardware_p->rtr_queue == new_rtr_entry) {
 
        can_spin_lock_irqsave(&hardware_p->rtr_lock, flags);
        if (hardware_p->rtr_queue == new_rtr_entry) {
@@ -113,6 +116,9 @@ int can_ioctl_remote_read(struct canuser_t *canuser, struct canmsg_t *rtr_msg,
        can_spin_unlock_irqrestore(&hardware_p->rtr_lock, flags);
        kfree(new_rtr_entry);
 
        can_spin_unlock_irqrestore(&hardware_p->rtr_lock, flags);
        kfree(new_rtr_entry);
 
+       if (err)
+               return -EINTR;
+
        return obj->ret;
 }
 
        return obj->ret;
 }