All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Vojtech Pavlik <vojtech@suse.de>, Greg KH <greg@kroah.com>
Subject: [PATCH] module-init-tools: generate modules.seriomap
Date: Sun, 6 Feb 2005 02:55:29 -0500	[thread overview]
Message-ID: <200502060255.30088.dtor_core@ameritech.net> (raw)

Hi Rusty,

I have converted serio bus to use ID matching and changed serio drivers
to use MODULE_DEVICE_TABLE. Now that Vojtech pulled the changes into his
tree it would be nice if official module-init-tools generated the module
map so that hotplug scripts could automatically load proper drivers.

Please consider applying the patch below.

Thanks!

-- 
Dmitry

diff -urN module-init-tools-3.1-pre5/depmod.c module-init-tools/depmod.c
--- module-init-tools-3.1-pre5/depmod.c	2004-06-30 23:24:40.000000000 -0500
+++ module-init-tools/depmod.c	2005-01-23 01:16:04.000000000 -0500
@@ -683,6 +683,7 @@
 	{ "modules.ieee1394map", output_ieee1394_table },
 	{ "modules.isapnpmap", output_isapnp_table },
 	{ "modules.inputmap", output_input_table },
+	{ "modules.seriomap", output_serio_table },
 	{ "modules.alias", output_aliases },
 	{ "modules.symbols", output_symbols },
 };
diff -urN module-init-tools-3.1-pre5/depmod.h module-init-tools/depmod.h
--- module-init-tools-3.1-pre5/depmod.h	2003-12-23 21:10:57.000000000 -0500
+++ module-init-tools/depmod.h	2005-01-23 01:17:17.000000000 -0500
@@ -47,6 +47,8 @@
 	void *pnp_card_table;
 	unsigned int input_size;
 	void *input_table;
+	unsigned int serio_size;
+	void *serio_table;
 
 	/* File contents and length. */
 	void *data;
diff -urN module-init-tools-3.1-pre5/moduleops_core.c module-init-tools/moduleops_core.c
--- module-init-tools-3.1-pre5/moduleops_core.c	2004-05-23 22:01:48.000000000 -0500
+++ module-init-tools/moduleops_core.c	2005-01-23 01:43:21.000000000 -0500
@@ -196,6 +196,10 @@
 	module->input_size = PERBIT(INPUT_DEVICE_SIZE);
 	module->input_table = PERBIT(deref_sym)(module->data,
 					"__mod_input_device_table");
+
+	module->serio_size = PERBIT(SERIO_DEVICE_SIZE);
+	module->serio_table = PERBIT(deref_sym)(module->data,
+					"__mod_serio_device_table");
 }
 
 struct module_ops PERBIT(mod_ops) = {
diff -urN module-init-tools-3.1-pre5/tables.c module-init-tools/tables.c
--- module-init-tools-3.1-pre5/tables.c	2003-12-24 00:23:38.000000000 -0500
+++ module-init-tools/tables.c	2005-01-23 01:13:24.000000000 -0500
@@ -340,3 +340,36 @@
 		}
 	}
 }
+
+static void output_serio_entry(struct serio_device_id *serio, char *name, FILE *out)
+{
+	fprintf(out,
+		"%-20s 0x%02x 0x%02x  0x%02x 0x%02x\n",
+		name,
+		serio->type,
+		serio->extra,
+		serio->id,
+		serio->proto);
+}
+
+
+void output_serio_table(struct module *modules, FILE *out)
+{
+	struct module *i;
+
+	fprintf(out, "# serio module       type extra id   proto\n");
+
+	for (i = modules; i; i = i->next) {
+		struct serio_device_id *e;
+		char shortname[strlen(i->pathname) + 1];
+
+		if (!i->serio_table)
+			continue;
+
+		make_shortname(shortname, i->pathname);
+		for (e = i->serio_table; e->type || e->proto; e = (void *)e + i->serio_size)
+			output_serio_entry(e, shortname, out);
+	}
+}
+
+
diff -urN module-init-tools-3.1-pre5/tables.h module-init-tools/tables.h
--- module-init-tools-3.1-pre5/tables.h	2003-12-24 00:18:54.000000000 -0500
+++ module-init-tools/tables.h	2005-01-23 01:21:48.000000000 -0500
@@ -116,6 +116,15 @@
 #define INPUT_DEVICE_SIZE32 (4 + 4 * 2 + 4 + 16 * 4 + 4 + 2 * 4 + 4 + 4 + 4 + 4 * 4 + 4)
 #define INPUT_DEVICE_SIZE64 (8 + 4 * 2 + 8 + 8 * 8 + 8 + 8 + 8 + 8 + 8 + 2 * 8 + 8)
 
+struct serio_device_id {
+	unsigned char type;
+	unsigned char extra;
+	unsigned char id;
+	unsigned char proto;
+};
+#define SERIO_DEVICE_SIZE32 (4 * 1)
+#define SERIO_DEVICE_SIZE64 (4 * 1 + 4)
+
 /* Functions provided by tables.c */
 struct module;
 void output_usb_table(struct module *modules, FILE *out);
@@ -124,5 +133,6 @@
 void output_ccw_table(struct module *modules, FILE *out);
 void output_isapnp_table(struct module *modules, FILE *out);
 void output_input_table(struct module *modules, FILE *out);
+void output_serio_table(struct module *modules, FILE *out);
 
 #endif /* MODINITTOOLS_TABLES_H */

             reply	other threads:[~2005-02-06  7:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-06  7:55 Dmitry Torokhov [this message]
2005-02-07  3:41 ` [PATCH] module-init-tools: generate modules.seriomap Rusty Russell
2005-02-07  5:16   ` Dmitry Torokhov

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=200502060255.30088.dtor_core@ameritech.net \
    --to=dtor_core@ameritech.net \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=vojtech@suse.de \
    /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.