* @complete_code:
* Completion code
*/
-static void cvmx_usb_perform_complete(struct cvmx_usb_state *usb,
- struct cvmx_usb_pipe *pipe,
- struct cvmx_usb_transaction *transaction,
- enum cvmx_usb_status complete_code)
+static void cvmx_usb_complete(struct cvmx_usb_state *usb,
+ struct cvmx_usb_pipe *pipe,
+ struct cvmx_usb_transaction *transaction,
+ enum cvmx_usb_status complete_code)
{
/* If this was a split then clear our split in progress marker */
if (usb->active_split == transaction)
usbc_hcchar.u32);
}
}
- cvmx_usb_perform_complete(usb, pipe, transaction,
- CVMX_USB_STATUS_CANCEL);
+ cvmx_usb_complete(usb, pipe, transaction, CVMX_USB_STATUS_CANCEL);
return 0;
}
* keeps substracting same byte count over and over again. In
* such case we just need to fail every transaction.
*/
- cvmx_usb_perform_complete(usb, pipe, transaction,
- CVMX_USB_STATUS_ERROR);
+ cvmx_usb_complete(usb, pipe, transaction,
+ CVMX_USB_STATUS_ERROR);
return 0;
}
* the actual bytes transferred
*/
pipe->pid_toggle = 0;
- cvmx_usb_perform_complete(usb, pipe, transaction,
- CVMX_USB_STATUS_STALL);
+ cvmx_usb_complete(usb, pipe, transaction,
+ CVMX_USB_STATUS_STALL);
} else if (usbc_hcint.s.xacterr) {
/*
* XactErr as a response means the device signaled
* something wrong with the transfer. For example, PID
* toggle errors cause these.
*/
- cvmx_usb_perform_complete(usb, pipe, transaction,
- CVMX_USB_STATUS_XACTERR);
+ cvmx_usb_complete(usb, pipe, transaction,
+ CVMX_USB_STATUS_XACTERR);
} else if (usbc_hcint.s.bblerr) {
/* Babble Error (BblErr) */
- cvmx_usb_perform_complete(usb, pipe, transaction,
- CVMX_USB_STATUS_BABBLEERR);
+ cvmx_usb_complete(usb, pipe, transaction,
+ CVMX_USB_STATUS_BABBLEERR);
} else if (usbc_hcint.s.datatglerr) {
/* Data toggle error */
- cvmx_usb_perform_complete(usb, pipe, transaction,
- CVMX_USB_STATUS_DATATGLERR);
+ cvmx_usb_complete(usb, pipe, transaction,
+ CVMX_USB_STATUS_DATATGLERR);
} else if (usbc_hcint.s.nyet) {
/*
* NYET as a response is only allowed in three cases: as a
*/
if ((buffer_space_left == 0) ||
(bytes_in_last_packet < pipe->max_packet))
- cvmx_usb_perform_complete(usb, pipe,
- transaction,
- CVMX_USB_STATUS_SUCCESS);
+ cvmx_usb_complete(usb, pipe,
+ transaction,
+ CVMX_USB_STATUS_SUCCESS);
} else {
/*
* Split transactions retry the split complete 4 times
case CVMX_USB_STAGE_NON_CONTROL:
case CVMX_USB_STAGE_NON_CONTROL_SPLIT_COMPLETE:
/* This should be impossible */
- cvmx_usb_perform_complete(usb, pipe,
- transaction,
- CVMX_USB_STATUS_ERROR);
+ cvmx_usb_complete(usb, pipe, transaction,
+ CVMX_USB_STATUS_ERROR);
break;
case CVMX_USB_STAGE_SETUP:
pipe->pid_toggle = 1;
transaction->stage =
CVMX_USB_STAGE_STATUS_SPLIT_COMPLETE;
else
- cvmx_usb_perform_complete(usb, pipe,
- transaction,
- CVMX_USB_STATUS_SUCCESS);
- break;
- case CVMX_USB_STAGE_STATUS_SPLIT_COMPLETE:
- cvmx_usb_perform_complete(usb, pipe,
+ cvmx_usb_complete(usb, pipe,
transaction,
CVMX_USB_STATUS_SUCCESS);
break;
+ case CVMX_USB_STAGE_STATUS_SPLIT_COMPLETE:
+ cvmx_usb_complete(usb, pipe, transaction,
+ CVMX_USB_STATUS_SUCCESS);
+ break;
}
break;
case CVMX_USB_TRANSFER_BULK:
CVMX_USB_TRANSFER_INTERRUPT)
pipe->next_tx_frame +=
pipe->interval;
- cvmx_usb_perform_complete(usb,
- pipe,
- transaction,
- CVMX_USB_STATUS_SUCCESS);
+ cvmx_usb_complete(usb, pipe,
+ transaction,
+ CVMX_USB_STATUS_SUCCESS);
}
} else {
if ((pipe->device_speed ==
CVMX_USB_TRANSFER_INTERRUPT)
pipe->next_tx_frame +=
pipe->interval;
- cvmx_usb_perform_complete(usb, pipe,
- transaction,
- CVMX_USB_STATUS_SUCCESS);
+ cvmx_usb_complete(usb, pipe,
+ transaction,
+ CVMX_USB_STATUS_SUCCESS);
}
}
break;
(bytes_this_transfer < 188)) {
pipe->next_tx_frame +=
pipe->interval;
- cvmx_usb_perform_complete(usb,
- pipe, transaction,
- CVMX_USB_STATUS_SUCCESS);
+ cvmx_usb_complete(usb, pipe,
+ transaction,
+ CVMX_USB_STATUS_SUCCESS);
}
} else {
if (transaction->stage ==
pipe->max_packet)) {
pipe->next_tx_frame +=
pipe->interval;
- cvmx_usb_perform_complete(usb,
- pipe,
- transaction,
- CVMX_USB_STATUS_SUCCESS);
+ cvmx_usb_complete(usb,
+ pipe,
+ transaction,
+ CVMX_USB_STATUS_SUCCESS);
}
} else
transaction->stage =
}
} else {
pipe->next_tx_frame += pipe->interval;
- cvmx_usb_perform_complete(usb, pipe,
- transaction,
- CVMX_USB_STATUS_SUCCESS);
+ cvmx_usb_complete(usb, pipe, transaction,
+ CVMX_USB_STATUS_SUCCESS);
}
break;
}
* We get channel halted interrupts with no result bits
* sets when the cable is unplugged
*/
- cvmx_usb_perform_complete(usb, pipe, transaction,
- CVMX_USB_STATUS_ERROR);
+ cvmx_usb_complete(usb, pipe, transaction,
+ CVMX_USB_STATUS_ERROR);
}
}
return 0;