History log of /haiku/src/add-ons/kernel/network/protocols/l2cap/l2cap_signal.cpp
Revision Date Author Comments
# 91e6e521 30-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 and kallisti5. Outgoing connections,
at least, manage to fully initialize and configure
successfully.


# 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.


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

l2cap: Fix x86_64 build and refactor trace


# 8638173c 12-Jul-2010 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

- Implementation for sendto() & close(), tested over a Motorola V5
- Incomming command rejections not yet properly handled.



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


# ef36d964 11-Jul-2010 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

- Implement hook Connect()
- Polish l2cap signals negotiation



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


# a5bf1237 14-Jun-2010 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

*Incorrect endianess handling from bdaddr at parsing from string.
*Remove bluetooth_util deprecated header
*Issue conn_req for socket connect() call



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37132 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


# a58b3b32 27-Sep-2009 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

Implement a bit further the sockets interface

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


# 61252f51 03-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

* Fixed the build and ticket #3515 (multi-line string).
* Automatic white space cleanup.


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


# 8a32045b 21-Dec-2008 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

Fix Null access at request ident, reported by Mika Lindqvist

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


# 7cc7cada 27-Nov-2008 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

- Implement signaling req/rsp
- Deliver Connection Oriented packets
- Complete the l2cap upper layers
- Basic interaction with sockets
- Implement thead at this layer for TX



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


# b9b8d43c 14-Oct-2008 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

Current L2CAP code. Replying ConnectionResponses signals. The style should be more acurate than my previous commits(so use this commit to correct my remaining bad habits). The Code is not completed but need to commit to have a chance to go on from Germany....

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


# 8638173cff5388cb3bbbc67e7d77977d1f69eb03 12-Jul-2010 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

- Implementation for sendto() & close(), tested over a Motorola V5
- Incomming command rejections not yet properly handled.



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


# ef36d9649647a658fecd9053b90252ee0d2f2381 11-Jul-2010 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

- Implement hook Connect()
- Polish l2cap signals negotiation



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


# a5bf12376daeded4049521eb17a6cc41192250d9 14-Jun-2010 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

*Incorrect endianess handling from bdaddr at parsing from string.
*Remove bluetooth_util deprecated header
*Issue conn_req for socket connect() call



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37132 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


# a58b3b32350051afd1b2d40541550ba9272cd96e 27-Sep-2009 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

Implement a bit further the sockets interface

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


# 61252f516cd77ecf6667e2ac8f10748873216ce8 03-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

* Fixed the build and ticket #3515 (multi-line string).
* Automatic white space cleanup.


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


# 8a32045bf6fdf5b241aa1c09c089b7d6943b6b04 21-Dec-2008 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

Fix Null access at request ident, reported by Mika Lindqvist

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


# 7cc7cada6a78b0f0a38da5dea553de57de73b899 27-Nov-2008 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

- Implement signaling req/rsp
- Deliver Connection Oriented packets
- Complete the l2cap upper layers
- Basic interaction with sockets
- Implement thead at this layer for TX



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


# b9b8d43c57b4b1a61483f5d70942aec84b68712d 14-Oct-2008 Oliver Ruiz Dorantes <oliver.ruiz.dorantes@gmail.com>

Current L2CAP code. Replying ConnectionResponses signals. The style should be more acurate than my previous commits(so use this commit to correct my remaining bad habits). The Code is not completed but need to commit to have a chance to go on from Germany....

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