|
From: David L. <dli...@us...> - 2001-03-02 10:49:29
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- Makefile 1.12 1.13=20=20=20=20=20=20=20=20=20=20=20=20 hci.c 1.120 1.121=20=20=20=20=20=20=20=20=20=20=20 hci_vendor.c 1.11 1.12=20=20=20=20=20=20=20=20=20=20=20=20 l2cap.c 1.85 1.86=20=20=20=20=20=20=20=20=20=20=20=20 rfcomm.c 1.89 1.90=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Alignement fixes for RISC processors by David LIBAULT from Gordon McNutt's= =20 patch |
|
From: Gordon M. <gm...@us...> - 2001-03-04 17:53:51
|
The following files were modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
Config.in 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20
README 1.25 1.26=20=20=20=20=20=20=20=20=20=20=20=20
bluetooth.c 1.133 1.134=20=20=20=20=20=20=20=20=20=20=20
hci_vendor.c 1.12 1.13=20=20=20=20=20=20=20=20=20=20=20=20
l2cap.c 1.86 1.87=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
--Modified the config macros to be compatible with the Linux kernel config =
system.
The diff of the modified file(s):
--- Config.in 2001/03/02 21:10:41 1.1
+++ Config.in 2001/03/04 17:54:54 1.2
@@ -1,5 +1,34 @@
#---------------------------------------------------------------------
# Bluetooth driver configuration
#---------------------------------------------------------------------
+mainmenu_option next_comment
+comment 'Bluetooth'
=20
tristate 'Bluetooth driver' CONFIG_BLUETOOTH
+
+if [ "$CONFIG_BLUETOOTH" !=3D "n" ]; then
+
+ bool 'Bluetooth proc entry' CONFIG_BLUETOOTH_PROC
+ bool 'Input buffering' CONFIG_BLUETOOTH_USEINBUFFER
+ bool 'HCI USB' CONFIG_BLUETOOTH_HCI_USB
+ bool 'Allow connectionless L2CAP' CONFIG_BLUETOOTH_L2CAP_CONNECTIONLESS
+ bool 'Use L2CAP timers' CONFIG_BLUETOOTH_L2CAP_USETIMERS
+
+ choice 'Bluetooth hardware type' \
+ "CSR CONFIG_BLUETOOTH_CSR \
+ None CONFIG_BLUETOOTH_NOINIT \
+ Digianswer CONFIG_BLUETOOTH_DIGIANSWER \
+ USB CONFIG_BLUETOOTH_USBMODULE \
+ Generic CONFIG_BLUETOOTH_GENERIC \
+ Ericsson CONFIG_BLUETOOTH_ERICSSON" Ericsson
+
+ if [ "$CONFIG_BLUETOOTH_ERICSSON" =3D "y" ]; then
+ bool 'Ericsson P9A firmware' CONFIG_BLUETOOTH_ERICSSON_P9A
+ fi
+fi
+
+endmenu
+# Don't know why I need this one again, but things don't work right in the=
char
+# menu if I don't put it in.
+# --gmcnutt
+endmenu
\ No newline at end of file
--- README 2001/01/08 16:44:38 1.25
+++ README 2001/03/04 17:54:54 1.26
@@ -300,7 +300,7 @@
=20
There are two files that needs to be changed
=20
-Kernel : btconfig.h, set HW_CURRENT to whatever you are using
+Kernel : btconfig.h, set CONFIG_BLUETOOTH_<hardware> to whatever you are u=
sing
=20
Usermode app : btd.c, set HW_CURRENT to whatever you are using=20
=20
--- bluetooth.c 2001/03/04 15:55:03 1.133
+++ bluetooth.c 2001/03/04 17:54:54 1.134
@@ -64,7 +64,7 @@
#include <linux/bluetooth/tci.h>
#endif
=20
-#ifdef BT_USE_PROC
+#ifdef CONFIG_BLUETOOTH_PROC
#include <linux/bluetooth/bt_proc.h>
#endif
=20
@@ -120,7 +120,7 @@
=20
/****************** TYPE DEFINITION SECTION ******************************=
***/
=20
-#ifdef BT_USEINBUFFER
+#ifdef CONFIG_BLUETOOTH_USEINBUFFER
=20
/* This buffer is used decrease overruns on serial port. Copies data in
interrupt context and schedules a task which consumes data at 'safe' ti=
me */
@@ -147,7 +147,7 @@
#endif
static void bt_flash_led(void);
=20
-#ifdef BT_USEINBUFFER
+#ifdef CONFIG_BLUETOOTH_USEINBUFFER
struct tq_struct bt_receive_task;
bt_inbuffer hci_data;
static void hci_receive_data_task(void);
@@ -598,7 +598,7 @@
case BTRESETPHYSICALHW:
#ifdef __CRIS__
=20
-#if HW_USED(HW_CSR)
+#ifdef CONFIG_BLUETOOTH_CSR
#define CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH
#else
#undef CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH
@@ -1243,13 +1243,13 @@
=20
bt_flash_led();=20=20
=20
-#ifdef BT_USEINBUFFER
+#ifdef CONFIG_BLUETOOTH_USEINBUFFER
/* store in bt inbuffer and schedule a hci receive task if none is starte=
d */
bt_handle_indata(data, count);
#else
/* process data right away */
hci_receive_data((u8*)data, count);
-#endif /* BT_USEINBUFFER */
+#endif /* CONFIG_BLUETOOTH_USEINBUFFER */
}
=20
=20
@@ -1410,7 +1410,7 @@
#undef FNC
}
=20
-#ifdef BT_USEINBUFFER
+#ifdef CONFIG_BLUETOOTH_USEINBUFFER
static void bt_handle_indata(const __u8 *data, s32 count)
{
s32 free;
@@ -1501,7 +1501,7 @@
hci_receive_data(getTemp, size_end);
}
}
-#endif /* BT_USEINBUFFER */
+#endif /* CONFIG_BLUETOOTH_USEINBUFFER */
=20
/* Opens a connection to the selected PSM, layer specific is the same as t=
he
* lowest part on the connection ID, in RFCOMM this is line | dlci, each o=
ne
@@ -1836,7 +1836,9 @@
{
static struct tty_ldisc bt_ldisc;
s32 status;
+#ifdef CONFIG_BLUETOOTH_PROC
s32 procfs_status =3D -1;
+#endif
=20
show_bt_version();
=20
@@ -1922,7 +1924,7 @@
=20=09
sertty =3D NULL;
=20
-#ifdef BT_USE_PROC
+#ifdef CONFIG_BLUETOOTH_PROC
DSYS("Registering BT proc files\n");
=20=20
#ifdef KERNEL_VERSION /* Not defined for kernel 2.0.x */
@@ -2090,12 +2092,12 @@
}
#endif /* USE_TCI */
=20=09
-#endif /* BT_USE_PROC */
+#endif /* CONFIG_BLUETOOTH_PROC */
=20
DSYS("Bluetooth Driver Using ttyBT[0-%d] (data), ttyBTC (ctrl [%d])\n",
BT_NBR_DATAPORTS-1, BT_NBR_PORTS-1);
=20
-#ifdef BT_USEINBUFFER
+#ifdef CONFIG_BLUETOOTH_USEINBUFFER
DSYS("Using BT Inbuffers [%d]\n", BT_INBUFFER_SIZE);
/* Init hci inbuffer */
hci_data.head =3D &hci_data.data[0];
@@ -2645,7 +2647,7 @@
if (bt_stack_initiated)
bt_shutdown();
=20=09
-#ifdef BT_USE_PROC
+#ifdef CONFIG_BLUETOOTH_PROC
#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,4,0)
remove_proc_entry(bt_status.name, &proc_root);
remove_proc_entry(bt_internal_info.name, &proc_root);
@@ -2669,7 +2671,7 @@
proc_unregister(&proc_root, tci_proc_entry.low_ino);
#endif /* USE_TCI */
#endif /* LINUX_VERSION_CODE */
-#endif /* BT_USE_PROC */
+#endif /* CONFIG_BLUETOOTH_PROC */
=20=09
DSYS("Bluetooth Driver unregistered\n");
}
--- hci_vendor.c 2001/03/02 10:50:44 1.12
+++ hci_vendor.c 2001/03/04 17:54:54 1.13
@@ -53,7 +53,7 @@
#include <linux/bluetooth/bluetooth.h>
#include <linux/bluetooth/btmem.h>
#include <linux/delay.h>
-#ifdef HCI_USEUSB
+#ifdef CONFIG_BLUETOOTH_HCI_USB
#include <linux/interrupt.h>
#endif
#else /* user mode */
@@ -68,7 +68,7 @@
=20
/****************** CONSTANT AND MACRO SECTION ***************************=
***/
=20
-#if HW_USED(HW_ERICSSON)
+#if defined(CONFIG_BLUETOOTH_ERICSSON)
/* Ericsson defines */
#define ERICSSON_SET_UART_BAUD_RATE 0x9
#define ERICSSON_WRITE_BD_ADDR 0xd
@@ -79,7 +79,7 @@
#define ERICSSON_TX_TEST 0x19
#endif
=20
-#if HW_USED(HW_DIGIANSWER)
+#if defined(CONFIG_BLUETOOTH_DIGIANSWER)
/* Digianswer defines */
#endif
=20
@@ -104,7 +104,7 @@
=20
/****************** FUNCTION DEFINITION SECTION **************************=
***/
=20
-#if HW_USED(HW_ERICSSON)
+#if defined(CONFIG_BLUETOOTH_ERICSSON)
/*************************************************************************=
****/
/********************** Ericsson functions *******************************=
****/
/*************************************************************************=
****/
@@ -170,7 +170,7 @@
D_ERR(__FUNCTION__": Baudrate not supported\n");
break;=09
}
-#ifndef P9A
+#ifndef CONFIG_BLUETOOTH_ERICSSON_P9A
tmp =3D send_cmd_block((u8*) &c_pkt ,c_pkt.len + CMD_HDR_LEN + HCI_HDR_LE=
N);
#else
if (hci_ctrl.hc_buf.cmd_num < 1) {
@@ -197,7 +197,7 @@
=20=20=20=20=20
case ERICSSON_SET_UART_BAUD_RATE:
D_CMD(__FUNCTION__" Ericsson baudrate set\n");
-#ifndef P9A
+#ifndef CONFIG_BLUETOOTH_ERICSSON_P9A
// no wake up, since hci_set_baudrate() is non-blocking
release_cmd_timer();
wake_up_interruptible(&hci_wq);
@@ -270,7 +270,7 @@
}
=20
=20
-#elif HW_USED(HW_DIGIANSWER)
+#elif defined(CONFIG_BLUETOOTH_DIGIANSWER)
/*************************************************************************=
****/
/************************* Digianswer functions **************************=
****/
/*************************************************************************=
****/
@@ -403,7 +403,7 @@
}
#endif
=20
-#elif HW_USED(HW_CSR)
+#elif defined(CONFIG_BLUETOOTH_CSR)
/*************************************************************************=
****/
/****************************** CSR functions ****************************=
****/
/*************************************************************************=
****/
--- l2cap.c 2001/03/02 10:50:44 1.86
+++ l2cap.c 2001/03/04 17:54:54 1.87
@@ -223,7 +223,7 @@
#endif /* LINUX_VERSION_CODE */
#endif /* __KERNEL__ */
=20
-#ifdef L2CAP_USETIMERS
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS
#define MAX_NO_RTX 0
#define RTX_TIMEOUT 5 /* sec */
#define ERTX_TIMEOUT 60 /* sec */
@@ -315,7 +315,11 @@
#if L2CAP_SELFTEST
test_conlist();
#endif
- l2cap->allow_conless =3D DEF_ALLOWCONLESS;
+#ifdef BLUETOOTH_CONFIG_L2CAP_CONNECTIONLESS
+ l2cap->allow_conless =3D 1;
+#else
+ l2cap->allow_conless =3D 0;
+#endif
l2cap->initiated =3D 1;
return 0;
}
@@ -978,7 +982,7 @@
return;
}
=20=20=20=20=20=20=20=20=20=20
-#ifdef L2CAP_USETIMERS
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS
disable_rtx(con);
#endif
=20
@@ -992,7 +996,7 @@
=20=20=20=20=20=20=20=20=20=20=20=20
case RES_PENDING:
l2ca_connect_pnd(con, conrsp->status);
-#ifdef L2CAP_USETIMERS
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS
/* Disable RTX timer and start ERTX */
//start_ertx();
#endif
@@ -1030,7 +1034,7 @@
Disable RTX/ERTX timers
(New state : CLOSED)
*/
-#ifdef L2CAP_USETIMERS
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS
disable_rtx(con);
//disable_ertx(con);
#endif
@@ -1071,7 +1075,7 @@
=20=09
case CONF_SUCCESS:
=20=20=20=20=20=20=20=20=20=20
-#ifdef L2CAP_USETIMERS
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS
disable_rtx(con);
#endif
=20
@@ -1121,7 +1125,7 @@
=20
/* If we end up here, config failed */
=20
-#ifdef L2CAP_USETIMERS
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS
disable_rtx(con);
#endif
=20
@@ -1166,7 +1170,7 @@
return;
}
=20
-#ifdef L2CAP_USETIMERS
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS
disable_rtx(con);
#endif=09
=20
@@ -1368,7 +1372,7 @@
sleep(3);
#endif
=20
-#ifdef L2CAP_USETIMERS
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS
do_cmd_backup(con, SIG_CONREQ, 0, NULL, 0, 0, 0);
#endif
/* baseband is up, now initiate l2cap */
@@ -1422,7 +1426,7 @@
/* flag phys link as down */
con->link_up =3D FALSE;
=20
-#ifdef L2CAP_USETIMERS
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS
/* cancel any outstanding timers */
disable_rtx(con);
//disable_ertx(con);
@@ -1561,7 +1565,7 @@
con->link_up =3D 1;
ENTERSTATE(con, W4_L2CAP_CONNECT_RSP);
PRINTSTATE(con);
-#ifdef L2CAP_USETIMERS
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS
do_cmd_backup(con, SIG_CONREQ, 0, NULL, 0, 0, 0);
#endif
l2cap_connect_req(con, psm);
@@ -1594,7 +1598,7 @@
=20
/* local mtu is set in l2cap_config_req */
=20
-#ifdef L2CAP_USETIMERS
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS
do_cmd_backup(con, SIG_CONFREQ, in_mtu, outflow,=20
flush_timeout, link_to, 0);
#endif=09=09
@@ -1620,7 +1624,7 @@
=20
con->conf_req_ready =3D FALSE;
con->conf_rsp_ready =3D FALSE;
-#ifdef L2CAP_USETIMERS=09=09
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS=09=09
do_cmd_backup(con, SIG_CONFREQ, in_mtu, outflow,=20
flush_timeout, link_to, 0);
#endif
@@ -1649,7 +1653,7 @@
=20
if (con->current_state =3D=3D OPEN || con->current_state =3D=3D CONFIG) {
=20
-#ifdef L2CAP_USETIMERS
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS
do_cmd_backup(con, SIG_DISCREQ, 0, NULL,0, 0, 0);
#endif
result =3D l2cap_disconnect_req(con);
@@ -1899,7 +1903,7 @@
tx->cur_len =3D L2CAP_HDRSIZE + payload_len; /* Increased as lower layers=
=20
add header data */=20=20
=20=09
-#ifdef L2CAP_USETIMERS
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS
/* start retransmission timer */
start_rtx(con, RTX_TIMEOUT);
#endif
@@ -2021,7 +2025,7 @@
SIGCMD_HDRSIZE + CONF_REQSIZE);
=20=09
print_data("l2cap options : ", (char*)opt , opt_len);
-#ifdef L2CAP_USETIMERS
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS
/* start retransmission timer */
start_rtx(con, RTX_TIMEOUT);
#endif
@@ -2065,7 +2069,7 @@
tx->bc_flag =3D NO_BROADCAST;
tx->cur_len =3D L2CAP_HDRSIZE + payload_len;
=20
-#ifdef L2CAP_USETIMERS
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS
/* start retransmission timer */
start_rtx(con, RTX_TIMEOUT);
#endif
@@ -2113,7 +2117,7 @@
tx->bc_flag =3D NO_BROADCAST;
tx->cur_len =3D L2CAP_HDRSIZE + payload_len; /* Increased when lower
layers add header data */
-#ifdef L2CAP_USETIMERS
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS
start_rtx(con, RTX_TIMEOUT);
#endif
return hci_send_data(tx);
@@ -2200,7 +2204,7 @@
tx->bc_flag =3D NO_BROADCAST;
tx->cur_len =3D L2CAP_HDRSIZE + payload_len; /* Increased when lower
layers add header data */
-#ifdef L2CAP_USETIMERS
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS
start_rtx(con, RTX_TIMEOUT);
#endif
return hci_send_data(tx);
@@ -2666,7 +2670,7 @@
/* use existing handle */
D_STATE("l2ca_ping : using existing handle\n");
con->ping_sent=3D1;
-#ifdef L2CAP_USETIMERS=09=09
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS=09=09
do_cmd_backup(con, SIG_ECHOREQ, 0, NULL, 0, 0, 0);
#endif
l2cap_echo_req(con, NULL, 0);
@@ -2721,7 +2725,7 @@
con->inforeq_sent =3D 1;
con->initiator =3D 1;
insert_con(con);
-#ifdef L2CAP_USETIMERS=09=09
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS=09=09
do_cmd_backup(con, SIG_INFOREQ, 0, NULL, 0, 0, infotype);
#endif
/* l2cap_echo_req is called in lp_connect_cfm */
@@ -2732,7 +2736,7 @@
/* use existing handle */
D_STATE("l2ca_getinfo : using existing handle\n");
con->inforeq_sent =3D 1;
-#ifdef L2CAP_USETIMERS=09=09
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS=09=09
do_cmd_backup(con, SIG_INFOREQ, 0, NULL, 0, 0, infotype);
#endif
l2cap_info_req(con, infotype);
@@ -2804,7 +2808,7 @@
=20=20=20
/* FIXME -- send l2ca_timeoutind() */
=20
-#ifdef L2CAP_USETIMERS
+#ifdef CONFIG_BLUETOOTH_L2CAP_USETIMERS
if (MAX_NO_RTX =3D=3D 0)
{
/* no retransmissions, shutdown connection */
|
|
From: Peter K. <pk...@us...> - 2001-03-05 15:51:16
|
The following files were modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
Config.in 1.4 1.5=20=20=20=20=20=20=20=20=20=20=20=20=20
bluetooth.c 1.135 1.136=20=20=20=20=20=20=20=20=20=20=20
l2cap.c 1.88 1.89=20=20=20=20=20=20=20=20=20=20=20=20
rfcomm.c 1.91 1.92=20=20=20=20=20=20=20=20=20=20=20=20
sec_client.c 1.12 1.13=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Made it possible to configure the use of a Security Manager and
TCI using the kernel configuration.
The diff of the modified file(s):
--- Config.in 2001/03/05 15:39:07 1.4
+++ Config.in 2001/03/05 15:52:52 1.5
@@ -10,8 +10,10 @@
=20
bool ' Bluetooth proc entries' CONFIG_BLUETOOTH_PROC
bool ' Input buffering' CONFIG_BLUETOOTH_USE_INBUFFER
+ bool ' Use Security Manager' CONFIG_BLUETOOTH_USE_SECURITY_MANAGER
bool ' Use L2CAP timers' CONFIG_BLUETOOTH_L2CAP_USE_TIMERS
bool ' Allow connectionless L2CAP' CONFIG_BLUETOOTH_L2CAP_CONNECTIONLESS
+ bool ' Enable TCI' CONFIG_BLUETOOTH_USE_TCI
=20
choice ' Bluetooth hardware type' \
"None CONFIG_BLUETOOTH_NOINIT \
--- bluetooth.c 2001/03/05 15:39:07 1.135
+++ bluetooth.c 2001/03/05 15:52:52 1.136
@@ -60,7 +60,7 @@
#include <linux/bluetooth/tcs.h>
#include <linux/bluetooth/sdp.h>
#include <linux/bluetooth/sec_client.h>
-#ifdef USE_TCI
+#ifdef CONFIG_BLUETOOTH_USE_TCI
#include <linux/bluetooth/tci.h>
#endif
=20
@@ -2007,7 +2007,7 @@
procfs_status);
}
=20
-#ifdef USE_SECURITY_MANAGER
+#ifdef CONFIG_BLUETOOTH_USE_SECURITY_MANAGER
#ifdef KERNEL_VERSION /* Not defined for kernel 2.0.x */
#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,4,0)
{
@@ -2039,7 +2039,7 @@
D_ERR("Couldn't register proc file for security manager %d\n",
procfs_status);
}
-#endif /* USE_SECURITY_MANAGER */
+#endif /* CONFIG_BLUETOOTH_USE_SECURITY_MANAGER */
=20
#ifdef KERNEL_VERSION /* Not defined for kernel 2.0.x */
#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,4,0)
@@ -2066,7 +2066,7 @@
procfs_status);
}
=20
-#ifdef USE_TCI
+#ifdef CONFIG_BLUETOOTH_USE_TCI
#ifdef KERNEL_VERSION /* Not defined for kernel 2.0.x */
#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,4,0)
{
@@ -2090,7 +2090,7 @@
D_ERR("Couldn't register proc file for tci database %d\n",
procfs_status);
}
-#endif /* USE_TCI */
+#endif /* CONFIG_BLUETOOTH_USE_TCI */
=20=09
#endif /* CONFIG_BLUETOOTH_PROC */
=20
@@ -2146,7 +2146,7 @@
hci_init();
l2cap_init();
=20
-#ifdef USE_TCI
+#ifdef CONFIG_BLUETOOTH_USE_TCI
tci_init();
#else
rfcomm_init();
@@ -2653,23 +2653,23 @@
remove_proc_entry(bt_internal_info.name, &proc_root);
remove_proc_entry(sdp_proc_entry.name, &proc_root);
remove_proc_entry(bt_proc_doit.name, &proc_root);
-#ifdef USE_SECURITY_MANAGER
+#ifdef CONFIG_BLUETOOTH_USE_SECURITY_MANAGER
remove_proc_entry(sec_man_proc_entry.name, &proc_root);
-#endif /* USE_SECURITY_MANAGER */
-#ifdef USE_TCI
+#endif /* CONFIG_BLUETOOTH_USE_SECURITY_MANAGER */
+#ifdef CONFIG_BLUETOOTH_USE_TCI
remove_proc_entry(tci_proc_entry.name, &proc_root);
-#endif /* USE_TCI */
+#endif /* CONFIG_BLUETOOTH_USE_TCI */
#else
proc_unregister(&proc_root, bt_status.low_ino);
proc_unregister(&proc_root, bt_internal_info.low_ino);
proc_unregister(&proc_root, sdp_proc_entry.low_ino);
proc_unregister(&proc_root, bt_proc_doit.low_ino);
-#ifdef USE_SECURITY_MANAGER
+#ifdef CONFIG_BLUETOOTH_USE_SECURITY_MANAGER
proc_unregister(&proc_root, sec_man_proc_entry.low_ino);
-#endif /* USE_SECURITY_MANAGER */
-#ifdef USE_TCI
+#endif /* CONFIG_BLUETOOTH_USE_SECURITY_MANAGER */
+#ifdef CONFIG_BLUETOOTH_USE_TCI
proc_unregister(&proc_root, tci_proc_entry.low_ino);
-#endif /* USE_TCI */
+#endif /* CONFIG_BLUETOOTH_USE_TCI */
#endif /* LINUX_VERSION_CODE */
#endif /* CONFIG_BLUETOOTH_PROC */
=20=09
--- l2cap.c 2001/03/05 15:39:07 1.88
+++ l2cap.c 2001/03/05 15:52:52 1.89
@@ -307,7 +307,7 @@
#endif /* LINUX_VERSION_CODE */
#endif /* __KERNEL__ */
=20
-#ifdef USE_SECURITY_MANAGER
+#ifdef CONFIG_BLUETOOTH_USE_SECURITY_MANAGER
/* Initialize security */
l2cap_sec_man_init();
#endif
@@ -713,7 +713,7 @@
con->conf_req_ready=3DFALSE;
con->conf_rsp_ready=3DFALSE;
=20
-#ifdef USE_SECURITY_MANAGER=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20
+#ifdef CONFIG_BLUETOOTH_USE_SECURITY_MANAGER=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20
l2cap_check_allowed_security(con->psm, con->remote_bd, con=
);
#else
l2ca_connect_ind(con);
--- rfcomm.c 2001/03/02 21:52:15 1.91
+++ rfcomm.c 2001/03/05 15:52:52 1.92
@@ -484,7 +484,7 @@
rpn_val.xoff_u8 =3D 0x13;
memset(&rpn_val.pm, 0 , 2); /* Set the mask to zero */
=20=20=20=20=20=20=20=20=20
-#ifdef USE_SECURITY_MANAGER
+#ifdef CONFIG_BLUETOOTH_USE_SECURITY_MANAGER
rfcomm_sec_man_init();
#endif
}
@@ -924,7 +924,7 @@
D_REC(FNC"setting server channel %d\n",
short_pkt->h.addr.server_chn);
=20
-#ifdef USE_SECURITY_MANAGER
+#ifdef CONFIG_BLUETOOTH_USE_SECURITY_MANAGER
rfcomm_check_allowed_security(rfcomm->l2cap->remot=
e_bd,
tmp_dlci, rfcomm);
#else
@@ -949,7 +949,7 @@
D_CTRL(FNC"sending back UA - other channel\n");
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
send_ua(rfcomm, tmp_dlci);
-#endif /* USE_SECURITY_MANAGER */
+#endif /* CONFIG_BLUETOOTH_USE_SECURITY_MANAGER */
} else {
=20
D_CTRL(FNC"no server on channel %d, sending DM\n",
--- sec_client.c 2001/03/03 15:33:00 1.12
+++ sec_client.c 2001/03/05 15:52:52 1.13
@@ -282,8 +282,9 @@
__FILE__, __LINE__);
=20
/* *** NOTE ***=20
- * define USE_SECURITY_MANAGER to 0 in btconfig.h if you=20
- * don't know what this is...
+ * Make sure CONFIG_BLUETOOTH_USE_SECURITY_MANAGER is
+ * undefined (either in kernel configuration or in btconfig.h)
+ * if you don't know what this is...
*/
=20
}
|
|
From: Gordon M. <gm...@us...> - 2001-03-24 21:12:10
|
The following files were modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
Config.in 1.7.2.1 1.7.2.2=20=20=20=20=20=20=20=20=20
bluetooth.c 1.154.2.3 1.154.2.4=20=20=20=20=20=20=20
btmem.c 1.37 1.37.2.1=20=20=20=20=20=20=20=20
hci.c 1.132.2.3 1.132.2.4=20=20=20=20=20=20=20
sdp.c 1.67 1.67.2.1=20=20=20=20=20=20=20=20
The accompanying log:
Merged from trunk
The diff of the modified file(s):
--- Config.in 2001/03/20 16:48:15 1.7.2.1
+++ Config.in 2001/03/24 21:11:38 1.7.2.2
@@ -15,7 +15,7 @@
bool ' Allow connectionless L2CAP' CONFIG_BLUETOOTH_L2CAP_CONNECTIONLESS
bool ' Enable TCI' CONFIG_BLUETOOTH_USE_TCI
bool ' HCI Inquiry' CONFIG_BLUETOOTH_HCI_INQUIRY
- bool ' Kernel Thread' CONFIG_BLUETOOTH_KERNEL_THREAD
+ bool ' Enable M/S Switch' CONFIG_BLUETOOTH_ENABLE_MSSWITCH
=20
choice ' Bluetooth hardware type' \
"None CONFIG_BLUETOOTH_NOINIT \
--- bluetooth.c 2001/03/24 19:37:17 1.154.2.3
+++ bluetooth.c 2001/03/24 21:11:38 1.154.2.4
@@ -735,8 +735,9 @@
inq_res)) < 0)
goto end_inquiry;
=20
- copy_to_user((s32*)arg, inq_res, sizeof(inquiry_results) + 6 *=20
- inq_res->nbr_of_units);
+ copy_to_user((s32*)arg, inq_res, sizeof(inquiry_results) +
+ 6 * inq_res->nbr_of_units);
+
end_inquiry:
kfree(inq_res);
return ret;
--- btmem.c 2001/03/02 21:52:15 1.37
+++ btmem.c 2001/03/24 21:11:38 1.37.2.1
@@ -214,7 +214,6 @@
=20
bt_tx_buf* subscribe_bt_buf(s32 send_len)
{
-#define FNC "subscribe_bt_buf : "
bt_tx_buf *tx;
s32 buf_len; /* Total size of bt_tx_object */
u32 head_free;
@@ -222,7 +221,7 @@
=20
cli();
buf_len =3D send_len + BT_TX_HDRSIZE;=20=20
- D_MEM(FNC"buf_len %d\n", buf_len);
+ D_MEM(__FUNCTION__ ": buf_len %d\n", buf_len);
=20
/*=20=20
'Normal' case
@@ -239,13 +238,11 @@
get_bt_buf();
=20
if (bt_buf.free > bt_buf.send) {
-=20=20=20=20
tail_free =3D (bt_buf.tail - bt_buf.free);
head_free =3D (bt_buf.send - bt_buf.head);
=20
if (tail_free >=3D buf_len) {
-
- D_MEM(FNC"subscribe in tail at pos %d\n",=20
+ D_MEM(__FUNCTION__ ": subscribe in tail at pos %d\n",=20
bt_buf.free - bt_buf.head);
tx =3D (bt_tx_buf *)bt_buf.free;
/* Don't touch send, only update free and count */
@@ -253,7 +250,6 @@
bt_buf.count +=3D buf_len;
bt_buf.nbr_bufs++;
} else if (head_free >=3D buf_len) {=20=20
-
D_MEM("No room in tail, subscribe at head (WRAP!)\n");
tx =3D (bt_tx_buf *)bt_buf.head;
=20=09=09=09
@@ -264,9 +260,8 @@
bt_buf.nbr_bufs++;
bt_buf.count +=3D buf_len;
} else {
-
- D_ERR(FNC"Cannot subscribe %d bytes !\n", send_len);
- D_ERR(FNC"Only %d available (non - fragmented)\n",
+ D_ERR(__FUNCTION__ ": Cannot subscribe %d bytes !\n", send_len);
+ D_ERR(__FUNCTION__ ": Only %d available (non - fragmented)\n",
buf_write_room());
=20
#if PANIC_AT_ERROR
@@ -277,7 +272,6 @@
return NULL;
}
} else if (bt_buf.free <=3D bt_buf.send) {
-=20=20=20=20
/* 'Wrap' case */
tail_free =3D (bt_buf.send - bt_buf.free);
head_free =3D 0; /* head_free is not interesting since we cannot=20
@@ -286,7 +280,6 @@
buffer! (Fragmentation) */
=20=20=20=20=20
if (tail_free >=3D buf_len) {
-
D_MEM("Wrapped buffer, subscribe at free (pos %d)\n",=20
bt_buf.free - bt_buf.head);
tx =3D (bt_tx_buf *)bt_buf.free;
@@ -294,13 +287,12 @@
bt_buf.count +=3D buf_len;
bt_buf.nbr_bufs++;
} else if (!bt_buf.count) {
-
/* If buffer empty, reset buffer */=20=20=20=20=20=20=20=20=20=20
btmem_reset();
=20=09=09=09
if (buf_len > bt_buf.size) {
- D_ERR(FNC"Cannot subscribe %d bytes !\n", send_len);=20
- D_ERR(FNC"Only %d available (non - fragmented)\n",
+ D_ERR(__FUNCTION__ ": Cannot subscribe %d bytes !\n", send_len);=20
+ D_ERR(__FUNCTION__ ": Only %d available (non - fragmented)\n",
buf_write_room());
btmem_get_status(NULL);
sti();
@@ -314,9 +306,9 @@
bt_buf.count +=3D buf_len;
bt_buf.nbr_bufs++;
} else {
- D_ERR(FNC"Cannot subscribe requested size (%d) !\n",=20
+ D_ERR(__FUNCTION__ ": Cannot subscribe requested size (%d) !\n",=20
send_len);
- D_ERR(FNC"Only %d available (non - fragmented)\n",
+ D_ERR(__FUNCTION__ ": Only %d available (non - fragmented)\n",
buf_write_room());
btmem_get_status(NULL);
#if PANIC_AT_ERROR
@@ -333,7 +325,6 @@
=20
sti();
return tx;
-#undef FNC
}
=20
/* Returns number of buffers */
@@ -343,7 +334,6 @@
return bt_buf.nbr_bufs;
}
=20
-
/* Returns total number of bytes in buffer (fragmented) */
=20
s32 buf_byte_count()
@@ -351,7 +341,6 @@
return bt_buf.count;
}
=20
-
/* Returns unfragmented buffer space */=20
=20
#define BTMEM_EXTRASPACE BT_BUF_SIZE/10 /* always an extra 10 % marginal
@@ -375,7 +364,6 @@
don't count a tossed tail ! */
space_left =3D (BT_BUF_SIZE -=20
(bt_buf.tail - bt_buf.toss_tail) - bt_buf.count);
-=20=20
}
=20
space_left -=3D (BT_TX_HDRSIZE+BTMEM_EXTRASPACE);
@@ -412,8 +400,7 @@
=20
tx =3D (bt_tx_buf *)(bt_buf.send);
=20
- if (tx->magic !=3D 0x4321)
- {
+ if (tx->magic !=3D 0x4321) {
D_ERR("get_bt_buf : wrong magic!\n");
#if PANIC_AT_ERROR
panic("lets stop here...\n");
@@ -442,32 +429,32 @@
=20
void unsubscribe_bt_buf(bt_tx_buf *tx)
{
-#define FNC "unsubscribe_bt_buf : "
s32 tail_free; /* for debug */
s32 head_free;
=20=20=20
- D_MEM(FNC"%d bytes (not incl hdrs) at pos %d\n",=20
+ if (!tx)
+ return;
+
+ D_MEM(__FUNCTION__ ": %d bytes (not incl hdrs) at pos %d\n",=20
tx->subscr_len, (u8 *)tx - bt_buf.head);
=20=20=20
/* Check that tx is valid for unssubscribe. We must process the=20
buffers in fifo order ! */
=20
cli();
- if (tx && (bt_buf.send =3D=3D (u8*)tx)) {
-
+ if (bt_buf.send =3D=3D (u8*)tx) {
if ((u8*)(tx->data + tx->subscr_len) <=3D bt_buf.tail) {
-=20=20=20=20=20=20
/* don't touch free, only subscribe_bt_buf change free */
bt_buf.send +=3D (tx->subscr_len + BT_TX_HDRSIZE);
bt_buf.count -=3D (tx->subscr_len + BT_TX_HDRSIZE);
bt_buf.nbr_bufs--;=20=20=20=20=20=20
} else {
- D_ERR(FNC"failed, out of boundary\n");
+ D_ERR(__FUNCTION__ ": failed, out of boundary\n");
}
} else if (bt_buf.count =3D=3D 0)
- D_MEM(FNC"no data in buffer\n");
+ D_MEM(__FUNCTION__ ": no data in buffer\n");
else {
- D_ERR(FNC"invalid data segment!\n");
+ D_ERR(__FUNCTION__ ": invalid data segment!\n");
#ifdef __KERNEL__
=20
D_ERR("pid : %d (tx:0x%x - send:0x%x=3D%d) send:%ld free:%ld\n",
@@ -495,7 +482,7 @@
=20
/* Is also checked done in get_bt_buf */
if (bt_buf.send =3D=3D bt_buf.toss_tail) {
- D_MEM(FNC"toss_tail, now send pos is 0\n");
+ D_MEM(__FUNCTION__ ": toss_tail, now send pos is 0\n");
bt_buf.send =3D bt_buf.head;
bt_buf.toss_tail =3D bt_buf.tail;
=20
@@ -603,13 +590,11 @@
bt_tx_buf *tx;
=20=20=20=20
for (i =3D 0; i < count; i++) {
-
if (cursize > buf_write_room())
return;
=20=09=20=20=20=20=20
printk("storing %d bytes packets\n", cursize);
while (buf_write_room() >=3D cursize) {
-=09=20=20=20=20=20=20=20
if (!(tx =3D subscribe_bt_buf(cursize))) {
return ;
}
--- hci.c 2001/03/21 23:23:25 1.132.2.3
+++ hci.c 2001/03/24 21:11:38 1.132.2.4
@@ -2189,7 +2189,7 @@
bytes2send =3D tx_buf->cur_len;
}
=20=09
- D_SND(__FUNCTION__", %d bytes \n", tx_buf->cur_len);
+ D_SND(__FUNCTION__", %d bytes \n", bytes2send);
=20=09
/* while there is space in the hardware buffers and we have
hci packets to send, we send them. After each sent packet
--- sdp.c 2001/03/06 11:06:24 1.67
+++ sdp.c 2001/03/24 21:11:38 1.67.2.1
@@ -315,6 +315,11 @@
#endif /* LINUX_VERSION_CODE */
#endif /* __KERNEL__ */
=20
+//#ifdef __KERNEL__
+static bt_tx_buf *db_write_tx_buf;
+static s32 db_write_recv;
+//#endif
+
#ifndef __KERNEL__
static s32 sdp_sock;
#endif
@@ -406,6 +411,9 @@
sdp_disconnect_req(i);
}
}=20=20
+
+ unsubscribe_bt_buf(db_write_tx_buf);
+ db_write_recv =3D 0;
}
=20
#ifdef __KERNEL__
@@ -907,11 +915,7 @@
=20
len =3D MIN(count, database_query.count);
=20
-#ifdef __KERNEL__
copy_to_user(buf, database_query.query, len);
-#else
- memcpy(buf, database_query.query, len);
-#endif
=20
if (database_query.count > len) {
memmove(database_query.query,
@@ -932,35 +936,60 @@
const char * buf, s32 count)
#endif
{
+ static data_struct db_hdl;
sdp_tx_buf *sdp_buf;
- bt_tx_buf *tx_buf;
- data_struct *db_hdl =3D (data_struct*) buf;
+ s32 read1 =3D 0;
+ s32 read2 =3D 0;
=20=09
D_PROC(__FUNCTION__ " Someone wrote %d bytes to sdp proc-file\n",count);
=20
- D_XMIT(__FUNCTION__ " preparing to send %d bytes data to sdp_con[%d]\n", =
count, db_hdl->sdp_con_id);
- PRINTPKT("Data to be sent to client:", db_hdl->data, db_hdl->len);
+ if (!bt_initiated())
+ return 0;
=20=09
- tx_buf =3D subscribe_bt_buf(sizeof(sdp_tx_buf) + db_hdl->len);
+ if (!db_write_tx_buf) {
+ read1 =3D MIN(sizeof db_hdl - db_write_recv, count);
+ copy_from_user(&db_hdl + db_write_recv, buf, read1);
=20
- if (!tx_buf) {
+ db_write_recv +=3D read1;
+
+ if (db_write_recv < sizeof db_hdl)
+ return read1;
+
+ db_write_tx_buf =3D subscribe_bt_buf(sizeof *sdp_buf + db_hdl.len);
+
+ if (!db_write_tx_buf) {
D_ERR(__FUNCTION__ " failed to get tx buffer\n");
- return -1;
+ db_write_recv -=3D read1;
+ return -ENOMEM;
}
=20
- tx_buf->cur_len =3D db_hdl->len;
- sdp_buf =3D (sdp_tx_buf*) (tx_buf->data);
+ db_write_tx_buf->cur_len =3D db_hdl.len;
=20
-#ifdef __KERNEL__
- copy_from_user(sdp_buf->frame, db_hdl->data, db_hdl->len);
-#else
- memcpy(sdp_buf->frame, db_hdl->data, db_hdl->len);
-#endif
+ count -=3D read1;
+ buf +=3D read1;
+ db_write_recv =3D 0;
+ }
=20
- l2cap_send_data(tx_buf, sdp_con_list[db_hdl->sdp_con_id].l2cap);
+ sdp_buf =3D (sdp_tx_buf*)db_write_tx_buf->data;
=20=09
- return count;
+ if (db_write_recv < db_hdl.len) {
+ read2 =3D MIN(db_hdl.len - db_write_recv, count);
+ copy_from_user(sdp_buf->frame + db_write_recv, buf, read2);
+ db_write_recv +=3D read2;
+
+ if (db_write_recv < db_hdl.len)
+ return read1 + read2;
}
+
+ D_XMIT(__FUNCTION__ " preparing to send %d bytes data to sdp_con[%d]\n", =
db_hdl.len, db_hdl.sdp_con_id);
+ PRINTPKT("Data to be sent to client:", db_hdl.data, db_hdl.len);
+
+ l2cap_send_data(db_write_tx_buf, sdp_con_list[db_hdl.sdp_con_id].l2cap);
+ db_write_tx_buf =3D NULL;
+ db_write_recv =3D 0;
+
+ return read1 + read2;
+}
#else /* __KERNEL__ */
=20
s32 sdp_doquery(s32 fd, u8 *request, s32 len)
@@ -968,11 +997,13 @@
s32 n;
u8 tmpbuf[512];
data_struct *db_hdl;
+ s32 recv;
=20
D_XMIT("sdp_doquery : sending request %d bytes\n", len);
write(fd, request, len);
=20=09
- n =3D read(fd, tmpbuf, 512);
+ if ((n =3D read(fd, tmpbuf, 512)) < 0)
+ return n;
=20
D_REC(__FUNCTION__ ", Received %d bytes\n", n);
=20=09
@@ -980,15 +1011,13 @@
=20=09
/* what if not all is written once */
=20
- if (n < (sizeof(data_struct) + db_hdl->len)) {
- D_ERR("sdp_doquery : only got partial response n:%d, db_hdl->len:%d\n", =
n, db_hdl->len);
- print_data("The request is:", request, len);
- return -1;
- }
+ for (recv =3D n; recv < sizeof *db_hdl + db_hdl->len; recv +=3D n)
+ if ((n =3D read(fd, tmpbuf + recv, 512 - recv)) < 0)
+ return n;
=20
sdp_send_data(&sdp_con_list[db_hdl->sdp_con_id], db_hdl->data, db_hdl->le=
n);=20
=20=09
- return n;
+ return recv;
}
#endif
=20
|
|
From: Anders J. <and...@us...> - 2002-01-24 16:08:50
|
The following files were modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
bluetooth.c 1.219 1.220=20=20=20=20=20=20=20=20=20=20=20
bnep.c 1.1 Added
bnep_status_proc.c 1.1 Added
bnep_test.c 1.1 Added
btmem.c 1.46 1.47=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Register BNEP-procfile.
* Added initial version of bnep.
* Added bnep tests with UPF testcases.
* btmem init now returns ENOMEM on error.
The diff of the modified file(s):
--- bluetooth.c 2002/01/24 12:43:36 1.219
+++ bluetooth.c 2002/01/24 16:08:47 1.220
@@ -2467,6 +2467,14 @@
procfs_status);
}
=20
+#ifdef CONFIG_BLUETOOTH_PAN
+ procfs_status =3D bnep_status_create_proc_file();
+ if (procfs_status < 0) {
+ D_ERR("Could not register proc file bnep_status %d\n",
+ procfs_status);
+ }
+#endif /* CONFIG_BLUETOOTH_PAN */
+
#endif /* CONFIG_BLUETOOTH_PROC */
=20
#ifdef CONFIG_BLUETOOTH_USE_TCI
@@ -3220,6 +3228,10 @@
proc_unregister(&proc_root, tci_proc_entry.low_ino);
#endif /* CONFIG_BLUETOOTH_USE_TCI */
#endif /* LINUX_VERSION_CODE */
+
+#ifdef CONFIG_BLUETOOTH_PAN
+ bnep_status_remove_proc_file();
+#endif
#endif /* CONFIG_BLUETOOTH_PROC */
=20
DSYS("Bluetooth Driver unregistered\n");
--- btmem.c 2002/01/24 12:42:33 1.46
+++ btmem.c 2002/01/24 16:08:47 1.47
@@ -114,7 +114,7 @@
=20
if(!(bt_buf.head =3D (u8*) kmalloc(BT_BUF_SIZE,GFP_KERNEL))) {
D_ERR("Can't allocate BT memory buffers");
- return -1;
+ return -ENOMEM;
}
=20=09
=20=20=20
|
|
From: Anders J. <and...@us...> - 2002-02-25 14:08:38
|
The following files were modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
bnep.c 1.8 1.9=20=20=20=20=20=20=20=20=20=20=20=20=20
l2cap.c 1.130 1.131=20=20=20=20=20=20=20=20=20=20=20
rfcomm.c 1.130 1.131=20=20=20=20=20=20=20=20=20=20=20
sdp.c 1.84 1.85=20=20=20=20=20=20=20=20=20=20=20=20
test.c 1.32 1.33=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Handle continuation flag in the configprocedure correctly.=20
* Handle the hintflag in a configurationoption.
The diff of the modified file(s):
--- bnep.c 20 Feb 2002 10:13:37 -0000 1.8
+++ bnep.c 25 Feb 2002 14:08:35 -0000 1.9
@@ -1316,27 +1316,20 @@
{
D_MISC(__FUNCTION__": remote cid %d\n", l2cap->remote_cid);
=20=09
- /* Check if we have sent a pos response yet */
- if (!l2ca_remote_conf_done(l2cap)) {
- /* Send a positive response */
if (l2ca_config_rsp(l2cap, l2cap->remote_mtu, NULL, CONF_SUCCESS)) {
D_ERR(__FUNCTION__": l2ca_config_rsp failed\n");
}
- } else {
- DSYS(__FUNCTION__": already sent a pos response\n");
- }
=20=09
/* If we weren't the initiator, we now send our configuration request. */
/* Fix l2cap->remote_mtu should be max BNEP_MTU??? */
- if (!l2cap->initiator) {
- if (!l2ca_local_conf_done(l2cap)) {
- if (l2ca_config_req(l2cap, l2cap->remote_mtu,=20
+ if (!l2ca_local_conf_done(con) && !con->conf_req_sent) {
+ if (l2ca_config_req(l2cap, BNEP_MTU,=20
NULL, BNEP_FLUSH_TIMEOUT, 0)) {
D_ERR(__FUNCTION__": l2ca_config_req failed\n");
}
- } else {
- DSYS(__FUNCTION__": already ready with config req\n");
}
+ else {
+ DSYS(__FUNCTION__": already ready with config req\n");
}
}
=20
@@ -1354,7 +1347,7 @@
DSYS(__FUNCTION__ ": l2cap configuration failed\n");
/* FIX ME notify usermode and reset connection */
return;
- } else {
+ } else if(l2cap->current_state =3D=3D OPEN) {
D_MISC(__FUNCTION__ ": remote cid %d\n", l2cap->remote_cid);
DSYS(__FUNCTION__ ": bnep channel opened\n");
dev =3D l2cap->upper_con;
@@ -1366,6 +1359,8 @@
bnep_setup_connection(local);=20
}
D_MISC("Interface %s\n", dev->name);
+ } else {
+ DSYS(__FUNCTION__": not done with configuration yet\n");
}
}
=20
--- l2cap.c 19 Feb 2002 19:04:41 -0000 1.130
+++ l2cap.c 25 Feb 2002 14:08:36 -0000 1.131
@@ -722,8 +722,7 @@
=20=09=09
switch (con->current_state) {
case CLOSED:
- /* FIXME - send peer=20
- 'l2cap_config_rsp_neg' */
+ l2cap_config_rsp(con, 0, NULL, CONF_REJ);
break;
=20=09=09=09
case CONFIG: {
@@ -1094,27 +1093,31 @@
#ifdef CONFIG_BLUETOOTH_L2CAP_USE_TIMERS
disable_rtx(con);
#endif
+ /* Do we expect any more values, if not we are done with our sides
+ configuration, reset the req_sent variable */
+ if(!confrsp->flags) {
con->conf_req_ready =3D TRUE;
+ con->conf_req_sent =3D 0;
+ }
=20
- if (!con->conf_rsp_ready) {
- /* Upper layers still haven't replied pos */
- D_STATE(__FUNCTION__": Still haven't replied pos on other sides conf r=
eq\n");
- return ;
- } else {=09=09=09=09
+
+ /* If both sides is ready with the configuration enter the
+ open state otherwise reside in CONFIG state */
+
+ if (l2ca_conf_done(con)) {=09=09=09
ENTERSTATE(con, OPEN);
PRINTSTATE(con);
DSYS("l2cap channel (%d,%d) [%s] connected\n",=20
con->local_cid, con->remote_cid,=20
psm2str(con->psm));
+ } else {
+ D_STATE(__FUNCTION__ ": Both sides not done with the configuration yet=
\n");
+ }
=20=09=09=09=09
/* notify upper layers that we successfully
opened a connection ! */
l2ca_config_cfm(con, confrsp->result);
-
- /* reset variable */
- con->conf_req_sent =3D 0;
return;
- }
=20=09=09=09
case CONF_FAILURE:
=20
@@ -1819,12 +1822,14 @@
=20
if (result =3D=3D CONF_SUCCESS) {
/* upper layers responded OK */
- con->conf_rsp_ready =3D TRUE;
=20
ret_val =3D l2cap_config_rsp(con, out_mtu, in_flow, result);
+ if(!con->remote_flags) {
+ con->conf_rsp_ready =3D TRUE;
+ }
=20
- /* check if we have sent a configure request yet */
- if (con->conf_req_ready && !con->remote_flags) {
+ /* Is the configuration done yet then enter OPEN state */
+ if (l2ca_conf_done(con)) {
/* all done, proceed to OPEN */
ENTERSTATE(con, OPEN);
PRINTSTATE(con);
@@ -3148,6 +3153,11 @@
return con->conf_req_ready;
}
=20
+s32 l2ca_conf_done(l2cap_con *con)
+{
+ return (con->conf_req_ready && con->conf_rsp_ready);
+}
+
/* Parse and set remote options in l2cap con */
s32=20
parse_options(l2cap_con *con, u8 *data, u32 len)
@@ -3163,7 +3173,9 @@
=20
while (pos < len) {
opt =3D (l2cap_option*)(data + pos);
- switch (opt->type) {
+=09=09
+ /* Strip the hint-bit before using */
+ switch (opt->type & 0x7f) {
case OPT_MTU:
con->remote_mtu =3D *(opt->option_data) |=20
(*(opt->option_data + 1) << 8);
--- rfcomm.c 3 Dec 2001 11:31:31 -0000 1.130
+++ rfcomm.c 25 Feb 2002 14:08:36 -0000 1.131
@@ -904,33 +904,14 @@
void=20
rfcomm_config_ind(l2cap_con* l2cap)
{
-
- /*=20
- FIXME
- Check whether the received params are acceptable,=20
- accept all for now
- */
-
D_CTRL("rfcomm_config_ind : remote cid %d\n", l2cap->remote_cid);
- /* check if we have sent a pos response yet */
- if (!l2ca_remote_conf_done(l2cap)){
- /* still haven't sent a pos configure response*/
-=09=09
if (l2ca_config_rsp(l2cap, l2cap->remote_mtu,=20
NULL, CONF_SUCCESS)) {
D_ERR(FNC"l2ca_config_rsp failed\n");
}
- } else=20
- DSYS(FNC"already have sent back a pos response\n");
-
=20
/* check if we received a pos response on a previous conf req */=20
- if (((rfcomm_con*) l2cap->upper_con)->initiator =3D=3D FALSE) {
-
- /* check if we received a pos response on a=20
- previous config req */=20
- if (!l2ca_local_conf_done(l2cap))
- {
+ if (!l2ca_local_conf_done(con) && !con->conf_req_sent) {
l2cap->local_mtu=3Dl2cap->remote_mtu;
=20
DSYS(FNC"Local l2cap mtu set to %d\n",=20
@@ -940,11 +921,9 @@
0, 0)) {
D_ERR(FNC"l2ca_config_req failed\n");
}
- } else=20
+ } else {
DSYS(FNC"already ready with config req\n");
-
}=20
-
}
=20
/* The lower protocol layer, L2CAP, indicates that the configuration
@@ -964,7 +943,7 @@
bt_connect_cfm(CREATE_RFCOMM_ID(rfcomm->line,0), status);
rfcomm_reset_con(rfcomm->line);
return;
- } else {
+ } else if(l2cap->current_state =3D=3D OPEN) {
DSYS(FNC"l2cap is now open\n");
=20=09=09
if (rfcomm->initiator &&=20
@@ -984,9 +963,9 @@
rfcomm->dlci[j].mtu =3D (l2cap->remote_mtu-5);
}
}
+ } else {
+ DSYS(FNC": configuration not done yet\n");
}
-=20=20=20=20=20=20=20=20
-
}
=20
/* The lower protocol layer, L2CAP, indicates that the lower layer=20
--- sdp.c 15 Jan 2002 11:02:28 -0000 1.84
+++ sdp.c 25 Feb 2002 14:08:37 -0000 1.85
@@ -525,6 +525,10 @@
return;
}
=20
+ if(l2cap->current_state !=3D OPEN) {
+ DSYS(__FUNTION__ ": Configuration not done yet\n");
+ }
+
/* Find the connecting sdp_con */
while ((i < MAX_NBR_SDP) && (!stop)) {
if ((sdp_con_list[i].state =3D=3D SDP_CONNECTING) &&=20
@@ -566,23 +570,12 @@
{
D_MISC(__FUNCTION__ " remote cid : %d\n", l2cap->remote_cid);
=20
- /* FIXME -- Check whether the received params are=20
- acceptable, accept all for now */
-
- /* check if we have sent a pos response yet */
- if (!l2ca_remote_conf_done(l2cap)) {
- /* still haven't sent a pos configure response*/
if (l2ca_config_rsp(l2cap, 0, NULL, CONF_SUCCESS)) {
D_ERR(__FUNCTION__ " Conf rsp failed\n");
}
- } else=20
- DSYS("already have sent back a pos response\n");
=20
- /* check if we received a pos response on a=20
- previous config req */=20
if (!l2ca_local_conf_done(l2cap) && !l2cap->conf_req_sent) {
/* FIXME -- use real options not static values */
-=09=09
if (l2ca_config_req(l2cap, 0, NULL, 0, 0)) {
D_ERR(__FUNCTION__ " Config request failed\n");
}
--- test.c 22 Oct 2001 13:25:54 -0000 1.32
+++ test.c 25 Feb 2002 14:08:37 -0000 1.33
@@ -326,18 +326,13 @@
D_STATE("test_config_ind : remote cid : %d remote_mtu : %d\n",=20
con->remote_cid, con->remote_mtu);
=20=09
- /* check if we have sent a pos response yet */
- if (!l2ca_remote_conf_done(con)) {
- /* still haven't sent a pos configure response*/
-
if (l2ca_config_rsp(con, 0, NULL, CONF_SUCCESS)) {
D_ERR("test_config_ind : Configuration response failed\n");
+=09=09=09
}=20=20=20=20
- } else=20
- printk("test_config_ind : already have sent back a pos response\n");
=20
- /* check if we received a pos response on a previous config req */=20
- if (!l2ca_local_conf_done(con)) {
+ /* Are we ready with our sides configuration */=20
+ if (!l2ca_local_conf_done(con) && !con->conf_req_sent) {
=20
/* still haven't sent config request yet */
=20
@@ -375,7 +370,9 @@
{
D_STATE("test_config_cfm : remote cid : %d\n", con->remote_cid);
=20=09
+ if(con->current_state =3D=3D OPEN) {
D_STATE("Now we have an open l2cap channel\n");
+ }
=20
/* negotiate upper protocol */
}
|
|
From: Anders J. <and...@us...> - 2002-02-28 20:12:16
|
The following files were modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
bluetooth.c 1.223 1.224=20=20=20=20=20=20=20=20=20=20=20
hci.c 1.193 1.194=20=20=20=20=20=20=20=20=20=20=20
hci_sec.c 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20
hci_vendor.c 1.61 1.62=20=20=20=20=20=20=20=20=20=20=20=20
sec_client.c 1.22 1.23=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Modified event filter setting procedure to handle any kind of filter.
* Number of cmdbuffers isn't decreased after a set_baudrate command.
The diff of the modified file(s):
--- bluetooth.c 12 Feb 2002 13:54:00 -0000 1.223
+++ bluetooth.c 28 Feb 2002 20:12:14 -0000 1.224
@@ -974,11 +974,15 @@
case HCISET_EVENT_FILTER:
{
u8 param[size];
+ u16 filter_size;
=20
BT_DRIVER(__FUNCTION__ ": HCISET_EVENT_FILTER\n");
copy_from_user(param, (s32*)arg, size);
=20=09=09
- hci_set_event_filter(param);
+ /* The size of the filter is in the first two bytes */
+ filter_size =3D ((param[0] << 8) & 0xff00) | param [1];
+
+ hci_set_event_filter(¶m[2], filter_size);
break;
}=09
=20=09=09
--- hci.c 13 Feb 2002 10:04:54 -0000 1.193
+++ hci.c 28 Feb 2002 20:12:15 -0000 1.194
@@ -2818,18 +2818,14 @@
=20
=20
s32
-hci_set_event_filter(u8 *data)
+hci_set_event_filter(u8 *data, u16 len)
{
D_CMD(__FUNCTION__ "\n");
=20
c_pkt.type =3D CMD_PKT;
c_pkt.opcode =3D hci_put_opcode(SET_EVENT_FILTER, HCI_HC);
- c_pkt.data[0] =3D data[0];
- c_pkt.data[1] =3D data[1];
- c_pkt.data[2] =3D data[2];
-
- c_pkt.len =3D 3;
-=20=20
+ memcpy(c_pkt.data, data, len);
+ c_pkt.len =3D len;
return send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN=
, DEFAULT_TIMEOUT);
}
=20
--- hci_sec.c 22 Feb 2002 13:16:59 -0000 1.1
+++ hci_sec.c 28 Feb 2002 20:12:15 -0000 1.2
@@ -85,15 +85,14 @@
=20
=20
=20
-void hci_process_sec_man_response(u16 result, u32 user_data, u32 request_v=
alue, unsigned char * event_param, unsigned char * remote_bd)
+void=20
+hci_process_sec_man_response(u16 result, u32 user_data, u32 request_value,=
unsigned char * event_param, unsigned char * remote_bd)
{
u8 pin_length =3D 0;
=20=09
- switch (request_value)
- {
+ switch (request_value) {
case PIN_CODE_REQUEST:
- switch(result)
- {
+ switch(result) {
case SECURITY_OK:
/* Calculate the PIN LENGTH */
while ((pin_length <=3D 16) && (event_param[pin_length] !=3D '\0'=
))
@@ -117,8 +116,7 @@
break;
=20=09=20=20=20=20
case LINK_KEY_REQUEST:
- switch(result)
- {
+ switch(result) {
case SECURITY_OK:
D(printk("Link key returned\n"));
hci_link_key_request_reply(remote_bd, event_param);
--- hci_vendor.c 28 Feb 2002 10:40:05 -0000 1.61
+++ hci_vendor.c 28 Feb 2002 20:12:15 -0000 1.62
@@ -1067,7 +1067,12 @@
#ifdef __KERNEL__
bt_wait_tx(2000); /* wait until DMA empty + 2 ms */
#endif
- hci_ctrl.hc_buf.cmd_num--;
+
+ /* FIXME: We don't catch a command status event after this and if=20
+ we decrease the number of buffers free it won't be updated
+ after the baudrate setting. We need to do this in a more
+ proper way. */
+ //hci_ctrl.hc_buf.cmd_num--;
=20
return tmp;
}
|
|
From: Anders J. <and...@us...> - 2003-04-14 08:43:54
|
The following files were modified in linux/drivers/char/bluetooth:
Name Old version New version Tag Comment
---- ----------- ----------- --- -------
bluetooth.c 1.238 1.239=20=20=20=20=20=20=20=20=20=20=20=20=20
hci.c 1.209 1.210=20=20=20=20=20=20=20=20=20=20=20=20=20
l2cap.c 1.136 1.137=20=20=20=20=20=20=20=20=20=20=20=20=20
tcs.c 1.17 1.18=20=20=20=20=20=20=20=20=20=20=20=20=20=20
test.c 1.39 1.40=20=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
lp_disconnect can now be used non-blocking to allow us to disconnect
remote clients in an interupt.
Added option to disconnect clients which fail to switch roles.
The diff of the modified file(s):
--- bluetooth.c 6 Mar 2003 16:04:00 -0000 1.238
+++ bluetooth.c 14 Apr 2003 08:43:46 -0000 1.239
@@ -273,6 +273,7 @@
=20
extern hci_controller hci_ctrl;
extern u8 name_request_response[BT_NAME_LENGTH + 1];
+extern u8 dont_allow_slave;
=20
/* Use global variables to store line and server channel of a new incoming=
connection */
#ifdef CONFIG_BLUETOOTH_PROC
@@ -647,7 +648,7 @@
return -MSGCODE(MSG_BT_INTERFACE, BT_NOTCONNECTED);
}
=20
- return lp_disconnect(con_str->hci_hdl);
+ return lp_disconnect(con_str->hci_hdl, 1);
}
=20
case BTWAITFORCONNECTION:
@@ -1427,6 +1428,20 @@
=20
BT_DRIVER("BTSETMSSWITCH: %d\n", enable);
hci_force_msswitch(enable);
+ return 0;
+ }
+
+ /* set dont_allow_slave flag. If set to 1 and we are
+ using the force_ms flag any client which doesn't
+ support M/S-switching will be disconnected by
+ us if we are non-initiators */
+ case BTDONTALLOWSLAVE:
+ {
+ u8 flag;
+ GET_USER(tmp, (s32*)arg);
+ flag =3D (u8)(tmp & 0xff);
+ BT_DRIVER("BTDONTALLOWSLAVE: %d\n", flag);
+ dont_allow_slave =3D flag;
return 0;
}
=20
--- hci.c 6 Mar 2003 16:03:57 -0000 1.209
+++ hci.c 14 Apr 2003 08:43:46 -0000 1.210
@@ -193,7 +193,7 @@
=20
/* Link Control Commands */
static s32 create_connection(u8 *bd, u32 pkt_type, u8 psrm, u8 psm, u32 c_=
off, u32 rol_sw);
-static s32 disconnect(u32 hdl, u8 reason);
+static s32 disconnect(u32 hdl, u8 reason, u8 block);
static s32 accept_connection_request(u8 bd_addr[], u8 role);
static s32 reject_connection_request(u8 bd_addr[], u32 reason);
static s32 change_connection_packet_type(u32 hci_hdl, u32 pkt_type);
@@ -816,6 +816,8 @@
{
u16 hci_hdl;
s32 i;
+ l2cap_con *con;
+ u8 rev_bd[6];
=20
PRINTPKT(__FUNCTION__, buf, len);
=20
@@ -1118,6 +1120,18 @@
case ROLE_CHANGED:
DSYS(__FUNCTION__ ": ROLE_CHANGED\n");
=20
+ /* Find the connection and set the role */
+ if ((con =3D get_con(buf + 1, CLOSED)) =3D=3D NULL) {
+ D_ERR(__FUNCTION__ ": couldn't find connection!\n");
+ break;
+ }
+
+ if(con->initiator) {
+ con->role =3D 0x00;
+ } else {
+ con->role =3D 0x01;
+ }
+
if (buf[0]) {
D_ERR(__FUNCTION__ ": Role changed failed due to %s\n",
get_err_msg(buf[0]));
@@ -1126,9 +1140,11 @@
} else if (buf[7]) {
DSYS(__FUNCTION__ ": Current master is 0x%04x%08x\n",
le16_to_cpuu(&buf[5]), le32_to_cpuu(&buf[1]));
+ con->role =3D 0x01;
} else {
DSYS(__FUNCTION__ ": Our role is master for BD Address 0x%04x%08x\n",
le16_to_cpuu(&buf[5]), le32_to_cpuu(&buf[1]));
+ con->role =3D 0x00;
}
break;
=20
@@ -2218,7 +2234,7 @@
disconnected. The Reason function parameter indicates the reason for en=
ding
the connection, see page 552 specification core 1.0B */
s32
-disconnect(u32 hdl, u8 reason)
+disconnect(u32 hdl, u8 reason, u8 block)
{
D_CMD(__FUNCTION__ "\n");
c_pkt.type =3D CMD_PKT;
@@ -2229,8 +2245,12 @@
c_pkt.data[2] =3D reason;
c_pkt.len =3D 3;
=20
+ if(block) {
return send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN,
DEFAULT_TIMEOUT);
+ } else {
+ return send_cmd((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN);
+ }
}
=20
/* A positive response to a previous connection request, role =3D 0 sets m=
aster,
@@ -3557,9 +3577,9 @@
=20
/* Disconnect a certain connection handler */
s32
-lp_disconnect(u32 hci_hdl)
+lp_disconnect(u32 hci_hdl, u8 block)
{
- return disconnect(hci_hdl, DISCMSG_USER_ENDED_CONNECTION);
+ return disconnect(hci_hdl, DISCMSG_USER_ENDED_CONNECTION, block);
}
=20
=20
--- l2cap.c 6 Mar 2003 16:03:59 -0000 1.136
+++ l2cap.c 14 Apr 2003 08:43:47 -0000 1.137
@@ -237,6 +237,7 @@
static struct protocol_layer default_protocol;
extern int bt_max_connections;
extern hci_controller hci_ctrl;
+u8 dont_allow_slave =3D 0;
=20
/****************** FUNCTION DEFINITION SECTION **************************=
***/
=20=20=20
@@ -1637,7 +1638,7 @@
callers responsibility to take proper action */
D_ERR(__FUNCTION__ ": failed (status %d)\n", retval);
if(!tmpcon) {
- lp_disconnect(con->hci_hdl);
+ lp_disconnect(con->hci_hdl, 1);
}
ENTERSTATE(con, CLOSED);
delete_con(con);
@@ -1654,7 +1655,7 @@
}
=20
if(!tmpcon) {
- lp_disconnect(con->hci_hdl);
+ lp_disconnect(con->hci_hdl, 1);
}
=20=09=09
switch(con->c_status) {
@@ -1769,7 +1770,7 @@
if (count_con(tmp_hdl) =3D=3D 0) {
DSYS("l2ca_disconnect_req : (C) no more l2cap cons\n");
DSYS("Shutdown baseband\n");
- lp_disconnect(tmp_hdl);
+ lp_disconnect(tmp_hdl, 1);
}
=20
return retval;
@@ -2797,6 +2798,18 @@
return;
}
=20=20=20
+ /* Check which role the device have at the moment,=20
+ if we only accept us to be the master and the=20
+ client currently is the master as a result of
+ a failure of the MS-switch we deny the connection
+ here */
+ if(dont_allow_slave && (!con->initiator) && con->role) {
+ D_ERR(__FUNCTION__ ": Remote role not allowed, the client failed to swit=
ch roles. Disconnecting.\n");
+ l2ca_connect_rsp(con, RES_SECNEG, STAT_NOINFO);
+ lp_disconnect(con->hci_hdl, 0);
+ return;
+ }
+=20=20
get_upper(con->psm)->con_ind(con);
}
=20
@@ -2954,7 +2967,7 @@
}
=20
if(first_conn) {
- lp_disconnect(con->hci_hdl);
+ lp_disconnect(con->hci_hdl, 1);
}
=20
return retval;
--- tcs.c 1 Aug 2002 16:19:29 -0000 1.17
+++ tcs.c 14 Apr 2003 08:43:50 -0000 1.18
@@ -490,7 +490,7 @@
=20=09
case RELEASE:
D_REC(FNC"Received RELEASE message\n");
- if (lp_disconnect(tcs[0].sco_hdl)) {
+ if (lp_disconnect(tcs[0].sco_hdl, 1)) {
D_ERR("lp_disconnect failed\n");
} else {
send_single_octet_msg(l2cap, RELEASE_COMPLETE, CALL_CONTROL);
--- test.c 6 Mar 2003 16:04:08 -0000 1.39
+++ test.c 14 Apr 2003 08:43:50 -0000 1.40
@@ -525,7 +525,7 @@
}
else if(!strncmp(cmd, "bb_disc ", 8)) {
int i =3D strtoul(cmd+8, NULL, 0);
- return lp_disconnect((unsigned short)i);
+ return lp_disconnect((unsigned short)i, 1);
}
else if(!strncmp(cmd, "lcid_disconnect ", 16)) {
l2cap_con *con =3D NULL;
|