Lines Matching full:emac

53 static int emac_get_tx_ts(struct prueth_emac *emac,  in emac_get_tx_ts()  argument
56 struct prueth *prueth = emac->prueth; in emac_get_tx_ts()
57 int slice = prueth_emac_slice(emac); in emac_get_tx_ts()
73 static void tx_ts_work(struct prueth_emac *emac) in tx_ts_work() argument
84 ret = emac_get_tx_ts(emac, &tsr); in tx_ts_work()
89 !emac->tx_ts_skb[tsr.cookie]) { in tx_ts_work()
90 netdev_err(emac->ndev, "Invalid TX TS cookie 0x%x\n", in tx_ts_work()
95 skb = emac->tx_ts_skb[tsr.cookie]; in tx_ts_work()
96 emac->tx_ts_skb[tsr.cookie] = NULL; /* free slot */ in tx_ts_work()
98 netdev_err(emac->ndev, "Driver Bug! got NULL skb\n"); in tx_ts_work()
102 hi_sw = readl(emac->prueth->shram.va + in tx_ts_work()
113 if (atomic_dec_and_test(&emac->tx_ts_pending)) /* no more? */ in tx_ts_work()
120 struct prueth_emac *emac = dev_id; in prueth_tx_ts_irq() local
123 tx_ts_work(emac); in prueth_tx_ts_irq()
243 struct prueth_emac *emac; in prueth_emac_common_start() local
247 if (!prueth->emac[ICSS_SLICE0] && !prueth->emac[ICSS_SLICE1]) in prueth_emac_common_start()
263 emac = prueth->emac[slice]; in prueth_emac_common_start()
264 if (!emac) in prueth_emac_common_start()
266 ret = icssg_config(prueth, emac, slice); in prueth_emac_common_start()
275 emac = prueth->emac[ICSS_SLICE0] ? prueth->emac[ICSS_SLICE0] : in prueth_emac_common_start()
276 prueth->emac[ICSS_SLICE1]; in prueth_emac_common_start()
277 ret = icss_iep_init(emac->iep, &prueth_iep_clockops, in prueth_emac_common_start()
278 emac, IEP_DEFAULT_CYCLE_TIME_NS); in prueth_emac_common_start()
298 struct prueth_emac *emac; in prueth_emac_common_stop() local
300 if (!prueth->emac[ICSS_SLICE0] && !prueth->emac[ICSS_SLICE1]) in prueth_emac_common_stop()
308 emac = prueth->emac[ICSS_SLICE0] ? prueth->emac[ICSS_SLICE0] : in prueth_emac_common_stop()
309 prueth->emac[ICSS_SLICE1]; in prueth_emac_common_stop()
310 icss_iep_exit(emac->iep); in prueth_emac_common_stop()
318 struct prueth_emac *emac = netdev_priv(ndev); in emac_adjust_link() local
320 struct prueth *prueth = emac->prueth; in emac_adjust_link()
326 if (phydev->duplex != emac->duplex) { in emac_adjust_link()
328 emac->duplex = phydev->duplex; in emac_adjust_link()
330 if (phydev->speed != emac->speed) { in emac_adjust_link()
332 emac->speed = phydev->speed; in emac_adjust_link()
334 if (!emac->link) { in emac_adjust_link()
336 emac->link = 1; in emac_adjust_link()
338 } else if (emac->link) { in emac_adjust_link()
340 emac->link = 0; in emac_adjust_link()
343 emac->speed = SPEED_1000; in emac_adjust_link()
346 emac->duplex = DUPLEX_FULL; in emac_adjust_link()
355 if (emac->link) { in emac_adjust_link()
356 if (emac->duplex == DUPLEX_HALF) in emac_adjust_link()
357 icssg_config_half_duplex(emac); in emac_adjust_link()
359 icssg_update_rgmii_cfg(prueth->miig_rt, emac); in emac_adjust_link()
362 spin_lock_irqsave(&emac->lock, flags); in emac_adjust_link()
363 icssg_config_ipg(emac); in emac_adjust_link()
364 spin_unlock_irqrestore(&emac->lock, flags); in emac_adjust_link()
365 icssg_config_set_speed(emac); in emac_adjust_link()
366 icssg_set_port_state(emac, ICSSG_EMAC_PORT_FORWARD); in emac_adjust_link()
369 icssg_set_port_state(emac, ICSSG_EMAC_PORT_DISABLE); in emac_adjust_link()
373 if (emac->link) { in emac_adjust_link()
378 prueth_cleanup_tx_ts(emac); in emac_adjust_link()
384 struct prueth_emac *emac = in emac_rx_timer_callback() local
388 enable_irq(emac->rx_chns.irq[rx_flow]); in emac_rx_timer_callback()
392 static int emac_phy_connect(struct prueth_emac *emac) in emac_phy_connect() argument
394 struct prueth *prueth = emac->prueth; in emac_phy_connect()
395 struct net_device *ndev = emac->ndev; in emac_phy_connect()
397 ndev->phydev = of_phy_connect(emac->ndev, emac->phy_node, in emac_phy_connect()
399 emac->phy_if); in emac_phy_connect()
402 emac->phy_node->full_name); in emac_phy_connect()
406 if (!emac->half_duplex) { in emac_phy_connect()
417 if (emac->phy_if == PHY_INTERFACE_MODE_MII) in emac_phy_connect()
426 struct prueth_emac *emac = clockops_data; in prueth_iep_gettime() local
427 struct prueth *prueth = emac->prueth; in prueth_iep_gettime()
440 iepcount_hi = icss_iep_get_count_hi(emac->iep); in prueth_iep_gettime()
444 iepcount_lo = icss_iep_get_count_low(emac->iep); in prueth_iep_gettime()
447 iepcount_hi_r = icss_iep_get_count_hi(emac->iep); in prueth_iep_gettime()
463 struct prueth_emac *emac = clockops_data; in prueth_iep_settime() local
469 sc_descp = emac->prueth->shram.va + TIMESYNC_FW_WC_SETCLOCK_DESC_OFFSET; in prueth_iep_settime()
479 /* Count from 0 to (cycle time) - emac->iep->def_inc */ in prueth_iep_settime()
480 sc_desc.CMP0_current = cycletime - emac->iep->def_inc; in prueth_iep_settime()
494 dev_err(emac->prueth->dev, "settime timeout\n"); in prueth_iep_settime()
501 struct prueth_emac *emac = clockops_data; in prueth_perout_enable() local
541 writel(reduction_factor, emac->prueth->shram.va + in prueth_perout_enable()
544 current_cycle = icssg_read_time(emac->prueth->shram.va + in prueth_perout_enable()
550 hi_lo_writeq(start_offset, emac->prueth->shram.va + in prueth_perout_enable()
565 struct prueth_emac *emac; in icssg_prueth_add_mcast() local
571 emac = netdev_priv(real_dev); in icssg_prueth_add_mcast()
573 port_mask = BIT(emac->port_id) | icssg_fdb_lookup(emac, addr, vlan_id); in icssg_prueth_add_mcast()
574 icssg_fdb_add_del(emac, addr, vlan_id, port_mask, true); in icssg_prueth_add_mcast()
575 icssg_vtbl_modify(emac, vlan_id, port_mask, port_mask, true); in icssg_prueth_add_mcast()
583 struct prueth_emac *emac; in icssg_prueth_del_mcast() local
590 emac = netdev_priv(real_dev); in icssg_prueth_del_mcast()
592 port_mask = BIT(emac->port_id); in icssg_prueth_del_mcast()
593 other_port_mask = port_mask ^ icssg_fdb_lookup(emac, addr, vlan_id); in icssg_prueth_del_mcast()
595 icssg_fdb_add_del(emac, addr, vlan_id, port_mask, false); in icssg_prueth_del_mcast()
596 icssg_vtbl_modify(emac, vlan_id, port_mask, port_mask, false); in icssg_prueth_del_mcast()
599 icssg_fdb_add_del(emac, addr, vlan_id, other_port_mask, true); in icssg_prueth_del_mcast()
600 icssg_vtbl_modify(emac, vlan_id, other_port_mask, in icssg_prueth_del_mcast()
607 static void icssg_prueth_hsr_fdb_add_del(struct prueth_emac *emac, in icssg_prueth_hsr_fdb_add_del() argument
610 icssg_fdb_add_del(emac, addr, vid, in icssg_prueth_hsr_fdb_add_del()
617 icssg_vtbl_modify(emac, vid, BIT(emac->port_id), in icssg_prueth_hsr_fdb_add_del()
618 BIT(emac->port_id), add); in icssg_prueth_hsr_fdb_add_del()
624 struct prueth_emac *emac; in icssg_prueth_hsr_add_mcast() local
632 emac = netdev_priv(hsr_get_port_ndev(real_dev, i)); in icssg_prueth_hsr_add_mcast()
633 if (!emac) in icssg_prueth_hsr_add_mcast()
635 icssg_prueth_hsr_fdb_add_del(emac, addr, vlan_id, in icssg_prueth_hsr_add_mcast()
639 emac = netdev_priv(real_dev); in icssg_prueth_hsr_add_mcast()
640 icssg_prueth_hsr_fdb_add_del(emac, addr, vlan_id, true); in icssg_prueth_hsr_add_mcast()
649 struct prueth_emac *emac; in icssg_prueth_hsr_del_mcast() local
657 emac = netdev_priv(hsr_get_port_ndev(real_dev, i)); in icssg_prueth_hsr_del_mcast()
658 if (!emac) in icssg_prueth_hsr_del_mcast()
660 icssg_prueth_hsr_fdb_add_del(emac, addr, vlan_id, in icssg_prueth_hsr_del_mcast()
664 emac = netdev_priv(real_dev); in icssg_prueth_hsr_del_mcast()
665 icssg_prueth_hsr_fdb_add_del(emac, addr, vlan_id, false); in icssg_prueth_hsr_del_mcast()
674 struct prueth_emac *emac = args; in icssg_update_vlan_mcast() local
680 __hw_addr_sync_multiple(&emac->vlan_mcast_list[vid], &vdev->mc, in icssg_update_vlan_mcast()
684 if (emac->prueth->is_hsr_offload_mode) in icssg_update_vlan_mcast()
685 __hw_addr_sync_dev(&emac->vlan_mcast_list[vid], vdev, in icssg_update_vlan_mcast()
689 __hw_addr_sync_dev(&emac->vlan_mcast_list[vid], vdev, in icssg_update_vlan_mcast()
697 * emac_ndo_open - EMAC device open
706 struct prueth_emac *emac = netdev_priv(ndev); in emac_ndo_open() local
707 int ret, i, num_data_chn = emac->tx_ch_num; in emac_ndo_open()
709 struct prueth *prueth = emac->prueth; in emac_ndo_open()
710 int slice = prueth_emac_slice(emac); in emac_ndo_open()
716 ether_addr_copy(emac->mac_addr, ndev->dev_addr); in emac_ndo_open()
718 icssg_class_set_mac_addr(prueth->miig_rt, slice, emac->mac_addr); in emac_ndo_open()
719 icssg_ft1_set_mac_addr(prueth->miig_rt, slice, emac->mac_addr); in emac_ndo_open()
728 init_completion(&emac->cmd_complete); in emac_ndo_open()
729 ret = prueth_init_tx_chns(emac); in emac_ndo_open()
736 ret = prueth_init_rx_chns(emac, &emac->rx_chns, "rx", in emac_ndo_open()
743 ret = prueth_ndev_add_tx_napi(emac); in emac_ndo_open()
749 ret = request_irq(emac->rx_chns.irq[rx_flow], prueth_rx_irq, in emac_ndo_open()
750 IRQF_TRIGGER_HIGH, dev_name(dev), emac); in emac_ndo_open()
762 flow_cfg = emac->dram.va + ICSSG_CONFIG_OFFSET + PSI_L_REGULAR_FLOW_ID_BASE_OFFSET; in emac_ndo_open()
763 writew(emac->rx_flow_id_base, &flow_cfg->rx_base_flow); in emac_ndo_open()
764 ret = emac_fdb_flow_id_updated(emac); in emac_ndo_open()
773 ret = request_threaded_irq(emac->tx_ts_irq, NULL, prueth_tx_ts_irq, in emac_ndo_open()
774 IRQF_ONESHOT, dev_name(dev), emac); in emac_ndo_open()
779 ret = prueth_prepare_rx_chan(emac, &emac->rx_chns, PRUETH_MAX_PKT_SIZE); in emac_ndo_open()
783 ret = k3_udma_glue_enable_rx_chn(emac->rx_chns.rx_chn); in emac_ndo_open()
787 for (i = 0; i < emac->tx_ch_num; i++) { in emac_ndo_open()
788 ret = k3_udma_glue_enable_tx_chn(emac->tx_chns[i].tx_chn); in emac_ndo_open()
794 for (i = 0; i < emac->tx_ch_num; i++) in emac_ndo_open()
795 napi_enable(&emac->tx_chns[i].napi_tx); in emac_ndo_open()
796 napi_enable(&emac->napi_rx); in emac_ndo_open()
803 queue_work(system_long_wq, &emac->stats_work.work); in emac_ndo_open()
811 prueth_reset_tx_chan(emac, i, false); in emac_ndo_open()
813 prueth_reset_rx_chan(&emac->rx_chns, max_rx_flows, false); in emac_ndo_open()
815 free_irq(emac->tx_ts_irq, emac); in emac_ndo_open()
820 free_irq(emac->rx_chns.irq[rx_flow], emac); in emac_ndo_open()
822 prueth_ndev_del_tx_napi(emac, emac->tx_ch_num); in emac_ndo_open()
824 prueth_cleanup_rx_chns(emac, &emac->rx_chns, max_rx_flows); in emac_ndo_open()
826 prueth_cleanup_tx_chns(emac); in emac_ndo_open()
832 * emac_ndo_stop - EMAC device stop
841 struct prueth_emac *emac = netdev_priv(ndev); in emac_ndo_stop() local
842 struct prueth *prueth = emac->prueth; in emac_ndo_stop()
854 if (emac->prueth->is_hsr_offload_mode) in emac_ndo_stop()
859 atomic_set(&emac->tdown_cnt, emac->tx_ch_num); in emac_ndo_stop()
863 reinit_completion(&emac->tdown_complete); in emac_ndo_stop()
864 for (i = 0; i < emac->tx_ch_num; i++) in emac_ndo_stop()
865 k3_udma_glue_tdown_tx_chn(emac->tx_chns[i].tx_chn, false); in emac_ndo_stop()
867 ret = wait_for_completion_timeout(&emac->tdown_complete, in emac_ndo_stop()
872 prueth_reset_tx_chan(emac, emac->tx_ch_num, true); in emac_ndo_stop()
873 for (i = 0; i < emac->tx_ch_num; i++) { in emac_ndo_stop()
874 napi_disable(&emac->tx_chns[i].napi_tx); in emac_ndo_stop()
875 hrtimer_cancel(&emac->tx_chns[i].tx_hrtimer); in emac_ndo_stop()
879 k3_udma_glue_tdown_rx_chn(emac->rx_chns.rx_chn, true); in emac_ndo_stop()
881 prueth_reset_rx_chan(&emac->rx_chns, max_rx_flows, true); in emac_ndo_stop()
883 napi_disable(&emac->napi_rx); in emac_ndo_stop()
884 hrtimer_cancel(&emac->rx_hrtimer); in emac_ndo_stop()
886 cancel_work_sync(&emac->rx_mode_work); in emac_ndo_stop()
889 cancel_delayed_work_sync(&emac->stats_work); in emac_ndo_stop()
895 free_irq(emac->tx_ts_irq, emac); in emac_ndo_stop()
897 free_irq(emac->rx_chns.irq[rx_flow], emac); in emac_ndo_stop()
898 prueth_ndev_del_tx_napi(emac, emac->tx_ch_num); in emac_ndo_stop()
900 prueth_cleanup_rx_chns(emac, &emac->rx_chns, max_rx_flows); in emac_ndo_stop()
901 prueth_cleanup_tx_chns(emac); in emac_ndo_stop()
910 struct prueth_emac *emac = container_of(work, struct prueth_emac, rx_mode_work); in emac_ndo_set_rx_mode_work() local
911 struct net_device *ndev = emac->ndev; in emac_ndo_set_rx_mode_work()
919 icssg_set_port_state(emac, ICSSG_EMAC_PORT_UC_FLOODING_DISABLE); in emac_ndo_set_rx_mode_work()
920 icssg_set_port_state(emac, ICSSG_EMAC_PORT_MC_FLOODING_DISABLE); in emac_ndo_set_rx_mode_work()
923 icssg_set_port_state(emac, ICSSG_EMAC_PORT_UC_FLOODING_ENABLE); in emac_ndo_set_rx_mode_work()
924 icssg_set_port_state(emac, ICSSG_EMAC_PORT_MC_FLOODING_ENABLE); in emac_ndo_set_rx_mode_work()
929 icssg_set_port_state(emac, ICSSG_EMAC_PORT_MC_FLOODING_ENABLE); in emac_ndo_set_rx_mode_work()
933 if (emac->prueth->is_hsr_offload_mode) { in emac_ndo_set_rx_mode_work()
937 vlan_for_each(emac->prueth->hsr_dev, in emac_ndo_set_rx_mode_work()
938 icssg_update_vlan_mcast, emac); in emac_ndo_set_rx_mode_work()
945 vlan_for_each(ndev, icssg_update_vlan_mcast, emac); in emac_ndo_set_rx_mode_work()
952 * emac_ndo_set_rx_mode - EMAC set receive mode function
953 * @ndev: The EMAC network adapter
960 struct prueth_emac *emac = netdev_priv(ndev); in emac_ndo_set_rx_mode() local
962 queue_work(emac->cmd_wq, &emac->rx_mode_work); in emac_ndo_set_rx_mode()
991 struct prueth_emac *emac = netdev_priv(ndev); in emac_ndo_vlan_rx_add_vid() local
992 struct prueth *prueth = emac->prueth; in emac_ndo_vlan_rx_add_vid()
993 int port_mask = BIT(emac->port_id); in emac_ndo_vlan_rx_add_vid()
999 __hw_addr_init(&emac->vlan_mcast_list[vid]); in emac_ndo_vlan_rx_add_vid()
1000 netdev_dbg(emac->ndev, "VID add vid:%u port_mask:%X untag_mask %X\n", in emac_ndo_vlan_rx_add_vid()
1003 icssg_vtbl_modify(emac, vid, port_mask, untag_mask, true); in emac_ndo_vlan_rx_add_vid()
1004 icssg_set_pvid(emac->prueth, vid, emac->port_id); in emac_ndo_vlan_rx_add_vid()
1012 struct prueth_emac *emac = netdev_priv(ndev); in emac_ndo_vlan_rx_del_vid() local
1013 struct prueth *prueth = emac->prueth; in emac_ndo_vlan_rx_del_vid()
1014 int port_mask = BIT(emac->port_id); in emac_ndo_vlan_rx_del_vid()
1020 netdev_dbg(emac->ndev, "VID del vid:%u port_mask:%X untag_mask %X\n", in emac_ndo_vlan_rx_del_vid()
1022 icssg_vtbl_modify(emac, vid, port_mask, untag_mask, false); in emac_ndo_vlan_rx_del_vid()
1047 struct prueth_emac *emac; in prueth_netdev_init() local
1061 ndev = alloc_etherdev_mq(sizeof(*emac), num_tx_chn); in prueth_netdev_init()
1065 emac = netdev_priv(ndev); in prueth_netdev_init()
1066 emac->prueth = prueth; in prueth_netdev_init()
1067 emac->ndev = ndev; in prueth_netdev_init()
1068 emac->port_id = port; in prueth_netdev_init()
1069 emac->cmd_wq = create_singlethread_workqueue("icssg_cmd_wq"); in prueth_netdev_init()
1070 if (!emac->cmd_wq) { in prueth_netdev_init()
1074 INIT_WORK(&emac->rx_mode_work, emac_ndo_set_rx_mode_work); in prueth_netdev_init()
1076 INIT_DELAYED_WORK(&emac->stats_work, icssg_stats_work_handler); in prueth_netdev_init()
1081 &emac->dram); in prueth_netdev_init()
1088 emac->tx_ch_num = 1; in prueth_netdev_init()
1091 if (emac->port_id == PRUETH_PORT_MII1) in prueth_netdev_init()
1093 emac->tx_ts_irq = platform_get_irq_byname_optional(prueth->pdev, irq_name); in prueth_netdev_init()
1094 if (emac->tx_ts_irq < 0) { in prueth_netdev_init()
1095 ret = dev_err_probe(prueth->dev, emac->tx_ts_irq, "could not get tx_ts_irq\n"); in prueth_netdev_init()
1100 spin_lock_init(&emac->lock); in prueth_netdev_init()
1101 mutex_init(&emac->cmd_lock); in prueth_netdev_init()
1103 emac->phy_node = of_parse_phandle(eth_node, "phy-handle", 0); in prueth_netdev_init()
1104 if (!emac->phy_node && !of_phy_is_fixed_link(eth_node)) { in prueth_netdev_init()
1116 emac->phy_node = eth_node; in prueth_netdev_init()
1119 ret = of_get_phy_mode(eth_node, &emac->phy_if); in prueth_netdev_init()
1125 if (emac->phy_if != PHY_INTERFACE_MODE_MII && in prueth_netdev_init()
1126 !phy_interface_mode_is_rgmii(emac->phy_if)) { in prueth_netdev_init()
1127 dev_err(prueth->dev, "PHY mode unsupported %s\n", phy_modes(emac->phy_if)); in prueth_netdev_init()
1137 switch (emac->phy_if) { in prueth_netdev_init()
1139 emac->phy_if = PHY_INTERFACE_MODE_RGMII_RXID; in prueth_netdev_init()
1142 emac->phy_if = PHY_INTERFACE_MODE_RGMII; in prueth_netdev_init()
1160 ether_addr_copy(emac->mac_addr, ndev->dev_addr); in prueth_netdev_init()
1171 netif_napi_add(ndev, &emac->napi_rx, icssg_napi_rx_poll); in prueth_netdev_init()
1172 hrtimer_init(&emac->rx_hrtimer, CLOCK_MONOTONIC, in prueth_netdev_init()
1174 emac->rx_hrtimer.function = &emac_rx_timer_callback; in prueth_netdev_init()
1175 prueth->emac[mac] = emac; in prueth_netdev_init()
1180 pruss_release_mem_region(prueth->pruss, &emac->dram); in prueth_netdev_init()
1182 destroy_workqueue(emac->cmd_wq); in prueth_netdev_init()
1184 emac->ndev = NULL; in prueth_netdev_init()
1185 prueth->emac[mac] = NULL; in prueth_netdev_init()
1194 struct prueth_emac *emac = netdev_priv(ndev); in prueth_dev_check() local
1196 return emac->prueth->is_switch_mode; in prueth_dev_check()
1213 struct prueth_emac *emac = prueth->emac[i]; in prueth_offload_fwd_mark_update() local
1215 if (!emac || !emac->ndev) in prueth_offload_fwd_mark_update()
1218 emac->offload_fwd_mark = set_val; in prueth_offload_fwd_mark_update()
1224 struct prueth_emac *emac0 = prueth->emac[PRUETH_MAC0]; in prueth_emac_restart()
1225 struct prueth_emac *emac1 = prueth->emac[PRUETH_MAC1]; in prueth_emac_restart()
1267 struct prueth_emac *emac; in icssg_change_mode() local
1277 emac = prueth->emac[mac]; in icssg_change_mode()
1279 if (emac->ndev->features & NETIF_F_HW_HSR_TAG_RM) in icssg_change_mode()
1280 icssg_set_port_state(emac, ICSSG_EMAC_HSR_RX_OFFLOAD_ENABLE); in icssg_change_mode()
1282 icssg_set_port_state(emac, ICSSG_EMAC_HSR_RX_OFFLOAD_DISABLE); in icssg_change_mode()
1285 if (netif_running(emac->ndev)) { in icssg_change_mode()
1286 icssg_fdb_add_del(emac, eth_stp_addr, prueth->default_vlan, in icssg_change_mode()
1292 icssg_vtbl_modify(emac, emac->port_vlan | DEFAULT_VID, in icssg_change_mode()
1293 BIT(emac->port_id) | DEFAULT_PORT_MASK, in icssg_change_mode()
1294 BIT(emac->port_id) | DEFAULT_UNTAG_MASK, in icssg_change_mode()
1297 icssg_vtbl_modify(emac, DEFAULT_VID, in icssg_change_mode()
1300 icssg_set_pvid(prueth, emac->port_vlan, emac->port_id); in icssg_change_mode()
1302 icssg_set_port_state(emac, ICSSG_EMAC_PORT_VLAN_AWARE_ENABLE); in icssg_change_mode()
1311 struct prueth_emac *emac = netdev_priv(ndev); in prueth_netdevice_port_link() local
1312 struct prueth *prueth = emac->prueth; in prueth_netdevice_port_link()
1325 err = switchdev_bridge_port_offload(br_ndev, ndev, emac, in prueth_netdevice_port_link()
1332 prueth->br_members |= BIT(emac->port_id); in prueth_netdevice_port_link()
1339 emac->port_vlan = prueth->default_vlan; in prueth_netdevice_port_link()
1351 struct prueth_emac *emac = netdev_priv(ndev); in prueth_netdevice_port_unlink() local
1352 struct prueth *prueth = emac->prueth; in prueth_netdevice_port_unlink()
1355 prueth->br_members &= ~BIT(emac->port_id); in prueth_netdevice_port_unlink()
1359 emac->port_vlan = 0; in prueth_netdevice_port_unlink()
1375 struct prueth_emac *emac = netdev_priv(ndev); in prueth_hsr_port_link() local
1376 struct prueth *prueth = emac->prueth; in prueth_hsr_port_link()
1380 emac0 = prueth->emac[PRUETH_MAC0]; in prueth_hsr_port_link()
1381 emac1 = prueth->emac[PRUETH_MAC1]; in prueth_hsr_port_link()
1386 prueth->hsr_members |= BIT(emac->port_id); in prueth_hsr_port_link()
1409 struct prueth_emac *emac = netdev_priv(ndev); in prueth_hsr_port_unlink() local
1410 struct prueth *prueth = emac->prueth; in prueth_hsr_port_unlink()
1415 emac0 = prueth->emac[PRUETH_MAC0]; in prueth_hsr_port_unlink()
1416 emac1 = prueth->emac[PRUETH_MAC1]; in prueth_hsr_port_unlink()
1418 prueth->hsr_members &= ~BIT(emac->port_id); in prueth_hsr_port_unlink()
1440 struct prueth_emac *emac = netdev_priv(ndev); in prueth_netdevice_event() local
1441 struct prueth *prueth = emac->prueth; in prueth_netdevice_event()
1692 prueth->emac[PRUETH_MAC0]->half_duplex = in prueth_probe()
1695 prueth->emac[PRUETH_MAC0]->iep = prueth->iep0; in prueth_probe()
1706 prueth->emac[PRUETH_MAC1]->half_duplex = in prueth_probe()
1709 prueth->emac[PRUETH_MAC1]->iep = prueth->iep0; in prueth_probe()
1714 ret = register_netdev(prueth->emac[PRUETH_MAC0]->ndev); in prueth_probe()
1720 prueth->registered_netdevs[PRUETH_MAC0] = prueth->emac[PRUETH_MAC0]->ndev; in prueth_probe()
1722 ret = emac_phy_connect(prueth->emac[PRUETH_MAC0]); in prueth_probe()
1728 phy_attached_info(prueth->emac[PRUETH_MAC0]->ndev->phydev); in prueth_probe()
1732 ret = register_netdev(prueth->emac[PRUETH_MAC1]->ndev); in prueth_probe()
1738 prueth->registered_netdevs[PRUETH_MAC1] = prueth->emac[PRUETH_MAC1]->ndev; in prueth_probe()
1739 ret = emac_phy_connect(prueth->emac[PRUETH_MAC1]); in prueth_probe()
1745 phy_attached_info(prueth->emac[PRUETH_MAC1]->ndev->phydev); in prueth_probe()
1756 dev_info(dev, "TI PRU ethernet driver initialized: %s EMAC mode\n", in prueth_probe()
1769 if (prueth->emac[i]->ndev->phydev) { in prueth_probe()
1770 phy_disconnect(prueth->emac[i]->ndev->phydev); in prueth_probe()
1771 prueth->emac[i]->ndev->phydev = NULL; in prueth_probe()
1828 phy_stop(prueth->emac[i]->ndev->phydev); in prueth_remove()
1829 phy_disconnect(prueth->emac[i]->ndev->phydev); in prueth_remove()
1830 prueth->emac[i]->ndev->phydev = NULL; in prueth_remove()