summaryrefslogtreecommitdiff
path: root/host/opcd_usb.h
blob: 73043968f44cf82e50a08cb70e7a6ffcccfc62ea (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
#ifndef _OPCD_USB_H
#define _OPCD_USB_H

#include "ausb/ausb.h"

#define OPCD_INTBUF_SIZE 64
struct opcd_handle {
	struct ausb_dev_handle *hdl;
	struct usbdevfs_urb int_urb;
	u_int8_t int_buf[OPCD_INTBUF_SIZE];
};

extern const char *opcd_hexdump(const void *data, unsigned int len);

extern struct opcd_handle *opcd_init(int is_picc);
extern void opcd_fini(struct opcd_handle *od);

extern int opcd_recv_reply(struct opcd_handle *od, char *buf, int len);
extern int opcd_send_command(struct opcd_handle *od, u_int8_t cmd, 
			     u_int8_t reg, u_int8_t val, u_int16_t len,
			     const unsigned char *data);
extern int opcd_usbperf(struct opcd_handle *od, unsigned int frames);

#endif
personal git repositories of Harald Welte. Your mileage may vary