hwtstamp.c (cfd12c06cdceac094aab3f097cce24c279bfd43b) hwtstamp.c (cf536ea3c7eefb26082836eb7f930b293dd38345)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Marvell 88E6xxx Switch hardware timestamping support
4 *
5 * Copyright (c) 2008 Marvell Semiconductor
6 *
7 * Copyright (c) 2017 National Instruments
8 * Erik Hons <erik.hons@ni.com>

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

464
465 mv88e6xxx_rxtstamp_work(chip, ps);
466 }
467
468 return restart ? 1 : -1;
469}
470
471bool mv88e6xxx_port_txtstamp(struct dsa_switch *ds, int port,
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Marvell 88E6xxx Switch hardware timestamping support
4 *
5 * Copyright (c) 2008 Marvell Semiconductor
6 *
7 * Copyright (c) 2017 National Instruments
8 * Erik Hons <erik.hons@ni.com>

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

464
465 mv88e6xxx_rxtstamp_work(chip, ps);
466 }
467
468 return restart ? 1 : -1;
469}
470
471bool mv88e6xxx_port_txtstamp(struct dsa_switch *ds, int port,
472 struct sk_buff *clone, unsigned int type)
472 struct sk_buff *clone)
473{
474 struct mv88e6xxx_chip *chip = ds->priv;
475 struct mv88e6xxx_port_hwtstamp *ps = &chip->port_hwtstamp[port];
476 struct ptp_header *hdr;
473{
474 struct mv88e6xxx_chip *chip = ds->priv;
475 struct mv88e6xxx_port_hwtstamp *ps = &chip->port_hwtstamp[port];
476 struct ptp_header *hdr;
477 unsigned int type;
477
478
479 type = ptp_classify_raw(clone);
480 if (type == PTP_CLASS_NONE)
481 return false;
482
478 hdr = mv88e6xxx_should_tstamp(chip, port, clone, type);
479 if (!hdr)
480 return false;
481
482 if (test_and_set_bit_lock(MV88E6XXX_HWTSTAMP_TX_IN_PROGRESS,
483 &ps->state))
484 return false;
485

--- 123 unchanged lines hidden ---
483 hdr = mv88e6xxx_should_tstamp(chip, port, clone, type);
484 if (!hdr)
485 return false;
486
487 if (test_and_set_bit_lock(MV88E6XXX_HWTSTAMP_TX_IN_PROGRESS,
488 &ps->state))
489 return false;
490

--- 123 unchanged lines hidden ---