Lines Matching defs:cpsw
37 #include "cpsw.h"
53 struct cpsw_common *cpsw;
65 static int cpsw_slave_index_priv(struct cpsw_common *cpsw,
74 static bool cpsw_is_switch_en(struct cpsw_common *cpsw)
76 return !cpsw->data.dual_emac;
81 struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
85 if (cpsw_is_switch_en(cpsw))
92 for (i = 0; i < cpsw->data.slaves; i++)
93 if (cpsw->slaves[i].ndev &&
94 (cpsw->slaves[i].ndev->flags & IFF_PROMISC))
99 dev_dbg(cpsw->dev, "promiscuity not disabled as the other interface is still in promiscuity mode\n");
104 cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM,
107 dev_dbg(cpsw->dev, "promiscuity enabled\n");
110 cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM,
112 dev_dbg(cpsw->dev, "promiscuity disabled\n");
128 struct cpsw_common *cpsw = priv->cpsw;
131 slave_no = cpsw_slave_index(cpsw, priv);
133 vid = cpsw->slaves[slave_no].port_vlan;
139 ret = cpsw_ale_add_mcast(cpsw->ale, addr, mask, flags, vid, 0);
141 ret = cpsw_ale_del_mcast(cpsw->ale, addr, 0, flags, vid);
254 struct cpsw_common *cpsw = priv->cpsw;
259 cpsw_ale_set_allmulti(cpsw->ale, IFF_ALLMULTI, priv->emac_port);
267 cpsw_ale_set_allmulti(cpsw->ale,
289 struct cpsw_common *cpsw;
300 cpsw = ndev_to_cpsw(xmeta->ndev);
302 pkt_size = cpsw->rx_packet_max;
308 ndev = cpsw->slaves[--port].ndev;
312 pool = cpsw->page_pool[ch];
316 if (cpsw->usage_count && status >= 0) {
375 cpts_rx_timestamp(cpsw->cpts, skb);
391 ret = cpdma_chan_submit_mapped(cpsw->rxv[ch].ch, new_page, dma,
402 struct cpsw_common *cpsw = priv->cpsw;
414 ret = cpsw_ale_add_vlan(cpsw->ale, vid, port_mask, 0, port_mask,
419 ret = cpsw_ale_add_ucast(cpsw->ale, priv->mac_addr,
424 ret = cpsw_ale_add_mcast(cpsw->ale, priv->ndev->broadcast,
431 cpsw_ale_del_ucast(cpsw->ale, priv->mac_addr,
434 cpsw_ale_del_vlan(cpsw->ale, vid, 0);
442 struct cpsw_common *cpsw = priv->cpsw;
445 if (cpsw_is_switch_en(cpsw)) {
446 dev_dbg(cpsw->dev, ".ndo_vlan_rx_add_vid called in switch mode\n");
450 if (vid == cpsw->data.default_vlan)
453 ret = pm_runtime_resume_and_get(cpsw->dev);
461 for (i = 0; i < cpsw->data.slaves; i++) {
462 if (cpsw->slaves[i].ndev &&
463 vid == cpsw->slaves[i].port_vlan) {
472 pm_runtime_put(cpsw->dev);
490 struct cpsw_common *cpsw = priv->cpsw;
496 cpsw_mqprio_resume(&cpsw->slaves[priv->emac_port - 1], priv);
499 cpsw_cbs_resume(&cpsw->slaves[priv->emac_port - 1], priv);
504 static void cpsw_init_stp_ale_entry(struct cpsw_common *cpsw)
508 cpsw_ale_add_mcast(cpsw->ale, stpa,
513 static void cpsw_init_host_port_switch(struct cpsw_common *cpsw)
515 int vlan = cpsw->data.default_vlan;
517 writel(CPSW_FIFO_NORMAL_MODE, &cpsw->host_port_regs->tx_in_ctl);
519 writel(vlan, &cpsw->host_port_regs->port_vlan);
521 cpsw_ale_add_vlan(cpsw->ale, vlan, ALE_ALL_PORTS,
525 cpsw_init_stp_ale_entry(cpsw);
527 cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, ALE_P0_UNI_FLOOD, 1);
528 dev_dbg(cpsw->dev, "Set P0_UNI_FLOOD\n");
529 cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, ALE_PORT_NOLEARN, 0);
532 static void cpsw_init_host_port_dual_mac(struct cpsw_common *cpsw)
534 int vlan = cpsw->data.default_vlan;
536 writel(CPSW_FIFO_DUAL_MAC_MODE, &cpsw->host_port_regs->tx_in_ctl);
538 cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, ALE_P0_UNI_FLOOD, 0);
539 dev_dbg(cpsw->dev, "unset P0_UNI_FLOOD\n");
541 writel(vlan, &cpsw->host_port_regs->port_vlan);
543 cpsw_ale_add_vlan(cpsw->ale, vlan, ALE_ALL_PORTS, ALE_ALL_PORTS, 0, 0);
545 cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, ALE_PORT_NOLEARN, 1);
550 struct cpsw_common *cpsw = priv->cpsw;
554 soft_reset("cpsw", &cpsw->regs->soft_reset);
555 cpsw_ale_start(cpsw->ale);
558 cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, ALE_VLAN_AWARE,
560 control_reg = readl(&cpsw->regs->control);
562 writel(control_reg, &cpsw->regs->control);
566 &cpsw->host_port_regs->cpdma_tx_pri_map);
567 writel_relaxed(0, &cpsw->host_port_regs->cpdma_rx_chan_map);
570 writel_relaxed(0, &cpsw->regs->ptype);
573 writel_relaxed(0x7, &cpsw->regs->stat_port_en);
576 writel(0x7, &cpsw->regs->flow_control);
578 if (cpsw_is_switch_en(cpsw))
579 cpsw_init_host_port_switch(cpsw);
581 cpsw_init_host_port_dual_mac(cpsw);
583 cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM,
591 struct cpsw_common *cpsw = priv->cpsw;
594 reg = (cpsw->version == CPSW_VERSION_1) ? CPSW1_PORT_VLAN :
598 cpsw_ale_add_vlan(cpsw->ale, slave->port_vlan, port_mask,
600 cpsw_ale_add_mcast(cpsw->ale, priv->ndev->broadcast,
603 cpsw_ale_add_ucast(cpsw->ale, priv->mac_addr,
606 cpsw_ale_control_set(cpsw->ale, priv->emac_port,
609 cpsw_ale_control_set(cpsw->ale, priv->emac_port,
617 struct cpsw_common *cpsw = priv->cpsw;
620 cpsw_ale_control_set(cpsw->ale, priv->emac_port,
622 cpsw_ale_control_set(cpsw->ale, priv->emac_port,
634 cpsw_ale_control_set(cpsw->ale, priv->emac_port,
637 cpsw_ale_add_mcast(cpsw->ale, priv->ndev->broadcast,
640 cpsw_ale_add_ucast(cpsw->ale, priv->mac_addr,
643 reg = (cpsw->version == CPSW_VERSION_1) ? CPSW1_PORT_VLAN :
651 struct cpsw_common *cpsw = priv->cpsw;
656 slave = &cpsw->slaves[priv->emac_port - 1];
687 cpsw_ale_control_set(cpsw->ale, priv->emac_port,
701 cpsw_ale_control_set(cpsw->ale, priv->emac_port,
714 if (phy->link && cpsw_need_resplit(cpsw))
715 cpsw_split_res(cpsw);
720 struct cpsw_common *cpsw = priv->cpsw;
730 switch (cpsw->version) {
755 cpsw->rx_packet_max);
760 if (cpsw_is_switch_en(cpsw))
793 struct cpsw_common *cpsw = priv->cpsw;
797 slave = &cpsw->slaves[priv->emac_port - 1];
810 if (cpsw->usage_count <= 1) {
811 napi_disable(&cpsw->napi_rx);
812 napi_disable(&cpsw->napi_tx);
813 cpts_unregister(cpsw->cpts);
814 cpsw_intr_disable(cpsw);
815 cpdma_ctlr_stop(cpsw->dma);
816 cpsw_ale_stop(cpsw->ale);
817 cpsw_destroy_xdp_rxqs(cpsw);
820 if (cpsw_need_resplit(cpsw))
821 cpsw_split_res(cpsw);
823 cpsw->usage_count--;
824 pm_runtime_put_sync(cpsw->dev);
831 struct cpsw_common *cpsw = priv->cpsw;
835 cpsw_is_switch_en(cpsw) ? "switch" : "dual_mac");
836 ret = pm_runtime_resume_and_get(cpsw->dev);
841 ret = netif_set_real_num_tx_queues(ndev, cpsw->tx_ch_num);
847 ret = netif_set_real_num_rx_queues(ndev, cpsw->rx_ch_num);
854 if (!cpsw->usage_count)
856 cpsw_slave_open(&cpsw->slaves[priv->emac_port - 1], priv);
859 if (!cpsw->usage_count) {
863 ret = cpsw_create_xdp_rxqs(cpsw);
871 if (cpsw->cpts) {
872 if (cpts_register(cpsw->cpts))
875 writel(0x10, &cpsw->wr_regs->misc_en);
878 napi_enable(&cpsw->napi_rx);
879 napi_enable(&cpsw->napi_tx);
881 if (cpsw->tx_irq_disabled) {
882 cpsw->tx_irq_disabled = false;
883 enable_irq(cpsw->irqs_table[1]);
886 if (cpsw->rx_irq_disabled) {
887 cpsw->rx_irq_disabled = false;
888 enable_irq(cpsw->irqs_table[0]);
895 if (cpsw->coal_intvl != 0) {
898 coal.rx_coalesce_usecs = cpsw->coal_intvl;
902 cpdma_ctlr_start(cpsw->dma);
903 cpsw_intr_enable(cpsw);
904 cpsw->usage_count++;
912 pm_runtime_put_sync(cpsw->dev);
920 struct cpsw_common *cpsw = priv->cpsw;
921 struct cpts *cpts = cpsw->cpts;
937 if (q_idx >= cpsw->tx_ch_num)
938 q_idx = q_idx % cpsw->tx_ch_num;
940 txch = cpsw->txv[q_idx].ch;
981 struct cpsw_common *cpsw = priv->cpsw;
986 slave_no = cpsw_slave_index(cpsw, priv);
990 ret = pm_runtime_resume_and_get(cpsw->dev);
994 vid = cpsw->slaves[slave_no].port_vlan;
997 cpsw_ale_del_ucast(cpsw->ale, priv->mac_addr, HOST_PORT_NUM,
999 cpsw_ale_add_ucast(cpsw->ale, addr->sa_data, HOST_PORT_NUM,
1004 cpsw_set_slave_mac(&cpsw->slaves[slave_no], priv);
1006 pm_runtime_put(cpsw->dev);
1015 struct cpsw_common *cpsw = priv->cpsw;
1019 if (cpsw_is_switch_en(cpsw)) {
1020 dev_dbg(cpsw->dev, "ndo del vlan is called in switch mode\n");
1024 if (vid == cpsw->data.default_vlan)
1027 ret = pm_runtime_resume_and_get(cpsw->dev);
1035 for (i = 0; i < cpsw->data.slaves; i++) {
1036 if (cpsw->slaves[i].ndev &&
1037 vid == cpsw->slaves[i].port_vlan) {
1044 ret = cpsw_ale_del_vlan(cpsw->ale, vid, 0);
1047 ret = cpsw_ale_del_ucast(cpsw->ale, priv->mac_addr,
1052 ret = cpsw_ale_del_mcast(cpsw->ale, priv->ndev->broadcast,
1057 cpsw_ale_flush_multicast(cpsw->ale, ALE_PORT_HOST, vid);
1060 pm_runtime_put(cpsw->dev);
1081 struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
1083 cpsw_intr_disable(cpsw);
1084 cpsw_rx_interrupt(cpsw->irqs_table[0], cpsw);
1085 cpsw_tx_interrupt(cpsw->irqs_table[1], cpsw);
1086 cpsw_intr_enable(cpsw);
1116 struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
1118 ppid->id_len = sizeof(cpsw->base_mac);
1119 memcpy(&ppid->id, &cpsw->base_mac, ppid->id_len);
1149 struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
1152 pdev = to_platform_device(cpsw->dev);
1153 strscpy(info->driver, "cpsw-switch", sizeof(info->driver));
1161 struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
1165 slave_no = cpsw_slave_index(cpsw, priv);
1166 if (!cpsw->slaves[slave_no].phy)
1169 if (!phy_validate_pause(cpsw->slaves[slave_no].phy, pause))
1175 phy_set_asym_pause(cpsw->slaves[slave_no].phy,
1218 static int cpsw_probe_dt(struct cpsw_common *cpsw)
1220 struct device_node *node = cpsw->dev->of_node, *tmp_node, *port_np;
1221 struct cpsw_platform_data *data = &cpsw->data;
1222 struct device *dev = cpsw->dev;
1347 static void cpsw_remove_dt(struct cpsw_common *cpsw)
1349 struct cpsw_platform_data *data = &cpsw->data;
1352 for (i = 0; i < cpsw->data.slaves; i++) {
1365 static int cpsw_create_ports(struct cpsw_common *cpsw)
1367 struct cpsw_platform_data *data = &cpsw->data;
1369 struct device *dev = cpsw->dev;
1373 for (i = 0; i < cpsw->data.slaves; i++) {
1388 priv->cpsw = cpsw;
1397 dev_info(cpsw->dev, "Detected MACID = %pM\n",
1401 dev_info(cpsw->dev, "Random MACID = %pM\n",
1407 cpsw->slaves[i].ndev = ndev;
1426 netif_napi_add(ndev, &cpsw->napi_rx,
1427 cpsw->quirk_irq ? cpsw_rx_poll : cpsw_rx_mq_poll);
1428 netif_napi_add_tx(ndev, &cpsw->napi_tx,
1429 cpsw->quirk_irq ?
1439 static void cpsw_unregister_ports(struct cpsw_common *cpsw)
1443 for (i = 0; i < cpsw->data.slaves; i++) {
1444 if (!cpsw->slaves[i].ndev)
1447 unregister_netdev(cpsw->slaves[i].ndev);
1451 static int cpsw_register_ports(struct cpsw_common *cpsw)
1455 for (i = 0; i < cpsw->data.slaves; i++) {
1456 if (!cpsw->slaves[i].ndev)
1460 ret = register_netdev(cpsw->slaves[i].ndev);
1462 dev_err(cpsw->dev,
1463 "cpsw: err registering net device%d\n", i);
1464 cpsw->slaves[i].ndev = NULL;
1470 cpsw_unregister_ports(cpsw);
1477 struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
1479 return !cpsw->data.dual_emac;
1485 static void cpsw_port_offload_fwd_mark_update(struct cpsw_common *cpsw)
1490 if (!cpsw->ale_bypass &&
1491 (cpsw->br_members == (ALE_PORT_1 | ALE_PORT_2)))
1494 dev_dbg(cpsw->dev, "set offload_fwd_mark %d\n", set_val);
1496 for (i = 0; i < cpsw->data.slaves; i++) {
1497 struct net_device *sl_ndev = cpsw->slaves[i].ndev;
1509 struct cpsw_common *cpsw = priv->cpsw;
1512 if (!cpsw->br_members) {
1513 cpsw->hw_bridge_dev = br_ndev;
1518 if (cpsw->hw_bridge_dev != br_ndev)
1527 cpsw->br_members |= BIT(priv->emac_port);
1529 cpsw_port_offload_fwd_mark_update(cpsw);
1537 struct cpsw_common *cpsw = priv->cpsw;
1541 cpsw->br_members &= ~BIT(priv->emac_port);
1543 cpsw_port_offload_fwd_mark_update(cpsw);
1545 if (!cpsw->br_members)
1546 cpsw->hw_bridge_dev = NULL;
1585 static int cpsw_register_notifiers(struct cpsw_common *cpsw)
1591 dev_err(cpsw->dev, "can't register netdevice notifier\n");
1595 ret = cpsw_switchdev_register_notifiers(cpsw);
1602 static void cpsw_unregister_notifiers(struct cpsw_common *cpsw)
1604 cpsw_switchdev_unregister_notifiers(cpsw);
1615 struct cpsw_common *cpsw = dl_priv->cpsw;
1617 dev_dbg(cpsw->dev, "%s id:%u\n", __func__, id);
1622 ctx->val.vbool = !cpsw->data.dual_emac;
1631 struct cpsw_common *cpsw = dl_priv->cpsw;
1632 int vlan = cpsw->data.default_vlan;
1637 dev_dbg(cpsw->dev, "%s id:%u\n", __func__, id);
1642 if (switch_en == !cpsw->data.dual_emac)
1645 if (!switch_en && cpsw->br_members) {
1646 dev_err(cpsw->dev, "Remove ports from BR before disabling switch mode\n");
1652 for (i = 0; i < cpsw->data.slaves; i++) {
1653 struct cpsw_slave *slave = &cpsw->slaves[i];
1664 cpsw->data.dual_emac = !switch_en;
1665 for (i = 0; i < cpsw->data.slaves; i++) {
1666 struct cpsw_slave *slave = &cpsw->slaves[i];
1673 vlan = cpsw->data.default_vlan;
1682 dev_info(cpsw->dev, "Enable switch mode\n");
1685 cpsw_ale_control_set(cpsw->ale, 0, ALE_BYPASS, 1);
1688 cpsw_ale_control_set(cpsw->ale, 0, ALE_CLEAR, 1);
1689 cpsw_ale_control_get(cpsw->ale, 0, ALE_AGEOUT);
1691 cpsw_init_host_port_switch(cpsw);
1693 for (i = 0; i < cpsw->data.slaves; i++) {
1694 struct cpsw_slave *slave = &cpsw->slaves[i];
1709 cpsw_ale_control_set(cpsw->ale, 0, ALE_BYPASS, 0);
1710 cpsw->data.dual_emac = false;
1712 dev_info(cpsw->dev, "Disable switch mode\n");
1715 cpsw_ale_control_set(cpsw->ale, 0, ALE_BYPASS, 1);
1717 cpsw_ale_control_set(cpsw->ale, 0, ALE_CLEAR, 1);
1718 cpsw_ale_control_get(cpsw->ale, 0, ALE_AGEOUT);
1720 cpsw_init_host_port_dual_mac(cpsw);
1722 for (i = 0; i < cpsw->data.slaves; i++) {
1723 struct cpsw_slave *slave = &cpsw->slaves[i];
1736 cpsw_ale_control_set(cpsw->ale, 0, ALE_BYPASS, 0);
1737 cpsw->data.dual_emac = true;
1749 struct cpsw_common *cpsw = dl_priv->cpsw;
1751 dev_dbg(cpsw->dev, "%s id:%u\n", __func__, id);
1755 ctx->val.vbool = cpsw_ale_control_get(cpsw->ale, 0, ALE_BYPASS);
1768 struct cpsw_common *cpsw = dl_priv->cpsw;
1771 dev_dbg(cpsw->dev, "%s id:%u\n", __func__, id);
1775 ret = cpsw_ale_control_set(cpsw->ale, 0, ALE_BYPASS,
1778 cpsw->ale_bypass = ctx->val.vbool;
1779 cpsw_port_offload_fwd_mark_update(cpsw);
1801 static int cpsw_register_devlink(struct cpsw_common *cpsw)
1803 struct device *dev = cpsw->dev;
1807 cpsw->devlink = devlink_alloc(&cpsw_devlink_ops, sizeof(*dl_priv), dev);
1808 if (!cpsw->devlink)
1811 dl_priv = devlink_priv(cpsw->devlink);
1812 dl_priv->cpsw = cpsw;
1814 ret = devlink_params_register(cpsw->devlink, cpsw_devlink_params,
1821 devlink_register(cpsw->devlink);
1825 devlink_free(cpsw->devlink);
1829 static void cpsw_unregister_devlink(struct cpsw_common *cpsw)
1831 devlink_unregister(cpsw->devlink);
1832 devlink_params_unregister(cpsw->devlink, cpsw_devlink_params,
1834 devlink_free(cpsw->devlink);
1838 { .compatible = "ti,cpsw-switch"},
1839 { .compatible = "ti,am335x-cpsw-switch"},
1840 { .compatible = "ti,am4372-cpsw-switch"},
1841 { .compatible = "ti,dra7-cpsw-switch"},
1855 struct cpsw_common *cpsw;
1863 cpsw = devm_kzalloc(dev, sizeof(struct cpsw_common), GFP_KERNEL);
1864 if (!cpsw)
1869 cpsw->dev = dev;
1871 cpsw->slaves = devm_kcalloc(dev,
1875 if (!cpsw->slaves)
1891 cpsw->bus_freq_mhz = clk_get_rate(clk) / 1000000;
1898 cpsw->regs = ss_regs;
1903 cpsw->irqs_table[0] = irq;
1908 cpsw->irqs_table[1] = irq;
1913 cpsw->misc_irq = irq;
1915 platform_set_drvdata(pdev, cpsw);
1928 ret = cpsw_probe_dt(cpsw);
1934 cpsw->quirk_irq = true;
1936 cpsw->rx_packet_max = rx_packet_max;
1937 cpsw->descs_pool_size = descs_pool_size;
1938 eth_random_addr(cpsw->base_mac);
1940 ret = cpsw_init_common(cpsw, ss_regs, ale_ageout,
1946 cpsw->wr_regs = cpsw->version == CPSW_VERSION_1 ?
1950 ch = cpsw->quirk_irq ? 0 : 7;
1951 cpsw->txv[0].ch = cpdma_chan_create(cpsw->dma, ch, cpsw_tx_handler, 0);
1952 if (IS_ERR(cpsw->txv[0].ch)) {
1954 ret = PTR_ERR(cpsw->txv[0].ch);
1958 cpsw->rxv[0].ch = cpdma_chan_create(cpsw->dma, 0, cpsw_rx_handler, 1);
1959 if (IS_ERR(cpsw->rxv[0].ch)) {
1961 ret = PTR_ERR(cpsw->rxv[0].ch);
1964 cpsw_split_res(cpsw);
1967 ret = cpsw_create_ports(cpsw);
1979 ret = devm_request_irq(dev, cpsw->irqs_table[0], cpsw_rx_interrupt,
1980 0, dev_name(dev), cpsw);
1986 ret = devm_request_irq(dev, cpsw->irqs_table[1], cpsw_tx_interrupt,
1987 0, dev_name(dev), cpsw);
1993 if (!cpsw->cpts)
1996 ret = devm_request_irq(dev, cpsw->misc_irq, cpsw_misc_interrupt,
1997 0, dev_name(&pdev->dev), cpsw);
2004 cpts_set_irqpoll(cpsw->cpts, false);
2007 ret = cpsw_register_notifiers(cpsw);
2011 ret = cpsw_register_devlink(cpsw);
2015 ret = cpsw_register_ports(cpsw);
2021 cpsw->version, CPSW_MAJOR_VERSION(cpsw->version),
2022 CPSW_MINOR_VERSION(cpsw->version),
2023 CPSW_RTL_VERSION(cpsw->version));
2030 cpsw_unregister_notifiers(cpsw);
2032 cpsw_unregister_ports(cpsw);
2034 cpts_release(cpsw->cpts);
2035 cpdma_ctlr_destroy(cpsw->dma);
2037 cpsw_remove_dt(cpsw);
2045 struct cpsw_common *cpsw = platform_get_drvdata(pdev);
2052 cpsw_unregister_notifiers(cpsw);
2053 cpsw_unregister_devlink(cpsw);
2054 cpsw_unregister_ports(cpsw);
2056 cpts_release(cpsw->cpts);
2057 cpdma_ctlr_destroy(cpsw->dma);
2058 cpsw_remove_dt(cpsw);
2066 struct cpsw_common *cpsw = dev_get_drvdata(dev);
2071 for (i = 0; i < cpsw->data.slaves; i++) {
2072 struct net_device *ndev = cpsw->slaves[i].ndev;
2090 struct cpsw_common *cpsw = dev_get_drvdata(dev);
2099 for (i = 0; i < cpsw->data.slaves; i++) {
2100 struct net_device *ndev = cpsw->slaves[i].ndev;
2117 .name = "cpsw-switch",