提交 2733d7b8 编写于 作者: G Grygorii Strashko 提交者: David S. Miller

net: ethernet: ti: cpsw: move mac_hi/lo defines in cpsw.h

Move mac_hi/lo defines in common header cpsw.h and re-use
them for netcp_ethss.c.
Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2c8a14d6
...@@ -978,10 +978,6 @@ static inline void soft_reset(const char *module, void __iomem *reg) ...@@ -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); 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, static void cpsw_set_slave_mac(struct cpsw_slave *slave,
struct cpsw_priv *priv) struct cpsw_priv *priv)
{ {
......
...@@ -17,6 +17,10 @@ ...@@ -17,6 +17,10 @@
#include <linux/if_ether.h> #include <linux/if_ether.h>
#include <linux/phy.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); 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); int ti_cm_get_macid(struct device *dev, int slave, u8 *mac_addr);
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/net_tstamp.h> #include <linux/net_tstamp.h>
#include <linux/ethtool.h> #include <linux/ethtool.h>
#include "cpsw.h"
#include "cpsw_ale.h" #include "cpsw_ale.h"
#include "netcp.h" #include "netcp.h"
#include "cpts.h" #include "cpts.h"
...@@ -2047,10 +2048,6 @@ static const struct ethtool_ops keystone_ethtool_ops = { ...@@ -2047,10 +2048,6 @@ static const struct ethtool_ops keystone_ethtool_ops = {
.get_ts_info = keystone_get_ts_info, .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, static void gbe_set_slave_mac(struct gbe_slave *slave,
struct gbe_intf *gbe_intf) struct gbe_intf *gbe_intf)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册