You can subscribe to this list here.
| 2001 |
Jan
|
Feb
(44) |
Mar
(202) |
Apr
(134) |
May
(89) |
Jun
(94) |
Jul
(58) |
Aug
(58) |
Sep
(56) |
Oct
(75) |
Nov
(26) |
Dec
(14) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(24) |
Feb
(30) |
Mar
(15) |
Apr
(49) |
May
(12) |
Jun
(6) |
Jul
(11) |
Aug
(20) |
Sep
(19) |
Oct
(3) |
Nov
(13) |
Dec
(1) |
| 2003 |
Jan
(7) |
Feb
(4) |
Mar
(7) |
Apr
(5) |
May
(6) |
Jun
(3) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(51) |
Dec
(1) |
| 2004 |
Jan
(11) |
Feb
(5) |
Mar
|
Apr
(5) |
May
(2) |
Jun
|
Jul
(21) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Peter K. <pk...@us...> - 2001-04-17 12:07:57
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
bluetooth.c 1.163 1.164=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Cannot clear the buffers in bt_flush_buffer() due to how hangup works.
The diff of the modified file(s):
--- bluetooth.c 2001/04/17 06:09:19 1.163
+++ bluetooth.c 2001/04/17 12:07:57 1.164
@@ -466,6 +466,9 @@
static void
bt_flush_buffer(struct tty_struct *tty)
{
+ /* Clearing the buffers here may lead to them being cleared before
+ they are sent when diconnecting a connection */
+#if 0
bt_tx_buf* tx_buf;
=20
BT_DRIVER("bt_flush_buffer\n");
@@ -473,6 +476,7 @@
while ((tx_buf =3D get_bt_buf())) {
unsubscribe_bt_buf(tx_buf);
}
+#endif
}
=20
static s32
|
|
From: Peter K. <pk...@us...> - 2001-04-17 12:04:37
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
hci.c 1.138 1.139=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Do not use DM1 and DH1 packets (they were re-added in 1.135, but
using them degrades performance for Ericsson clients too much).
The diff of the modified file(s):
--- hci.c 2001/04/17 07:03:27 1.138
+++ hci.c 2001/04/17 12:04:00 1.139
@@ -703,7 +703,7 @@
} else {
DSYS(__FUNCTION__", ACL link is up\n");
change_connection_packet_type(hci_hdl,=20
- DM1|DH1|DM3|DH3|DM5|DH5);
+ DM3|DH3|DM5|DH5);
set_hci_con(buf + 3, hci_hdl);
remote_name_request(buf + 3);
=20
|
|
From: Mattias A. <mat...@us...> - 2001-04-17 11:53:29
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- btdebug.h 1.38 1.39=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: added bd2str The diff of the modified file(s): --- btdebug.h 2001/03/30 10:58:51 1.38 +++ btdebug.h 2001/04/17 11:53:29 1.39 @@ -190,5 +190,7 @@ void print_data(const unsigned char *message, unsigned char *buf, int len); #endif =20 +const char* bd2str(const unsigned char *bd); + #endif /****************** END OF FILE btdebug.h ********************************= ****/ |
|
From: Peter K. <pk...@us...> - 2001-04-17 10:38:18
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_conf.h 1.2 1.3=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Configured for CSR hardware and to use IP Assigner by default. The diff of the modified file(s): --- bt_conf.h 2001/03/02 13:54:57 1.2 +++ bt_conf.h 2001/04/17 10:38:18 1.3 @@ -50,7 +50,7 @@ #define HW_USBMODULE 5 /* Not implemented */ =20 /* This sets current HW in usermode application */ -#define HW_CURRENT HW_ERICSSON +#define HW_CURRENT HW_CSR =20 #define HW_USED(x) (HW_CURRENT =3D=3D x) =20 @@ -70,6 +70,6 @@ /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D*/ /* IPA server */ =20 -//#define USE_IPASSIGN +#define USE_IPASSIGN =20 #endif /* __BT_CONF_H__ */ |
|
From: Mattias A. <mat...@us...> - 2001-04-17 10:00:26
|
The following files were modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
hci_vendor.c 1.21 1.22=20=20=20=20=20=20=20=20=20=20=20=20
rfcomm.c 1.100 1.101=20=20=20=20=20=20=20=20=20=20=20
sdp.c 1.73 1.74=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
use kernel wait queue structs when doing busywait in usermode stack
(emulates blocking calls with usermode stack define of interuptible_sleep_on
and wake_up_interruptible in btcommon.h)
The diff of the modified file(s):
--- hci_vendor.c 2001/04/10 13:04:24 1.21
+++ hci_vendor.c 2001/04/17 10:00:26 1.22
@@ -88,7 +88,6 @@
/* These are declared in hci.c */
extern cmd_pkt c_pkt;
=20
-#if __KERNEL__
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
extern struct wait_queue *hci_wq;
extern struct wait_queue *set_baudrate_wq;
@@ -96,7 +95,6 @@
extern wait_queue_head_t hci_wq;
extern wait_queue_head_t set_baudrate_wq;
#endif /* LINUX_VERSION_CODE */
-#endif /* __KERNEL__ */
=20
extern hci_controller hci_ctrl;
=20
--- rfcomm.c 2001/04/12 16:25:58 1.100
+++ rfcomm.c 2001/04/17 10:00:26 1.101
@@ -544,8 +544,8 @@
/* One RFCOMM connection for each bt_tty 0 to 6 */
=20
#ifdef __KERNEL__
-
static struct timer_list rfcomm_timer;
+#endif
#define RFCOMM_CON_TIMEOUT (5*HZ)
=20
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
@@ -554,9 +554,6 @@
static wait_queue_head_t rfcomm_disconnect_wq;
#endif /* LINUX_VERSION_CODE */
=20
-#else
-static int rfcomm_disconnect_wq;
-#endif /* __KERNEL__ */
=20
void send_send_data(unsigned long ptr);
=20
@@ -687,7 +684,17 @@
=20=20=20
DSYS("Shutting down RFCOMM\n");
=20
- /* Reset rfcomm lines */
+#if 0
+ /* First try disconnecting */
+ for (i =3D 0; i < BT_NBR_DATAPORTS; i++) {
+ rfcomm_con *rfcomm =3D get_rfcomm_con(i);
+ if (get_connected_dlci(rfcomm) !=3D -1) {
+ DSYS("Now disconnecting rfcomm line %d\n", i);
+ rfcomm_disconnect_req(i);
+ }=09=09
+ }
+#endif
+ /* If still connections left, terminate them */
for (i =3D 0; i < BT_NBR_DATAPORTS; i++) {
rfcomm_reset_con(i);
}
--- sdp.c 2001/04/17 07:00:49 1.73
+++ sdp.c 2001/04/17 10:00:26 1.74
@@ -307,13 +307,11 @@
/* Transaction id used for request */
//static u16 req_trans_id =3D 0xaabb;
=20
-#ifdef __KERNEL__
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
static struct wait_queue *sdp_disc_wq =3D NULL;
#else
static wait_queue_head_t sdp_disc_wq;
#endif /* LINUX_VERSION_CODE */
-#endif /* __KERNEL__ */
=20
#ifdef __KERNEL__
static bt_tx_buf *db_write_tx_buf;
|
|
From: Gordon M. <gm...@us...> - 2001-04-17 07:03:27
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
hci.c 1.137 1.138=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Added some checks to make sure we don't write beyond the end of some of our=
buffers due to bad length field values.
The diff of the modified file(s):
--- hci.c 2001/04/12 15:13:01 1.137
+++ hci.c 2001/04/17 07:03:27 1.138
@@ -409,6 +409,21 @@
event_len =3D *buf;
buf +=3D 1;
count -=3D 1;
+
+ /* If we don't check this and the lower level driver
+ gives us some trashed values then we might write
+ beyond the end of our event buffer in a memcpy=20
+ below.
+ --gmcnutt
+ */
+ if (event_len > sizeof(event_buf)) {
+ D_ERR(__FUNCTION__ ": %d is too big for our "\
+ "event buffer -- discarding buffer\n",
+ event_len);
+ state =3D WAIT_FOR_PACKET_TYPE;
+ return;
+ }
+
if (event_len <=3D count) {
process_event(buf, event_len, event_type);
buf +=3D event_len;
@@ -450,6 +465,19 @@
pb_flag =3D (((u32) hdr[1]) & 0x30) >> 4;
bc_flag =3D (((u32) hdr[1]) & 0xc0) >> 6;
data_len =3D CHAR2INT16(hdr[3],hdr[2]);
+
+ /* Check the length to make sure we won't=20
+ overrun in_buf->buf_ptr in a memcpy later.
+ --gmcnutt
+ */
+ if (data_len > HCI_IN_SIZE) {
+ D_ERR(__FUNCTION__ ": %d is too big "\
+ "for our HCI input buffers -- "\
+ "discarding buffer\n",
+ data_len);
+ state =3D WAIT_FOR_PACKET_TYPE;
+ return;
+ }
=20
if (pb_flag =3D=3D L2CAP_FRAME_START) {
D_REC(__FUNCTION__", new frame\n");
|
|
From: Gordon M. <gm...@us...> - 2001-04-17 07:00:49
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
sdp.c 1.72 1.73=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
--Fixed a bug that caused the user process to hang while reinitializing the=
stack after establishing an SDP connection.
The diff of the modified file(s):
--- sdp.c 2001/04/17 00:56:11 1.72
+++ sdp.c 2001/04/17 07:00:49 1.73
@@ -755,9 +755,15 @@
D_ERR(__FUNCTION__ ", An error with error code %d occured duinr disconn=
etion of sdp channel %d\n", err, sdp_id);
sdp_con_list[sdp_id].state =3D SDP_DISCONNECTED;
sdp_con_list[sdp_id].l2cap =3D NULL;=20=20
- } else {
+ }=20
+#if 0
+ /* sdp_disconnect_cfm wakes up this queue, but by the time we
+ get here it already did, so we sleep forever!
+ */
+else {
interruptible_sleep_on(&sdp_disc_wq);
}
+#endif
}
}
=20
|
|
From: Gordon M. <gm...@us...> - 2001-04-17 06:09:19
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
bluetooth.c 1.162 1.163=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
--Backed out my last change. A closer look shows that we can use /dev/ttyBT=
C (and only /dev/ttyBTC) for SDP connections. When we open /dev/ttyBTC it r=
emains in the BT_INACTIVE state. Then bt_register_sdp will move it to BT_AC=
TIVE, and bt_unregister_sdp will move it back to BT_INACTIVE. This does mea=
n that we can only have one SDP connection in the system at a time, so it's=
still not ideal.
The diff of the modified file(s):
--- bluetooth.c 2001/04/17 05:33:19 1.162
+++ bluetooth.c 2001/04/17 06:09:19 1.163
@@ -2412,8 +2412,7 @@
D_WARN("bt_register_sdp: Pending SDP data for this new connection @ line=
%d\n", line);
}
=20
- if ((SESSIONSTATE(line) =3D=3D BT_INACTIVE) ||
- (SESSIONSTATE(line) =3D=3D BT_UPPERCONNECTED)){
+ if (SESSIONSTATE(line) =3D=3D BT_INACTIVE) {
/* now register ! */
DSYS("bt_register_sdp : line %d\n", line);
SESSIONSTATE(line) =3D BT_ACTIVE;
|
|
From: Gordon M. <gm...@us...> - 2001-04-17 05:33:19
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
bluetooth.c 1.161 1.162=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
--Someone correct me if I'm wrong, but I don't think we can get a useful SD=
P connection without this change. The only time we'll ever see BT_INACTIVE =
on a session after starting a BTCONNECT is if the line is /dev/ttyBTC. But =
if we establish an SDP connection on /dev/ttyBTC we'll never be able to use=
it for BT_SDP_REQUEST ioctls because it's session state will be stuck in B=
T_LOWERCONNECTED. The BT_ACTIVE state is impossible on /dev/ttyBTC. So we'l=
l need to use one of the data devices, and as soon as one of these opens th=
e session state goes to BT_UPPERCONNECTED.
The diff of the modified file(s):
--- bluetooth.c 2001/04/12 12:06:53 1.161
+++ bluetooth.c 2001/04/17 05:33:19 1.162
@@ -2412,7 +2412,8 @@
D_WARN("bt_register_sdp: Pending SDP data for this new connection @ line=
%d\n", line);
}
=20
- if (SESSIONSTATE(line) =3D=3D BT_INACTIVE) {
+ if ((SESSIONSTATE(line) =3D=3D BT_INACTIVE) ||
+ (SESSIONSTATE(line) =3D=3D BT_UPPERCONNECTED)){
/* now register ! */
DSYS("bt_register_sdp : line %d\n", line);
SESSIONSTATE(line) =3D BT_ACTIVE;
@@ -2503,7 +2504,7 @@
/* Data line ! */
if (!bt_stack_initiated) {
D_WARN("bt_register_tty : Bluetooth stack not initiated\n");
- return -1;
+ return -EPERM;
}
}
=20
|
|
From: Gordon M. <gm...@us...> - 2001-04-17 00:56:11
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
sdp.c 1.71 1.72=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
--l2ca_disconnect_req will not return a negative value on all errors. On so=
me errors, such as an l2cap timeout, it returns a positive value. In the ca=
se of an l2cap timeout we don't want to sleep on the sdp_disc_wq since it's=
likely we'll never wake up.
The diff of the modified file(s):
--- sdp.c 2001/03/30 12:09:30 1.71
+++ sdp.c 2001/04/17 00:56:11 1.72
@@ -751,7 +751,7 @@
/*-------------------------------------------------------------------*/
if (sdp_id <=3D MAX_NBR_SDP &&
(sdp->state =3D=3D SDP_CONNECTING || sdp->state =3D=3D SDP_CONNECTED)=
) {
- if ((err =3D l2ca_disconnect_req(sdp_con_list[sdp_id].l2cap)) < 0) {
+ if ((err =3D l2ca_disconnect_req(sdp_con_list[sdp_id].l2cap)) !=3D 0) {
D_ERR(__FUNCTION__ ", An error with error code %d occured duinr disconn=
etion of sdp channel %d\n", err, sdp_id);
sdp_con_list[sdp_id].state =3D SDP_DISCONNECTED;
sdp_con_list[sdp_id].l2cap =3D NULL;=20=20
|
|
From: Peter K. <pk...@us...> - 2001-04-12 16:25:59
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
rfcomm.c 1.99 1.100=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
If rfcomm session was reset in rfcomm_disconnect_req(), we
called l2ca_disconnect_req() with a NULL pointer instead of
the l2cap_con object.
The diff of the modified file(s):
--- rfcomm.c 2001/04/12 12:25:29 1.99
+++ rfcomm.c 2001/04/12 16:25:58 1.100
@@ -779,6 +779,8 @@
tmp =3D get_connected_dlci(rfcomm);
=20
if (tmp > 0) {
+ l2cap_con *l2cap =3D rfcomm->l2cap;
+
rfcomm->dlci[tmp].state =3D DISCONNECTING;
=20=09=09
send_disc(rfcomm, tmp);
@@ -786,8 +788,8 @@
#ifdef __KERNEL__
start_wq_timer(&rfcomm_timer, RFCOMM_CON_TIMEOUT,
&rfcomm_disconnect_wq);
-
#endif
+
/* FIXME -- check that we haven't already received=20
disconnect 'acknowledge' */
=20
@@ -810,10 +812,9 @@
=20
/* Now rfcomm is disconnected, disconnect l2cap */
=20
- l2ca_disconnect_req(rfcomm->l2cap);
+ l2ca_disconnect_req(l2cap);
=20
/* Now l2cap ch for RFCOMM is disconnected */
-
}
else
D_WARN("rfcomm_disconnect_req : line not connected !\n");
|
|
From: Peter K. <pk...@us...> - 2001-04-12 15:56:42
|
The following files were modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
bluetooth.c 1.155 1.155.2.1=20=20=20=20=20=20=20
rfcomm.c 1.95 1.95.4.1=20=20=20=20=20=20=20=20
The accompanying log:
Branch to fix disconnection of Bluetooth connection in R2_1_11.
The diff of the modified file(s):
--- bluetooth.c 2001/03/27 19:32:27 1.155
+++ bluetooth.c 2001/04/12 15:56:40 1.155.2.1
@@ -466,6 +466,7 @@
static void
bt_flush_buffer(struct tty_struct *tty)
{
+#if 0=09
bt_tx_buf* tx_buf;
=20
BT_DRIVER("bt_flush_buffer\n");
@@ -473,6 +474,7 @@
while ((tx_buf =3D get_bt_buf())) {
unsubscribe_bt_buf(tx_buf);
}
+#endif
}
=20
static s32
@@ -2378,6 +2380,11 @@
D_WARN("bt_unregister_rfcomm : inactive session\n");
return -1;
}
+
+ /* notify upper tty that this rfcomm connection is down */
+#ifdef __KERNEL__
+ bt_hangupline(line);
+#endif
return 0;
}
=20
--- rfcomm.c 2001/03/12 15:54:35 1.95
+++ rfcomm.c 2001/04/12 15:56:40 1.95.4.1
@@ -975,31 +975,30 @@
void=20
rfcomm_disconnect_ind(l2cap_con *l2cap)
{
-#define FNC "rfcomm_disconnect_ind: "
rfcomm_con *rfcomm;
=20
- D_CTRL(FNC"remote cid %d\n", l2cap->remote_cid);
+ D_CTRL(__FUNCTION__" remote cid %d\n", l2cap->remote_cid);
=20
rfcomm =3D ((rfcomm_con*) l2cap->upper_con);
=20
- if (l2ca_disconnect_rsp(l2cap)) {
- D_ERR(FNC"l2ca_disconnect_rsp failed\n");
- return;
- }
+ /* This l2cap connection is going down, remove all rfcomm cons=20
+ and notify upper tty */
=20
+ if (!l2cap->link_up)
+ {
+ DSYS("Baseband is down, reset this RFCOMM session\n");
#ifdef __KERNEL__
-
bt_unregister_rfcomm(rfcomm->line);
-
- /* notify upper tty that this rfcomm connection is down */
- bt_hangupline(rfcomm->line);
-#else
- bt_disconnect_ind(CREATE_RFCOMM_ID(rfcomm->line, 0));
#endif
-=09
+ bt_disconnect_ind(CREATE_RFCOMM_ID(rfcomm->line, 0));
rfcomm_reset_con(rfcomm->line);
+ }
=20=09
-#undef FNC
+ /* always try to send back rsp (if link is down con is deleted) */
+ if (l2ca_disconnect_rsp(l2cap)) {
+ D_ERR(__FUNCTION__" l2ca_disconnect_rsp failed\n");
+ return;
+ }
}
=20
void=20
@@ -1013,8 +1012,17 @@
=20
rfcomm =3D (rfcomm_con*) l2cap->upper_con;
=20
+ /* fixme -- should we indicate to bt interface when rfcomm is=20
+ down or when l2cap for rfcomm is down ? */
bt_disconnect_ind(CREATE_RFCOMM_ID(rfcomm->line, 0));
=20=09
+ /* fixme -- add these glue layer functions in userstack */
+#ifdef __KERNEL__
+ bt_unregister_rfcomm(rfcomm->line);
+
+ /* wake up bt line */
+ bt_disconnect_cfm(CREATE_RFCOMM_ID(rfcomm->line, 0), 0);
+#endif=09
rfcomm_reset_con(rfcomm->line);
=20=09
#undef FNC
@@ -1154,6 +1162,7 @@
=20
} else if (rfcomm->dlci[tmp_dlci].state =3D=3D DISCONNECTING) {
if (tmp_dlci =3D=3D 0) {
+ rfcomm->dlci[0].state =3D DISCONNECTED;
#ifdef __KERNEL__=20=20
wake_up_interruptible(&rfcomm_disconnect_wq);
#else
@@ -1197,6 +1206,8 @@
Tell the tty that the link is down */
send_ua(rfcomm, tmp_dlci);
bt_disconnect_ind(CREATE_RFCOMM_ID(rfcomm->line, 0));
+ bt_unregister_rfcomm(rfcomm->line);
+
} else {
rfcomm->dlci[tmp_dlci].state =3D DISCONNECTED;
send_ua(rfcomm, tmp_dlci);
|
|
From: Mattias A. <mat...@us...> - 2001-04-12 15:14:50
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- btcommon.h 1.69 1.70=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * added dummy for usermode timers The diff of the modified file(s): --- btcommon.h 2001/04/11 20:23:57 1.69 +++ btcommon.h 2001/04/12 15:14:50 1.70 @@ -300,7 +300,9 @@ struct timer_list rtx; struct timer_list ertx; #else - /* fixme */ + /* dummy */ + int rtx; + int ertx; #endif u16 rtx_no; /* nbr retries */ u16 rtx_action; /* preferred action when rtx expires */=09 |
|
From: Mattias A. <mat...@us...> - 2001-04-12 15:14:06
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
btdebug.c 1.18 1.19=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* added bd2str which converts a bd addr into a string
=20=20
The diff of the modified file(s):
--- btdebug.c 2001/03/30 10:28:20 1.18
+++ btdebug.c 2001/04/12 15:14:06 1.19
@@ -126,8 +126,16 @@
}
printf("\n");
}
-
#endif
=20
+const char* bd2str(const unsigned char *bd)
+{
+ static char buf[20];
+
+ sprintf(buf, "%02X:%02X:%02X:%02X:%02X:%02X",
+ bd[0], bd[1], bd[2], bd[3], bd[4], bd[5]);
+
+ return buf;
+}
=20
/****************** END OF FILE debug.c **********************************=
***/
|
|
From: Mattias A. <mat...@us...> - 2001-04-12 15:13:02
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.136 1.137=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * added 1 s sleep in hci_emulator when connecting/disconnecting baseband * fixed usermode stack declarations of "wait queues" The diff of the modified file(s): --- hci.c 2001/04/10 12:27:10 1.136 +++ hci.c 2001/04/12 15:13:01 1.137 @@ -304,7 +304,6 @@ static u32 hci_cmd_pending =3D 0; static u32 hci_inq_pending =3D 0; =20 -#if __KERNEL__ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) struct wait_queue *hci_wq =3D NULL; struct wait_queue *inq_wq =3D NULL; @@ -316,7 +315,6 @@ wait_queue_head_t set_baudrate_wq; wait_queue_head_t test_wq; #endif /* LINUX_VERSION_CODE */ -#endif /* __KERNEL__ */ =20 static s32 test_wq_active =3D 0; =20 @@ -3156,6 +3154,7 @@ D_CMD(__FUNCTION__", ACCEPT_CONNECTION->connection complete\n"); o_len =3D set_con_cpl_event(out_event, 0, cmd->data, HCI_HDL, ACL_CON); + sleep(1); bt_write_lower_driver(o_event, o_len); =20=20=20=20=20=20=20 lp_connect_cfm(data + 4, 0, 0); @@ -3165,6 +3164,7 @@ D_CMD(__FUNCTION__", REJECT_CONNECTION->connection complete\n"); o_len =3D set_con_cpl_event(out_event, cmd->data[6], cmd->data, HCI_HDL, ACL_CON); + sleep(1); bt_write_lower_driver(o_event, o_len); lp_connect_cfm(data + 4, 0xd, 0); break; |
|
From: Mattias A. <mat...@us...> - 2001-04-12 15:10:49
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- l2cap_con.c 1.5 1.6=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * added init of conf_req_sent and timer.rtx_no The diff of the modified file(s): --- l2cap_con.c 2001/03/30 12:01:33 1.5 +++ l2cap_con.c 2001/04/12 15:10:49 1.6 @@ -182,6 +182,7 @@ con->current_state =3D CLOSED; con->conf_req_ready =3D TRUE; /* haven't started anything yet */ con->conf_rsp_ready =3D TRUE; /* haven't started anything yet */ + con->conf_req_sent =3D 0; /* haven't sent anything yet */ con->initiator =3D FALSE; /* Other side initiated (default) */=20 con->magic =3D L2CAP_CON_MAGIC; con->upper_con =3D NULL; @@ -192,6 +193,7 @@ con->timer.ertx_action =3D ERTX_ACTION_DISCONNECT; con->timer.rtx_inuse =3D 0; con->timer.ertx_inuse =3D 0; + con->timer.rtx_no =3D 0; =20 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) con->wq =3D NULL; |
|
From: Mattias A. <mat...@us...> - 2001-04-12 15:10:02
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
l2cap.c 1.98 1.99=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* fixed return code when waking up wait queue (SIG_CONRSP)
* added conf_req_sent
* fixed auto shutdown of l2cap cons (currently not used)
* added l2ca_wait after l2cap_connect_req when baseband exists
* fixed bug when calculating new timer interval
* fixed usermode problems with timer
* cleanup & minor changes
The diff of the modified file(s):
--- l2cap.c 2001/04/11 11:16:30 1.98
+++ l2cap.c 2001/04/12 15:10:01 1.99
@@ -223,23 +223,23 @@
#define RTX_TIMEOUT 2 /* sec */
#define ERTX_TIMEOUT 60 /* sec */
=20
+
#ifdef __KERNEL__
-void start_rtx(l2cap_con *con, unsigned short timeout, unsigned short acti=
on);
-void disable_rtx(l2cap_con *con);
-void start_ertx(l2cap_con *con, unsigned short timeout);
-void disable_ertx(l2cap_con *con);
void l2cap_rtx_timeout(unsigned long ptr);
void l2cap_ertx_timeout(unsigned long ptr);
-
#else /* usermode stack */
-
l2cap_con *timeout_con =3D NULL;
s32 timer_cancelled =3D 0;
-void start_rtx(l2cap_con *con, s32 timeout, u16 action);
-void disable_rtx(l2cap_con *con);
void l2cap_rtx_timeout(void);
+void l2cap_ertx_timeout(unsigned long ptr);
#endif
=20
+void start_rtx(l2cap_con *con, unsigned short timeout, unsigned short acti=
on);
+void disable_rtx(l2cap_con *con);
+
+void start_ertx(l2cap_con *con, unsigned short timeout);
+void disable_ertx(l2cap_con *con);
+
#endif
=20
/****************** GLOBAL VARIABLE DECLARATION SECTION ******************=
***/
@@ -342,8 +342,6 @@
s32=20
l2cap_shutdown(void)
{
- //l2cap_con *con =3D get_first_con();
-=20=20
DSYS("Shutting down L2CAP\n");
if (!l2cap->initiated)
{
@@ -351,21 +349,25 @@
return -1;
}
=20=09
+/* experimental */
#if 0
- /* Notify upper users, don't have time for real disconnect... */
+ {=20=20
+ l2cap_con *con;
+ con =3D get_first_con();
while (con!=3D NULL) {
- l2ca_disconnect_ind(con);
- con =3D get_next_con(con);
+ if (l2ca_disconnect_req(con) !=3D 0)
+ break;
+ con =3D get_first_con();
}
+ }
#endif
- /* necessary ? */
+
free_list();
remove_all_upper();
=20
#ifdef __CRIS__
bt_connections =3D 0;
#endif
-
/*ALWAYS SUCCESS*/
return 0;
}
@@ -1003,7 +1005,9 @@
=20
switch (conrsp->result) {
case RES_SUCCESS:
- l2ca_wakeup("l2cap_connect_rsp", con);
+
+ con->c_result =3D RES_SUCCESS;
+ l2ca_wakeup("l2cap connect rsp", con);
ENTERSTATE(con, CONFIG);
PRINTSTATE(con);
l2ca_connect_cfm(con, conrsp->result);
@@ -1106,7 +1110,11 @@
/* notify upper layers that we successfully
opened a connection ! */
l2ca_config_cfm(con, confrsp->result);
- } return;
+
+ /* reset */
+ con->conf_req_sent =3D 0;
+ return;
+ }
=20=09=09=09
case CONF_FAILURE:
=20
@@ -1330,8 +1338,9 @@
l2cap_con *con;
D_STATE("lp_connect_cfm: %s (hci_handle : %d)\n",=20
get_err_msg(status), con_hdl);
- print_data("lp_connect_cfm BD", bd_addr, 6);
=20
+ D_STATE("lp_connect_cfm : bd %s\n", bd2str(bd_addr));
+
/* FIXME -- use bt session list to notify upper layers that=20
con failed !!! */
=20
@@ -1349,7 +1358,7 @@
con->link_up =3D TRUE;
=20
/* see if there is someone to wakeup */
- l2ca_wakeup("lp_connect_cfm", con);
+ l2ca_wakeup("lp_connect_cfm (pos)", con);
=20=09=09
if (con->c_flags & FLAG_RETURNNOW)
{
@@ -1496,7 +1505,7 @@
s32 i;
u8 rev_bd[6];
=20
- D_RCV("l2cap_connect_req\n");
+ D_RCV("l2ca_connect_req\n");
PRINTPKT("l2ca_connect_req : sent to bd ",bd, 6);
=20
/* Check bd_addr */
@@ -1562,6 +1571,9 @@
=20
l2cap_connect_req(con, psm);
=20
+ l2ca_wait("l2cap_connect_req : wait rsp", con);
+
+ /* fixme -- use con->c_status */
return 0;
} else {
D_STATE("l2ca_connect_req : create new baseband link\n");
@@ -1588,12 +1600,8 @@
=20
/* wait until we received a response or after timeout */
=20
-#ifdef BTD_USERSTACK
- printk("Sleeping 2 sec\n");=09
- sleep(2);
-#else
l2ca_wait("l2cap_connect_req : wait rsp", con);
-#endif
+
}
=20
return con->c_result;
@@ -1616,7 +1624,7 @@
=20
if (con->current_state =3D=3D CONFIG) {=20=20
/* local mtu is set in l2cap_config_req */
-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
+ con->conf_req_sent =3D 1;
return l2cap_config_req(con, in_mtu, outflow,=20
flush_timeout, link_to);=20=20
=20
@@ -1668,6 +1676,7 @@
PRINTSTATE(con);
} else {
D_ERR("l2ca_disconnect_req : Invalid state !\n");
+ PRINTSTATE(con);
return -1;=20=20=20=20
}
=20=09
@@ -1755,6 +1764,9 @@
con->local_cid, con->remote_cid,=20
psm2str(con->psm));
=20=09=09=09
+ /* reset */
+ con->conf_req_sent =3D 0;
+
/* notify upper layers that we are opened */
l2ca_config_cfm(con, RES_SUCCESS);
=20
@@ -1991,6 +2003,7 @@
=20=20=20
cmd->code =3D SIG_CONREQ;
cmd->id =3D set_id(con); /* Sets sig_id_sent in l2cap_con */
+
cmd->len =3D cpu_to_le16(CON_REQSIZE);
=20
SET_L2CAP_HDR(l2cap_buf->frame, payload_len, CIDSIG);
@@ -2602,6 +2615,7 @@
=20=09
if (PARANOIA_CHECKCON(con)) {
D_ERR("%s l.%d NULL/magic failed\n", __FILE__, __LINE__);
+ tx->flushed =3D 1; /* flush this buffer */
return -1;
}
=20
@@ -2913,15 +2927,15 @@
=20
#ifdef CONFIG_BLUETOOTH_L2CAP_USE_TIMERS
=20
-#ifdef __KERNEL__
-
/* Action is used when the sending function doesn't want
to handle the action it self */
void
start_rtx(l2cap_con *con, unsigned short timeout, u16 action)
{
/* multiply by 2 each rtx */
- timeout *=3D (2<<(con->timer.rtx_no));
+
+ if (con->timer.rtx_no > 0)
+ timeout =3D timeout*(2<<(con->timer.rtx_no - 1));
=20
/* FIXME -- use flush timeout to calculate number of
retransmissions */
@@ -2935,6 +2949,7 @@
return;
}
=20=09
+#ifdef __KERNEL__=09
init_timer(&con->timer.rtx);
con->timer.rtx.function =3D l2cap_rtx_timeout;
con->timer.rtx.data =3D (unsigned long)con;
@@ -2942,20 +2957,13 @@
con->timer.rtx_inuse =3D 1;
con->timer.rtx_action =3D action;
add_timer(&con->timer.rtx);=20=20
-}
=20
-
-#else /* USERSTACK */
+#else /* Usermode stack */
=20
-/* FIXME -- Currently usermode stack and signal() doesn't work=20
- since we are using threads */
-void=20
-start_rtx(l2cap_con *con, s32 timeout)
-{
-#if 1
- printk("use NO timer...\n");
+ /* FIXME */
+ printk("Use NO timer in usermode stack yet...\n");
return;
-#else
+#if 0
struct itimerval t =3D {{0,0},{timeout, 0}};
=20
D_TIM("Starting RTX timer (%d sec)\n", timeout);
@@ -2972,9 +2980,10 @@
=20
timer_cancelled =3D 0;
#endif
-}
+
#endif /* __KERNEL__ */
=20
+}
=20
void
disable_rtx(l2cap_con *con)
@@ -2984,6 +2993,8 @@
if (con->timer.rtx_inuse) {
del_timer(&con->timer.rtx);
con->timer.rtx_inuse =3D 0;
+ con->timer.rtx_no =3D 0;
+ con->timer.rtx_action =3D RTX_ACTION_DISCONNECT;
}
else
D_TIM("RTX never started\n");
@@ -3005,12 +3016,17 @@
return;
}
=20
+#ifdef __KERNEL__
init_timer(&con->timer.ertx);
con->timer.ertx.function =3D l2cap_ertx_timeout;
con->timer.ertx.data =3D (unsigned long)con;
con->timer.ertx.expires =3D jiffies + timeout*HZ;
con->timer.ertx_inuse =3D 1;
add_timer(&con->timer.ertx);
+#else
+ /* fixme */
+ con->timer.ertx_inuse =3D 1;
+#endif
}
=20
void
@@ -3018,15 +3034,18 @@
{
D_TIM("Disabling ERTX timer\n");
#ifdef __KERNEL__
- if (con->timer.rtx_inuse){
+ if (con->timer.ertx_inuse){
del_timer(&con->timer.ertx);
- con->timer.rtx_inuse =3D 0;
+ con->timer.ertx_inuse =3D 0;
+ con->timer.ertx_action =3D ERTX_ACTION_DISCONNECT;
}
else
D_TIM("ERTX never started\n");
-#else
+#else /* Usermode stack */
/* FIXME */
printk("disable_ertx FIXME\n");
+ con->timer.ertx_inuse =3D 0;
+ con->timer.ertx_action =3D ERTX_ACTION_DISCONNECT;
#endif
}
#endif /* CONFIG_BLUETOOTH_L2CAP_USE_TIMERS */
@@ -3070,13 +3089,6 @@
con->remote_mtu =3D *(opt->option_data) |=20
(*(opt->option_data + 1) << 8);
=20
- if ((con->remote_mtu < MTU_MIN) &&=20
- ((con->remote_mtu + L2CAP_HDRSIZE) > HCI_IN_SIZE)) {
- D_WARN("Remote side tries to use nonvalid MTU [%d]\n",
- con->remote_mtu);
- return CONF_FAILURE;
- }
-=09=09=09=20=20=20=20
D_RCV("Setting remote mtu (%d:%d) to %d bytes\n",
con->local_cid, con->remote_cid,=20
con->remote_mtu);
@@ -3189,14 +3201,13 @@
return;
} else {
printk(" flow:\n");
- printk(" flags:%d service:%d token_rate:%d\n",
- f->flags, f->service, (int) f->token_rate);
+ printk(" flags:%d service: 0x%x token_rate: 0x%d\n",
+ f->flags, f->service, (unsigned int) f->token_rate);
printk(" bucket_size:%d bytes peak:%d bps latency:%d ms delay:%d ms\n",
- (int)f->bucket_size, (int)f->peak, (int)f->latency,=20
- (int)f->delay);
+ (unsigned int)f->bucket_size, (unsigned int)f->peak,=20
+ (unsigned int)f->latency, (unsigned int)f->delay);
}
}
-
/* Returns a free cid in range 0x0040 - 0xffff */
/* FIXME - search from MIN_CID every time ? */
u16 get_cid(void)
|
|
From: Mattias A. <mat...@us...> - 2001-04-12 12:25:31
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
rfcomm.c 1.98 1.99=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* fixed credit based flow control when received piggybacked credits in=20
uih frame (thanks to David Libault)
* reset rfcomm session and unregister rfcomm even if disconnect fails=20
* fixed setting of control ch state before waking up disc wait queue
* fixed termination of rfcomm when baseband timed out
* fixed race in rfcomm_disconnect_ind, sometimes bt_hangupline flushed=20
outbuffer (containing l2ca_disconnect_rsp) before the scheduled data=20=
=20
was sent.=20
* added more debug
* cleanup & minor changes
The diff of the modified file(s):
--- rfcomm.c 2001/04/10 12:27:10 1.98
+++ rfcomm.c 2001/04/12 12:25:29 1.99
@@ -92,9 +92,9 @@
#endif
=20
#if PRINT_DATA_ENABLE
-#define PRINTPKT(str, data, len) print_data(str, data, len)
+#define RF_DATA(str, data, len) print_data(str, data, len)
#else
-#define PRINTPKT(str, data, len)
+#define RF_DATA(str, data, len)
#endif
=20
=20
@@ -554,6 +554,8 @@
static wait_queue_head_t rfcomm_disconnect_wq;
#endif /* LINUX_VERSION_CODE */
=20
+#else
+static int rfcomm_disconnect_wq;
#endif /* __KERNEL__ */
=20
void send_send_data(unsigned long ptr);
@@ -785,16 +787,33 @@
start_wq_timer(&rfcomm_timer, RFCOMM_CON_TIMEOUT,
&rfcomm_disconnect_wq);
=20
+#endif
/* FIXME -- check that we haven't already received=20
disconnect 'acknowledge' */
+
interruptible_sleep_on(&rfcomm_disconnect_wq);
=20
+ /* Check that rfcomm session really disconnected */
+ /* FIXME -- add timer obj with status in rfcomm obj */
+
+ /* check control channel */
+ if (rfcomm->dlci[0].state !=3D DISCONNECTED)
+ {
+ printk("Rfcomm disconnect failed, reset session\n");
+#ifdef __KERNEL__
+ bt_unregister_rfcomm(rfcomm->line);
+ bt_disconnect_cfm(CREATE_RFCOMM_ID(rfcomm->line, 0),=20
+ rfcomm->l2cap->c_result);
+#endif
+ rfcomm_reset_con(rfcomm->line);
+ }
+
/* Now rfcomm is disconnected, disconnect l2cap */
=20
l2ca_disconnect_req(rfcomm->l2cap);
=20
/* Now l2cap ch for RFCOMM is disconnected */
-#endif
+
}
else
D_WARN("rfcomm_disconnect_req : line not connected !\n");
@@ -967,7 +986,8 @@
{
=20=09=09=09
s32 j;
- DSYS(FNC"Setting RFCOMM frame size to %d\n", l2cap->remote_mtu-5);
+ DSYS(FNC"Setting RFCOMM frame size to %d\n",=20
+ l2cap->remote_mtu-5);
=20=09=09=09
for (j =3D 0; j < 62; j++) {
rfcomm->dlci[j].mtu =3D (l2cap->remote_mtu-5);
@@ -980,35 +1000,36 @@
=20
/* The lower protocol layer, L2CAP, indicates that the lower layer=20
connection is about to disconnect */
-
void=20
rfcomm_disconnect_ind(l2cap_con *l2cap)
{
-#define FNC "rfcomm_disconnect_ind: "
rfcomm_con *rfcomm;
=20
- D_CTRL(FNC"remote cid %d\n", l2cap->remote_cid);
+ D_CTRL(__FUNCTION__" remote cid %d\n", l2cap->remote_cid);
=20
rfcomm =3D ((rfcomm_con*) l2cap->upper_con);
=20
+ /* This l2cap connection is going down, remove all rfcomm cons=20
+ and notify upper tty */
=20
- /* FIXME -- disconnect all rfcomm cons on this l2cap con=20
- if any */
+ if (!l2cap->link_up)
+ {
+ DSYS("Baseband is down, reset this RFCOMM session\n");
+#ifdef __KERNEL__
+ bt_unregister_rfcomm(rfcomm->line);
+#endif
+ bt_disconnect_ind(CREATE_RFCOMM_ID(rfcomm->line, 0));
+ rfcomm_reset_con(rfcomm->line);
+ }
=20
+ /* always try to send back rsp (if link is down con is deleted) */
if (l2ca_disconnect_rsp(l2cap)) {
- D_ERR(FNC"l2ca_disconnect_rsp failed\n");
+ D_ERR(__FUNCTION__" l2ca_disconnect_rsp failed\n");
return;
}
-
-#ifdef __KERNEL__
- /* notify upper tty that this rfcomm connection is down */
- bt_hangupline(rfcomm->line);
-#else
- bt_disconnect_ind(CREATE_RFCOMM_ID(rfcomm->line, 0));
-#endif
-#undef FNC
}
=20
+
void=20
rfcomm_disconnect_cfm(l2cap_con *l2cap)
{
@@ -1023,6 +1044,8 @@
/* fixme -- should we indicate to bt interface when rfcomm is=20
down or when l2cap for rfcomm is down ? */
bt_disconnect_ind(CREATE_RFCOMM_ID(rfcomm->line, 0));
+
+ /* fixme -- add these glue layer functions in userstack */
#ifdef __KERNEL__
bt_unregister_rfcomm(rfcomm->line);
=20
@@ -1030,7 +1053,6 @@
bt_disconnect_cfm(CREATE_RFCOMM_ID(rfcomm->line, 0),=20
l2cap->c_result);
#endif
-=09
rfcomm_reset_con(rfcomm->line);
=20=09
#undef FNC
@@ -1051,7 +1073,7 @@
u32 uih_len;
u8 tmp_dlci;
=20
- PRINTPKT("rfcomm_receive_data:",data,len);
+ RF_DATA("rfcomm_receive_data:",data,len);
=20=09
D_REC(FNC"%d bytes, our cid is %d\n",len,=20
l2cap->remote_cid);
@@ -1172,14 +1194,13 @@
if (tmp_dlci =3D=3D 0) {
#ifdef __KERNEL__=09=09=09
release_wq_timer(&rfcomm_timer);
+#endif
+ printk("RFCOMM disconnected ctrl ch (local)\n");
+ rfcomm->dlci[0].state =3D DISCONNECTED;
+=09=09=09=09
/* this will take down l2cap aswell */
wake_up_interruptible(&rfcomm_disconnect_wq);
=20
-#else
- /* usermode stack */
- l2ca_disconnect_req(rfcomm->l2cap);
-#endif
-=20=20=20=20=20=20=20=20
} else {
s32 tmp;
rfcomm->dlci[tmp_dlci].state =3D DISCONNECTED;
@@ -1215,7 +1236,7 @@
rfcomm->dlci[0].state =3D DISCONNECTED;
/* FIXME:
Tell the tty that the link is down */
- printk("RFCOMM control ch disconnected\n");
+ printk("RFCOMM control ch disconnected (remotely)\n");
send_ua(rfcomm, tmp_dlci);
} else {
rfcomm->dlci[tmp_dlci].state =3D DISCONNECTED;
@@ -1258,14 +1279,15 @@
}
=20
if (GET_PF(short_pkt->h.control)) {
- printk(FNC" %d more credits on dlci:%d...\n",=20
+ D_REC(FNC" %d more credits on dlci:%d...\n",=20
*uih_data_start, tmp_dlci);
- if (crc_check(data, SHORT_CRC_CHECK,=20
- uih_data_start[1])) {
- break;
- }
- rfcomm->dlci[tmp_dlci].local_credits +=3D uih_data_start[0];
- break;
+
+ rfcomm->dlci[tmp_dlci].local_credits +=3D=20
+ uih_data_start[0];
+ uih_data_start++;
+
+ /* feed uih data to tty if any */
+
}
=20
if (crc_check(data, SHORT_CRC_CHECK,
@@ -1283,8 +1305,14 @@
if (rfcomm->credit_flow) {
rfcomm->dlci[tmp_dlci].remote_credits -=3D 1;
if (rfcomm->dlci[tmp_dlci].remote_credits <=3D 1) {
- rfcomm_send_credits(rfcomm, tmp_dlci, NBROFCREDITS -1);
- rfcomm->dlci[tmp_dlci].remote_credits +=3D NBROFCREDITS - 1;=20
+ /* FIXME -- possible race ? */
+=09=09=09=09=09
+ /* FIXME -- send credits piggybacked */
+
+ rfcomm_send_credits(rfcomm, tmp_dlci,=20
+ NBROFCREDITS -1);
+ rfcomm->dlci[tmp_dlci].remote_credits+=3D
+ NBROFCREDITS - 1;=20
}
}=09=09=09
bt_receive_top(con_id, uih_data_start, uih_len);
@@ -1318,10 +1346,11 @@
=20=09
if (dlci =3D=3D 0) {
D_ERR(FNC" Not allowed to send data on DLCI 0\n");
+ return -1;
}
=20=09
rfcomm =3D &rfcomm_con_list[line];
- PRINTPKT(FNC, data, count);
+ RF_DATA(FNC, data, count);
=20
if (rfcomm =3D=3D NULL) {
D_ERR(FNC" ERROR rfcomm_con =3D=3D NULL\n");
@@ -1331,11 +1360,11 @@
return -1;
} else if(rfcomm->dlci[0].state =3D=3D FLOW_STOPPED) {
DSYS(FNC"Flow stopped on all channels, returning zero\n");
- /* FIXME: We need to buffer the incomming data here... */
+ /* FIXME: We need to buffer the incoming data here... */
return 0;
} else if (rfcomm->dlci[dlci].state =3D=3D FLOW_STOPPED) {
DSYS(FNC"Flow stopped, returning zero\n");
- /* FIXME: We need to buffer the incomming data here... */
+ /* FIXME: We need to buffer the incoming data here... */
return 0;
}
/* Check whether there are any data channels connected */
@@ -1419,6 +1448,8 @@
#define FNC "process_mcc: "
mcc_short_frame *mcc_short_pkt;
=20=20=20=20=20
+ D_CTRL("process_mcc\n");
+
if (longpkt) {
mcc_short_pkt =3D (mcc_short_frame*)(((long_frame*)data)->data);
} else {
@@ -1480,7 +1511,7 @@
rfcomm->dlci[dlci].state =3D FLOW_STOPPED;
} else {
rfcomm->dlci[dlci].state =3D CONNECTED;
- D_CTRL(FNC"Flow on on dlci %d\n", dlci);
+ D_CTRL(FNC"Flow ON, dlci %d\n", dlci);
}
=20
rfcomm_msc_msg(rfcomm, v24_sigs, MCC_RSP, dlci);
@@ -1520,10 +1551,9 @@
memset(&rpn_val.pm, 0, 2);
}
}
-=20=20=20=20
-=09=09
break;
}
+
case RLS: /*Remote line status*/
{
u8 tmp_dlci;
@@ -1866,6 +1896,8 @@
short_frame *uih_pkt;
u32 rfcomm_frame_size;
=20=20=20
+ D_CTRL(__FUNCTION__" give %d credits to dlci %d\n", credits, dlci);
+
rfcomm_frame_size =3D (sizeof(short_frame) + 1 + FCS_SIZE);
tx_buf =3D subscribe_bt_buf(sizeof(rfcomm_tx_buf) + rfcomm_frame_size);
=20
@@ -2298,7 +2330,6 @@
return l2cap_send_data(tx_buf, rfcomm->l2cap);
}
=20
-
void
set_uih_hdr(short_frame *uih_pkt, u8 dlci, u32 len, u8 cr)
{
@@ -2327,7 +2358,7 @@
&& (rfcomm_con_list[i].dlci[0].state !=3D DISCONNECTED)) {
i++;
}
- D_CTRL("get_new_rfcomm_con: rfcomm_con -> tty%d\n",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 {
@@ -2378,7 +2409,7 @@
{
u8 fcs =3D 0xff;
=20
- PRINTPKT("crc_check:",data,length);
+ RF_DATA("crc_check:",data,length);
while (length--) {
fcs =3D crctable[fcs^*data++];
}
|
|
From: Mattias A. <mat...@us...> - 2001-04-12 12:06:54
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
bluetooth.c 1.160 1.161=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
do hangup in bt_unregister_rfcomm
The diff of the modified file(s):
--- bluetooth.c 2001/04/01 15:50:12 1.160
+++ bluetooth.c 2001/04/12 12:06:53 1.161
@@ -2448,6 +2448,11 @@
D_WARN("bt_unregister_rfcomm : inactive session\n");
return -1;
}
+
+ /* notify upper tty that this rfcomm connection is down */
+#ifdef __KERNEL__
+ bt_hangupline(line);
+#endif
return 0;
}
=20
|
|
From: Mattias A. <mat...@us...> - 2001-04-11 20:23:57
|
The following file was modified in linux/include/linux/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
btcommon.h 1.68 1.69=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
fixed blocking calls in usermode stack
added conf_req_sent in l2cap_con struct
The diff of the modified file(s):
--- btcommon.h 2001/04/10 12:26:41 1.68
+++ btcommon.h 2001/04/11 20:23:57 1.69
@@ -68,6 +68,7 @@
/* KERNEL_VERSION() is not defined in all 2.0.x versions of the linux kern=
el.
Define it here so we can use it in the code without having to check whe=
ther
it is defined or not */
+
#ifndef KERNEL_VERSION
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
#endif
@@ -75,8 +76,8 @@
#ifndef __KERNEL__
#define kmalloc(size,prio) malloc((size))
#define kfree(obj) free((obj))
-#define wake_up_interruptible(p)
-#define interruptible_sleep_on(p) sleep(1)
+#define wake_up_interruptible(p) do {*(p) =3D 0;} while (0)
+#define interruptible_sleep_on(p) do {(int)*(p)=3D1; while (*(p)){ usleep(=
10000);}; } while (0)
#define cli()
#define sti()
#endif
@@ -339,6 +340,7 @@
u8 sig_id_sent; /* last sent command id */
u8 sig_id_rcv; /* last received command id*/
=20=09
+ s32 conf_req_sent;
s32 conf_req_ready; /* indicates if we received pos rsp on our req */
s32 conf_rsp_ready; /* indicates if we replied pos on a config req */
=20
|
|
From: Peter K. <pk...@us...> - 2001-04-11 12:54:53
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_ipa.c 1.2 1.3=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
open_socket() returns negative value on error.
The diff of the modified file(s):
--- bt_ipa.c 2001/03/21 18:35:20 1.2
+++ bt_ipa.c 2001/04/11 12:54:52 1.3
@@ -64,8 +64,8 @@
{
int ipa_fd;
=20=20=20
- syslog(LOG_INFO, "Opening socket to IP Assigner\n");=20=20
- if (!(ipa_fd =3D open_socket(IPASERVER, CLIENT)))
+ syslog(LOG_INFO, "Opening socket to IP Assigner");
+ if ((ipa_fd =3D open_socket(IPASERVER, CLIENT)) < 0)
{=20=20
perror("open_socket");
return -1;
@@ -75,14 +75,14 @@
=20
void ipa_close(int ipa_fd)
{
- syslog(LOG_INFO, "Closing socket to IP Assigner\n");=20=20
+ syslog(LOG_INFO, "Closing socket to IP Assigner");=20=20
close(ipa_fd);
}
=20
/* Sends msg to IPA socket */
int ipa_write(int ipa_fd, ipa_msg *msg)
{
- syslog(LOG_INFO, "ipa_send : sending ipa request (type : %d) len %d \n",
+ syslog(LOG_INFO, "ipa_send: sending ipa request (type: %d) len %d",
msg->type, msg->len);
=20=20=20
return write(ipa_fd, msg, msg->len + sizeof(struct ipa_msg));
@@ -129,30 +129,29 @@
=20
void show_ipset(struct ip_set* set, int line)
{
- syslog(LOG_INFO, "IP set [line:%d]\n", line);
+ syslog(LOG_INFO, "IP set [line:%d]", line);
=20
if (set)
{=20=20=20=20
- syslog(LOG_INFO, " ip : %s\n", inet_ntoa(set->ip));
+ syslog(LOG_INFO, " ip: %s", inet_ntoa(set->ip));
+ syslog(LOG_INFO, " netmask: %s", inet_ntoa(set->netmask));
=20
if (set->nbr_of_dns >=3D 1)
- syslog(LOG_INFO, " dns1 : %s\n", inet_ntoa(set->dns[0]));
+ syslog(LOG_INFO, " dns1: %s", inet_ntoa(set->dns[0]));
=20
- if (set->nbr_of_dns =3D=3D 2)
- syslog(LOG_INFO, " dns2 : %s\n", inet_ntoa(set->dns[1]));
+ if (set->nbr_of_dns >=3D 2)
+ syslog(LOG_INFO, " dns2: %s", inet_ntoa(set->dns[1]));
=20
if (set->nbr_of_wins >=3D 1)
- syslog(LOG_INFO, " wins 1 : %s\n", inet_ntoa(set->wins[0]));
+ syslog(LOG_INFO, " wins1: %s", inet_ntoa(set->wins[0]));
=20
- if (set->nbr_of_wins =3D=3D 2)
- syslog(LOG_INFO, " wins2 : %s\n", inet_ntoa(set->wins[1]));
+ if (set->nbr_of_wins >=3D 2)
+ syslog(LOG_INFO, " wins2: %s", inet_ntoa(set->wins[1]));
=20
- syslog(LOG_INFO, " netmask : %s\n", inet_ntoa(set->netmask));
- syslog(LOG_INFO, "useradius : %d\n", set->useradius);
- syslog(LOG_INFO, "useradiusip : %d\n", set->useradiusip);
- syslog(LOG_INFO, "usingmasq : %d\n", set->usingmasq);
+ syslog(LOG_INFO, " useradius: %d", set->useradius);
+ syslog(LOG_INFO, "useradiusip: %d", set->useradiusip);
+ syslog(LOG_INFO, " usingmasq: %d", set->usingmasq);
}
}
=20
#endif /* USE_IPASSIGN */
-
|
|
From: Peter K. <pk...@us...> - 2001-04-11 12:42:30
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_if.c 1.5 1.6=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Corrected indentation.
The diff of the modified file(s):
--- bt_if.c 2001/03/30 12:31:46 1.5
+++ bt_if.c 2001/04/11 12:42:30 1.6
@@ -268,9 +268,9 @@
void bt_showstatus(void)
{
#ifdef BT_USERSTACK
-
char tmp[4096];
int len;
+
len =3D bt_read_internal(tmp);
tmp[len] =3D 0;
printf("%s", tmp);
@@ -280,7 +280,6 @@
#endif=20
}
=20
-
/* fixme<1> -- add usermode stack version */
int
bt_send(int fd, int len, int repeat)
@@ -325,8 +324,7 @@
}
=20=20=20=20=20
repeat--;
- printf("%6d kB left to send... \r",
- ((repeat*len)/1000));
+ printf("%6d kB left to send... \r", ((repeat*len)/1000));
fflush(stdout);
}
gettimeofday(&stop_t, NULL);
@@ -342,7 +340,6 @@
}
=20
=20
-
void
bt_waitline(int bt_fd, int line)
{
@@ -436,14 +433,12 @@
}
else
printf("Success!\n");
-
#else
ret_val =3D l2ca_ping(bd, data, len);
#endif
return ret_val;
}
=20
-
int=20
bt_getinfo(int bt_cfd, unsigned char bd[6], unsigned short type)
{
@@ -467,7 +462,6 @@
return ret_val;
}
=20
-
int bt_testcmd(int bt_cfd, unsigned char *cmd)
{
int ret_val;
@@ -491,6 +485,7 @@
int bt_force_msswitch_as_server(int bt_cfd, int enable)
{
int ret_val;
+
syslog(LOG_INFO, "bt_force_msswitch_as_server : % d\n"), enable;
#ifndef BT_USERSTACK=20
if ((ret_val =3D ioctl(bt_cfd, BTSETMSSWITCH, &enable)) !=3D 0)
@@ -569,6 +564,7 @@
int bt_set_baudrate(int bt_cfd, int spd)
{
int result;
+
syslog(LOG_INFO, "bt_set_baudrate %d baud", spd);
#ifdef BT_USERSTACK
tcflush(phys_fd, TCIOFLUSH);
@@ -595,16 +591,17 @@
#else
int i;
BD_ADDR rev_bd;
+
hci_read_local_bd(rev_bd);
=20
/* return as big endian */
- for (i =3D 0; i < 6; i++) {
+ for (i =3D 0; i < 6; i++)
+ {
bd_addr[i] =3D rev_bd[5-i];
}
#endif
}
=20
-
void
enable_dut(int bt_cfd)
{
@@ -640,7 +637,6 @@
for (i =3D 0; i < 6; i++) {
bd_addr[i] =3D rev_bd[5-i];
}
-
#endif
}
=20
@@ -678,6 +674,7 @@
#else
{
unsigned int tmp [2];=20=20
+
tmp[0] =3D interval;
tmp[1] =3D wind;
=20=20=20=20=20
@@ -741,13 +738,16 @@
hci_write_class_of_device(class_of_device);
#endif
break;
+
case 1:
syslog(LOG_INFO, "bt_set_classofdevice, Unsupported format 0x%02x\n",=
=20
format);
break;
+
case 2:
syslog(LOG_INFO, "bt_set_classofdevice, Unsupported format 0x%02x\n", =
format);
break;
+
default:
syslog(LOG_INFO, "bt_set_classofdevice, Unsupported format 0x%02x\n", =
format);
break;
@@ -1020,7 +1020,7 @@
#define BT_DATA(fmt...) do {print_time(1);printk(BT_DBG_STR"DATA " fmt);} =
while (0)
#else
#define BT_DATA(fmt...) printk(BT_DBG_STR"DATA " fmt)
-#endif
+#endif /* BT_USE_TIMESTAMPS */
=20
#else /* BT_DATA_DEBUG */
#define BT_DATA(fmt...)
@@ -1030,8 +1030,7 @@
int init_read_thread(void)
{
printf("Initiating read thread\n");
- if (pthread_create(&read_thread, NULL,=20
- (void*)hci_receive_thread, NULL)!=3D0)
+ if (pthread_create(&read_thread, NULL, (void*)hci_receive_thread, NULL) =
!=3D 0)
perror("pthread_create");=20=20=20=20
sleep(1); /* wait for thread to start */
return 0;
@@ -1152,7 +1151,6 @@
BT_DATADUMP("|X|-->", data, len);
=20
#if 0 /* fixme */
-
if (modem_emulation && !modem_connected)
{
modem_emulator(0xb055e, data, len);
@@ -1214,10 +1212,8 @@
=20=09
switch (psm) {
case RFCOMM_LAYER:
- {=09
printf("bt_connect_cfm [%s]\n", psmname(psm));
break;
- }
=20=20=20=20=20=20=20=20=20=20=20
case SDP_LAYER:
printf("bt_connect_cfm [%s]\n", psmname(psm));
@@ -1237,8 +1233,7 @@
bt_disconnect_ind(unsigned int con_id)=20
{
if (GET_PSM(con_id) =3D=3D RFCOMM_LAYER)
- printf("bt_disconnect_ind : RFCOMM dlci : %d\n",=20
- GET_RFCOMMDLCI(con_id));
+ printf("bt_disconnect_ind : RFCOMM dlci : %d\n", GET_RFCOMMDLCI(con_id=
));
else
printf("bt_disconnect_ind : psm %d\n", GET_PSM(con_id));
}
@@ -1266,4 +1261,4 @@
{
return bt_initdone;
}
-#endif
+#endif /* BT_USERSTACK */
|
|
From: Peter K. <pk...@us...> - 2001-04-11 12:24:22
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_misc.c 1.5 1.6=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
open_tcpsocket() no longer crashes if there is no colon in
the address string. Instead it terminates the program
(thanks to Salil Gokhale for finding this).
The diff of the modified file(s):
--- bt_misc.c 2001/04/04 10:43:04 1.5
+++ bt_misc.c 2001/04/11 12:24:22 1.6
@@ -119,8 +119,6 @@
client_sockfd =3D accept(server_sockfd,=20
(struct sockaddr *)&(client_address),
&client_len);
-=20=20=20=20
- return client_sockfd;
}
else
{
@@ -139,10 +137,10 @@
return -1;
}
=20
-
syslog(LOG_INFO, "Socket connected to %s\n", server_address.sun_path);
- return client_sockfd;
}
+
+ return client_sockfd;
}
=20
/* TCP socket */
@@ -161,11 +159,16 @@
=20=20=20
/*parse address string */
=20
- pos =3D strchr(addrstr, ':');
+ if (!(pos =3D strchr(addrstr, ':')))
+ {
+ fprintf(stderr, "Port argument missing!\n");
+ exit(1);
+ }
=20
/* copy ip address */
- memcpy(ipstr, addrstr, pos-addrstr);
- ipstr[pos-addrstr]=3D0; /* null term */
+ *pos =3D '\0';
+ strncpy(ipstr, addrstr, sizeof ipstr);
+ ipstr[sizeof ipstr - 1] =3D '\0';
=20
/* extract port number */
port =3D atoi(pos+1);
@@ -199,8 +202,6 @@
client_sockfd =3D accept(server_sockfd,
(struct sockaddr *)&(client_address),
&client_len);
-=20=20=20=20
- return client_sockfd;
}
else
{
@@ -223,9 +224,9 @@
perror("open_tcpsocket");
exit(1);
}
+ }
=20
return client_sockfd;
- }
}
=20
=20
|
|
From: Peter K. <pk...@us...> - 2001-04-11 12:23:46
|
The following file was modified in apps/bluetooth/btd:
Name Old version New version Comment
---- ----------- ----------- -------
btd.c 1.89 1.90=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
open_tcpsocket() no longer crashes if there is no colon in
the address string. Instead it terminates the program
(thanks to Salil Gokhale for finding this).
The diff of the modified file(s):
--- btd.c 2001/03/30 12:49:06 1.89
+++ btd.c 2001/04/11 12:23:45 1.90
@@ -851,7 +851,7 @@
/* check if there is a server available */
if (! use_ipassign)
{
- if ((ipa_sock =3D open_socket(SRVSOCKET, CLIENT)))
+ if ((ipa_sock =3D open_socket(SRVSOCKET, CLIENT)) >=3D 0)
{
syslog(LOG_INFO, "IP Assign server OK.\n");
close_device(ipa_sock);
@@ -2332,8 +2332,7 @@
=20=20=20
if ((n =3D write(pty_master_fd, data, len)) !=3D len)
{
- BT_DATA("bt_receive_top: tried to write %d bytes, wrote %d\n",
- len, n);
+ BT_DATA("bt_receive_top: tried to write %d bytes, wrote %d\n", len, n);
}
=20
bt_stat.bytes_received+=3Dn;
@@ -2360,7 +2359,6 @@
line =3D GET_RFCOMMLINE(con_id);
=20=20=20=20=20=20=20=20=20=20=20
if ((line < 0) || (line > BT_NBR_DATAPORTS)) {
-=20=20=20=20=20=20=20=20=20=20=20=20
printf("bt_connect_cfm on invalid line (%d)\n", line);
return;
}
@@ -2371,10 +2369,8 @@
=20=09
switch (psm) {
case RFCOMM_LAYER:
- {=09
printf("bt_connect_cfm [%s]\n", psmname(psm));
break;
- }
=20=20=20=20=20=20=20=20=20=20=20
case SDP_LAYER:
printf("bt_connect_cfm [%s]\n", psmname(psm));
@@ -2436,11 +2432,16 @@
=20=20=20
/*parse address string */
=20
- pos =3D strchr(addrstr, ':');
+ if (!(pos =3D strchr(addrstr, ':')))
+ {
+ fprintf(stderr, "Port argument missing!\n");
+ exit(1);
+ }
=20
/* copy ip address */
- memcpy(ipstr, addrstr, pos-addrstr);
- ipstr[pos-addrstr]=3D0; /* null term */
+ *pos =3D '\0';
+ strncpy(ipstr, addrstr, sizeof ipstr);
+ ipstr[sizeof ipstr - 1] =3D '\0';
=20
/* extract port number */
port =3D atoi(pos+1);
@@ -2472,9 +2473,6 @@
client_sockfd =3D accept(server_sockfd,
(struct sockaddr *)&(client_address),
&client_len);
-=20=20=20=20
- return client_sockfd;
-
}
else
{
@@ -2497,10 +2495,10 @@
perror("open_tcpsocket");
exit(1);
}
+ }
=20
return client_sockfd;
}
-}
=20
#endif /* BTD_USERSTACK */
=20
@@ -2530,8 +2528,6 @@
client_sockfd =3D accept(server_sockfd,=20
(struct sockaddr *)&(client_address),
&client_len);
-=20=20=20=20
- return client_sockfd;
}
else
{
@@ -2547,13 +2543,13 @@
(struct sockaddr *)&server_address,=20
server_len) < 0) {
syslog(LOG_ERR, "open_socket %s failed", name);
- return 0;
+ return -1;
}
=20
-
syslog(LOG_INFO, "Socket connected to %s\n", server_address.sun_path);
- return client_sockfd;
}
+
+ return client_sockfd;
}
=20
#ifdef USE_IPASSIGN
@@ -2565,7 +2561,7 @@
=20=20=20
syslog(LOG_INFO, "Opening socket to IP Assigner\n");
=20=20=20
- if (!(ipa_sock =3D open_socket(SRVSOCKET, CLIENT)))
+ if ((ipa_sock =3D open_socket(SRVSOCKET, CLIENT)) < 0)
{=20=20
perror("open_socket");
return NULL;
@@ -2748,7 +2744,6 @@
switch (layer)
{
case MSG_LAYER_HCI:
- {
switch(code)
{=20=20=20=20=20=20=20
case 4:=20=20=20=20=20=20=20=20
@@ -2757,11 +2752,9 @@
return "HCI - Unknown reason";
break;
}
- }
break;
=20=20=20=20=20
case MSG_LAYER_L2CAP:
- {
switch(code)
{=20
case RES_PSMNEG:
@@ -2773,7 +2766,6 @@
default:
return "L2CAP - unknown reason";
}
- }
break;
=20=20=20=20=20
default:
@@ -2807,7 +2799,8 @@
/* only connects rfcomm (as client) currently */
if (GET_PSM(con_id) =3D=3D RFCOMM_LAYER)
con.id =3D con_id;
- else{=20=20
+ else
+ {
printf("Only connects rfcomm as client !\n");
return ;
}
@@ -2826,7 +2819,8 @@
srv_ch =3D GET_RFCOMMSRVCH(con_id);
line =3D GET_RFCOMMLINE(con_id);
=20=20
- if (line !=3D 0) {
+ if (line !=3D 0)
+ {
printf("Use line 0 instead ! (usermode only)\n");
return;
}
@@ -2854,7 +2848,8 @@
CHECK_RFCOMM(con_id);
line =3D GET_RFCOMMLINE(con_id);
=20=20=20
- if (line !=3D 0) {
+ if (line !=3D 0)
+ {
printf("Use line 0 instead ! (usermode only)\n");
return;
}
@@ -2982,8 +2977,8 @@
for (i =3D 0; i < 6; i++) {
bd_addr[i] =3D rev_bd[5-i];
}
-
#endif
+
printf("Current 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]);
@@ -3025,8 +3020,8 @@
for (i =3D 0; i < 6; i++) {
bd_addr[i] =3D rev_bd[5-i];
}
-
#endif
+
printf("Client 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]);
@@ -3326,7 +3321,7 @@
=20
/*********************************************************************/
/***************** Ericsson test functions ***************************/
-/******************This will be moved later **************************/
+/***************** This will be moved later **************************/
/*********************************************************************/
=20
#ifdef ECS_TEST_FUNCTIONS
|
|
From: Peter K. <pk...@us...> - 2001-04-11 11:45:32
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- .cvsignore 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Ignore bttest too. The diff of the modified file(s): --- .cvsignore 2001/03/13 19:23:11 1.1 +++ .cvsignore 2001/04/11 11:45:32 1.2 @@ -5,3 +5,4 @@ btcon btsend btdisc +bttest |