Vladimir Oltean ff6ac4d013 net: dsa: make dsa_port_supports_hwtstamp() construct a fake ifreq
dsa_master_ioctl() is in the process of getting converted to a different
API, where we won't have access to a struct ifreq * anymore, but rather,
to a struct kernel_hwtstamp_config.

Since ds->ops->port_hwtstamp_get() still uses struct ifreq *, this
creates a difficult situation where we have to make up such a dummy
pointer.

The conversion is a bit messy, because it forces a "good" implementation
of ds->ops->port_hwtstamp_get() to return -EFAULT in copy_to_user()
because of the NULL ifr->ifr_data pointer. However, it works, and it is
only a transient step until ds->ops->port_hwtstamp_get() gets converted
to the new API which passes struct kernel_hwtstamp_config and does not
call copy_to_user().

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-04-03 10:04:27 +01:00
..
2023-02-21 18:24:12 -08:00
2023-03-31 09:17:09 +01:00
2023-03-16 17:34:40 -07:00
2023-02-13 09:30:14 +00:00
2023-03-30 23:52:20 -07:00
2023-02-21 18:24:12 -08:00
2023-03-25 13:32:43 -07:00
2023-02-21 18:24:12 -08:00
2023-03-30 23:52:20 -07:00
2023-03-13 15:59:20 -07:00