Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
/* Structure for the RTR queue */
struct rtr_id {
unsigned long id;
/* Structure for the RTR queue */
struct rtr_id {
unsigned long id;
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;
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);
}
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;
/*struct canque_ends_t *qends;*/
DEBUGMSG("Remote transmission request\n");
/*struct canque_ends_t *qends;*/
DEBUGMSG("Remote transmission request\n");
}
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;
/* 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) {
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;
+