+ DWC_DEBUGPL(DBG_HCD_FLOOD, "OUT NAK enhancement disabled, no core support\n");
+ }
+
+ if (hc->halt_status == DWC_OTG_HC_XFER_NAK) {
+ /* The channel was nakking and halted to free up the
+ * channel for another transfer. If this channel has
+ * already received data, we need to skip that amount on
+ * the next try.
+ */
+ update_urb_state_xfer_intr(hc, hc_regs, qtd->urb,
+ qtd, DWC_OTG_HC_XFER_NAK);
+
+ save_data_toggle(hc, hc_regs, qtd);
+
+ /* It turns out that sometimes a channel is halted just
+ * as it receives its last packet. This causes the
+ * to trigger a channel halted interrupt without a
+ * transfer complete flag, even though the transfer is
+ * actually complete. If we don't handle that here, the
+ * qtd will be resubmitted and since bulk in can't have
+ * empty packets, this will cause one full packet of
+ * "extra" data to be transfered. So we check here to
+ * see if the transfer is complete and handle that
+ * accordingly.
+ */
+ if (usb_pipebulk(qtd->urb->pipe) &&
+ usb_pipein(qtd->urb->pipe) &&
+ qtd->urb->actual_length == qtd->urb->transfer_buffer_length) {
+ dwc_otg_hcd_complete_urb(hcd, qtd->urb, 0);
+ complete_non_periodic_xfer(hcd, hc, hc_regs, qtd, DWC_OTG_HC_XFER_URB_COMPLETE);
+ } else {
+ release_channel(hcd, hc, qtd, hc->halt_status);
+ }
+ return;