All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: "David S. Miller" <davem@davemloft.net>, <netdev@vger.kernel.org>
Cc: Sekhar Nori <nsekhar@ti.com>, <linux-kernel@vger.kernel.org>,
	<linux-omap@vger.kernel.org>,
	Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>,
	Murali Karicheri <m-karicheri2@ti.com>,
	Grygorii Strashko <grygorii.strashko@ti.com>
Subject: [PATCH 04/11] net: ethernet: ti: cpsw: move mac_hi/lo defines in cpsw.h
Date: Wed, 22 Nov 2017 15:25:50 -0600	[thread overview]
Message-ID: <20171122212557.9998-5-grygorii.strashko@ti.com> (raw)
In-Reply-To: <20171122212557.9998-1-grygorii.strashko@ti.com>

Move mac_hi/lo defines in common header cpsw.h and re-use
them for netcp_ethss.c.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 drivers/net/ethernet/ti/cpsw.c        | 4 ----
 drivers/net/ethernet/ti/cpsw.h        | 4 ++++
 drivers/net/ethernet/ti/netcp_ethss.c | 5 +----
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 2c50596..f914589 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -978,10 +978,6 @@ static inline void soft_reset(const char *module, void __iomem *reg)
 	WARN(readl_relaxed(reg) & 1, "failed to soft-reset %s\n", module);
 }
 
-#define mac_hi(mac)	(((mac)[0] << 0) | ((mac)[1] << 8) |	\
-			 ((mac)[2] << 16) | ((mac)[3] << 24))
-#define mac_lo(mac)	(((mac)[4] << 0) | ((mac)[5] << 8))
-
 static void cpsw_set_slave_mac(struct cpsw_slave *slave,
 			       struct cpsw_priv *priv)
 {
diff --git a/drivers/net/ethernet/ti/cpsw.h b/drivers/net/ethernet/ti/cpsw.h
index a325f555..cf111db 100644
--- a/drivers/net/ethernet/ti/cpsw.h
+++ b/drivers/net/ethernet/ti/cpsw.h
@@ -17,6 +17,10 @@
 #include <linux/if_ether.h>
 #include <linux/phy.h>
 
+#define mac_hi(mac)	(((mac)[0] << 0) | ((mac)[1] << 8) |	\
+			 ((mac)[2] << 16) | ((mac)[3] << 24))
+#define mac_lo(mac)	(((mac)[4] << 0) | ((mac)[5] << 8))
+
 void cpsw_phy_sel(struct device *dev, phy_interface_t phy_mode, int slave);
 int ti_cm_get_macid(struct device *dev, int slave, u8 *mac_addr);
 
diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
index 4ad8216..1ff0ade 100644
--- a/drivers/net/ethernet/ti/netcp_ethss.c
+++ b/drivers/net/ethernet/ti/netcp_ethss.c
@@ -27,6 +27,7 @@
 #include <linux/net_tstamp.h>
 #include <linux/ethtool.h>
 
+#include "cpsw.h"
 #include "cpsw_ale.h"
 #include "netcp.h"
 #include "cpts.h"
@@ -2047,10 +2048,6 @@ static const struct ethtool_ops keystone_ethtool_ops = {
 	.get_ts_info		= keystone_get_ts_info,
 };
 
-#define mac_hi(mac)	(((mac)[0] << 0) | ((mac)[1] << 8) |	\
-			 ((mac)[2] << 16) | ((mac)[3] << 24))
-#define mac_lo(mac)	(((mac)[4] << 0) | ((mac)[5] << 8))
-
 static void gbe_set_slave_mac(struct gbe_slave *slave,
 			      struct gbe_intf *gbe_intf)
 {
-- 
2.10.5

WARNING: multiple messages have this Message-ID (diff)
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: "David S. Miller" <davem@davemloft.net>, netdev@vger.kernel.org
Cc: Sekhar Nori <nsekhar@ti.com>,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>,
	Murali Karicheri <m-karicheri2@ti.com>,
	Grygorii Strashko <grygorii.strashko@ti.com>
Subject: [PATCH 04/11] net: ethernet: ti: cpsw: move mac_hi/lo defines in cpsw.h
Date: Wed, 22 Nov 2017 15:25:50 -0600	[thread overview]
Message-ID: <20171122212557.9998-5-grygorii.strashko@ti.com> (raw)
In-Reply-To: <20171122212557.9998-1-grygorii.strashko@ti.com>

Move mac_hi/lo defines in common header cpsw.h and re-use
them for netcp_ethss.c.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 drivers/net/ethernet/ti/cpsw.c        | 4 ----
 drivers/net/ethernet/ti/cpsw.h        | 4 ++++
 drivers/net/ethernet/ti/netcp_ethss.c | 5 +----
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 2c50596..f914589 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -978,10 +978,6 @@ static inline void soft_reset(const char *module, void __iomem *reg)
 	WARN(readl_relaxed(reg) & 1, "failed to soft-reset %s\n", module);
 }
 
