Hello, Thierry

I recently had the same problems with GRUB netbooting, and already
done just what you suggested:
 added new field to pci_device struct - pointer to correct probe 
 routine:
struct pci_device {
        unsigned short  vendor, dev_id;
        const char      *name;
        unsigned int    membase;
        unsigned short  ioaddr;
        unsigned short  devfn;
        struct nic      *(*eth_probe)(struct nic *, unsigned short *,
                                      struct pci_device *);
}; 
and added code to call the correct probe function before trying
all the drivers. I was in doubt whom I shoud bug with it: Okuji or 
Etherboot maintainers. I attached my patch to this message so 
we avoid unneeded duplication of efforts.  This is my current and 
working version. 

By the way I looked into recent Etherboot distribution 
and found that version in grub is quite dated 5 or 8 month old, 
Etherboot has some new drivers, pci_device struct is also changed. 
However this problem with non-optimal probing sequence of pci devices 
still exists in Etherboot too.

Regards,
Eugene


On Sun, 14 Jan 2001, Thierry Laronde wrote:
> Hello,
> 
> I have the following goal : built a "diagnOS" floppy with the GRUB on it, 
> allowing in particular to boot via the network (LAN) from any unknown 
> PC with a supported PCI NIC.
> 
[snip] 

--- grub-0.5.96.1/netboot/config.c      Sun Jul 30 03:22:54 2000
+++ grub-0.5.96.1-ifconfig2/netboot/config.c    Sat Jan 13 18:38:22 2001
@@ -35,115 +35,116 @@
 #if    defined(ETHERBOOT32)            /* only for 32 bit machines */
 #define        INCLUDE_PCI
 #include       "pci.h"
