aboutsummaryrefslogtreecommitdiff
path: root/include/linux/usb/ccid_bridge.h
blob: 1d1b89500170e688855cd4bc86734379aae3bd62 (plain)
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
63
64
#ifndef __UAPI_USB_CCID_BRIDGE_H
#define __UAPI_USB_CCID_BRIDGE_H

#include <linux/ioctl.h>

/**
 * struct usb_ccid_data - Used to receive the CCID class descriptor,
 *        clock rates and data rates supported by the device.
 * @length: The length of the buffer.
 * @data: The buffer as it is returned by the device for GET_DESCRIPTOR,
 *        GET_CLOCK_FREQUENCIES and GET_DATA_RATES requests.
 */
struct usb_ccid_data {
	uint8_t length;
	void *data;
};

/**
 * struct usb_ccid_abort - Used to abort an already sent command.
 * @seq: The sequence number of the command.
 * @slot: The slot of the IC, on which the command is sent.
 */
struct usb_ccid_abort {
	uint8_t seq;
	uint8_t slot;
};

#define USB_CCID_NOTIFY_SLOT_CHANGE_EVENT 1
#define USB_CCID_HARDWARE_ERROR_EVENT 2
#define USB_CCID_RESUME_EVENT 3
/**
 * struct usb_ccid_event - Used to receive notify slot change or hardware
 *        error event.
 * @notify: If the event is USB_CCID_NOTIFY_SLOT_CHANGE_EVENT, slot_icc_state
 *        has the information about the current slots state.
 * @error: If the event is USB_CCID_HARDWARE_ERROR_EVENT, error has
 *        information about the hardware error condition.
 */
struct usb_ccid_event {
	uint8_t event;
	union {
		struct {
			uint8_t slot_icc_state;
		} notify;

		struct {
			uint8_t slot;
			uint8_t seq;
			uint8_t error_code;
		} error;
	} u;
};

#define USB_CCID_GET_CLASS_DESC _IOWR('C', 0, struct usb_ccid_data)

#define USB_CCID_GET_CLOCK_FREQUENCIES _IOWR('C', 1, struct usb_ccid_data)

#define USB_CCID_GET_DATA_RATES _IOWR('C', 2, struct usb_ccid_data)

#define USB_CCID_ABORT _IOW('C', 3, struct usb_ccid_abort)

#define USB_CCID_GET_EVENT _IOR('C', 4, struct usb_ccid_event)

#endif /* __UAPI_USB_CCID_BRIDGE_H */