From: Frank Mandarino <fmandarino@endrelia.com>
To: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] [Patch] Reduce bccmd "Operation timed out" errors
Date: Wed, 30 Aug 2006 11:45:37 -0400 [thread overview]
Message-ID: <ed4br2$7t9$1@sea.gmane.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1144 bytes --]
Hi Marcel,
The attached bccmd patch reverses the order of processing the
PACKET_RECEIVED and PACKET_SENT activity bits returned by ubcsp_poll(),
to handle the case where both bits are set. This condition occurs when
the received packet contains the acknowledgment for the previously sent
packet. It happens quite often on my system, and results in an
"Operation timed out" error.
Currently, when both bits are set, the PACKET_RECEIVED bit is processed
first, and the received packet is ignored because it hasn't yet
processed the PACKET_SENT bit. Then when the PACKET_SENT bit is
processed, it sets a flag to indicate that the next received packet will
contain the result, and the loop should be exited at that time. Since
no further packets are received, the loop times out.
By reversing the order of processing, the packet sent flag gets set
before the PACKET_RECEIVED bit is processed, and the loop is exited.
After making this change, I haven't seen a single operation timed out error.
Regards,
../fam
--
Frank Mandarino fmandarino(a)endrelia.com
Endrelia Technologies Inc.
Toronto, Ontario, Canada
[-- Attachment #2: csr_bcsp.c.txt --]
[-- Type: text/plain, Size: 1209 bytes --]
Index: utils/tools/csr_bcsp.c
===================================================================
RCS file: /cvsroot/bluez/utils/tools/csr_bcsp.c,v
retrieving revision 1.6
diff -u -r1.6 csr_bcsp.c
--- utils/tools/csr_bcsp.c 26 Jul 2006 13:32:45 -0000 1.6
+++ utils/tools/csr_bcsp.c 30 Aug 2006 15:06:56 -0000
@@ -188,19 +188,6 @@
while (1) {
delay = ubcsp_poll(&activity);
- if (activity & UBCSP_PACKET_RECEIVED) {
- if (sent && receive_packet.channel == 5 &&
- receive_packet.payload[0] == 0xff) {
- memcpy(rp, receive_packet.payload,
- receive_packet.length);
- break;
- }
-
- receive_packet.length = 512;
- ubcsp_receive_packet(&receive_packet);
- timeout = 0;
- }
-
if (activity & UBCSP_PACKET_SENT) {
switch (varid) {
case CSR_VARID_COLD_RESET:
@@ -214,6 +201,19 @@
timeout = 0;
}
+ if (activity & UBCSP_PACKET_RECEIVED) {
+ if (sent && receive_packet.channel == 5 &&
+ receive_packet.payload[0] == 0xff) {
+ memcpy(rp, receive_packet.payload,
+ receive_packet.length);
+ break;
+ }
+
+ receive_packet.length = 512;
+ ubcsp_receive_packet(&receive_packet);
+ timeout = 0;
+ }
+
if (delay) {
usleep(delay * 100);
[-- Attachment #3: Type: text/plain, Size: 373 bytes --]
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
[-- Attachment #4: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
reply other threads:[~2006-08-30 15:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='ed4br2$7t9$1@sea.gmane.org' \
--to=fmandarino@endrelia.com \
--cc=bluez-devel@lists.sourceforge.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox