Linux bluetooth development
 help / color / mirror / Atom feed
* [Bluez-devel] L2CAP: ECONNRESET is set for every l2cap disconnect.
@ 2007-03-28 15:27 Aarti Kumar
  2007-03-31 13:55 ` Marcel Holtmann
  0 siblings, 1 reply; 3+ messages in thread
From: Aarti Kumar @ 2007-03-28 15:27 UTC (permalink / raw)
  To: Bluez-devel

I am sure if this issue has been discussed before or
not. 

Is it necessary to the set the struct sock->err value
to ECONNRESET when l2cap disconnect request is
received from remote device ?

l2cap_disconnect_req function sets the error value in
sock structure by calling l2cap_chan_del(sk,
ECONNRESET) every time l2cap connection is
disconnected.

This might lead to some loss of data at receiver side
in case of fast sender and slow receiver. 

The sender will send l2cap packets and disconnects. 

The receiver side will read the packets, but once
l2cap disconnect is received, even though there is
data in sk_buff, the bt_sock_recvmsg will return 0 as
skb_recv_datagram will return NULL. 

Can we set the value to ECONNRESET only in case of
error condition and for the normal disconnect set it
to 0 by calling l2cap_chan_del(sk,0) from
l2cap_disconnect_req ?

So if error field is not set in sock structure,
bt_sock_recvmsg will return data bytes till sk_buff is
empty and which case 0 will be returned. This will
prevent any data loss.

Also if the user wants to know when socket
disconnected, POLLHUP will be set for sock fd so after
disconnect happens and there is data to be read both
POLLHUP and POLLIN will set.
If we set sock err field then user will not be able to
retrieve data from sk_buff, even if POLLLIN is set.

I am using 2.6 kernel.

Thanks,
Aarti.






 
____________________________________________________________________________________
Finding fabulous fares is fun.  
Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains.
http://farechase.yahoo.com/promo-generic-14795097

-------------------------------------------------------------------------
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] 3+ messages in thread
* Re: [Bluez-devel] hcid returning "Device or resource busy"?
@ 2007-03-28 13:20 Marcel Holtmann
  2007-03-28 15:05 ` [Bluez-devel] L2CAP: ECONNRESET is set for every l2cap disconnect Aarti Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Marcel Holtmann @ 2007-03-28 13:20 UTC (permalink / raw)
  To: BlueZ development

Hi Bastien,

> > the problem is that the baseband is busy with the remote name request.
> > It has to page the remote device for getting the name and in that case
> > you simply can't run an inquiry. All currently available Bluetooth chips
> > have this limitation.
> > 
> > Main question is why we have the remote name request just before you
> > wanna start the inquiry. What D-Bus methods are you actually calling in
> > what order? I think you constructed a use case that we never tested.
> 
> The code is fairly straight forward. See:
> http://svn.gnome.org/viewcvs/nautilus-sendto/trunk/src/plugins/bluetooth.c?view=markup
> 
> The code first does a ListRemoteDevices (to list all the known, visible,
> etc.) devices in add_known_devices_to_list(), and then runs an discovery
> using DiscoverDevices in start_device_scanning().
> 
> Nothing mind blowing. I want to show all the known devices first (ie.
> the ones in the databases), and then add the devices
> visible/discoverable when the application is launched.
> 
> Is ListRemoteDevices actually doing anything on the HCI? I was under the
> impression that it should only pull items from the disk...

I almost guessed it. The ListRemoteDevices is not the problem the
GetRemoteName is the tricky part here. If the name is not in the cache
it tries to resolve it and this causes the baseband page which will
block the inquiry call.

You can wait for the completed RemoteNameUpdated or RemoteNameFailed
signals before actually starting the DiscoverDevices procedure. However
in case of devices out of range this might not be a good idea.

Let me discuss this through with the others. Feel free to hop onto
#bluez at Freenode.

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] 3+ messages in thread

end of thread, other threads:[~2007-03-31 13:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-28 15:27 [Bluez-devel] L2CAP: ECONNRESET is set for every l2cap disconnect Aarti Kumar
2007-03-31 13:55 ` Marcel Holtmann
  -- strict thread matches above, loose matches on Subject: below --
2007-03-28 13:20 [Bluez-devel] hcid returning "Device or resource busy"? Marcel Holtmann
2007-03-28 15:05 ` [Bluez-devel] L2CAP: ECONNRESET is set for every l2cap disconnect Aarti Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox