From: Marcel Holtmann <marcel@rvs.uni-bielefeld.de>
To: Daryl Van Vorst <daryl@wideray.com>
Cc: BlueZ Mailing List <bluez-devel@lists.sourceforge.net>
Subject: [Bluez-devel] RE: Rfcomm qualification
Date: 30 Jul 2003 23:43:46 +0200 [thread overview]
Message-ID: <1059601432.1832.9.camel@pegasus> (raw)
In-Reply-To: <000501c356b7$2887faf0$1a01010a@baked>
[-- Attachment #1: Type: text/plain, Size: 498 bytes --]
Hi Daryl,
> Will making the default value of credits zero break other things?
I got some time to test this and it brings our RFCOMM code back to the
behavior of 1.0b. The session wide credits value is useless and the dlc
credits value must be zero in the initial place. But we must make sure
that we request 1.1 credit based flow control for outgoing connections.
The attached patch should solve all problems.
Max, please review the patch to make sure I don't forget anything.
Regards
Marcel
[-- Attachment #2: patch --]
[-- Type: text/x-patch, Size: 2002 bytes --]
diff -Nru a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h
--- a/include/net/bluetooth/rfcomm.h Wed Jul 30 23:33:57 2003
+++ b/include/net/bluetooth/rfcomm.h Wed Jul 30 23:33:57 2003
@@ -166,9 +166,7 @@
atomic_t refcnt;
int initiator;
- /* Default DLC parameters */
- uint mtu;
- uint credits;
+ uint mtu;
struct list_head dlcs;
};
diff -Nru a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
--- a/net/bluetooth/rfcomm/core.c Wed Jul 30 23:33:57 2003
+++ b/net/bluetooth/rfcomm/core.c Wed Jul 30 23:33:57 2003
@@ -202,7 +202,7 @@
d->mtu = RFCOMM_DEFAULT_MTU;
d->v24_sig = RFCOMM_V24_RTC | RFCOMM_V24_RTR | RFCOMM_V24_DV;
- d->credits = RFCOMM_MAX_CREDITS;
+ d->credits = 0;
d->rx_credits = RFCOMM_DEFAULT_CREDITS;
}
@@ -310,7 +310,6 @@
rfcomm_dlc_link(s, d);
d->mtu = s->mtu;
- d->credits = s->credits;
if (s->state == BT_CONNECTED)
rfcomm_send_pn(s, 1, d);
@@ -474,9 +473,8 @@
s->state = state;
s->sock = sock;
- s->mtu = RFCOMM_DEFAULT_MTU;
- s->credits = RFCOMM_MAX_CREDITS;
-
+ s->mtu = RFCOMM_DEFAULT_MTU;
+
list_add(&s->list, &session_list);
/* Do not increment module usage count for listeting sessions.
@@ -746,7 +744,7 @@
pn->ack_timer = 0;
pn->max_retrans = 0;
- if (d->credits) {
+ if (cr || d->credits) {
pn->flow_ctrl = cr ? 0xf0 : 0xe0;
pn->credits = RFCOMM_DEFAULT_CREDITS;
} else {
@@ -1140,18 +1138,16 @@
if (cr) {
if (pn->flow_ctrl == 0xf0) {
+ d->credits = RFCOMM_MAX_CREDITS;
d->tx_credits = pn->credits;
- } else {
+ } else
set_bit(RFCOMM_TX_THROTTLED, &d->flags);
- d->credits = 0;
- }
} else {
if (pn->flow_ctrl == 0xe0) {
+ d->credits = RFCOMM_MAX_CREDITS;
d->tx_credits = pn->credits;
- } else {
+ } else
set_bit(RFCOMM_TX_THROTTLED, &d->flags);
- d->credits = 0;
- }
}
d->priority = pn->priority;
next prev parent reply other threads:[~2003-07-30 21:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-29 20:58 Rfcomm qualification Daryl Van Vorst
2003-07-29 23:03 ` [Bluez-devel] " Marcel Holtmann
2003-07-30 16:25 ` Daryl Van Vorst
2003-07-30 17:22 ` [Bluez-devel] " Marcel Holtmann
2003-07-30 21:43 ` Marcel Holtmann [this message]
2003-07-31 0:01 ` Max Krasnyansky
2003-07-31 0:48 ` Marcel Holtmann
2003-08-05 17:10 ` Max Krasnyansky
2003-08-05 22:04 ` Marcel Holtmann
2003-08-11 16:43 ` Daryl Van Vorst
2003-08-11 19:03 ` Marcel Holtmann
2003-08-14 17:39 ` Daryl Van Vorst
2003-08-14 17:48 ` Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1059601432.1832.9.camel@pegasus \
--to=marcel@rvs.uni-bielefeld.de \
--cc=bluez-devel@lists.sourceforge.net \
--cc=daryl@wideray.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.