|
From: Peter K. <pk...@us...> - 2001-09-12 12:38:11
|
The following files were modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
bluetooth.c 1.194 1.195=20=20=20=20=20=20=20=20=20=20=20
l2cap.c 1.117 1.118=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Use hci_ctrl.nbr_of_connections instead of calculating bt_connections
for bt_set_leds().
The diff of the modified file(s):
--- bluetooth.c 2001/09/10 11:19:57 1.194
+++ bluetooth.c 2001/09/12 12:38:10 1.195
@@ -76,6 +76,7 @@
#include <linux/bluetooth/btcommon.h>
#include <linux/bluetooth/btmem.h>
#include <linux/bluetooth/hci.h>
+#include <linux/bluetooth/hci_internal.h>
#include <linux/bluetooth/l2cap.h>
#include <linux/bluetooth/rfcomm.h>
#include <linux/bluetooth/tcs.h>
@@ -251,6 +252,8 @@
=20
/****************** GLOBAL VARIABLE DECLARATION SECTION ******************=
***/
=20
+extern hci_controller hci_ctrl;
+
/****************** LOCAL VARIABLE DECLARATION SECTION *******************=
***/
=20
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
@@ -2252,14 +2255,10 @@
static void
bt_set_leds(int active)
{
- extern int bt_connections;
- int light_leds =3D ((!bt_connections && active =3D=3D BLUETOOTH_ACTIVITY)=
||
- (bt_connections && active =3D=3D NO_BLUETOOTH_ACTIVITY));
-
- if (light_leds) {
+ if ((!hci_ctrl.nbr_of_connections && active =3D=3D BLUETOOTH_ACTIVITY) ||
+ (hci_ctrl.nbr_of_connections && active =3D=3D NO_BLUETOOTH_ACT=
IVITY)) {
LED_ACTIVE_SET(bt_dfu_mode(-1) ? LED_ORANGE : LED_GREEN);
- }
- else {
+ } else {
LED_ACTIVE_SET(LED_OFF);
}
}
--- l2cap.c 2001/09/12 12:12:29 1.117
+++ l2cap.c 2001/09/12 12:38:10 1.118
@@ -247,10 +247,6 @@
=20
/****************** GLOBAL VARIABLE DECLARATION SECTION ******************=
***/
=20
-#ifdef __CRIS__
-int bt_connections =3D 0;
-#endif
-
/****************** LOCAL VARIABLE DECLARATION SECTION *******************=
***/
=20
static l2cap_layer l2capmain; /* Main structure */
@@ -275,10 +271,6 @@
init_con_list();
l2cap->cid_count =3D MIN_CID; /* Moved from init_con_list */
=20
-#ifdef __CRIS__
- bt_connections =3D 0;
-#endif
-
/* Set all upper layers to default */
=20
l2cap_protocol_default(&default_protocol);
@@ -367,10 +359,6 @@
free_con_list();
remove_all_upper();
=20
-#ifdef __CRIS__
- bt_connections =3D 0;
-#endif
-
/* ALWAYS SUCCESS */
return 0;
}
@@ -1407,9 +1395,6 @@
con->c_flags &=3D ~FLAG_RETURNNOW;
return 0;
}
-#ifdef __CRIS__
- bt_connections++;
-#endif
=20=09=09
if (!(con->initiator)) {=09=09
D_STATE("We are server\n");
@@ -1502,13 +1487,6 @@
=20
/* flush old buffers waiting to be sent on this handle */
btmem_flushhandle((u16)con_hdl);
-
-#ifdef __CRIS__
- if (bt_connections > 0)
- bt_connections--;
- else
- D_ERR(__FUNCTION__ ": bt_connections =3D=3D 0\n");
-#endif
=20
return found;
}
|