ccid_bridge.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef __UAPI_USB_CCID_BRIDGE_H
  2. #define __UAPI_USB_CCID_BRIDGE_H
  3. #include <linux/ioctl.h>
  4. /**
  5. * struct usb_ccid_data - Used to receive the CCID class descriptor,
  6. * clock rates and data rates supported by the device.
  7. * @length: The length of the buffer.
  8. * @data: The buffer as it is returned by the device for GET_DESCRIPTOR,
  9. * GET_CLOCK_FREQUENCIES and GET_DATA_RATES requests.
  10. */
  11. struct usb_ccid_data {
  12. uint8_t length;
  13. void *data;
  14. };
  15. /**
  16. * struct usb_ccid_abort - Used to abort an already sent command.
  17. * @seq: The sequence number of the command.
  18. * @slot: The slot of the IC, on which the command is sent.
  19. */
  20. struct usb_ccid_abort {
  21. uint8_t seq;
  22. uint8_t slot;
  23. };
  24. #define USB_CCID_NOTIFY_SLOT_CHANGE_EVENT 1
  25. #define USB_CCID_HARDWARE_ERROR_EVENT 2
  26. #define USB_CCID_RESUME_EVENT 3
  27. /**
  28. * struct usb_ccid_event - Used to receive notify slot change or hardware
  29. * error event.
  30. * @notify: If the event is USB_CCID_NOTIFY_SLOT_CHANGE_EVENT, slot_icc_state
  31. * has the information about the current slots state.
  32. * @error: If the event is USB_CCID_HARDWARE_ERROR_EVENT, error has
  33. * information about the hardware error condition.
  34. */
  35. struct usb_ccid_event {
  36. uint8_t event;
  37. union {
  38. struct {
  39. uint8_t slot_icc_state;
  40. } notify;
  41. struct {
  42. uint8_t slot;
  43. uint8_t seq;
  44. uint8_t error_code;
  45. } error;
  46. } u;
  47. };
  48. #define USB_CCID_GET_CLASS_DESC _IOWR('C', 0, struct usb_ccid_data)
  49. #define USB_CCID_GET_CLOCK_FREQUENCIES _IOWR('C', 1, struct usb_ccid_data)
  50. #define USB_CCID_GET_DATA_RATES _IOWR('C', 2, struct usb_ccid_data)
  51. #define USB_CCID_ABORT _IOW('C', 3, struct usb_ccid_abort)
  52. #define USB_CCID_GET_EVENT _IOR('C', 4, struct usb_ccid_event)
  53. #endif /* __UAPI_USB_CCID_BRIDGE_H */