net: mac802154: Follow the count of ongoing transmissions
authorMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 19 May 2022 15:05:09 +0000 (17:05 +0200)
committerStefan Schmidt <stefan@datenfreihafen.org>
Fri, 10 Jun 2022 07:48:40 +0000 (09:48 +0200)
commitbde000ae459f2829ed88e967f7fa7665b4e3afaf
treea226648bb9b839989a52bdfe56f6f9c158ca159a
parentd08d951a9ae7e30fc0421a1af2b4193ce4aa6b3e
net: mac802154: Follow the count of ongoing transmissions

In order to create a synchronous API for MLME command purposes, we need
to be able to track the end of the ongoing transmissions. Let's
introduce an atomic variable which is incremented when a transmission
starts and decremented when relevant so that we know at any moment
whether there is an ongoing transmission.

The counter gets decremented in the following situations:
- The operation is asynchronous and there was a failure during the
  offloading process.
- The operation is synchronous and the synchronous operation failed.
- The operation finished, either successfully or not.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Alexander Aring <aahringo@redhat.com>
Link: https://lore.kernel.org/r/20220519150516.443078-5-miquel.raynal@bootlin.com
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
include/net/cfg802154.h
net/mac802154/tx.c
net/mac802154/util.c