diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2023-05-30 08:12:40 +0900 |
---|---|---|
committer | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2023-05-30 08:12:40 +0900 |
commit | e27b3939128a1d99a4c84f35e4f3897dae73ccd0 (patch) | |
tree | 5f49755b7b74d87ee2dc30f386452e9878e12389 /drivers/firewire | |
parent | 1ef147710b54d47f4108c802d8ee6f3d27fe922d (diff) | |
download | lwn-e27b3939128a1d99a4c84f35e4f3897dae73ccd0.tar.gz lwn-e27b3939128a1d99a4c84f35e4f3897dae73ccd0.zip |
firewire: cdev: add new event to notify phy packet with time stamp
This commit adds new event to notify event of phy packet with time stamp
field.
Unlike the fw_cdev_event_request3 and fw_cdev_event_response2, the size
of new structure, fw_cdev_event_phy_packet2, is multiples of 8, thus
padding is not required to keep the same size between System V ABI for
different architectures.
It is noticeable that for the case of ping request 1394 OHCI controller
does not record the isochronous cycle at which the packet was sent for
the request subaction. Instead, it records round-trip count measured by
hardware at 42.195 MHz resolution.
Cc: kunit-dev@googlegroups.com
Link: https://lore.kernel.org/r/20230529113406.986289-12-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Diffstat (limited to 'drivers/firewire')
-rw-r--r-- | drivers/firewire/uapi-test.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/firewire/uapi-test.c b/drivers/firewire/uapi-test.c index 640e5c05415a..c6ebf02e3d45 100644 --- a/drivers/firewire/uapi-test.c +++ b/drivers/firewire/uapi-test.c @@ -59,10 +59,24 @@ static void structure_layout_event_response2(struct kunit *test) KUNIT_EXPECT_EQ(test, 32, offsetof(struct fw_cdev_event_response2, data)); } +// Added at v6.5. +static void structure_layout_event_phy_packet2(struct kunit *test) +{ + KUNIT_EXPECT_EQ(test, 24, sizeof(struct fw_cdev_event_phy_packet2)); + + KUNIT_EXPECT_EQ(test, 0, offsetof(struct fw_cdev_event_phy_packet2, closure)); + KUNIT_EXPECT_EQ(test, 8, offsetof(struct fw_cdev_event_phy_packet2, type)); + KUNIT_EXPECT_EQ(test, 12, offsetof(struct fw_cdev_event_phy_packet2, rcode)); + KUNIT_EXPECT_EQ(test, 16, offsetof(struct fw_cdev_event_phy_packet2, length)); + KUNIT_EXPECT_EQ(test, 20, offsetof(struct fw_cdev_event_phy_packet2, tstamp)); + KUNIT_EXPECT_EQ(test, 24, offsetof(struct fw_cdev_event_phy_packet2, data)); +} + static struct kunit_case structure_layout_test_cases[] = { KUNIT_CASE(structure_layout_event_response), KUNIT_CASE(structure_layout_event_request3), KUNIT_CASE(structure_layout_event_response2), + KUNIT_CASE(structure_layout_event_phy_packet2), {} }; |