minix/drivers/usbd/include/usb/hcd_interface.h
Kees Jongenburger 880ae44a72 usb:Adding usb enumeration.
usbd update from JPEmbedded

Change-Id: I4098b29a3188abe7110d59f0746ea40ac5818bbf

http://gerrit.minix3.org/#/c/2698/
2014-07-28 17:05:40 +02:00

57 lines
1.9 KiB
C
Executable file

/*
* Interface for HCD
*
* This file holds prototypes that must be implemented by HCD
* and event call that should be called when interrupt occurred
*/
#ifndef _HCD_INTERFACE_H_
#define _HCD_INTERFACE_H_
#include <usb/hcd_common.h>
/*===========================================================================*
* HCD additional defines *
*===========================================================================*/
/* Can be returned by 'read_data' to indicate error */
#define HCD_READ_ERR -1
/*===========================================================================*
* HCD driver structure to be filled
*===========================================================================*/
struct hcd_driver_state {
/* Standard USB controller procedures */
void (*setup_device) (void *, hcd_reg1, hcd_reg1);
int (*reset_device) (void *, hcd_speed *);
void (*setup_stage) (void *, hcd_ctrlrequest *);
void (*bulk_in_stage) (void *, hcd_bulkrequest *);
void (*bulk_out_stage) (void *, hcd_bulkrequest *);
void (*in_data_stage) (void *);
void (*out_data_stage) (void *);
void (*in_status_stage) (void *);
void (*out_status_stage) (void *);
int (*read_data) (void *, hcd_reg1 *, int);
int (*check_error) (void *, hcd_transfer, hcd_direction);
/* Controller's private data (like mapped registers) */
void * private_data;
/* Current state to be handled by driver */
hcd_event current_event;
int current_endpoint;
hcd_event expected_event;
int expected_endpoint;
};
/*===========================================================================*
* HCD event handling routine *
*===========================================================================*/
/* Handle asynchronous event
* This must be called in case of specific HCD interrupts listed above */
void hcd_handle_event(hcd_driver_state *);
#endif /* !_HCD_INTERFACE_H_ */