support host intr transfer maxpacket more than 16
authoryangkai <yk@rock-chips.com>
Tue, 13 Nov 2012 09:30:44 +0000 (17:30 +0800)
committeryangkai <yk@rock-chips.com>
Tue, 13 Nov 2012 09:30:44 +0000 (17:30 +0800)
drivers/usb/dwc_otg/dwc_otg_cil.c
drivers/usb/dwc_otg/dwc_otg_hcd_intr.c

index 3eefe676d364aa493c5077c6ebfb0599c414022e..8acc6b0cdacf968985fda22f09b91bf720ce3985 100755 (executable)
@@ -1540,7 +1540,7 @@ void dwc_otg_hc_start_transfer(dwc_otg_core_if_t *_core_if, dwc_hc_t *_hc)
                        uint32_t max_periodic_len = _hc->multi_count * _hc->max_packet;
                        if (_hc->xfer_len > max_periodic_len) 
                        {
-                               _hc->xfer_len = max_periodic_len;
+//                             _hc->xfer_len = max_periodic_len;
                        } 
                        else 
                        {
index 175708a3079aa26a7d8ce3290eb339e5e101fbbc..18ffb15d39e22cebef81a004eef5d6602d8e07ba 100755 (executable)
@@ -1134,8 +1134,12 @@ static int32_t handle_hc_xfercomp_intr(dwc_otg_hcd_t *_hcd,
                break;
        case PIPE_INTERRUPT:
                DWC_DEBUGPL(DBG_HCDV, "  Interrupt transfer complete\n");
-               update_urb_state_xfer_comp(_hc, _hc_regs, urb, _qtd);
-
+               urb_xfer_done = update_urb_state_xfer_comp(_hc, _hc_regs, urb, _qtd);
+               if(!urb_xfer_done){
+                   save_data_toggle(_hc, _hc_regs, _qtd);
+               halt_channel(_hcd, _hc, _qtd, DWC_OTG_HC_XFER_NAK);
+               break;
+               }
                /*
                 * Interrupt URB is done on the first transfer complete
                 * interrupt.
@@ -1297,6 +1301,8 @@ static int32_t handle_hc_nak_intr(dwc_otg_hcd_t *_hcd,
                break;
        case PIPE_INTERRUPT:
                _qtd->error_count = 0;
+        update_urb_state_xfer_intr(_hc, _hc_regs, _qtd->urb,_qtd, DWC_OTG_HC_XFER_NAK);
+        save_data_toggle(_hc, _hc_regs, _qtd);
                halt_channel(_hcd, _hc, _qtd, DWC_OTG_HC_XFER_NAK);
                break;
        case PIPE_ISOCHRONOUS: