From patchwork Thu Jan 20 00:51:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 534483 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A7A3C43217 for ; Thu, 20 Jan 2022 00:51:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357928AbiATAv3 (ORCPT ); Wed, 19 Jan 2022 19:51:29 -0500 Received: from relay11.mail.gandi.net ([217.70.178.231]:42765 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357906AbiATAv2 (ORCPT ); Wed, 19 Jan 2022 19:51:28 -0500 Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 7B530100004; Thu, 20 Jan 2022 00:51:25 +0000 (UTC) From: Miquel Raynal To: Alexander Aring , Stefan Schmidt , linux-wpan@vger.kernel.org Cc: "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-wireless@vger.kernel.org, David Girault , Romuald Despres , Frederic Blain , Nicolas Schodet , Thomas Petazzoni , Miquel Raynal Subject: [wpan-next 01/14] net: ieee802154: Move the logic restarting the queue upon transmission Date: Thu, 20 Jan 2022 01:51:09 +0100 Message-Id: <20220120005122.309104-2-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220120005122.309104-1-miquel.raynal@bootlin.com> References: <20220120005122.309104-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Create a new helper with the logic restarting the queue upon transmission, so that we can create a second path for error conditions which can reuse that code easily. Signed-off-by: Miquel Raynal --- net/mac802154/util.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/net/mac802154/util.c b/net/mac802154/util.c index f2078238718b..4c06a6bd391a 100644 --- a/net/mac802154/util.c +++ b/net/mac802154/util.c @@ -55,8 +55,9 @@ enum hrtimer_restart ieee802154_xmit_ifs_timer(struct hrtimer *timer) return HRTIMER_NORESTART; } -void ieee802154_xmit_complete(struct ieee802154_hw *hw, struct sk_buff *skb, - bool ifs_handling) +static void +ieee802154_wakeup_after_xmit_done(struct ieee802154_hw *hw, struct sk_buff *skb, + bool ifs_handling) { if (ifs_handling) { struct ieee802154_local *local = hw_to_local(hw); @@ -83,7 +84,12 @@ void ieee802154_xmit_complete(struct ieee802154_hw *hw, struct sk_buff *skb, } else { ieee802154_wake_queue(hw); } +} +void ieee802154_xmit_complete(struct ieee802154_hw *hw, struct sk_buff *skb, + bool ifs_handling) +{ + ieee802154_wakeup_after_xmit_done(hw, skb, ifs_handling); dev_consume_skb_any(skb); } EXPORT_SYMBOL(ieee802154_xmit_complete);