ptp: add debugfs interface to see applied channel masks
authorXabier Marquiegui <reibax@gmail.com>
Wed, 11 Oct 2023 22:39:57 +0000 (00:39 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 15 Oct 2023 19:07:52 +0000 (20:07 +0100)
commit403376ddb4221be9db5326ae334773807df71ffe
tree027d7c1055733aecd925d4941b8a7d90296e57f6
parentc5a445b1e9347b14752b01f1a304bd7a2f260acc
ptp: add debugfs interface to see applied channel masks

Use debugfs to be able to view channel mask applied to every timestamp
event queue.

Every time the device is opened, a new entry is created in
`$DEBUGFS_MOUNTPOINT/ptpN/$INSTANCE_ADDRESS/mask`.

The mask value can be viewed grouped in 32bit decimal values using cat,
or converted to hexadecimal with the included `ptpchmaskfmt.sh` script.
32 bit values are listed from least significant to most significant.

Signed-off-by: Xabier Marquiegui <reibax@gmail.com>
Suggested-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/ptp/ptp_chardev.c
drivers/ptp/ptp_clock.c
drivers/ptp/ptp_private.h
tools/testing/selftests/ptp/ptpchmaskfmt.sh [new file with mode: 0644]