felix.c (cf536ea3c7eefb26082836eb7f930b293dd38345) felix.c (5c5416f5d4c75fe6aba56f6c2c45a070b5e7cc78)
1// SPDX-License-Identifier: GPL-2.0
2/* Copyright 2019-2021 NXP Semiconductors
3 *
4 * This is an umbrella module for all network switches that are
5 * register-compatible with Ocelot and that perform I/O to their host CPU
6 * through an NPI (Node Processor Interface) Ethernet port.
7 */
8#include <uapi/linux/if_bridge.h>

--- 1381 unchanged lines hidden (view full) ---

1390 tstamp = ((u64)tstamp_hi << 32) | tstamp_lo;
1391
1392 shhwtstamps = skb_hwtstamps(skb);
1393 memset(shhwtstamps, 0, sizeof(struct skb_shared_hwtstamps));
1394 shhwtstamps->hwtstamp = tstamp;
1395 return false;
1396}
1397
1// SPDX-License-Identifier: GPL-2.0
2/* Copyright 2019-2021 NXP Semiconductors
3 *
4 * This is an umbrella module for all network switches that are
5 * register-compatible with Ocelot and that perform I/O to their host CPU
6 * through an NPI (Node Processor Interface) Ethernet port.
7 */
8#include <uapi/linux/if_bridge.h>

--- 1381 unchanged lines hidden (view full) ---

1390 tstamp = ((u64)tstamp_hi << 32) | tstamp_lo;
1391
1392 shhwtstamps = skb_hwtstamps(skb);
1393 memset(shhwtstamps, 0, sizeof(struct skb_shared_hwtstamps));
1394 shhwtstamps->hwtstamp = tstamp;
1395 return false;
1396}
1397
1398static bool felix_txtstamp(struct dsa_switch *ds, int port,
1399 struct sk_buff *clone)
1398static void felix_txtstamp(struct dsa_switch *ds, int port,
1399 struct sk_buff *skb)
1400{
1401 struct ocelot *ocelot = ds->priv;
1402 struct ocelot_port *ocelot_port = ocelot->ports[port];
1400{
1401 struct ocelot *ocelot = ds->priv;
1402 struct ocelot_port *ocelot_port = ocelot->ports[port];
1403 struct sk_buff *clone;
1403
1404 if (ocelot->ptp && ocelot_port->ptp_cmd == IFH_REW_OP_TWO_STEP_PTP) {
1404
1405 if (ocelot->ptp && ocelot_port->ptp_cmd == IFH_REW_OP_TWO_STEP_PTP) {
1406 clone = skb_clone_sk(skb);
1407 if (!clone)
1408 return;
1409
1405 ocelot_port_add_txtstamp_skb(ocelot, port, clone);
1410 ocelot_port_add_txtstamp_skb(ocelot, port, clone);
1406 return true;
1411 DSA_SKB_CB(skb)->clone = clone;
1407 }
1412 }
1408
1409 return false;
1410}
1411
1412static int felix_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
1413{
1414 struct ocelot *ocelot = ds->priv;
1415
1416 ocelot_port_set_maxlen(ocelot, port, new_mtu);
1417

--- 283 unchanged lines hidden ---
1413}
1414
1415static int felix_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
1416{
1417 struct ocelot *ocelot = ds->priv;
1418
1419 ocelot_port_set_maxlen(ocelot, port, new_mtu);
1420

--- 283 unchanged lines hidden ---