OSDN Git Service

net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX
authorHangbin Liu <liuhangbin@gmail.com>
Fri, 10 Dec 2021 08:59:58 +0000 (16:59 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Dec 2021 12:28:24 +0000 (12:28 +0000)
Since commit 94dd016ae538 ("bond: pass get_ts_info and SIOC[SG]HWTSTAMP
ioctl to active device") the user could get bond active interface's
PHC index directly. But when there is a failover, the bond active
interface will change, thus the PHC index is also changed. This may
break the user's program if they did not update the PHC timely.

This patch adds a new hwtstamp_config flag HWTSTAMP_FLAG_BONDED_PHC_INDEX.
When the user wants to get the bond active interface's PHC, they need to
add this flag and be aware the PHC index may be changed.

With the new flag. All flag checks in current drivers are removed. Only
the checking in net_hwtstamp_validate() is kept.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
40 files changed:
drivers/net/dsa/hirschmann/hellcreek_hwtstamp.c
drivers/net/dsa/mv88e6xxx/hwtstamp.c
drivers/net/ethernet/amd/xgbe/xgbe-drv.c
drivers/net/ethernet/aquantia/atlantic/aq_main.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
drivers/net/ethernet/broadcom/tg3.c
drivers/net/ethernet/cadence/macb_ptp.c
drivers/net/ethernet/cavium/liquidio/lio_main.c
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
drivers/net/ethernet/cavium/thunder/nicvf_main.c
drivers/net/ethernet/engleder/tsnep_ptp.c
drivers/net/ethernet/freescale/fec_ptp.c
drivers/net/ethernet/freescale/gianfar.c
drivers/net/ethernet/intel/e1000e/netdev.c
drivers/net/ethernet/intel/i40e/i40e_ptp.c
drivers/net/ethernet/intel/ice/ice_ptp.c
drivers/net/ethernet/intel/igb/igb_ptp.c
drivers/net/ethernet/intel/igc/igc_ptp.c
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
drivers/net/ethernet/microchip/lan743x_ptp.c
drivers/net/ethernet/mscc/ocelot.c
drivers/net/ethernet/neterion/vxge/vxge-main.c
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
drivers/net/ethernet/qlogic/qede/qede_ptp.c
drivers/net/ethernet/renesas/ravb_main.c
drivers/net/ethernet/sfc/ptp.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/ethernet/ti/cpsw_priv.c
drivers/net/ethernet/ti/netcp_ethss.c
drivers/net/ethernet/xscale/ixp4xx_eth.c
drivers/net/phy/dp83640.c
drivers/net/phy/mscc/mscc_ptp.c
drivers/ptp/ptp_ines.c
include/uapi/linux/net_tstamp.h
net/core/dev_ioctl.c

index 40b41c7..b3bc948 100644 (file)
@@ -52,10 +52,6 @@ static int hellcreek_set_hwtstamp_config(struct hellcreek *hellcreek, int port,
         */
        clear_bit_unlock(HELLCREEK_HWTSTAMP_ENABLED, &ps->state);
 
-       /* Reserved for future extensions */
-       if (config->flags)
-               return -EINVAL;
-
        switch (config->tx_type) {
        case HWTSTAMP_TX_ON:
                tx_tstamp_enable = true;
index 8f74ffc..389f8a6 100644 (file)
@@ -100,10 +100,6 @@ static int mv88e6xxx_set_hwtstamp_config(struct mv88e6xxx_chip *chip, int port,
         */
        clear_bit_unlock(MV88E6XXX_HWTSTAMP_ENABLED, &ps->state);
 
-       /* reserved for future extensions */
-       if (config->flags)
-               return -EINVAL;
-
        switch (config->tx_type) {
        case HWTSTAMP_TX_OFF:
                tstamp_enable = false;
index 30d24d1..492ac38 100644 (file)
@@ -1508,9 +1508,6 @@ static int xgbe_set_hwtstamp_settings(struct xgbe_prv_data *pdata,
        if (copy_from_user(&config, ifreq->ifr_data, sizeof(config)))
                return -EFAULT;
 
-       if (config.flags)
-               return -EINVAL;
-
        mac_tscr = 0;
 
        switch (config.tx_type) {
index e22935c..e65ce71 100644 (file)
@@ -231,9 +231,6 @@ static void aq_ndev_set_multicast_settings(struct net_device *ndev)
 static int aq_ndev_config_hwtstamp(struct aq_nic_s *aq_nic,
                                   struct hwtstamp_config *config)
 {
-       if (config->flags)
-               return -EINVAL;
-
        switch (config->tx_type) {
        case HWTSTAMP_TX_OFF:
        case HWTSTAMP_TX_ON:
index aec666e..651bc1d 100644 (file)
@@ -15356,11 +15356,6 @@ static int bnx2x_hwtstamp_ioctl(struct bnx2x *bp, struct ifreq *ifr)
        DP(BNX2X_MSG_PTP, "Requested tx_type: %d, requested rx_filters = %d\n",
           config.tx_type, config.rx_filter);
 
-       if (config.flags) {
-               BNX2X_ERR("config.flags is reserved for future use\n");
-               return -EINVAL;
-       }
-
        bp->hwtstamp_ioctl_called = true;
        bp->tx_type = config.tx_type;
        bp->rx_filter = config.rx_filter;
index 8388be1..4852096 100644 (file)
@@ -417,9 +417,6 @@ int bnxt_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
        if (copy_from_user(&stmpconf, ifr->ifr_data, sizeof(stmpconf)))
                return -EFAULT;
 
-       if (stmpconf.flags)
-               return -EINVAL;
-
        if (stmpconf.tx_type != HWTSTAMP_TX_ON &&
            stmpconf.tx_type != HWTSTAMP_TX_OFF)
                return -ERANGE;
index 283f3c1..c28f8cc 100644 (file)
@@ -13806,9 +13806,6 @@ static int tg3_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
        if (copy_from_user(&stmpconf, ifr->ifr_data, sizeof(stmpconf)))
                return -EFAULT;
 
-       if (stmpconf.flags)
-               return -EINVAL;
-
        if (stmpconf.tx_type != HWTSTAMP_TX_ON &&
            stmpconf.tx_type != HWTSTAMP_TX_OFF)
                return -ERANGE;
index 095c5a2..fb6b27f 100644 (file)
@@ -464,10 +464,6 @@ int gem_set_hwtst(struct net_device *dev, struct ifreq *ifr, int cmd)
                           sizeof(*tstamp_config)))
                return -EFAULT;
 
-       /* reserved for future extensions */
-       if (tstamp_config->flags)
-               return -EINVAL;
-
        switch (tstamp_config->tx_type) {
        case HWTSTAMP_TX_OFF:
                break;
index 12eee2b..ba28aa4 100644 (file)
@@ -2114,9 +2114,6 @@ static int hwtstamp_ioctl(struct net_device *netdev, struct ifreq *ifr)
        if (copy_from_user(&conf, ifr->ifr_data, sizeof(conf)))
                return -EFAULT;
 
-       if (conf.flags)
-               return -EINVAL;
-
        switch (conf.tx_type) {
        case HWTSTAMP_TX_ON:
        case HWTSTAMP_TX_OFF:
index c607756..568f211 100644 (file)
@@ -1254,9 +1254,6 @@ static int hwtstamp_ioctl(struct net_device *netdev, struct ifreq *ifr)
        if (copy_from_user(&conf, ifr->ifr_data, sizeof(conf)))
                return -EFAULT;
 
-       if (conf.flags)
-               return -EINVAL;
-
        switch (conf.tx_type) {
        case HWTSTAMP_TX_ON:
        case HWTSTAMP_TX_OFF:
index 4b4ffdd..103591d 100644 (file)
@@ -702,9 +702,6 @@ static int octeon_mgmt_ioctl_hwtstamp(struct net_device *netdev,
        if (copy_from_user(&config, rq->ifr_data, sizeof(config)))
                return -EFAULT;
 
-       if (config.flags) /* reserved for future extensions */
-               return -EINVAL;
-
        /* Check the status of hardware for tiemstamps */
        if (OCTEON_IS_MODEL(OCTEON_CN6XXX)) {
                /* Get the current state of the PTP clock */
index bb45d5d..6319169 100644 (file)
@@ -1917,10 +1917,6 @@ static int nicvf_config_hwtstamp(struct net_device *netdev, struct ifreq *ifr)
        if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
                return -EFAULT;
 
-       /* reserved for future extensions */
-       if (config.flags)
-               return -EINVAL;
-
        switch (config.tx_type) {
        case HWTSTAMP_TX_OFF:
        case HWTSTAMP_TX_ON:
index 4bfb4d8..eaad453 100644 (file)
@@ -31,9 +31,6 @@ int tsnep_ptp_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
                if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
                        return -EFAULT;
 
-               if (config.flags)
-                       return -EINVAL;
-
                switch (config.tx_type) {
                case HWTSTAMP_TX_OFF:
                case HWTSTAMP_TX_ON:
index d71eac7..af99017 100644 (file)
@@ -473,10 +473,6 @@ int fec_ptp_set(struct net_device *ndev, struct ifreq *ifr)
        if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
                return -EFAULT;
 
-       /* reserved for future extensions */
-       if (config.flags)
-               return -EINVAL;
-
        switch (config.tx_type) {
        case HWTSTAMP_TX_OFF:
                fep->hwts_tx_en = 0;
index acab58f..206b7a3 100644 (file)
@@ -2076,10 +2076,6 @@ static int gfar_hwtstamp_set(struct net_device *netdev, struct ifreq *ifr)
        if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
                return -EFAULT;
 
-       /* reserved for future extensions */
-       if (config.flags)
-               return -EINVAL;
-
        switch (config.tx_type) {
        case HWTSTAMP_TX_OFF:
                priv->hwts_tx_en = 0;
index 44e2dc8..635a959 100644 (file)
@@ -3614,10 +3614,6 @@ static int e1000e_config_hwtstamp(struct e1000_adapter *adapter,
        if (!(adapter->flags & FLAG_HAS_HW_TIMESTAMP))
                return -EINVAL;
 
-       /* flags reserved for future extensions - must be zero */
-       if (config->flags)
-               return -EINVAL;
-
        switch (config->tx_type) {
        case HWTSTAMP_TX_OFF:
                tsync_tx_ctl = 0;
index 09b1d5a..61e5789 100644 (file)
@@ -1205,10 +1205,6 @@ static int i40e_ptp_set_timestamp_mode(struct i40e_pf *pf,
 
        INIT_WORK(&pf->ptp_extts0_work, i40e_ptp_extts0_work);
 
-       /* Reserved for future extensions. */
-       if (config->flags)
-               return -EINVAL;
-
        switch (config->tx_type) {
        case HWTSTAMP_TX_OFF:
                pf->ptp_tx = false;
index bf7247c..dfc7c83 100644 (file)
@@ -1205,10 +1205,6 @@ int ice_ptp_get_ts_config(struct ice_pf *pf, struct ifreq *ifr)
 static int
 ice_ptp_set_timestamp_mode(struct ice_pf *pf, struct hwtstamp_config *config)
 {
-       /* Reserved for future extensions. */
-       if (config->flags)
-               return -EINVAL;
-
        switch (config->tx_type) {
        case HWTSTAMP_TX_OFF:
                ice_set_tx_tstamp(pf, false);
index 0011b15..0ac4cc5 100644 (file)
@@ -1015,10 +1015,6 @@ static int igb_ptp_set_timestamp_mode(struct igb_adapter *adapter,
        bool is_l2 = false;
        u32 regval;
 
-       /* reserved for future extensions */
-       if (config->flags)
-               return -EINVAL;
-
        switch (config->tx_type) {
        case HWTSTAMP_TX_OFF:
                tsync_tx_ctl = 0;
index 30568e3..71813fa 100644 (file)
@@ -560,10 +560,6 @@ static void igc_ptp_enable_tx_timestamp(struct igc_adapter *adapter)
 static int igc_ptp_set_timestamp_mode(struct igc_adapter *adapter,
                                      struct hwtstamp_config *config)
 {
-       /* reserved for future extensions */
-       if (config->flags)
-               return -EINVAL;
-
        switch (config->tx_type) {
        case HWTSTAMP_TX_OFF:
                igc_ptp_disable_tx_timestamp(adapter);
index 23ddfd7..336426a 100644 (file)
@@ -992,10 +992,6 @@ static int ixgbe_ptp_set_timestamp_mode(struct ixgbe_adapter *adapter,
        bool is_l2 = false;
        u32 regval;
 
-       /* reserved for future extensions */
-       if (config->flags)
-               return -EINVAL;
-
        switch (config->tx_type) {
        case HWTSTAMP_TX_OFF:
                tsync_tx_ctl = 0;
index 8e5820d..b1cce44 100644 (file)
@@ -5142,9 +5142,6 @@ static int mvpp2_set_ts_config(struct mvpp2_port *port, struct ifreq *ifr)
        if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
                return -EFAULT;
 
-       if (config.flags)
-               return -EINVAL;
-
        if (config.tx_type != HWTSTAMP_TX_OFF &&
            config.tx_type != HWTSTAMP_TX_ON)
                return -ERANGE;
index 1333edf..6080ebd 100644 (file)
@@ -2002,10 +2002,6 @@ int otx2_config_hwtstamp(struct net_device *netdev, struct ifreq *ifr)
        if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
                return -EFAULT;
 
-       /* reserved for future extensions */
-       if (config.flags)
-               return -EINVAL;
-
        switch (config.tx_type) {
        case HWTSTAMP_TX_OFF:
                otx2_config_hw_tx_tstamp(pfvf, false);
index f1c10f2..ad1e4ca 100644 (file)
@@ -2427,10 +2427,6 @@ static int mlx4_en_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
        if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
                return -EFAULT;
 
-       /* reserved for future extensions */
-       if (config.flags)
-               return -EINVAL;
-
        /* device doesn't support time stamping */
        if (!(mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS))
                return -EINVAL;
index 9380e39..8b7a8d8 100644 (file)
@@ -1305,12 +1305,6 @@ int lan743x_ptp_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
        if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
                return -EFAULT;
 
-       if (config.flags) {
-               netif_warn(adapter, drv, adapter->netdev,
-                          "ignoring hwtstamp_config.flags == 0x%08X, expected 0\n",
-                          config.flags);
-       }
-
        switch (config.tx_type) {
        case HWTSTAMP_TX_OFF:
                for (index = 0; index < LAN743X_MAX_TX_CHANNELS;
index 876a7ec..9b42187 100644 (file)
@@ -1617,10 +1617,6 @@ int ocelot_hwstamp_set(struct ocelot *ocelot, int port, struct ifreq *ifr)
        if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg)))
                return -EFAULT;
 
-       /* reserved for future extensions */
-       if (cfg.flags)
-               return -EINVAL;
-
        /* Tx type sanity check */
        switch (cfg.tx_type) {
        case HWTSTAMP_TX_ON:
index 1969009..2c2e9e5 100644 (file)
@@ -3159,10 +3159,6 @@ static int vxge_hwtstamp_set(struct vxgedev *vdev, void __user *data)
        if (copy_from_user(&config, data, sizeof(config)))
                return -EFAULT;
 
-       /* reserved for future extensions */
-       if (config.flags)
-               return -EINVAL;
-
        /* Transmit HW Timestamp not supported */
        switch (config.tx_type) {
        case HWTSTAMP_TX_OFF:
index 71d2342..1dc40c5 100644 (file)
@@ -210,9 +210,6 @@ static int hwtstamp_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
        if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg)))
                return -EFAULT;
 
-       if (cfg.flags) /* reserved for future extensions */
-               return -EINVAL;
-
        /* Get ieee1588's dev information */
        pdev = adapter->ptp_pdev;
 
index 8c28fab..39176e7 100644 (file)
@@ -304,11 +304,6 @@ int qede_ptp_hw_ts(struct qede_dev *edev, struct ifreq *ifr)
                   "HWTSTAMP IOCTL: Requested tx_type = %d, requested rx_filters = %d\n",
                   config.tx_type, config.rx_filter);
 
-       if (config.flags) {
-               DP_ERR(edev, "config.flags is reserved for future use\n");
-               return -EINVAL;
-       }
-
        ptp->hw_ts_ioctl_called = 1;
        ptp->tx_type = config.tx_type;
        ptp->rx_filter = config.rx_filter;
index ce09bd4..b215cde 100644 (file)
@@ -2221,10 +2221,6 @@ static int ravb_hwtstamp_set(struct net_device *ndev, struct ifreq *req)
        if (copy_from_user(&config, req->ifr_data, sizeof(config)))
                return -EFAULT;
 
-       /* Reserved for future extensions */
-       if (config.flags)
-               return -EINVAL;
-
        switch (config.tx_type) {
        case HWTSTAMP_TX_OFF:
                tstamp_tx_ctrl = 0;
index 797e518..f0ef515 100644 (file)
@@ -1765,9 +1765,6 @@ static int efx_ptp_ts_init(struct efx_nic *efx, struct hwtstamp_config *init)
 {
        int rc;
 
-       if (init->flags)
-               return -EINVAL;
-
        if ((init->tx_type != HWTSTAMP_TX_OFF) &&
            (init->tx_type != HWTSTAMP_TX_ON))
                return -ERANGE;
index 7e3e1bc..c26ac28 100644 (file)
@@ -638,10 +638,6 @@ static int stmmac_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
        netdev_dbg(priv->dev, "%s config flags:0x%x, tx_type:0x%x, rx_filter:0x%x\n",
                   __func__, config.flags, config.tx_type, config.rx_filter);
 
-       /* reserved for future extensions */
-       if (config.flags)
-               return -EINVAL;
-
        if (config.tx_type != HWTSTAMP_TX_OFF &&
            config.tx_type != HWTSTAMP_TX_ON)
                return -ERANGE;
index c99dd97..8624a04 100644 (file)
@@ -626,10 +626,6 @@ static int cpsw_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
        if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg)))
                return -EFAULT;
 
-       /* reserved for future extensions */
-       if (cfg.flags)
-               return -EINVAL;
-
        if (cfg.tx_type != HWTSTAMP_TX_OFF && cfg.tx_type != HWTSTAMP_TX_ON)
                return -ERANGE;
 
index 33c1592..751fb0b 100644 (file)
@@ -2654,10 +2654,6 @@ static int gbe_hwtstamp_set(struct gbe_intf *gbe_intf, struct ifreq *ifr)
        if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg)))
                return -EFAULT;
 
-       /* reserved for future extensions */
-       if (cfg.flags)
-               return -EINVAL;
-
        switch (cfg.tx_type) {
        case HWTSTAMP_TX_OFF:
                gbe_dev->tx_ts_enabled = 0;
index 65fdad1..df77a22 100644 (file)
@@ -382,9 +382,6 @@ static int hwtstamp_set(struct net_device *netdev, struct ifreq *ifr)
        if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg)))
                return -EFAULT;
 
-       if (cfg.flags) /* reserved for future extensions */
-               return -EINVAL;
-
        ret = ixp46x_ptp_find(&port->timesync_regs, &port->phc_index);
        if (ret)
                return ret;
index 705c166..c2d1a85 100644 (file)
@@ -1235,9 +1235,6 @@ static int dp83640_hwtstamp(struct mii_timestamper *mii_ts, struct ifreq *ifr)
        if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg)))
                return -EFAULT;
 
-       if (cfg.flags) /* reserved for future extensions */
-               return -EINVAL;
-
        if (cfg.tx_type < 0 || cfg.tx_type > HWTSTAMP_TX_ONESTEP_SYNC)
                return -ERANGE;
 
index edb9516..34f8298 100644 (file)
@@ -1057,9 +1057,6 @@ static int vsc85xx_hwtstamp(struct mii_timestamper *mii_ts, struct ifreq *ifr)
        if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg)))
                return -EFAULT;
 
-       if (cfg.flags)
-               return -EINVAL;
-
        switch (cfg.tx_type) {
        case HWTSTAMP_TX_ONESTEP_SYNC:
                one_step = true;
index 6c7c284..61f47fb 100644 (file)
@@ -338,10 +338,6 @@ static int ines_hwtstamp(struct mii_timestamper *mii_ts, struct ifreq *ifr)
        if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg)))
                return -EFAULT;
 
-       /* reserved for future extensions */
-       if (cfg.flags)
-               return -EINVAL;
-
        switch (cfg.tx_type) {
        case HWTSTAMP_TX_OFF:
                ts_stat_tx = 0;
index fcc61c7..e258e52 100644 (file)
@@ -62,7 +62,7 @@ struct so_timestamping {
 /**
  * struct hwtstamp_config - %SIOCGHWTSTAMP and %SIOCSHWTSTAMP parameter
  *
- * @flags:     no flags defined right now, must be zero for %SIOCSHWTSTAMP
+ * @flags:     one of HWTSTAMP_FLAG_*
  * @tx_type:   one of HWTSTAMP_TX_*
  * @rx_filter: one of HWTSTAMP_FILTER_*
  *
@@ -78,6 +78,20 @@ struct hwtstamp_config {
        int rx_filter;
 };
 
+/* possible values for hwtstamp_config->flags */
+enum hwtstamp_flags {
+       /*
+        * With this flag, the user could get bond active interface's
+        * PHC index. Note this PHC index is not stable as when there
+        * is a failover, the bond active interface will be changed, so
+        * will be the PHC index.
+        */
+       HWTSTAMP_FLAG_BONDED_PHC_INDEX = (1<<0),
+
+       HWTSTAMP_FLAG_LAST = HWTSTAMP_FLAG_BONDED_PHC_INDEX,
+       HWTSTAMP_FLAG_MASK = (HWTSTAMP_FLAG_LAST - 1) | HWTSTAMP_FLAG_LAST
+};
+
 /* possible values for hwtstamp_config->tx_type */
 enum hwtstamp_tx_types {
        /*
index 1d309a6..1b807d1 100644 (file)
@@ -192,7 +192,7 @@ static int net_hwtstamp_validate(struct ifreq *ifr)
        if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg)))
                return -EFAULT;
 
-       if (cfg.flags) /* reserved for future extensions */
+       if (cfg.flags & ~HWTSTAMP_FLAG_MASK)
                return -EINVAL;
 
        tx_type = cfg.tx_type;