summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2fe2521)
This mode is there for compatibility reasons with old driver
version and should be moved to its own IOCTL.
struct canmsg_t read_msg;
DEBUGMSG("Remote transmission request\n");
struct canmsg_t read_msg;
DEBUGMSG("Remote transmission request\n");
+
+ copy_from_user(&read_msg, buffer, sizeof(struct canmsg_t));
+
can_spin_lock_irqsave(&hardware_p->rtr_lock, flags);
if (hardware_p->rtr_queue == NULL) { //No remote messages pending
new_rtr_entry=(struct rtr_id *)kmalloc(sizeof(struct rtr_id),GFP_ATOMIC);
can_spin_lock_irqsave(&hardware_p->rtr_lock, flags);
if (hardware_p->rtr_queue == NULL) { //No remote messages pending
new_rtr_entry=(struct rtr_id *)kmalloc(sizeof(struct rtr_id),GFP_ATOMIC);
interruptible_sleep_on(&new_rtr_entry->rtr_wq);
can_spin_lock_irqsave(&hardware_p->rtr_lock, flags);
interruptible_sleep_on(&new_rtr_entry->rtr_wq);
can_spin_lock_irqsave(&hardware_p->rtr_lock, flags);
- copy_to_user(buffer, &read_msg, sizeof(struct canmsg_t));
if (hardware_p->rtr_queue == new_rtr_entry) {
if (new_rtr_entry->next != NULL)
hardware_p->rtr_queue=new_rtr_entry->next;
if (hardware_p->rtr_queue == new_rtr_entry) {
if (new_rtr_entry->next != NULL)
hardware_p->rtr_queue=new_rtr_entry->next;
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);
+ copy_to_user(buffer, &read_msg, sizeof(struct canmsg_t));
+
copy_from_user(&read_msg, buffer, sizeof(struct canmsg_t));
if (read_msg.flags & MSG_RTR)
copy_from_user(&read_msg, buffer, sizeof(struct canmsg_t));
if (read_msg.flags & MSG_RTR)
+ /* FIXME: RTR processing should go to its own IOCTLs */
ret = can_rtr_read(chip, obj, buffer);
else
ret = can_std_read(file, qends, obj, buffer, length);
ret = can_rtr_read(chip, obj, buffer);
else
ret = can_std_read(file, qends, obj, buffer, length);