Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

firewire: ohci: use static inline functions to serialize data of AT DMA

This commit replaces current implementation with the helper functions added
in the former commit.

Link: https://lore.kernel.org/r/20240802003606.109402-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

+18 -14
+18 -14
drivers/firewire/ohci.c
··· 1409 1409 d[0].control = cpu_to_le16(DESCRIPTOR_KEY_IMMEDIATE); 1410 1410 d[0].res_count = cpu_to_le16(packet->timestamp); 1411 1411 1412 - /* 1413 - * The DMA format for asynchronous link packets is different 1414 - * from the IEEE1394 layout, so shift the fields around 1415 - * accordingly. 1416 - */ 1417 - 1418 1412 tcode = async_header_get_tcode(packet->header); 1419 1413 header = (__le32 *) &d[1]; 1420 1414 switch (tcode) { ··· 1421 1427 case TCODE_READ_BLOCK_RESPONSE: 1422 1428 case TCODE_LOCK_REQUEST: 1423 1429 case TCODE_LOCK_RESPONSE: 1424 - header[0] = cpu_to_le32((packet->header[0] & 0xffff) | 1425 - (packet->speed << 16)); 1426 - header[1] = cpu_to_le32((packet->header[1] & 0xffff) | 1427 - (packet->header[0] & 0xffff0000)); 1428 - header[2] = cpu_to_le32(packet->header[2]); 1430 + ohci1394_at_data_set_src_bus_id(header, false); 1431 + ohci1394_at_data_set_speed(header, packet->speed); 1432 + ohci1394_at_data_set_tlabel(header, async_header_get_tlabel(packet->header)); 1433 + ohci1394_at_data_set_retry(header, async_header_get_retry(packet->header)); 1434 + ohci1394_at_data_set_tcode(header, tcode); 1435 + 1436 + ohci1394_at_data_set_destination_id(header, 1437 + async_header_get_destination(packet->header)); 1438 + 1439 + if (ctx == &ctx->ohci->at_response_ctx) { 1440 + ohci1394_at_data_set_rcode(header, async_header_get_rcode(packet->header)); 1441 + } else { 1442 + ohci1394_at_data_set_destination_offset(header, 1443 + async_header_get_offset(packet->header)); 1444 + } 1429 1445 1430 1446 if (tcode_is_block_packet(tcode)) 1431 1447 header[3] = cpu_to_le32(packet->header[3]); ··· 1444 1440 1445 1441 d[0].req_count = cpu_to_le16(packet->header_length); 1446 1442 break; 1447 - 1448 1443 case TCODE_LINK_INTERNAL: 1449 - header[0] = cpu_to_le32((TCODE_LINK_INTERNAL << 4) | 1450 - (packet->speed << 16)); 1444 + ohci1394_at_data_set_speed(header, packet->speed); 1445 + ohci1394_at_data_set_tcode(header, TCODE_LINK_INTERNAL); 1446 + 1451 1447 header[1] = cpu_to_le32(packet->header[1]); 1452 1448 header[2] = cpu_to_le32(packet->header[2]); 1453 1449 d[0].req_count = cpu_to_le16(12);