endpoint address was only set in fs descriptor, but we need it in hs too. Update storage device descriptor dynamic based on dcd
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14507 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4ecd9716bd
commit
17f2dd5c13
4 changed files with 18 additions and 6 deletions
|
@ -613,10 +613,6 @@ int usb_arcotg_dcd_enable(struct usb_ep* ep,
|
|||
+ }
|
||||
#endif
|
||||
|
||||
/* set address of used ep in desc */
|
||||
logf("ep address %x", desc->bEndpointAddress);
|
||||
desc->bEndpointAddress |= ep->ep_num;
|
||||
|
||||
/* here initialize variable of ep */
|
||||
ep->maxpacket = max;
|
||||
ep->desc = desc;
|
||||
|
|
|
@ -165,5 +165,11 @@ static int ep_matches(struct usb_ep* ep, struct usb_endpoint_descriptor* desc)
|
|||
|
||||
/* MATCH!! */
|
||||
|
||||
/* set address of used ep in desc */
|
||||
logf("ep address %x", desc->bEndpointAddress);
|
||||
desc->bEndpointAddress |= ep->ep_num;
|
||||
|
||||
ep->desc = desc;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -201,6 +201,10 @@ int usb_serial_driver_bind(void* controler_ops)
|
|||
serial_debug_desc.bDebugInEndpoint = dev.in->ep_num;
|
||||
serial_debug_desc.bDebugOutEndpoint = dev.out->ep_num;
|
||||
|
||||
/* update hs descriptors as we asume that endpoints are the same for fs and hs */
|
||||
serial_hs_in_desc.bEndpointAddress = serial_fs_in_desc.bEndpointAddress;
|
||||
serial_hs_out_desc.bEndpointAddress = serial_fs_out_desc.bEndpointAddress;
|
||||
|
||||
return 0;
|
||||
|
||||
autoconf_fail:
|
||||
|
|
|
@ -53,7 +53,6 @@ static struct usb_device_descriptor storage_device_desc = {
|
|||
.bDeviceClass = 0,
|
||||
.bDeviceSubClass = 0,
|
||||
.bDeviceProtocol = 0,
|
||||
.bMaxPacketSize0 = 64,
|
||||
.idVendor = 0xffff,
|
||||
.idProduct = 0x0001,
|
||||
.iManufacturer = 0,
|
||||
|
@ -181,6 +180,13 @@ int usb_storage_driver_bind(void* controler_ops)
|
|||
dev.out->claimed = true;
|
||||
logf("usb storage: out: %s", dev.out->name);
|
||||
|
||||
/* update device decsriptor */
|
||||
storage_device_desc.bMaxPacketSize0 = ops->ep0->maxpacket;
|
||||
|
||||
/* update hs descriptors as we asume that endpoints are the same for fs and hs */
|
||||
storage_hs_bulk_in_desc.bEndpointAddress = storage_fs_bulk_in_desc.bEndpointAddress;
|
||||
storage_hs_bulk_out_desc.bEndpointAddress = storage_fs_bulk_out_desc.bEndpointAddress;
|
||||
|
||||
return 0;
|
||||
|
||||
autoconf_fail:
|
||||
|
|
Loading…
Reference in a new issue