All of lore.kernel.org
 help / color / mirror / Atom feed
From: Loic Poulain <loic.poulain@linaro.org>
To: unlisted-recipients:; (no To-header on input)
Cc: netdev@vger.kernel.org, bjorn@mork.no, dcbw@redhat.com,
	carl.yin@quectel.com, mpearson@lenovo.com, cchen50@lenovo.com,
	jwjiang@lenovo.com, ivan.zhang@quectel.com,
	naveen.kumar@quectel.com, ivan.mikhanchuk@quectel.com,
	Loic Poulain <loic.poulain@linaro.org>
Subject: [PATCH net-next v4 3/5] net: mhi: Create mhi.h
Date: Mon,  8 Feb 2021 09:00:35 +0100	[thread overview]
Message-ID: <1612771237-3782-4-git-send-email-loic.poulain@linaro.org> (raw)
In-Reply-To: <1612771237-3782-1-git-send-email-loic.poulain@linaro.org>

Move mhi-net shared structures to mhi header, that will be used by
upcoming proto(s).

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
---
 drivers/net/mhi/mhi.h | 36 ++++++++++++++++++++++++++++++++++++
 drivers/net/mhi/net.c | 33 ++-------------------------------
 2 files changed, 38 insertions(+), 31 deletions(-)
 create mode 100644 drivers/net/mhi/mhi.h

diff --git a/drivers/net/mhi/mhi.h b/drivers/net/mhi/mhi.h
new file mode 100644
index 0000000..5050e4a
--- /dev/null
+++ b/drivers/net/mhi/mhi.h
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* MHI Network driver - Network over MHI bus
+ *
+ * Copyright (C) 2021 Linaro Ltd <loic.poulain@linaro.org>
+ */
+
+struct mhi_net_stats {
+	u64_stats_t rx_packets;
+	u64_stats_t rx_bytes;
+	u64_stats_t rx_errors;
+	u64_stats_t rx_dropped;
+	u64_stats_t tx_packets;
+	u64_stats_t tx_bytes;
+	u64_stats_t tx_errors;
+	u64_stats_t tx_dropped;
+	struct u64_stats_sync tx_syncp;
+	struct u64_stats_sync rx_syncp;
+};
+
+struct mhi_net_dev {
+	struct mhi_device *mdev;
+	struct net_device *ndev;
+	struct sk_buff *skbagg_head;
+	struct sk_buff *skbagg_tail;
+	const struct mhi_net_proto *proto;
+	void *proto_data;
+	struct delayed_work rx_refill;
+	struct mhi_net_stats stats;
+	u32 rx_queue_sz;
+};
+
+struct mhi_net_proto {
+	int (*init)(struct mhi_net_dev *mhi_netdev);
+	struct sk_buff * (*tx_fixup)(struct mhi_net_dev *mhi_netdev, struct sk_buff *skb);
+	void (*rx)(struct mhi_net_dev *mhi_netdev, struct sk_buff *skb);
+};
diff --git a/drivers/net/mhi/net.c b/drivers/net/mhi/net.c
index b92c2e1..58b4b7c 100644
--- a/drivers/net/mhi/net.c
+++ b/drivers/net/mhi/net.c
@@ -12,41 +12,12 @@
 #include <linux/skbuff.h>
 #include <linux/u64_stats_sync.h>
 
+#include "mhi.h"
+
 #define MHI_NET_MIN_MTU		ETH_MIN_MTU
 #define MHI_NET_MAX_MTU		0xffff
 #define MHI_NET_DEFAULT_MTU	0x4000
 
-struct mhi_net_stats {
-	u64_stats_t rx_packets;
-	u64_stats_t rx_bytes;
-	u64_stats_t rx_errors;
-	u64_stats_t rx_dropped;
-	u64_stats_t tx_packets;
-	u64_stats_t tx_bytes;
-	u64_stats_t tx_errors;
-	u64_stats_t tx_dropped;
-	struct u64_stats_sync tx_syncp;
-	struct u64_stats_sync rx_syncp;
-};
-
-struct mhi_net_dev {
-	struct mhi_device *mdev;
-	struct net_device *ndev;
-	struct sk_buff *skbagg_head;
-	struct sk_buff *skbagg_tail;
-	const struct mhi_net_proto *proto;
-	void *proto_data;
-	struct delayed_work rx_refill;
-	struct mhi_net_stats stats;
-	u32 rx_queue_sz;
-};
-
-struct mhi_net_proto {
-	int (*init)(struct mhi_net_dev *mhi_netdev);
-	struct sk_buff * (*tx_fixup)(struct mhi_net_dev *mhi_netdev, struct sk_buff *skb);
-	void (*rx)(struct mhi_net_dev *mhi_netdev, struct sk_buff *skb);
-};
-
 struct mhi_device_info {
 	const char *netname;
 	const struct mhi_net_proto *proto;
-- 
2.7.4


  parent reply	other threads:[~2021-02-08  7:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08  8:00 [PATCH net-next v4 0/5] Add MBIM over MHI support Loic Poulain
2021-02-08  8:00 ` [PATCH net-next v4 1/5] net: mhi: Add protocol support Loic Poulain
2021-02-08  8:00 ` [PATCH net-next v4 2/5] net: mhi: Add dedicated folder Loic Poulain
2021-02-08  8:00 ` Loic Poulain [this message]
2021-02-08  8:00 ` [PATCH net-next v4 4/5] net: mhi: Add rx_length_errors stat Loic Poulain
2021-02-08  8:00 ` [PATCH net-next v4 5/5] net: mhi: Add mbim proto Loic Poulain
2021-02-08 21:12   ` Jakub Kicinski

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=1612771237-3782-4-git-send-email-loic.poulain@linaro.org \
    --to=loic.poulain@linaro.org \
    --cc=bjorn@mork.no \
    --cc=carl.yin@quectel.com \
    --cc=cchen50@lenovo.com \
    --cc=dcbw@redhat.com \
    --cc=ivan.mikhanchuk@quectel.com \
    --cc=ivan.zhang@quectel.com \
    --cc=jwjiang@lenovo.com \
    --cc=mpearson@lenovo.com \
    --cc=naveen.kumar@quectel.com \
    --cc=netdev@vger.kernel.org \
    /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.