• Vladimir Oltean's avatar
    net: dsa: make dsa_port_supports_hwtstamp() construct a fake ifreq · ff6ac4d0
    Vladimir Oltean authored
    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: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    ff6ac4d0
port.c 50 KB