Skip to content

Bluetooth: L2CAP: always send from workqueue#67528

Merged
carlescufi merged 2 commits intozephyrproject-rtos:mainfrom
jori-nordic:l2cap-send-from-wq
Jan 17, 2024
Merged

Bluetooth: L2CAP: always send from workqueue#67528
carlescufi merged 2 commits intozephyrproject-rtos:mainfrom
jori-nordic:l2cap-send-from-wq

Conversation

@jori-nordic
Copy link
Copy Markdown
Contributor

Always pull from the channel queue from the system workqueue context.
This simplifies debugging.

This also allows us to remove sent from the metadata struct.

Stacked on #67526

alwa-nordic
alwa-nordic previously approved these changes Jan 16, 2024
Separate most of the param checking in `bt_l2cap_chan_send()`, with the
logic in `bt_l2cap_dyn_chan_send()`.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Always pull from the channel queue from the system workqueue context.
This simplifies debugging.

This also allows us to remove `sent` from the metadata struct.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
@carlescufi carlescufi merged commit 81d524d into zephyrproject-rtos:main Jan 17, 2024
PavelVPV added a commit to PavelVPV/zephyr that referenced this pull request Apr 2, 2025
`>= 0` was used when EATT support was implemented (zephyrproject-rtos#23199). After
\zephyrproject-rtos#67528, `bt_l2cap_chan_send` doesn't return amount of bytes sent, but
either 0 or negative value. Thus `>= 0` is not needed. It also
confusing when reading code.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
PavelVPV added a commit to PavelVPV/zephyr that referenced this pull request Apr 2, 2025
`>= 0` was used when EATT support was implemented (zephyrproject-rtos#23199). After
PR zephyrproject-rtos#67528, `bt_l2cap_chan_send` doesn't return amount of bytes sent or
any positive value, but either 0 or negative value. Thus `>= 0` is not
needed. It also confusing when reading code, especially when the same
check is not implemented in other cases where underlying function
`chan_send` is used.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
PavelVPV added a commit to PavelVPV/zephyr that referenced this pull request Apr 2, 2025
`>= 0` was used when EATT support was implemented (zephyrproject-rtos#23199) because
`bt_l2cap_chan_send` could return number of bytes sent. After PR zephyrproject-rtos#67528,
`bt_l2cap_chan_send` doesn't return amount of bytes sent or any positive
value, but either 0 or negative value. Thus `>= 0` is not needed. It
also confusing when reading code, especially when the same check is not
implemented in other cases where underlying function `chan_send` is
used.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
PavelVPV added a commit to PavelVPV/zephyr that referenced this pull request Apr 3, 2025
`>= 0` was used when EATT support was implemented (zephyrproject-rtos#23199) because
`bt_l2cap_chan_send` could return number of bytes sent. After PR zephyrproject-rtos#67528,
`bt_l2cap_chan_send` doesn't return amount of bytes sent or any positive
value, but either 0 or negative value. Thus `>= 0` is not needed. It
also confusing when reading code, especially when the same check is not
implemented in other cases where underlying function `chan_send` is
used.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
PavelVPV added a commit to PavelVPV/zephyr that referenced this pull request Apr 3, 2025
`>= 0` was used when EATT support was implemented (zephyrproject-rtos#23199) because
`bt_l2cap_chan_send` could return number of bytes sent. After PR zephyrproject-rtos#67528,
`bt_l2cap_chan_send` doesn't return amount of bytes sent or any positive
value, but either 0 or negative value. Thus `>= 0` is not needed. It
also confusing when reading code, especially when the same check is not
implemented in other cases where underlying function `chan_send` is
used.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
PavelVPV added a commit to PavelVPV/zephyr that referenced this pull request Apr 3, 2025
`>= 0` was used when EATT support was implemented (zephyrproject-rtos#23199) because
`bt_l2cap_chan_send` could return number of bytes sent. After PR zephyrproject-rtos#67528,
`bt_l2cap_chan_send` doesn't return amount of bytes sent or any positive
value, but either 0 or negative value. Thus `>= 0` is not needed. It
also confusing when reading code, especially when the same check is not
implemented in other cases where underlying function `chan_send` is
used.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
kartben pushed a commit that referenced this pull request Apr 7, 2025
`>= 0` was used when EATT support was implemented (#23199) because
`bt_l2cap_chan_send` could return number of bytes sent. After PR #67528,
`bt_l2cap_chan_send` doesn't return amount of bytes sent or any positive
value, but either 0 or negative value. Thus `>= 0` is not needed. It
also confusing when reading code, especially when the same check is not
implemented in other cases where underlying function `chan_send` is
used.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
abrarnasirjaffari pushed a commit to abrarnasirjaffari/zephyr that referenced this pull request Apr 9, 2025
`>= 0` was used when EATT support was implemented (zephyrproject-rtos#23199) because
`bt_l2cap_chan_send` could return number of bytes sent. After PR zephyrproject-rtos#67528,
`bt_l2cap_chan_send` doesn't return amount of bytes sent or any positive
value, but either 0 or negative value. Thus `>= 0` is not needed. It
also confusing when reading code, especially when the same check is not
implemented in other cases where underlying function `chan_send` is
used.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Bluetooth Host Bluetooth Host (excluding BR/EDR) area: Bluetooth

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants