]> Zhao Yanbai Git Server - minix.git/commitdiff
Make I/O port check less strict
authorPhilip Homburg <philip@cs.vu.nl>
Thu, 3 Nov 2005 11:33:42 +0000 (11:33 +0000)
committerPhilip Homburg <philip@cs.vu.nl>
Thu, 3 Nov 2005 11:33:42 +0000 (11:33 +0000)
drivers/rtl8139/rtl8139.c

index 4faaf4a39c15aefe648e51d2540fb10cd1b6b0f0..982dfc8fc9ff9fc951b1b4cc4f31731579b1cbd1 100755 (executable)
@@ -182,7 +182,7 @@ FORWARD _PROTOTYPE( unsigned my_inb, (U16_t port) );
 FORWARD _PROTOTYPE( unsigned my_inw, (U16_t port) );
 FORWARD _PROTOTYPE( unsigned my_inl, (U16_t port) );
 static unsigned my_inb(U16_t port) {
-       U8_t value;
+       u32_t value;
        int s;
        if ((s=sys_inb(port, &value)) !=OK)
                printf("RTL8139: warning, sys_inb failed: %d\n", s);
@@ -648,9 +648,11 @@ re_t *rep;
        pci_reserve(devind);
        /* printf("cr = 0x%x\n", pci_attr_r16(devind, PCI_CR)); */
        bar= pci_attr_r32(devind, PCI_BAR) & 0xffffffe0;
-       if ((bar & 0x3ff) >= 0x100-32 || bar < 0x400)
-         panic("rtl_probe",
-           "base address is not properly configured", NO_NUM);
+       if (bar < 0x400)
+       {
+               panic("rtl_probe",
+                       "base address is not properly configured", NO_NUM);
+       }
        rep->re_base_port= bar;
 
        ilr= pci_attr_r8(devind, PCI_ILR);