summaryrefslogtreecommitdiff
path: root/drivers/net/dsa
diff options
context:
space:
mode:
authorYangbo Lu <yangbo.lu@nxp.com>2021-04-27 07:22:02 +0300
committerDavid S. Miller <davem@davemloft.net>2021-04-28 00:10:15 +0300
commit682eaad93e8cfaaa439af39861ab8610eae5ff33 (patch)
treebd366d700b96ac1acfa91d9b0d2eab0121dabdd7 /drivers/net/dsa
parentd150946ed878d566ac55003b4722621bb55d9ac2 (diff)
downloadlinux-682eaad93e8cfaaa439af39861ab8610eae5ff33.tar.xz
net: mscc: ocelot: convert to ocelot_port_txtstamp_request()
Convert to a common ocelot_port_txtstamp_request() for TX timestamp request handling. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com> Acked-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r--drivers/net/dsa/ocelot/felix.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
index b28280b6e91a..ce607fbaaa3a 100644
--- a/drivers/net/dsa/ocelot/felix.c
+++ b/drivers/net/dsa/ocelot/felix.c
@@ -1399,17 +1399,16 @@ static void felix_txtstamp(struct dsa_switch *ds, int port,
struct sk_buff *skb)
{
struct ocelot *ocelot = ds->priv;
- struct ocelot_port *ocelot_port = ocelot->ports[port];
- struct sk_buff *clone;
+ struct sk_buff *clone = NULL;
- if (ocelot->ptp && ocelot_port->ptp_cmd == IFH_REW_OP_TWO_STEP_PTP) {
- clone = skb_clone_sk(skb);
- if (!clone)
- return;
+ if (!ocelot->ptp)
+ return;
- ocelot_port_add_txtstamp_skb(ocelot, port, clone);
+ if (ocelot_port_txtstamp_request(ocelot, port, skb, &clone))
+ return;
+
+ if (clone)
OCELOT_SKB_CB(skb)->clone = clone;
- }
}
static int felix_change_mtu(struct dsa_switch *ds, int port, int new_mtu)