@@ -517,14 +517,14 @@ static const char *tcodes[] = {
517
517
static void log_ar_at_event (struct fw_ohci * ohci ,
518
518
char dir , int speed , u32 * header , int evt )
519
519
{
520
- int tcode = header [ 0 ] >> 4 & 0xf ;
520
+ int tcode = async_header_get_tcode ( header ) ;
521
521
char specific [12 ];
522
522
523
523
if (likely (!(param_debug & OHCI_PARAM_DEBUG_AT_AR )))
524
524
return ;
525
525
526
526
if (unlikely (evt >= ARRAY_SIZE (evts )))
527
- evt = 0x1f ;
527
+ evt = 0x1f ;
528
528
529
529
if (evt == OHCI1394_evt_bus_reset ) {
530
530
ohci_notice (ohci , "A%c evt_bus_reset, generation %d\n" ,
@@ -539,7 +539,8 @@ static void log_ar_at_event(struct fw_ohci *ohci,
539
539
break ;
540
540
case 0x1 : case 0x5 : case 0x7 : case 0x9 : case 0xb :
541
541
snprintf (specific , sizeof (specific ), " %x,%x" ,
542
- header [3 ] >> 16 , header [3 ] & 0xffff );
542
+ async_header_get_data_length (header ),
543
+ async_header_get_extended_tcode (header ));
543
544
break ;
544
545
default :
545
546
specific [0 ] = '\0' ;
@@ -556,17 +557,17 @@ static void log_ar_at_event(struct fw_ohci *ohci,
556
557
break ;
557
558
case 0x0 : case 0x1 : case 0x4 : case 0x5 : case 0x9 :
558
559
ohci_notice (ohci ,
559
- "A%c spd %x tl %02x, %04x -> %04x, %s, %s, %04x%08x %s\n" ,
560
- dir , speed , header [ 0 ] >> 10 & 0x3f ,
561
- header [ 1 ] >> 16 , header [ 0 ] >> 16 , evts [ evt ] ,
562
- tcodes [ tcode ], header [ 1 ] & 0xffff , header [ 2 ] , specific );
560
+ "A%c spd %x tl %02x, %04x -> %04x, %s, %s, %012llx %s\n" ,
561
+ dir , speed , async_header_get_tlabel ( header ) ,
562
+ async_header_get_source ( header ), async_header_get_destination ( header ) ,
563
+ evts [ evt ], tcodes [ tcode ], async_header_get_offset ( header ) , specific );
563
564
break ;
564
565
default :
565
566
ohci_notice (ohci ,
566
567
"A%c spd %x tl %02x, %04x -> %04x, %s, %s%s\n" ,
567
- dir , speed , header [ 0 ] >> 10 & 0x3f ,
568
- header [ 1 ] >> 16 , header [ 0 ] >> 16 , evts [ evt ] ,
569
- tcodes [tcode ], specific );
568
+ dir , speed , async_header_get_tlabel ( header ) ,
569
+ async_header_get_source ( header ), async_header_get_destination ( header ) ,
570
+ evts [ evt ], tcodes [tcode ], specific );
570
571
}
571
572
}
572
573
@@ -854,7 +855,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
854
855
p .header [1 ] = cond_le32_to_cpu (buffer [1 ]);
855
856
p .header [2 ] = cond_le32_to_cpu (buffer [2 ]);
856
857
857
- tcode = (p .header [ 0 ] >> 4 ) & 0x0f ;
858
+ tcode = async_header_get_tcode (p .header ) ;
858
859
switch (tcode ) {
859
860
case TCODE_WRITE_QUADLET_REQUEST :
860
861
case TCODE_READ_QUADLET_RESPONSE :
@@ -875,7 +876,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
875
876
case TCODE_LOCK_RESPONSE :
876
877
p .header [3 ] = cond_le32_to_cpu (buffer [3 ]);
877
878
p .header_length = 16 ;
878
- p .payload_length = p .header [ 3 ] >> 16 ;
879
+ p .payload_length = async_header_get_data_length ( p .header ) ;
879
880
if (p .payload_length > MAX_ASYNC_PAYLOAD ) {
880
881
ar_context_abort (ctx , "invalid packet length" );
881
882
return NULL ;
@@ -912,8 +913,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
912
913
* Several controllers, notably from NEC and VIA, forget to
913
914
* write ack_complete status at PHY packet reception.
914
915
*/
915
- if (evt == OHCI1394_evt_no_status &&
916
- (p .header [0 ] & 0xff ) == (OHCI1394_phy_tcode << 4 ))
916
+ if (evt == OHCI1394_evt_no_status && tcode == OHCI1394_phy_tcode )
917
917
p .ack = ACK_COMPLETE ;
918
918
919
919
/*
@@ -1354,7 +1354,7 @@ static int at_context_queue_packet(struct context *ctx,
1354
1354
* accordingly.
1355
1355
*/
1356
1356
1357
- tcode = (packet -> header [ 0 ] >> 4 ) & 0x0f ;
1357
+ tcode = async_header_get_tcode (packet -> header ) ;
1358
1358
header = (__le32 * ) & d [1 ];
1359
1359
switch (tcode ) {
1360
1360
case TCODE_WRITE_QUADLET_REQUEST :
0 commit comments