aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWingMan Kwok2015-02-27 15:53:19 -0600
committerWingMan Kwok2015-03-10 09:20:34 -0500
commitc376febd9ff9c0bc205cd4c9a719f5578ae4bd15 (patch)
tree0a2794db9abc3db7ba0e54b0bd3e04a1c824d3e7 /drivers/net/ethernet/ti/keystone_ethss2.c
parentefd468cfeeb35dbb843540d6bcc8c61231a054a7 (diff)
downloadlinux-c376febd9ff9c0bc205cd4c9a719f5578ae4bd15.tar.gz
linux-c376febd9ff9c0bc205cd4c9a719f5578ae4bd15.tar.xz
linux-c376febd9ff9c0bc205cd4c9a719f5578ae4bd15.zip
net: keystone: add support of setting hw address live
This patch adds support of setting hw address live. When doing so, the netcp needs to update the lower modules cpsw and pa to update their database accordingly, i.e. setting up their receive filters. Signed-off-by: WingMan Kwok <w-kwok2@ti.com>
Diffstat (limited to 'drivers/net/ethernet/ti/keystone_ethss2.c')
-rw-r--r--drivers/net/ethernet/ti/keystone_ethss2.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ti/keystone_ethss2.c b/drivers/net/ethernet/ti/keystone_ethss2.c
index e5fadee8c0f..feaf3b82840 100644
--- a/drivers/net/ethernet/ti/keystone_ethss2.c
+++ b/drivers/net/ethernet/ti/keystone_ethss2.c
@@ -167,6 +167,7 @@
167#define IS_SGMII_MAC_PHY(i) \ 167#define IS_SGMII_MAC_PHY(i) \
168 (((i) == SGMII_LINK_MAC_PHY) || ((i) == SGMII_LINK_MAC_PHY_MASTER)) 168 (((i) == SGMII_LINK_MAC_PHY) || ((i) == SGMII_LINK_MAC_PHY_MASTER))
169 169
170
170/* CPSW Statistics register map size */ 171/* CPSW Statistics register map size */
171#define CPSW2_STATS_REGS_SIZE 0x200 172#define CPSW2_STATS_REGS_SIZE 0x200
172 173
@@ -903,6 +904,7 @@ struct cpsw2_priv {
903 u32 num_serdes; 904 u32 num_serdes;
904 u32 serdes_lanes; 905 u32 serdes_lanes;
905 struct serdes serdes; 906 struct serdes serdes;
907 u32 opened;
906}; 908};
907 909
908/* slave_port: 0-based (currently relevant only in multi_if mode) 910/* slave_port: 0-based (currently relevant only in multi_if mode)
@@ -2764,6 +2766,9 @@ static int cpsw2_add_addr(void *intf_priv, struct netcp_addr *naddr)
2764 struct cpsw2_intf *cpsw_intf = intf_priv; 2766 struct cpsw2_intf *cpsw_intf = intf_priv;
2765 struct cpsw2_priv *cpsw_dev = cpsw_intf->cpsw_priv; 2767 struct cpsw2_priv *cpsw_dev = cpsw_intf->cpsw_priv;
2766 2768
2769 if (!cpsw_dev->opened)
2770 return -ENXIO;
2771
2767 dev_dbg(cpsw_dev->dev, "ethss adding address %pM, type %d\n", 2772 dev_dbg(cpsw_dev->dev, "ethss adding address %pM, type %d\n",
2768 naddr->addr, naddr->type); 2773 naddr->addr, naddr->type);
2769 2774
@@ -2790,6 +2795,9 @@ static int cpsw2_del_addr(void *intf_priv, struct netcp_addr *naddr)
2790 struct cpsw2_intf *cpsw_intf = intf_priv; 2795 struct cpsw2_intf *cpsw_intf = intf_priv;
2791 struct cpsw2_priv *cpsw_dev = cpsw_intf->cpsw_priv; 2796 struct cpsw2_priv *cpsw_dev = cpsw_intf->cpsw_priv;
2792 2797
2798 if (!cpsw_dev->opened)
2799 return -ENXIO;
2800
2793 dev_dbg(cpsw_dev->dev, "ethss deleting address %pM, type %d\n", 2801 dev_dbg(cpsw_dev->dev, "ethss deleting address %pM, type %d\n",
2794 naddr->addr, naddr->type); 2802 naddr->addr, naddr->type);
2795 2803
@@ -3455,6 +3463,7 @@ static int cpsw2_open(void *intf_priv, struct net_device *ndev)
3455 PSTREAM_ROUTE_GLOBAL_DMA); 3463 PSTREAM_ROUTE_GLOBAL_DMA);
3456 3464
3457 cpsw2_register_cpts(cpsw_dev); 3465 cpsw2_register_cpts(cpsw_dev);
3466 cpsw_dev->opened = 1;
3458 return 0; 3467 return 0;
3459 3468
3460ale_fail: 3469ale_fail:
@@ -3494,6 +3503,7 @@ static int cpsw2_close(void *intf_priv, struct net_device *ndev)
3494 clk_put(cpsw_dev->cpgmac); 3503 clk_put(cpsw_dev->cpgmac);
3495 3504
3496 cpsw2_unregister_cpts(cpsw_dev); 3505 cpsw2_unregister_cpts(cpsw_dev);
3506 cpsw_dev->opened = 0;
3497 return 0; 3507 return 0;
3498} 3508}
3499 3509