All of lore.kernel.org
 help / color / mirror / Atom feed
From: vincent guffens <v.guffens@imperial.ac.uk>
To: grub-devel@gnu.org
Subject: [patch 3/3] PCI support (simple test driver)
Date: Tue, 16 May 2006 22:40:37 +0100	[thread overview]
Message-ID: <446A46D5.7040704@imperial.ac.uk> (raw)

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);
+}



                 reply	other threads:[~2006-05-16 21:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=446A46D5.7040704@imperial.ac.uk \
    --to=v.guffens@imperial.ac.uk \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.