Make MUSB use 'interval' for bulk transfers

This commit is contained in:
Wojciech Zajac 2014-06-23 12:59:39 +02:00 committed by Lionel Sambuc
parent e0f92bef05
commit e858b9b5e9
3 changed files with 10 additions and 18 deletions

View file

@ -605,6 +605,12 @@ hcd_non_control_urb(hcd_device_state * this_device, hcd_urb * urb)
return EXIT_FAILURE; return EXIT_FAILURE;
} }
/* Check if remembered interval matches */
if ((hcd_reg1)e->descriptor.bInterval != urb->interval) {
USB_MSG("EP interval mismatch");
return EXIT_FAILURE;
}
/* Assign URB values to data request structure */ /* Assign URB values to data request structure */
request.type = urb->type; request.type = urb->type;
request.endpoint = urb->endpoint; request.endpoint = urb->endpoint;

View file

@ -503,12 +503,8 @@ musb_rx_stage(void * cfg, hcd_datarequest * request)
/* Rewrite RXMAXP */ /* Rewrite RXMAXP */
HCD_WR2(r, MUSB_REG_RXMAXP, request->max_packet_size); HCD_WR2(r, MUSB_REG_RXMAXP, request->max_packet_size);
/* Set HOST_RXINTERVAL based on transfer type */ /* Set HOST_RXINTERVAL (which means interval or NAK limit) */
if (HCD_TRANSFER_BULK == request->type) HCD_WR1(r, MUSB_REG_HOST_RXINTERVAL, request->interval);
HCD_WR1(r, MUSB_REG_HOST_RXINTERVAL,
MUSB_VAL_HOST_XXINTERVAL_DEFAULT);
else if (HCD_TRANSFER_INTERRUPT == request->type)
HCD_WR1(r, MUSB_REG_HOST_RXINTERVAL, request->interval);
#if 0 #if 0
{ {
@ -597,12 +593,8 @@ musb_tx_stage(void * cfg, hcd_datarequest * request)
/* Rewrite TXMAXP */ /* Rewrite TXMAXP */
HCD_WR2(r, MUSB_REG_TXMAXP, request->max_packet_size); HCD_WR2(r, MUSB_REG_TXMAXP, request->max_packet_size);
/* Set HOST_TXINTERVAL based on transfer type */ /* Set HOST_TXINTERVAL (which means interval or NAK limit) */
if (HCD_TRANSFER_BULK == request->type) HCD_WR1(r, MUSB_REG_HOST_TXINTERVAL, request->interval);
HCD_WR1(r, MUSB_REG_HOST_TXINTERVAL,
MUSB_VAL_HOST_XXINTERVAL_DEFAULT);
else if (HCD_TRANSFER_INTERRUPT == request->type)
HCD_WR1(r, MUSB_REG_HOST_TXINTERVAL, request->interval);
#if 0 #if 0
{ {

View file

@ -141,12 +141,6 @@
HCD_BIT(2) | \ HCD_BIT(2) | \
HCD_BIT(3)) HCD_BIT(3))
/* HOST_RXINTERVAL/HOST_TXINTERVAL */
/* Default NAK limit for non-control transfer
* When too big this may cause driver to wait for
* quite long in case of NAK error */
#define MUSB_VAL_HOST_XXINTERVAL_DEFAULT 0x10u
/* HOST_RXCSR */ /* HOST_RXCSR */
#define MUSB_VAL_HOST_RXCSR_RXPKTRDY HCD_BIT(0) #define MUSB_VAL_HOST_RXCSR_RXPKTRDY HCD_BIT(0)
#define MUSB_VAL_HOST_RXCSR_FIFOFULL HCD_BIT(1) #define MUSB_VAL_HOST_RXCSR_FIFOFULL HCD_BIT(1)