+#include        "cards.h"
 static unsigned short  pci_ioaddrs[16];
 
 static struct pci_device       pci_nic_list[] = {
 #ifdef INCLUDE_NS8390
        { PCI_VENDOR_ID_REALTEK,        PCI_DEVICE_ID_REALTEK_8029,
-               "Realtek 8029", 0, 0, 0},
+               "Realtek 8029", 0, 0, 0,nepci_probe },
        { PCI_VENDOR_ID_WINBOND2,       PCI_DEVICE_ID_WINBOND2_89C940,
-               "Winbond NE2000-PCI", 0, 0, 0},
+               "Winbond NE2000-PCI", 0, 0, 0,nepci_probe},
        { PCI_VENDOR_ID_COMPEX,         PCI_DEVICE_ID_COMPEX_RL2000,
-               "Compex ReadyLink 2000", 0, 0, 0},
+               "Compex ReadyLink 2000", 0, 0, 0,nepci_probe },
        { PCI_VENDOR_ID_KTI,            PCI_DEVICE_ID_KTI_ET32P2,
-               "KTI ET32P2", 0, 0, 0},
+               "KTI ET32P2", 0, 0, 0,nepci_probe},
        { PCI_VENDOR_ID_NETVIN,         PCI_DEVICE_ID_NETVIN_NV5000SC,
-               "NetVin NV5000SC", 0, 0, 0},
+               "NetVin NV5000SC", 0, 0, 0,nepci_probe},
 #endif
 #ifdef INCLUDE_3C90X
        { PCI_VENDOR_ID_3COM,           PCI_DEVICE_ID_3COM_3C900TPO,
-               "3Com900-TPO", 0, 0, 0},
+               "3Com900-TPO", 0, 0, 0,a3c90x_probe},
        { PCI_VENDOR_ID_3COM,           PCI_DEVICE_ID_3COM_3C900COMBO,
-               "3Com900-Combo", 0, 0, 0},
+               "3Com900-Combo", 0, 0, 0,a3c90x_probe},
        { PCI_VENDOR_ID_3COM,           PCI_DEVICE_ID_3COM_3C905TX,
-               "3Com905-TX", 0, 0, 0},
+               "3Com905-TX", 0, 0, 0,a3c90x_probe},
        { PCI_VENDOR_ID_3COM,           PCI_DEVICE_ID_3COM_3C905T4,
-               "3Com905-T4", 0, 0, 0},
+               "3Com905-T4", 0, 0, 0,a3c90x_probe},
 
        { PCI_VENDOR_ID_3COM,           0x9004,
-               "3Com900B-TPO", 0, 0, 0},
+               "3Com900B-TPO", 0, 0, 0,a3c90x_probe},
        { PCI_VENDOR_ID_3COM,           0x9005,
-               "3Com900B-Combo", 0, 0, 0},
+               "3Com900B-Combo", 0, 0, 0,a3c90x_probe},
        { PCI_VENDOR_ID_3COM,           0x9006,
-               "3Com900B-2/T", 0, 0, 0},
+               "3Com900B-2/T", 0, 0, 0,a3c90x_probe},
        { PCI_VENDOR_ID_3COM,           0x900A,
-               "3Com900B-FL", 0, 0, 0},
+               "3Com900B-FL", 0, 0, 0,a3c90x_probe},
        { PCI_VENDOR_ID_3COM,           PCI_DEVICE_ID_3COM_3C905B_TX,
-               "3Com905B-TX", 0, 0, 0},
+               "3Com905B-TX", 0, 0, 0,a3c90x_probe},
        { PCI_VENDOR_ID_3COM,           0x9056,
-               "3Com905B-T4", 0, 0, 0},
+               "3Com905B-T4", 0, 0, 0,a3c90x_probe},
        { PCI_VENDOR_ID_3COM,           0x905A,
-               "3Com905B-FL", 0, 0, 0},
+               "3Com905B-FL", 0, 0, 0,a3c90x_probe},
        { PCI_VENDOR_ID_3COM,           PCI_DEVICE_ID_3COM_3C905C_TXM,
-               "3Com905C-TXM", 0, 0, 0},
+               "3Com905C-TXM", 0, 0, 0,a3c90x_probe},
 
 #endif
 #ifdef INCLUDE_3C595
        { PCI_VENDOR_ID_3COM,           PCI_DEVICE_ID_3COM_3C590,
-               "3Com590", 0, 0, 0},
+               "3Com590", 0, 0, 0,t595_probe},
        { PCI_VENDOR_ID_3COM,           PCI_DEVICE_ID_3COM_3C595,
-               "3Com595", 0, 0, 0},
+               "3Com595", 0, 0, 0,t595_probe},
        { PCI_VENDOR_ID_3COM,           PCI_DEVICE_ID_3COM_3C595_1,
-               "3Com595", 0, 0, 0},
+               "3Com595", 0, 0, 0,t595_probe},
        { PCI_VENDOR_ID_3COM,           PCI_DEVICE_ID_3COM_3C595_2,
-               "3Com595", 0, 0, 0},
+               "3Com595", 0, 0, 0,t595_probe},
 #endif
 #ifdef INCLUDE_EEPRO100
        { PCI_VENDOR_ID_INTEL,          PCI_DEVICE_ID_INTEL_82557,
-               "Intel EtherExpressPro100", 0, 0, 0},
+               "Intel EtherExpressPro100", 0, 0, 0,  eepro100_probe},
 #endif
 #ifdef INCLUDE_EPIC100
        { PCI_VENDOR_ID_SMC,            PCI_DEVICE_ID_SMC_EPIC100,
-               "SMC EtherPowerII", 0, 0, 0},
+               "SMC EtherPowerII", 0, 0, 0, epic100_probe},
 #endif
 #ifdef INCLUDE_LANCE
        { PCI_VENDOR_ID_AMD,            PCI_DEVICE_ID_AMD_LANCE,
-               "AMD Lance/PCI", 0, 0, 0},
+               "AMD Lance/PCI", 0, 0, 0,lancepci_probe},
 #endif
 #ifdef INCLUDE_RTL8139
        { PCI_VENDOR_ID_REALTEK,        PCI_DEVICE_ID_REALTEK_8139,
-               "Realtek 8139", 0, 0, 0},
+               "Realtek 8139", 0, 0, 0, rtl8139_probe},
         { PCI_VENDOR_ID_SMC_1211,       PCI_DEVICE_ID_SMC_1211,
-                "SMC EZ10/100", 0, 0, 0},
+                "SMC EZ10/100", 0, 0, 0, rtl8139_probe},
 #endif
 #ifdef INCLUDE_OTULIP
        { PCI_VENDOR_ID_DEC,            PCI_DEVICE_ID_DEC_TULIP,
-               "Digital Tulip", 0, 0, 0},
+               "Digital Tulip", 0, 0, 0, otulip_probe},
        { PCI_VENDOR_ID_DEC,            PCI_DEVICE_ID_DEC_TULIP_FAST,
-               "Digital Tulip Fast", 0, 0, 0},
+               "Digital Tulip Fast", 0, 0, 0, otulip_probe},
        { PCI_VENDOR_ID_DEC,            PCI_DEVICE_ID_DEC_TULIP_PLUS,
-               "Digital Tulip+", 0, 0, 0},
+               "Digital Tulip+", 0, 0, 0, otulip_probe},
        { PCI_VENDOR_ID_DEC,            PCI_DEVICE_ID_DEC_21142,
-               "Digital Tulip 21142", 0, 0, 0},
+               "Digital Tulip 21142", 0, 0, 0, otulip_probe},
 #endif
 #ifdef INCLUDE_TULIP
        { PCI_VENDOR_ID_DEC,            PCI_DEVICE_ID_DEC_TULIP,
-               "Digital Tulip", 0, 0, 0},
+               "Digital Tulip", 0, 0, 0, tulip_probe},
        { PCI_VENDOR_ID_DEC,            PCI_DEVICE_ID_DEC_TULIP_FAST,
-               "Digital Tulip Fast", 0, 0, 0},
+               "Digital Tulip Fast", 0, 0, 0, tulip_probe},
        { PCI_VENDOR_ID_DEC,            PCI_DEVICE_ID_DEC_TULIP_PLUS,
-               "Digital Tulip+", 0, 0, 0},
+               "Digital Tulip+", 0, 0, 0, tulip_probe},
        { PCI_VENDOR_ID_DEC,            PCI_DEVICE_ID_DEC_21142,
-               "Digital Tulip 21142", 0, 0, 0},
+               "Digital Tulip 21142", 0, 0, 0, tulip_probe},
        { PCI_VENDOR_ID_MACRONIX,       PCI_DEVICE_ID_MX987x5,
-               "Macronix MX987x5", 0, 0, 0},
+               "Macronix MX987x5", 0, 0, 0, tulip_probe},
        { PCI_VENDOR_ID_LINKSYS,        PCI_DEVICE_ID_LC82C115,
-               "LinkSys LNE100TX", 0, 0, 0},
+               "LinkSys LNE100TX", 0, 0, 0, tulip_probe},
        { PCI_VENDOR_ID_LINKSYS,        PCI_DEVICE_ID_DEC_TULIP,
-               "Netgear FA310TX", 0, 0, 0},
+               "Netgear FA310TX", 0, 0, 0, tulip_probe},
        { PCI_VENDOR_ID_DAVICOM, PCI_DEVICE_ID_DM9102,
-               "Davicom 9102", 0, 0, 0},
+               "Davicom 9102", 0, 0, 0, tulip_probe},
        { PCI_VENDOR_ID_ADMTEK, PCI_DEVICE_ID_ADMTEK_0985,
-               "ADMtek Centaur-P", 0, 0, 0},
+               "ADMtek Centaur-P", 0, 0, 0, tulip_probe},
 #endif
 #ifdef INCLUDE_VIA_RHINE
        { PCI_VENDOR_ID_VIATEC, PCI_DEVICE_ID_VIA_RHINE_I,
-               "VIA 3043", 0, 0, 0},
+               "VIA 3043", 0, 0, 0, rhine_probe},
        { PCI_VENDOR_ID_VIATEC, PCI_DEVICE_ID_VIA_86C100A,
-               "VIA 86C100A", 0, 0, 0},
+               "VIA 86C100A", 0, 0, 0, rhine_probe},
 #endif
 /* other PCI NICs go here */