-#define mac_hi(mac)	(((mac)[0] << 0) | ((mac)[1] << 8) |	\
-			 ((mac)[2] << 16) | ((mac)[3] << 24))
-#define mac_lo(mac)	(((mac)[4] << 0) | ((mac)[5] << 8))
-
 static void cpsw_set_slave_mac(struct cpsw_slave *slave,
 			       struct cpsw_priv *priv)
 {
diff --git a/drivers/net/ethernet/ti/cpsw.h b/drivers/net/ethernet/ti/cpsw.h
index a325f555..cf111db 100644
--- a/drivers/net/ethernet/ti/cpsw.h
+++ b/drivers/net/ethernet/ti/cpsw.h
@@ -17,6 +17,10 @@
 #include <linux/if_ether.h>
 #include <linux/phy.h>
 
+#define mac_hi(mac)	(((mac)[0] << 0) | ((mac)[1] << 8) |	\
+			 ((mac)[2] << 16) | ((mac)[3] << 24))
+#define mac_lo(mac)	(((mac)[4] << 0) | ((mac)[5] << 8))
+
 void cpsw_phy_sel(struct device *dev, phy_interface_t phy_mode, int slave);
 int ti_cm_get_macid(struct device *dev, int slave, u8 *mac_addr);
 
diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
index 4ad8216..1ff0ade 100644
--- a/drivers/net/ethernet/ti/netcp_ethss.c
+++ b/drivers/net/ethernet/ti/netcp_ethss.c
@@ -27,6 +27,7 @@
 #include <linux/net_tstamp.h>
 #include <linux/ethtool.h>
 
+#include "cpsw.h"
 #include "cpsw_ale.h"
 #include "netcp.h"
 #include "cpts.h"
@@ -2047,10 +2048,6 @@ static const struct ethtool_ops keystone_ethtool_ops = {
 	.get_ts_info		= keystone_get_ts_info,
 };
 
-#define mac_hi(mac)	(((mac)[0] << 0) | ((mac)[1] << 8) |	\
-			 ((mac)[2] << 16) | ((mac)[3] << 24))
-#define mac_lo(mac)	(((mac)[4] << 0) | ((mac)[5] << 8))
-
 static void gbe_set_slave_mac(struct gbe_slave *slave,
 			      struct gbe_intf *gbe_intf)
 {
-- 
2.10.5

  parent reply	other threads:[~2017-11-22 21:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22 21:25 [PATCH 00/11] net: ethernet: ti: cpsw/ale clean up and optimization Grygorii Strashko
2017-11-22 21:25 ` Grygorii Strashko
2017-11-22 21:25 ` [PATCH 01/11] net: ethernet: ti: cpsw: drop unused var poll from cpsw_update_channels_res Grygorii Strashko
2017-11-22 21:25   ` Grygorii Strashko
2017-11-22 21:25 ` [PATCH 02/11] net: ethernet: ti: cpsw: use proper io apis Grygorii Strashko
2017-11-22 21:25   ` Grygorii Strashko
2017-11-22 21:25 ` [PATCH 03/11] net: ethernet: ti: cpsw: move platform data struct to .c file Grygorii Strashko
2017-11-22 21:25   ` Grygorii Strashko
2017-11-22 21:25 ` Grygorii Strashko [this message]
2017-11-22 21:25   ` [PATCH 04/11] net: ethernet: ti: cpsw: move mac_hi/lo defines in cpsw.h Grygorii Strashko
2017-11-22 21:25 ` [PATCH 05/11] net: ethernet: ti: cpsw: fix ale port numbers Grygorii Strashko
2017-11-22 21:25   ` Grygorii Strashko
2017-11-22 21:25 ` [PATCH 06/11] net: ethernet: ti: ale: use proper io apis Grygorii Strashko
2017-11-22 21:25   ` Grygorii Strashko
2017-11-22 21:25 ` [PATCH 07/11] net: ethernet: ti: ale: disable ale from stop() Grygorii Strashko
2017-11-22 21:25   ` Grygorii Strashko
2017-11-22 21:25 ` [PATCH 08/11] net: ethernet: ti: ale: optimize ale entry mask bits configuartion Grygorii Strashko
2017-11-22 21:25   ` Grygorii Strashko
2017-11-22 21:25 ` [PATCH 09/11] net: ethernet: ti: ale: move static initialization in cpsw_ale_create() Grygorii Strashko
2017-11-22 21:25   ` Grygorii Strashko
2017-11-22 21:25 ` [PATCH 10/11] net: ethernet: ti: ale: use devm_kzalloc " Grygorii Strashko
2017-11-22 21:25   ` Grygorii Strashko
2017-11-22 21:25 ` [PATCH 11/11] net: ethernet: ti: ale: fix port check in cpsw_ale_control_set/get Grygorii Strashko
2017-11-22 21:25   ` Grygorii Strashko
2017-11-23 18:09 ` [PATCH 00/11] net: ethernet: ti: cpsw/ale clean up and optimization David Miller

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=20171122212557.9998-5-grygorii.strashko@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=davem@davemloft.net \
    --cc=ivan.khoronzhuk@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=m-karicheri2@ti.com \
    --cc=netdev@vger.kernel.org \
    --cc=nsekhar@ti.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.