Skip to content

Commit aa5c5ed

Browse files
committed
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/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
1 parent 6503df3 commit aa5c5ed

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/firewire/core-transaction.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@
3131
#include "core.h"
3232
#include "packet-header-definitions.h"
3333

34-
#define HEADER_TCODE(tcode) ((tcode) << 4)
35-
#define HEADER_DATA_LENGTH(length) ((length) << 16)
36-
3734
#define HEADER_DESTINATION_IS_BROADCAST(header) \
3835
((async_header_get_destination(header) & 0x3f) == 0x3f)
3936

@@ -215,10 +212,11 @@ static void fw_fill_request(struct fw_packet *packet, int tcode, int tlabel,
215212
int ext_tcode;
216213

217214
if (tcode == TCODE_STREAM_DATA) {
218-
packet->header[0] =
219-
HEADER_DATA_LENGTH(length) |
220-
destination_id |
221-
HEADER_TCODE(TCODE_STREAM_DATA);
215+
// The value of destination_id argument should include tag, channel, and sy fields
216+
// as isochronous packet header has.
217+
packet->header[0] = destination_id;
218+
isoc_header_set_data_length(packet->header, length);
219+
isoc_header_set_tcode(packet->header, TCODE_STREAM_DATA);
222220
packet->header_length = 4;
223221
packet->payload = payload;
224222
packet->payload_length = length;

0 commit comments

Comments
 (0)