Commit 63ca48a7 authored by Johann Fischer's avatar Johann Fischer Committed by Carles Cufí
Browse files

drivers: usb_dc_native_posix: use ep_dir and ep_idx in usbip_send_common


Use ep_idx in usbip_send_common() instead of endpoint address
and get direction from endpoint address.
Signed-off-by: default avatarJohann Fischer <johann.fischer@nordicsemi.no>
parent 735ba17c
...@@ -432,12 +432,14 @@ int usbip_send(uint8_t ep, const uint8_t *data, size_t len) ...@@ -432,12 +432,14 @@ int usbip_send(uint8_t ep, const uint8_t *data, size_t len)
bool usbip_send_common(uint8_t ep, uint32_t data_len) bool usbip_send_common(uint8_t ep, uint32_t data_len)
{ {
struct usbip_submit_rsp rsp; struct usbip_submit_rsp rsp;
uint32_t ep_dir = USB_EP_DIR_IS_IN(ep) ? USBIP_DIR_IN : USBIP_DIR_OUT;
uint32_t ep_idx = USB_EP_GET_IDX(ep);
rsp.common.command = htonl(USBIP_RET_SUBMIT); rsp.common.command = htonl(USBIP_RET_SUBMIT);
rsp.common.seqnum = htonl(seqnum_global); rsp.common.seqnum = htonl(seqnum_global);
rsp.common.devid = htonl(0); rsp.common.devid = htonl(0);
rsp.common.direction = htonl(0); /* TODO get from ep */ rsp.common.direction = htonl(ep_dir);
rsp.common.ep = htonl(ep); rsp.common.ep = htonl(ep_idx);
rsp.status = htonl(0); rsp.status = htonl(0);
rsp.actual_length = htonl(data_len); rsp.actual_length = htonl(data_len);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment