From c90c4320a4b60fe299505d5186fb501002b0f625 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 30 May 2013 19:28:19 +0200 Subject: [PATCH] detach the kernel driver before mode switch --- switch.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/switch.c b/switch.c index 7c5cff4..15933d4 100644 --- a/switch.c +++ b/switch.c @@ -7,9 +7,14 @@ enum { __DATA_MAX }; +static void detach_driver(struct usbdev_data *data) +{ + libusb_detach_kernel_driver(data->devh, data->interface); +} + static void handle_generic(struct usbdev_data *data, struct blob_attr **tb) { - fprintf(stderr, "Do generic switch!\n"); + detach_driver(data); } static void handle_huawei(struct usbdev_data *data, struct blob_attr **tb) @@ -34,11 +39,13 @@ static void handle_qisda(struct usbdev_data *data, struct blob_attr **tb) static void handle_gct(struct usbdev_data *data, struct blob_attr **tb) { + detach_driver(data); /* TODO */ } static void handle_kobil(struct usbdev_data *data, struct blob_attr **tb) { + detach_driver(data); /* TODO */ } @@ -54,6 +61,7 @@ static void handle_mobile_action(struct usbdev_data *data, struct blob_attr **tb static void handle_cisco(struct usbdev_data *data, struct blob_attr **tb) { + detach_driver(data); /* TODO */ } -- 2.25.1