]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
ti_cpsw: Validate hwtstamp_config completely before applying it
authorBen Hutchings <bhutchings@solarflare.com>
Thu, 14 Nov 2013 00:47:36 +0000 (00:47 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 14 Nov 2013 21:22:10 +0000 (16:22 -0500)
commit2ee91e54bd5367bf4123719a4f7203857b28e046
tree6f41e8ce1a25163f0a809131a1a73c2cbfe4f59b
parent5f3da3281932a795b80cddd1887291515a7e324d
ti_cpsw: Validate hwtstamp_config completely before applying it

cpsw_hwtstamp_ioctl() should validate all fields of hwtstamp_config,
and the hardware version, before making any changes.  Currently it
sets the TX configuration before validating the rx_filter field
or that the hardware supports timestamping.

Also correct the error code for hardware versions that don't
support timestamping.  ENOTSUPP is used by the NFS implementation
and is not part of userland API; we want EOPNOTSUPP (which glibc
also calls ENOTSUP, with one 'P').

Untested as I don't have a cross-compiler to hand.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Acked-by: Mugunthan V N <mugunthanvnm@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw.c