History log of /haiku/src/add-ons/kernel/bluetooth/btCoreData/BTCoreData.cpp
Revision Date Author Comments
# bb83316a 26-Apr-2024 Augustin Cavalier <waddlesplash@gmail.com>

L2CAP: Major refactor of the whole component.

(And surrounding portions of the "btCoreData" module.)

* Rewrote the main "l2cap.h" header representing protocol constants
and structures. Now conforms to general Haiku naming conventions
rather than BSD ones. Some more constants added/removed based
on the most recent Bluetooth specification.

* Rewrote all code derived from the BSDs to match Haiku conventions
and structures in the driver.

* Dropped the "channel" and "frame" structures from "btCoreData".
Channels are now managed by L2capEndpoints, and "frames" are
now just plain net_buffers without surrounding structures.
This also makes state management much simpler.

* Made it so that actual net_buffers are passed through to the
l2cap_receive function rather than another data structure.
A fake interface address is used to communicate connection
information. (This probably ought to be changed, though.)

* Get rid of l2cap_lower and l2cap_upper abstractions.
Everything related to channel/endpoint management is now
done in L2capEndpoint, while buffer reception is handled
directly in l2cap_receive and elsewhere, same as other drivers.

* Wire up more hooks and fix module flags (needed to be able to
get the module loaded and opening sockets at all.)

* Implement an actual locking strategy in L2capEndpoint
and HciConnection. There's still problems with lifetime
management, but at least thread-safety is mostly handled.

* Create an L2capEndpointManager and use it to manage
the endpoints, rather than having a single (unsafe)
linked-list.

And plenty of other refactorings and cleanups besides.
There's still more to be done for Bluetooth overall, though:

* The "btCoreData" and "hci" modules also badly need a major
overhaul, and should be merged into a single "bluetooth"
bus_manager. They also shouldn't be passing around pointers
to other modules like this.

* There's a number of TODOs/FIXMEs in the L2CAP module, most
notably around timeouts (especially command timeouts) and
parameter validation/specification.

Tested by myself with kallisti5's help. Incoming connections
(on the PSM for SDP) get all the way to the latter half
of the Configuration step before hanging.


# 1f2fa6cd 09-Apr-2016 Alexander von Gluck IV <kallisti5@unixzen.com>

bluetooth: Refactor debugging and trace calls

* The old debug system was too complex and made
troubleshooring difficult. (it also was unique
like a snowflake... which we don't want)
* Move to the classic TRACE / ERROR a large majority
of the code has changed to.
* I like trace statements, but drop some obvious ones
* Fix style issues along the way


# ebffd5b1 09-Apr-2016 Alexander von Gluck IV <kallisti5@unixzen.com>

bluetooth/btCoreData: Add missing api_version


# 73e3d8d2 09-Apr-2016 Alexander von Gluck IV <kallisti5@unixzen.com>

bluetooth/btCoreData: x86_64 build fixes


# 94817d60 24-Jun-2015 Philippe Saint-Pierre <stpere@gmail.com>

Coding style fixes


# 269ebc04 19-Aug-2010 Oliver Tappe <zooey@hirschkaefer.de>

Fix #6373, second try
* make BDADDR_* macros refer to value types instead of addresses
* adjust all interfaces using bdaddr_t* to use (mostly const) refs instead,
which IMHO makes the interface & code clearer
* that got rid of a couple of const incorrectness casts
* some cleanup along the way


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38265 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9760dcae 17-Jan-2010 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

- Move bluetooth net_device module to a independent module HCI, remake API interfaces
- Move functionality for assembling ACL/events packets of the driver to this module
- Move h2generic driver to c++ (not style)
- Pass checkstyle.py to all commited files.
Fixes:
- Wrong condition for finishing l2cap packet segmentation.
- Place NetBuffersPrependers in a inner scope to avoid Sycing twice in destructor.
- Avoid keeping trace of l2cap responses of any other kind of thread.
- Do not free net_buffers of for Frame containers.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35117 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 31f87630 28-Nov-2009 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

- Proper implementation of accept/bind l2cap socket interface
- Add more debug info for the KDL debug command
- Request channel pointer also for non l2cap signal frames
- Add locks for packet queues



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34333 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e572eeaa 07-Apr-2009 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

Fix build, due Count/Size change in 29979

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30005 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 18c7aa0c 25-Nov-2008 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

- Add bluetooth kernel module intented to manage all internal data structures
-Managing for HCI connections
-Managing of L2cap Channels
-Pending frames
-Interface with KDL



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28726 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 94817d608db39e49b74c9bb49e195c412f0e4111 24-Jun-2015 Philippe Saint-Pierre <stpere@gmail.com>

Coding style fixes


# 269ebc04b9082e0081f3660bd727d9a6bc4a683d 19-Aug-2010 Oliver Tappe <zooey@hirschkaefer.de>

Fix #6373, second try
* make BDADDR_* macros refer to value types instead of addresses
* adjust all interfaces using bdaddr_t* to use (mostly const) refs instead,
which IMHO makes the interface & code clearer
* that got rid of a couple of const incorrectness casts
* some cleanup along the way


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38265 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9760dcae2038d47442f4658c2575844c6cf92c40 17-Jan-2010 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

- Move bluetooth net_device module to a independent module HCI, remake API interfaces
- Move functionality for assembling ACL/events packets of the driver to this module
- Move h2generic driver to c++ (not style)
- Pass checkstyle.py to all commited files.
Fixes:
- Wrong condition for finishing l2cap packet segmentation.
- Place NetBuffersPrependers in a inner scope to avoid Sycing twice in destructor.
- Avoid keeping trace of l2cap responses of any other kind of thread.
- Do not free net_buffers of for Frame containers.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35117 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 31f876303149dde3ca6e1abe6300963311659710 28-Nov-2009 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

- Proper implementation of accept/bind l2cap socket interface
- Add more debug info for the KDL debug command
- Request channel pointer also for non l2cap signal frames
- Add locks for packet queues



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34333 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e572eeaab4611e59227da64dfe6f024a4b50c989 07-Apr-2009 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

Fix build, due Count/Size change in 29979

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30005 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 18c7aa0c9d1c6593c7c5d14a322562bb2fad3721 25-Nov-2008 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

- Add bluetooth kernel module intented to manage all internal data structures
-Managing for HCI connections
-Managing of L2cap Channels
-Pending frames
-Interface with KDL



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28726 a95241bf-73f2-0310-859d-f6bbb57e9c96