|
From: Mattias A. <mat...@us...> - 2001-05-02 15:43:29
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
rfcomm.c 1.107 1.108=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* replaced hardcoded values with define
* index test should go first in while loop (get_connected_dlci)
* fixed bug when all rfcomm cons where busy (get_new_rfcomm_con)
The diff of the modified file(s):
--- rfcomm.c 2001/04/25 17:08:53 1.107
+++ rfcomm.c 2001/05/02 15:43:29 1.108
@@ -540,8 +540,8 @@
static u8 crctable[256];
/* The crctable for the FEC field */
=20
-rfcomm_con rfcomm_con_list[7];
-/* One RFCOMM connection for each bt_tty 0 to 6 */
+rfcomm_con rfcomm_con_list[BT_NBR_DATAPORTS];
+/* One RFCOMM connection for each bt_tty 0 to BT_NBR_DATAPORTS */
=20
#ifdef __KERNEL__
static struct timer_list rfcomm_timer;
@@ -873,7 +873,7 @@
con objs) to see which rfcomm that was trying to connect */
=20
/* Find the connecting rfcomm_con */
- while ((i < 7) && (!stop)) {
+ while ((i < BT_NBR_DATAPORTS) && (!stop)) {
if ((rfcomm_con_list[i].dlci[0].state =3D=3D CONNECTING) &&=20
(rfcomm_con_list[i].initiator =3D=3D TRUE)) {
rfcomm =3D &rfcomm_con_list[i];
@@ -2363,19 +2363,18 @@
{
s32 i =3D 0;
=20
- while ((i<BT_NBR_DATAPORTS)
- && (rfcomm_con_list[i].dlci[0].state !=3D DISCONNECTED)) {
- i++;
- }
D_CTRL("get_new_rfcomm_con: rfcomm_con -> ttyBT%d\n",i);
- if (rfcomm_con_list[i].dlci[0].state !=3D DISCONNECTED) {
- return NULL;
- } else {
- /* Reset these parameters just incase... */
+
+ for (i =3D 0 ; i < BT_NBR_DATAPORTS ; i ++)
+ {
+ if (rfcomm_con_list[i].dlci[0].state =3D=3D DISCONNECTED)
+ {
rfcomm_con_list[i].l2cap =3D NULL;
return &rfcomm_con_list[i];
}
}
+ return NULL;
+}
=20
rfcomm_con*=20
get_rfcomm_con(u8 line)
@@ -2398,7 +2397,7 @@
s32 tmp;
=20
tmp =3D 61;
- while ((rfcomm->dlci[tmp].state =3D=3D DISCONNECTED) && (tmp > 0)) {
+ while ((tmp > 0) && (rfcomm->dlci[tmp].state =3D=3D DISCONNECTED)) {
tmp--;
}
=20
|