#include <libusb.h>
#include <ccid-spec.h>
Go to the source code of this file.
Data Structures | |
struct | _chipcard |
struct | _cci |
struct | _xfr |
Defines | |
#define | trace(cci, fmt, x...) |
Functions | |
_private int | _probe_descriptors (struct libusb_device *dev, int *cp, int *ip, int *ap) |
Probe a USB device for a CCID interface. | |
_private int | _RDR_to_PC (struct _cci *cci, unsigned int slot, struct _xfr *xfr) |
_private unsigned int | _RDR_to_PC_SlotStatus (struct _cci *cci, struct _xfr *xfr) |
_private unsigned int | _RDR_to_PC_DataBlock (struct _cci *cci, struct _xfr *xfr) |
_private int | _PC_to_RDR_GetSlotStatus (struct _cci *cci, unsigned int slot, struct _xfr *xfr) |
_private int | _PC_to_RDR_IccPowerOn (struct _cci *cci, unsigned int slot, struct _xfr *xfr, unsigned int voltage) |
_private int | _PC_to_RDR_IccPowerOff (struct _cci *cci, unsigned int slot, struct _xfr *xfr) |
_private int | _PC_to_RDR_XfrBlock (struct _cci *cci, unsigned int slot, struct _xfr *xfr) |
_private int | _cci_wait_for_interrupt (struct _cci *cci) |
_private struct _xfr * | _xfr_do_alloc (size_t txbuf, size_t rxbuf) |
_private void | _xfr_do_free (struct _xfr *xfr) |
_private void | _hex_dumpf (FILE *f, const uint8_t *tmp, size_t len, size_t llen) |
#define trace | ( | cci, | |||
fmt, | |||||
x... | ) |
do { \ struct _cci *_CCI = cci; \ if ( _CCI->cci_tf ) { \ fprintf(_CCI->cci_tf, fmt , ##x); \ fflush(_CCI->cci_tf); \ } \ }while(0);
Definition at line 12 of file ccid-internal.h.
Referenced by _cci_wait_for_interrupt(), _chipcard_set_status(), _cmd_result(), _PC_to_RDR_GetSlotStatus(), _PC_to_RDR_IccPowerOff(), _PC_to_RDR_IccPowerOn(), _PC_to_RDR_XfrBlock(), _RDR_to_PC(), _RDR_to_PC_DataBlock(), _RDR_to_PC_SlotStatus(), cci_probe(), cp_cci_init(), fill_ccid_desc(), get_endpoint(), and probe_descriptors().
_private int _cci_wait_for_interrupt | ( | struct _cci * | cci | ) |
Definition at line 24 of file cci.c.
References _chipcard::cc_status, _cci::cci_dev, _cci::cci_intrp, _cci::cci_slot, _cci::cci_xfr, CHIPCARD_NOT_PRESENT, CHIPCARD_PRESENT, RDR_to_PC_HardwareError, RDR_to_PC_NotifySlotChange, trace, x_rbuflen(), and _xfr::x_rxhdr.
Referenced by chipcard_wait_for_card().
_private void _hex_dumpf | ( | FILE * | f, | |
const uint8_t * | tmp, | |||
size_t | len, | |||
size_t | llen | |||
) |
Definition at line 11 of file util.c.
Referenced by _PC_to_RDR_XfrBlock(), _RDR_to_PC_DataBlock(), fill_ccid_desc(), hex_dump(), and hex_dumpf().
Definition at line 301 of file cci.c.
References _PC_to_RDR(), ccid_msg::bMessageType, PC_to_RDR_GetSlotStatus, trace, and _xfr::x_txhdr.
Referenced by cci_probe(), chipcard_slot_status(), and chipcard_wait_for_card().
Definition at line 348 of file cci.c.
References _PC_to_RDR(), ccid_msg::bMessageType, PC_to_RDR_IccPowerOff, trace, and _xfr::x_txhdr.
Referenced by chipcard_slot_off().
_private int _PC_to_RDR_IccPowerOn | ( | struct _cci * | cci, | |
unsigned int | slot, | |||
struct _xfr * | xfr, | |||
unsigned int | voltage | |||
) |
Definition at line 315 of file cci.c.
References _PC_to_RDR(), ccid_msg::bMessageType, CHIPCARD_1_8V, CHIPCARD_3V, CHIPCARD_5V, CHIPCARD_AUTO_VOLTAGE, ccid_msg::out, PC_to_RDR_IccPowerOn, trace, and _xfr::x_txhdr.
Referenced by chipcard_slot_on().
Definition at line 287 of file cci.c.
References _hex_dumpf(), _PC_to_RDR(), ccid_msg::bMessageType, _cci::cci_tf, PC_to_RDR_XfrBlock, trace, _xfr::x_txbuf, _xfr::x_txhdr, and _xfr::x_txlen.
Referenced by chipcard_transact().
_private int _probe_descriptors | ( | struct libusb_device * | dev, | |
int * | cp, | |||
int * | ip, | |||
int * | ap | |||
) |
Probe a USB device for a CCID interface.
dev | ccidev_t representing a physical device. | |
cp | Pointer to an integer to retrieve configuration number. | |
ip | Pointer to an integer to retrieve interface number. | |
ap | Pointer to an integer to retrieve alternate setting number. |
Definition at line 260 of file ccidev.c.
References check_interface(), and check_vendor_dev_list().
Referenced by cci_probe(), ccid_device(), and ccid_get_device_list().
Definition at line 224 of file cci.c.
References _chipcard_set_status(), _cmd_result(), ccid_msg::bSeq, ccid_msg::bSlot, _cci::cci_seq, _cci::cci_slot, CCID_RESULT_TIMEOUT, do_recv(), ccid_msg::in, trace, _xfr::x_rxhdr, and _xfr::x_rxlen.
Referenced by cci_probe(), chipcard_slot_off(), chipcard_slot_on(), chipcard_slot_status(), chipcard_transact(), and chipcard_wait_for_card().
Definition at line 69 of file cci.c.
References _hex_dumpf(), ccid_msg::bMessageType, _cci::cci_tf, ccid_msg::in, RDR_to_PC_DataBlock, trace, _xfr::x_rxbuf, _xfr::x_rxhdr, and _xfr::x_rxlen.
Referenced by chipcard_slot_on(), and chipcard_transact().
Definition at line 78 of file cci.c.
References ccid_msg::bMessageType, CHIPCARD_CLOCK_ERR, CHIPCARD_CLOCK_START, CHIPCARD_CLOCK_STOP, CHIPCARD_CLOCK_STOP_H, CHIPCARD_CLOCK_STOP_L, ccid_msg::in, RDR_to_PC_SlotStatus, trace, and _xfr::x_rxhdr.
Referenced by cci_probe(), chipcard_slot_off(), and chipcard_slot_status().
_private struct _xfr* _xfr_do_alloc | ( | size_t | txbuf, | |
size_t | rxbuf | |||
) | [read] |
Definition at line 15 of file xfr.c.
References _xfr::x_rxbuf, _xfr::x_rxhdr, _xfr::x_rxmax, _xfr::x_txbuf, _xfr::x_txhdr, and _xfr::x_txmax.
Referenced by cci_probe(), and xfr_alloc().
_private void _xfr_do_free | ( | struct _xfr * | xfr | ) |
Definition at line 155 of file xfr.c.
Referenced by cci_close(), cci_probe(), and xfr_free().