gbe_intf
static struct gbe_intf *keystone_get_intf_data(struct netcp_intf *netcp)
struct gbe_intf *gbe_intf;
gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
if (!gbe_intf)
gbe_intf = netcp_module_get_intf_data(&xgbe_module, netcp);
return gbe_intf;
struct gbe_intf *gbe_intf;
gbe_intf = keystone_get_intf_data(netcp);
if (!gbe_intf)
gbe_dev = gbe_intf->gbe_dev;
struct gbe_intf *gbe_intf;
gbe_intf = keystone_get_intf_data(netcp);
if (!gbe_intf)
gbe_dev = gbe_intf->gbe_dev;
struct gbe_intf *gbe_intf;
gbe_intf = keystone_get_intf_data(netcp);
if (!gbe_intf)
gbe_dev = gbe_intf->gbe_dev;
struct gbe_intf *gbe_intf;
gbe_intf = keystone_get_intf_data(netcp);
if (!gbe_intf)
if (!gbe_intf->slave)
cmd->base.port = gbe_intf->slave->phy_port_t;
struct gbe_intf *gbe_intf;
gbe_intf = keystone_get_intf_data(netcp);
if (!gbe_intf)
if (!gbe_intf->slave)
if (port != gbe_intf->slave->phy_port_t) {
gbe_intf->slave->phy_port_t = port;
struct gbe_intf *gbe_intf;
gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
if (!gbe_intf || !gbe_intf->gbe_dev->cpts)
info->phc_index = gbe_intf->gbe_dev->cpts->phc_index;
struct gbe_intf *gbe_intf)
struct net_device *ndev = gbe_intf->ndev;
struct gbe_intf *gbe_intf;
gbe_intf = netcp_module_get_intf_data(&xgbe_module, netcp);
if (!gbe_intf)
netcp_ethss_update_link_state(gbe_intf->gbe_dev, gbe_intf->slave,
struct gbe_intf *gbe_intf;
gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
if (!gbe_intf)
netcp_ethss_update_link_state(gbe_intf->gbe_dev, gbe_intf->slave,
static void gbe_slave_stop(struct gbe_intf *intf)
static int gbe_slave_open(struct gbe_intf *gbe_intf)
struct gbe_priv *priv = gbe_intf->gbe_dev;
struct gbe_slave *slave = gbe_intf->slave;
gbe_set_slave_mac(slave, gbe_intf);
cpsw_ale_add_mcast(priv->ale, gbe_intf->ndev->broadcast,
slave->phy = of_phy_connect(gbe_intf->ndev,
static void gbe_add_mcast_addr(struct gbe_intf *gbe_intf, u8 *addr)
struct gbe_priv *gbe_dev = gbe_intf->gbe_dev;
for_each_set_bit(vlan_id, gbe_intf->active_vlans, VLAN_N_VID) {
static void gbe_add_ucast_addr(struct gbe_intf *gbe_intf, u8 *addr)
struct gbe_priv *gbe_dev = gbe_intf->gbe_dev;
for_each_set_bit(vlan_id, gbe_intf->active_vlans, VLAN_N_VID)
static void gbe_del_mcast_addr(struct gbe_intf *gbe_intf, u8 *addr)
struct gbe_priv *gbe_dev = gbe_intf->gbe_dev;
for_each_set_bit(vlan_id, gbe_intf->active_vlans, VLAN_N_VID) {
static void gbe_del_ucast_addr(struct gbe_intf *gbe_intf, u8 *addr)
struct gbe_priv *gbe_dev = gbe_intf->gbe_dev;
for_each_set_bit(vlan_id, gbe_intf->active_vlans, VLAN_N_VID) {
struct gbe_intf *gbe_intf = intf_priv;
struct gbe_priv *gbe_dev = gbe_intf->gbe_dev;
gbe_add_mcast_addr(gbe_intf, naddr->addr);
gbe_add_ucast_addr(gbe_intf, naddr->addr);
struct gbe_intf *gbe_intf = intf_priv;
struct gbe_priv *gbe_dev = gbe_intf->gbe_dev;
gbe_del_mcast_addr(gbe_intf, naddr->addr);
gbe_del_ucast_addr(gbe_intf, naddr->addr);
struct gbe_intf *gbe_intf = intf_priv;
struct gbe_priv *gbe_dev = gbe_intf->gbe_dev;
set_bit(vid, gbe_intf->active_vlans);
struct gbe_intf *gbe_intf = intf_priv;
struct gbe_priv *gbe_dev = gbe_intf->gbe_dev;
clear_bit(vid, gbe_intf->active_vlans);
struct gbe_intf *gbe_intf = context;
struct gbe_priv *gbe_dev = gbe_intf->gbe_dev;
static bool gbe_need_txtstamp(struct gbe_intf *gbe_intf,
return cpts_can_timestamp(gbe_intf->gbe_dev->cpts, skb);
static int gbe_txtstamp_mark_pkt(struct gbe_intf *gbe_intf,
struct gbe_priv *gbe_dev = gbe_intf->gbe_dev;
if (gbe_need_txtstamp(gbe_intf, p_info)) {
p_info->ts_context = (void *)gbe_intf;
static int gbe_rxtstamp(struct gbe_intf *gbe_intf, struct netcp_packet *p_info)
struct gbe_priv *gbe_dev = gbe_intf->gbe_dev;
struct gbe_intf *gbe_intf = intf_priv;
gbe_dev = gbe_intf->gbe_dev;
phy = gbe_intf->slave->phy;
static void gbe_hwtstamp(struct gbe_intf *gbe_intf)
struct gbe_priv *gbe_dev = gbe_intf->gbe_dev;
struct gbe_slave *slave = gbe_intf->slave;
struct gbe_intf *gbe_intf = intf_priv;
gbe_dev = gbe_intf->gbe_dev;
phy = gbe_intf->slave->phy;
gbe_hwtstamp(gbe_intf);
static inline int gbe_txtstamp_mark_pkt(struct gbe_intf *gbe_intf,
static inline int gbe_rxtstamp(struct gbe_intf *gbe_intf,
static inline int gbe_hwtstamp(struct gbe_intf *gbe_intf,
struct gbe_intf *gbe_intf = intf_priv;
struct gbe_priv *gbe_dev = gbe_intf->gbe_dev;
struct gbe_intf *gbe_intf = intf_priv;
struct phy_device *phy = gbe_intf->slave->phy;
struct gbe_intf *gbe_intf;
for_each_intf(gbe_intf, gbe_dev) {
if (!gbe_intf->slave->open)
netcp_ethss_update_link_state(gbe_dev, gbe_intf->slave,
gbe_intf->ndev);
struct gbe_intf *gbe_intf = data;
p_info->tx_pipe = &gbe_intf->tx_pipe;
return gbe_txtstamp_mark_pkt(gbe_intf, p_info);
struct gbe_intf *gbe_intf = data;
return gbe_rxtstamp(gbe_intf, p_info);
struct gbe_intf *gbe_intf = intf_priv;
struct gbe_priv *gbe_dev = gbe_intf->gbe_dev;
struct gbe_slave *slave = gbe_intf->slave;
gbe_intf->tx_pipe.flags = SWITCH_TO_PORT_IN_TAGINFO;
gbe_intf->tx_pipe.switch_to_port = 0;
gbe_intf->tx_pipe.switch_to_port = port_num;
gbe_intf->tx_pipe.dma_chan_name,
gbe_intf->tx_pipe.dma_channel,
gbe_intf->tx_pipe.switch_to_port,
gbe_intf->tx_pipe.flags);
gbe_slave_stop(gbe_intf);
ret = gbe_slave_open(gbe_intf);
netcp_register_txhook(netcp, GBE_TXHOOK_ORDER, gbe_txhook, gbe_intf);
netcp_register_rxhook(netcp, GBE_RXHOOK_ORDER, gbe_rxhook, gbe_intf);
gbe_slave_stop(gbe_intf);
struct gbe_intf *gbe_intf = intf_priv;
struct gbe_priv *gbe_dev = gbe_intf->gbe_dev;
gbe_slave_stop(gbe_intf);
netcp_unregister_rxhook(netcp, GBE_RXHOOK_ORDER, gbe_rxhook, gbe_intf);
netcp_unregister_txhook(netcp, GBE_TXHOOK_ORDER, gbe_txhook, gbe_intf);
gbe_intf->slave->open = false;
atomic_set(&gbe_intf->slave->link_state, NETCP_LINK_STATE_INVALID);
struct gbe_intf *gbe_intf;
gbe_intf = devm_kzalloc(gbe_dev->dev, sizeof(*gbe_intf), GFP_KERNEL);
if (!gbe_intf)
gbe_intf->ndev = ndev;
gbe_intf->dev = gbe_dev->dev;
gbe_intf->gbe_dev = gbe_dev;
gbe_intf->slave = devm_kzalloc(gbe_dev->dev,
sizeof(*gbe_intf->slave),
if (!gbe_intf->slave) {
if (init_slave(gbe_dev, gbe_intf->slave, node)) {
gbe_intf->tx_pipe = gbe_dev->tx_pipe;
list_add_tail(&gbe_intf->gbe_intf_list, &gbe_dev->gbe_intf_head);
*intf_priv = gbe_intf;
if (gbe_intf->slave)
devm_kfree(gbe_dev->dev, gbe_intf->slave);
if (gbe_intf)
devm_kfree(gbe_dev->dev, gbe_intf);
struct gbe_intf *gbe_intf = intf_priv;
gbe_intf->ndev->ethtool_ops = NULL;
list_del(&gbe_intf->gbe_intf_list);
devm_kfree(gbe_intf->dev, gbe_intf->slave);
devm_kfree(gbe_intf->dev, gbe_intf);