All of lore.kernel.org
 help / color / mirror / Atom feed
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: Qualification testing - rfcomm
Date: 11 Jul 2003 10:18:29 +0200	[thread overview]
Message-ID: <1057911516.1026.7.camel@pegasus> (raw)
In-Reply-To: <001501c3457d$18b63a10$1a01010a@baked>

[-- Attachment #1: Type: text/plain, Size: 918 bytes --]

Hi Daryl,

> TP/RFC/BV-12-C:
> "Verify that the IUT handles aggregate flow control correctly when the
> Tester, acting as a device conforming to Bleutooth version 1.0B, controls
> the data flow using the Flow Control on/off commands FCon and FCoff. The
> IUT's device role is of no importance."
> 
> The command and console output:
> 
> root@jack-00000000:~>./rctest -s -P 1 -b 20 00:A0:96:1F:83:71
> rctest[362]: Connected
> rctest[362]: Sending ...
> rfcomm_recv_mcc: Unknown control type 0x18
> rfcomm_recv_mcc: Unknown control type 0x28
> 
> The IUT does not respond to FCoff with FCoff, and continues sending data. It
> also does not respond to FCon with FCon. 

we don't have support for flow control on the entire RFCOMM session. But
it seems that the FCOFF and FCON should be supported. The attached patch
implements support for it, but I am not quite sure if it is the right
way to do this.

Regards

Marcel


[-- Attachment #2: patch-fcoff-fcon --]
[-- Type: text/plain, Size: 2114 bytes --]

--- bt-2.4/net/bluetooth/rfcomm/core.c	Thu Jul 10 21:16:52 2003
+++ marcel-2.4/net/bluetooth/rfcomm/core.c	Fri Jul 11 10:04:37 2003
@@ -853,6 +853,50 @@
 	return rfcomm_send_frame(s, buf, ptr - buf);
 }
 
+static int rfcomm_send_fcoff(struct rfcomm_session *s, int cr)
+{
+	struct rfcomm_hdr *hdr;
+	struct rfcomm_mcc *mcc;
+	u8 buf[16], *ptr = buf;
+
+	BT_DBG("%p cr %d", s, cr);
+
+	hdr = (void *) ptr; ptr += sizeof(*hdr);
+	hdr->addr = __addr(s->initiator, 0);
+	hdr->ctrl = __ctrl(RFCOMM_UIH, 0);
+	hdr->len  = __len8(sizeof(*mcc));
+
+	mcc = (void *) ptr; ptr += sizeof(*mcc);
+	mcc->type = __mcc_type(cr, RFCOMM_FCOFF);
+	mcc->len  = __len8(0);
+
+	*ptr = __fcs(buf); ptr++;
+
+	return rfcomm_send_frame(s, buf, ptr - buf);
+}
+
+static int rfcomm_send_fcon(struct rfcomm_session *s, int cr)
+{
+	struct rfcomm_hdr *hdr;
+	struct rfcomm_mcc *mcc;
+	u8 buf[16], *ptr = buf;
+
+	BT_DBG("%p cr %d", s, cr);
+
+	hdr = (void *) ptr; ptr += sizeof(*hdr);
+	hdr->addr = __addr(s->initiator, 0);
+	hdr->ctrl = __ctrl(RFCOMM_UIH, 0);
+	hdr->len  = __len8(sizeof(*mcc));
+
+	mcc = (void *) ptr; ptr += sizeof(*mcc);
+	mcc->type = __mcc_type(cr, RFCOMM_FCON);
+	mcc->len  = __len8(0);
+
+	*ptr = __fcs(buf); ptr++;
+
+	return rfcomm_send_frame(s, buf, ptr - buf);
+}
+
 static int rfcomm_send_test(struct rfcomm_session *s, int cr, u8 *pattern, int len)
 {
 	struct socket *sock = s->sock;
@@ -1351,6 +1395,20 @@
 		rfcomm_recv_msc(s, cr, skb);
 		break;
 
+	case RFCOMM_FCOFF:
+		if (cr) {
+			set_bit(RFCOMM_TX_THROTTLED, &s->flags);
+			rfcomm_send_fcoff(s, 0);
+		}
+		break;
+
+	case RFCOMM_FCON:
+		if (cr) {
+			clear_bit(RFCOMM_TX_THROTTLED, &s->flags);
+			rfcomm_send_fcon(s, 0);
+		}
+		break;
+
 	case RFCOMM_TEST:
 		if (cr)
 			rfcomm_send_test(s, 0, skb->data, skb->len);
@@ -1533,6 +1591,9 @@
 	struct list_head *p, *n;
 
 	BT_DBG("session %p state %ld", s, s->state);
+
+	if (test_bit(RFCOMM_TX_THROTTLED, &s->flags))
+		return;
 
 	list_for_each_safe(p, n, &s->dlcs) {
 		d = list_entry(p, struct rfcomm_dlc, list);

  parent reply	other threads:[~2003-07-11  8:18 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-08 18:16 Qualification testing - rfcomm Daryl Van Vorst
2003-07-08 21:47 ` [Bluez-devel] " James Courtier-Dutton
2003-07-08 23:23   ` Daryl Van Vorst
2003-07-18 19:35     ` James Courtier-Dutton
2003-07-11  8:18 ` Marcel Holtmann [this message]
2003-07-22 16:23   ` [Bluez-devel] " Max Krasnyansky
2003-07-22 16:46     ` Marcel Holtmann
2003-07-22 17:40       ` Max Krasnyansky
2003-07-22 19:13         ` Marcel Holtmann
2003-07-22 16:48     ` Daryl Van Vorst
2003-07-22 16:53       ` Marcel Holtmann
2003-07-22 17:01         ` Daryl Van Vorst
2003-07-11  8:55 ` Marcel Holtmann
2003-07-11 16:43   ` Daryl Van Vorst
2003-07-11 19:05     ` [Bluez-devel] " Daryl Van Vorst
2003-07-18 18:53       ` Daryl Van Vorst
2003-07-18 18:58         ` Marcel Holtmann
2003-07-18 19:07           ` Daryl Van Vorst
2003-07-18 19:12             ` Marcel Holtmann
2003-07-18 19:19               ` Daryl Van Vorst
2003-07-22 17:09                 ` Max Krasnyansky
2003-07-22 18:13                   ` David Woodhouse
2003-07-22 19:43                     ` Max Krasnyansky
2003-07-22 16:26     ` Max Krasnyansky
2003-07-18 19:30 ` [Bluez-devel] " James Courtier-Dutton
2003-07-18 20:25   ` Daryl Van Vorst

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=1057911516.1026.7.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.