};
/**
- * enum cvmx_usb_complete - possible callback function status codes
+ * enum cvmx_usb_status - possible callback function status codes
*
- * @CVMX_USB_COMPLETE_SUCCESS: The transaction / operation finished without
+ * @CVMX_USB_STATUS_SUCCESS: The transaction / operation finished without
* any errors
- * @CVMX_USB_COMPLETE_SHORT: FIXME: This is currently not implemented
- * @CVMX_USB_COMPLETE_CANCEL: The transaction was canceled while in flight
+ * @CVMX_USB_STATUS_SHORT: FIXME: This is currently not implemented
+ * @CVMX_USB_STATUS_CANCEL: The transaction was canceled while in flight
* by a user call to cvmx_usb_cancel
- * @CVMX_USB_COMPLETE_ERROR: The transaction aborted with an unexpected
+ * @CVMX_USB_STATUS_ERROR: The transaction aborted with an unexpected
* error status
- * @CVMX_USB_COMPLETE_STALL: The transaction received a USB STALL response
+ * @CVMX_USB_STATUS_STALL: The transaction received a USB STALL response
* from the device
- * @CVMX_USB_COMPLETE_XACTERR: The transaction failed with an error from the
+ * @CVMX_USB_STATUS_XACTERR: The transaction failed with an error from the
* device even after a number of retries
- * @CVMX_USB_COMPLETE_DATATGLERR: The transaction failed with a data toggle
+ * @CVMX_USB_STATUS_DATATGLERR: The transaction failed with a data toggle
* error even after a number of retries
- * @CVMX_USB_COMPLETE_BABBLEERR: The transaction failed with a babble error
- * @CVMX_USB_COMPLETE_FRAMEERR: The transaction failed with a frame error
+ * @CVMX_USB_STATUS_BABBLEERR: The transaction failed with a babble error
+ * @CVMX_USB_STATUS_FRAMEERR: The transaction failed with a frame error
* even after a number of retries
*/
-enum cvmx_usb_complete {
- CVMX_USB_COMPLETE_SUCCESS,
- CVMX_USB_COMPLETE_SHORT,
- CVMX_USB_COMPLETE_CANCEL,
- CVMX_USB_COMPLETE_ERROR,
- CVMX_USB_COMPLETE_STALL,
- CVMX_USB_COMPLETE_XACTERR,
- CVMX_USB_COMPLETE_DATATGLERR,
- CVMX_USB_COMPLETE_BABBLEERR,
- CVMX_USB_COMPLETE_FRAMEERR,
+enum cvmx_usb_status {
+ CVMX_USB_STATUS_SUCCESS,
+ CVMX_USB_STATUS_SHORT,
+ CVMX_USB_STATUS_CANCEL,
+ CVMX_USB_STATUS_ERROR,
+ CVMX_USB_STATUS_STALL,
+ CVMX_USB_STATUS_XACTERR,
+ CVMX_USB_STATUS_DATATGLERR,
+ CVMX_USB_STATUS_BABBLEERR,
+ CVMX_USB_STATUS_FRAMEERR,
};
/**
struct cvmx_usb_iso_packet {
int offset;
int length;
- enum cvmx_usb_complete status;
+ enum cvmx_usb_status status;
};
/**
}
static void octeon_usb_urb_complete_callback(struct cvmx_usb_state *usb,
- enum cvmx_usb_complete status,
+ enum cvmx_usb_status status,
struct cvmx_usb_pipe *pipe,
struct cvmx_usb_transaction
*transaction,
struct usb_hcd *hcd = octeon_to_hcd(priv);
struct device *dev = hcd->self.controller;
- if (likely(status == CVMX_USB_COMPLETE_SUCCESS))
+ if (likely(status == CVMX_USB_STATUS_SUCCESS))
urb->actual_length = bytes_transferred;
else
urb->actual_length = 0;
/* Recalculate the transfer size by adding up each packet */
urb->actual_length = 0;
for (i = 0; i < urb->number_of_packets; i++) {
- if (iso_packet[i].status == CVMX_USB_COMPLETE_SUCCESS) {
+ if (iso_packet[i].status == CVMX_USB_STATUS_SUCCESS) {
urb->iso_frame_desc[i].status = 0;
urb->iso_frame_desc[i].actual_length =
iso_packet[i].length;
}
switch (status) {
- case CVMX_USB_COMPLETE_SUCCESS:
+ case CVMX_USB_STATUS_SUCCESS:
urb->status = 0;
break;
- case CVMX_USB_COMPLETE_CANCEL:
+ case CVMX_USB_STATUS_CANCEL:
if (urb->status == 0)
urb->status = -ENOENT;
break;
- case CVMX_USB_COMPLETE_STALL:
+ case CVMX_USB_STATUS_STALL:
dev_dbg(dev, "status=stall pipe=%p transaction=%p size=%d\n",
pipe, transaction, bytes_transferred);
urb->status = -EPIPE;
break;
- case CVMX_USB_COMPLETE_BABBLEERR:
+ case CVMX_USB_STATUS_BABBLEERR:
dev_dbg(dev, "status=babble pipe=%p transaction=%p size=%d\n",
pipe, transaction, bytes_transferred);
urb->status = -EPIPE;
break;
- case CVMX_USB_COMPLETE_SHORT:
+ case CVMX_USB_STATUS_SHORT:
dev_dbg(dev, "status=short pipe=%p transaction=%p size=%d\n",
pipe, transaction, bytes_transferred);
urb->status = -EREMOTEIO;
break;
- case CVMX_USB_COMPLETE_ERROR:
- case CVMX_USB_COMPLETE_XACTERR:
- case CVMX_USB_COMPLETE_DATATGLERR:
- case CVMX_USB_COMPLETE_FRAMEERR:
+ case CVMX_USB_STATUS_ERROR:
+ case CVMX_USB_STATUS_XACTERR:
+ case CVMX_USB_STATUS_DATATGLERR:
+ case CVMX_USB_STATUS_FRAMEERR:
dev_dbg(dev, "status=%d pipe=%p transaction=%p size=%d\n",
status, pipe, transaction, bytes_transferred);
urb->status = -EPROTO;
static void cvmx_usb_perform_complete(struct cvmx_usb_state *usb,
struct cvmx_usb_pipe *pipe,
struct cvmx_usb_transaction *transaction,
- enum cvmx_usb_complete complete_code)
+ enum cvmx_usb_status complete_code)
{
/* If this was a split then clear our split in progress marker */
if (usb->active_split == transaction)
* next one
*/
if ((transaction->iso_number_packets > 1) &&
- (complete_code == CVMX_USB_COMPLETE_SUCCESS)) {
+ (complete_code == CVMX_USB_STATUS_SUCCESS)) {
/* No bytes transferred for this packet as of yet */
transaction->actual_bytes = 0;
/* One less ISO waiting to transfer */
}
}
cvmx_usb_perform_complete(usb, pipe, transaction,
- CVMX_USB_COMPLETE_CANCEL);
+ CVMX_USB_STATUS_CANCEL);
return 0;
}
* such case we just need to fail every transaction.
*/
cvmx_usb_perform_complete(usb, pipe, transaction,
- CVMX_USB_COMPLETE_ERROR);
+ CVMX_USB_STATUS_ERROR);
return 0;
}
*/
pipe->pid_toggle = 0;
cvmx_usb_perform_complete(usb, pipe, transaction,
- CVMX_USB_COMPLETE_STALL);
+ CVMX_USB_STATUS_STALL);
} else if (usbc_hcint.s.xacterr) {
/*
* XactErr as a response means the device signaled
* toggle errors cause these.
*/
cvmx_usb_perform_complete(usb, pipe, transaction,
- CVMX_USB_COMPLETE_XACTERR);
+ CVMX_USB_STATUS_XACTERR);
} else if (usbc_hcint.s.bblerr) {
/* Babble Error (BblErr) */
cvmx_usb_perform_complete(usb, pipe, transaction,
- CVMX_USB_COMPLETE_BABBLEERR);
+ CVMX_USB_STATUS_BABBLEERR);
} else if (usbc_hcint.s.datatglerr) {
/* Data toggle error */
cvmx_usb_perform_complete(usb, pipe, transaction,
- CVMX_USB_COMPLETE_DATATGLERR);
+ CVMX_USB_STATUS_DATATGLERR);
} else if (usbc_hcint.s.nyet) {
/*
* NYET as a response is only allowed in three cases: as a
(bytes_in_last_packet < pipe->max_packet))
cvmx_usb_perform_complete(usb, pipe,
transaction,
- CVMX_USB_COMPLETE_SUCCESS);
+ CVMX_USB_STATUS_SUCCESS);
} else {
/*
* Split transactions retry the split complete 4 times
/* This should be impossible */
cvmx_usb_perform_complete(usb, pipe,
transaction,
- CVMX_USB_COMPLETE_ERROR);
+ CVMX_USB_STATUS_ERROR);
break;
case CVMX_USB_STAGE_SETUP:
pipe->pid_toggle = 1;
else
cvmx_usb_perform_complete(usb, pipe,
transaction,
- CVMX_USB_COMPLETE_SUCCESS);
+ CVMX_USB_STATUS_SUCCESS);
break;
case CVMX_USB_STAGE_STATUS_SPLIT_COMPLETE:
cvmx_usb_perform_complete(usb, pipe,
transaction,
- CVMX_USB_COMPLETE_SUCCESS);
+ CVMX_USB_STATUS_SUCCESS);
break;
}
break;
cvmx_usb_perform_complete(usb,
pipe,
transaction,
- CVMX_USB_COMPLETE_SUCCESS);
+ CVMX_USB_STATUS_SUCCESS);
}
} else {
if ((pipe->device_speed ==
pipe->interval;
cvmx_usb_perform_complete(usb, pipe,
transaction,
- CVMX_USB_COMPLETE_SUCCESS);
+ CVMX_USB_STATUS_SUCCESS);
}
}
break;
pipe->interval;
cvmx_usb_perform_complete(usb,
pipe, transaction,
- CVMX_USB_COMPLETE_SUCCESS);
+ CVMX_USB_STATUS_SUCCESS);
}
} else {
if (transaction->stage ==
cvmx_usb_perform_complete(usb,
pipe,
transaction,
- CVMX_USB_COMPLETE_SUCCESS);
+ CVMX_USB_STATUS_SUCCESS);
}
} else
transaction->stage =
pipe->next_tx_frame += pipe->interval;
cvmx_usb_perform_complete(usb, pipe,
transaction,
- CVMX_USB_COMPLETE_SUCCESS);
+ CVMX_USB_STATUS_SUCCESS);
}
break;
}
* sets when the cable is unplugged
*/
cvmx_usb_perform_complete(usb, pipe, transaction,
- CVMX_USB_COMPLETE_ERROR);
+ CVMX_USB_STATUS_ERROR);
}
}
return 0;
urb->iso_frame_desc[i].offset;
iso_packet[i].length =
urb->iso_frame_desc[i].length;
- iso_packet[i].status =
- CVMX_USB_COMPLETE_ERROR;
+ iso_packet[i].status = CVMX_USB_STATUS_ERROR;
}
/*
* Store a pointer to the list in the URB setup_packet