]> git.baikalelectronics.ru Git - 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)
commitb2e56e3f0ca927f10f9faa4f6310f1d5ee149bfd
tree6f41e8ce1a25163f0a809131a1a73c2cbfe4f59b
parentff157b53541b5aace352d4c56847d979f7385311
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