cvmx_usb_callback_func_t callback[__CVMX_USB_CALLBACK_END]; /**< User global callbacks */
void *callback_data[__CVMX_USB_CALLBACK_END]; /**< User data for each callback */
int indent; /**< Used by debug output to indent functions */
- cvmx_usb_port_status_t port_status; /**< Last port status used for change notification */
+ struct cvmx_usb_port_status port_status; /**< Last port status used for change notification */
cvmx_usb_pipe_list_t free_pipes; /**< List of all pipes that are currently closed */
cvmx_usb_pipe_list_t idle_pipes; /**< List of open pipes that have no transactions */
cvmx_usb_pipe_list_t active_pipes[4]; /**< Active pipes indexed by transfer type */
*
* Returns: Port status information
*/
-cvmx_usb_port_status_t cvmx_usb_get_status(cvmx_usb_state_t *state)
+struct cvmx_usb_port_status cvmx_usb_get_status(cvmx_usb_state_t *state)
{
cvmx_usbcx_hprt_t usbc_hprt;
- cvmx_usb_port_status_t result;
+ struct cvmx_usb_port_status result;
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state;
memset(&result, 0, sizeof(result));
* @port_status:
* Port status to set, most like returned by cvmx_usb_get_status()
*/
-void cvmx_usb_set_status(cvmx_usb_state_t *state, cvmx_usb_port_status_t port_status)
+void cvmx_usb_set_status(cvmx_usb_state_t *state, struct cvmx_usb_port_status port_status)
{
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state;
usb->port_status = port_status;
pipe->next_tx_frame = usb->frame_number + pipe->interval -
(usb->frame_number - pipe->next_tx_frame) % pipe->interval;
} else {
- cvmx_usb_port_status_t port;
+ struct cvmx_usb_port_status port;
port = cvmx_usb_get_status((cvmx_usb_state_t *)usb);
if (port.port_enabled) {
/* We'll retry the exact same transaction again */
};
/**
- * Structure returned containing the USB port status information.
+ * struct cvmx_usb_port_status - the USB port status information
+ *
+ * @port_enabled: 1 = Usb port is enabled, 0 = disabled
+ * @port_over_current: 1 = Over current detected, 0 = Over current not
+ * detected. Octeon doesn't support over current detection.
+ * @port_powered: 1 = Port power is being supplied to the device, 0 =
+ * power is off. Octeon doesn't support turning port power
+ * off.
+ * @port_speed: Current port speed.
+ * @connected: 1 = A device is connected to the port, 0 = No device is
+ * connected.
+ * @connect_change: 1 = Device connected state changed since the last set
+ * status call.
*/
-typedef struct
-{
- uint32_t reserved : 25;
- uint32_t port_enabled : 1; /**< 1 = Usb port is enabled, 0 = disabled */
- uint32_t port_over_current : 1; /**< 1 = Over current detected, 0 = Over current not detected. Octeon doesn't support over current detection */
- uint32_t port_powered : 1; /**< 1 = Port power is being supplied to the device, 0 = power is off. Octeon doesn't support turning port power off */
- enum cvmx_usb_speed port_speed : 2; /**< Current port speed */
- uint32_t connected : 1; /**< 1 = A device is connected to the port, 0 = No device is connected */
- uint32_t connect_change : 1; /**< 1 = Device connected state changed since the last set status call */
-} cvmx_usb_port_status_t;
+struct cvmx_usb_port_status {
+ uint32_t reserved : 25;
+ uint32_t port_enabled : 1;
+ uint32_t port_over_current : 1;
+ uint32_t port_powered : 1;
+ enum cvmx_usb_speed port_speed : 2;
+ uint32_t connected : 1;
+ uint32_t connect_change : 1;
+};
/**
* This is the structure of a Control packet header
extern int cvmx_usb_shutdown(cvmx_usb_state_t *state);
extern int cvmx_usb_enable(cvmx_usb_state_t *state);
extern int cvmx_usb_disable(cvmx_usb_state_t *state);
-extern cvmx_usb_port_status_t cvmx_usb_get_status(cvmx_usb_state_t *state);
-extern void cvmx_usb_set_status(cvmx_usb_state_t *state, cvmx_usb_port_status_t port_status);
+extern struct cvmx_usb_port_status cvmx_usb_get_status(cvmx_usb_state_t *state);
+extern void cvmx_usb_set_status(cvmx_usb_state_t *state, struct cvmx_usb_port_status port_status);
extern int cvmx_usb_open_pipe(cvmx_usb_state_t *state,
enum cvmx_usb_pipe_flags flags,
int device_addr, int endpoint_num,
static int octeon_usb_hub_status_data(struct usb_hcd *hcd, char *buf)
{
struct octeon_hcd *priv = hcd_to_octeon(hcd);
- cvmx_usb_port_status_t port_status;
+ struct cvmx_usb_port_status port_status;
unsigned long flags;
spin_lock_irqsave(&priv->lock, flags);
{
struct octeon_hcd *priv = hcd_to_octeon(hcd);
struct device *dev = hcd->self.controller;
- cvmx_usb_port_status_t usb_port_status;
+ struct cvmx_usb_port_status usb_port_status;
int port_status;
struct usb_hub_descriptor *desc;
unsigned long flags;