@@ -604,7 +604,7 @@ s32 EXI_GetID(s32 nChn,s32 nDev,u32 *nId)
604
604
{
605
605
u64 idtime = 0 ;
606
606
s32 ret ,lck ;
607
- u32 level ;
607
+ u32 level , cnt , id ;
608
608
exibus_priv * exi = & eximap [nChn ];
609
609
610
610
if (nChn == EXI_CHANNEL_0 && nDev == EXI_DEVICE_2 && exi_id_serport1 != 0 ) {
@@ -642,7 +642,14 @@ s32 EXI_GetID(s32 nChn,s32 nDev,u32 *nId)
642
642
else ret = EXI_Lock (nChn ,nDev ,NULL );
643
643
644
644
if (ret ) {
645
- ret = EXI_GetIDEx (nChn ,nDev ,nId );
645
+ id = 0xffffffff ;
646
+ cnt = 0 ;
647
+ while (cnt < 10 ) {
648
+ if ((ret = EXI_GetIDEx (nChn ,nDev ,nId ))== 0 ) break ;
649
+ if (id == * nId ) break ;
650
+ id = * nId ;
651
+ cnt ++ ;
652
+ }
646
653
EXI_Unlock (nChn );
647
654
}
648
655
@@ -680,9 +687,10 @@ s32 EXI_GetIDEx(s32 nChn,s32 nDev,u32 *nId)
680
687
681
688
ret = 0 ;
682
689
reg = 0 ;
690
+ * nId = 0 ;
683
691
if (EXI_Imm (nChn ,& reg ,2 ,EXI_WRITE ,NULL )== 0 ) ret |= 0x01 ;
684
692
if (EXI_Sync (nChn )== 0 ) ret |= 0x02 ;
685
- if (EXI_Imm (nChn ,nId ,4 ,EXI_READ ,NULL )== 0 ) ret |= 0x04 ;
693
+ if (EXI_Imm (nChn ,nId ,4 ,EXI_READWRITE ,NULL )== 0 ) ret |= 0x04 ;
686
694
if (EXI_Sync (nChn )== 0 ) ret |= 0x08 ;
687
695
if (EXI_Deselect (nChn )== 0 ) ret |= 0x10 ;
688
696
0 commit comments