|
From: Mats F. <ma...@us...> - 2001-07-06 07:00:08
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
bcsp_sequence.c 1.13 1.14=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Corrected the RTX timeout
* Some minor changes
The diff of the modified file(s):
--- bcsp_sequence.c 2001/06/08 12:46:49 1.13
+++ bcsp_sequence.c 2001/07/06 07:00:07 1.14
@@ -64,6 +64,8 @@
#define WINSIZE 4
#define SEQUENCE_TIMEOUT (HZ/4) /* default 250 ms */
=20
+#define BCSP_RTX_MAX 20
+
/****************** TYPE DEFINITION SECTION ******************************=
***/
=20
typedef struct resend_buf {
@@ -102,6 +104,8 @@
static u8 winspace;
#endif
=20
+static u8 rtx_count =3D BCSP_RTX_MAX;
+
=20
static u32 got_packet =3D FALSE;
=20
@@ -152,7 +156,7 @@
sti();
=20
/* FIXME: Do we need to schedule when winsize > 0 ? */
- if ((winspace > 0) && (buf_count())) {
+ if ((winspace > 0) && buf_count() && (hci_acl_num_cnt() > 0)) {
/* ack is piggybacked in next tx data packet */
D("<-data ack\n");
} else {
@@ -167,7 +171,9 @@
/* ack is piggybacked in next tx data packet */
printk("seq out-of-order [exp:%d, got:%d]\n",=20
expected_rxseq, BCSP_GET_SEQ(bcsp));
+
} else {
+ s32 i;
printk("seq out-of-order [exp:%d, got:%d], send ack\n",
expected_rxseq, BCSP_GET_SEQ(bcsp));
send_ack();
@@ -247,6 +253,7 @@
D(__FUNCTION__" win_up:%d\n", winspace);
=20
rxack =3D new_ack;
+ rtx_count =3D BCSP_RTX_MAX;
=20
sti();
=20=09
@@ -264,16 +271,14 @@
}
}
=20
-#define BCSP_RTX_MAX 20
void
sequence_resend(void)
{
struct bcsp bcsp;
u8 resend_cnt =3D rxack;
- u8 rtx_count =3D BCSP_RTX_MAX;
=20=09
cli();
- while ((resend_cnt !=3D txseq) && (rtx_count--)) {
+ while (rtx_count && (resend_cnt !=3D txseq)) {
sti();
printk(__FUNCTION__" : seq_nbr:%d, last_ack:%d, cur_seq:%d\n\n", resend_=
cnt, rxack, txseq);
=20=09=09
@@ -295,13 +300,14 @@
}=20=20=20=20=20=20=20
sti();
=20=09
- if (rtx_count =3D=3D 0)
- {
+ rtx_count--;
+=09
+ if (rtx_count =3D=3D 0) {
printk("ERROR : giving up on rtx !\n");
/* fixme -- signal link down etc. */
- }
- else
+ } else {
start_resend_timer();
+ }
}
=20
=20
|