{
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot *ocelot = priv->port.ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
return &ocelot->devlink_ports[port];
}
bool ingress)
{
struct ocelot *ocelot = priv->port.ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
if (!ingress)
return -EOPNOTSUPP;
struct flow_action_entry *action = &f->rule->action.entries[0];
struct ocelot *ocelot = priv->port.ocelot;
struct ocelot_policer pol = { 0 };
- int port = priv->chip_port;
+ int port = priv->port.index;
int err;
if (!ingress) {
other_priv = netdev_priv(a->dev);
- err = ocelot_port_mirror_add(ocelot, priv->chip_port,
- other_priv->chip_port, ingress, extack);
+ err = ocelot_port_mirror_add(ocelot, priv->port.index,
+ other_priv->port.index, ingress, extack);
if (err)
return err;
struct netlink_ext_ack *extack)
{
struct ocelot *ocelot = priv->port.ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
int err;
err = ocelot_port_policer_del(ocelot, port);
struct netlink_ext_ack *extack)
{
struct ocelot *ocelot = priv->port.ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
ocelot_port_mirror_del(ocelot, port, ingress);
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot_port *ocelot_port = &priv->port;
struct ocelot *ocelot = ocelot_port->ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
int ret;
ret = ocelot_vlan_add(ocelot, port, vid, pvid, untagged);
{
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot *ocelot = priv->port.ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
int ret;
/* 8021q removes VID 0 on module unload for all interfaces
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot_port *ocelot_port = &priv->port;
struct ocelot *ocelot = ocelot_port->ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
u32 rew_op = 0;
if (!static_branch_unlikely(&ocelot_fdma_enabled) &&
{
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot *ocelot = priv->port.ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
/* Configure the port to read the stats from */
ocelot_write(ocelot, SYS_STAT_CFG_STAT_VIEW(port),
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot_port *ocelot_port = &priv->port;
struct ocelot *ocelot = ocelot_port->ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
return ocelot_fdb_add(ocelot, port, addr, vid, ocelot_port->bridge);
}
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot_port *ocelot_port = &priv->port;
struct ocelot *ocelot = ocelot_port->ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
return ocelot_fdb_del(ocelot, port, addr, vid, ocelot_port->bridge);
}
.cb = cb,
.idx = *idx,
};
- int port = priv->chip_port;
+ int port = priv->port.index;
int ret;
ret = ocelot_fdb_dump(ocelot, port, ocelot_port_fdb_do_dump, &dump);
netdev_features_t changed = dev->features ^ features;
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot *ocelot = priv->port.ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
if ((dev->features & NETIF_F_HW_TC) > (features & NETIF_F_HW_TC) &&
priv->tc.offload_cnt) {
{
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot *ocelot = priv->port.ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
/* If the attached PHY device isn't capable of timestamping operations,
* use our own (when possible).
struct ocelot_port *ocelot_port = &priv->port;
struct ocelot *ocelot = ocelot_port->ocelot;
- ocelot_port_set_maxlen(ocelot, priv->chip_port, new_mtu);
+ ocelot_port_set_maxlen(ocelot, priv->port.index, new_mtu);
WRITE_ONCE(dev->mtu, new_mtu);
return 0;
priv = netdev_priv(dev);
- return priv->chip_port;
+ return priv->port.index;
}
static void ocelot_port_get_strings(struct net_device *netdev, u32 sset,
{
struct ocelot_port_private *priv = netdev_priv(netdev);
struct ocelot *ocelot = priv->port.ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
ocelot_get_strings(ocelot, port, sset, data);
}
{
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot *ocelot = priv->port.ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
ocelot_get_ethtool_stats(ocelot, port, data);
}
{
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot *ocelot = priv->port.ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
return ocelot_get_sset_count(ocelot, port, sset);
}
{
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot *ocelot = priv->port.ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
if (!ocelot->ptp)
return ethtool_op_get_ts_info(dev, info);
{
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot *ocelot = priv->port.ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
int err = 0;
if (ctx && ctx != priv)
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot_port *ocelot_port = &priv->port;
struct ocelot *ocelot = ocelot_port->ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
return ocelot_vlan_prepare(ocelot, port, vid, pvid, untagged, extack);
}
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot_port *ocelot_port = &priv->port;
struct ocelot *ocelot = ocelot_port->ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
return ocelot_port_mdb_add(ocelot, port, mdb, ocelot_port->bridge);
}
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot_port *ocelot_port = &priv->port;
struct ocelot *ocelot = ocelot_port->ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
return ocelot_port_mdb_del(ocelot, port, mdb, ocelot_port->bridge);
}
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot_port *ocelot_port = &priv->port;
struct ocelot *ocelot = ocelot_port->ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
return ocelot_mrp_add(ocelot, port, mrp);
}
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot_port *ocelot_port = &priv->port;
struct ocelot *ocelot = ocelot_port->ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
return ocelot_mrp_del(ocelot, port, mrp);
}
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot_port *ocelot_port = &priv->port;
struct ocelot *ocelot = ocelot_port->ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
return ocelot_mrp_add_ring_role(ocelot, port, mrp);
}
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot_port *ocelot_port = &priv->port;
struct ocelot *ocelot = ocelot_port->ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
return ocelot_mrp_del_ring_role(ocelot, port, mrp);
}
struct ocelot_port_private *priv = netdev_priv(dev);
struct ocelot_port *ocelot_port = &priv->port;
struct ocelot *ocelot = ocelot_port->ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
int bridge_num, err;
bridge_num = ocelot_bridge_num_get(ocelot, bridge);
struct ocelot_port *ocelot_port = &priv->port;
struct ocelot *ocelot = ocelot_port->ocelot;
int bridge_num = ocelot_port->bridge_num;
- int port = priv->chip_port;
+ int port = priv->port.index;
int err;
err = ocelot_switchdev_unsync(ocelot, port);
struct ocelot_port *ocelot_port = &priv->port;
struct ocelot *ocelot = ocelot_port->ocelot;
struct net_device *bridge_dev;
- int port = priv->chip_port;
+ int port = priv->port.index;
int err;
err = ocelot_port_lag_join(ocelot, port, bond, info);
struct ocelot_port *ocelot_port = &priv->port;
struct ocelot *ocelot = ocelot_port->ocelot;
struct net_device *bridge_dev;
- int port = priv->chip_port;
+ int port = priv->port.index;
ocelot_port_lag_leave(ocelot, port, bond);
bool is_active = info->link_up && info->tx_enabled;
struct ocelot_port *ocelot_port = &priv->port;
struct ocelot *ocelot = ocelot_port->ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
if (!ocelot_port->bond)
return NOTIFY_DONE;
struct net_device *ndev = to_net_dev(config->dev);
struct ocelot_port_private *priv = netdev_priv(ndev);
struct ocelot *ocelot = priv->port.ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
ocelot_phylink_mac_link_down(ocelot, port, link_an_mode, interface,
OCELOT_MAC_QUIRKS);
struct net_device *ndev = to_net_dev(config->dev);
struct ocelot_port_private *priv = netdev_priv(ndev);
struct ocelot *ocelot = priv->port.ocelot;
- int port = priv->chip_port;
+ int port = priv->port.index;
ocelot_phylink_mac_link_up(ocelot, port, phydev, link_an_mode,
interface, speed, duplex,
SET_NETDEV_DEV(dev, ocelot->dev);
priv = netdev_priv(dev);
priv->dev = dev;
- priv->chip_port = port;
ocelot_port = &priv->port;
ocelot_port->ocelot = ocelot;
+ ocelot_port->index = port;
ocelot_port->target = target;
ocelot->ports[port] = ocelot_port;