openpcd/firmware/src/os/usb_handler.h @ master
1 | 14055f6e | (no author) | #ifndef _USB_HANDLER_H
|
---|---|---|---|
2 | #define _USB_HANDLER_H
|
||
3 | |||
4 | 38f0dbf7 | (no author) | #include "openpcd.h"
|
5 | 83c18361 | (no author) | #include <os/req_ctx.h>
|
6 | 38f0dbf7 | (no author) | |
7 | 81416e6a | (no author) | #define MAX_PAYLOAD_LEN (64 - sizeof(struct openpcd_hdr))
|
8 | |||
9 | 514b0f72 | laforge | #define USB_RET_RESPOND (1 << 8)
|
10 | #define USB_RET_ERR (2 << 8)
|
||
11 | #define USB_ERR(x) (USB_RET_RESPOND|USB_RET_ERR|(x & 0xff))
|
||
12 | |||
13 | enum usbapi_err { |
||
14 | USB_ERR_NONE, |
||
15 | USB_ERR_CMD_UNKNOWN, |
||
16 | USB_ERR_CMD_NOT_IMPL, |
||
17 | };
|
||
18 | |||
19 | 81416e6a | (no author) | typedef int usb_cmd_fn(struct req_ctx *rctx); |
20 | |||
21 | 373c172a | Harald Welte | extern int usb_hdlr_register(usb_cmd_fn *hdlr, uint8_t class); |
22 | extern void usb_hdlr_unregister(uint8_t class); |
||
23 | 81416e6a | (no author) | |
24 | 14055f6e | (no author) | extern void usb_in_process(void); |
25 | 812c69de | (no author) | extern void usb_out_process(void); |
26 | 14055f6e | (no author) | |
27 | #endif
|