forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bluetooth: L2CAP: Prepend SDU header immediately
Previously it was not always possible to prepend the header. It was not possible if the application neglected to reserve the space for headers. This is bad because it forces a buffer segment allocation even if the buffer had enough room for the headers. E.g. a payload of 10 bytes in a netbuf of 30 bytes would have been segmented. We now explicitly reject the buffer if it does not have the headroom. This allows us to do a nice thing; simplify L2CAP segmentation. We convert the SDU from the application into a PDU payload, by prepending the SDU header, i.e. the SDU length in the original buffer. This PDU payload is ready to be chunked into PDUs without having to keep track of where in the SDU we are. This has the effect of removing a bunch of logic in the segmentation machine. Signed-off-by: Jonathan Rico <[email protected]> Signed-off-by: Aleksander Wasaznik <[email protected]>
- Loading branch information
1 parent
6e8c8a1
commit 38c39af
Showing
6 changed files
with
52 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters