Skip to content

6lo gnrc fragmentation expects driver to block on TX #7474

Closed
@jnohlgard

Description

The 6lowpan fragmentation code in gnrc doesn't work when a driver returns an error code if the device is already busy transmitting another packet, instead of blocking the driver thread. This is the case for kw2xrf (#4822) and kw41zrf.
The at86rf2xx driver works with gnrc, but it uses a busy wait until the device reports that it is idle, wasting CPU cycles on doing nothing but reading the spi bus over and over.
The netdev api documentation does not give a clear description which behaviour is correct. It just says that the send method shall return <0 on error, without specifying what should be considered an error.
Either the netdev api documentation needs to be updated to explicitly say that the driver should block if the device is busy, or the gnrc fragmentation code needs to be improved.
Also, it seems like the return value from netdev send is discarded by gnrc, so it doesn't seem to really matter what the driver does on errors.

PS I am working on a solution for the kw41zrf using a mutex to make the thread sleep while waiting for TX to finish, just to get this working properly for a project, but it won't exactly be what I would call a clean solution.

Metadata

Labels

Area: driversArea: Device driversArea: networkArea: NetworkingType: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)Type: questionThe issue poses a question regarding usage of RIOT

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions