Skip to content

Commit

Permalink
adapt to msg api change (#33)
Browse files Browse the repository at this point in the history
msg.o.raw and msg.o.err no longer point to the same address.

DONE: RTOS-792
  • Loading branch information
ziemleszcz authored Jun 28, 2024
1 parent 462b287 commit d0fb9b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions libusb/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ int usb_open(usb_devinfo_t *dev, usb_transfer_type_t type, usb_dir_t dir)
if ((ret = msgSend(usbdrv_common.port, &msg)) != 0)
return ret;

return *(int *)msg.o.raw;
return msg.o.err;
}


Expand Down Expand Up @@ -194,7 +194,7 @@ int usb_urbAlloc(unsigned pipe, void *data, usb_dir_t dir, size_t size, int type
return ret;

/* URB id */
return *(int *)msg.o.raw;
return msg.o.err;
}


Expand Down
7 changes: 2 additions & 5 deletions usb/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,7 @@ static int usb_handleOpen(usb_open_t *o, msg_t *msg)
if ((pipe = usb_drvPipeOpen(drv, hcd, o->locationID, o->iface, o->dir, o->type)) < 0)
return -EINVAL;

*(int *)msg->o.raw = pipe;

return 0;
return pipe;
}


Expand Down Expand Up @@ -274,8 +272,7 @@ static void usb_msgthr(void *arg)
msg.o.err = usb_handleConnect(&msg, &umsg->connect);
break;
case usb_msg_open:
if (usb_handleOpen(&umsg->open, &msg) != 0)
msg.o.err = -1;
msg.o.err = usb_handleOpen(&umsg->open, &msg);
break;
case usb_msg_urb:
ret = usb_handleUrb(&msg, port, rid);
Expand Down

0 comments on commit d0fb9b4

Please sign in to comment.