1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef USB6FIRE_COMM_H
14#define USB6FIRE_COMM_H
15
16#include "common.h"
17
18enum
19{
20 COMM_RECEIVER_BUFSIZE = 64,
21};
22
23struct comm_runtime {
24 struct sfire_chip *chip;
25
26 struct urb receiver;
27 u8 *receiver_buffer;
28
29 u8 serial;
30
31 void (*init_urb)(struct comm_runtime *rt, struct urb *urb, u8 *buffer,
32 void *context, void(*handler)(struct urb *urb));
33
34 int (*write8)(struct comm_runtime *rt, u8 request, u8 reg, u8 value);
35 int (*write16)(struct comm_runtime *rt, u8 request, u8 reg,
36 u8 vh, u8 vl);
37};
38
39int usb6fire_comm_init(struct sfire_chip *chip);
40void usb6fire_comm_abort(struct sfire_chip *chip);
41void usb6fire_comm_destroy(struct sfire_chip *chip);
42#endif
43
44