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: "'Max Krasnyansky'" <maxk@qualcomm.com>,
	"'BlueZ Mailing List'" <bluez-devel@lists.sourceforge.net>
Subject: RE: [Bluez-devel] Re: Qualification testing - rfcomm
Date: 22 Jul 2003 18:53:15 +0200	[thread overview]
Message-ID: <1058892812.2755.26.camel@pegasus> (raw)
In-Reply-To: <000c01c35071$0c788f60$1a01010a@baked>

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

Hi Daryl,

> > > @@ -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);
> > This part is not ok. We still have to check for timeout. Rest 
> > of patch is fine.
> 
> Ok. I'll see if it's not too late to stop testing it. :)

it should not make any difference for the test case, but here is the
complete version of the new patch.

Regards

Marcel


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

diff -urN linux-2.4.22-pre7/net/bluetooth/rfcomm/core.c linux-2.4.22-pre7-mh/net/bluetooth/rfcomm/core.c
--- linux-2.4.22-pre7/net/bluetooth/rfcomm/core.c	Tue Jul 22 18:33:43 2003
+++ linux-2.4.22-pre7-mh/net/bluetooth/rfcomm/core.c	Tue Jul 22 18:37:59 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);
@@ -1540,6 +1598,9 @@
 			__rfcomm_dlc_close(d, ETIMEDOUT);
 			continue;
 		}
+
+		if (test_bit(RFCOMM_TX_THROTTLED, &s->flags))
+			continue;
 
 		if ((d->state == BT_CONNECTED || d->state == BT_DISCONN) &&
 				d->mscex == RFCOMM_MSCEX_OK)

  reply	other threads:[~2003-07-22 16:53 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 ` [Bluez-devel] " Marcel Holtmann
2003-07-22 16:23   ` 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 [this message]
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=1058892812.2755.26.camel@pegasus \
    --to=marcel@rvs.uni-bielefeld.de \
    --cc=bluez-devel@lists.sourceforge.net \
    --cc=daryl@wideray.com \
    --cc=maxk@qualcomm.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.