|
From: Willy S. <sag...@us...> - 2002-04-08 16:45:07
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Tag Comment
---- ----------- ----------- --- -------
bnep.c 1.14 1.15=20=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Added bnep_disconnect_req=20
The diff of the modified file(s):
--- bnep.c 21 Mar 2002 15:15:06 -0000 1.14
+++ bnep.c 8 Apr 2002 09:39:46 -0000 1.15
@@ -58,7 +58,7 @@
#include <linux/ioctl.h>
#include <linux/config.h>
#include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
@@ -117,6 +117,8 @@
=20
/****************** GLOBAL VARIABLE DECLARATION SECTION ******************=
***/
=20
+static s32 result_param_bnep;
+
/*************************** UPF TEST VARS *******************************=
***/
extern int dont_send_reply;
=20
@@ -1277,18 +1279,23 @@
if (l2ca_connect_rsp(l2cap, RES_NOSRC, STAT_NOINFO)) {
D_ERR("bnep_connect_ind: l2ca_connect_rsp failed\n");
}
+ result_param_bnep |=3D 0xff;
return;
}
=20=20=20
if (l2ca_connect_rsp(l2cap, RES_SUCCESS, STAT_NOINFO)) {
D_ERR("bnep_connect_ind: l2ca_connect_rsp failed\n");
+ result_param_bnep |=3D 0xff;
return;
}
=20=09
// l2cap->dev =3D &dev_bnep[i];
+ result_param_bnep =3D ((l2cap->hci_hdl<<8)&0x0ffff00) + ((i<<24)&0=
xff000000);
local->state =3D BNEP_CONFIG;
local->initiator =3D 0;
l2cap->upper_con =3D (void *)&dev_bnep[i];
+
+ result_param_bnep &=3D 0xffffff00;
}
=20
static void
@@ -1474,7 +1481,33 @@
return -1;
}
=20=09
+ return result_param_bnep;
+}
+
+u32
+bnep_disconnect_req(u8 *bd_addr)
+{
+ struct net_local *local;
+ int i;
+
+ DSYS("BNEP: Shutting down BD_ADDR %02x:%02x:%02x:%02x:%02x:%02x\n",
+ bd_addr[0],bd_addr[1],bd_addr[2],bd_addr[3],bd_addr[4],bd_addr[5]);
+=20=09
+ for (i =3D 0; i < BNEP_INTERFACES; i++) {
+ local =3D dev_bnep[i].priv;
+ if (local !=3D NULL && local->l2cap !=3D NULL && local->l2cap->remote_bd=
!=3D NULL)
+ if (memcmp(local->l2cap->remote_bd, bd_addr, 6)) {
+ D_MISC("Disconnecting %s\n", dev_bnep[i].name);
+ if (l2ca_disconnect_req(local->l2cap)) {
+ D_ERR(__FUNCTION__": l2ca_connect_req failed\n");
+ return -1;
+ }
+ else
return 0;
+ }
+ }
+ DSYS("BNEP: bnep_disconnect_req bd_addr no found !!!\n");
+ return -1;
}
=20
s32
|