diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2024-04-28 10:13:46 +0300 |
---|---|---|
committer | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2024-05-06 05:06:05 +0300 |
commit | aa5c5edc08c5f92753e9182c6d5f9e8caa2466d9 (patch) | |
tree | 93ca0af5c5dc2d2a9591a1d962498b08bb9fc13e | |
parent | 6503df36128b56685367172ebb7b0765c466f485 (diff) | |
download | linux-aa5c5edc08c5f92753e9182c6d5f9e8caa2466d9.tar.xz |
firewire: core: replace local macros with common inline functions for isochronous packet header
This commit replaces the local macros with the common inline functions
to serialize the packer header for Asynchronous Streaming Packet.
Link: https://lore.kernel.org/r/20240428071347.409202-9-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-rw-r--r-- | drivers/firewire/core-transaction.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c index 45ea15342ab8..3ecb0b945083 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c @@ -31,9 +31,6 @@ #include "core.h" #include "packet-header-definitions.h" -#define HEADER_TCODE(tcode) ((tcode) << 4) -#define HEADER_DATA_LENGTH(length) ((length) << 16) - #define HEADER_DESTINATION_IS_BROADCAST(header) \ ((async_header_get_destination(header) & 0x3f) == 0x3f) @@ -215,10 +212,11 @@ static void fw_fill_request(struct fw_packet *packet, int tcode, int tlabel, int ext_tcode; if (tcode == TCODE_STREAM_DATA) { - packet->header[0] = - HEADER_DATA_LENGTH(length) | - destination_id | - HEADER_TCODE(TCODE_STREAM_DATA); + // The value of destination_id argument should include tag, channel, and sy fields + // as isochronous packet header has. + packet->header[0] = destination_id; + isoc_header_set_data_length(packet->header, length); + isoc_header_set_tcode(packet->header, TCODE_STREAM_DATA); packet->header_length = 4; packet->payload = payload; packet->payload_length = length; |