aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb2/core/usb2_dynamic.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb2/core/usb2_dynamic.c')
-rw-r--r--sys/dev/usb2/core/usb2_dynamic.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/sys/dev/usb2/core/usb2_dynamic.c b/sys/dev/usb2/core/usb2_dynamic.c
index bf7ce591937d..3e0bdf12b443 100644
--- a/sys/dev/usb2/core/usb2_dynamic.c
+++ b/sys/dev/usb2/core/usb2_dynamic.c
@@ -39,6 +39,7 @@ static usb2_temp_get_desc_t usb2_temp_get_desc_w;
static usb2_temp_setup_by_index_t usb2_temp_setup_by_index_w;
static usb2_temp_unsetup_t usb2_temp_unsetup_w;
static usb2_test_quirk_t usb2_test_quirk_w;
+static usb2_test_huawei_autoinst_t usb2_test_huawei_autoinst_w;
static usb2_quirk_ioctl_t usb2_quirk_ioctl_w;
/* global variables */
@@ -46,6 +47,7 @@ usb2_temp_get_desc_t *usb2_temp_get_desc_p = &usb2_temp_get_desc_w;
usb2_temp_setup_by_index_t *usb2_temp_setup_by_index_p = &usb2_temp_setup_by_index_w;
usb2_temp_unsetup_t *usb2_temp_unsetup_p = &usb2_temp_unsetup_w;
usb2_test_quirk_t *usb2_test_quirk_p = &usb2_test_quirk_w;
+usb2_test_huawei_autoinst_t *usb2_test_huawei_autoinst_p = &usb2_test_huawei_autoinst_w;
usb2_quirk_ioctl_t *usb2_quirk_ioctl_p = &usb2_quirk_ioctl_w;
devclass_t usb2_devclass_ptr = NULL;
@@ -86,6 +88,13 @@ usb2_temp_unsetup_w(struct usb2_device *udev)
}
}
+static uint8_t
+usb2_test_huawei_autoinst_w(struct usb2_device *udev,
+ struct usb2_attach_arg *uaa)
+{
+ return (USB_ERR_INVAL);
+}
+
void
usb2_quirk_unload(void *arg)
{
@@ -130,3 +139,17 @@ usb2_bus_unload(void *arg)
pause("WAIT", hz);
}
+
+void
+usb2_test_huawei_unload(void *arg)
+{
+ /* reset function pointers */
+
+ usb2_test_huawei_autoinst_p = &usb2_test_huawei_autoinst_w;
+
+ /* wait for CPU to exit the loaded functions, if any */
+
+ /* XXX this is a tradeoff */
+
+ pause("WAIT", 16*hz);
+}