From 88f653ad2e278a42c3c1c480022820abdeea233f Mon Sep 17 00:00:00 2001 From: Till Straumann Date: Wed, 20 Jul 2011 17:25:21 +0000 Subject: 2011-07-20 Till Straumann * if_em/Makefile.am, if_em/e1000_osdep.h, if_em/e1000_osdep.c, if_em/if_em.c: added e1000_osdep.c which implements all os-dependent parts in a bsdnet-agnostic fashion. Hence, the low-level driver can be used w/o bsdnet. FIXES: dependency on bsdnet initialization; PCI bus header was not initialized when not used via bsdnet (lanIpBasic driver crashed). --- bsd_eth_drivers/if_em/if_em.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'bsd_eth_drivers/if_em/if_em.c') diff --git a/bsd_eth_drivers/if_em/if_em.c b/bsd_eth_drivers/if_em/if_em.c index 05d4216..9d2f8d5 100644 --- a/bsd_eth_drivers/if_em/if_em.c +++ b/bsd_eth_drivers/if_em/if_em.c @@ -441,6 +441,18 @@ em_probe(device_t dev) INIT_DEBUGOUT("em_probe: begin"); +#ifdef __rtems__ + /* copy PCI signature to the low-level (bsd-agnostic) support + * struct. + */ + { + struct adapter *adapter = device_get_softc(dev); + adapter->osdep.pcisig.bus = dev->bushdr.pci.bus; + adapter->osdep.pcisig.dev = dev->bushdr.pci.dev; + adapter->osdep.pcisig.fun = dev->bushdr.pci.fun; + } +#endif + pci_vendor_id = pci_get_vendor(dev); if (pci_vendor_id != EM_VENDOR_ID) return (ENXIO); @@ -4782,6 +4794,7 @@ em_is_valid_ether_addr(uint8_t *addr) return (TRUE); } +#ifndef __rtems__ /* * NOTE: the following routines using the e1000 * naming style are provided to the shared @@ -4864,6 +4877,7 @@ e1000_free_dev_spec_struct(struct e1000_hw *hw) free(hw->dev_spec, M_DEVBUF); return; } +#endif /* * Enable PCI Wake On Lan capability -- cgit v1.2.3