summaryrefslogtreecommitdiffstats
path: root/bsd_eth_drivers/if_em/e1000_osdep.h
diff options
context:
space:
mode:
authorTill Straumann <strauman@slac.stanford.edu>2011-07-21 23:24:54 +0000
committerTill Straumann <strauman@slac.stanford.edu>2011-07-21 23:24:54 +0000
commitf552470eec83d3587c603922404ea5115c6963a7 (patch)
treef12fca8ecbff140b90683c083795da5299f89452 /bsd_eth_drivers/if_em/e1000_osdep.h
parent2011-07-20 Till Straumann <Till.Straumann@TU-Berlin.de> (diff)
downloadlibbsdport-f552470eec83d3587c603922404ea5115c6963a7.tar.bz2
2011-07-21 Till Straumann <Till.Straumann@TU-Berlin.de>
* if_em/e1000_osdep.h, if_em/e1000_osdep.c, if_em/if_em.c: added e1000_register()/e1000_unregister() to keep track of devices that are 'in-use'. This allows for sharing the low-level code between bsdnet and standalone drivers (e.g., for PtP GigE links).
Diffstat (limited to 'bsd_eth_drivers/if_em/e1000_osdep.h')
-rw-r--r--bsd_eth_drivers/if_em/e1000_osdep.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/bsd_eth_drivers/if_em/e1000_osdep.h b/bsd_eth_drivers/if_em/e1000_osdep.h
index 134c4cc..c6796f1 100644
--- a/bsd_eth_drivers/if_em/e1000_osdep.h
+++ b/bsd_eth_drivers/if_em/e1000_osdep.h
@@ -87,11 +87,20 @@ typedef volatile uint32_t __uint32_va_t __attribute__((may_alias));
typedef volatile uint16_t __uint16_va_t __attribute__((may_alias));
struct e1000_pcisig {
- uint16_t bus;
- uint8_t dev;
- uint8_t fun;
+ uint32_t sig;
};
+/* Register an instance; if this returns nonzero
+ * then registration failed and the device with
+ * the pci signature passed in MUST NOT be used
+ * (since it is already in use by another driver).
+ */
+int
+e1000_register(struct e1000_pcisig *sig_p_out, unsigned bus, unsigned dev, unsigned fun);
+
+void
+e1000_unregister(struct e1000_pcisig *sig_p);
+
#ifdef NO_82542_SUPPORT
#define E1000_REGISTER(hw, reg) reg
#else