Lines Matching defs:cpsw
35 #include "cpsw.h"
51 struct cpsw_common *cpsw;
63 static int cpsw_slave_index_priv(struct cpsw_common *cpsw,
72 static bool cpsw_is_switch_en(struct cpsw_common *cpsw)
74 return !cpsw->data.dual_emac;
79 struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
83 if (cpsw_is_switch_en(cpsw))
90 for (i = 0; i < cpsw->data.slaves; i++)
91 if (cpsw->slaves[i].ndev &&
92 (cpsw->slaves[i].ndev->flags & IFF_PROMISC))
97 dev_dbg(cpsw->dev, "promiscuity not disabled as the other interface is still in promiscuity mode\n");
102 cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM,
105 dev_dbg(cpsw->dev, "promiscuity enabled\n");
108 cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM,
110 dev_dbg(cpsw->dev, "promiscuity disabled\n");
126 struct cpsw_common *cpsw = priv->cpsw;
129 slave_no = cpsw_slave_index(cpsw, priv);
131 vid = cpsw->slaves[slave_no].port_vlan;
137 ret = cpsw_ale_add_mcast(cpsw->ale, addr, mask, flags, vid, 0);
139 ret = cpsw_ale_del_mcast(cpsw->ale, addr, 0, flags, vid);
252 struct cpsw_common *cpsw = priv->cpsw;
257 cpsw_ale_set_allmulti(cpsw->ale, IFF_ALLMULTI, priv->emac_port);
265 cpsw_ale_set_allmulti(cpsw->ale,
287 struct cpsw_common *cpsw;
298 cpsw = ndev_to_cpsw(xmeta->ndev);
300 pkt_size = cpsw->rx_packet_max;
306 ndev = cpsw->slaves[--port].ndev;
310 pool = cpsw->page_pool[ch];
314 if (cpsw->usage_count && status >= 0) {
381 cpts_rx_timestamp(cpsw->cpts, skb);
397 ret = cpdma_chan_submit_mapped(cpsw->rxv[ch].ch, new_page, dma,
408 struct cpsw_common *cpsw = priv->cpsw;
420 ret = cpsw_ale_add_vlan(cpsw->ale, vid, port_mask, 0, port_mask,
425 ret = cpsw_ale_add_ucast(cpsw->ale, priv->mac_addr,
430 ret = cpsw_ale_add_mcast(cpsw->ale, priv->ndev->broadcast,
437 cpsw_ale_del_ucast(cpsw->ale, priv->mac_addr,
440 cpsw_ale_del_vlan(cpsw->ale, vid, 0);
448 struct cpsw_common *cpsw = priv->cpsw;
451 if (cpsw_is_switch_en(cpsw)) {
452 dev_dbg(cpsw->dev, ".ndo_vlan_rx_add_vid called in switch mode\n");
456 if (vid == cpsw->data.default_vlan)
459 ret = pm_runtime_get_sync(cpsw->dev);
461 pm_runtime_put_noidle(cpsw->dev);
469 for (i = 0; i < cpsw->data.slaves; i++) {
470 if (cpsw->slaves[i].ndev &&
471 vid == cpsw->slaves[i].port_vlan) {
480 pm_runtime_put(cpsw->dev);
498 struct cpsw_common *cpsw = priv->cpsw;
504 cpsw_mqprio_resume(&cpsw->slaves[priv->emac_port - 1], priv);
507 cpsw_cbs_resume(&cpsw->slaves[priv->emac_port - 1], priv);
510 static void cpsw_init_stp_ale_entry(struct cpsw_common *cpsw)
514 cpsw_ale_add_mcast(cpsw->ale, stpa,
519 static void cpsw_init_host_port_switch(struct cpsw_common *cpsw)
521 int vlan = cpsw->data.default_vlan;
523 writel(CPSW_FIFO_NORMAL_MODE, &cpsw->host_port_regs->tx_in_ctl);
525 writel(vlan, &cpsw->host_port_regs->port_vlan);
527 cpsw_ale_add_vlan(cpsw->ale, vlan, ALE_ALL_PORTS,
531 cpsw_init_stp_ale_entry(cpsw);
533 cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, ALE_P0_UNI_FLOOD, 1);
534 dev_dbg(cpsw->dev, "Set P0_UNI_FLOOD\n");
535 cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, ALE_PORT_NOLEARN, 0);
538 static void cpsw_init_host_port_dual_mac(struct cpsw_common *cpsw)
540 int vlan = cpsw->data.default_vlan;
542 writel(CPSW_FIFO_DUAL_MAC_MODE, &cpsw->host_port_regs->tx_in_ctl);
544 cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, ALE_P0_UNI_FLOOD, 0);
545 dev_dbg(cpsw->dev, "unset P0_UNI_FLOOD\n");
547 writel(vlan, &cpsw->host_port_regs->port_vlan);
549 cpsw_ale_add_vlan(cpsw->ale, vlan, ALE_ALL_PORTS, ALE_ALL_PORTS, 0, 0);
551 cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, ALE_PORT_NOLEARN, 1);
556 struct cpsw_common *cpsw = priv->cpsw;
560 soft_reset("cpsw", &cpsw->regs->soft_reset);
561 cpsw_ale_start(cpsw->ale);
564 cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, ALE_VLAN_AWARE,
566 control_reg = readl(&cpsw->regs->control);
568 writel(control_reg, &cpsw->regs->control);
572 &cpsw->host_port_regs->cpdma_tx_pri_map);
573 writel_relaxed(0, &cpsw->host_port_regs->cpdma_rx_chan_map);
576 writel_relaxed(0, &cpsw->regs->ptype);
579 writel_relaxed(0x7, &cpsw->regs->stat_port_en);
582 writel(0x7, &cpsw->regs->flow_control);
584 if (cpsw_is_switch_en(cpsw))
585 cpsw_init_host_port_switch(cpsw);
587 cpsw_init_host_port_dual_mac(cpsw);
589 cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM,
597 struct cpsw_common *cpsw = priv->cpsw;
600 reg = (cpsw->version == CPSW_VERSION_1) ? CPSW1_PORT_VLAN :
604 cpsw_ale_add_vlan(cpsw->ale, slave->port_vlan, port_mask,
606 cpsw_ale_add_mcast(cpsw->ale, priv->ndev->broadcast,
609 cpsw_ale_add_ucast(cpsw->ale, priv->mac_addr,
612 cpsw_ale_control_set(cpsw->ale, priv->emac_port,
615 cpsw_ale_control_set(cpsw->ale, priv->emac_port,
623 struct cpsw_common *cpsw = priv->cpsw;
626 cpsw_ale_control_set(cpsw->ale, priv->emac_port,
628 cpsw_ale_control_set(cpsw->ale, priv->emac_port,
640 cpsw_ale_control_set(cpsw->ale, priv->emac_port,
643 cpsw_ale_add_mcast(cpsw->ale, priv->ndev->broadcast,
646 cpsw_ale_add_ucast(cpsw->ale, priv->mac_addr,
649 reg = (cpsw->version == CPSW_VERSION_1) ? CPSW1_PORT_VLAN :
657 struct cpsw_common *cpsw = priv->cpsw;
662 slave = &cpsw->slaves[priv->emac_port - 1];
693 cpsw_ale_control_set(cpsw->ale, priv->emac_port,
707 cpsw_ale_control_set(cpsw->ale, priv->emac_port,
720 if (phy->link && cpsw_need_resplit(cpsw))
721 cpsw_split_res(cpsw);
726 struct cpsw_common *cpsw = priv->cpsw;
736 switch (cpsw->version) {
761 cpsw->rx_packet_max);
766 if (cpsw_is_switch_en(cpsw))
796 struct cpsw_common *cpsw = priv->cpsw;
800 slave = &cpsw->slaves[priv->emac_port - 1];
813 if (cpsw->usage_count <= 1) {
814 napi_disable(&cpsw->napi_rx);
815 napi_disable(&cpsw->napi_tx);
816 cpts_unregister(cpsw->cpts);
817 cpsw_intr_disable(cpsw);
818 cpdma_ctlr_stop(cpsw->dma);
819 cpsw_ale_stop(cpsw->ale);
820 cpsw_destroy_xdp_rxqs(cpsw);
823 if (cpsw_need_resplit(cpsw))
824 cpsw_split_res(cpsw);
826 cpsw->usage_count--;
827 pm_runtime_put_sync(cpsw->dev);
834 struct cpsw_common *cpsw = priv->cpsw;
838 cpsw_is_switch_en(cpsw) ? "switch" : "dual_mac");
839 ret = pm_runtime_get_sync(cpsw->dev);
841 pm_runtime_put_noidle(cpsw->dev);
846 ret = netif_set_real_num_tx_queues(ndev, cpsw->tx_ch_num);
852 ret = netif_set_real_num_rx_queues(ndev, cpsw->rx_ch_num);
859 if (!cpsw->usage_count)
861 cpsw_slave_open(&cpsw->slaves[priv->emac_port - 1], priv);
864 if (!cpsw->usage_count) {
868 ret = cpsw_create_xdp_rxqs(cpsw);
876 if (cpsw->cpts) {
877 if (cpts_register(cpsw->cpts))
880 writel(0x10, &cpsw->wr_regs->misc_en);
883 napi_enable(&cpsw->napi_rx);
884 napi_enable(&cpsw->napi_tx);
886 if (cpsw->tx_irq_disabled) {
887 cpsw->tx_irq_disabled = false;
888 enable_irq(cpsw->irqs_table[1]);
891 if (cpsw->rx_irq_disabled) {
892 cpsw->rx_irq_disabled = false;
893 enable_irq(cpsw->irqs_table[0]);
900 if (cpsw->coal_intvl != 0) {
903 coal.rx_coalesce_usecs = cpsw->coal_intvl;
907 cpdma_ctlr_start(cpsw->dma);
908 cpsw_intr_enable(cpsw);
909 cpsw->usage_count++;
917 pm_runtime_put_sync(cpsw->dev);
925 struct cpsw_common *cpsw = priv->cpsw;
926 struct cpts *cpts = cpsw->cpts;
942 if (q_idx >= cpsw->tx_ch_num)
943 q_idx = q_idx % cpsw->tx_ch_num;
945 txch = cpsw->txv[q_idx].ch;
986 struct cpsw_common *cpsw = priv->cpsw;
991 slave_no = cpsw_slave_index(cpsw, priv);
995 ret = pm_runtime_get_sync(cpsw->dev);
997 pm_runtime_put_noidle(cpsw->dev);
1001 vid = cpsw->slaves[slave_no].port_vlan;
1004 cpsw_ale_del_ucast(cpsw->ale, priv->mac_addr, HOST_PORT_NUM,
1006 cpsw_ale_add_ucast(cpsw->ale, addr->sa_data, HOST_PORT_NUM,
1011 cpsw_set_slave_mac(&cpsw->slaves[slave_no], priv);
1013 pm_runtime_put(cpsw->dev);
1022 struct cpsw_common *cpsw = priv->cpsw;
1026 if (cpsw_is_switch_en(cpsw)) {
1027 dev_dbg(cpsw->dev, "ndo del vlan is called in switch mode\n");
1031 if (vid == cpsw->data.default_vlan)
1034 ret = pm_runtime_get_sync(cpsw->dev);
1036 pm_runtime_put_noidle(cpsw->dev);
1044 for (i = 0; i < cpsw->data.slaves; i++) {
1045 if (cpsw->slaves[i].ndev &&
1046 vid == cpsw->slaves[i].port_vlan) {
1053 ret = cpsw_ale_del_vlan(cpsw->ale, vid, 0);
1056 ret = cpsw_ale_del_ucast(cpsw->ale, priv->mac_addr,
1061 ret = cpsw_ale_del_mcast(cpsw->ale, priv->ndev->broadcast,
1066 cpsw_ale_flush_multicast(cpsw->ale, ALE_PORT_HOST, vid);
1069 pm_runtime_put(cpsw->dev);
1090 struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
1092 cpsw_intr_disable(cpsw);
1093 cpsw_rx_interrupt(cpsw->irqs_table[0], cpsw);
1094 cpsw_tx_interrupt(cpsw->irqs_table[1], cpsw);
1095 cpsw_intr_enable(cpsw);
1127 struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
1129 ppid->id_len = sizeof(cpsw->base_mac);
1130 memcpy(&ppid->id, &cpsw->base_mac, ppid->id_len);
1160 struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
1163 pdev = to_platform_device(cpsw->dev);
1164 strlcpy(info->driver, "cpsw-switch", sizeof(info->driver));
1172 struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
1176 slave_no = cpsw_slave_index(cpsw, priv);
1177 if (!cpsw->slaves[slave_no].phy)
1180 if (!phy_validate_pause(cpsw->slaves[slave_no].phy, pause))
1186 phy_set_asym_pause(cpsw->slaves[slave_no].phy,
1229 static int cpsw_probe_dt(struct cpsw_common *cpsw)
1231 struct device_node *node = cpsw->dev->of_node, *tmp_node, *port_np;
1232 struct cpsw_platform_data *data = &cpsw->data;
1233 struct device *dev = cpsw->dev;
1362 static void cpsw_remove_dt(struct cpsw_common *cpsw)
1364 struct cpsw_platform_data *data = &cpsw->data;
1367 for (i = 0; i < cpsw->data.slaves; i++) {
1380 static int cpsw_create_ports(struct cpsw_common *cpsw)
1382 struct cpsw_platform_data *data = &cpsw->data;
1384 struct device *dev = cpsw->dev;
1388 for (i = 0; i < cpsw->data.slaves; i++) {
1403 priv->cpsw = cpsw;
1412 dev_info(cpsw->dev, "Detected MACID = %pM\n",
1416 dev_info(cpsw->dev, "Random MACID = %pM\n",
1422 cpsw->slaves[i].ndev = ndev;
1437 netif_napi_add(ndev, &cpsw->napi_rx,
1438 cpsw->quirk_irq ?
1441 netif_tx_napi_add(ndev, &cpsw->napi_tx,
1442 cpsw->quirk_irq ?
1453 static void cpsw_unregister_ports(struct cpsw_common *cpsw)
1457 for (i = 0; i < cpsw->data.slaves; i++) {
1458 if (!cpsw->slaves[i].ndev)
1461 unregister_netdev(cpsw->slaves[i].ndev);
1465 static int cpsw_register_ports(struct cpsw_common *cpsw)
1469 for (i = 0; i < cpsw->data.slaves; i++) {
1470 if (!cpsw->slaves[i].ndev)
1474 ret = register_netdev(cpsw->slaves[i].ndev);
1476 dev_err(cpsw->dev,
1477 "cpsw: err registering net device%d\n", i);
1478 cpsw->slaves[i].ndev = NULL;
1484 cpsw_unregister_ports(cpsw);
1491 struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
1493 return !cpsw->data.dual_emac;
1499 static void cpsw_port_offload_fwd_mark_update(struct cpsw_common *cpsw)
1504 if (!cpsw->ale_bypass &&
1505 (cpsw->br_members == (ALE_PORT_1 | ALE_PORT_2)))
1508 dev_dbg(cpsw->dev, "set offload_fwd_mark %d\n", set_val);
1510 for (i = 0; i < cpsw->data.slaves; i++) {
1511 struct net_device *sl_ndev = cpsw->slaves[i].ndev;
1522 struct cpsw_common *cpsw = priv->cpsw;
1524 if (!cpsw->br_members) {
1525 cpsw->hw_bridge_dev = br_ndev;
1530 if (cpsw->hw_bridge_dev != br_ndev)
1534 cpsw->br_members |= BIT(priv->emac_port);
1536 cpsw_port_offload_fwd_mark_update(cpsw);
1544 struct cpsw_common *cpsw = priv->cpsw;
1546 cpsw->br_members &= ~BIT(priv->emac_port);
1548 cpsw_port_offload_fwd_mark_update(cpsw);
1550 if (!cpsw->br_members)
1551 cpsw->hw_bridge_dev = NULL;
1588 static int cpsw_register_notifiers(struct cpsw_common *cpsw)
1594 dev_err(cpsw->dev, "can't register netdevice notifier\n");
1598 ret = cpsw_switchdev_register_notifiers(cpsw);
1605 static void cpsw_unregister_notifiers(struct cpsw_common *cpsw)
1607 cpsw_switchdev_unregister_notifiers(cpsw);
1618 struct cpsw_common *cpsw = dl_priv->cpsw;
1620 dev_dbg(cpsw->dev, "%s id:%u\n", __func__, id);
1625 ctx->val.vbool = !cpsw->data.dual_emac;
1634 struct cpsw_common *cpsw = dl_priv->cpsw;
1635 int vlan = cpsw->data.default_vlan;
1640 dev_dbg(cpsw->dev, "%s id:%u\n", __func__, id);
1645 if (switch_en == !cpsw->data.dual_emac)
1648 if (!switch_en && cpsw->br_members) {
1649 dev_err(cpsw->dev, "Remove ports from BR before disabling switch mode\n");
1655 for (i = 0; i < cpsw->data.slaves; i++) {
1656 struct cpsw_slave *slave = &cpsw->slaves[i];
1667 cpsw->data.dual_emac = !switch_en;
1668 for (i = 0; i < cpsw->data.slaves; i++) {
1669 struct cpsw_slave *slave = &cpsw->slaves[i];
1676 vlan = cpsw->data.default_vlan;
1685 dev_info(cpsw->dev, "Enable switch mode\n");
1688 cpsw_ale_control_set(cpsw->ale, 0, ALE_BYPASS, 1);
1691 cpsw_ale_control_set(cpsw->ale, 0, ALE_CLEAR, 1);
1692 cpsw_ale_control_get(cpsw->ale, 0, ALE_AGEOUT);
1694 cpsw_init_host_port_switch(cpsw);
1696 for (i = 0; i < cpsw->data.slaves; i++) {
1697 struct cpsw_slave *slave = &cpsw->slaves[i];
1712 cpsw_ale_control_set(cpsw->ale, 0, ALE_BYPASS, 0);
1713 cpsw->data.dual_emac = false;
1715 dev_info(cpsw->dev, "Disable switch mode\n");
1718 cpsw_ale_control_set(cpsw->ale, 0, ALE_BYPASS, 1);
1720 cpsw_ale_control_set(cpsw->ale, 0, ALE_CLEAR, 1);
1721 cpsw_ale_control_get(cpsw->ale, 0, ALE_AGEOUT);
1723 cpsw_init_host_port_dual_mac(cpsw);
1725 for (i = 0; i < cpsw->data.slaves; i++) {
1726 struct cpsw_slave *slave = &cpsw->slaves[i];
1739 cpsw_ale_control_set(cpsw->ale, 0, ALE_BYPASS, 0);
1740 cpsw->data.dual_emac = true;
1752 struct cpsw_common *cpsw = dl_priv->cpsw;
1754 dev_dbg(cpsw->dev, "%s id:%u\n", __func__, id);
1758 ctx->val.vbool = cpsw_ale_control_get(cpsw->ale, 0, ALE_BYPASS);
1771 struct cpsw_common *cpsw = dl_priv->cpsw;
1774 dev_dbg(cpsw->dev, "%s id:%u\n", __func__, id);
1778 ret = cpsw_ale_control_set(cpsw->ale, 0, ALE_BYPASS,
1781 cpsw->ale_bypass = ctx->val.vbool;
1782 cpsw_port_offload_fwd_mark_update(cpsw);
1804 static int cpsw_register_devlink(struct cpsw_common *cpsw)
1806 struct device *dev = cpsw->dev;
1810 cpsw->devlink = devlink_alloc(&cpsw_devlink_ops, sizeof(*dl_priv));
1811 if (!cpsw->devlink)
1814 dl_priv = devlink_priv(cpsw->devlink);
1815 dl_priv->cpsw = cpsw;
1817 ret = devlink_register(cpsw->devlink, dev);
1823 ret = devlink_params_register(cpsw->devlink, cpsw_devlink_params,
1830 devlink_params_publish(cpsw->devlink);
1834 devlink_unregister(cpsw->devlink);
1836 devlink_free(cpsw->devlink);
1840 static void cpsw_unregister_devlink(struct cpsw_common *cpsw)
1842 devlink_params_unpublish(cpsw->devlink);
1843 devlink_params_unregister(cpsw->devlink, cpsw_devlink_params,
1845 devlink_unregister(cpsw->devlink);
1846 devlink_free(cpsw->devlink);
1850 { .compatible = "ti,cpsw-switch"},
1851 { .compatible = "ti,am335x-cpsw-switch"},
1852 { .compatible = "ti,am4372-cpsw-switch"},
1853 { .compatible = "ti,dra7-cpsw-switch"},
1867 struct cpsw_common *cpsw;
1875 cpsw = devm_kzalloc(dev, sizeof(struct cpsw_common), GFP_KERNEL);
1876 if (!cpsw)
1881 cpsw->dev = dev;
1883 cpsw->slaves = devm_kcalloc(dev,
1887 if (!cpsw->slaves)
1903 cpsw->bus_freq_mhz = clk_get_rate(clk) / 1000000;
1911 cpsw->regs = ss_regs;
1916 cpsw->irqs_table[0] = irq;
1921 cpsw->irqs_table[1] = irq;
1926 cpsw->misc_irq = irq;
1928 platform_set_drvdata(pdev, cpsw);
1942 ret = cpsw_probe_dt(cpsw);
1948 cpsw->quirk_irq = true;
1950 cpsw->rx_packet_max = rx_packet_max;
1951 cpsw->descs_pool_size = descs_pool_size;
1952 eth_random_addr(cpsw->base_mac);
1954 ret = cpsw_init_common(cpsw, ss_regs, ale_ageout,
1960 cpsw->wr_regs = cpsw->version == CPSW_VERSION_1 ?
1964 ch = cpsw->quirk_irq ? 0 : 7;
1965 cpsw->txv[0].ch = cpdma_chan_create(cpsw->dma, ch, cpsw_tx_handler, 0);
1966 if (IS_ERR(cpsw->txv[0].ch)) {
1968 ret = PTR_ERR(cpsw->txv[0].ch);
1972 cpsw->rxv[0].ch = cpdma_chan_create(cpsw->dma, 0, cpsw_rx_handler, 1);
1973 if (IS_ERR(cpsw->rxv[0].ch)) {
1975 ret = PTR_ERR(cpsw->rxv[0].ch);
1978 cpsw_split_res(cpsw);
1981 ret = cpsw_create_ports(cpsw);
1993 ret = devm_request_irq(dev, cpsw->irqs_table[0], cpsw_rx_interrupt,
1994 0, dev_name(dev), cpsw);
2000 ret = devm_request_irq(dev, cpsw->irqs_table[1], cpsw_tx_interrupt,
2001 0, dev_name(dev), cpsw);
2007 if (!cpsw->cpts)
2010 ret = devm_request_irq(dev, cpsw->misc_irq, cpsw_misc_interrupt,
2011 0, dev_name(&pdev->dev), cpsw);
2018 cpts_set_irqpoll(cpsw->cpts, false);
2021 ret = cpsw_register_notifiers(cpsw);
2025 ret = cpsw_register_devlink(cpsw);
2029 ret = cpsw_register_ports(cpsw);
2035 cpsw->version, CPSW_MAJOR_VERSION(cpsw->version),
2036 CPSW_MINOR_VERSION(cpsw->version),
2037 CPSW_RTL_VERSION(cpsw->version));
2044 cpsw_unregister_notifiers(cpsw);
2046 cpsw_unregister_ports(cpsw);
2048 cpts_release(cpsw->cpts);
2049 cpdma_ctlr_destroy(cpsw->dma);
2051 cpsw_remove_dt(cpsw);
2059 struct cpsw_common *cpsw = platform_get_drvdata(pdev);
2068 cpsw_unregister_notifiers(cpsw);
2069 cpsw_unregister_devlink(cpsw);
2070 cpsw_unregister_ports(cpsw);
2072 cpts_release(cpsw->cpts);
2073 cpdma_ctlr_destroy(cpsw->dma);
2074 cpsw_remove_dt(cpsw);
2082 struct cpsw_common *cpsw = dev_get_drvdata(dev);
2087 for (i = 0; i < cpsw->data.slaves; i++) {
2088 struct net_device *ndev = cpsw->slaves[i].ndev;
2106 struct cpsw_common *cpsw = dev_get_drvdata(dev);
2115 for (i = 0; i < cpsw->data.slaves; i++) {
2116 struct net_device *ndev = cpsw->slaves[i].ndev;
2133 .name = "cpsw-switch",