Here's the USB Bluetooth driver patch that fixes some problems again.
It is against 2.4.6-pre2.
Also, people might have noticed that the Bluez Bluetooth stack made it
into the kernel in 2.4.6-pre2, so I'm probably going to be changing the
bluetooth driver's name to something like usb-bluetooth.o in the future
to help prevent namespace collisions (there currently isn't one, but it
could make people confused.)
The bluetooth USB driver doesn't work with the Bluez bluetooth stack,
there is a different USB driver present for that stack (a much nicer
driver too, due to the different interface the Bluez code presents.)
thanks,
greg k-h
diff -Nru a/drivers/usb/bluetooth.c b/drivers/usb/bluetooth.c
--- a/drivers/usb/bluetooth.c Sun Jun 10 23:08:08 2001
+++ b/drivers/usb/bluetooth.c Sun Jun 10 23:08:08 2001
@@ -1,11 +1,15 @@
/*
- * bluetooth.c Version 0.10
+ * bluetooth.c Version 0.11
*
- * Copyright (c) 2000 Greg Kroah-Hartman <[EMAIL PROTECTED]>
+ * Copyright (c) 2000, 2001 Greg Kroah-Hartman <[EMAIL PROTECTED]>
* Copyright (c) 2000 Mark Douglas Corner <[EMAIL PROTECTED]>
*
* USB Bluetooth driver, based on the Bluetooth Spec version 1.0B
*
+ * (2001/06/05) Version 0.11 gkh
+ * - Fixed problem with read urb status saying that we have shutdown,
+ * and that we shouldn't resubmit the urb. Patch from unknown.
+ *
* (2001/05/28) Version 0.10 gkh
* - Fixed problem with using data from userspace in the bluetooth_write
* function as found by the CHECKER project.
@@ -15,6 +19,10 @@
* - Added a buffer to the control_urb_pool which fixes a memory leak
* when the device is removed from the system.
*
+ * (2001/05/28) Version 0.9 gkh
+ * Fixed problem with bluetooth==NULL for bluetooth_read_bulk_callback
+ * which was found by both the CHECKER project and Mikko Rahkonen.
+ *
* (08/04/2001) gb
* Identify version on module load.
*
@@ -106,7 +114,7 @@
/*
* Version Information
*/
-#define DRIVER_VERSION "v0.10"
+#define DRIVER_VERSION "v0.11"
#define DRIVER_AUTHOR "Greg Kroah-Hartman, Mark Douglas Corner"
#define DRIVER_DESC "USB Bluetooth driver"
@@ -863,21 +871,6 @@
unsigned int packet_size;
int result;
-#ifdef BTBUGGYHARDWARE
- if ((count == 4) && (data[0] == 0x00) && (data[1] == 0x00)
- && (data[2] == 0x00) && (data[3] == 0x00)) {
- urb->actual_length = 0;
- FILL_BULK_URB(bluetooth->read_urb, bluetooth->dev,
- usb_rcvbulkpipe(bluetooth->dev,
bluetooth->bulk_in_endpointAddress),
- bluetooth->bulk_in_buffer,
bluetooth->bulk_in_buffer_size,
- bluetooth_read_bulk_callback, bluetooth);
- result = usb_submit_urb(bluetooth->read_urb);
- if (result)
- err (__FUNCTION__ " - failed resubmitting read urb, error %d",
result);
-
- return;
- }
-#endif
dbg(__FUNCTION__);
@@ -888,6 +881,10 @@
if (urb->status) {
dbg(__FUNCTION__ " - nonzero read bulk status received: %d",
urb->status);
+ if (urb->status == -ENOENT) {
+ dbg(__FUNCTION__ " - URB canceled, won't reschedule");
+ return;
+ }
goto exit;
}
@@ -905,6 +902,21 @@
printk ("\n");
}
#endif
+#ifdef BTBUGGYHARDWARE
+ if ((count == 4) && (data[0] == 0x00) && (data[1] == 0x00)
+ && (data[2] == 0x00) && (data[3] == 0x00)) {
+ urb->actual_length = 0;
+ FILL_BULK_URB(bluetooth->read_urb, bluetooth->dev,
+ usb_rcvbulkpipe(bluetooth->dev,
+bluetooth->bulk_in_endpointAddress),
+ bluetooth->bulk_in_buffer,
+bluetooth->bulk_in_buffer_size,
+ bluetooth_read_bulk_callback, bluetooth);
+ result = usb_submit_urb(bluetooth->read_urb);
+ if (result)
+ err (__FUNCTION__ " - failed resubmitting read urb, error %d",
+result);
+
+ return;
+ }
+#endif
/* We add a packet type identifier to the beginning of each
HCI frame. This makes the data in the tty look like a
serial USB devices. Each HCI frame can be broken across
@@ -952,6 +964,9 @@
}
exit:
+ if (!bluetooth || !bluetooth->active)
+ return;
+
FILL_BULK_URB(bluetooth->read_urb, bluetooth->dev,
usb_rcvbulkpipe(bluetooth->dev,
bluetooth->bulk_in_endpointAddress),
bluetooth->bulk_in_buffer, bluetooth->bulk_in_buffer_size,