* [Bluez-devel] Error: sdptool browse --> Connection reset by peer
@ 2006-07-19 16:28 JP Freeley
2006-07-20 0:48 ` Marcel Holtmann
0 siblings, 1 reply; 19+ messages in thread
From: JP Freeley @ 2006-07-19 16:28 UTC (permalink / raw)
To: bluez-devel
I am getting an error ("Connection reset by peer") when I run an
"sdptool browse" and it discovers my Sprint Pocket PC handset.
I'm sure this is probably a common situation. I have attached my
"hcidump -V -R". Any help in deciphering this problem would be great. My
goal is to send a .vcf file to the device.
Could this device be looking at my "device class" and refusing the
connection?
Of course, I'd be happy to provide any other info as necessary to assit.
TIA,
jpf
*** HCICONFIG ***
% hciconfig -a
hci0: Type: USB
BD Address: 00:03:C9:87:37:13 ACL MTU: 1017:8 SCO MTU: 64:0
UP RUNNING PSCAN ISCAN
RX bytes:18007 acl:307 sco:0 events:523 errors:0
TX bytes:90101 acl:325 sco:0 commands:129 errors:0
Features: 0xff 0xff 0x8d 0xfe 0x9b 0xf9 0x00 0x80
Packet type: DM1 DH1 HV1
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'bbm-0'
Class: 0x100100
Service Classes:
Device Class: Computer, Uncategorized
HCI Ver: 2.0 (0x3) HCI Rev: 0x2000 LMP Ver: 2.0 (0x3) LMP Subver: 0x4127
Manufacturer: Broadcom Corporation (15)
*** HCIDUMP ***
% hcidump -V -R
HCI sniffer - Bluetooth packet analyzer ver 1.30
device: hci0 snap_len: 1028 filter: 0xffffffff
< 01 01 04 05 33 8B 9E 0A 14
< HCI Command: Inquiry (0x01|0x0001) plen 5
lap 0x9e8b33 len 10 num 20
> 04 0F 04 00 01 01 04
> HCI Event: Command Status (0x0f) plen 4
Inquiry (0x01|0x0001) status 0x00 ncmd 1
> 04 02 0F 01 99 CD B9 37 12 00 01 00 00 14 01 10 CB 1E
> HCI Event: Inquiry Result (0x02) plen 15
bdaddr 00:12:37:B9:CD:99 mode 1 clkoffset 0x1ecb class 0x100114
> 04 02 0F 01 99 CD B9 37 12 00 01 00 00 14 01 10 CB 1E
> HCI Event: Inquiry Result (0x02) plen 15
bdaddr 00:12:37:B9:CD:99 mode 1 clkoffset 0x1ecb class 0x100114
> 04 02 0F 01 99 CD B9 37 12 00 01 00 00 14 01 10 CA 1E
> HCI Event: Inquiry Result (0x02) plen 15
bdaddr 00:12:37:B9:CD:99 mode 1 clkoffset 0x1eca class 0x100114
> 04 02 0F 01 99 CD B9 37 12 00 01 00 00 14 01 10 CB 1E
> HCI Event: Inquiry Result (0x02) plen 15
bdaddr 00:12:37:B9:CD:99 mode 1 clkoffset 0x1ecb class 0x100114
> 04 02 0F 01 99 CD B9 37 12 00 01 00 00 14 01 10 CB 1E
> HCI Event: Inquiry Result (0x02) plen 15
bdaddr 00:12:37:B9:CD:99 mode 1 clkoffset 0x1ecb class 0x100114
> 04 02 0F 01 99 CD B9 37 12 00 01 00 00 14 01 10 CB 1E
> HCI Event: Inquiry Result (0x02) plen 15
bdaddr 00:12:37:B9:CD:99 mode 1 clkoffset 0x1ecb class 0x100114
> 04 02 0F 01 99 CD B9 37 12 00 01 00 00 14 01 10 CB 1E
> HCI Event: Inquiry Result (0x02) plen 15
bdaddr 00:12:37:B9:CD:99 mode 1 clkoffset 0x1ecb class 0x100114
> 04 02 0F 01 99 CD B9 37 12 00 01 00 00 14 01 10 CA 1E
> HCI Event: Inquiry Result (0x02) plen 15
bdaddr 00:12:37:B9:CD:99 mode 1 clkoffset 0x1eca class 0x100114
> 04 02 0F 01 99 CD B9 37 12 00 01 00 00 14 01 10 CB 1E
> HCI Event: Inquiry Result (0x02) plen 15
bdaddr 00:12:37:B9:CD:99 mode 1 clkoffset 0x1ecb class 0x100114
> 04 02 0F 01 99 CD B9 37 12 00 01 00 00 14 01 10 CB 1E
> HCI Event: Inquiry Result (0x02) plen 15
bdaddr 00:12:37:B9:CD:99 mode 1 clkoffset 0x1ecb class 0x100114
> 04 02 0F 01 99 CD B9 37 12 00 01 00 00 14 01 10 CA 1E
> HCI Event: Inquiry Result (0x02) plen 15
bdaddr 00:12:37:B9:CD:99 mode 1 clkoffset 0x1eca class 0x100114
> 04 01 01 00
> HCI Event: Inquiry Complete (0x01) plen 1
status 0x00
< 01 05 04 0D 99 CD B9 37 12 00 18 00 01 00 CA 9E 01
< HCI Command: Create Connection (0x01|0x0005) plen 13
bdaddr 00:12:37:B9:CD:99 ptype 0x0018 rswitch 0x01 clkoffset 0x1eca (valid)
Packet type: DM1 DH1
> 04 0F 04 00 01 05 04
> HCI Event: Command Status (0x0f) plen 4
Create Connection (0x01|0x0005) status 0x00 ncmd 1
> 04 03 0B 00 0C 00 99 CD B9 37 12 00 01 00
> HCI Event: Connect Complete (0x03) plen 11
status 0x00 handle 12 bdaddr 00:12:37:B9:CD:99 type ACL encrypt 0x00
< 02 0C 20 0C 00 08 00 01 00 02 01 04 00 01 00 40 00
< 01 0D 08 04 0C 00 0F 00
< ACL data: handle 12 flags 0x02 dlen 12
L2CAP(s): Connect req: psm 1 scid 0x0040
< HCI Command: Write Link Policy Settings (0x02|0x000d) plen 4
handle 12 policy 0x0f
Link policy: RSWITCH HOLD SNIFF PARK
> 04 0E 06 01 0D 08 00 0C 00
> HCI Event: Command Complete (0x0e) plen 6
Write Link Policy Settings (0x02|0x000d) ncmd 1
status 0x00 handle 12
> 04 05 04 00 0C 00 13
> HCI Event: Disconn Complete (0x05) plen 4
status 0x00 handle 12 reason 0x13
Reason: Remote User Terminated Connection
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [Bluez-devel] Error: sdptool browse --> Connection reset by peer 2006-07-19 16:28 [Bluez-devel] Error: sdptool browse --> Connection reset by peer JP Freeley @ 2006-07-20 0:48 ` Marcel Holtmann 2006-07-20 21:27 ` JP Freeley 2006-07-22 14:08 ` [Bluez-devel] It's rfcomm connect problem Fabrizio Guglielmino 0 siblings, 2 replies; 19+ messages in thread From: Marcel Holtmann @ 2006-07-20 0:48 UTC (permalink / raw) To: BlueZ development Hi, > I am getting an error ("Connection reset by peer") when I run an > "sdptool browse" and it discovers my Sprint Pocket PC handset. > > I'm sure this is probably a common situation. I have attached my > "hcidump -V -R". Any help in deciphering this problem would be great. My > goal is to send a .vcf file to the device. please include "hcidump -X -V". Regards Marcel ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Bluez-devel] Error: sdptool browse --> Connection reset by peer 2006-07-20 0:48 ` Marcel Holtmann @ 2006-07-20 21:27 ` JP Freeley 2006-07-25 4:26 ` JP Freeley 2006-07-22 14:08 ` [Bluez-devel] It's rfcomm connect problem Fabrizio Guglielmino 1 sibling, 1 reply; 19+ messages in thread From: JP Freeley @ 2006-07-20 21:27 UTC (permalink / raw) To: BlueZ development [-- Attachment #1.1: Type: text/plain, Size: 1586 bytes --] Mr. Holtmann-- Thanks for the reply, but I'm having trouble replicating the situation. I'm having trouble in general I think. My bluetooth setup seems quite finicky and unstable. There are so many factors which affect this, it's hard to point the finger at any single point of failure. (Could be handheld devices, could be Linux, could be bluez, could be BT Dongle, could be kernel, etc.) I can send you any notes on my configuration that may lend clues, just tell me where to start. I just ran an "apt-get upgrade" last night and haven't had much time to see if it helped at all yet. Thanks, jpf Marcel Holtmann wrote: > Hi, > > >> I am getting an error ("Connection reset by peer") when I run an >> "sdptool browse" and it discovers my Sprint Pocket PC handset. >> >> I'm sure this is probably a common situation. I have attached my >> "hcidump -V -R". Any help in deciphering this problem would be great. My >> goal is to send a .vcf file to the device. >> > > please include "hcidump -X -V". > > Regards > > Marcel > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel > > [-- Attachment #1.2: Type: text/html, Size: 2309 bytes --] [-- Attachment #2: Type: text/plain, Size: 348 bytes --] ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV [-- Attachment #3: Type: text/plain, Size: 164 bytes --] _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Bluez-devel] Error: sdptool browse --> Connection reset by peer 2006-07-20 21:27 ` JP Freeley @ 2006-07-25 4:26 ` JP Freeley 0 siblings, 0 replies; 19+ messages in thread From: JP Freeley @ 2006-07-25 4:26 UTC (permalink / raw) To: BlueZ development [-- Attachment #1.1: Type: text/plain, Size: 3234 bytes --] Just FYI .... It seems as though most of my woes are over. As it turns out, I was running the debian-etch version of bluez .. which seems to be a bit stale, and still buggy. I recompiled based on the 3.1.tar.gz packages from bluez.sourceforge.net and everything seems working much better. My problem right now is that the /etc/init.d/bluetooth script doesn't work. I went through and fixed paths to /usr/local/sbin (from simply /usr/sbin) .. It produces no log output and doesn't start any daemons, just a quiet exit. Any thoughts would be appreciated. When I run the most important commands by hand, they work fine (so it must be failing before trying to execute these commands): start-stop-daemon --start --exec /usr/local/sbin/hcid start-stop-daemon --start --exec /usr/local/sbin/sdpd (I think I have kernel rfcomm [krfcommd]) Thanks jpf JP Freeley wrote: > Mr. Holtmann-- > > Thanks for the reply, but I'm having trouble replicating the > situation. I'm having trouble in general I think. My bluetooth setup > seems quite finicky and unstable. There are so many factors which > affect this, it's hard to point the finger at any single point of > failure. (Could be handheld devices, could be Linux, could be bluez, > could be BT Dongle, could be kernel, etc.) > > I can send you any notes on my configuration that may lend clues, just > tell me where to start. I just ran an "apt-get upgrade" last night and > haven't had much time to see if it helped at all yet. > > Thanks, > > jpf > > Marcel Holtmann wrote: >> Hi, >> >> >>> I am getting an error ("Connection reset by peer") when I run an >>> "sdptool browse" and it discovers my Sprint Pocket PC handset. >>> >>> I'm sure this is probably a common situation. I have attached my >>> "hcidump -V -R". Any help in deciphering this problem would be great. My >>> goal is to send a .vcf file to the device. >>> >> >> please include "hcidump -X -V". >> >> Regards >> >> Marcel >> >> >> >> ------------------------------------------------------------------------- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to share your >> opinions on IT & business topics through brief surveys -- and earn cash >> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >> _______________________________________________ >> Bluez-devel mailing list >> Bluez-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/bluez-devel >> >> > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel > [-- Attachment #1.2: Type: text/html, Size: 4473 bytes --] [-- Attachment #2: Type: text/plain, Size: 348 bytes --] ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV [-- Attachment #3: Type: text/plain, Size: 164 bytes --] _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bluez-devel] It's rfcomm connect problem 2006-07-20 0:48 ` Marcel Holtmann 2006-07-20 21:27 ` JP Freeley @ 2006-07-22 14:08 ` Fabrizio Guglielmino 2006-07-24 8:38 ` Andreas Gaufer 1 sibling, 1 reply; 19+ messages in thread From: Fabrizio Guglielmino @ 2006-07-22 14:08 UTC (permalink / raw) To: BlueZ development Hi all, I made some investigation about the BtOBEX_TransportConnect signaled to the list and Marcel some days before. Openobex isn't involved in the problem, in my try I've writed from scatch a simple obex push client (not using openobex but only socket). In my test I found this : if there are two thread (also two process) making something like ... ret = connect(fd, (struct sockaddr *)dst, sizeof(struct sockaddr_rd)); ... in simultaneous way the second always fail (return -1). I've also tryed to "protect" the connect using a mutex and all works but (naturally) second connection result conditioned to the frist (syncronous so thread it is not useful). I think there is some solution to this but I don't know if it's using some ioctl on socket (nonbloking?) or some hci command to adapter. Please can some one give me some hint? I'm looking at kernel source related to rfcomm (/usr/src/ linux-2.6.116/net/bluetooth/rfcomm/*.c) but I'm not sure the problem reside here... thanks, bye Fabrizio ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Bluez-devel] It's rfcomm connect problem 2006-07-22 14:08 ` [Bluez-devel] It's rfcomm connect problem Fabrizio Guglielmino @ 2006-07-24 8:38 ` Andreas Gaufer 2006-07-24 13:33 ` Fabrizio Guglielmino 0 siblings, 1 reply; 19+ messages in thread From: Andreas Gaufer @ 2006-07-24 8:38 UTC (permalink / raw) To: BlueZ development Hi Fabrizio, i'm working on a possibly related problem. Could you check the hcidump of your situation and look out for apparently unmotivated hci_reset commands sent to your device? Greetings & TIA Andy On Sat, 22 Jul 2006 16:08:08 +0200 Fabrizio Guglielmino <guglielmino@infitsrl.com> wrote: > Hi all, > I made some investigation about the BtOBEX_TransportConnect signaled > to the list and Marcel some days before. > Openobex isn't involved in the problem, in my try I've writed from > scatch a simple obex push client (not using openobex but only > socket). > In my test I found this : if there are two thread (also two process) > making something like > > ... > ret = connect(fd, (struct sockaddr *)dst, sizeof(struct sockaddr_rd)); > ... > > in simultaneous way the second always fail (return -1). I've also > tryed to "protect" the connect using a mutex and all works > but (naturally) second connection result conditioned to the frist > (syncronous so thread it is not useful). > > I think there is some solution to this but I don't know if it's using > some ioctl on socket (nonbloking?) or some hci command to adapter. > Please can some one give me some hint? > > I'm looking at kernel source related to rfcomm (/usr/src/ > linux-2.6.116/net/bluetooth/rfcomm/*.c) but I'm not sure the problem > reside here... > > > thanks, bye > Fabrizio > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Bluez-devel] It's rfcomm connect problem 2006-07-24 8:38 ` Andreas Gaufer @ 2006-07-24 13:33 ` Fabrizio Guglielmino 2006-07-24 13:56 ` Andreas Gaufer 0 siblings, 1 reply; 19+ messages in thread From: Fabrizio Guglielmino @ 2006-07-24 13:33 UTC (permalink / raw) To: BlueZ development Hi Andy, I Andy the problem I have is described in following hcidump: < HCI Command: Create Connection (0x01|0x0005) plen 13 bdaddr 00:09:2D:2A:68:20 ptype 0xcc18 rswitch 0x01 clkoffset 0x0000 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 > HCI Event: Command Status (0x0f) plen 4 Create Connection (0x01|0x0005) status 0x00 ncmd 1 < HCI Command: Create Connection (0x01|0x0005) plen 13 bdaddr 00:01:E3:25:53:44 ptype 0xcc18 rswitch 0x01 clkoffset 0x0000 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 > HCI Event: Command Status (0x0f) plen 4 Create Connection (0x01|0x0005) status 0x0c ncmd 1 Error: Command Disallowed > HCI Event: Connect Complete (0x03) plen 11 status 0x00 handle 42 bdaddr 00:09:2D:2A:68:20 type ACL encrypt 0x00 < ACL data: handle 42 flags 0x02 dlen 12 L2CAP(s): Connect req: psm 3 scid 0x0040 > HCI Event: Number of Completed Packets (0x13) plen 5 handle 42 packets 1 > HCI Event: Max Slots Change (0x1b) plen 3 handle 42 slots 5 > ACL data: handle 42 flags 0x02 dlen 16 L2CAP(s): Connect rsp: dcid 0x0044 scid 0x0040 result 0 status 0 Connection successful < ACL data: handle 42 flags 0x02 dlen 16 L2CAP(s): Config req: dcid 0x0044 flags 0x00 clen 4 MTU 1024 > ACL data: handle 42 flags 0x02 dlen 16 L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4 MTU 1691 < ACL data: handle 42 flags 0x02 dlen 14 L2CAP(s): Config rsp: scid 0x0044 flags 0x00 result 0 clen 0 Success > HCI Event: Number of Completed Packets (0x13) plen 5 handle 42 packets 1 > HCI Event: Number of Completed Packets (0x13) plen 5 handle 42 packets 1 > ACL data: handle 42 flags 0x02 dlen 14 L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0 Success < ACL data: handle 42 flags 0x02 dlen 8 L2CAP(d): cid 0x0044 len 4 [psm 3] RFCOMM(s): SABM: cr 1 dlci 0 pf 1 ilen 0 fcs 0x1c > HCI Event: Number of Completed Packets (0x13) plen 5 handle 42 packets 1 > ACL data: handle 42 flags 0x02 dlen 8 L2CAP(d): cid 0x0040 len 4 [psm 3] RFCOMM(s): UA: cr 1 dlci 0 pf 1 ilen 0 fcs 0xd7 < ACL data: handle 42 flags 0x02 dlen 18 L2CAP(d): cid 0x0044 len 14 [psm 3] RFCOMM(s): PN CMD: cr 1 dlci 0 pf 0 ilen 10 fcs 0x70 mcc_len 8 dlci 4 frame_type 0 credit_flow 15 pri 7 ack_timer 0 frame_size 1019 max_retrans 0 credits 7 > HCI Event: Number of Completed Packets (0x13) plen 5 handle 42 packets 1 > ACL data: handle 42 flags 0x02 dlen 18 L2CAP(d): cid 0x0040 len 14 [psm 3] RFCOMM(s): PN RSP: cr 0 dlci 0 pf 0 ilen 10 fcs 0xaa mcc_len 8 dlci 4 frame_type 0 credit_flow 14 pri 0 ack_timer 0 frame_size 1019 max_retrans 0 credits 7 < ACL data: handle 42 flags 0x02 dlen 8 L2CAP(d): cid 0x0044 len 4 [psm 3] RFCOMM(s): SABM: cr 1 dlci 4 pf 1 ilen 0 fcs 0x96 > HCI Event: Number of Completed Packets (0x13) plen 5 handle 42 packets 1 > ACL data: handle 42 flags 0x02 dlen 8 L2CAP(d): cid 0x0040 len 4 [psm 3] RFCOMM(s): UA: cr 1 dlci 4 pf 1 ilen 0 fcs 0x5d < ACL data: handle 42 flags 0x02 dlen 12 L2CAP(d): cid 0x0044 len 8 [psm 3] RFCOMM(s): MSC CMD: cr 1 dlci 0 pf 0 ilen 4 fcs 0x70 mcc_len 2 dlci 4 fc 0 rtc 1 rtr 1 ic 0 dv 1 b1 1 b2 1 b3 0 len 0 > HCI Event: Number of Completed Packets (0x13) plen 5 handle 42 packets 1 > ACL data: handle 42 flags 0x02 dlen 12 L2CAP(d): cid 0x0040 len 8 [psm 3] RFCOMM(s): MSC RSP: cr 0 dlci 0 pf 0 ilen 4 fcs 0xaa mcc_len 2 dlci 4 fc 0 rtc 1 rtr 1 ic 0 dv 1 b1 1 b2 1 b3 0 len 0 > ACL data: handle 42 flags 0x02 dlen 12 L2CAP(d): cid 0x0040 len 8 [psm 3] RFCOMM(s): MSC CMD: cr 0 dlci 0 pf 0 ilen 4 fcs 0xaa mcc_len 2 dlci 4 fc 0 rtc 1 rtr 1 ic 0 dv 1 b1 1 b2 1 b3 0 len 0 < ACL data: handle 42 flags 0x02 dlen 12 L2CAP(d): cid 0x0044 len 8 [psm 3] RFCOMM(s): MSC RSP: cr 1 dlci 0 pf 0 ilen 4 fcs 0x70 mcc_len 2 dlci 4 fc 0 rtc 1 rtr 1 ic 0 dv 1 b1 1 b2 1 b3 0 len 0 < ACL data: handle 42 flags 0x02 dlen 9 L2CAP(d): cid 0x0044 len 5 [psm 3] RFCOMM(d): UIH: cr 1 dlci 4 pf 1 ilen 0 fcs 0x79 credits 33 < ACL data: handle 42 flags 0x02 dlen 25 L2CAP(d): cid 0x0044 len 21 [psm 3] RFCOMM(d): UIH: cr 1 dlci 4 pf 0 ilen 17 fcs 0x65 0000: 80 00 11 10 00 08 00 00 00 00 00 00 00 00 00 00 = ................ 0010: 00 . > HCI Event: Number of Completed Packets (0x13) plen 5 handle 42 packets 1 > HCI Event: Number of Completed Packets (0x13) plen 5 handle 42 packets 1 > HCI Event: Number of Completed Packets (0x13) plen 5 handle 42 packets 1 > ACL data: handle 42 flags 0x02 dlen 9 L2CAP(d): cid 0x0040 len 5 [psm 3] RFCOMM(d): UIH: cr 0 dlci 4 pf 1 ilen 0 fcs 0xa3 credits 23 As You can see the second Create Connection fails with a Command = disallowed..... In my case I've no see any hci_reset..... Hi Fabrizio Andreas Gaufer ha scritto: > Hi Fabrizio, > > i'm working on a possibly related problem. Could you check the hcidump of > your situation and look out for apparently unmotivated hci_reset > commands sent to your device? = > > Greetings & TIA > > Andy > > On Sat, 22 Jul 2006 16:08:08 +0200 > Fabrizio Guglielmino <guglielmino@infitsrl.com> wrote: > > = >> Hi all, >> I made some investigation about the BtOBEX_TransportConnect signaled = >> to the list and Marcel some days before. >> Openobex isn't involved in the problem, in my try I've writed from = >> scatch a simple obex push client (not using openobex but only >> socket). >> In my test I found this : if there are two thread (also two process) = >> making something like >> >> ... >> ret =3D connect(fd, (struct sockaddr *)dst, sizeof(struct sockaddr_rd)= ); >> ... >> >> in simultaneous way the second always fail (return -1). I've also = >> tryed to "protect" the connect using a mutex and all works >> but (naturally) second connection result conditioned to the frist = >> (syncronous so thread it is not useful). >> >> I think there is some solution to this but I don't know if it's using = >> some ioctl on socket (nonbloking?) or some hci command to adapter. >> Please can some one give me some hint? >> >> I'm looking at kernel source related to rfcomm (/usr/src/ = >> linux-2.6.116/net/bluetooth/rfcomm/*.c) but I'm not sure the problem = >> reside here... >> >> >> thanks, bye >> Fabrizio = >> >> ------------------------------------------------------------------------- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to share = your >> opinions on IT & business topics through brief surveys -- and earn cash >> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID= =3DDEVDEV >> _______________________________________________ >> Bluez-devel mailing list >> Bluez-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/bluez-devel >> = > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share y= our > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel > > > = -- = ______________________________ Fabrizio Guglielmino = Infit Srl Software Engineering Tel. +39 11 7410915 Fax. +39 11 7410915 www.infitsrl.com C.so Svizzera, 79/8 - Torino ______________________________ Il presente messaggio ed ogni eventuale allegato hanno natura confidenziale e sono riservati ai destinatari indicati. La diffusione a terzi e qualsiasi altro uso non autorizzato sono proibiti. I messaggi ed i relativi allegati possono essere soggetti ad alterazioni. Il mittente declina ogni responsabilit=E0 per le eventuali alterazioni, modificazioni o falsificazioni. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDE= VDEV _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Bluez-devel] It's rfcomm connect problem 2006-07-24 13:33 ` Fabrizio Guglielmino @ 2006-07-24 13:56 ` Andreas Gaufer 2006-07-24 16:35 ` Marcel Holtmann 0 siblings, 1 reply; 19+ messages in thread From: Andreas Gaufer @ 2006-07-24 13:56 UTC (permalink / raw) To: BlueZ development Hi Fabrizio, thank your for that information. I guess your problem is just the same you had with sdp some while ago. A single BT Device can not *start* connecting to two different remote devices at the same time. To solve this you have to find a way to: 1. Create Connection to device A 2. Wait until Connect Complete for A's bdaddr happens (no matter if failed or succ.) 3. Then continue with other Create Connection Commands Greetings Andy On Mon, 24 Jul 2006 15:33:43 +0200 Fabrizio Guglielmino <guglielmino@infitsrl.com> wrote: > Hi Andy, > I Andy the problem I have is described in following hcidump: > > < HCI Command: Create Connection (0x01|0x0005) plen 13 > bdaddr 00:09:2D:2A:68:20 ptype 0xcc18 rswitch 0x01 clkoffset 0x0000 > Packet type: DM1 DM3 DM5 DH1 DH3 DH5 > > HCI Event: Command Status (0x0f) plen 4 > Create Connection (0x01|0x0005) status 0x00 ncmd 1 -- this is too soon to connect to 00:01:E3:25:53:44.... > < HCI Command: Create Connection (0x01|0x0005) plen 13 > bdaddr 00:01:E3:25:53:44 ptype 0xcc18 rswitch 0x01 clkoffset 0x0000 > Packet type: DM1 DM3 DM5 DH1 DH3 DH5 > > HCI Event: Command Status (0x0f) plen 4 > Create Connection (0x01|0x0005) status 0x0c ncmd 1 > Error: Command Disallowed > > HCI Event: Connect Complete (0x03) plen 11 > status 0x00 handle 42 bdaddr 00:09:2D:2A:68:20 type ACL encrypt 0x00 -- after this changes are much better.... > < ACL data: handle 42 flags 0x02 dlen 12 > L2CAP(s): Connect req: psm 3 scid 0x0040 > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 42 packets 1 > > HCI Event: Max Slots Change (0x1b) plen 3 > handle 42 slots 5 > > ACL data: handle 42 flags 0x02 dlen 16 > L2CAP(s): Connect rsp: dcid 0x0044 scid 0x0040 result 0 status 0 > Connection successful > < ACL data: handle 42 flags 0x02 dlen 16 > L2CAP(s): Config req: dcid 0x0044 flags 0x00 clen 4 > MTU 1024 > > ACL data: handle 42 flags 0x02 dlen 16 > L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4 > MTU 1691 > < ACL data: handle 42 flags 0x02 dlen 14 > L2CAP(s): Config rsp: scid 0x0044 flags 0x00 result 0 clen 0 > Success > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 42 packets 1 > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 42 packets 1 > > ACL data: handle 42 flags 0x02 dlen 14 > L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0 > Success > < ACL data: handle 42 flags 0x02 dlen 8 > L2CAP(d): cid 0x0044 len 4 [psm 3] > RFCOMM(s): SABM: cr 1 dlci 0 pf 1 ilen 0 fcs 0x1c > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 42 packets 1 > > ACL data: handle 42 flags 0x02 dlen 8 > L2CAP(d): cid 0x0040 len 4 [psm 3] > RFCOMM(s): UA: cr 1 dlci 0 pf 1 ilen 0 fcs 0xd7 > < ACL data: handle 42 flags 0x02 dlen 18 > L2CAP(d): cid 0x0044 len 14 [psm 3] > RFCOMM(s): PN CMD: cr 1 dlci 0 pf 0 ilen 10 fcs 0x70 mcc_len 8 > dlci 4 frame_type 0 credit_flow 15 pri 7 ack_timer 0 > frame_size 1019 max_retrans 0 credits 7 > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 42 packets 1 > > ACL data: handle 42 flags 0x02 dlen 18 > L2CAP(d): cid 0x0040 len 14 [psm 3] > RFCOMM(s): PN RSP: cr 0 dlci 0 pf 0 ilen 10 fcs 0xaa mcc_len 8 > dlci 4 frame_type 0 credit_flow 14 pri 0 ack_timer 0 > frame_size 1019 max_retrans 0 credits 7 > < ACL data: handle 42 flags 0x02 dlen 8 > L2CAP(d): cid 0x0044 len 4 [psm 3] > RFCOMM(s): SABM: cr 1 dlci 4 pf 1 ilen 0 fcs 0x96 > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 42 packets 1 > > ACL data: handle 42 flags 0x02 dlen 8 > L2CAP(d): cid 0x0040 len 4 [psm 3] > RFCOMM(s): UA: cr 1 dlci 4 pf 1 ilen 0 fcs 0x5d > < ACL data: handle 42 flags 0x02 dlen 12 > L2CAP(d): cid 0x0044 len 8 [psm 3] > RFCOMM(s): MSC CMD: cr 1 dlci 0 pf 0 ilen 4 fcs 0x70 mcc_len 2 > dlci 4 fc 0 rtc 1 rtr 1 ic 0 dv 1 b1 1 b2 1 b3 0 len 0 > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 42 packets 1 > > ACL data: handle 42 flags 0x02 dlen 12 > L2CAP(d): cid 0x0040 len 8 [psm 3] > RFCOMM(s): MSC RSP: cr 0 dlci 0 pf 0 ilen 4 fcs 0xaa mcc_len 2 > dlci 4 fc 0 rtc 1 rtr 1 ic 0 dv 1 b1 1 b2 1 b3 0 len 0 > > ACL data: handle 42 flags 0x02 dlen 12 > L2CAP(d): cid 0x0040 len 8 [psm 3] > RFCOMM(s): MSC CMD: cr 0 dlci 0 pf 0 ilen 4 fcs 0xaa mcc_len 2 > dlci 4 fc 0 rtc 1 rtr 1 ic 0 dv 1 b1 1 b2 1 b3 0 len 0 > < ACL data: handle 42 flags 0x02 dlen 12 > L2CAP(d): cid 0x0044 len 8 [psm 3] > RFCOMM(s): MSC RSP: cr 1 dlci 0 pf 0 ilen 4 fcs 0x70 mcc_len 2 > dlci 4 fc 0 rtc 1 rtr 1 ic 0 dv 1 b1 1 b2 1 b3 0 len 0 > < ACL data: handle 42 flags 0x02 dlen 9 > L2CAP(d): cid 0x0044 len 5 [psm 3] > RFCOMM(d): UIH: cr 1 dlci 4 pf 1 ilen 0 fcs 0x79 credits 33 > < ACL data: handle 42 flags 0x02 dlen 25 > L2CAP(d): cid 0x0044 len 21 [psm 3] > RFCOMM(d): UIH: cr 1 dlci 4 pf 0 ilen 17 fcs 0x65 > 0000: 80 00 11 10 00 08 00 00 00 00 00 00 00 00 00 00 > ................ > 0010: 00 . > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 42 packets 1 > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 42 packets 1 > > HCI Event: Number of Completed Packets (0x13) plen 5 > handle 42 packets 1 > > ACL data: handle 42 flags 0x02 dlen 9 > L2CAP(d): cid 0x0040 len 5 [psm 3] > RFCOMM(d): UIH: cr 0 dlci 4 pf 1 ilen 0 fcs 0xa3 credits 23 > > As You can see the second Create Connection fails with a Command > disallowed..... > In my case I've no see any hci_reset..... > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Bluez-devel] It's rfcomm connect problem 2006-07-24 13:56 ` Andreas Gaufer @ 2006-07-24 16:35 ` Marcel Holtmann 2006-07-24 18:34 ` Andreas Gaufer 0 siblings, 1 reply; 19+ messages in thread From: Marcel Holtmann @ 2006-07-24 16:35 UTC (permalink / raw) To: BlueZ development Hi Andreas, > thank your for that information. I guess your problem is just the same > you had with sdp some while ago. A single BT Device can not *start* > connecting to two different remote devices at the same time. > > To solve this you have to find a way to: > > 1. Create Connection to device A > 2. Wait until Connect Complete for A's bdaddr happens (no matter if failed or succ.) > 3. Then continue with other Create Connection Commands we have a plan to make the L2CAP layer handle multiple ACL connects and try again if one attempt fails. However the last patch I wrote for it got lost somehow and it was broken anyway. The mailing list should contain a thread where I proposed how this must be handled. I don't have time to look at it at the moment. So if anybody wants to work on it, please do so and send in a patch. Regards Marcel ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Bluez-devel] It's rfcomm connect problem 2006-07-24 16:35 ` Marcel Holtmann @ 2006-07-24 18:34 ` Andreas Gaufer 2006-07-24 20:30 ` Fabrizio Guglielmino 0 siblings, 1 reply; 19+ messages in thread From: Andreas Gaufer @ 2006-07-24 18:34 UTC (permalink / raw) To: BlueZ development Hi Marcel, i see the problem here and studied the mails about that. We workaround it by retrying socket a couple of times which works OK even if it wont scale too good up to the theoretical maximum of connections. In the moment I'm debugging some phenomena that sends hci_reset to hci devices that run more than one connection while pumping on maximum negotiated MTU (Obex Layer). I don't know where its coming from yet, I'll keep you updated on my findings. = I would be happy joining the work on the L2CAP later. Greetings Andy On Mon, 24 Jul 2006 18:35:12 +0200 Marcel Holtmann <marcel@holtmann.org> wrote: > Hi Andreas, > = > > thank your for that information. I guess your problem is just the same > > you had with sdp some while ago. A single BT Device can not *start* > > connecting to two different remote devices at the same time. = > > = > > To solve this you have to find a way to: > > = > > 1. Create Connection to device A = > > 2. Wait until Connect Complete for A's bdaddr happens (no matter if fai= led or succ.) > > 3. Then continue with other Create Connection Commands > = > we have a plan to make the L2CAP layer handle multiple ACL connects and > try again if one attempt fails. However the last patch I wrote for it > got lost somehow and it was broken anyway. The mailing list should > contain a thread where I proposed how this must be handled. I don't have > time to look at it at the moment. So if anybody wants to work on it, > please do so and send in a patch. > = > Regards > = > Marcel > = > = > = > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share y= our > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel -- = -- = mit freundlichen Gr=FC=DFen / best regards, Andreas Gaufer Office: +49 951-700428-91 Fax: +49 951-700428-87 Mail: Andreas.Gaufer@bluecellnetworks.com I fully agree with RFC 1855 ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDE= VDEV _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Bluez-devel] It's rfcomm connect problem 2006-07-24 18:34 ` Andreas Gaufer @ 2006-07-24 20:30 ` Fabrizio Guglielmino 2006-07-24 21:12 ` Marcel Holtmann 0 siblings, 1 reply; 19+ messages in thread From: Fabrizio Guglielmino @ 2006-07-24 20:30 UTC (permalink / raw) To: BlueZ development Ok many thanks to all.. Last solutions it's to see at l2cap layer and try to understand ho wo = write the patch, if I will succeed to find the past Marcel's thread about it I'll try to = write this patch. Any suggestion will be appreciated .... Bye Fabrizio Il giorno 24/lug/06, alle ore 20:34, Andreas Gaufer ha scritto: > Hi Marcel, > > i see the problem here and studied the mails about that. We workaround > it by retrying socket a couple of times which works OK even if it wont > scale too good up to the theoretical maximum of connections. > > In the moment I'm debugging some phenomena that sends hci_reset to > hci devices that run more than one connection while pumping on maximum > negotiated MTU (Obex Layer). I don't know where its coming from = > yet, I'll > keep you updated on my findings. > > I would be happy joining the work on the L2CAP later. > > Greetings > > Andy > > On Mon, 24 Jul 2006 18:35:12 +0200 > Marcel Holtmann <marcel@holtmann.org> wrote: > >> Hi Andreas, >> >>> thank your for that information. I guess your problem is just the = >>> same >>> you had with sdp some while ago. A single BT Device can not *start* >>> connecting to two different remote devices at the same time. >>> >>> To solve this you have to find a way to: >>> >>> 1. Create Connection to device A >>> 2. Wait until Connect Complete for A's bdaddr happens (no matter = >>> if failed or succ.) >>> 3. Then continue with other Create Connection Commands >> >> we have a plan to make the L2CAP layer handle multiple ACL = >> connects and >> try again if one attempt fails. However the last patch I wrote for it >> got lost somehow and it was broken anyway. The mailing list should >> contain a thread where I proposed how this must be handled. I = >> don't have >> time to look at it at the moment. So if anybody wants to work on it, >> please do so and send in a patch. >> >> Regards >> >> Marcel >> >> >> >> --------------------------------------------------------------------- = >> ---- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to = >> share your >> opinions on IT & business topics through brief surveys -- and earn = >> cash >> http://www.techsay.com/default.php? = >> page=3Djoin.php&p=3Dsourceforge&CID=3DDEVDEV >> _______________________________________________ >> Bluez-devel mailing list >> Bluez-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/bluez-devel > > > -- = > -- = > mit freundlichen Gr=FC=DFen / best regards, > > Andreas Gaufer > > Office: +49 951-700428-91 > Fax: +49 951-700428-87 > Mail: Andreas.Gaufer@bluecellnetworks.com > > I fully agree with RFC 1855 > > > ---------------------------------------------------------------------- = > --- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to = > share your > opinions on IT & business topics through brief surveys -- and earn = > cash > http://www.techsay.com/default.php? = > page=3Djoin.php&p=3Dsourceforge&CID=3DDEVDEV > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDE= VDEV _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Bluez-devel] It's rfcomm connect problem 2006-07-24 20:30 ` Fabrizio Guglielmino @ 2006-07-24 21:12 ` Marcel Holtmann 2006-07-27 9:04 ` Fabrizio Guglielmino 0 siblings, 1 reply; 19+ messages in thread From: Marcel Holtmann @ 2006-07-24 21:12 UTC (permalink / raw) To: BlueZ development [-- Attachment #1: Type: text/plain, Size: 312 bytes --] Hi Fabrizio, > Last solutions it's to see at l2cap layer and try to understand ho wo > write the patch, if > I will succeed to find the past Marcel's thread about it I'll try to > write this patch. it must look something like the attached one. However that one might crash your machine. Regards Marcel [-- Attachment #2: patch --] [-- Type: text/x-patch, Size: 3011 bytes --] diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 8242a0e..cb19e66 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h @@ -183,6 +183,8 @@ struct l2cap_chan_list { }; struct l2cap_conn { + struct list_head list; + struct hci_conn *hcon; bdaddr_t *dst; diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index eaaad65..1d1c423 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c @@ -63,6 +63,9 @@ static struct bt_sock_list l2cap_sk_list .lock = RW_LOCK_UNLOCKED }; +static LIST_HEAD(l2cap_conn_list); +static DEFINE_SPINLOCK(l2cap_conn_lock); + static void __l2cap_sock_close(struct sock *sk, int reason); static void l2cap_sock_close(struct sock *sk); static void l2cap_sock_kill(struct sock *sk); @@ -295,6 +298,10 @@ static void l2cap_conn_del(struct hci_co BT_DBG("hcon %p conn %p, err %d", hcon, conn, err); + spin_lock_bh(&l2cap_conn_lock); + list_del(&conn->list); + spin_unlock_bh(&l2cap_conn_lock); + if (conn->rx_skb) kfree_skb(conn->rx_skb); @@ -642,18 +649,23 @@ static int l2cap_do_connect(struct sock sk->sk_state = BT_CONNECT; l2cap_sock_set_timer(sk, sk->sk_sndtimeo); - if (hcon->state == BT_CONNECTED) { - if (sk->sk_type == SOCK_SEQPACKET) { - struct l2cap_conn_req req; - l2cap_pi(sk)->ident = l2cap_get_ident(conn); - req.scid = __cpu_to_le16(l2cap_pi(sk)->scid); - req.psm = l2cap_pi(sk)->psm; - l2cap_send_cmd(conn, l2cap_pi(sk)->ident, - L2CAP_CONN_REQ, sizeof(req), &req); - } else { - l2cap_sock_clear_timer(sk); - sk->sk_state = BT_CONNECTED; - } + if (hcon->state != BT_CONNECTED) { + spin_lock_bh(&l2cap_conn_lock); + list_add_tail(&conn->list, &l2cap_conn_list); + spin_unlock_bh(&l2cap_conn_lock); + goto done; + } + + if (sk->sk_type == SOCK_SEQPACKET) { + struct l2cap_conn_req req; + l2cap_pi(sk)->ident = l2cap_get_ident(conn); + req.scid = __cpu_to_le16(l2cap_pi(sk)->scid); + req.psm = l2cap_pi(sk)->psm; + l2cap_send_cmd(conn, l2cap_pi(sk)->ident, + L2CAP_CONN_REQ, sizeof(req), &req); + } else { + l2cap_sock_clear_timer(sk); + sk->sk_state = BT_CONNECTED; } done: @@ -1926,12 +1938,35 @@ static int l2cap_connect_cfm(struct hci_ if (hcon->type != ACL_LINK) return 0; - if (!status) { + switch (status) { + case 0x00: conn = l2cap_conn_add(hcon, status); - if (conn) - l2cap_conn_ready(conn); - } else + if (!conn) + break; + + spin_lock_bh(&l2cap_conn_lock); + list_del(&conn->list); + spin_unlock_bh(&l2cap_conn_lock); + + l2cap_conn_ready(conn); + + spin_lock_bh(&l2cap_conn_lock); + if (!list_empty(&l2cap_conn_list)) { + conn = list_entry(l2cap_conn_list.next, struct l2cap_conn, list); + list_move_tail(&conn->list, &l2cap_conn_list); + hci_conn_put(conn->hcon); + hci_connect(conn->hcon->hdev, ACL_LINK, conn->dst); + } + spin_unlock_bh(&l2cap_conn_lock); + break; + + case 0x0c: + break; + + default: l2cap_conn_del(hcon, bt_err(status)); + break; + } return 0; } [-- Attachment #3: Type: text/plain, Size: 348 bytes --] ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV [-- 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 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [Bluez-devel] It's rfcomm connect problem 2006-07-24 21:12 ` Marcel Holtmann @ 2006-07-27 9:04 ` Fabrizio Guglielmino 2006-07-27 9:25 ` [Bluez-devel] It's rfcomm connect problem [ERRATA] Fabrizio Guglielmino 2006-07-28 11:14 ` [Bluez-devel] It's rfcomm connect problem Marcel Holtmann 0 siblings, 2 replies; 19+ messages in thread From: Fabrizio Guglielmino @ 2006-07-27 9:04 UTC (permalink / raw) To: BlueZ development I Marcel, I'm trying to use the patch to handle multiple l2cap connection, I'm not = a kernel/modules expert developer so I need a little help. Firts I'm trying to understand what the patch do and I think it's clear = (is used a linked list to handle multiple connection). My problems are with kernel programming enviromnment: 1) I'm using kernel-2.6.10 I have to update to a more recent version? 2) Is there some documentation about bluez kernel modules? I need to = understand how modules works to make try to make the patch. Many thanks Fabrizio Marcel Holtmann ha scritto: > Hi Fabrizio, > > = >> Last solutions it's to see at l2cap layer and try to understand ho wo = >> write the patch, if >> I will succeed to find the past Marcel's thread about it I'll try to = >> write this patch. >> = > > it must look something like the attached one. However that one might > crash your machine. > > Regards > > Marcel > > = > ------------------------------------------------------------------------ > > diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h > index 8242a0e..cb19e66 100644 > --- a/include/net/bluetooth/l2cap.h > +++ b/include/net/bluetooth/l2cap.h > @@ -183,6 +183,8 @@ struct l2cap_chan_list { > }; > = > struct l2cap_conn { > + struct list_head list; > + > struct hci_conn *hcon; > = > bdaddr_t *dst; > diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c > index eaaad65..1d1c423 100644 > --- a/net/bluetooth/l2cap.c > +++ b/net/bluetooth/l2cap.c > @@ -63,6 +63,9 @@ static struct bt_sock_list l2cap_sk_list > .lock =3D RW_LOCK_UNLOCKED > }; > = > +static LIST_HEAD(l2cap_conn_list); > +static DEFINE_SPINLOCK(l2cap_conn_lock); > + > static void __l2cap_sock_close(struct sock *sk, int reason); > static void l2cap_sock_close(struct sock *sk); > static void l2cap_sock_kill(struct sock *sk); > @@ -295,6 +298,10 @@ static void l2cap_conn_del(struct hci_co > = > BT_DBG("hcon %p conn %p, err %d", hcon, conn, err); > = > + spin_lock_bh(&l2cap_conn_lock); > + list_del(&conn->list); > + spin_unlock_bh(&l2cap_conn_lock); > + > if (conn->rx_skb) > kfree_skb(conn->rx_skb); > = > @@ -642,18 +649,23 @@ static int l2cap_do_connect(struct sock = > sk->sk_state =3D BT_CONNECT; > l2cap_sock_set_timer(sk, sk->sk_sndtimeo); > = > - if (hcon->state =3D=3D BT_CONNECTED) { > - if (sk->sk_type =3D=3D SOCK_SEQPACKET) { > - struct l2cap_conn_req req; > - l2cap_pi(sk)->ident =3D l2cap_get_ident(conn); > - req.scid =3D __cpu_to_le16(l2cap_pi(sk)->scid); > - req.psm =3D l2cap_pi(sk)->psm; > - l2cap_send_cmd(conn, l2cap_pi(sk)->ident, > - L2CAP_CONN_REQ, sizeof(req), &req); > - } else { > - l2cap_sock_clear_timer(sk); > - sk->sk_state =3D BT_CONNECTED; > - } > + if (hcon->state !=3D BT_CONNECTED) { > + spin_lock_bh(&l2cap_conn_lock); > + list_add_tail(&conn->list, &l2cap_conn_list); > + spin_unlock_bh(&l2cap_conn_lock); > + goto done; > + } > + > + if (sk->sk_type =3D=3D SOCK_SEQPACKET) { > + struct l2cap_conn_req req; > + l2cap_pi(sk)->ident =3D l2cap_get_ident(conn); > + req.scid =3D __cpu_to_le16(l2cap_pi(sk)->scid); > + req.psm =3D l2cap_pi(sk)->psm; > + l2cap_send_cmd(conn, l2cap_pi(sk)->ident, > + L2CAP_CONN_REQ, sizeof(req), &req); > + } else { > + l2cap_sock_clear_timer(sk); > + sk->sk_state =3D BT_CONNECTED; > } > = > done: > @@ -1926,12 +1938,35 @@ static int l2cap_connect_cfm(struct hci_ > if (hcon->type !=3D ACL_LINK) > return 0; > = > - if (!status) { > + switch (status) { > + case 0x00: > conn =3D l2cap_conn_add(hcon, status); > - if (conn) > - l2cap_conn_ready(conn); > - } else > + if (!conn) > + break; > + > + spin_lock_bh(&l2cap_conn_lock); > + list_del(&conn->list); > + spin_unlock_bh(&l2cap_conn_lock); > + > + l2cap_conn_ready(conn); > + > + spin_lock_bh(&l2cap_conn_lock); > + if (!list_empty(&l2cap_conn_list)) { > + conn =3D list_entry(l2cap_conn_list.next, struct l2cap_conn, list); > + list_move_tail(&conn->list, &l2cap_conn_list); > + hci_conn_put(conn->hcon); > + hci_connect(conn->hcon->hdev, ACL_LINK, conn->dst); > + } > + spin_unlock_bh(&l2cap_conn_lock); > + break; > + > + case 0x0c: > + break; > + > + default: > l2cap_conn_del(hcon, bt_err(status)); > + break; > + } > = > return 0; > } > = > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share y= our > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel > = -- = ______________________________ Fabrizio Guglielmino = Infit Srl Software Engineering Tel. +39 11 7410915 Fax. +39 11 7410915 www.infitsrl.com C.so Svizzera, 79/8 - Torino ______________________________ Il presente messaggio ed ogni eventuale allegato hanno natura confidenziale e sono riservati ai destinatari indicati. La diffusione a terzi e qualsiasi altro uso non autorizzato sono proibiti. I messaggi ed i relativi allegati possono essere soggetti ad alterazioni. Il mittente declina ogni responsabilit=E0 per le eventuali alterazioni, modificazioni o falsificazioni. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDE= VDEV _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Bluez-devel] It's rfcomm connect problem [ERRATA] 2006-07-27 9:04 ` Fabrizio Guglielmino @ 2006-07-27 9:25 ` Fabrizio Guglielmino 2006-07-28 11:14 ` [Bluez-devel] It's rfcomm connect problem Marcel Holtmann 1 sibling, 0 replies; 19+ messages in thread From: Fabrizio Guglielmino @ 2006-07-27 9:25 UTC (permalink / raw) To: BlueZ development Kernel is 2.6.12 non .10 ...sorry... Fabrizio Guglielmino ha scritto: > I Marcel, > I'm trying to use the patch to handle multiple l2cap connection, I'm = > not a kernel/modules expert developer so > I need a little help. > Firts I'm trying to understand what the patch do and I think it's = > clear (is used a linked list to handle multiple connection). > > My problems are with kernel programming enviromnment: > > 1) I'm using kernel-2.6.10 I have to update to a more recent version? > > 2) Is there some documentation about bluez kernel modules? I need to = > understand how modules works to make try to make the patch. > > Many thanks > Fabrizio > > > Marcel Holtmann ha scritto: >> Hi Fabrizio, >> >> = >>> Last solutions it's to see at l2cap layer and try to understand ho = >>> wo write the patch, if >>> I will succeed to find the past Marcel's thread about it I'll try = >>> to write this patch. >>> = >> >> it must look something like the attached one. However that one might >> crash your machine. >> >> Regards >> >> Marcel >> >> = >> ------------------------------------------------------------------------ >> >> diff --git a/include/net/bluetooth/l2cap.h = >> b/include/net/bluetooth/l2cap.h >> index 8242a0e..cb19e66 100644 >> --- a/include/net/bluetooth/l2cap.h >> +++ b/include/net/bluetooth/l2cap.h >> @@ -183,6 +183,8 @@ struct l2cap_chan_list { >> }; >> = >> struct l2cap_conn { >> + struct list_head list; >> + >> struct hci_conn *hcon; >> = >> bdaddr_t *dst; >> diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c >> index eaaad65..1d1c423 100644 >> --- a/net/bluetooth/l2cap.c >> +++ b/net/bluetooth/l2cap.c >> @@ -63,6 +63,9 @@ static struct bt_sock_list l2cap_sk_list >> .lock =3D RW_LOCK_UNLOCKED >> }; >> = >> +static LIST_HEAD(l2cap_conn_list); >> +static DEFINE_SPINLOCK(l2cap_conn_lock); >> + >> static void __l2cap_sock_close(struct sock *sk, int reason); >> static void l2cap_sock_close(struct sock *sk); >> static void l2cap_sock_kill(struct sock *sk); >> @@ -295,6 +298,10 @@ static void l2cap_conn_del(struct hci_co >> = >> BT_DBG("hcon %p conn %p, err %d", hcon, conn, err); >> = >> + spin_lock_bh(&l2cap_conn_lock); >> + list_del(&conn->list); >> + spin_unlock_bh(&l2cap_conn_lock); >> + >> if (conn->rx_skb) >> kfree_skb(conn->rx_skb); >> = >> @@ -642,18 +649,23 @@ static int l2cap_do_connect(struct sock = >> sk->sk_state =3D BT_CONNECT; >> l2cap_sock_set_timer(sk, sk->sk_sndtimeo); >> = >> - if (hcon->state =3D=3D BT_CONNECTED) { >> - if (sk->sk_type =3D=3D SOCK_SEQPACKET) { >> - struct l2cap_conn_req req; >> - l2cap_pi(sk)->ident =3D l2cap_get_ident(conn); >> - req.scid =3D __cpu_to_le16(l2cap_pi(sk)->scid); >> - req.psm =3D l2cap_pi(sk)->psm; >> - l2cap_send_cmd(conn, l2cap_pi(sk)->ident, >> - L2CAP_CONN_REQ, sizeof(req), &req); >> - } else { >> - l2cap_sock_clear_timer(sk); >> - sk->sk_state =3D BT_CONNECTED; >> - } >> + if (hcon->state !=3D BT_CONNECTED) { >> + spin_lock_bh(&l2cap_conn_lock); >> + list_add_tail(&conn->list, &l2cap_conn_list); >> + spin_unlock_bh(&l2cap_conn_lock); >> + goto done; >> + } >> + >> + if (sk->sk_type =3D=3D SOCK_SEQPACKET) { >> + struct l2cap_conn_req req; >> + l2cap_pi(sk)->ident =3D l2cap_get_ident(conn); >> + req.scid =3D __cpu_to_le16(l2cap_pi(sk)->scid); >> + req.psm =3D l2cap_pi(sk)->psm; >> + l2cap_send_cmd(conn, l2cap_pi(sk)->ident, >> + L2CAP_CONN_REQ, sizeof(req), &req); >> + } else { >> + l2cap_sock_clear_timer(sk); >> + sk->sk_state =3D BT_CONNECTED; >> } >> = >> done: >> @@ -1926,12 +1938,35 @@ static int l2cap_connect_cfm(struct hci_ >> if (hcon->type !=3D ACL_LINK) >> return 0; >> = >> - if (!status) { >> + switch (status) { >> + case 0x00: >> conn =3D l2cap_conn_add(hcon, status); >> - if (conn) >> - l2cap_conn_ready(conn); >> - } else >> + if (!conn) >> + break; >> + >> + spin_lock_bh(&l2cap_conn_lock); >> + list_del(&conn->list); >> + spin_unlock_bh(&l2cap_conn_lock); >> + >> + l2cap_conn_ready(conn); >> + >> + spin_lock_bh(&l2cap_conn_lock); >> + if (!list_empty(&l2cap_conn_list)) { >> + conn =3D list_entry(l2cap_conn_list.next, struct = >> l2cap_conn, list); >> + list_move_tail(&conn->list, &l2cap_conn_list); >> + hci_conn_put(conn->hcon); >> + hci_connect(conn->hcon->hdev, ACL_LINK, conn->dst); >> + } >> + spin_unlock_bh(&l2cap_conn_lock); >> + break; >> + >> + case 0x0c: >> + break; >> + >> + default: >> l2cap_conn_del(hcon, bt_err(status)); >> + break; >> + } >> = >> return 0; >> } >> = >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------= - = >> >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to = >> share your >> opinions on IT & business topics through brief surveys -- and earn cash >> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID= =3DDEVDEV = >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Bluez-devel mailing list >> Bluez-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/bluez-devel >> = > > -- = ______________________________ Fabrizio Guglielmino = Infit Srl Software Engineering Tel. +39 11 7410915 Fax. +39 11 7410915 www.infitsrl.com C.so Svizzera, 79/8 - Torino ______________________________ Il presente messaggio ed ogni eventuale allegato hanno natura confidenziale e sono riservati ai destinatari indicati. La diffusione a terzi e qualsiasi altro uso non autorizzato sono proibiti. I messaggi ed i relativi allegati possono essere soggetti ad alterazioni. Il mittente declina ogni responsabilit=E0 per le eventuali alterazioni, modificazioni o falsificazioni. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDE= VDEV _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Bluez-devel] It's rfcomm connect problem 2006-07-27 9:04 ` Fabrizio Guglielmino 2006-07-27 9:25 ` [Bluez-devel] It's rfcomm connect problem [ERRATA] Fabrizio Guglielmino @ 2006-07-28 11:14 ` Marcel Holtmann 2006-07-31 10:02 ` [Bluez-devel] About l2cap patch to handle multiple connections Fabrizio Guglielmino 1 sibling, 1 reply; 19+ messages in thread From: Marcel Holtmann @ 2006-07-28 11:14 UTC (permalink / raw) To: BlueZ development Hi Fabrizio, > I'm trying to use the patch to handle multiple l2cap connection, I'm not > a kernel/modules expert developer so > I need a little help. > Firts I'm trying to understand what the patch do and I think it's clear > (is used a linked list to handle multiple connection). one warning up-front. I never actually ran this patch on any machine. It is only compile tested. So it might crash your system. > My problems are with kernel programming enviromnment: > > 1) I'm using kernel-2.6.10 I have to update to a more recent version? It might work, but I advise you to develop against 2.6.18-rc2 or even the Git repository from Linus. > 2) Is there some documentation about bluez kernel modules? I need to > understand how modules works to make try to make the patch. Check out the kernel documentation itself. There exists no specific BlueZ documentation for kernel programming. Regards Marcel ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bluez-devel] About l2cap patch to handle multiple connections.... 2006-07-28 11:14 ` [Bluez-devel] It's rfcomm connect problem Marcel Holtmann @ 2006-07-31 10:02 ` Fabrizio Guglielmino 2006-07-31 14:14 ` Marcel Holtmann 0 siblings, 1 reply; 19+ messages in thread From: Fabrizio Guglielmino @ 2006-07-31 10:02 UTC (permalink / raw) To: BlueZ development Hi I'm trying to play with the patch to make it work (as Marcel said it = hangs my machine). First I'm trying a simple debug by printing to find where it hangs... There is a first question about this: various BT_DBG statements that = print bluetooth address in string format (using batostr) print them in reverse = order(00:01:02.... is printed 02:01:00). My test machine is a powerpc based mac, I've used in user-space the = ba2str without problems in same architecture so I'm confused about this. An other dubt is about following log : Jul 31 10:36:39 localhost kernel: [ 596.604617] Bluetooth: = 00:00:00:00:00:00 -> 44:53:25:E3:01:00 psm 0x300 Jul 31 10:36:39 localhost kernel: [ 596.606752] Bluetooth: = 00:00:00:00:00:00 -> 20:68:2A:2D:09:00 psm 0x300 (address are in reverse order as I said above) Why psm is 0x300? May be also the psm in reverse order and really it's = 0x003 (RFCOMM) as I would have expected ? Many thanks Fabrizio Marcel Holtmann ha scritto: > Hi Fabrizio, > > = >> I'm trying to use the patch to handle multiple l2cap connection, I'm not = >> a kernel/modules expert developer so >> I need a little help. >> Firts I'm trying to understand what the patch do and I think it's clear = >> (is used a linked list to handle multiple connection). >> = > > one warning up-front. I never actually ran this patch on any machine. It > is only compile tested. So it might crash your system. > > = >> My problems are with kernel programming enviromnment: >> >> 1) I'm using kernel-2.6.10 I have to update to a more recent version? >> = > > It might work, but I advise you to develop against 2.6.18-rc2 or even > the Git repository from Linus. > > = >> 2) Is there some documentation about bluez kernel modules? I need to = >> understand how modules works to make try to make the patch. >> = > > Check out the kernel documentation itself. There exists no specific > BlueZ documentation for kernel programming. > > Regards > > Marcel > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share y= our > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel > > > = -- = ______________________________ Fabrizio Guglielmino = Infit Srl Software Engineering Tel. +39 11 7410915 Fax. +39 11 7410915 www.infitsrl.com C.so Svizzera, 79/8 - Torino ______________________________ Il presente messaggio ed ogni eventuale allegato hanno natura confidenziale e sono riservati ai destinatari indicati. La diffusione a terzi e qualsiasi altro uso non autorizzato sono proibiti. I messaggi ed i relativi allegati possono essere soggetti ad alterazioni. Il mittente declina ogni responsabilit=E0 per le eventuali alterazioni, modificazioni o falsificazioni. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDE= VDEV _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Bluez-devel] About l2cap patch to handle multiple connections.... 2006-07-31 10:02 ` [Bluez-devel] About l2cap patch to handle multiple connections Fabrizio Guglielmino @ 2006-07-31 14:14 ` Marcel Holtmann 2006-08-02 11:24 ` Fabrizio Guglielmino 0 siblings, 1 reply; 19+ messages in thread From: Marcel Holtmann @ 2006-07-31 14:14 UTC (permalink / raw) To: BlueZ development Hi Fabrizio, > Hi I'm trying to play with the patch to make it work (as Marcel said it > hangs my machine). > > First I'm trying a simple debug by printing to find where it hangs... > > There is a first question about this: various BT_DBG statements that > print bluetooth address > in string format (using batostr) print them in reverse > order(00:01:02.... is printed 02:01:00). > My test machine is a powerpc based mac, I've used in user-space the > ba2str without problems in same architecture > so I'm confused about this. this is normal. We don't bother to swap the address for the debug messages. In Bluetooth the address is always used in the reversed order, but for the human eyes it is swapped. > An other dubt is about following log : > > Jul 31 10:36:39 localhost kernel: [ 596.604617] Bluetooth: > 00:00:00:00:00:00 -> 44:53:25:E3:01:00 psm 0x300 > Jul 31 10:36:39 localhost kernel: [ 596.606752] Bluetooth: > 00:00:00:00:00:00 -> 20:68:2A:2D:09:00 psm 0x300 > (address are in reverse order as I said above) > > Why psm is 0x300? May be also the psm in reverse order and really it's > 0x003 (RFCOMM) as I would have expected ? This looks like a big endian bug. The PSM value is in little endian order. Regards Marcel ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Bluez-devel] About l2cap patch to handle multiple connections.... 2006-07-31 14:14 ` Marcel Holtmann @ 2006-08-02 11:24 ` Fabrizio Guglielmino 2006-08-02 13:43 ` Marcel Holtmann 0 siblings, 1 reply; 19+ messages in thread From: Fabrizio Guglielmino @ 2006-08-02 11:24 UTC (permalink / raw) To: BlueZ development I have not made great progresses but I try to explain them looking some one can help me. System hangs after l2cap_connect_cfm function, this is called for every device to which I try to connect to (in my case only 2). In non-patched version of l2cap_connect_cfm there was a call to l2cap_conn_ready if status was 0x00 on a valid conn. In patched version l2cap_conn_ready is no more called. l2cap_conn_ready it seems to execute the l2cap connection request so is this a forgetfulness? I've try to insert the call but without success (system hangs again) so if the response to previous question is true this is not the only problem. I hope someone (more expert of me on this layer) can help to make me to work this patch. thanks Fabrizio Marcel Holtmann ha scritto: > Hi Fabrizio, > > >> Hi I'm trying to play with the patch to make it work (as Marcel said it >> hangs my machine). >> >> First I'm trying a simple debug by printing to find where it hangs... >> >> There is a first question about this: various BT_DBG statements that >> print bluetooth address >> in string format (using batostr) print them in reverse >> order(00:01:02.... is printed 02:01:00). >> My test machine is a powerpc based mac, I've used in user-space the >> ba2str without problems in same architecture >> so I'm confused about this. >> > > this is normal. We don't bother to swap the address for the debug > messages. In Bluetooth the address is always used in the reversed order, > but for the human eyes it is swapped. > > >> An other dubt is about following log : >> >> Jul 31 10:36:39 localhost kernel: [ 596.604617] Bluetooth: >> 00:00:00:00:00:00 -> 44:53:25:E3:01:00 psm 0x300 >> Jul 31 10:36:39 localhost kernel: [ 596.606752] Bluetooth: >> 00:00:00:00:00:00 -> 20:68:2A:2D:09:00 psm 0x300 >> (address are in reverse order as I said above) >> >> Why psm is 0x300? May be also the psm in reverse order and really it's >> 0x003 (RFCOMM) as I would have expected ? >> > > This looks like a big endian bug. The PSM value is in little endian > order. > > Regards > > Marcel > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Bluez-devel mailing list > Bluez-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bluez-devel > > > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Bluez-devel] About l2cap patch to handle multiple connections.... 2006-08-02 11:24 ` Fabrizio Guglielmino @ 2006-08-02 13:43 ` Marcel Holtmann 0 siblings, 0 replies; 19+ messages in thread From: Marcel Holtmann @ 2006-08-02 13:43 UTC (permalink / raw) To: BlueZ development Hi Fabrizio, > I have not made great progresses but I try to explain them looking some > one can help me. > System hangs after l2cap_connect_cfm function, this is called for every > device to which I try to connect to (in my case only 2). > > In non-patched version of l2cap_connect_cfm there was a call to > l2cap_conn_ready if status was 0x00 on a valid conn. > In patched version l2cap_conn_ready is no more called. l2cap_conn_ready > it seems to execute the l2cap connection request so is > this a forgetfulness? I've try to insert the call but without success > (system hangs again) so if the response to previous question is true this > is not the only problem. the call to l2cap_conn_ready() is still there. Check the code in more detail. Actually the code after l2cap_conn_read() to find the next pending ACL connection might be the problem. Regards Marcel ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2006-08-02 13:43 UTC | newest] Thread overview: 19+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-07-19 16:28 [Bluez-devel] Error: sdptool browse --> Connection reset by peer JP Freeley 2006-07-20 0:48 ` Marcel Holtmann 2006-07-20 21:27 ` JP Freeley 2006-07-25 4:26 ` JP Freeley 2006-07-22 14:08 ` [Bluez-devel] It's rfcomm connect problem Fabrizio Guglielmino 2006-07-24 8:38 ` Andreas Gaufer 2006-07-24 13:33 ` Fabrizio Guglielmino 2006-07-24 13:56 ` Andreas Gaufer 2006-07-24 16:35 ` Marcel Holtmann 2006-07-24 18:34 ` Andreas Gaufer 2006-07-24 20:30 ` Fabrizio Guglielmino 2006-07-24 21:12 ` Marcel Holtmann 2006-07-27 9:04 ` Fabrizio Guglielmino 2006-07-27 9:25 ` [Bluez-devel] It's rfcomm connect problem [ERRATA] Fabrizio Guglielmino 2006-07-28 11:14 ` [Bluez-devel] It's rfcomm connect problem Marcel Holtmann 2006-07-31 10:02 ` [Bluez-devel] About l2cap patch to handle multiple connections Fabrizio Guglielmino 2006-07-31 14:14 ` Marcel Holtmann 2006-08-02 11:24 ` Fabrizio Guglielmino 2006-08-02 13:43 ` Marcel Holtmann
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox