[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bluetooth-dev] ppp over axis stack in 2.4 kernel



Hi,

Here's a patch file for axis stack in 2.4.0-test7 kernel.
But, ppp can't work over axis stack. :(
You can try it. Good luck.

1. mkdir /dev/tts; mknod /dev/tts/0 c 4 64
   (/dev/tts/0 is the same as the /dev/ttyS0 in 2.2.x kernel)
2. may be add follow lines to /etc/conf.modules (see ppp document)
   alias tty-ldisc-3 ppp_async
   alias tty-ldisc-14 ppp_synctty
   alias tty-major-108 ppp_generic
   (maybe reboot it)
3. copy the patch file to bluetooth/src
4. cd bluetooth/src; patch -p1 < bluetooth_20000814_patch-2.4.0-test7
5. make clean; make; insmod bt.o
6. btd -u /dev/tts/0 (see bluetooth/src/README)

diff -urN src/bluetooth.c src_seasky_mdy/bluetooth.c
--- src/bluetooth.c	Mon Aug 14 21:03:31 2000
+++ src_seasky_mdy/bluetooth.c	Mon Oct  2 17:49:21 2000
@@ -42,6 +42,15 @@
 #include <linux/bluetooth/bt_proc.h>
 #endif
 
+#include <linux/version.h>
+#ifndef KERNEL_VERSION
+#define KERNEL_VERSION(a,b,c) (((a) << 16) | ((b) << 8) | (c))
+#endif
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
+read_proc_t bt_read_proc;
+#endif
+
 #ifdef ELINUX_BT_TEST
 #include "../etrax100ser.h"
 #include <asm/svinto.h>
@@ -168,7 +177,11 @@
 static struct termios *bt_termios[BT_NR_PORTS]; 
 static struct termios *bt_termios_locked[BT_NR_PORTS];
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
+static DECLARE_WAIT_QUEUE_HEAD (connect_wq);
+#else
 static struct wait_queue *connect_wq = NULL;
+#endif
 static s32 con_status;
 
 static serport_profile_info p_ser;
@@ -1063,7 +1076,12 @@
 
 #ifdef KERNEL_VERSION /* Not defined for kernel 2.0.x */
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,2,0)
-	procfs_status = proc_register(&proc_root, &bt_proc_file);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
+	create_proc_read_entry ("bt", 0, NULL, bt_read_proc , NULL);
+	procfs_status = 0;
+#else
+        procfs_status = proc_register(&proc_root, &bt_proc_file);
+#endif
 #else
 	procfs_status = proc_register_dynamic(&proc_root, &bt_proc_file);
 #endif /* LINUX_VERSION_CODE */
@@ -1320,7 +1338,11 @@
 	
 #ifdef KERNEL_VERSION /* Not defined for kernel 2.0.x */
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,2,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
+        remove_proc_entry ("bt", NULL);
+#else
 	proc_unregister(&proc_root, bt_proc_file.low_ino);
+#endif
 #else
 	proc_unregister(&proc_root, bt_proc_file.low_ino);
 #endif /* LINUX_VERSION_CODE */
diff -urN src/bt_proc.c src_seasky_mdy/bt_proc.c
--- src/bt_proc.c	Mon Aug 14 21:03:31 2000
+++ src_seasky_mdy/bt_proc.c	Mon Oct  2 18:05:01 2000
@@ -56,6 +56,40 @@
 #include "include/btcommon.h"
 #endif
 
+#include <linux/version.h>
+#ifndef KERNEL_VERSION
+#define KERNEL_VERSION(a,b,c) (((a) << 16) | ((b) << 8) | (c))
+#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
+int bt_read_proc(char *buf, char **start, off_t off, int count, int *eof, void *data)
+{
+	int len=0;
+	len+=sprintf(buf+len, "\n[Bluetooth Status]\n");
+	len+=sprintf(buf+len, "----------------------------------------\n");
+
+	if (!bt_initiated()) {
+		len+=sprintf(buf+len, "\nStack not initiated\n\n");
+		goto end_of_len;
+	}
+
+	len+=sprintf(buf+len, "bytes received : %9d\n", 
+		     bt_stat.bytes_received);
+	len+=sprintf(buf+len, "bytes sent     : %9d\n", 
+		     bt_stat.bytes_sent);
+	len+=rfcomm_sprint_status(buf+len);
+	len+=l2cap_sprint_status(buf+len);
+	len+=sprintf(buf+len, "\n----------------------------------------\n");
+
+end_of_len:
+
+        if (len <= off+count) *eof = 1;
+        *start = buf + off;
+        len -= off;
+        if (len>count) len = count;
+        if (len<0) len = 0;
+        return len;
+}
+#else
 #ifdef __KERNEL__
 u32 bt_read_proc(char *buf, char **start, off_t offset, int len, int unused)
 #else
@@ -94,4 +128,4 @@
 	&bt_read_proc,
 };
 #endif
-
+#endif
diff -urN src/hci.c src_seasky_mdy/hci.c
--- src/hci.c	Mon Aug 14 21:03:31 2000
+++ src_seasky_mdy/hci.c	Mon Oct  2 17:49:27 2000
@@ -412,7 +412,16 @@
 struct timer_list emc_test_timer;
 #endif
 
+#include <linux/version.h>
+#ifndef KERNEL_VERSION
+#define KERNEL_VERSION(a,b,c) (((a) << 16) | ((b) << 8) | (c))
+#endif
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
+DECLARE_WAIT_QUEUE_HEAD (hci_wq);
+#else
 struct wait_queue *hci_wq = NULL;
+#endif
 static u8 local_bd[6];
 
 /****************** FUNCTION DEFINITION SECTION *****************************/
diff -urN src/rfcomm.c src_seasky_mdy/rfcomm.c
--- src/rfcomm.c	Mon Aug 14 21:03:31 2000
+++ src_seasky_mdy/rfcomm.c	Mon Oct  2 17:48:36 2000
@@ -371,7 +371,17 @@
 /* One RFCOMM connection for each bt_tty 0 to 6 */
 
 #ifdef __KERNEL__
+
+#include <linux/version.h>
+#ifndef KERNEL_VERSION
+#define KERNEL_VERSION(a,b,c) (((a) << 16) | ((b) << 8) | (c))
+#endif
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
+static DECLARE_WAIT_QUEUE_HEAD (rfcomm_disconnect_wq);
+#else
 static struct wait_queue *rfcomm_disconnect_wq = NULL;
+#endif
 #endif
 
 rpn_values rpn_val;