--- a/cmake/Modules/FindUSB.cmake
+++ b/cmake/Modules/FindUSB.cmake
@@ -8,7 +8,7 @@
     /usr/local/include
   )
 
-  find_library(LIBUSB_LIBRARIES NAMES usb-1.0
+  find_library(LIBUSB_LIBRARIES NAMES usb-1.0 usb
     PATHS
     ${LIBUSB_PKG_LIBRARY_DIRS}
     /usr/lib
--- a/lib/hid/hid.c
+++ b/lib/hid/hid.c
@@ -59,7 +59,7 @@
 #define LOG(...) do {} while (0)
 #endif
 
-#ifndef __FreeBSD__
+#if !defined( __FreeBSD__ ) || !defined(__FreeBSD_kernel__)
 #define DETACH_KERNEL_DRIVER
 #endif
 
@@ -250,7 +250,7 @@
 }
 #endif /* INVASIVE_GET_USAGE */
 
-#ifdef __FreeBSD__
+#if 0
 /* The FreeBSD version of libusb doesn't have this funciton. In mainline
    libusb, it's inlined in libusb.h. This function will bear a striking
    resemblence to that one, because there's about one way to code it.
@@ -333,7 +333,7 @@
 	size_t inbytes;
 	size_t outbytes;
 	size_t res;
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 	const char *inptr;
 #else
 	char *inptr;
