Commit d0c3e464 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'hwtstamp_bonding'



Hangbin Liu says:

====================
net: add new hwtstamp flag HWTSTAMP_FLAG_BONDED_PHC_INDEX

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

v3: Use bitwise test to check the flags validation
v2: rename the flag to HWTSTAMP_FLAG_BONDED_PHC_INDEX
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents a3c62a04 085d6100
Loading
Loading
Loading
Loading
+21 −12
Original line number Diff line number Diff line
@@ -4094,6 +4094,7 @@ static int bond_eth_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cm
	struct mii_ioctl_data *mii = NULL;
	const struct net_device_ops *ops;
	struct net_device *real_dev;
	struct hwtstamp_config cfg;
	struct ifreq ifrr;
	int res = 0;

@@ -4124,6 +4125,10 @@ static int bond_eth_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cm
		break;
	case SIOCSHWTSTAMP:
	case SIOCGHWTSTAMP:
		if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg)))
			return -EFAULT;

		if (cfg.flags & HWTSTAMP_FLAG_BONDED_PHC_INDEX) {
			rcu_read_lock();
			real_dev = bond_option_active_slave_get_rcu(bond);
			rcu_read_unlock();
@@ -4132,13 +4137,17 @@ static int bond_eth_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cm
				ifrr.ifr_ifru = ifr->ifr_ifru;

				ops = real_dev->netdev_ops;
			if (netif_device_present(real_dev) && ops->ndo_eth_ioctl)
				if (netif_device_present(real_dev) && ops->ndo_eth_ioctl) {
					res = ops->ndo_eth_ioctl(real_dev, &ifrr, cmd);

					if (!res)
						ifr->ifr_ifru = ifrr.ifr_ifru;

					return res;
				}
		break;
			}
		}
		fallthrough;
	default:
		res = -EOPNOTSUPP;
	}
+0 −4
Original line number Diff line number Diff line
@@ -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;
+0 −4
Original line number Diff line number Diff line
@@ -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;
+0 −3
Original line number Diff line number Diff line
@@ -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) {
+0 −3
Original line number Diff line number Diff line
@@ -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:
Loading