@@ -347,8 +347,8 @@ void iop_complete_message(struct iop_msg *msg)
347
347
int chan = msg -> channel ;
348
348
int i ,offset ;
349
349
350
- iop_pr_debug ("msg %p iop_num %d channel %d \n" , msg , msg -> iop_num ,
351
- msg -> channel );
350
+ iop_pr_debug ("iop_num %d chan %d reply %*ph \n" ,
351
+ msg -> iop_num , msg -> channel , IOP_MSG_LEN , msg -> reply );
352
352
353
353
offset = IOP_ADDR_RECV_MSG + (msg -> channel * IOP_MSG_LEN );
354
354
@@ -372,6 +372,9 @@ static void iop_do_send(struct iop_msg *msg)
372
372
volatile struct mac_iop * iop = iop_base [msg -> iop_num ];
373
373
int i ,offset ;
374
374
375
+ iop_pr_debug ("iop_num %d chan %d message %*ph\n" ,
376
+ msg -> iop_num , msg -> channel , IOP_MSG_LEN , msg -> message );
377
+
375
378
offset = IOP_ADDR_SEND_MSG + (msg -> channel * IOP_MSG_LEN );
376
379
377
380
for (i = 0 ; i < IOP_MSG_LEN ; i ++ , offset ++ ) {
@@ -394,8 +397,6 @@ static void iop_handle_send(uint iop_num, uint chan)
394
397
struct iop_msg * msg ;
395
398
int i ,offset ;
396
399
397
- iop_pr_debug ("iop_num %d chan %d\n" , iop_num , chan );
398
-
399
400
iop_writeb (iop , IOP_ADDR_SEND_STATE + chan , IOP_MSG_IDLE );
400
401
401
402
if (!(msg = iop_send_queue [iop_num ][chan ])) return ;
@@ -405,6 +406,9 @@ static void iop_handle_send(uint iop_num, uint chan)
405
406
for (i = 0 ; i < IOP_MSG_LEN ; i ++ , offset ++ ) {
406
407
msg -> reply [i ] = iop_readb (iop , offset );
407
408
}
409
+ iop_pr_debug ("iop_num %d chan %d reply %*ph\n" ,
410
+ iop_num , chan , IOP_MSG_LEN , msg -> reply );
411
+
408
412
if (msg -> handler ) (* msg -> handler )(msg );
409
413
msg -> status = IOP_MSGSTATUS_UNUSED ;
410
414
msg = msg -> next ;
@@ -424,8 +428,6 @@ static void iop_handle_recv(uint iop_num, uint chan)
424
428
int i ,offset ;
425
429
struct iop_msg * msg ;
426
430
427
- iop_pr_debug ("iop_num %d chan %d\n" , iop_num , chan );
428
-
429
431
msg = iop_get_unused_msg ();
430
432
msg -> iop_num = iop_num ;
431
433
msg -> channel = chan ;
@@ -437,6 +439,8 @@ static void iop_handle_recv(uint iop_num, uint chan)
437
439
for (i = 0 ; i < IOP_MSG_LEN ; i ++ , offset ++ ) {
438
440
msg -> message [i ] = iop_readb (iop , offset );
439
441
}
442
+ iop_pr_debug ("iop_num %d chan %d message %*ph\n" ,
443
+ iop_num , chan , IOP_MSG_LEN , msg -> message );
440
444
441
445
iop_writeb (iop , IOP_ADDR_RECV_STATE + chan , IOP_MSG_RCVD );
442
446
@@ -446,9 +450,6 @@ static void iop_handle_recv(uint iop_num, uint chan)
446
450
if (msg -> handler ) {
447
451
(* msg -> handler )(msg );
448
452
} else {
449
- iop_pr_debug ("unclaimed message on iop_num %d chan %d\n" ,
450
- iop_num , chan );
451
- iop_pr_debug ("%*ph\n" , IOP_MSG_LEN , msg -> message );
452
453
memset (msg -> reply , 0 , IOP_MSG_LEN );
453
454
iop_complete_message (msg );
454
455
}
@@ -559,35 +560,34 @@ irqreturn_t iop_ism_irq(int irq, void *dev_id)
559
560
int i ,state ;
560
561
u8 events = iop -> status_ctrl & (IOP_INT0 | IOP_INT1 );
561
562
562
- iop_pr_debug ("status %02X\n" , iop -> status_ctrl );
563
-
564
563
do {
564
+ iop_pr_debug ("iop_num %d status %02X\n" , iop_num ,
565
+ iop -> status_ctrl );
566
+
565
567
/* INT0 indicates state change on an outgoing message channel */
566
568
if (events & IOP_INT0 ) {
567
569
iop -> status_ctrl = IOP_INT0 | IOP_RUN | IOP_AUTOINC ;
568
- iop_pr_debug ("new status %02X, send states" ,
569
- iop -> status_ctrl );
570
570
for (i = 0 ; i < NUM_IOP_CHAN ; i ++ ) {
571
571
state = iop_readb (iop , IOP_ADDR_SEND_STATE + i );
572
- iop_pr_cont (" %02X" , state );
573
572
if (state == IOP_MSG_COMPLETE )
574
573
iop_handle_send (iop_num , i );
574
+ else if (state != IOP_MSG_IDLE )
575
+ iop_pr_debug ("chan %d send state %02X\n" ,
576
+ i , state );
575
577
}
576
- iop_pr_cont ("\n" );
577
578
}
578
579
579
580
/* INT1 for incoming messages */
580
581
if (events & IOP_INT1 ) {
581
582
iop -> status_ctrl = IOP_INT1 | IOP_RUN | IOP_AUTOINC ;
582
- iop_pr_debug ("new status %02X, recv states" ,
583
- iop -> status_ctrl );
584
583
for (i = 0 ; i < NUM_IOP_CHAN ; i ++ ) {
585
584
state = iop_readb (iop , IOP_ADDR_RECV_STATE + i );
586
- iop_pr_cont (" %02X" , state );
587
585
if (state == IOP_MSG_NEW )
588
586
iop_handle_recv (iop_num , i );
587
+ else if (state != IOP_MSG_IDLE )
588
+ iop_pr_debug ("chan %d recv state %02X\n" ,
589
+ i , state );
589
590
}
590
- iop_pr_cont ("\n" );
591
591
}
592
592
593
593
events = iop -> status_ctrl & (IOP_INT0 | IOP_INT1 );
0 commit comments