blob: 9e4037dcc6cb86952816ad49443ce0d8c201e6c4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
#ifndef TMINIT_H
#define TMINIT_H
#include <linux/usb.h>
/*
* This structs contains (in little endian) the response data
* of the wheel to the request 73
*
* A sufficient research to understand what each field does is not
* beign conducted yet. The position and meaning of fields are a
* just a very optimistic guess based on instinct....
*/
struct __packed tm_wheel_response
{
/*
* Seems to be the type of packet
* - 0x0049 if is data.a (15 bytes)
* - 0x0047 if is data.b (7 bytes)
*/
uint16_t type;
union {
struct __packed {
uint16_t field0;
uint16_t field1;
/*
* Seems to be the model code of the wheel
* Read table thrustmaster_wheels to values
*/
uint8_t attachment;
uint8_t model;
uint16_t field2;
uint16_t field3;
uint16_t field4;
uint16_t field5;
} a;
struct __packed {
uint16_t field0;
uint16_t field1;
uint8_t attachment;
uint8_t model;
} b;
} data;
};
struct tm_wheel {
struct usb_device *usb_dev;
struct usb_interface *interface;
struct urb *urb;
struct usb_ctrlrequest *model_request;
struct tm_wheel_response *response;
struct usb_ctrlrequest *change_request;
};
int thrustmaster_probe(struct tm_wheel *wheel, struct usb_interface *interface);
void thrustmaster_disconnect(struct tm_wheel *wheel);
#endif /* TMINIT_H */
|