Lines Matching refs:intf
34 void bcmasp_enable_phy_irq(struct bcmasp_intf *intf, int en) in bcmasp_enable_phy_irq() argument
36 struct bcmasp_priv *priv = intf->parent; in bcmasp_enable_phy_irq()
39 if (!intf->internal_phy) in bcmasp_enable_phy_irq()
43 _intr2_mask_clear(priv, ASP_INTR2_PHY_EVENT(intf->channel)); in bcmasp_enable_phy_irq()
45 _intr2_mask_set(priv, ASP_INTR2_PHY_EVENT(intf->channel)); in bcmasp_enable_phy_irq()
48 void bcmasp_enable_tx_irq(struct bcmasp_intf *intf, int en) in bcmasp_enable_tx_irq() argument
50 struct bcmasp_priv *priv = intf->parent; in bcmasp_enable_tx_irq()
53 _intr2_mask_clear(priv, ASP_INTR2_TX_DESC(intf->channel)); in bcmasp_enable_tx_irq()
55 _intr2_mask_set(priv, ASP_INTR2_TX_DESC(intf->channel)); in bcmasp_enable_tx_irq()
59 void bcmasp_enable_rx_irq(struct bcmasp_intf *intf, int en) in bcmasp_enable_rx_irq() argument
61 struct bcmasp_priv *priv = intf->parent; in bcmasp_enable_rx_irq()
64 _intr2_mask_clear(priv, ASP_INTR2_RX_ECH(intf->channel)); in bcmasp_enable_rx_irq()
66 _intr2_mask_set(priv, ASP_INTR2_RX_ECH(intf->channel)); in bcmasp_enable_rx_irq()
81 static void bcmasp_intr2_handling(struct bcmasp_intf *intf, u32 status) in bcmasp_intr2_handling() argument
83 if (status & ASP_INTR2_RX_ECH(intf->channel)) { in bcmasp_intr2_handling()
84 if (likely(napi_schedule_prep(&intf->rx_napi))) { in bcmasp_intr2_handling()
85 bcmasp_enable_rx_irq(intf, 0); in bcmasp_intr2_handling()
86 __napi_schedule_irqoff(&intf->rx_napi); in bcmasp_intr2_handling()
90 if (status & ASP_INTR2_TX_DESC(intf->channel)) { in bcmasp_intr2_handling()
91 if (likely(napi_schedule_prep(&intf->tx_napi))) { in bcmasp_intr2_handling()
92 bcmasp_enable_tx_irq(intf, 0); in bcmasp_intr2_handling()
93 __napi_schedule_irqoff(&intf->tx_napi); in bcmasp_intr2_handling()
97 if (status & ASP_INTR2_PHY_EVENT(intf->channel)) in bcmasp_intr2_handling()
98 phy_mac_interrupt(intf->ndev->phydev); in bcmasp_intr2_handling()
104 struct bcmasp_intf *intf; in bcmasp_isr() local
118 list_for_each_entry(intf, &priv->intfs, list) in bcmasp_isr()
119 bcmasp_intr2_handling(intf, status); in bcmasp_isr()
124 void bcmasp_flush_rx_port(struct bcmasp_intf *intf) in bcmasp_flush_rx_port() argument
126 struct bcmasp_priv *priv = intf->parent; in bcmasp_flush_rx_port()
129 switch (intf->port) { in bcmasp_flush_rx_port()
514 void bcmasp_netfilt_suspend(struct bcmasp_intf *intf) in bcmasp_netfilt_suspend() argument
516 struct bcmasp_priv *priv = intf->parent; in bcmasp_netfilt_suspend()
524 priv->net_filters[i].port != intf->port) in bcmasp_netfilt_suspend()
548 int bcmasp_netfilt_get_all_active(struct bcmasp_intf *intf, u32 *rule_locs, in bcmasp_netfilt_get_all_active() argument
551 struct bcmasp_priv *priv = intf->parent; in bcmasp_netfilt_get_all_active()
556 priv->net_filters[i].port != intf->port) in bcmasp_netfilt_get_all_active()
575 int bcmasp_netfilt_get_active(struct bcmasp_intf *intf) in bcmasp_netfilt_get_active() argument
577 struct bcmasp_priv *priv = intf->parent; in bcmasp_netfilt_get_active()
582 priv->net_filters[i].port != intf->port) in bcmasp_netfilt_get_active()
597 bool bcmasp_netfilt_check_dup(struct bcmasp_intf *intf, in bcmasp_netfilt_check_dup() argument
600 struct bcmasp_priv *priv = intf->parent; in bcmasp_netfilt_check_dup()
607 priv->net_filters[i].port != intf->port) in bcmasp_netfilt_check_dup()
664 struct bcmasp_net_filter *bcmasp_netfilt_get_init(struct bcmasp_intf *intf, in bcmasp_netfilt_get_init() argument
669 struct bcmasp_priv *priv = intf->parent; in bcmasp_netfilt_get_init()
694 priv->net_filters[i].port == intf->port) in bcmasp_netfilt_get_init()
716 nfilter->port = intf->port; in bcmasp_netfilt_get_init()
730 void bcmasp_netfilt_release(struct bcmasp_intf *intf, in bcmasp_netfilt_release() argument
733 struct bcmasp_priv *priv = intf->parent; in bcmasp_netfilt_release()
750 static void bcmasp_set_mda_filter(struct bcmasp_intf *intf, in bcmasp_set_mda_filter() argument
755 struct bcmasp_priv *priv = intf->parent; in bcmasp_set_mda_filter()
771 static void bcmasp_en_mda_filter(struct bcmasp_intf *intf, bool en, in bcmasp_en_mda_filter() argument
774 struct bcmasp_priv *priv = intf->parent; in bcmasp_en_mda_filter()
780 priv->mda_filters[i].port = intf->port; in bcmasp_en_mda_filter()
782 rx_filter_core_wl(priv, ((intf->channel + 8) | in bcmasp_en_mda_filter()
784 ASP_RX_FILTER_MDA_CFG_UMC_SEL(intf->port)), in bcmasp_en_mda_filter()
809 #define ASP_RX_FILT_MDA(intf, name) (((intf)->index * \ argument
818 void bcmasp_set_promisc(struct bcmasp_intf *intf, bool en) in bcmasp_set_promisc() argument
820 unsigned int i = ASP_RX_FILT_MDA(intf, PROMISC); in bcmasp_set_promisc()
825 bcmasp_set_mda_filter(intf, promisc, promisc, i); in bcmasp_set_promisc()
826 bcmasp_en_mda_filter(intf, en, i); in bcmasp_set_promisc()
829 void bcmasp_set_allmulti(struct bcmasp_intf *intf, bool en) in bcmasp_set_allmulti() argument
832 unsigned int i = ASP_RX_FILT_MDA(intf, ALLMULTI); in bcmasp_set_allmulti()
835 bcmasp_set_mda_filter(intf, allmulti, allmulti, i); in bcmasp_set_allmulti()
836 bcmasp_en_mda_filter(intf, en, i); in bcmasp_set_allmulti()
839 void bcmasp_set_broad(struct bcmasp_intf *intf, bool en) in bcmasp_set_broad() argument
841 unsigned int i = ASP_RX_FILT_MDA(intf, BROADCAST); in bcmasp_set_broad()
845 bcmasp_set_mda_filter(intf, addr, addr, i); in bcmasp_set_broad()
846 bcmasp_en_mda_filter(intf, en, i); in bcmasp_set_broad()
849 void bcmasp_set_oaddr(struct bcmasp_intf *intf, const unsigned char *addr, in bcmasp_set_oaddr() argument
853 unsigned int i = ASP_RX_FILT_MDA(intf, OWN_ADDR); in bcmasp_set_oaddr()
855 bcmasp_set_mda_filter(intf, addr, mask, i); in bcmasp_set_oaddr()
856 bcmasp_en_mda_filter(intf, en, i); in bcmasp_set_oaddr()
859 void bcmasp_disable_all_filters(struct bcmasp_intf *intf) in bcmasp_disable_all_filters() argument
861 struct bcmasp_priv *priv = intf->parent; in bcmasp_disable_all_filters()
865 res_count = bcmasp_total_res_mda_cnt(intf->parent); in bcmasp_disable_all_filters()
870 priv->mda_filters[i].port == intf->port) in bcmasp_disable_all_filters()
871 bcmasp_en_mda_filter(intf, 0, i); in bcmasp_disable_all_filters()
875 static int bcmasp_combine_set_filter(struct bcmasp_intf *intf, in bcmasp_combine_set_filter() argument
879 struct bcmasp_priv *priv = intf->parent; in bcmasp_combine_set_filter()
895 bcmasp_set_mda_filter(intf, addr, mask, i); in bcmasp_combine_set_filter()
903 int bcmasp_set_en_mda_filter(struct bcmasp_intf *intf, unsigned char *addr, in bcmasp_set_en_mda_filter() argument
906 struct bcmasp_priv *priv = intf->parent; in bcmasp_set_en_mda_filter()
910 res_count = bcmasp_total_res_mda_cnt(intf->parent); in bcmasp_set_en_mda_filter()
915 priv->mda_filters[i].port != intf->port) in bcmasp_set_en_mda_filter()
919 ret = bcmasp_combine_set_filter(intf, addr, mask, i); in bcmasp_set_en_mda_filter()
921 intf->mib.filters_combine_cnt++; in bcmasp_set_en_mda_filter()
931 bcmasp_set_mda_filter(intf, addr, mask, i); in bcmasp_set_en_mda_filter()
932 bcmasp_en_mda_filter(intf, 1, i); in bcmasp_set_en_mda_filter()
1047 void bcmasp_core_clock_set_intf(struct bcmasp_intf *intf, bool en) in bcmasp_core_clock_set_intf() argument
1049 u32 intf_mask = ASP_CTRL_CLOCK_CTRL_ASP_RGMII_DIS(intf->port); in bcmasp_core_clock_set_intf()
1050 struct bcmasp_priv *priv = intf->parent; in bcmasp_core_clock_set_intf()
1128 static void bcmasp_enable_wol_shared(struct bcmasp_intf *intf, bool en) in bcmasp_enable_wol_shared() argument
1130 struct bcmasp_priv *priv = intf->parent; in bcmasp_enable_wol_shared()
1135 set_bit(intf->port, &priv->wol_irq_enabled_mask); in bcmasp_enable_wol_shared()
1140 set_bit(intf->port, &priv->wol_irq_enabled_mask); in bcmasp_enable_wol_shared()
1147 clear_bit(intf->port, &priv->wol_irq_enabled_mask); in bcmasp_enable_wol_shared()
1167 struct bcmasp_intf *intf; in bcmasp_init_wol_per_intf() local
1170 list_for_each_entry(intf, &priv->intfs, list) { in bcmasp_init_wol_per_intf()
1171 irq = bcmasp_get_and_request_irq(priv, intf->port + 1); in bcmasp_init_wol_per_intf()
1174 intf->port, irq); in bcmasp_init_wol_per_intf()
1178 intf->wol_irq = irq; in bcmasp_init_wol_per_intf()
1179 intf->wol_irq_enabled = false; in bcmasp_init_wol_per_intf()
1184 static void bcmasp_enable_wol_per_intf(struct bcmasp_intf *intf, bool en) in bcmasp_enable_wol_per_intf() argument
1186 struct device *dev = &intf->parent->pdev->dev; in bcmasp_enable_wol_per_intf()
1188 if (en ^ intf->wol_irq_enabled) in bcmasp_enable_wol_per_intf()
1189 irq_set_irq_wake(intf->wol_irq, en); in bcmasp_enable_wol_per_intf()
1191 intf->wol_irq_enabled = en; in bcmasp_enable_wol_per_intf()
1197 struct bcmasp_intf *intf; in bcmasp_wol_irq_destroy_per_intf() local
1199 list_for_each_entry(intf, &priv->intfs, list) { in bcmasp_wol_irq_destroy_per_intf()
1200 if (intf->wol_irq > 0) in bcmasp_wol_irq_destroy_per_intf()
1201 free_irq(intf->wol_irq, priv); in bcmasp_wol_irq_destroy_per_intf()
1205 static void bcmasp_eee_fixup(struct bcmasp_intf *intf, bool en) in bcmasp_eee_fixup() argument
1209 reg = rx_edpkt_core_rl(intf->parent, ASP_EDPKT_SPARE_REG); in bcmasp_eee_fixup()
1210 phy_lpi_overwrite = intf->internal_phy ? ASP_EDPKT_SPARE_REG_EPHY_LPI : in bcmasp_eee_fixup()
1218 rx_edpkt_core_wl(intf->parent, reg, ASP_EDPKT_SPARE_REG); in bcmasp_eee_fixup()
1293 struct bcmasp_intf *intf, *n; in bcmasp_remove_intfs() local
1295 list_for_each_entry_safe(intf, n, &priv->intfs, list) { in bcmasp_remove_intfs()
1296 list_del(&intf->list); in bcmasp_remove_intfs()
1297 bcmasp_interface_destroy(intf); in bcmasp_remove_intfs()
1307 struct bcmasp_intf *intf; in bcmasp_probe() local
1378 intf = bcmasp_interface_create(priv, intf_node, i); in bcmasp_probe()
1379 if (!intf) { in bcmasp_probe()
1385 list_add_tail(&intf->list, &priv->intfs); in bcmasp_probe()
1402 list_for_each_entry(intf, &priv->intfs, list) { in bcmasp_probe()
1403 ret = register_netdev(intf->ndev); in bcmasp_probe()
1405 netdev_err(intf->ndev, in bcmasp_probe()
1440 struct bcmasp_intf *intf; in bcmasp_suspend() local
1443 list_for_each_entry(intf, &priv->intfs, list) { in bcmasp_suspend()
1444 ret = bcmasp_interface_suspend(intf); in bcmasp_suspend()
1468 struct bcmasp_intf *intf; in bcmasp_resume() local
1489 list_for_each_entry(intf, &priv->intfs, list) { in bcmasp_resume()
1490 ret = bcmasp_interface_resume(intf); in bcmasp_resume()