All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Alexander Aring <alex.aring@gmail.com>,
	Stefan Schmidt <stefan@datenfreihafen.org>,
	linux-wpan@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, David Girault <david.girault@qorvo.com>,
	Romuald Despres <romuald.despres@qorvo.com>,
	Frederic Blain <frederic.blain@qorvo.com>,
	Nicolas Schodet <nico@ni.fr.eu.org>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>
Subject: [PATCH v6 03/10] net: mac802154: Save a global error code on transmissions
Date: Thu,  7 Apr 2022 12:08:56 +0200	[thread overview]
Message-ID: <20220407100903.1695973-4-miquel.raynal@bootlin.com> (raw)
In-Reply-To: <20220407100903.1695973-1-miquel.raynal@bootlin.com>

So far no error is returned from a failing transmission. However it
might sometimes be useful, and particularly easy to use during sync
transfers (for certain MLME commands). Let's create an internal variable
for that, global to the device. Right now only success are registered,
which is rather useless, but soon we will have more situations filling
this field.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 net/mac802154/ieee802154_i.h | 2 ++
 net/mac802154/util.c         | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/net/mac802154/ieee802154_i.h b/net/mac802154/ieee802154_i.h
index 702560acc8ce..1381e6a5e180 100644
--- a/net/mac802154/ieee802154_i.h
+++ b/net/mac802154/ieee802154_i.h
@@ -56,6 +56,8 @@ struct ieee802154_local {
 
 	struct sk_buff *tx_skb;
 	struct work_struct tx_work;
+	/* A negative Linux error code or a null/positive MLME error status */
+	int tx_result;
 };
 
 enum {
diff --git a/net/mac802154/util.c b/net/mac802154/util.c
index f2078238718b..0bf46f174de3 100644
--- a/net/mac802154/util.c
+++ b/net/mac802154/util.c
@@ -58,8 +58,11 @@ enum hrtimer_restart ieee802154_xmit_ifs_timer(struct hrtimer *timer)
 void ieee802154_xmit_complete(struct ieee802154_hw *hw, struct sk_buff *skb,
 			      bool ifs_handling)
 {
+	struct ieee802154_local *local = hw_to_local(hw);
+
+	local->tx_result = IEEE802154_SUCCESS;
+
 	if (ifs_handling) {
-		struct ieee802154_local *local = hw_to_local(hw);
 		u8 max_sifs_size;
 
 		/* If transceiver sets CRC on his own we need to use lifs
-- 
2.27.0


  parent reply	other threads:[~2022-04-07 10:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07 10:08 [PATCH v6 00/10] ieee802154: Better Tx error handling Miquel Raynal
2022-04-07 10:08 ` [PATCH v6 01/10] net: ieee802154: Enhance/fix the names of the MLME return codes Miquel Raynal
2022-04-07 10:08 ` [PATCH v6 02/10] net: ieee802154: Fill the list of " Miquel Raynal
2022-04-07 10:08 ` Miquel Raynal [this message]
2022-04-07 10:08 ` [PATCH v6 04/10] net: mac802154: Create an offloaded transmission error helper Miquel Raynal
2022-04-07 10:08 ` [PATCH v6 05/10] net: mac802154: Create an error helper for asynchronous offloading errors Miquel Raynal
2022-04-07 10:08 ` [PATCH v6 06/10] net: ieee802154: at86rf230: Call _xmit_hw_error() when failing to offload frames Miquel Raynal
2022-04-07 10:09 ` [PATCH v6 07/10] net: ieee802154: at86rf230: Forward Tx trac errors Miquel Raynal
2022-04-07 10:09 ` [PATCH v6 08/10] net: ieee802154: atusb: Call _xmit_hw_error() upon transmission error Miquel Raynal
2022-04-07 10:09 ` [PATCH v6 09/10] net: ieee802154: ca8210: Use core return codes instead of hardcoding them Miquel Raynal
2022-04-07 10:09 ` [PATCH v6 10/10] net: ieee802154: ca8210: Call _xmit_error() when a transmission fails Miquel Raynal
2022-04-25 12:37 ` [PATCH v6 00/10] ieee802154: Better Tx error handling Alexander Aring
2022-04-25 19:25   ` Stefan Schmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220407100903.1695973-4-miquel.raynal@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=alex.aring@gmail.com \
    --cc=davem@davemloft.net \
    --cc=david.girault@qorvo.com \
    --cc=frederic.blain@qorvo.com \
    --cc=kuba@kernel.org \
    --cc=linux-wpan@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nico@ni.fr.eu.org \
    --cc=romuald.despres@qorvo.com \
    --cc=stefan@datenfreihafen.org \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.