Skip to content

Commit

Permalink
usb: Move MPS check to device controller code
Browse files Browse the repository at this point in the history
Make check in usb_dc_ep_check_cap()

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
  • Loading branch information
finikorg committed Apr 5, 2019
1 parent 980dcef commit 3c750df
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions subsys/usb/usb_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,21 +474,8 @@ static bool set_endpoint(const struct usb_ep_descriptor *ep_desc)

ep_cfg.ep_type = ep_desc->bmAttributes;

switch (ep_cfg.ep_type) {
case USB_DC_EP_BULK:
if (ep_cfg.ep_mps > USB_MAX_BULK_MPS) {
return false;
}
case USB_DC_EP_CONTROL:
if (ep_cfg.ep_mps > MAX_PACKET_SIZE0) {
return false;
}
case USB_DC_EP_INTERRUPT:
if (ep_cfg.ep_mps > USB_MAX_INT_MPS) {
return false;
}
default:
break;
if (usb_dc_ep_check_cap(&ep_cfg) < 0) {
return false;
}

LOG_DBG("Configure endpoint 0x%x type %u MPS %u",
Expand Down

0 comments on commit 3c750df

Please sign in to comment.