Skip to contentSkip to conversation

PnP MODULE_DEVICE_TABLE Update - 2.5.46 (3/6)

PATCH In review Adam Belay 3 participants 6 messages Nov 7, 2002 – Nov 12, 2002

Subsystems (6)
lore
Share & tools
lore

Adam Belay

author
#0 lore raw

PATCH 1/1 PnP MODULE_DEVICE_TABLE Update - 2.5.46 (3/6)

Here's a patch from Jaroslav Kysela. It was sent in previously but doesn't appear to be included. Here it is again only now against 2.5.46.

drivers/net/e100/e100_main.c +2 -2
diff -ur --new-file a/drivers/net/e100/e100_main.c b/drivers/net/e100/e100_main.c
@@ -87,8 +87,8 @@
 extern int e100_create_proc_subdir(struct e100_private *, char *);
 extern void e100_remove_proc_subdir(struct e100_private *, char *);
 #else
-#define e100_create_proc_subdir(X) 0
-#define e100_remove_proc_subdir(X) do {} while(0)
+#define e100_create_proc_subdir(X, Y) 0
+#define e100_remove_proc_subdir(X, Y) do {} while(0)
 #endif
 
 static int e100_do_ethtool_ioctl(struct net_device *, struct ifreq *);
include/linux/module.h +2 -0
diff -ur --new-file a/include/linux/module.h b/include/linux/module.h
@@ -239,6 +239,8 @@
  * The following is a list of known device types (arg 1),
  * and the C types which are to be passed as arg 2.
  * pci - struct pci_device_id - List of PCI ids supported by this module
+ * pnpc - struct pnpc_device_id - List of PnP card ids (PNPBIOS, ISA PnP) supported by this module
+ * pnp - struct pnp_device_id - List of PnP ids (PNPBIOS, ISA PnP) supported by this module
  * isapnp - struct isapnp_device_id - List of ISA PnP ids supported by this module
  * usb - struct usb_device_id - List of USB ids supported by this module
  */
include/linux/pnp.h +3 -0
diff -ur --new-file a/include/linux/pnp.h b/include/linux/pnp.h
@@ -79,6 +79,9 @@
 
 /* Driver Management */
 
+#define pnpc_device_id pnp_id		/* for module.h */
+#define pnp_device_id pnp_id		/* for module.h */
+
 struct pnp_id {
 	char id[7];
 	unsigned long driver_data;	/* data private to the driver */
include/linux/sunrpc/stats.h +10 -8
diff -ur --new-file a/include/linux/sunrpc/stats.h b/include/linux/sunrpc/stats.h
@@ -61,16 +61,18 @@
 
 #else
 
+static inline struct proc_dir_entry *rpc_proc_register(struct rpc_stat *s) { return NULL; }
+static inline void rpc_proc_unregister(const char *p) {}
+static inline int rpc_proc_read(char *a, char **b, off_t c, int d, int *e, void *f) { return 0; }
+static inline void rpc_proc_zero(struct rpc_program *p) {}
+
+static inline struct proc_dir_entry *svc_proc_register(struct svc_stat *s) { return NULL; }
 static inline void svc_proc_unregister(const char *p) {}
-static inline struct proc_dir_entry*svc_proc_register(struct svc_stat *s)
-{
-	return NULL;
-}
+static inline int svc_proc_read(char *a, char **b, off_t c, int d, int *e, void *f) { return 0; }
+static inline void svc_proc_zero(struct svc_program *p) {}
+
+#define proc_net_rpc NULL
 
-static inline int svc_proc_read(char *a, char **b, off_t c, int d, int *e, void *f)
-{
-	return 0;
-}
 #endif
 
 #endif /* _LINUX_SUNRPC_STATS_H */
sound/oss/opl3sa2.c +1 -1
diff -ur --new-file a/sound/oss/opl3sa2.c b/sound/oss/opl3sa2.c
@@ -841,7 +841,7 @@
 	{.id = ""}
 };
 
-/*MODULE_DEVICE_TABLE(isapnp, isapnp_opl3sa2_list);*/
+MODULE_DEVICE_TABLE(pnp, pnp_opl3sa2_list);
 
 static int opl3sa2_pnp_probe(struct pnp_dev *dev, const struct pnp_id *card_id,
 			     const struct pnp_id *dev_id)
#1 lore raw

include/linux/module.h line 243

Quoted 10 lines · Adam Belay

diff -ur --new-file a/include/linux/module.h b/include/linux/module.h

include/linux/module.h +2 -0
@@ -239,6 +239,8 @@
  * The following is a list of known device types (arg 1),
  * and the C types which are to be passed as arg 2.
  * pci - struct pci_device_id - List of PCI ids supported by this module
