|
From: Olov H. <ol...@us...> - 2001-07-10 12:52:56
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
l2cap.c 1.110 1.111=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Added support for max number of BT connections
The diff of the modified file(s):
--- l2cap.c 2001/06/18 12:49:31 1.110
+++ l2cap.c 2001/07/10 12:52:55 1.111
@@ -50,6 +50,7 @@
#include <linux/malloc.h>
#include <linux/bluetooth/l2cap.h>
#include <linux/bluetooth/hci.h>
+#include <linux/bluetooth/hci_internal.h>
#include <linux/bluetooth/rfcomm.h>
#include <linux/bluetooth/sdp.h>
#include <linux/bluetooth/test.h>
@@ -254,6 +255,8 @@
static l2cap_layer l2capmain; /* Main structure */
static l2cap_layer* l2cap;
static struct protocol_layer default_protocol;
+extern int bt_max_connections;
+extern hci_controller hci_ctrl;
=20
/****************** FUNCTION DEFINITION SECTION **************************=
***/
=20=20=20
@@ -1312,11 +1315,20 @@
=20
/* We are server and creates an l2cap connection object=20
which we set hci handle when we received lp_connect_cfm */
+ /* Denying a connection at this state does not allow
+ SDP queries when max amount of connections is reached*/
=20=20=20
+ if (hci_ctrl.nbr_of_connections < bt_max_connections){
D_CON(__FUNCTION__ ": Accepting connection\n");
l2cap_create_con(bd_addr);
lp_connect_rsp(bd_addr,1);
}
+ else{
+ D_CON(__FUNCTION__ ": Denying connection. Current connections: %d,=20
+ max connections: %d\n", bt_connections, bt_max_connections=
);
+ lp_connect_rsp(bd_addr,0);
+ }
+}
=20
/* is called when we accept a _new_ baseband connection */
void=20
|