Commit 4a11c551 authored by David S. Miller's avatar David S. Miller

Merge branch 'net-mscc-allow-forwarding-ioctl-operations-to-attached-PHYs'

Antoine Tenart says:

====================
net: mscc: allow forwarding ioctl operations to attached PHYs

These two patches allow forwarding ioctl to the PHY MII implementation,
and support is added for offloading timestamping operations to
compatible attached PHYs.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 626a8323 b2e118f6
...@@ -1204,18 +1204,19 @@ static int ocelot_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -1204,18 +1204,19 @@ static int ocelot_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
struct ocelot *ocelot = priv->port.ocelot; struct ocelot *ocelot = priv->port.ocelot;
int port = priv->chip_port; int port = priv->chip_port;
/* The function is only used for PTP operations for now */ /* If the attached PHY device isn't capable of timestamping operations,
if (!ocelot->ptp) * use our own (when possible).
return -EOPNOTSUPP; */
if (!phy_has_hwtstamp(dev->phydev) && ocelot->ptp) {
switch (cmd) { switch (cmd) {
case SIOCSHWTSTAMP: case SIOCSHWTSTAMP:
return ocelot_hwstamp_set(ocelot, port, ifr); return ocelot_hwstamp_set(ocelot, port, ifr);
case SIOCGHWTSTAMP: case SIOCGHWTSTAMP:
return ocelot_hwstamp_get(ocelot, port, ifr); return ocelot_hwstamp_get(ocelot, port, ifr);
default:
return -EOPNOTSUPP;
} }
}
return phy_mii_ioctl(dev->phydev, ifr, cmd);
} }
static const struct net_device_ops ocelot_port_netdev_ops = { static const struct net_device_ops ocelot_port_netdev_ops = {
......
...@@ -189,6 +189,7 @@ static irqreturn_t ocelot_xtr_irq_handler(int irq, void *arg) ...@@ -189,6 +189,7 @@ static irqreturn_t ocelot_xtr_irq_handler(int irq, void *arg)
skb->offload_fwd_mark = 1; skb->offload_fwd_mark = 1;
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
if (!skb_defer_rx_timestamp(skb))
netif_rx(skb); netif_rx(skb);
dev->stats.rx_bytes += len; dev->stats.rx_bytes += len;
dev->stats.rx_packets++; dev->stats.rx_packets++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment