CFLAGS=-Wall
xilinx.so: xilinx.c xilinx.h
- gcc $(CFLAGS) $< -o $@ -ldl -shared
+ gcc $(CFLAGS) $< -o $@ -ldl -lusb -shared
clean:
rm -f xilinx.so
#include <sys/stat.h>
#include <sys/time.h>
#include <stdio.h>
+#include <usb.h>
#include "xilinx.h"
static int (*ioctl_func) (int, int, void *) = NULL;
static int windrvrfd = 0;
+static struct usb_bus *busses = NULL;
void hexdump(unsigned char *buf, int len);
void diff(unsigned char *buf1, unsigned char *buf2, int len);
if (!strcmp (pathname, "/dev/windrvr6")) {
fprintf(stderr,"opening windrvr6\n");
windrvrfd = fd;
+ if (!busses) {
+ usb_init();
+ usb_find_busses();
+ usb_find_devices();
+
+ busses = usb_get_busses();
+ }
}
return fd;