struct hwtstamp_config.rx_filter passed to SIOCSHWTSTAMP can be updated by
the kernel with the value of HWTSTAMP_FILTER_SOME. That indicates that all
requested packets will be timestamped, and some others as well.

Update hwts_init() to recognize this as a valid response, instead of
rejecting it as mismatch.

Signed-off-by: Petr Machata <pe...@mellanox.com>
---

Notes:
    v2: Fix whitespace.

 sk.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sk.c b/sk.c
index 93ba77a..416d784 100644
--- a/sk.c
+++ b/sk.c
@@ -105,7 +105,8 @@ static int hwts_init(int fd, const char *device, int 
rx_filter,
        if (cfg.tx_type != tx_type ||
            (cfg.rx_filter != rx_filter &&
             cfg.rx_filter != rx_filter2 &&
-            cfg.rx_filter != HWTSTAMP_FILTER_ALL)) {
+            cfg.rx_filter != HWTSTAMP_FILTER_ALL &&
+            cfg.rx_filter != HWTSTAMP_FILTER_SOME)) {
                pr_debug("tx_type   %d not %d", cfg.tx_type, tx_type);
                pr_debug("rx_filter %d not %d or %d", cfg.rx_filter, rx_filter,
                         rx_filter2);
-- 
2.20.1


_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to