+ * pnpc - struct pnpc_device_id - List of PnP card ids (PNPBIOS, ISA PnP) supported by this module
+ * pnp - struct pnp_device_id - List of PnP ids (PNPBIOS, ISA PnP) supported by this module

I must have missed this last time, but to refresh my memory, why do you need two different device types? What's the difference between a card id and a device id?

thanks,

greg k-h

#2 lore raw
Quoted 15 lines · Greg KH

include/linux/module.h line 243

Quoted 10 lines · Adam Belay

diff -ur --new-file a/include/linux/module.h b/include/linux/module.h

include/linux/module.h +2 -0
@@ -239,6 +239,8 @@
  * The following is a list of known device types (arg 1),
  * and the C types which are to be passed as arg 2.
  * pci - struct pci_device_id - List of PCI ids supported by this module
+ * pnpc - struct pnpc_device_id - List of PnP card ids (PNPBIOS, ISA PnP) supported by this module
+ * pnp - struct pnp_device_id - List of PnP ids (PNPBIOS, ISA PnP) supported by this module

I must have missed this last time, but to refresh my memory, why do you need two different device types? What's the difference between a card id and a device id?

The card id represents a group of logical devices (device ids). It's good to know how are devices connected, especially for soundcards where are several logical devices working together (codec, synth, midi uart). Addressing these devices separately (as the OSS sound driver does for example) causes a lot of confusion for users when more cards are in one system.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com

#3 lore raw
Quoted 18 lines · Jaroslav Kysela
Quoted 15 lines · Greg KH

include/linux/module.h line 243

Quoted 10 lines · Adam Belay

diff -ur --new-file a/include/linux/module.h b/include/linux/module.h

include/linux/module.h +2 -0
@@ -239,6 +239,8 @@
  * The following is a list of known device types (arg 1),
  * and the C types which are to be passed as arg 2.
  * pci - struct pci_device_id - List of PCI ids supported by this module
+ * pnpc - struct pnpc_device_id - List of PnP card ids (PNPBIOS, ISA PnP) supported by this module
+ * pnp - struct pnp_device_id - List of PnP ids (PNPBIOS, ISA PnP) supported by this module

I must have missed this last time, but to refresh my memory, why do you need two different device types? What's the difference between a card id and a device id?

Quoted 6 lines

The card id represents a group of logical devices (device ids). It's good to know how are devices connected, especially for soundcards where are several logical devices working together (codec, synth, midi uart). Addressing these devices separately (as the OSS sound driver does for example) causes a lot of confusion for users when more cards are in one system.

But I don't see any code using this functionality in the kernel right now (or in the patches just sent out.) Is it really needed if there is no users?

thanks,

greg k-h

#4 lore raw
Quoted 26 lines · Greg KH
Quoted 18 lines · Jaroslav Kysela
Quoted 15 lines · Greg KH

include/linux/module.h line 243

Quoted 10 lines · Adam Belay

diff -ur --new-file a/include/linux/module.h b/include/linux/module.h

include/linux/module.h +2 -0
@@ -239,6 +239,8 @@
  * The following is a list of known device types (arg 1),
  * and the C types which are to be passed as arg 2.
  * pci - struct pci_device_id - List of PCI ids supported by this module
+ * pnpc - struct pnpc_device_id - List of PnP card ids (PNPBIOS, ISA PnP) supported by this module
+ * pnp - struct pnp_device_id - List of PnP ids (PNPBIOS, ISA PnP) supported by this module

I must have missed this last time, but to refresh my memory, why do you need two different device types? What's the difference between a card id and a device id?

Quoted 6 lines

The card id represents a group of logical devices (device ids). It's good to know how are devices connected, especially for soundcards where are several logical devices working together (codec, synth, midi uart). Addressing these devices separately (as the OSS sound driver does for example) causes a lot of confusion for users when more cards are in one system.

Quoted 3 lines

But I don't see any code using this functionality in the kernel right now (or in the patches just sent out.) Is it really needed if there is no users?

All ALSA modules will use it after this patch is merged.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

#5 lore raw
Quoted 2 lines · Jaroslav Kysela

All ALSA modules will use it after this patch is merged.

I had to not apply the include/linux/module.h changes as Rusty is in the middle of hacking that code into a billion tiny pieces. As it was only a comment change, I don't think it was a big deal right now :)

And he is currently changing the MODULE_DEVICE_TABLE() logic to not expose kernel structures to userspace, so you might want to watch that to see if it will work for your type of devices too.

thanks,

greg k-h