Hi,
Here's a patch against 2.2.19-pre16 that updates the USB bluetooth driver to
the same level of 2.4.2.
(patch 1 of 7 in this bundle)
thanks,
greg k-h
p.s. It's "Greg Kroah-Hartman" (1 'n') :)
diff -Naur -X /home/greg/linux/dontdiff linux-2.2.19-pre16/drivers/usb/bluetooth.c
linux-2.2.19-pre16-greg/drivers/usb/bluetooth.c
--- linux-2.2.19-pre16/drivers/usb/bluetooth.c Sun Dec 10 16:49:43 2000
+++ linux-2.2.19-pre16-greg/drivers/usb/bluetooth.c Mon Mar 5 11:33:18 2001
@@ -1,11 +1,15 @@
/*
- * bluetooth.c Version 0.6
+ * bluetooth.c Version 0.7
*
* Copyright (c) 2000 Greg Kroah-Hartman <[EMAIL PROTECTED]>
* Copyright (c) 2000 Mark Douglas Corner <[EMAIL PROTECTED]>
*
* USB Bluetooth driver, based on the Bluetooth Spec version 1.0B
*
+ * (11/29/2000) Version 0.7 gkh
+ * Fixed problem with overrunning the tty flip buffer.
+ * Removed unneeded NULL pointer initialization.
+ *
* (10/05/2000) Version 0.6 gkh
* Fixed bug with urb->dev not being set properly, now that the usb
* core needs it.
@@ -73,9 +77,9 @@
#include <linux/init.h>
#include <linux/malloc.h>
#include <linux/fcntl.h>
+#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
-#include <linux/tty.h>
#include <linux/module.h>
#include <linux/devfs_fs_kernel.h>
@@ -199,8 +203,7 @@
static struct tty_struct * bluetooth_tty[BLUETOOTH_TTY_MINORS];
static struct termios * bluetooth_termios[BLUETOOTH_TTY_MINORS];
static struct termios * bluetooth_termios_locked[BLUETOOTH_TTY_MINORS];
-static struct usb_bluetooth *bluetooth_table[BLUETOOTH_TTY_MINORS] = {NULL, };
-
+static struct usb_bluetooth *bluetooth_table[BLUETOOTH_TTY_MINORS];
static inline int bluetooth_paranoia_check (struct usb_bluetooth *bluetooth, const
char *function)
@@ -315,6 +318,11 @@
tty->driver_data = bluetooth;
bluetooth->tty = tty;
+ /* force low_latency on so that our tty_push actually forces the data through,
+ * otherwise it is scheduled, and with high data rates (like with OHCI) data
+ * can get lost. */
+ bluetooth->tty->low_latency = 1;
+
bluetooth->active = 1;
/* Reset the packet position counters */
@@ -774,9 +782,14 @@
return;
}
- if (packet_size + EVENT_HDR_SIZE == bluetooth->int_packet_pos){
- for (i = 0; i < bluetooth->int_packet_pos; ++i)
+ if (packet_size + EVENT_HDR_SIZE == bluetooth->int_packet_pos) {
+ for (i = 0; i < bluetooth->int_packet_pos; ++i) {
+ /* if we insert more than TTY_FLIPBUF_SIZE characters, we drop
+them */
+ if (bluetooth->tty->flip.count >= TTY_FLIPBUF_SIZE) {
+ tty_flip_buffer_push(bluetooth->tty);
+ }
tty_insert_flip_char(bluetooth->tty, bluetooth->int_buffer[i],
0);
+ }
tty_flip_buffer_push(bluetooth->tty);
bluetooth->int_packet_pos = 0;
@@ -888,8 +901,13 @@
}
if (packet_size + ACL_HDR_SIZE == bluetooth->bulk_packet_pos) {
- for (i = 0; i < bluetooth->bulk_packet_pos; ++i)
+ for (i = 0; i < bluetooth->bulk_packet_pos; ++i) {
+ /* if we insert more than TTY_FLIPBUF_SIZE characters, we drop
+them. */
+ if (bluetooth->tty->flip.count >= TTY_FLIPBUF_SIZE) {
+ tty_flip_buffer_push(bluetooth->tty);
+ }
tty_insert_flip_char(bluetooth->tty,
bluetooth->bulk_buffer[i], 0);
+ }
tty_flip_buffer_push(bluetooth->tty);
bluetooth->bulk_packet_pos = 0;
}
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
http://lists.sourceforge.net/lists/listinfo/linux-usb-devel