⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 config.c

📁 i386的bootloader源码grub
💻 C
📖 第 1 页 / 共 2 页
字号:
  { PCI_VENDOR_ID_DEC,      PCI_DEVICE_ID_DEC_TULIP_PLUS,  otulip_probe },  { PCI_VENDOR_ID_DEC,      PCI_DEVICE_ID_DEC_21142,       otulip_probe },# endif /* INCLUDE_OTULIP */# ifdef	INCLUDE_TULIP  { PCI_VENDOR_ID_DEC,      PCI_DEVICE_ID_DEC_TULIP,       tulip_probe },  { PCI_VENDOR_ID_DEC,      PCI_DEVICE_ID_DEC_TULIP_FAST,  tulip_probe },  { PCI_VENDOR_ID_DEC,      PCI_DEVICE_ID_DEC_TULIP_PLUS,  tulip_probe },  { PCI_VENDOR_ID_DEC,      PCI_DEVICE_ID_DEC_21142,       tulip_probe },  { PCI_VENDOR_ID_MACRONIX, PCI_DEVICE_ID_MX987x5,         tulip_probe },  { PCI_VENDOR_ID_LINKSYS,  PCI_DEVICE_ID_LC82C115,        tulip_probe },  { PCI_VENDOR_ID_LINKSYS,  PCI_DEVICE_ID_DEC_TULIP,       tulip_probe },  { PCI_VENDOR_ID_DAVICOM,  PCI_DEVICE_ID_DM9102,          tulip_probe },  { PCI_VENDOR_ID_DAVICOM,  PCI_DEVICE_ID_DM9009,          tulip_probe },  { PCI_VENDOR_ID_ADMTEK,   PCI_DEVICE_ID_ADMTEK_0985,     tulip_probe },  { PCI_VENDOR_ID_ADMTEK,   0x0981,                        tulip_probe },  { 0x125B,                 0x1400,                        tulip_probe },  { 0x11F6,                 0x9881,                        tulip_probe },# endif /* INCLUDE_TULIP */# ifdef INCLUDE_DAVICOM  { PCI_VENDOR_ID_DAVICOM,   PCI_DEVICE_ID_DM9102,           davicom_probe },  { PCI_VENDOR_ID_DAVICOM,   PCI_DEVICE_ID_DM9009,           davicom_probe },# endif /* INCLUDE_DAVICOM */# ifdef	INCLUDE_VIA_RHINE  { PCI_VENDOR_ID_VIATEC,   PCI_DEVICE_ID_VIA_VT6102,      rhine_probe },  { PCI_VENDOR_ID_VIATEC,   PCI_DEVICE_ID_VIA_RHINE_I,     rhine_probe },  { PCI_VENDOR_ID_VIATEC,   PCI_DEVICE_ID_VIA_86C100A,     rhine_probe },# endif /* INCLUDE_VIA_RHINE */# ifdef INCLUDE_W89C840  { PCI_VENDOR_ID_WINBOND2, PCI_DEVICE_ID_WINBOND2_89C840, w89c840_probe },  { PCI_VENDOR_ID_COMPEX,   PCI_DEVICE_ID_COMPEX_RL100ATX, w89c840_probe },# endif /* INCLUDE_W89C840 */# ifdef INCLUDE_SIS900  { PCI_VENDOR_ID_SIS,      PCI_DEVICE_ID_SIS900,          sis900_probe },  { PCI_VENDOR_ID_SIS,      PCI_DEVICE_ID_SIS7016,         sis900_probe },# endif /* INCLUDE_SIS900 */# ifdef INCLUDE_NATSEMI  { PCI_VENDOR_ID_NS,       PCI_DEVICE_ID_DP83815,         natsemi_probe },# endif /* INCLUDE_NATSEMI */# ifdef INCLUDE_TLAN  { PCI_VENDOR_ID_OLICOM,   PCI_DEVICE_ID_OLICOM_OC2326,   tlan_probe },# endif /* INCLUDE_TLAN */  { 0,                      0,                             0 }};#endif /* GRUB && INCLUDE_PCI */struct dispatch_table{  const char	*nic_name;#ifdef	INCLUDE_PCI  struct nic	*(*eth_probe) (struct nic *, unsigned short *,			       struct pci_device *);#else  struct nic	*(*eth_probe) (struct nic *, unsigned short *);#endif	/* INCLUDE_PCI */  unsigned short	*probe_ioaddrs;		/* for probe overrides */};/* *	NIC probing is in order of appearance in this table. *	If for some reason you want to change the order, *	just rearrange the entries (bracketed by the #ifdef/#endif) */static struct dispatch_table	NIC[] ={#ifdef	INCLUDE_RTL8139  { "RTL8139", rtl8139_probe, pci_ioaddrs },#endif#ifdef INCLUDE_SIS900  { "SIS900", sis900_probe, pci_ioaddrs },	#endif#ifdef INCLUDE_NATSEMI  { "NATSEMI", natsemi_probe, pci_ioaddrs },	#endif#ifdef	INCLUDE_WD  { "WD", wd_probe, 0 },#endif#ifdef	INCLUDE_3C503  { "3C503", t503_probe, 0 },#endif#ifdef	INCLUDE_NE  { "NE*000", ne_probe, 0 },#endif#ifdef	INCLUDE_3C509  { "3C5x9", t509_probe, 0 },#endif#ifdef	INCLUDE_3C529  { "3C5x9", t529_probe, 0 },#endif#ifdef	INCLUDE_3C595  { "3C595", t595_probe, pci_ioaddrs },#endif#ifdef	INCLUDE_3C90X  { "3C90X", a3c90x_probe, pci_ioaddrs },#endif#ifdef	INCLUDE_EEPRO  { "EEPRO", eepro_probe, 0 },#endif#ifdef	INCLUDE_EEPRO100  { "EEPRO100", eepro100_probe, pci_ioaddrs },#endif#ifdef	INCLUDE_EPIC100  { "EPIC100", epic100_probe, pci_ioaddrs },#endif#ifdef	INCLUDE_OTULIP  { "OTulip", otulip_probe, pci_ioaddrs },#endif#ifdef	INCLUDE_TULIP  { "Tulip", tulip_probe, pci_ioaddrs },#endif#ifdef	INCLUDE_DAVICOM  { "DAVICOM", davicom_probe, pci_ioaddrs },#endif#ifdef	INCLUDE_CS89X0  { "CS89x0", cs89x0_probe, 0 },#endif#ifdef	INCLUDE_NE2100  { "NE2100", ne2100_probe, 0 },#endif#ifdef	INCLUDE_NI6510  { "NI6510", ni6510_probe, 0 },#endif#ifdef	INCLUDE_SK_G16  { "SK_G16", SK_probe, 0 },#endif#ifdef	INCLUDE_3C507  { "3C507", t507_probe, 0 },#endif#ifdef	INCLUDE_NI5010  { "NI5010", ni5010_probe, 0 },#endif#ifdef	INCLUDE_NI5210  { "NI5210", ni5210_probe, 0 },#endif#ifdef	INCLUDE_EXOS205  { "EXOS205", exos205_probe, 0 },#endif#ifdef	INCLUDE_SMC9000  { "SMC9000", smc9000_probe, 0 },#endif#ifdef	INCLUDE_TIARA  { "TIARA", tiara_probe, 0 },#endif#ifdef	INCLUDE_DEPCA  { "DEPCA", depca_probe, 0 },#endif#ifdef	INCLUDE_NS8390  { "NE2000/PCI", nepci_probe, pci_ioaddrs },#endif#ifdef	INCLUDE_LANCE  { "LANCE/PCI", lancepci_probe, pci_ioaddrs },#endif#ifdef	INCLUDE_VIA_RHINE  { "VIA 86C100", rhine_probe, pci_ioaddrs },#endif#ifdef	INCLUDE_W89C840  { "W89C840F", w89c840_probe, pci_ioaddrs },#endif#ifdef	INCLUDE_TLAN  { "Olicom 2326", tlan_probe, pci_ioaddrs },#endif  /* this entry must always be last to mark the end of list */  { 0, 0, 0 }};#define	NIC_TABLE_SIZE	(sizeof (NIC) / sizeof (NIC[0]))static inteth_dummy (struct nic *dummy){  return 0;}static char	packet[ETH_FRAME_LEN];struct nic	nic ={  (void (*) (struct nic *)) eth_dummy,	/* reset */  eth_dummy,				/* poll */  (void (*) (struct nic *, const char *,	     unsigned int, unsigned int,	     const char *)) eth_dummy,	/* transmit */  (void (*) (struct nic *)) eth_dummy,	/* disable */#ifdef	T503_AUI  1,					/* aui */#else  0,					/* no aui */#endif  &rom,					/* rom_info */  arptable[ARP_CLIENT].node,		/* node_addr */  packet,				/* packet */  0,				/* packetlen */  0,				/* priv_data */};voideth_reset (void){  (*nic.reset) (&nic);}inteth_probe (void){  struct pci_device	*p;  const struct dispatch_table	*t;  static int probed = 0;  /* If already probed, don't try to probe it any longer.  */  if (probed)    return 1;    /* Clear the ready flag.  */  network_ready = 0;  /* Clear the ARP table.  */  grub_memset ((char *) arptable, 0,	       MAX_ARP * sizeof (struct arptable_t));    p = 0;  #ifdef	INCLUDE_PCI  /* In GRUB, the ROM info is initialized here.  */  rom = *((struct rom_info *) ROM_INFO_LOCATION);    eth_pci_init(pci_nic_list);  pci_ioaddrs[0] = 0;  pci_ioaddrs[1] = 0;  /* at this point we have a list of possible PCI candidates     we just pick the first one with a non-zero ioaddr */  for (p = pci_nic_list; p->vendor != 0; ++p)    {      if (p->ioaddr != 0)	{	  pci_ioaddrs[0] = p->ioaddr;	  break;	}    }#endif    etherboot_printf("Probing...");	#ifdef INCLUDE_PCI  if (p->vendor)    {      struct pci_dispatch_table *pt;            for (pt = PCI_NIC; pt->eth_probe != 0; pt++)	if (p->vendor == pt->vendor && p->dev_id == pt->dev_id)	  {	    etherboot_printf ("[%s]", p->name);	    if ((pt->eth_probe) (&nic, pci_ioaddrs, p))	      {		probed = 1;		return 1;	      }	  }    }#endif /* INCLUDE_PCI */	  for (t = NIC; t->nic_name != 0; ++t)    {      etherboot_printf("[%s]", t->nic_name);#ifdef	INCLUDE_PCI      if ((*t->eth_probe) (&nic, t->probe_ioaddrs, p))	{	  probed = 1;	  return 1;	}#else      if ((*t->eth_probe) (&nic, t->probe_ioaddrs))	{	  probed = 1;	  return 1;	}#endif	/* INCLUDE_PCI */    }    return 0;}inteth_poll (void){  return ((*nic.poll) (&nic));}voideth_transmit (const char *d, unsigned int t, unsigned int s, const void *p){  (*nic.transmit) (&nic, d, t, s, p);  if (t == IP)    twiddle ();}voideth_disable (void){  (*nic.disable) (&nic);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -