mirror of
https://github.com/LineageOS/android_kernel_samsung_msm8226.git
synced 2026-09-29 00:00:25 +02:00
This module implements a bridge driver which allows user space to communicate with USB smart card devices. This module provides /dev/ccid_bridge device file which allows read/write/ioctl methods. The ioctls facilitate control and interrupt transfers. The bulk transfers are implemented via read and write. The interrupt endpoint is optional and not all devices may support it. Change-Id: I67ac7c7d15fb65c8f6a2cc9f9c81343da074aab7 Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
65 lines
1.7 KiB
C
65 lines
1.7 KiB
C
#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 */
|