diff options
Diffstat (limited to 'usb-bsd.c')
-rw-r--r-- | usb-bsd.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -34,7 +34,11 @@ #undef USB_SPEED_LOW #include <sys/ioctl.h> +#ifndef __DragonFly__ #include <dev/usb/usb.h> +#else +#include <bus/usb/usb.h> +#endif #include <signal.h> /* This value has maximum potential at 16. @@ -68,7 +72,7 @@ static int ensure_ep_open(USBHostDevice *dev, int ep, int mode) ep = UE_GET_ADDR(ep); if (dev->ep_fd[ep] < 0) { -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__DragonFly__) snprintf(buf, sizeof(buf) - 1, "%s.%d", dev->devpath, ep); #else snprintf(buf, sizeof(buf) - 1, "%s.%02d", dev->devpath, ep); @@ -321,7 +325,7 @@ USBDevice *usb_host_device_open(const char *devname) return NULL; } -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__DragonFly__) snprintf(ctlpath, PATH_MAX, "/dev/%s", bus_info.udi_devnames[0]); #else snprintf(ctlpath, PATH_MAX, "/dev/%s.00", bus_info.udi_devnames[0]); @@ -411,7 +415,7 @@ static int usb_host_scan(void *opaque, USBScanFunc *func) if (strncmp(bus_info.udi_devnames[0], "ugen", 4) != 0) continue; -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__DragonFly__) snprintf(devbuf, sizeof(devbuf) - 1, "/dev/%s", bus_info.udi_devnames[0]); #else snprintf(devbuf, sizeof(devbuf) - 1, "/dev/%s.00", bus_info.udi_devnames[0]); |