Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1229705pxb; Fri, 21 Jan 2022 12:51:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyFtqDha3bExD+YZqVW/N3UOAxY9ES+TquzSAf51xSlO5BR7wPn3RZnMHuOgVROl7X6BysS X-Received: by 2002:a17:902:7fc4:b0:14a:9f3d:3358 with SMTP id t4-20020a1709027fc400b0014a9f3d3358mr5280652plb.165.1642798294908; Fri, 21 Jan 2022 12:51:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642798294; cv=none; d=google.com; s=arc-20160816; b=ghGOu6MPVTJ8NVoHPolxIV1y7dFmrPs9IQ41v+hJXXQ5ytYKWkSgNswrOHXfHIj7LX ERTToDTgUC6ZrUCp+GrNL/yMuxGZV2n66bt8Zuag/7LeaGqDhKWlBeoCUegrzWHLkcOs 7Rx5vmjucn1VHm1yPuZAoluGZZrFvL8aKJSPEdpI5g6SlxJmKP9RxFT5AHPp6WxgT0aq VGjexauZJQs3OQyqe53KI0Nx/oAjtnDu6e3c3wCWM0E42mP7n/wbD57SfFA9+wwjzK0G CDvv8Kigbq7GwdYEGYoCF49vOXbkK5G7fqN9uy5n0kxHJIUUcBPtOCWcDarOU0SUP741 zX/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=tJrSQ2GLFDNzzoQCpuTsIczrdWvTLH/p8qH52aZA+6Q=; b=WKCRtHlNzWzCbIyRMy8tx1gcLFBWXFxUvaBI4+EXAb9XNgYzm++lxYSUep/kjgq8rR Dasd2+54mtTv9AAEElzr/aaHfSBM2VAd64y8hp3QoWPG58fknjuqBCyPZezWB6O7jpRx 4yXsX1X6GmtlYHBVlzCAjwg0xfTBXU2NRQSXXcJ3L6dlRrvMUZLjKsfuP88mxhgqknAl d+Thv4z4ieVwAbkKUSYlBSS9geTMc5JksX7c9tkXO8V/6MEvB0dKHNygnug3SQQGP7cg Cucy7xbh4h1erR80enOkC/wg1Vv+5u9xinI24Zoir/IQy5VvdITe4Rq/B8CNvoxF3DlZ QXiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q34si7207229pgk.819.2022.01.21.12.51.26; Fri, 21 Jan 2022 12:51:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357990AbiATAvm (ORCPT + 70 others); Wed, 19 Jan 2022 19:51:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357995AbiATAvj (ORCPT ); Wed, 19 Jan 2022 19:51:39 -0500 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [IPv6:2001:4b98:dc4:8::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C32CC061574; Wed, 19 Jan 2022 16:51:38 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id E38FD100004; Thu, 20 Jan 2022 00:51:35 +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 08/14] net: mac802154: Rename the main tx_work struct Date: Thu, 20 Jan 2022 01:51:16 +0100 Message-Id: <20220120005122.309104-9-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This entry is dedicated to synchronous transmissions done by drivers without async hook. Make this clearer that this is not a work that any driver can use by at least prefixing it with "sync_". While at it, let's enhance the comment explaining why we choose one or the other. Signed-off-by: Miquel Raynal --- net/mac802154/ieee802154_i.h | 2 +- net/mac802154/main.c | 2 +- net/mac802154/tx.c | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/net/mac802154/ieee802154_i.h b/net/mac802154/ieee802154_i.h index b4882b2d7688..18d1f6804810 100644 --- a/net/mac802154/ieee802154_i.h +++ b/net/mac802154/ieee802154_i.h @@ -55,7 +55,7 @@ struct ieee802154_local { struct sk_buff_head skb_queue; struct sk_buff *tx_skb; - struct work_struct tx_work; + struct work_struct sync_tx_work; }; enum { diff --git a/net/mac802154/main.c b/net/mac802154/main.c index bfd7c431cdea..0023c6e80725 100644 --- a/net/mac802154/main.c +++ b/net/mac802154/main.c @@ -95,7 +95,7 @@ ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops) skb_queue_head_init(&local->skb_queue); - INIT_WORK(&local->tx_work, ieee802154_xmit_sync_worker); + INIT_WORK(&local->sync_tx_work, ieee802154_xmit_sync_worker); /* init supported flags with 802.15.4 default ranges */ phy->supported.max_minbe = 8; diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c index 97df5985b830..a01689ddd547 100644 --- a/net/mac802154/tx.c +++ b/net/mac802154/tx.c @@ -25,7 +25,7 @@ void ieee802154_xmit_sync_worker(struct work_struct *work) { struct ieee802154_local *local = - container_of(work, struct ieee802154_local, tx_work); + container_of(work, struct ieee802154_local, sync_tx_work); struct sk_buff *skb = local->tx_skb; struct net_device *dev = skb->dev; int res; @@ -76,7 +76,10 @@ ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb) /* Stop the netif queue on each sub_if_data object. */ ieee802154_stop_queue(&local->hw); - /* async is priority, otherwise sync is fallback */ + /* Drivers should preferably implement the async callback. In some rare + * cases they only provide a sync callback which we will use as a + * fallback. + */ if (local->ops->xmit_async) { unsigned int len = skb->len; @@ -90,7 +93,7 @@ ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb) dev->stats.tx_bytes += len; } else { local->tx_skb = skb; - queue_work(local->workqueue, &local->tx_work); + queue_work(local->workqueue, &local->sync_tx_work); } return NETDEV_TX_OK; -- 2.27.0