-       {0, 0, NULL, 0, 0, 0}
+       {0, 0, NULL, 0, 0, 0,0}
 };
 #endif /* ETHERBOOT32 */
 #endif /* INCLUDE_*PCI */
@@ -350,6 +352,18 @@
        }
 #endif
        printf("Probing...");
+#ifdef INCLUDE_PCI
+       if(p->name && p->eth_probe) 
+         {
+           printf("<%s>", p->name);
+           if ((p->eth_probe)(&nic, pci_ioaddrs, p)) {
+#ifdef GRUB
+             probed = 1;
+#endif /* GRUB */
+             return (1);
+           }
+         }
+#endif /* INCLUDE_PCI */
        for (t = NIC; t->nic_name != 0; ++t)
        {
                printf("[%s]", t->nic_name);
--- ./grub-0.5.96.1/netboot/pci.h       Sun Jul 30 03:22:54 2000
+++ ./grub-0.5.96.1-ifconfig2/netboot/pci.h     Sat Jan 13 18:15:32 2001
@@ -149,6 +149,8 @@
        unsigned int    membase;
        unsigned short  ioaddr;
        unsigned short  devfn;
+        struct nic     *(*eth_probe)(struct nic *, unsigned short *,
+                                     struct pci_device *);
 };
 
 extern void    eth_pci_init(struct pci_device *);


_______________________________________________
Bug-grub mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-grub

Reply via email to