1
2
3
4
5 #ifndef __ADB_H
6 #define __ADB_H
7
8 #include <uapi/linux/adb.h>
9
10
11 struct adb_request {
12 unsigned char data[32];
13 int nbytes;
14 unsigned char reply[32];
15 int reply_len;
16 unsigned char reply_expected;
17 unsigned char sent;
18 unsigned char complete;
19 void (*done)(struct adb_request *);
20 void *arg;
21 struct adb_request *next;
22 };
23
24 struct adb_ids {
25 int nids;
26 unsigned char id[16];
27 };
28
29
30
31 struct adb_driver {
32 char name[16];
33 int (*probe)(void);
34 int (*init)(void);
35 int (*send_request)(struct adb_request *req, int sync);
36 int (*autopoll)(int devs);
37 void (*poll)(void);
38 int (*reset_bus)(void);
39 };
40
41
42 #define ADBREQ_REPLY 1
43 #define ADBREQ_SYNC 2
44 #define ADBREQ_NOSEND 4
45
46
47
48 enum adb_message {
49 ADB_MSG_POWERDOWN,
50 ADB_MSG_PRE_RESET,
51 ADB_MSG_POST_RESET
52 };
53 extern struct blocking_notifier_head adb_client_list;
54
55 int adb_request(struct adb_request *req, void (*done)(struct adb_request *),
56 int flags, int nbytes, ...);
57 int adb_register(int default_id,int handler_id,struct adb_ids *ids,
58 void (*handler)(unsigned char *, int, int));
59 int adb_unregister(int index);
60 void adb_poll(void);
61 void adb_input(unsigned char *, int, int);
62 int adb_reset_bus(void);
63
64 int adb_try_handler_change(int address, int new_id);
65 int adb_get_infos(int address, int *original_address, int *handler_id);
66
67 #endif