* [patch 3/3] PCI support (simple test driver)
@ 2006-05-16 21:40 vincent guffens
0 siblings, 0 replies; only message in thread
From: vincent guffens @ 2006-05-16 21:40 UTC (permalink / raw)
To: grub-devel
And here comes the last part, this test driver detects the ne2000 card
in qemu.
2006-05-16 Vincent Guffens <vinsz@fsfe.org>
* drivers/net/: New directory.
* conf/i386-pc.rmk (pkgdata_MODULES): Added test_driver.mod
to the list of modules.
(test_driver_mod_SOURCES): Added.
(test_driver_mod_CFLAGS): Likewise.
(test_driver_mod_LDFLAGS): Likewise.
* driver/net/test_driver.c: New file.
diff -rNu grub2-pci_etherboot/ChangeLog grub2-pci_test_driver/ChangeLog
--- grub2-pci_etherboot/ChangeLog 2006-05-16 21:51:44.000000000 +0100
+++ grub2-pci_test_driver/ChangeLog 2006-05-16 21:52:08.000000000 +0100
@@ -1,5 +1,17 @@
2006-05-16 Vincent Guffens <vinsz@fsfe.org>
+ * drivers/net/: New directory.
+
+ * conf/i386-pc.rmk (pkgdata_MODULES): Added test_driver.mod
+ to the list of modules.
+ (test_driver_mod_SOURCES): Added.
+ (test_driver_mod_CFLAGS): Likewise.
+ (test_driver_mod_LDFLAGS): Likewise.
+
+ * driver/net/test_driver.c: New file.
+
+2006-05-16 Vincent Guffens <vinsz@fsfe.org>
+
* drivers/include/etherboot/: New directory.
* drivers/pci/i386/: Likewise.
diff -rNu grub2-pci_etherboot/conf/i386-pc.rmk
grub2-pci_test_driver/conf/i386-pc.rmk
--- grub2-pci_etherboot/conf/i386-pc.rmk 2006-05-16 21:27:03.000000000 +0100
+++ grub2-pci_test_driver/conf/i386-pc.rmk 2006-05-16 21:39:54.000000000
+0100
@@ -117,7 +117,8 @@
pkgdata_MODULES = _chain.mod _linux.mod linux.mod normal.mod \
_multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod \
vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \
- videotest.mod play.mod pci.mod pci_etherboot.mod
+ videotest.mod play.mod pci.mod pci_etherboot.mod \
+ test_driver.mod
# For _chain.mod.
_chain_mod_SOURCES = loader/i386/pc/chainloader.c
@@ -220,4 +221,9 @@
pci_etherboot_mod_CFLAGS = $(COMMON_CFLAGS) $(DRIVERS_CFLAGS)
pci_etherboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
+# For test_driver.mod
+test_driver_mod_SOURCES = drivers/net/test_driver.c
+test_driver_mod_CFLAGS = $(COMMON_CFLAGS) $(DRIVERS_CFLAGS)
+test_driver_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
include $(srcdir)/conf/common.mk
diff -rNu grub2-pci_etherboot/drivers/net/test_driver.c
grub2-pci_test_driver/drivers/net/test_driver.c
--- grub2-pci_etherboot/drivers/net/test_driver.c 1970-01-01
01:00:00.000000000 +0100
+++ grub2-pci_test_driver/drivers/net/test_driver.c 2006-05-16
21:40:07.000000000 +0100
@@ -0,0 +1,40 @@
+#include <grub/pci.h>
+#include <grub/dl.h>
+#include <grub/normal.h>
+#include <grub/err.h>
+#include <etherboot/pci_ids.h>
+
+static grub_err_t
+test_driver_probe (grub_pci_device_t pdev __attribute__((unused)))
+{
+ /* Whah! if it was always so simple. */
+ return GRUB_ERR_NONE;
+}
+
+static struct grub_pci_ids test_driver_ids[] =
+{
+ {0x10ec, 0x8029, "realtek 8029 test"},
+ {0x1186, 0x0300, "dlink-528"},
+};
+
+static struct grub_pci_driver test_driver =
+{
+ .next = 0,
+ .type = GRUB_NET_ETHERNET,
+ .name = "Test driver",
+ .probe = test_driver_probe,
+ .ids = test_driver_ids,
+ .id_count = sizeof(test_driver_ids)/sizeof(test_driver_ids[0]),
+ .class = 0, /* could be PCI_CLASS_NETWORK_ETHERNET
+ for generic drivers */
+};
+
+GRUB_MOD_INIT(test_driver)
+{
+ grub_register_pci_driver (&test_driver);
+}
+
+GRUB_MOD_FINI(test_driver)
+{
+ grub_unregister_pci_driver (&test_driver);
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-05-16 21:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-16 21:40 [patch 3/3] PCI support (simple test driver) vincent guffens
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.