2006-08-08 17:19:09 +00:00
|
|
|
#ifndef _USB_HANDLER_H
|
|
|
|
#define _USB_HANDLER_H
|
|
|
|
|
2006-08-23 20:25:41 +00:00
|
|
|
#include "openpcd.h"
|
2006-09-09 04:42:17 +00:00
|
|
|
#include <os/req_ctx.h>
|
2006-08-23 20:25:41 +00:00
|
|
|
|
2006-08-16 13:26:04 +00:00
|
|
|
#define MAX_PAYLOAD_LEN (64 - sizeof(struct openpcd_hdr))
|
|
|
|
|
2006-09-20 11:44:10 +00:00
|
|
|
#define USB_RET_RESPOND (1 << 8)
|
|
|
|
#define USB_RET_ERR (2 << 8)
|
|
|
|
#define USB_ERR(x) (USB_RET_RESPOND|USB_RET_ERR|(x & 0xff))
|
|
|
|
|
|
|
|
enum usbapi_err {
|
|
|
|
USB_ERR_NONE,
|
|
|
|
USB_ERR_CMD_UNKNOWN,
|
|
|
|
USB_ERR_CMD_NOT_IMPL,
|
|
|
|
};
|
|
|
|
|
2006-08-16 13:26:04 +00:00
|
|
|
typedef int usb_cmd_fn(struct req_ctx *rctx);
|
|
|
|
|
2015-09-28 15:00:51 +00:00
|
|
|
extern int usb_hdlr_register(usb_cmd_fn *hdlr, uint8_t class);
|
|
|
|
extern void usb_hdlr_unregister(uint8_t class);
|
2006-08-16 13:26:04 +00:00
|
|
|
|
2006-08-08 17:19:09 +00:00
|
|
|
extern void usb_in_process(void);
|
2006-08-08 20:02:58 +00:00
|
|
|
extern void usb_out_process(void);
|
2006-08-08 17:19:09 +00:00
|
|
|
|
|
|
|
#endif
|