summaryrefslogtreecommitdiffstats
path: root/src/include/nic.h
diff options
context:
space:
mode:
authorMichael Brown2005-03-08 19:53:11 +0100
committerMichael Brown2005-03-08 19:53:11 +0100
commit3d6123e69ab879c72ff489afc5bf93ef0b7a94ce (patch)
tree9f3277569153a550fa8d81ebd61bd88f266eb8da /src/include/nic.h
downloadipxe-3d6123e69ab879c72ff489afc5bf93ef0b7a94ce.tar.gz
ipxe-3d6123e69ab879c72ff489afc5bf93ef0b7a94ce.tar.xz
ipxe-3d6123e69ab879c72ff489afc5bf93ef0b7a94ce.zip
Initial revision
Diffstat (limited to 'src/include/nic.h')
-rw-r--r--src/include/nic.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/include/nic.h b/src/include/nic.h
new file mode 100644
index 00000000..c258d745
--- /dev/null
+++ b/src/include/nic.h
@@ -0,0 +1,49 @@
+ /*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2, or (at
+ * your option) any later version.
+ */
+
+#ifndef NIC_H
+#define NIC_H
+
+#include "dev.h"
+
+typedef enum {
+ DISABLE = 0,
+ ENABLE,
+ FORCE
+} irq_action_t;
+
+/*
+ * Structure returned from eth_probe and passed to other driver
+ * functions.
+ */
+struct nic
+{
+ struct dev dev; /* This must come first */
+ int (*poll)P((struct nic *, int retrieve));
+ void (*transmit)P((struct nic *, const char *d,
+ unsigned int t, unsigned int s, const char *p));
+ void (*irq)P((struct nic *, irq_action_t));
+ int flags; /* driver specific flags */
+ struct rom_info *rom_info; /* -> rom_info from main */
+ unsigned char *node_addr;
+ unsigned char *packet;
+ unsigned int packetlen;
+ unsigned int ioaddr;
+ unsigned char irqno;
+ void *priv_data; /* driver can hang private data here */
+};
+
+
+extern struct nic nic;
+extern int eth_probe(struct dev *dev);
+extern int eth_poll(int retrieve);
+extern void eth_transmit(const char *d, unsigned int t, unsigned int s, const void *p);
+extern void eth_disable(void);
+extern void eth_irq(irq_action_t action);
+extern int eth_load_configuration(struct dev *dev);
+extern int eth_load(struct dev *dev);;
+#endif /* NIC_H */