summaryrefslogtreecommitdiffstats
path: root/bsd_eth_drivers/if_em/if_em.c
diff options
context:
space:
mode:
authorTill Straumann <strauman@slac.stanford.edu>2011-07-20 17:25:21 +0000
committerTill Straumann <strauman@slac.stanford.edu>2011-07-20 17:25:21 +0000
commit88f653ad2e278a42c3c1c480022820abdeea233f (patch)
tree56329574a0093a9db1385b31124d9e92136afec3 /bsd_eth_drivers/if_em/if_em.c
parent9d32a19998f9b70249bdf9daa8efde9262d71b9e (diff)
downloadlibbsdport-88f653ad2e278a42c3c1c480022820abdeea233f.tar.bz2
2011-07-20 Till Straumann <Till.Straumann@TU-Berlin.de>
* 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).
Diffstat (limited to 'bsd_eth_drivers/if_em/if_em.c')
-rw-r--r--bsd_eth_drivers/if_em/if_em.c14
1 files changed, 14 insertions, 0 deletions
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