Skip to contentSkip to conversation

Dynamic DVB minor allocation

linux-dvb Andreas Oberritter 1 participant 1 message Oct 20, 2008 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Hello,

recently we've exceeded the limit of minor devices, when we tried to register five demux devices on an adapter instance. We circumvented this limit by changing the macro nums2minor, which is not acceptable if you want to stay backwards compatible.

So I went for a cleaner solution and added a new configuration option, which allows dynamic minor allocation for DVB devices.

I haven't tested it yet. It is loosely based on drivers/usb/core/file.c.

Any comments?

Regards,
Andreas

linux/drivers/media/dvb/Kconfig +12 -0
diff -r 9273407ca6e1 linux/drivers/media/dvb/Kconfig
@@ -8,6 +8,18 @@
 	default y
 	---help---
 	  Say Y to select Digital TV adapters
+
+config DVB_DYNAMIC_MINORS
+	bool "Dynamic DVB minor allocation"
+	depends on DVB_CORE
+	help
+	  If you say Y here, the DVB subsystem will use dynamic minor
+	  allocation for any device that uses the DVB major number.
+	  This means that you can have more than 4 of a single type
+	  of device (like demuxes and frontends) per adapter, but udev
+	  will be required to manage the device nodes.
+
+	  If you are unsure about this, say N here.
 
 if DVB_CAPTURE_DRIVERS && DVB_CORE
 
linux/drivers/media/dvb/dvb-core/dvbdev.c +40 -21

119 lines not on this page · raw message

linux/drivers/media/dvb/dvb-core/dvbdev.h +1 -0
diff -r 9273407ca6e1 linux/drivers/media/dvb/dvb-core/dvbdev.h
@@ -70,6 +70,7 @@
 	struct file_operations *fops;
 	struct dvb_adapter *adapter;
 	int type;
+	int minor;
 	u32 id;
 
 	/* in theory, 'users' can vanish now,

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb