From: John Hodge Date: Fri, 28 Oct 2011 13:41:04 +0000 (+0800) Subject: Modules/RTL8139 - Fixed bug if BAR is invalid X-Git-Tag: rel0.14~174 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=463074dd4899f1cc851bff9c74356f5c6def1bb2;p=tpg%2Facess2.git Modules/RTL8139 - Fixed bug if BAR is invalid --- diff --git a/Modules/Network/RTL8139/rtl8139.c b/Modules/Network/RTL8139/rtl8139.c index a34aeb4a..4472276a 100644 --- a/Modules/Network/RTL8139/rtl8139.c +++ b/Modules/Network/RTL8139/rtl8139.c @@ -133,13 +133,13 @@ int RTL8139_Install(char **Options) gaRTL8139_Cards = calloc( giRTL8139_CardCount, sizeof(tCard) ); - //while( (id = PCI_GetDevice(0x10EC, 0x8139, 0, id)) != -1 ) - while( (id = PCI_GetDevice(VENDOR_ID, DEVICE_ID, i)) != -1 ) + for( i = 0 ; (id = PCI_GetDevice(VENDOR_ID, DEVICE_ID, i)) != -1; i ++ ) { card = &gaRTL8139_Cards[i]; base = PCI_GetBAR( id, 0 ); if( !(base & 1) ) { - Log_Warning("RTL8139", "Driver does not support MMIO, skipping card"); + Log_Warning("RTL8139", "Driver does not support MMIO, skipping card (addr %x)", + base); card->IOBase = 0; card->IRQ = 0; continue ; @@ -215,8 +215,6 @@ int RTL8139_Install(char **Options) card->MacAddr[0], card->MacAddr[1], card->MacAddr[2], card->MacAddr[3], card->MacAddr[4], card->MacAddr[5] ); - - i ++; } gRTL8139_DriverInfo.RootNode.Size = giRTL8139_CardCount;