Lines Matching refs:gbe_intf

759 struct gbe_intf {  struct
1756 static struct gbe_intf *keystone_get_intf_data(struct netcp_intf *netcp) in keystone_get_intf_data()
1758 struct gbe_intf *gbe_intf; in keystone_get_intf_data() local
1760 gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp); in keystone_get_intf_data()
1761 if (!gbe_intf) in keystone_get_intf_data()
1762 gbe_intf = netcp_module_get_intf_data(&xgbe_module, netcp); in keystone_get_intf_data()
1764 return gbe_intf; in keystone_get_intf_data()
1771 struct gbe_intf *gbe_intf; in keystone_get_stat_strings() local
1775 gbe_intf = keystone_get_intf_data(netcp); in keystone_get_stat_strings()
1776 if (!gbe_intf) in keystone_get_stat_strings()
1778 gbe_dev = gbe_intf->gbe_dev; in keystone_get_stat_strings()
1796 struct gbe_intf *gbe_intf; in keystone_get_sset_count() local
1799 gbe_intf = keystone_get_intf_data(netcp); in keystone_get_sset_count()
1800 if (!gbe_intf) in keystone_get_sset_count()
1802 gbe_dev = gbe_intf->gbe_dev; in keystone_get_sset_count()
1914 struct gbe_intf *gbe_intf; in keystone_get_ethtool_stats() local
1917 gbe_intf = keystone_get_intf_data(netcp); in keystone_get_ethtool_stats()
1918 if (!gbe_intf) in keystone_get_ethtool_stats()
1921 gbe_dev = gbe_intf->gbe_dev; in keystone_get_ethtool_stats()
1935 struct gbe_intf *gbe_intf; in keystone_get_link_ksettings() local
1940 gbe_intf = keystone_get_intf_data(netcp); in keystone_get_link_ksettings()
1941 if (!gbe_intf) in keystone_get_link_ksettings()
1944 if (!gbe_intf->slave) in keystone_get_link_ksettings()
1948 cmd->base.port = gbe_intf->slave->phy_port_t; in keystone_get_link_ksettings()
1958 struct gbe_intf *gbe_intf; in keystone_set_link_ksettings() local
1972 gbe_intf = keystone_get_intf_data(netcp); in keystone_set_link_ksettings()
1973 if (!gbe_intf) in keystone_set_link_ksettings()
1976 if (!gbe_intf->slave) in keystone_set_link_ksettings()
1979 if (port != gbe_intf->slave->phy_port_t) { in keystone_set_link_ksettings()
1996 gbe_intf->slave->phy_port_t = port; in keystone_set_link_ksettings()
2005 struct gbe_intf *gbe_intf; in keystone_get_ts_info() local
2007 gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp); in keystone_get_ts_info()
2008 if (!gbe_intf || !gbe_intf->gbe_dev->cpts) in keystone_get_ts_info()
2018 info->phc_index = gbe_intf->gbe_dev->cpts->phc_index; in keystone_get_ts_info()
2057 struct gbe_intf *gbe_intf) in gbe_set_slave_mac() argument
2059 struct net_device *ndev = gbe_intf->ndev; in gbe_set_slave_mac()
2163 struct gbe_intf *gbe_intf; in xgbe_adjust_link() local
2165 gbe_intf = netcp_module_get_intf_data(&xgbe_module, netcp); in xgbe_adjust_link()
2166 if (!gbe_intf) in xgbe_adjust_link()
2169 netcp_ethss_update_link_state(gbe_intf->gbe_dev, gbe_intf->slave, in xgbe_adjust_link()
2176 struct gbe_intf *gbe_intf; in gbe_adjust_link() local
2178 gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp); in gbe_adjust_link()
2179 if (!gbe_intf) in gbe_adjust_link()
2182 netcp_ethss_update_link_state(gbe_intf->gbe_dev, gbe_intf->slave, in gbe_adjust_link()
2253 static void gbe_slave_stop(struct gbe_intf *intf) in gbe_slave_stop()
2285 static int gbe_slave_open(struct gbe_intf *gbe_intf) in gbe_slave_open() argument
2287 struct gbe_priv *priv = gbe_intf->gbe_dev; in gbe_slave_open()
2288 struct gbe_slave *slave = gbe_intf->slave; in gbe_slave_open()
2301 gbe_set_slave_mac(slave, gbe_intf); in gbe_slave_open()
2312 cpsw_ale_add_mcast(priv->ale, gbe_intf->ndev->broadcast, in gbe_slave_open()
2344 slave->phy = of_phy_connect(gbe_intf->ndev, in gbe_slave_open()
2402 static void gbe_add_mcast_addr(struct gbe_intf *gbe_intf, u8 *addr) in gbe_add_mcast_addr() argument
2404 struct gbe_priv *gbe_dev = gbe_intf->gbe_dev; in gbe_add_mcast_addr()
2410 for_each_set_bit(vlan_id, gbe_intf->active_vlans, VLAN_N_VID) { in gbe_add_mcast_addr()
2417 static void gbe_add_ucast_addr(struct gbe_intf *gbe_intf, u8 *addr) in gbe_add_ucast_addr() argument
2419 struct gbe_priv *gbe_dev = gbe_intf->gbe_dev; in gbe_add_ucast_addr()
2424 for_each_set_bit(vlan_id, gbe_intf->active_vlans, VLAN_N_VID) in gbe_add_ucast_addr()
2429 static void gbe_del_mcast_addr(struct gbe_intf *gbe_intf, u8 *addr) in gbe_del_mcast_addr() argument
2431 struct gbe_priv *gbe_dev = gbe_intf->gbe_dev; in gbe_del_mcast_addr()
2436 for_each_set_bit(vlan_id, gbe_intf->active_vlans, VLAN_N_VID) { in gbe_del_mcast_addr()
2441 static void gbe_del_ucast_addr(struct gbe_intf *gbe_intf, u8 *addr) in gbe_del_ucast_addr() argument
2443 struct gbe_priv *gbe_dev = gbe_intf->gbe_dev; in gbe_del_ucast_addr()
2448 for_each_set_bit(vlan_id, gbe_intf->active_vlans, VLAN_N_VID) { in gbe_del_ucast_addr()
2456 struct gbe_intf *gbe_intf = intf_priv; in gbe_add_addr() local
2457 struct gbe_priv *gbe_dev = gbe_intf->gbe_dev; in gbe_add_addr()
2465 gbe_add_mcast_addr(gbe_intf, naddr->addr); in gbe_add_addr()
2469 gbe_add_ucast_addr(gbe_intf, naddr->addr); in gbe_add_addr()
2482 struct gbe_intf *gbe_intf = intf_priv; in gbe_del_addr() local
2483 struct gbe_priv *gbe_dev = gbe_intf->gbe_dev; in gbe_del_addr()
2491 gbe_del_mcast_addr(gbe_intf, naddr->addr); in gbe_del_addr()
2495 gbe_del_ucast_addr(gbe_intf, naddr->addr); in gbe_del_addr()
2508 struct gbe_intf *gbe_intf = intf_priv; in gbe_add_vid() local
2509 struct gbe_priv *gbe_dev = gbe_intf->gbe_dev; in gbe_add_vid()
2511 set_bit(vid, gbe_intf->active_vlans); in gbe_add_vid()
2524 struct gbe_intf *gbe_intf = intf_priv; in gbe_del_vid() local
2525 struct gbe_priv *gbe_dev = gbe_intf->gbe_dev; in gbe_del_vid()
2528 clear_bit(vid, gbe_intf->active_vlans); in gbe_del_vid()
2536 struct gbe_intf *gbe_intf = context; in gbe_txtstamp() local
2537 struct gbe_priv *gbe_dev = gbe_intf->gbe_dev; in gbe_txtstamp()
2542 static bool gbe_need_txtstamp(struct gbe_intf *gbe_intf, in gbe_need_txtstamp() argument
2547 return cpts_can_timestamp(gbe_intf->gbe_dev->cpts, skb); in gbe_need_txtstamp()
2550 static int gbe_txtstamp_mark_pkt(struct gbe_intf *gbe_intf, in gbe_txtstamp_mark_pkt() argument
2554 struct gbe_priv *gbe_dev = gbe_intf->gbe_dev; in gbe_txtstamp_mark_pkt()
2569 if (gbe_need_txtstamp(gbe_intf, p_info)) { in gbe_txtstamp_mark_pkt()
2571 p_info->ts_context = (void *)gbe_intf; in gbe_txtstamp_mark_pkt()
2578 static int gbe_rxtstamp(struct gbe_intf *gbe_intf, struct netcp_packet *p_info) in gbe_rxtstamp() argument
2581 struct gbe_priv *gbe_dev = gbe_intf->gbe_dev; in gbe_rxtstamp()
2599 static int gbe_hwtstamp_get(struct gbe_intf *gbe_intf, struct ifreq *ifr) in gbe_hwtstamp_get() argument
2601 struct gbe_priv *gbe_dev = gbe_intf->gbe_dev; in gbe_hwtstamp_get()
2615 static void gbe_hwtstamp(struct gbe_intf *gbe_intf) in gbe_hwtstamp() argument
2617 struct gbe_priv *gbe_dev = gbe_intf->gbe_dev; in gbe_hwtstamp()
2618 struct gbe_slave *slave = gbe_intf->slave; in gbe_hwtstamp()
2645 static int gbe_hwtstamp_set(struct gbe_intf *gbe_intf, struct ifreq *ifr) in gbe_hwtstamp_set() argument
2647 struct gbe_priv *gbe_dev = gbe_intf->gbe_dev; in gbe_hwtstamp_set()
2694 gbe_hwtstamp(gbe_intf); in gbe_hwtstamp_set()
2727 static inline int gbe_txtstamp_mark_pkt(struct gbe_intf *gbe_intf, in gbe_txtstamp_mark_pkt() argument
2733 static inline int gbe_rxtstamp(struct gbe_intf *gbe_intf, in gbe_rxtstamp() argument
2739 static inline int gbe_hwtstamp(struct gbe_intf *gbe_intf, in gbe_hwtstamp() argument
2753 static inline int gbe_hwtstamp_get(struct gbe_intf *gbe_intf, struct ifreq *req) in gbe_hwtstamp_get() argument
2758 static inline int gbe_hwtstamp_set(struct gbe_intf *gbe_intf, struct ifreq *req) in gbe_hwtstamp_set() argument
2766 struct gbe_intf *gbe_intf = intf_priv; in gbe_set_rx_mode() local
2767 struct gbe_priv *gbe_dev = gbe_intf->gbe_dev; in gbe_set_rx_mode()
2821 struct gbe_intf *gbe_intf = intf_priv; in gbe_ioctl() local
2822 struct phy_device *phy = gbe_intf->slave->phy; in gbe_ioctl()
2827 return gbe_hwtstamp_get(gbe_intf, req); in gbe_ioctl()
2829 return gbe_hwtstamp_set(gbe_intf, req); in gbe_ioctl()
2842 struct gbe_intf *gbe_intf; in netcp_ethss_timer() local
2846 for_each_intf(gbe_intf, gbe_dev) { in netcp_ethss_timer()
2847 if (!gbe_intf->slave->open) in netcp_ethss_timer()
2849 netcp_ethss_update_link_state(gbe_dev, gbe_intf->slave, in netcp_ethss_timer()
2850 gbe_intf->ndev); in netcp_ethss_timer()
2874 struct gbe_intf *gbe_intf = data; in gbe_txhook() local
2876 p_info->tx_pipe = &gbe_intf->tx_pipe; in gbe_txhook()
2878 return gbe_txtstamp_mark_pkt(gbe_intf, p_info); in gbe_txhook()
2883 struct gbe_intf *gbe_intf = data; in gbe_rxhook() local
2885 return gbe_rxtstamp(gbe_intf, p_info); in gbe_rxhook()
2890 struct gbe_intf *gbe_intf = intf_priv; in gbe_open() local
2891 struct gbe_priv *gbe_dev = gbe_intf->gbe_dev; in gbe_open()
2893 struct gbe_slave *slave = gbe_intf->slave; in gbe_open()
2905 gbe_intf->tx_pipe.flags = SWITCH_TO_PORT_IN_TAGINFO; in gbe_open()
2908 gbe_intf->tx_pipe.switch_to_port = 0; in gbe_open()
2910 gbe_intf->tx_pipe.switch_to_port = port_num; in gbe_open()
2914 gbe_intf->tx_pipe.dma_chan_name, in gbe_open()
2915 gbe_intf->tx_pipe.dma_channel, in gbe_open()
2916 gbe_intf->tx_pipe.switch_to_port, in gbe_open()
2917 gbe_intf->tx_pipe.flags); in gbe_open()
2919 gbe_slave_stop(gbe_intf); in gbe_open()
2936 ret = gbe_slave_open(gbe_intf); in gbe_open()
2940 netcp_register_txhook(netcp, GBE_TXHOOK_ORDER, gbe_txhook, gbe_intf); in gbe_open()
2941 netcp_register_rxhook(netcp, GBE_RXHOOK_ORDER, gbe_rxhook, gbe_intf); in gbe_open()
2951 gbe_slave_stop(gbe_intf); in gbe_open()
2957 struct gbe_intf *gbe_intf = intf_priv; in gbe_close() local
2959 struct gbe_priv *gbe_dev = gbe_intf->gbe_dev; in gbe_close()
2963 gbe_slave_stop(gbe_intf); in gbe_close()
2965 netcp_unregister_rxhook(netcp, GBE_RXHOOK_ORDER, gbe_rxhook, gbe_intf); in gbe_close()
2966 netcp_unregister_txhook(netcp, GBE_TXHOOK_ORDER, gbe_txhook, gbe_intf); in gbe_close()
2968 gbe_intf->slave->open = false; in gbe_close()
2969 atomic_set(&gbe_intf->slave->link_state, NETCP_LINK_STATE_INVALID); in gbe_close()
3746 struct gbe_intf *gbe_intf; in gbe_attach() local
3754 gbe_intf = devm_kzalloc(gbe_dev->dev, sizeof(*gbe_intf), GFP_KERNEL); in gbe_attach()
3755 if (!gbe_intf) in gbe_attach()
3758 gbe_intf->ndev = ndev; in gbe_attach()
3759 gbe_intf->dev = gbe_dev->dev; in gbe_attach()
3760 gbe_intf->gbe_dev = gbe_dev; in gbe_attach()
3762 gbe_intf->slave = devm_kzalloc(gbe_dev->dev, in gbe_attach()
3763 sizeof(*gbe_intf->slave), in gbe_attach()
3765 if (!gbe_intf->slave) { in gbe_attach()
3770 if (init_slave(gbe_dev, gbe_intf->slave, node)) { in gbe_attach()
3775 gbe_intf->tx_pipe = gbe_dev->tx_pipe; in gbe_attach()
3777 list_add_tail(&gbe_intf->gbe_intf_list, &gbe_dev->gbe_intf_head); in gbe_attach()
3778 *intf_priv = gbe_intf; in gbe_attach()
3782 if (gbe_intf->slave) in gbe_attach()
3783 devm_kfree(gbe_dev->dev, gbe_intf->slave); in gbe_attach()
3784 if (gbe_intf) in gbe_attach()
3785 devm_kfree(gbe_dev->dev, gbe_intf); in gbe_attach()
3791 struct gbe_intf *gbe_intf = intf_priv; in gbe_release() local
3793 gbe_intf->ndev->ethtool_ops = NULL; in gbe_release()
3794 list_del(&gbe_intf->gbe_intf_list); in gbe_release()
3795 devm_kfree(gbe_intf->dev, gbe_intf->slave); in gbe_release()
3796 devm_kfree(gbe_intf->dev, gbe_intf); in gbe_release()