aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/usb_dynamic.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/usb_dynamic.c')
-rw-r--r--sys/dev/usb/usb_dynamic.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/sys/dev/usb/usb_dynamic.c b/sys/dev/usb/usb_dynamic.c
index d08e7f84afd8..24c13f9f5dc1 100644
--- a/sys/dev/usb/usb_dynamic.c
+++ b/sys/dev/usb/usb_dynamic.c
@@ -59,6 +59,9 @@
/* function prototypes */
static usb_handle_req_t usb_temp_get_desc_w;
static usb_temp_setup_by_index_t usb_temp_setup_by_index_w;
+#if USB_HAVE_COMPAT_LINUX
+static usb_linux_free_device_t usb_linux_free_device_w;
+#endif
static usb_temp_unsetup_t usb_temp_unsetup_w;
static usb_test_quirk_t usb_test_quirk_w;
static usb_quirk_ioctl_t usb_quirk_ioctl_w;
@@ -66,6 +69,9 @@ static usb_quirk_ioctl_t usb_quirk_ioctl_w;
/* global variables */
usb_handle_req_t *usb_temp_get_desc_p = &usb_temp_get_desc_w;
usb_temp_setup_by_index_t *usb_temp_setup_by_index_p = &usb_temp_setup_by_index_w;
+#if USB_HAVE_COMPAT_LINUX
+usb_linux_free_device_t *usb_linux_free_device_p = &usb_linux_free_device_w;
+#endif
usb_temp_unsetup_t *usb_temp_unsetup_p = &usb_temp_unsetup_w;
usb_test_quirk_t *usb_test_quirk_p = &usb_test_quirk_w;
usb_quirk_ioctl_t *usb_quirk_ioctl_p = &usb_quirk_ioctl_w;
@@ -103,6 +109,14 @@ usb_temp_unsetup_w(struct usb_device *udev)
udev->usb_template_ptr = NULL;
}
+#if USB_HAVE_COMPAT_LINUX
+static void
+usb_linux_free_device_w(struct usb_device *udev)
+{
+ /* NOP */
+}
+#endif
+
void
usb_quirk_unload(void *arg)
{
@@ -147,3 +161,19 @@ usb_bus_unload(void *arg)
pause("WAIT", hz);
}
+
+#if USB_HAVE_COMPAT_LINUX
+void
+usb_linux_unload(void *arg)
+{
+ /* reset function pointers */
+
+ usb_linux_free_device_p = &usb_linux_free_device_w;
+
+ /* wait for CPU to exit the loaded functions, if any */
+
+ /* XXX this is a tradeoff */
+
+ pause("WAIT", hz);
+}
+#endif