* [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
@ 2008-03-29 21:40 Janne Grunau
2008-03-30 6:02 ` Michael Krufky
2008-04-09 15:07 ` Manu Abraham
0 siblings, 2 replies; 24+ messages in thread
From: Janne Grunau @ 2008-03-29 21:40 UTC (permalink / raw)
To: linux-dvb
[-- Attachment #1: Type: text/plain, Size: 1272 bytes --]
Hi,
I resubmit this patch since I still think it is a good idea to the this
driver option. There is still no udev recipe to guaranty stable dvb
adapter numbers. I've tried to come up with some rules but it's tricky
due to the multiple device nodes in a subdirectory. I won't claim that
it is impossible to get udev to assign driver or hardware specific
stable dvb adapter numbers but I think this patch is easier and more
clean than a udev based solution.
I'll drop this patch if a simple udev solution is found in a reasonable
amount of time. But if there is no I would like to see the attached
patch merged.
Quoting myself for a short desciprtion for the patch:
> V4L drivers have the {radio|vbi|video}_nr module options to allocate
> static minor numbers per driver.
>
> Attached patch adds a similiar mechanism to the dvb subsystem. To
> avoid problems with device unplugging and repluging each driver holds
> a DVB_MAX_ADAPTER long array of the preffered order of adapter
> numbers.
>
> options dvb-usb-dib0700 adapter_nr=7,6,5,4,3,2,1,0 would result in a
> reversed allocation of adapter numbers.
>
> With adapter_nr=2,5 it tries first to get adapter number 2 and 5. If
> both are already in use it will allocate the lowest free adapter
> number.
Janne
[-- Attachment #2: modoption_adapter_numbers2.diff --]
[-- Type: text/x-diff, Size: 39432 bytes --]
diff -r 0776e4801991 linux/drivers/media/dvb/b2c2/flexcop.c
--- a/linux/drivers/media/dvb/b2c2/flexcop.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/b2c2/flexcop.c Sat Mar 29 22:39:56 2008 +0100
@@ -49,6 +49,10 @@ MODULE_PARM_DESC(debug, "set debug level
MODULE_PARM_DESC(debug, "set debug level (1=info,2=tuner,4=i2c,8=ts,16=sram,32=reg (|-able))." DEBSTATUS);
#undef DEBSTATUS
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
+
/* global zero for ibi values */
flexcop_ibi_value ibi_zero;
@@ -67,7 +71,7 @@ static int flexcop_dvb_init(struct flexc
static int flexcop_dvb_init(struct flexcop_device *fc)
{
int ret;
- if ((ret = dvb_register_adapter(&fc->dvb_adapter,"FlexCop Digital TV device",fc->owner,fc->dev)) < 0) {
+ if ((ret = dvb_register_adapter(&fc->dvb_adapter,"FlexCop Digital TV device",fc->owner,fc->dev,adapter_nr)) < 0) {
err("error registering DVB adapter");
return ret;
}
diff -r 0776e4801991 linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
--- a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c Sat Mar 29 22:39:56 2008 +0100
@@ -40,6 +40,11 @@ static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
#define dprintk( args... ) \
do { \
@@ -718,7 +723,7 @@ static int __devinit dvb_bt8xx_load_card
{
int result;
- if ((result = dvb_register_adapter(&card->dvb_adapter, card->card_name, THIS_MODULE, &card->bt->dev->dev)) < 0) {
+ if ((result = dvb_register_adapter(&card->dvb_adapter, card->card_name, THIS_MODULE, &card->bt->dev->dev, adapter_nr)) < 0) {
printk("dvb_bt8xx: dvb_register_adapter failed (errno = %d)\n", result);
return result;
}
diff -r 0776e4801991 linux/drivers/media/dvb/cinergyT2/cinergyT2.c
--- a/linux/drivers/media/dvb/cinergyT2/cinergyT2.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/cinergyT2/cinergyT2.c Sat Mar 29 22:39:56 2008 +0100
@@ -60,6 +60,10 @@ static int debug;
static int debug;
module_param_named(debug, debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
#define dprintk(level, args...) \
@@ -1004,7 +1008,7 @@ static int cinergyt2_probe (struct usb_i
return -ENOMEM;
}
- if ((err = dvb_register_adapter(&cinergyt2->adapter, DRIVER_NAME, THIS_MODULE, &cinergyt2->udev->dev)) < 0) {
+ if ((err = dvb_register_adapter(&cinergyt2->adapter, DRIVER_NAME, THIS_MODULE, &cinergyt2->udev->dev, adapter_nr)) < 0) {
kfree(cinergyt2);
return err;
}
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-core/dvbdev.c
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c Sat Mar 29 22:39:56 2008 +0100
@@ -52,7 +52,6 @@ static const char * const dnames[] = {
"net", "osd"
};
-#define DVB_MAX_ADAPTERS 8
#define DVB_MAX_IDS 4
#define nums2minor(num,type,id) ((num << 6) | (id << 4) | type)
#define MAX_DVB_MINORS (DVB_MAX_ADAPTERS*64)
@@ -277,18 +276,25 @@ void dvb_unregister_device(struct dvb_de
}
EXPORT_SYMBOL(dvb_unregister_device);
+static int dvbdev_check_free_adapter_num(int num)
+{
+ struct list_head *entry;
+ list_for_each (entry, &dvb_adapter_list) {
+ struct dvb_adapter *adap;
+ adap = list_entry(entry, struct dvb_adapter, list_head);
+ if (adap->num == num)
+ return 0;
+ }
+ return 1;
+}
static int dvbdev_get_free_adapter_num (void)
{
int num = 0;
while (num < DVB_MAX_ADAPTERS) {
- struct dvb_adapter *adap;
- list_for_each_entry(adap, &dvb_adapter_list, list_head)
- if (adap->num == num)
- goto skip;
- return num;
-skip:
+ if (dvbdev_check_free_adapter_num(num))
+ return num;
num++;
}
@@ -296,13 +302,27 @@ skip:
}
-int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct module *module, struct device *device)
+int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct module *module, struct device *device, int *adapter_nums)
{
- int num;
+ int i, num;
mutex_lock(&dvbdev_register_lock);
- if ((num = dvbdev_get_free_adapter_num ()) < 0) {
+ for (i=0; i<DVB_MAX_ADAPTERS; ++i) {
+ num = adapter_nums[i];
+ if (num >= 0 && num < DVB_MAX_ADAPTERS) {
+ /* use the one the driver asked for */
+ if (dvbdev_check_free_adapter_num(num))
+ break;
+ }
+ else {
+ num = dvbdev_get_free_adapter_num();
+ break;
+ }
+ num = -1;
+ }
+
+ if (num < 0) {
mutex_unlock(&dvbdev_register_lock);
return -ENFILE;
}
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-core/dvbdev.h
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.h Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.h Sat Mar 29 22:39:56 2008 +0100
@@ -31,6 +31,10 @@
#define DVB_MAJOR 212
+#define DVB_MAX_ADAPTERS 8
+
+#define DVB_UNSET (-1)
+
#define DVB_DEVICE_VIDEO 0
#define DVB_DEVICE_AUDIO 1
#define DVB_DEVICE_SEC 2
@@ -78,7 +82,9 @@ struct dvb_device {
};
-extern int dvb_register_adapter (struct dvb_adapter *adap, const char *name, struct module *module, struct device *device);
+extern int dvb_register_adapter (struct dvb_adapter *adap, const char *name,
+ struct module *module, struct device *device,
+ int *adapter_nums);
extern int dvb_unregister_adapter (struct dvb_adapter *adap);
extern int dvb_register_device (struct dvb_adapter *adap,
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/a800.c
--- a/linux/drivers/media/dvb/dvb-usb/a800.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/a800.c Sat Mar 29 22:39:56 2008 +0100
@@ -18,6 +18,9 @@ static int debug;
static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (rc=1 (or-able))." DVB_USB_DEBUG_STATUS);
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
#define deb_rc(args...) dprintk(debug,0x01,args)
static int a800_power_ctrl(struct dvb_usb_device *d, int onoff)
@@ -94,7 +97,7 @@ static int a800_probe(struct usb_interfa
static int a800_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&a800_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf,&a800_properties,THIS_MODULE,NULL,adapter_nr);
}
/* do not change the order of the ID table */
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/af9005.c
--- a/linux/drivers/media/dvb/dvb-usb/af9005.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/af9005.c Sat Mar 29 22:39:56 2008 +0100
@@ -38,6 +38,10 @@ int dvb_usb_af9005_dump_eeprom = 0;
int dvb_usb_af9005_dump_eeprom = 0;
module_param_named(dump_eeprom, dvb_usb_af9005_dump_eeprom, int, 0);
MODULE_PARM_DESC(dump_eeprom, "dump contents of the eeprom.");
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
/* remote control decoder */
int (*rc_decode) (struct dvb_usb_device * d, u8 * data, int len, u32 * event,
@@ -1020,7 +1024,7 @@ static int af9005_usb_probe(struct usb_i
static int af9005_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf, &af9005_properties, THIS_MODULE, NULL);
+ return dvb_usb_device_init(intf, &af9005_properties, THIS_MODULE, NULL, adapter_nr);
}
static struct usb_device_id af9005_usb_table[] = {
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/au6610.c
--- a/linux/drivers/media/dvb/dvb-usb/au6610.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/au6610.c Sat Mar 29 22:39:56 2008 +0100
@@ -18,6 +18,10 @@ static int dvb_usb_au6610_debug;
static int dvb_usb_au6610_debug;
module_param_named(debug, dvb_usb_au6610_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
static int au6610_usb_msg(struct dvb_usb_device *d, u8 operation, u8 addr,
u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen)
@@ -163,7 +167,7 @@ static int au6610_probe(struct usb_inter
if (intf->num_altsetting < AU6610_ALTSETTING_COUNT)
return -ENODEV;
- if ((ret = dvb_usb_device_init(intf, &au6610_properties, THIS_MODULE, &d)) == 0) {
+ if ((ret = dvb_usb_device_init(intf, &au6610_properties, THIS_MODULE, &d, adapter_nr)) == 0) {
alt = usb_altnum_to_altsetting(intf, AU6610_ALTSETTING);
if (alt == NULL) {
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/cxusb.c
--- a/linux/drivers/media/dvb/dvb-usb/cxusb.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/cxusb.c Sat Mar 29 22:39:56 2008 +0100
@@ -40,6 +40,11 @@ static int dvb_usb_cxusb_debug;
static int dvb_usb_cxusb_debug;
module_param_named(debug, dvb_usb_cxusb_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
+
#define deb_info(args...) dprintk(dvb_usb_cxusb_debug,0x01,args)
#define deb_i2c(args...) if (d->udev->descriptor.idVendor == USB_VID_MEDION) \
dprintk(dvb_usb_cxusb_debug,0x01,args)
@@ -723,14 +728,14 @@ static int cxusb_probe(struct usb_interf
static int cxusb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_lgh064f_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_lgz201_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_dtt7579_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_dualdig4_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_nano2_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_nano2_needsfirmware_properties,THIS_MODULE,NULL) == 0) {
+ if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&cxusb_bluebird_lgh064f_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&cxusb_bluebird_lgz201_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&cxusb_bluebird_dtt7579_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&cxusb_bluebird_dualdig4_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&cxusb_bluebird_nano2_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&cxusb_bluebird_nano2_needsfirmware_properties,THIS_MODULE,NULL,adapter_nr) == 0) {
return 0;
}
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/dib0700_core.c
--- a/linux/drivers/media/dvb/dvb-usb/dib0700_core.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dib0700_core.c Sat Mar 29 22:39:56 2008 +0100
@@ -16,6 +16,10 @@ static int dvb_usb_dib0700_ir_proto = 1;
static int dvb_usb_dib0700_ir_proto = 1;
module_param(dvb_usb_dib0700_ir_proto, int, 0644);
MODULE_PARM_DESC(dvb_usb_dib0700_ir_proto, "set ir protocol (0=NEC, 1=RC5 (default), 2=RC6).");
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
/* expecting rx buffer: request data[0] data[1] ... data[2] */
static int dib0700_ctrl_wr(struct dvb_usb_device *d, u8 *tx, u8 txlen)
@@ -289,7 +293,7 @@ static int dib0700_probe(struct usb_inte
#endif
for (i = 0; i < dib0700_device_count; i++)
- if (dvb_usb_device_init(intf, &dib0700_devices[i], THIS_MODULE, &dev) == 0)
+ if (dvb_usb_device_init(intf, &dib0700_devices[i], THIS_MODULE, &dev, adapter_nr) == 0)
{
dib0700_rc_setup(dev);
return 0;
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/dibusb-mb.c
--- a/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c Sat Mar 29 22:39:56 2008 +0100
@@ -13,6 +13,10 @@
* see Documentation/dvb/README.dvb-usb for more information
*/
#include "dibusb.h"
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
static int dib3000mb_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
{
@@ -107,10 +111,10 @@ static int dibusb_probe(struct usb_inter
static int dibusb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- if (dvb_usb_device_init(intf,&dibusb1_1_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&dibusb1_1_an2235_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&dibusb2_0b_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&artec_t1_usb2_properties,THIS_MODULE,NULL) == 0)
+ if (dvb_usb_device_init(intf,&dibusb1_1_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&dibusb1_1_an2235_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&dibusb2_0b_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&artec_t1_usb2_properties,THIS_MODULE,NULL,adapter_nr) == 0)
return 0;
return -EINVAL;
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/dibusb-mc.c
--- a/linux/drivers/media/dvb/dvb-usb/dibusb-mc.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dibusb-mc.c Sat Mar 29 22:39:56 2008 +0100
@@ -14,13 +14,17 @@
*/
#include "dibusb.h"
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
+
/* USB Driver stuff */
static struct dvb_usb_device_properties dibusb_mc_properties;
static int dibusb_mc_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&dibusb_mc_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf,&dibusb_mc_properties,THIS_MODULE,NULL,adapter_nr);
}
/* do not change the order of the ID table */
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/digitv.c
--- a/linux/drivers/media/dvb/dvb-usb/digitv.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/digitv.c Sat Mar 29 22:39:56 2008 +0100
@@ -20,6 +20,11 @@ static int dvb_usb_digitv_debug;
static int dvb_usb_digitv_debug;
module_param_named(debug,dvb_usb_digitv_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
+
#define deb_rc(args...) dprintk(dvb_usb_digitv_debug,0x01,args)
static int digitv_ctrl_msg(struct dvb_usb_device *d,
@@ -257,7 +262,7 @@ static int digitv_probe(struct usb_inter
{
struct dvb_usb_device *d;
int ret;
- if ((ret = dvb_usb_device_init(intf,&digitv_properties,THIS_MODULE,&d)) == 0) {
+ if ((ret = dvb_usb_device_init(intf,&digitv_properties,THIS_MODULE,&d,adapter_nr)) == 0) {
u8 b[4] = { 0 };
if (d != NULL) { /* do that only when the firmware is loaded */
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/dtt200u.c
--- a/linux/drivers/media/dvb/dvb-usb/dtt200u.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dtt200u.c Sat Mar 29 22:39:56 2008 +0100
@@ -17,6 +17,10 @@ int dvb_usb_dtt200u_debug;
int dvb_usb_dtt200u_debug;
module_param_named(debug,dvb_usb_dtt200u_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2 (or-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
static int dtt200u_power_ctrl(struct dvb_usb_device *d, int onoff)
{
@@ -101,11 +105,11 @@ static int dtt200u_usb_probe(struct usb_
static int dtt200u_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- if (dvb_usb_device_init(intf,&dtt200u_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&wt220u_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&wt220u_fc_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&wt220u_zl0353_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&wt220u_miglia_properties,THIS_MODULE,NULL) == 0)
+ if (dvb_usb_device_init(intf,&dtt200u_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&wt220u_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&wt220u_fc_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&wt220u_zl0353_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&wt220u_miglia_properties,THIS_MODULE,NULL,adapter_nr) == 0)
return 0;
return -ENODEV;
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/dvb-usb-common.h
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-common.h Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-common.h Sat Mar 29 22:39:56 2008 +0100
@@ -40,7 +40,7 @@ extern int dvb_usb_i2c_init(struct dvb_u
extern int dvb_usb_i2c_init(struct dvb_usb_device *);
extern int dvb_usb_i2c_exit(struct dvb_usb_device *);
-extern int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap);
+extern int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap, int *adapter_nums);
extern int dvb_usb_adapter_dvb_exit(struct dvb_usb_adapter *adap);
extern int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap);
extern int dvb_usb_adapter_frontend_exit(struct dvb_usb_adapter *adap);
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c Sat Mar 29 22:39:56 2008 +0100
@@ -77,12 +77,12 @@ static int dvb_usb_stop_feed(struct dvb_
return dvb_usb_ctrl_feed(dvbdmxfeed,0);
}
-int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap)
+int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap, int *adapter_nums)
{
int ret;
if ((ret = dvb_register_adapter(&adap->dvb_adap, adap->dev->desc->name,
- adap->dev->owner, &adap->dev->udev->dev)) < 0) {
+ adap->dev->owner, &adap->dev->udev->dev, adapter_nums)) < 0) {
deb_info("dvb_register_adapter failed: error %d", ret);
goto err;
}
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c Sat Mar 29 22:39:56 2008 +0100
@@ -26,7 +26,7 @@ module_param_named(force_pid_filter_usag
module_param_named(force_pid_filter_usage, dvb_usb_force_pid_filter_usage, int, 0444);
MODULE_PARM_DESC(force_pid_filter_usage, "force all dvb-usb-devices to use a PID filter, if any (default: 0).");
-static int dvb_usb_adapter_init(struct dvb_usb_device *d)
+static int dvb_usb_adapter_init(struct dvb_usb_device *d, int *adapter_nrs)
{
struct dvb_usb_adapter *adap;
int ret,n;
@@ -72,7 +72,7 @@ static int dvb_usb_adapter_init(struct d
}
if ((ret = dvb_usb_adapter_stream_init(adap)) ||
- (ret = dvb_usb_adapter_dvb_init(adap)) ||
+ (ret = dvb_usb_adapter_dvb_init(adap, adapter_nrs)) ||
(ret = dvb_usb_adapter_frontend_init(adap))) {
return ret;
}
@@ -122,7 +122,7 @@ static int dvb_usb_exit(struct dvb_usb_d
return 0;
}
-static int dvb_usb_init(struct dvb_usb_device *d)
+static int dvb_usb_init(struct dvb_usb_device *d, int *adapter_nums)
{
int ret = 0;
@@ -143,7 +143,7 @@ static int dvb_usb_init(struct dvb_usb_d
dvb_usb_device_power_ctrl(d, 1);
if ((ret = dvb_usb_i2c_init(d)) ||
- (ret = dvb_usb_adapter_init(d))) {
+ (ret = dvb_usb_adapter_init(d, adapter_nums))) {
dvb_usb_exit(d);
return ret;
}
@@ -214,7 +214,7 @@ int dvb_usb_device_power_ctrl(struct dvb
* USB
*/
int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_device_properties
- *props, struct module *owner,struct dvb_usb_device **du)
+ *props, struct module *owner,struct dvb_usb_device **du, int *adapter_nums)
{
struct usb_device *udev = interface_to_usbdev(intf);
struct dvb_usb_device *d = NULL;
@@ -254,7 +254,7 @@ int dvb_usb_device_init(struct usb_inter
if (du != NULL)
*du = d;
- ret = dvb_usb_init(d);
+ ret = dvb_usb_init(d, adapter_nums);
if (ret == 0)
info("%s successfully initialized and connected.",desc->name);
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/dvb-usb.h
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb.h Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb.h Sat Mar 29 22:39:56 2008 +0100
@@ -387,7 +387,7 @@ struct dvb_usb_device {
void *priv;
};
-extern int dvb_usb_device_init(struct usb_interface *, struct dvb_usb_device_properties *, struct module *, struct dvb_usb_device **);
+extern int dvb_usb_device_init(struct usb_interface *, struct dvb_usb_device_properties *, struct module *, struct dvb_usb_device **, int *adapter_nums);
extern void dvb_usb_device_exit(struct usb_interface *);
/* the generic read/write method for device control */
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/gl861.c
--- a/linux/drivers/media/dvb/dvb-usb/gl861.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/gl861.c Sat Mar 29 22:39:56 2008 +0100
@@ -15,6 +15,10 @@ static int dvb_usb_gl861_debug;
static int dvb_usb_gl861_debug;
module_param_named(debug,dvb_usb_gl861_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
static int gl861_i2c_msg(struct dvb_usb_device *d, u8 addr,
u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen)
@@ -140,7 +144,7 @@ static int gl861_probe(struct usb_interf
if (intf->num_altsetting < 2)
return -ENODEV;
- if ((ret = dvb_usb_device_init(intf, &gl861_properties, THIS_MODULE, &d)) == 0) {
+ if ((ret = dvb_usb_device_init(intf, &gl861_properties, THIS_MODULE, &d, adapter_nr)) == 0) {
alt = usb_altnum_to_altsetting(intf, 0);
if (alt == NULL) {
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/gp8psk.c
--- a/linux/drivers/media/dvb/dvb-usb/gp8psk.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/gp8psk.c Sat Mar 29 22:39:56 2008 +0100
@@ -21,6 +21,10 @@ int dvb_usb_gp8psk_debug;
int dvb_usb_gp8psk_debug;
module_param_named(debug,dvb_usb_gp8psk_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
int gp8psk_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen)
{
@@ -208,7 +212,7 @@ static int gp8psk_usb_probe(struct usb_i
{
int ret;
struct usb_device *udev = interface_to_usbdev(intf);
- ret = dvb_usb_device_init(intf,&gp8psk_properties,THIS_MODULE,NULL);
+ ret = dvb_usb_device_init(intf,&gp8psk_properties,THIS_MODULE,NULL,adapter_nr);
if (ret == 0) {
info("found Genpix USB device pID = %x (hex)",
le16_to_cpu(udev->descriptor.idProduct));
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/m920x.c
--- a/linux/drivers/media/dvb/dvb-usb/m920x.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/m920x.c Sat Mar 29 22:39:56 2008 +0100
@@ -21,6 +21,10 @@ static int dvb_usb_m920x_debug;
static int dvb_usb_m920x_debug;
module_param_named(debug,dvb_usb_m920x_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
static int m920x_set_filter(struct dvb_usb_device *d, int type, int idx, int pid);
@@ -619,26 +623,26 @@ static int m920x_probe(struct usb_interf
*/
if ((ret = dvb_usb_device_init(intf, &megasky_properties,
- THIS_MODULE, &d)) == 0) {
+ THIS_MODULE, &d, adapter_nr)) == 0) {
rc_init_seq = megasky_rc_init;
goto found;
}
if ((ret = dvb_usb_device_init(intf, &digivox_mini_ii_properties,
- THIS_MODULE, &d)) == 0) {
+ THIS_MODULE, &d, adapter_nr)) == 0) {
/* No remote control, so no rc_init_seq */
goto found;
}
/* This configures both tuners on the TV Walker Twin */
if ((ret = dvb_usb_device_init(intf, &tvwalkertwin_properties,
- THIS_MODULE, &d)) == 0) {
+ THIS_MODULE, &d, adapter_nr)) == 0) {
rc_init_seq = tvwalkertwin_rc_init;
goto found;
}
if ((ret = dvb_usb_device_init(intf, &dposh_properties,
- THIS_MODULE, &d)) == 0) {
+ THIS_MODULE, &d, adapter_nr)) == 0) {
/* Remote controller not supported yet. */
goto found;
}
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c
--- a/linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c Sat Mar 29 22:39:56 2008 +0100
@@ -14,6 +14,10 @@ static int debug;
static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc,2=eeprom (|-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
#define deb_rc(args...) dprintk(debug,0x01,args)
#define deb_ee(args...) dprintk(debug,0x02,args)
@@ -142,7 +146,7 @@ static int nova_t_probe(struct usb_inter
static int nova_t_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&nova_t_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf,&nova_t_properties,THIS_MODULE,NULL,adapter_nr);
}
/* do not change the order of the ID table */
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/opera1.c
--- a/linux/drivers/media/dvb/dvb-usb/opera1.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/opera1.c Sat Mar 29 22:39:56 2008 +0100
@@ -45,6 +45,11 @@ MODULE_PARM_DESC(debug,
MODULE_PARM_DESC(debug,
"set debugging level (1=info,xfer=2,pll=4,ts=8,err=16,rc=32,fw=64 (or-able))."
DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
+
#if 0
struct mutex mymutex;
#endif
@@ -559,7 +564,7 @@ static int opera1_probe(struct usb_inter
return -EINVAL;
}
- if (dvb_usb_device_init(intf, &opera1_properties, THIS_MODULE, NULL) != 0)
+ if (dvb_usb_device_init(intf, &opera1_properties, THIS_MODULE, NULL, adapter_nr) != 0)
return -EINVAL;
return 0;
}
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/ttusb2.c
--- a/linux/drivers/media/dvb/dvb-usb/ttusb2.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/ttusb2.c Sat Mar 29 22:39:56 2008 +0100
@@ -36,6 +36,10 @@ static int dvb_usb_ttusb2_debug;
#define deb_info(args...) dprintk(dvb_usb_ttusb2_debug,0x01,args)
module_param_named(debug,dvb_usb_ttusb2_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info (or-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
struct ttusb2_state {
u8 id;
@@ -186,7 +190,7 @@ static int ttusb2_probe(struct usb_inter
static int ttusb2_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&ttusb2_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf,&ttusb2_properties,THIS_MODULE,NULL,adapter_nr);
}
static struct usb_device_id ttusb2_table [] = {
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/umt-010.c
--- a/linux/drivers/media/dvb/dvb-usb/umt-010.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/umt-010.c Sat Mar 29 22:39:56 2008 +0100
@@ -12,6 +12,10 @@
#include "dibusb.h"
#include "mt352.h"
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
static int umt_mt352_demod_init(struct dvb_frontend *fe)
{
@@ -75,7 +79,7 @@ static int umt_probe(struct usb_interfac
static int umt_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- if (dvb_usb_device_init(intf,&umt_properties,THIS_MODULE,NULL) == 0)
+ if (dvb_usb_device_init(intf,&umt_properties,THIS_MODULE,NULL,adapter_nr) == 0)
return 0;
return -EINVAL;
}
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/vp702x.c
--- a/linux/drivers/media/dvb/dvb-usb/vp702x.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/vp702x.c Sat Mar 29 22:39:56 2008 +0100
@@ -20,6 +20,10 @@ int dvb_usb_vp702x_debug;
int dvb_usb_vp702x_debug;
module_param_named(debug,dvb_usb_vp702x_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
struct vp702x_state {
int pid_filter_count;
@@ -285,7 +289,7 @@ static int vp702x_usb_probe(struct usb_i
static int vp702x_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&vp702x_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf,&vp702x_properties,THIS_MODULE,NULL,adapter_nr);
}
static struct usb_device_id vp702x_usb_table [] = {
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/vp7045.c
--- a/linux/drivers/media/dvb/dvb-usb/vp7045.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/vp7045.c Sat Mar 29 22:39:56 2008 +0100
@@ -18,6 +18,11 @@ static int dvb_usb_vp7045_debug;
static int dvb_usb_vp7045_debug;
module_param_named(debug,dvb_usb_vp7045_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
+
#define deb_info(args...) dprintk(dvb_usb_vp7045_debug,0x01,args)
#define deb_xfer(args...) dprintk(dvb_usb_vp7045_debug,0x02,args)
#define deb_rc(args...) dprintk(dvb_usb_vp7045_debug,0x04,args)
@@ -227,7 +232,7 @@ static int vp7045_usb_probe(struct usb_i
static int vp7045_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&vp7045_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf,&vp7045_properties,THIS_MODULE,NULL,adapter_nr);
}
static struct usb_device_id vp7045_usb_table [] = {
diff -r 0776e4801991 linux/drivers/media/dvb/pluto2/pluto2.c
--- a/linux/drivers/media/dvb/pluto2/pluto2.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/pluto2/pluto2.c Sat Mar 29 22:39:56 2008 +0100
@@ -90,6 +90,10 @@
#define I2C_ADDR_TDA10046 0x10
#define I2C_ADDR_TUA6034 0xc2
#define NHWFILTERS 8
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
struct pluto {
/* pci */
@@ -666,7 +670,7 @@ static int __devinit pluto2_probe(struct
goto err_pluto_hw_exit;
/* dvb */
- ret = dvb_register_adapter(&pluto->dvb_adapter, DRIVER_NAME, THIS_MODULE, &pdev->dev);
+ ret = dvb_register_adapter(&pluto->dvb_adapter, DRIVER_NAME, THIS_MODULE, &pdev->dev, adapter_nr);
if (ret < 0)
goto err_i2c_del_adapter;
diff -r 0776e4801991 linux/drivers/media/dvb/ttpci/av7110.c
--- a/linux/drivers/media/dvb/ttpci/av7110.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/ttpci/av7110.c Sat Mar 29 22:39:56 2008 +0100
@@ -87,6 +87,7 @@ static int wss_cfg_4_3 = 0x4008;
static int wss_cfg_4_3 = 0x4008;
static int wss_cfg_16_9 = 0x0007;
static int tv_standard;
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
module_param_named(debug, av7110_debug, int, 0644);
MODULE_PARM_DESC(debug, "debug level (bitmask, default 0)");
@@ -111,6 +112,8 @@ MODULE_PARM_DESC(wss_cfg_16_9, "WSS 16:9
MODULE_PARM_DESC(wss_cfg_16_9, "WSS 16:9 - default 0x0007 - bit 15: disable, 14: burst mode, 13..0: wss data");
module_param(tv_standard, int, 0444);
MODULE_PARM_DESC(tv_standard, "TV standard: 0 PAL (default), 1 NTSC");
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
static void restart_feeds(struct av7110 *av7110);
@@ -2461,7 +2464,7 @@ static int __devinit av7110_attach(struc
goto err_kfree_0;
ret = dvb_register_adapter(&av7110->dvb_adapter, av7110->card_name,
- THIS_MODULE, &dev->pci->dev);
+ THIS_MODULE, &dev->pci->dev, adapter_nr);
if (ret < 0)
goto err_put_firmware_1;
diff -r 0776e4801991 linux/drivers/media/dvb/ttpci/budget-core.c
--- a/linux/drivers/media/dvb/ttpci/budget-core.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/ttpci/budget-core.c Sat Mar 29 22:39:56 2008 +0100
@@ -56,6 +56,10 @@ module_param_named(bufsize, dma_buffer_s
module_param_named(bufsize, dma_buffer_size, int, 0444);
MODULE_PARM_DESC(debug, "Turn on/off budget debugging (default:off).");
MODULE_PARM_DESC(bufsize, "DMA buffer size in KB, default: 188, min: 188, max: 1410 (Activy: 564)");
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
/****************************************************************************
* TT budget / WinTV Nova
@@ -471,7 +475,7 @@ int ttpci_budget_init(struct budget *bud
budget->buffer_width, budget->buffer_height);
printk("%s: dma buffer size %u\n", budget->dev->name, budget->buffer_size);
- if ((ret = dvb_register_adapter(&budget->dvb_adapter, budget->card->name, owner, &budget->dev->pci->dev)) < 0) {
+ if ((ret = dvb_register_adapter(&budget->dvb_adapter, budget->card->name, owner, &budget->dev->pci->dev, adapter_nr)) < 0) {
return ret;
}
diff -r 0776e4801991 linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
--- a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c Sat Mar 29 22:39:56 2008 +0100
@@ -59,9 +59,12 @@
*/
static int debug;
-
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
#define dprintk(x...) do { if (debug) printk(KERN_DEBUG x); } while (0)
@@ -1681,7 +1684,7 @@ static int ttusb_probe(struct usb_interf
mutex_unlock(&ttusb->semi2c);
- if ((result = dvb_register_adapter(&ttusb->adapter, "Technotrend/Hauppauge Nova-USB", THIS_MODULE, &udev->dev)) < 0) {
+ if ((result = dvb_register_adapter(&ttusb->adapter, "Technotrend/Hauppauge Nova-USB", THIS_MODULE, &udev->dev, adapter_nr)) < 0) {
ttusb_free_iso_urbs(ttusb);
kfree(ttusb);
return result;
diff -r 0776e4801991 linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
--- a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c Sat Mar 29 22:39:56 2008 +0100
@@ -47,6 +47,7 @@ static int debug;
static int debug;
static int output_pva;
static int enable_rc;
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
@@ -54,6 +55,8 @@ MODULE_PARM_DESC(output_pva, "Output PVA
MODULE_PARM_DESC(output_pva, "Output PVA from dvr device (default:off)");
module_param(enable_rc, int, 0644);
MODULE_PARM_DESC(enable_rc, "Turn on/off IR remote control(default: off)");
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
#define dprintk if (debug) printk
@@ -1456,7 +1459,7 @@ static int ttusb_dec_init_dvb(struct ttu
dprintk("%s\n", __FUNCTION__);
if ((result = dvb_register_adapter(&dec->adapter,
- dec->model_name, THIS_MODULE, &dec->udev->dev)) < 0) {
+ dec->model_name, THIS_MODULE, &dec->udev->dev, adapter_nr)) < 0) {
printk("%s: dvb_register_adapter failed: error %d\n",
__FUNCTION__, result);
diff -r 0776e4801991 linux/drivers/media/video/videobuf-dvb.c
--- a/linux/drivers/media/video/videobuf-dvb.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/video/videobuf-dvb.c Sat Mar 29 22:39:56 2008 +0100
@@ -39,6 +39,10 @@ static unsigned int debug;
static unsigned int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug,"enable debug messages");
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr,"DVB adapter numbers");
#define dprintk(fmt, arg...) if (debug) \
printk(KERN_DEBUG "%s/dvb: " fmt, dvb->name , ## arg)
@@ -151,7 +155,7 @@ int videobuf_dvb_register(struct videobu
mutex_init(&dvb->lock);
/* register adapter */
- result = dvb_register_adapter(&dvb->adapter, dvb->name, module, device);
+ result = dvb_register_adapter(&dvb->adapter, dvb->name, module, device, adapter_nr);
if (result < 0) {
printk(KERN_WARNING "%s: dvb_register_adapter failed (errno = %d)\n",
dvb->name, result);
[-- Attachment #3: Type: text/plain, Size: 150 bytes --]
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-03-29 21:40 [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try Janne Grunau
@ 2008-03-30 6:02 ` Michael Krufky
2008-03-30 11:53 ` Janne Grunau
2008-04-09 15:07 ` Manu Abraham
1 sibling, 1 reply; 24+ messages in thread
From: Michael Krufky @ 2008-03-30 6:02 UTC (permalink / raw)
To: Janne Grunau; +Cc: linux-dvb
2008/3/29 Janne Grunau <janne-dvb@grunau.be>:
> Hi,
>
> I resubmit this patch since I still think it is a good idea to the this
> driver option. There is still no udev recipe to guaranty stable dvb
> adapter numbers. I've tried to come up with some rules but it's tricky
> due to the multiple device nodes in a subdirectory. I won't claim that
> it is impossible to get udev to assign driver or hardware specific
> stable dvb adapter numbers but I think this patch is easier and more
> clean than a udev based solution.
>
> I'll drop this patch if a simple udev solution is found in a reasonable
> amount of time. But if there is no I would like to see the attached
> patch merged.
>
> Quoting myself for a short desciprtion for the patch:
>
> > V4L drivers have the {radio|vbi|video}_nr module options to allocate
> > static minor numbers per driver.
> >
> > Attached patch adds a similiar mechanism to the dvb subsystem. To
> > avoid problems with device unplugging and repluging each driver holds
> > a DVB_MAX_ADAPTER long array of the preffered order of adapter
> > numbers.
> >
> > options dvb-usb-dib0700 adapter_nr=7,6,5,4,3,2,1,0 would result in a
> > reversed allocation of adapter numbers.
> >
> > With adapter_nr=2,5 it tries first to get adapter number 2 and 5. If
> > both are already in use it will allocate the lowest free adapter
> > number.
Personally, I would love to see this merged -- I hope that others will
agree with me.
One critique:
videobuf-dvb is more of a central helper module. I believe that the
module option should live in the callers of videobuf-dvb (such as
cx88-dvb / saa7134-dvb / cx23885-dvb) rather than within the
videobuf-dvb module, itself. The array can be passed into
videobuf-dvb the same as was done with dvb-usb-dvb.c
Other than that, I think that this feature would be a valuable
addition to the DVB subsystem.
-Mike Krufky
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
@ 2008-03-30 8:50 Eduard Huguet
0 siblings, 0 replies; 24+ messages in thread
From: Eduard Huguet @ 2008-03-30 8:50 UTC (permalink / raw)
To: linux-dvb
[-- Attachment #1.1: Type: text/plain, Size: 2327 bytes --]
Great idea. I have myself a Nova-T 500 and an Avermedia A700 and I've
finally had to blacklist both modules for udev and manually loading later
the drivers in the desired order. This is the only way I get always the same
nunbering schema.
If not, I was getting the following crazy situation:
- dvb0: A700, dvb1/2 for the Nova T-500 when cold booting
- dvb0 Nova-T 500, dvb1 A700 and dvb2 Nova T-500 again when rebooting
Best regards,
Eduard
PS and OT: by the way, any progress out there on the Avermedia A700 (please,
Matthias, tell me something positive :D ...?
---------- Missatge reenviat ----------
> From: Janne Grunau <janne-dvb@grunau.be>
> To: linux-dvb@linuxtv.org
> Date: Sat, 29 Mar 2008 22:40:25 +0100
> Subject: [linux-dvb] [PATCH] Add driver specific module option to choose
> dvb adapter numbers, second try
> Hi,
>
> I resubmit this patch since I still think it is a good idea to the this
> driver option. There is still no udev recipe to guaranty stable dvb
> adapter numbers. I've tried to come up with some rules but it's tricky
> due to the multiple device nodes in a subdirectory. I won't claim that
> it is impossible to get udev to assign driver or hardware specific
> stable dvb adapter numbers but I think this patch is easier and more
> clean than a udev based solution.
>
> I'll drop this patch if a simple udev solution is found in a reasonable
> amount of time. But if there is no I would like to see the attached
> patch merged.
>
> Quoting myself for a short desciprtion for the patch:
>
> > V4L drivers have the {radio|vbi|video}_nr module options to allocate
> > static minor numbers per driver.
> >
> > Attached patch adds a similiar mechanism to the dvb subsystem. To
> > avoid problems with device unplugging and repluging each driver holds
> > a DVB_MAX_ADAPTER long array of the preffered order of adapter
> > numbers.
> >
> > options dvb-usb-dib0700 adapter_nr=7,6,5,4,3,2,1,0 would result in a
> > reversed allocation of adapter numbers.
> >
> > With adapter_nr=2,5 it tries first to get adapter number 2 and 5. If
> > both are already in use it will allocate the lowest free adapter
> > number.
>
> Janne
>
> _______________________________________________
> linux-dvb mailing list
> linux-dvb@linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
>
>
[-- Attachment #1.2: Type: text/html, Size: 2920 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-03-30 6:02 ` Michael Krufky
@ 2008-03-30 11:53 ` Janne Grunau
2008-03-30 18:17 ` Janne Grunau
0 siblings, 1 reply; 24+ messages in thread
From: Janne Grunau @ 2008-03-30 11:53 UTC (permalink / raw)
To: Michael Krufky; +Cc: linux-dvb
[-- Attachment #1: Type: text/plain, Size: 441 bytes --]
On Sunday 30 March 2008 08:02:27 Michael Krufky wrote:
>
> One critique:
>
> videobuf-dvb is more of a central helper module. I believe that the
> module option should live in the callers of videobuf-dvb (such as
> cx88-dvb / saa7134-dvb / cx23885-dvb) rather than within the
> videobuf-dvb module, itself. The array can be passed into
> videobuf-dvb the same as was done with dvb-usb-dvb.c
I agree. Fixed, updated patch attached.
Janne
[-- Attachment #2: modoption_adapter_numbers3.diff --]
[-- Type: text/x-diff, Size: 42737 bytes --]
diff -r 0776e4801991 linux/drivers/media/dvb/b2c2/flexcop.c
--- a/linux/drivers/media/dvb/b2c2/flexcop.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/b2c2/flexcop.c Sun Mar 30 13:51:34 2008 +0200
@@ -49,6 +49,10 @@ MODULE_PARM_DESC(debug, "set debug level
MODULE_PARM_DESC(debug, "set debug level (1=info,2=tuner,4=i2c,8=ts,16=sram,32=reg (|-able))." DEBSTATUS);
#undef DEBSTATUS
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
+
/* global zero for ibi values */
flexcop_ibi_value ibi_zero;
@@ -67,7 +71,7 @@ static int flexcop_dvb_init(struct flexc
static int flexcop_dvb_init(struct flexcop_device *fc)
{
int ret;
- if ((ret = dvb_register_adapter(&fc->dvb_adapter,"FlexCop Digital TV device",fc->owner,fc->dev)) < 0) {
+ if ((ret = dvb_register_adapter(&fc->dvb_adapter,"FlexCop Digital TV device",fc->owner,fc->dev,adapter_nr)) < 0) {
err("error registering DVB adapter");
return ret;
}
diff -r 0776e4801991 linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
--- a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c Sun Mar 30 13:51:34 2008 +0200
@@ -40,6 +40,11 @@ static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
#define dprintk( args... ) \
do { \
@@ -718,7 +723,7 @@ static int __devinit dvb_bt8xx_load_card
{
int result;
- if ((result = dvb_register_adapter(&card->dvb_adapter, card->card_name, THIS_MODULE, &card->bt->dev->dev)) < 0) {
+ if ((result = dvb_register_adapter(&card->dvb_adapter, card->card_name, THIS_MODULE, &card->bt->dev->dev, adapter_nr)) < 0) {
printk("dvb_bt8xx: dvb_register_adapter failed (errno = %d)\n", result);
return result;
}
diff -r 0776e4801991 linux/drivers/media/dvb/cinergyT2/cinergyT2.c
--- a/linux/drivers/media/dvb/cinergyT2/cinergyT2.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/cinergyT2/cinergyT2.c Sun Mar 30 13:51:34 2008 +0200
@@ -60,6 +60,10 @@ static int debug;
static int debug;
module_param_named(debug, debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
#define dprintk(level, args...) \
@@ -1004,7 +1008,7 @@ static int cinergyt2_probe (struct usb_i
return -ENOMEM;
}
- if ((err = dvb_register_adapter(&cinergyt2->adapter, DRIVER_NAME, THIS_MODULE, &cinergyt2->udev->dev)) < 0) {
+ if ((err = dvb_register_adapter(&cinergyt2->adapter, DRIVER_NAME, THIS_MODULE, &cinergyt2->udev->dev, adapter_nr)) < 0) {
kfree(cinergyt2);
return err;
}
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-core/dvbdev.c
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c Sun Mar 30 13:51:34 2008 +0200
@@ -52,7 +52,6 @@ static const char * const dnames[] = {
"net", "osd"
};
-#define DVB_MAX_ADAPTERS 8
#define DVB_MAX_IDS 4
#define nums2minor(num,type,id) ((num << 6) | (id << 4) | type)
#define MAX_DVB_MINORS (DVB_MAX_ADAPTERS*64)
@@ -277,18 +276,25 @@ void dvb_unregister_device(struct dvb_de
}
EXPORT_SYMBOL(dvb_unregister_device);
+static int dvbdev_check_free_adapter_num(int num)
+{
+ struct list_head *entry;
+ list_for_each (entry, &dvb_adapter_list) {
+ struct dvb_adapter *adap;
+ adap = list_entry(entry, struct dvb_adapter, list_head);
+ if (adap->num == num)
+ return 0;
+ }
+ return 1;
+}
static int dvbdev_get_free_adapter_num (void)
{
int num = 0;
while (num < DVB_MAX_ADAPTERS) {
- struct dvb_adapter *adap;
- list_for_each_entry(adap, &dvb_adapter_list, list_head)
- if (adap->num == num)
- goto skip;
- return num;
-skip:
+ if (dvbdev_check_free_adapter_num(num))
+ return num;
num++;
}
@@ -296,13 +302,27 @@ skip:
}
-int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct module *module, struct device *device)
+int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct module *module, struct device *device, int *adapter_nums)
{
- int num;
+ int i, num;
mutex_lock(&dvbdev_register_lock);
- if ((num = dvbdev_get_free_adapter_num ()) < 0) {
+ for (i=0; i<DVB_MAX_ADAPTERS; ++i) {
+ num = adapter_nums[i];
+ if (num >= 0 && num < DVB_MAX_ADAPTERS) {
+ /* use the one the driver asked for */
+ if (dvbdev_check_free_adapter_num(num))
+ break;
+ }
+ else {
+ num = dvbdev_get_free_adapter_num();
+ break;
+ }
+ num = -1;
+ }
+
+ if (num < 0) {
mutex_unlock(&dvbdev_register_lock);
return -ENFILE;
}
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-core/dvbdev.h
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.h Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.h Sun Mar 30 13:51:34 2008 +0200
@@ -31,6 +31,10 @@
#define DVB_MAJOR 212
+#define DVB_MAX_ADAPTERS 8
+
+#define DVB_UNSET (-1)
+
#define DVB_DEVICE_VIDEO 0
#define DVB_DEVICE_AUDIO 1
#define DVB_DEVICE_SEC 2
@@ -78,7 +82,9 @@ struct dvb_device {
};
-extern int dvb_register_adapter (struct dvb_adapter *adap, const char *name, struct module *module, struct device *device);
+extern int dvb_register_adapter (struct dvb_adapter *adap, const char *name,
+ struct module *module, struct device *device,
+ int *adapter_nums);
extern int dvb_unregister_adapter (struct dvb_adapter *adap);
extern int dvb_register_device (struct dvb_adapter *adap,
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/a800.c
--- a/linux/drivers/media/dvb/dvb-usb/a800.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/a800.c Sun Mar 30 13:51:34 2008 +0200
@@ -18,6 +18,9 @@ static int debug;
static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (rc=1 (or-able))." DVB_USB_DEBUG_STATUS);
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
#define deb_rc(args...) dprintk(debug,0x01,args)
static int a800_power_ctrl(struct dvb_usb_device *d, int onoff)
@@ -94,7 +97,7 @@ static int a800_probe(struct usb_interfa
static int a800_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&a800_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf,&a800_properties,THIS_MODULE,NULL,adapter_nr);
}
/* do not change the order of the ID table */
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/af9005.c
--- a/linux/drivers/media/dvb/dvb-usb/af9005.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/af9005.c Sun Mar 30 13:51:34 2008 +0200
@@ -38,6 +38,10 @@ int dvb_usb_af9005_dump_eeprom = 0;
int dvb_usb_af9005_dump_eeprom = 0;
module_param_named(dump_eeprom, dvb_usb_af9005_dump_eeprom, int, 0);
MODULE_PARM_DESC(dump_eeprom, "dump contents of the eeprom.");
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
/* remote control decoder */
int (*rc_decode) (struct dvb_usb_device * d, u8 * data, int len, u32 * event,
@@ -1020,7 +1024,7 @@ static int af9005_usb_probe(struct usb_i
static int af9005_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf, &af9005_properties, THIS_MODULE, NULL);
+ return dvb_usb_device_init(intf, &af9005_properties, THIS_MODULE, NULL, adapter_nr);
}
static struct usb_device_id af9005_usb_table[] = {
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/au6610.c
--- a/linux/drivers/media/dvb/dvb-usb/au6610.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/au6610.c Sun Mar 30 13:51:34 2008 +0200
@@ -18,6 +18,10 @@ static int dvb_usb_au6610_debug;
static int dvb_usb_au6610_debug;
module_param_named(debug, dvb_usb_au6610_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
static int au6610_usb_msg(struct dvb_usb_device *d, u8 operation, u8 addr,
u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen)
@@ -163,7 +167,7 @@ static int au6610_probe(struct usb_inter
if (intf->num_altsetting < AU6610_ALTSETTING_COUNT)
return -ENODEV;
- if ((ret = dvb_usb_device_init(intf, &au6610_properties, THIS_MODULE, &d)) == 0) {
+ if ((ret = dvb_usb_device_init(intf, &au6610_properties, THIS_MODULE, &d, adapter_nr)) == 0) {
alt = usb_altnum_to_altsetting(intf, AU6610_ALTSETTING);
if (alt == NULL) {
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/cxusb.c
--- a/linux/drivers/media/dvb/dvb-usb/cxusb.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/cxusb.c Sun Mar 30 13:51:34 2008 +0200
@@ -40,6 +40,11 @@ static int dvb_usb_cxusb_debug;
static int dvb_usb_cxusb_debug;
module_param_named(debug, dvb_usb_cxusb_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
+
#define deb_info(args...) dprintk(dvb_usb_cxusb_debug,0x01,args)
#define deb_i2c(args...) if (d->udev->descriptor.idVendor == USB_VID_MEDION) \
dprintk(dvb_usb_cxusb_debug,0x01,args)
@@ -723,14 +728,14 @@ static int cxusb_probe(struct usb_interf
static int cxusb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_lgh064f_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_lgz201_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_dtt7579_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_dualdig4_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_nano2_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_nano2_needsfirmware_properties,THIS_MODULE,NULL) == 0) {
+ if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&cxusb_bluebird_lgh064f_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&cxusb_bluebird_lgz201_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&cxusb_bluebird_dtt7579_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&cxusb_bluebird_dualdig4_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&cxusb_bluebird_nano2_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&cxusb_bluebird_nano2_needsfirmware_properties,THIS_MODULE,NULL,adapter_nr) == 0) {
return 0;
}
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/dib0700_core.c
--- a/linux/drivers/media/dvb/dvb-usb/dib0700_core.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dib0700_core.c Sun Mar 30 13:51:34 2008 +0200
@@ -16,6 +16,10 @@ static int dvb_usb_dib0700_ir_proto = 1;
static int dvb_usb_dib0700_ir_proto = 1;
module_param(dvb_usb_dib0700_ir_proto, int, 0644);
MODULE_PARM_DESC(dvb_usb_dib0700_ir_proto, "set ir protocol (0=NEC, 1=RC5 (default), 2=RC6).");
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
/* expecting rx buffer: request data[0] data[1] ... data[2] */
static int dib0700_ctrl_wr(struct dvb_usb_device *d, u8 *tx, u8 txlen)
@@ -289,7 +293,7 @@ static int dib0700_probe(struct usb_inte
#endif
for (i = 0; i < dib0700_device_count; i++)
- if (dvb_usb_device_init(intf, &dib0700_devices[i], THIS_MODULE, &dev) == 0)
+ if (dvb_usb_device_init(intf, &dib0700_devices[i], THIS_MODULE, &dev, adapter_nr) == 0)
{
dib0700_rc_setup(dev);
return 0;
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/dibusb-mb.c
--- a/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c Sun Mar 30 13:51:34 2008 +0200
@@ -13,6 +13,10 @@
* see Documentation/dvb/README.dvb-usb for more information
*/
#include "dibusb.h"
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
static int dib3000mb_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
{
@@ -107,10 +111,10 @@ static int dibusb_probe(struct usb_inter
static int dibusb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- if (dvb_usb_device_init(intf,&dibusb1_1_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&dibusb1_1_an2235_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&dibusb2_0b_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&artec_t1_usb2_properties,THIS_MODULE,NULL) == 0)
+ if (dvb_usb_device_init(intf,&dibusb1_1_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&dibusb1_1_an2235_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&dibusb2_0b_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&artec_t1_usb2_properties,THIS_MODULE,NULL,adapter_nr) == 0)
return 0;
return -EINVAL;
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/dibusb-mc.c
--- a/linux/drivers/media/dvb/dvb-usb/dibusb-mc.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dibusb-mc.c Sun Mar 30 13:51:34 2008 +0200
@@ -14,13 +14,17 @@
*/
#include "dibusb.h"
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
+
/* USB Driver stuff */
static struct dvb_usb_device_properties dibusb_mc_properties;
static int dibusb_mc_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&dibusb_mc_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf,&dibusb_mc_properties,THIS_MODULE,NULL,adapter_nr);
}
/* do not change the order of the ID table */
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/digitv.c
--- a/linux/drivers/media/dvb/dvb-usb/digitv.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/digitv.c Sun Mar 30 13:51:34 2008 +0200
@@ -20,6 +20,11 @@ static int dvb_usb_digitv_debug;
static int dvb_usb_digitv_debug;
module_param_named(debug,dvb_usb_digitv_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
+
#define deb_rc(args...) dprintk(dvb_usb_digitv_debug,0x01,args)
static int digitv_ctrl_msg(struct dvb_usb_device *d,
@@ -257,7 +262,7 @@ static int digitv_probe(struct usb_inter
{
struct dvb_usb_device *d;
int ret;
- if ((ret = dvb_usb_device_init(intf,&digitv_properties,THIS_MODULE,&d)) == 0) {
+ if ((ret = dvb_usb_device_init(intf,&digitv_properties,THIS_MODULE,&d,adapter_nr)) == 0) {
u8 b[4] = { 0 };
if (d != NULL) { /* do that only when the firmware is loaded */
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/dtt200u.c
--- a/linux/drivers/media/dvb/dvb-usb/dtt200u.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dtt200u.c Sun Mar 30 13:51:34 2008 +0200
@@ -17,6 +17,10 @@ int dvb_usb_dtt200u_debug;
int dvb_usb_dtt200u_debug;
module_param_named(debug,dvb_usb_dtt200u_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2 (or-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
static int dtt200u_power_ctrl(struct dvb_usb_device *d, int onoff)
{
@@ -101,11 +105,11 @@ static int dtt200u_usb_probe(struct usb_
static int dtt200u_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- if (dvb_usb_device_init(intf,&dtt200u_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&wt220u_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&wt220u_fc_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&wt220u_zl0353_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&wt220u_miglia_properties,THIS_MODULE,NULL) == 0)
+ if (dvb_usb_device_init(intf,&dtt200u_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&wt220u_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&wt220u_fc_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&wt220u_zl0353_properties,THIS_MODULE,NULL,adapter_nr) == 0 ||
+ dvb_usb_device_init(intf,&wt220u_miglia_properties,THIS_MODULE,NULL,adapter_nr) == 0)
return 0;
return -ENODEV;
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/dvb-usb-common.h
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-common.h Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-common.h Sun Mar 30 13:51:34 2008 +0200
@@ -40,7 +40,7 @@ extern int dvb_usb_i2c_init(struct dvb_u
extern int dvb_usb_i2c_init(struct dvb_usb_device *);
extern int dvb_usb_i2c_exit(struct dvb_usb_device *);
-extern int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap);
+extern int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap, int *adapter_nums);
extern int dvb_usb_adapter_dvb_exit(struct dvb_usb_adapter *adap);
extern int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap);
extern int dvb_usb_adapter_frontend_exit(struct dvb_usb_adapter *adap);
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c Sun Mar 30 13:51:34 2008 +0200
@@ -77,12 +77,12 @@ static int dvb_usb_stop_feed(struct dvb_
return dvb_usb_ctrl_feed(dvbdmxfeed,0);
}
-int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap)
+int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap, int *adapter_nums)
{
int ret;
if ((ret = dvb_register_adapter(&adap->dvb_adap, adap->dev->desc->name,
- adap->dev->owner, &adap->dev->udev->dev)) < 0) {
+ adap->dev->owner, &adap->dev->udev->dev, adapter_nums)) < 0) {
deb_info("dvb_register_adapter failed: error %d", ret);
goto err;
}
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c Sun Mar 30 13:51:34 2008 +0200
@@ -26,7 +26,7 @@ module_param_named(force_pid_filter_usag
module_param_named(force_pid_filter_usage, dvb_usb_force_pid_filter_usage, int, 0444);
MODULE_PARM_DESC(force_pid_filter_usage, "force all dvb-usb-devices to use a PID filter, if any (default: 0).");
-static int dvb_usb_adapter_init(struct dvb_usb_device *d)
+static int dvb_usb_adapter_init(struct dvb_usb_device *d, int *adapter_nrs)
{
struct dvb_usb_adapter *adap;
int ret,n;
@@ -72,7 +72,7 @@ static int dvb_usb_adapter_init(struct d
}
if ((ret = dvb_usb_adapter_stream_init(adap)) ||
- (ret = dvb_usb_adapter_dvb_init(adap)) ||
+ (ret = dvb_usb_adapter_dvb_init(adap, adapter_nrs)) ||
(ret = dvb_usb_adapter_frontend_init(adap))) {
return ret;
}
@@ -122,7 +122,7 @@ static int dvb_usb_exit(struct dvb_usb_d
return 0;
}
-static int dvb_usb_init(struct dvb_usb_device *d)
+static int dvb_usb_init(struct dvb_usb_device *d, int *adapter_nums)
{
int ret = 0;
@@ -143,7 +143,7 @@ static int dvb_usb_init(struct dvb_usb_d
dvb_usb_device_power_ctrl(d, 1);
if ((ret = dvb_usb_i2c_init(d)) ||
- (ret = dvb_usb_adapter_init(d))) {
+ (ret = dvb_usb_adapter_init(d, adapter_nums))) {
dvb_usb_exit(d);
return ret;
}
@@ -214,7 +214,7 @@ int dvb_usb_device_power_ctrl(struct dvb
* USB
*/
int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_device_properties
- *props, struct module *owner,struct dvb_usb_device **du)
+ *props, struct module *owner,struct dvb_usb_device **du, int *adapter_nums)
{
struct usb_device *udev = interface_to_usbdev(intf);
struct dvb_usb_device *d = NULL;
@@ -254,7 +254,7 @@ int dvb_usb_device_init(struct usb_inter
if (du != NULL)
*du = d;
- ret = dvb_usb_init(d);
+ ret = dvb_usb_init(d, adapter_nums);
if (ret == 0)
info("%s successfully initialized and connected.",desc->name);
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/dvb-usb.h
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb.h Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb.h Sun Mar 30 13:51:34 2008 +0200
@@ -387,7 +387,7 @@ struct dvb_usb_device {
void *priv;
};
-extern int dvb_usb_device_init(struct usb_interface *, struct dvb_usb_device_properties *, struct module *, struct dvb_usb_device **);
+extern int dvb_usb_device_init(struct usb_interface *, struct dvb_usb_device_properties *, struct module *, struct dvb_usb_device **, int *adapter_nums);
extern void dvb_usb_device_exit(struct usb_interface *);
/* the generic read/write method for device control */
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/gl861.c
--- a/linux/drivers/media/dvb/dvb-usb/gl861.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/gl861.c Sun Mar 30 13:51:34 2008 +0200
@@ -15,6 +15,10 @@ static int dvb_usb_gl861_debug;
static int dvb_usb_gl861_debug;
module_param_named(debug,dvb_usb_gl861_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
static int gl861_i2c_msg(struct dvb_usb_device *d, u8 addr,
u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen)
@@ -140,7 +144,7 @@ static int gl861_probe(struct usb_interf
if (intf->num_altsetting < 2)
return -ENODEV;
- if ((ret = dvb_usb_device_init(intf, &gl861_properties, THIS_MODULE, &d)) == 0) {
+ if ((ret = dvb_usb_device_init(intf, &gl861_properties, THIS_MODULE, &d, adapter_nr)) == 0) {
alt = usb_altnum_to_altsetting(intf, 0);
if (alt == NULL) {
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/gp8psk.c
--- a/linux/drivers/media/dvb/dvb-usb/gp8psk.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/gp8psk.c Sun Mar 30 13:51:34 2008 +0200
@@ -21,6 +21,10 @@ int dvb_usb_gp8psk_debug;
int dvb_usb_gp8psk_debug;
module_param_named(debug,dvb_usb_gp8psk_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
int gp8psk_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen)
{
@@ -208,7 +212,7 @@ static int gp8psk_usb_probe(struct usb_i
{
int ret;
struct usb_device *udev = interface_to_usbdev(intf);
- ret = dvb_usb_device_init(intf,&gp8psk_properties,THIS_MODULE,NULL);
+ ret = dvb_usb_device_init(intf,&gp8psk_properties,THIS_MODULE,NULL,adapter_nr);
if (ret == 0) {
info("found Genpix USB device pID = %x (hex)",
le16_to_cpu(udev->descriptor.idProduct));
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/m920x.c
--- a/linux/drivers/media/dvb/dvb-usb/m920x.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/m920x.c Sun Mar 30 13:51:34 2008 +0200
@@ -21,6 +21,10 @@ static int dvb_usb_m920x_debug;
static int dvb_usb_m920x_debug;
module_param_named(debug,dvb_usb_m920x_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
static int m920x_set_filter(struct dvb_usb_device *d, int type, int idx, int pid);
@@ -619,26 +623,26 @@ static int m920x_probe(struct usb_interf
*/
if ((ret = dvb_usb_device_init(intf, &megasky_properties,
- THIS_MODULE, &d)) == 0) {
+ THIS_MODULE, &d, adapter_nr)) == 0) {
rc_init_seq = megasky_rc_init;
goto found;
}
if ((ret = dvb_usb_device_init(intf, &digivox_mini_ii_properties,
- THIS_MODULE, &d)) == 0) {
+ THIS_MODULE, &d, adapter_nr)) == 0) {
/* No remote control, so no rc_init_seq */
goto found;
}
/* This configures both tuners on the TV Walker Twin */
if ((ret = dvb_usb_device_init(intf, &tvwalkertwin_properties,
- THIS_MODULE, &d)) == 0) {
+ THIS_MODULE, &d, adapter_nr)) == 0) {
rc_init_seq = tvwalkertwin_rc_init;
goto found;
}
if ((ret = dvb_usb_device_init(intf, &dposh_properties,
- THIS_MODULE, &d)) == 0) {
+ THIS_MODULE, &d, adapter_nr)) == 0) {
/* Remote controller not supported yet. */
goto found;
}
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c
--- a/linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c Sun Mar 30 13:51:34 2008 +0200
@@ -14,6 +14,10 @@ static int debug;
static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc,2=eeprom (|-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
#define deb_rc(args...) dprintk(debug,0x01,args)
#define deb_ee(args...) dprintk(debug,0x02,args)
@@ -142,7 +146,7 @@ static int nova_t_probe(struct usb_inter
static int nova_t_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&nova_t_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf,&nova_t_properties,THIS_MODULE,NULL,adapter_nr);
}
/* do not change the order of the ID table */
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/opera1.c
--- a/linux/drivers/media/dvb/dvb-usb/opera1.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/opera1.c Sun Mar 30 13:51:34 2008 +0200
@@ -45,6 +45,11 @@ MODULE_PARM_DESC(debug,
MODULE_PARM_DESC(debug,
"set debugging level (1=info,xfer=2,pll=4,ts=8,err=16,rc=32,fw=64 (or-able))."
DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
+
#if 0
struct mutex mymutex;
#endif
@@ -559,7 +564,7 @@ static int opera1_probe(struct usb_inter
return -EINVAL;
}
- if (dvb_usb_device_init(intf, &opera1_properties, THIS_MODULE, NULL) != 0)
+ if (dvb_usb_device_init(intf, &opera1_properties, THIS_MODULE, NULL, adapter_nr) != 0)
return -EINVAL;
return 0;
}
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/ttusb2.c
--- a/linux/drivers/media/dvb/dvb-usb/ttusb2.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/ttusb2.c Sun Mar 30 13:51:34 2008 +0200
@@ -36,6 +36,10 @@ static int dvb_usb_ttusb2_debug;
#define deb_info(args...) dprintk(dvb_usb_ttusb2_debug,0x01,args)
module_param_named(debug,dvb_usb_ttusb2_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info (or-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
struct ttusb2_state {
u8 id;
@@ -186,7 +190,7 @@ static int ttusb2_probe(struct usb_inter
static int ttusb2_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&ttusb2_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf,&ttusb2_properties,THIS_MODULE,NULL,adapter_nr);
}
static struct usb_device_id ttusb2_table [] = {
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/umt-010.c
--- a/linux/drivers/media/dvb/dvb-usb/umt-010.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/umt-010.c Sun Mar 30 13:51:34 2008 +0200
@@ -12,6 +12,10 @@
#include "dibusb.h"
#include "mt352.h"
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
static int umt_mt352_demod_init(struct dvb_frontend *fe)
{
@@ -75,7 +79,7 @@ static int umt_probe(struct usb_interfac
static int umt_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- if (dvb_usb_device_init(intf,&umt_properties,THIS_MODULE,NULL) == 0)
+ if (dvb_usb_device_init(intf,&umt_properties,THIS_MODULE,NULL,adapter_nr) == 0)
return 0;
return -EINVAL;
}
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/vp702x.c
--- a/linux/drivers/media/dvb/dvb-usb/vp702x.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/vp702x.c Sun Mar 30 13:51:34 2008 +0200
@@ -20,6 +20,10 @@ int dvb_usb_vp702x_debug;
int dvb_usb_vp702x_debug;
module_param_named(debug,dvb_usb_vp702x_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
struct vp702x_state {
int pid_filter_count;
@@ -285,7 +289,7 @@ static int vp702x_usb_probe(struct usb_i
static int vp702x_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&vp702x_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf,&vp702x_properties,THIS_MODULE,NULL,adapter_nr);
}
static struct usb_device_id vp702x_usb_table [] = {
diff -r 0776e4801991 linux/drivers/media/dvb/dvb-usb/vp7045.c
--- a/linux/drivers/media/dvb/dvb-usb/vp7045.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/vp7045.c Sun Mar 30 13:51:34 2008 +0200
@@ -18,6 +18,11 @@ static int dvb_usb_vp7045_debug;
static int dvb_usb_vp7045_debug;
module_param_named(debug,dvb_usb_vp7045_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS);
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
+
#define deb_info(args...) dprintk(dvb_usb_vp7045_debug,0x01,args)
#define deb_xfer(args...) dprintk(dvb_usb_vp7045_debug,0x02,args)
#define deb_rc(args...) dprintk(dvb_usb_vp7045_debug,0x04,args)
@@ -227,7 +232,7 @@ static int vp7045_usb_probe(struct usb_i
static int vp7045_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&vp7045_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf,&vp7045_properties,THIS_MODULE,NULL,adapter_nr);
}
static struct usb_device_id vp7045_usb_table [] = {
diff -r 0776e4801991 linux/drivers/media/dvb/pluto2/pluto2.c
--- a/linux/drivers/media/dvb/pluto2/pluto2.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/pluto2/pluto2.c Sun Mar 30 13:51:34 2008 +0200
@@ -90,6 +90,10 @@
#define I2C_ADDR_TDA10046 0x10
#define I2C_ADDR_TUA6034 0xc2
#define NHWFILTERS 8
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
struct pluto {
/* pci */
@@ -666,7 +670,7 @@ static int __devinit pluto2_probe(struct
goto err_pluto_hw_exit;
/* dvb */
- ret = dvb_register_adapter(&pluto->dvb_adapter, DRIVER_NAME, THIS_MODULE, &pdev->dev);
+ ret = dvb_register_adapter(&pluto->dvb_adapter, DRIVER_NAME, THIS_MODULE, &pdev->dev, adapter_nr);
if (ret < 0)
goto err_i2c_del_adapter;
diff -r 0776e4801991 linux/drivers/media/dvb/ttpci/av7110.c
--- a/linux/drivers/media/dvb/ttpci/av7110.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/ttpci/av7110.c Sun Mar 30 13:51:34 2008 +0200
@@ -87,6 +87,7 @@ static int wss_cfg_4_3 = 0x4008;
static int wss_cfg_4_3 = 0x4008;
static int wss_cfg_16_9 = 0x0007;
static int tv_standard;
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
module_param_named(debug, av7110_debug, int, 0644);
MODULE_PARM_DESC(debug, "debug level (bitmask, default 0)");
@@ -111,6 +112,8 @@ MODULE_PARM_DESC(wss_cfg_16_9, "WSS 16:9
MODULE_PARM_DESC(wss_cfg_16_9, "WSS 16:9 - default 0x0007 - bit 15: disable, 14: burst mode, 13..0: wss data");
module_param(tv_standard, int, 0444);
MODULE_PARM_DESC(tv_standard, "TV standard: 0 PAL (default), 1 NTSC");
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
static void restart_feeds(struct av7110 *av7110);
@@ -2461,7 +2464,7 @@ static int __devinit av7110_attach(struc
goto err_kfree_0;
ret = dvb_register_adapter(&av7110->dvb_adapter, av7110->card_name,
- THIS_MODULE, &dev->pci->dev);
+ THIS_MODULE, &dev->pci->dev, adapter_nr);
if (ret < 0)
goto err_put_firmware_1;
diff -r 0776e4801991 linux/drivers/media/dvb/ttpci/budget-core.c
--- a/linux/drivers/media/dvb/ttpci/budget-core.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/ttpci/budget-core.c Sun Mar 30 13:51:34 2008 +0200
@@ -56,6 +56,10 @@ module_param_named(bufsize, dma_buffer_s
module_param_named(bufsize, dma_buffer_size, int, 0444);
MODULE_PARM_DESC(debug, "Turn on/off budget debugging (default:off).");
MODULE_PARM_DESC(bufsize, "DMA buffer size in KB, default: 188, min: 188, max: 1410 (Activy: 564)");
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
/****************************************************************************
* TT budget / WinTV Nova
@@ -471,7 +475,7 @@ int ttpci_budget_init(struct budget *bud
budget->buffer_width, budget->buffer_height);
printk("%s: dma buffer size %u\n", budget->dev->name, budget->buffer_size);
- if ((ret = dvb_register_adapter(&budget->dvb_adapter, budget->card->name, owner, &budget->dev->pci->dev)) < 0) {
+ if ((ret = dvb_register_adapter(&budget->dvb_adapter, budget->card->name, owner, &budget->dev->pci->dev, adapter_nr)) < 0) {
return ret;
}
diff -r 0776e4801991 linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
--- a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c Sun Mar 30 13:51:34 2008 +0200
@@ -59,9 +59,12 @@
*/
static int debug;
-
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
#define dprintk(x...) do { if (debug) printk(KERN_DEBUG x); } while (0)
@@ -1681,7 +1684,7 @@ static int ttusb_probe(struct usb_interf
mutex_unlock(&ttusb->semi2c);
- if ((result = dvb_register_adapter(&ttusb->adapter, "Technotrend/Hauppauge Nova-USB", THIS_MODULE, &udev->dev)) < 0) {
+ if ((result = dvb_register_adapter(&ttusb->adapter, "Technotrend/Hauppauge Nova-USB", THIS_MODULE, &udev->dev, adapter_nr)) < 0) {
ttusb_free_iso_urbs(ttusb);
kfree(ttusb);
return result;
diff -r 0776e4801991 linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
--- a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c Sun Mar 30 13:51:34 2008 +0200
@@ -47,6 +47,7 @@ static int debug;
static int debug;
static int output_pva;
static int enable_rc;
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
@@ -54,6 +55,8 @@ MODULE_PARM_DESC(output_pva, "Output PVA
MODULE_PARM_DESC(output_pva, "Output PVA from dvr device (default:off)");
module_param(enable_rc, int, 0644);
MODULE_PARM_DESC(enable_rc, "Turn on/off IR remote control(default: off)");
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
#define dprintk if (debug) printk
@@ -1456,7 +1459,8 @@ static int ttusb_dec_init_dvb(struct ttu
dprintk("%s\n", __FUNCTION__);
if ((result = dvb_register_adapter(&dec->adapter,
- dec->model_name, THIS_MODULE, &dec->udev->dev)) < 0) {
+ dec->model_name, THIS_MODULE, &dec->udev->dev,
+ adapter_nr)) < 0) {
printk("%s: dvb_register_adapter failed: error %d\n",
__FUNCTION__, result);
diff -r 0776e4801991 linux/drivers/media/video/cx23885/cx23885-dvb.c
--- a/linux/drivers/media/video/cx23885/cx23885-dvb.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/video/cx23885/cx23885-dvb.c Sun Mar 30 13:51:34 2008 +0200
@@ -54,6 +54,10 @@ static unsigned int alt_tuner;
static unsigned int alt_tuner;
module_param(alt_tuner, int, 0644);
MODULE_PARM_DESC(alt_tuner, "Enable alternate tuner configuration");
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
/* ------------------------------------------------------------------ */
@@ -334,7 +338,7 @@ static int dvb_register(struct cx23885_t
/* register everything */
return videobuf_dvb_register(&port->dvb, THIS_MODULE, port,
- &dev->pci->dev);
+ &dev->pci->dev, adapter_nr);
}
int cx23885_dvb_register(struct cx23885_tsport *port)
diff -r 0776e4801991 linux/drivers/media/video/cx88/cx88-dvb.c
--- a/linux/drivers/media/video/cx88/cx88-dvb.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/video/cx88/cx88-dvb.c Sun Mar 30 13:51:34 2008 +0200
@@ -58,6 +58,10 @@ static unsigned int debug;
static unsigned int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug,"enable debug messages [dvb]");
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
#define dprintk(level,fmt, arg...) if (debug >= level) \
printk(KERN_DEBUG "%s/2-dvb: " fmt, core->name, ## arg)
@@ -869,7 +873,7 @@ static int dvb_register(struct cx8802_de
cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL);
/* register everything */
- return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, &dev->pci->dev);
+ return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, &dev->pci->dev, adapter_nr);
}
/* ----------------------------------------------------------- */
diff -r 0776e4801991 linux/drivers/media/video/saa7134/saa7134-dvb.c
--- a/linux/drivers/media/video/saa7134/saa7134-dvb.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/video/saa7134/saa7134-dvb.c Sun Mar 30 13:51:34 2008 +0200
@@ -64,6 +64,10 @@ static int debug;
static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off module debugging (default:off).");
+
+static int adapter_nr[] = {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET };
+module_param_array(adapter_nr, int, NULL, 0444);
+MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers");
#define dprintk(fmt, arg...) do { if (debug) \
printk(KERN_DEBUG "%s/dvb: " fmt, dev->name , ## arg); } while(0)
@@ -1264,7 +1268,7 @@ static int dvb_init(struct saa7134_dev *
}
/* register everything else */
- ret = videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, &dev->pci->dev);
+ ret = videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, &dev->pci->dev, adapter_nr);
/* this sequence is necessary to make the tda1004x load its firmware
* and to enter analog mode of hybrid boards
diff -r 0776e4801991 linux/drivers/media/video/videobuf-dvb.c
--- a/linux/drivers/media/video/videobuf-dvb.c Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/drivers/media/video/videobuf-dvb.c Sun Mar 30 13:51:34 2008 +0200
@@ -144,14 +144,15 @@ int videobuf_dvb_register(struct videobu
int videobuf_dvb_register(struct videobuf_dvb *dvb,
struct module *module,
void *adapter_priv,
- struct device *device)
+ struct device *device,
+ int *adapter_nr)
{
int result;
mutex_init(&dvb->lock);
/* register adapter */
- result = dvb_register_adapter(&dvb->adapter, dvb->name, module, device);
+ result = dvb_register_adapter(&dvb->adapter, dvb->name, module, device, adapter_nr);
if (result < 0) {
printk(KERN_WARNING "%s: dvb_register_adapter failed (errno = %d)\n",
dvb->name, result);
diff -r 0776e4801991 linux/include/media/videobuf-dvb.h
--- a/linux/include/media/videobuf-dvb.h Fri Mar 28 14:52:44 2008 -0300
+++ b/linux/include/media/videobuf-dvb.h Sun Mar 30 13:51:34 2008 +0200
@@ -35,7 +35,8 @@ int videobuf_dvb_register(struct videobu
int videobuf_dvb_register(struct videobuf_dvb *dvb,
struct module *module,
void *adapter_priv,
- struct device *device);
+ struct device *device,
+ int *adapter_nr);
void videobuf_dvb_unregister(struct videobuf_dvb *dvb);
/*
[-- Attachment #3: Type: text/plain, Size: 150 bytes --]
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-03-30 11:53 ` Janne Grunau
@ 2008-03-30 18:17 ` Janne Grunau
2008-04-08 8:30 ` Janne Grunau
0 siblings, 1 reply; 24+ messages in thread
From: Janne Grunau @ 2008-03-30 18:17 UTC (permalink / raw)
To: linux-dvb
[-- Attachment #1: Type: text/plain, Size: 268 bytes --]
On Sunday 30 March 2008 13:53:33 Janne Grunau wrote:
>
> I agree. Fixed, updated patch attached.
Next try:
replaced module option definition in each driver by a macro,
fixed all checkpatch.pl error and warning
added Signed-off-by line and patch description
Janne
[-- Attachment #2: modoption_adapter_numbers4.diff --]
[-- Type: text/x-diff, Size: 39789 bytes --]
Adds selectable adapter numbers as per module option
From: Janne Grunau <janne-dvb@grunau.be>
The adapter_nr module options can be used to allocate static adapter numbers
on a driver level. It avoid problems with changing DVB apdapter numbers after
warm/cold boot or device unplugging and repluging.
Each driver holds DVB_MAX_ADAPTER long array of the preffered order of adapter
numbers.
options dvb-usb-dib0700 adapter_nr=7,6,5,4,3,2,1,0 would result in a
reversed allocation of adapter numbers.
With adapter_nr=2,5 it tries first to get adapter number 2 and 5. If
both are already in use it will allocate the lowest free adapter
number.
Signed-off-by: Janne Grunau <janne-dvb@grunau.be>
diff --git a/linux/drivers/media/dvb/b2c2/flexcop.c b/linux/drivers/media/dvb/b2c2/flexcop.c
--- a/linux/drivers/media/dvb/b2c2/flexcop.c
+++ b/linux/drivers/media/dvb/b2c2/flexcop.c
@@ -49,6 +49,8 @@ MODULE_PARM_DESC(debug, "set debug level
MODULE_PARM_DESC(debug, "set debug level (1=info,2=tuner,4=i2c,8=ts,16=sram,32=reg (|-able))." DEBSTATUS);
#undef DEBSTATUS
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
+
/* global zero for ibi values */
flexcop_ibi_value ibi_zero;
@@ -66,8 +68,10 @@ static int flexcop_dvb_stop_feed(struct
static int flexcop_dvb_init(struct flexcop_device *fc)
{
- int ret;
- if ((ret = dvb_register_adapter(&fc->dvb_adapter,"FlexCop Digital TV device",fc->owner,fc->dev)) < 0) {
+ int ret = dvb_register_adapter(&fc->dvb_adapter,
+ "FlexCop Digital TV device", fc->owner,
+ fc->dev, adapter_nr);
+ if (ret < 0) {
err("error registering DVB adapter");
return ret;
}
diff --git a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
--- a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -40,6 +40,8 @@ static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define dprintk( args... ) \
do { \
@@ -718,7 +720,10 @@ static int __devinit dvb_bt8xx_load_card
{
int result;
- if ((result = dvb_register_adapter(&card->dvb_adapter, card->card_name, THIS_MODULE, &card->bt->dev->dev)) < 0) {
+ result = dvb_register_adapter(&card->dvb_adapter, card->card_name,
+ THIS_MODULE, &card->bt->dev->dev,
+ adapter_nr);
+ if (result < 0) {
printk("dvb_bt8xx: dvb_register_adapter failed (errno = %d)\n", result);
return result;
}
diff --git a/linux/drivers/media/dvb/cinergyT2/cinergyT2.c b/linux/drivers/media/dvb/cinergyT2/cinergyT2.c
--- a/linux/drivers/media/dvb/cinergyT2/cinergyT2.c
+++ b/linux/drivers/media/dvb/cinergyT2/cinergyT2.c
@@ -60,6 +60,8 @@ static int debug;
static int debug;
module_param_named(debug, debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
#define dprintk(level, args...) \
@@ -1004,7 +1006,10 @@ static int cinergyt2_probe (struct usb_i
return -ENOMEM;
}
- if ((err = dvb_register_adapter(&cinergyt2->adapter, DRIVER_NAME, THIS_MODULE, &cinergyt2->udev->dev)) < 0) {
+ err = dvb_register_adapter(&cinergyt2->adapter, DRIVER_NAME,
+ THIS_MODULE, &cinergyt2->udev->dev,
+ adapter_nr);
+ if (err < 0) {
kfree(cinergyt2);
return err;
}
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.c b/linux/drivers/media/dvb/dvb-core/dvbdev.c
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c
@@ -52,7 +52,6 @@ static const char * const dnames[] = {
"net", "osd"
};
-#define DVB_MAX_ADAPTERS 8
#define DVB_MAX_IDS 4
#define nums2minor(num,type,id) ((num << 6) | (id << 4) | type)
#define MAX_DVB_MINORS (DVB_MAX_ADAPTERS*64)
@@ -277,18 +276,25 @@ void dvb_unregister_device(struct dvb_de
}
EXPORT_SYMBOL(dvb_unregister_device);
+static int dvbdev_check_free_adapter_num(int num)
+{
+ struct list_head *entry;
+ list_for_each(entry, &dvb_adapter_list) {
+ struct dvb_adapter *adap;
+ adap = list_entry(entry, struct dvb_adapter, list_head);
+ if (adap->num == num)
+ return 0;
+ }
+ return 1;
+}
static int dvbdev_get_free_adapter_num (void)
{
int num = 0;
while (num < DVB_MAX_ADAPTERS) {
- struct dvb_adapter *adap;
- list_for_each_entry(adap, &dvb_adapter_list, list_head)
- if (adap->num == num)
- goto skip;
- return num;
-skip:
+ if (dvbdev_check_free_adapter_num(num))
+ return num;
num++;
}
@@ -296,13 +302,28 @@ skip:
}
-int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct module *module, struct device *device)
+int dvb_register_adapter(struct dvb_adapter *adap, const char *name,
+ struct module *module, struct device *device,
+ int *adapter_nums)
{
- int num;
+ int i, num;
mutex_lock(&dvbdev_register_lock);
- if ((num = dvbdev_get_free_adapter_num ()) < 0) {
+ for (i = 0; i < DVB_MAX_ADAPTERS; ++i) {
+ num = adapter_nums[i];
+ if (num >= 0 && num < DVB_MAX_ADAPTERS) {
+ /* use the one the driver asked for */
+ if (dvbdev_check_free_adapter_num(num))
+ break;
+ } else {
+ num = dvbdev_get_free_adapter_num();
+ break;
+ }
+ num = -1;
+ }
+
+ if (num < 0) {
mutex_unlock(&dvbdev_register_lock);
return -ENFILE;
}
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.h b/linux/drivers/media/dvb/dvb-core/dvbdev.h
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.h
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.h
@@ -31,6 +31,10 @@
#define DVB_MAJOR 212
+#define DVB_MAX_ADAPTERS 8
+
+#define DVB_UNSET (-1)
+
#define DVB_DEVICE_VIDEO 0
#define DVB_DEVICE_AUDIO 1
#define DVB_DEVICE_SEC 2
@@ -41,6 +45,11 @@
#define DVB_DEVICE_NET 7
#define DVB_DEVICE_OSD 8
+#define DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr) \
+ static int adapter_nr[] = \
+ {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET }; \
+ module_param_array(adapter_nr, int, NULL, 0444); \
+ MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers")
struct dvb_adapter {
int num;
@@ -78,7 +87,9 @@ struct dvb_device {
};
-extern int dvb_register_adapter (struct dvb_adapter *adap, const char *name, struct module *module, struct device *device);
+extern int dvb_register_adapter(struct dvb_adapter *adap, const char *name,
+ struct module *module, struct device *device,
+ int *adapter_nums);
extern int dvb_unregister_adapter (struct dvb_adapter *adap);
extern int dvb_register_device (struct dvb_adapter *adap,
diff --git a/linux/drivers/media/dvb/dvb-usb/a800.c b/linux/drivers/media/dvb/dvb-usb/a800.c
--- a/linux/drivers/media/dvb/dvb-usb/a800.c
+++ b/linux/drivers/media/dvb/dvb-usb/a800.c
@@ -18,6 +18,9 @@ static int debug;
static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (rc=1 (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
+
#define deb_rc(args...) dprintk(debug,0x01,args)
static int a800_power_ctrl(struct dvb_usb_device *d, int onoff)
@@ -94,7 +97,8 @@ static int a800_probe(struct usb_interfa
static int a800_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&a800_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf, &a800_properties, THIS_MODULE, NULL,
+ adapter_nr);
}
/* do not change the order of the ID table */
diff --git a/linux/drivers/media/dvb/dvb-usb/af9005.c b/linux/drivers/media/dvb/dvb-usb/af9005.c
--- a/linux/drivers/media/dvb/dvb-usb/af9005.c
+++ b/linux/drivers/media/dvb/dvb-usb/af9005.c
@@ -38,6 +38,8 @@ int dvb_usb_af9005_dump_eeprom = 0;
int dvb_usb_af9005_dump_eeprom = 0;
module_param_named(dump_eeprom, dvb_usb_af9005_dump_eeprom, int, 0);
MODULE_PARM_DESC(dump_eeprom, "dump contents of the eeprom.");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
/* remote control decoder */
int (*rc_decode) (struct dvb_usb_device * d, u8 * data, int len, u32 * event,
@@ -1020,7 +1022,8 @@ static int af9005_usb_probe(struct usb_i
static int af9005_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf, &af9005_properties, THIS_MODULE, NULL);
+ return dvb_usb_device_init(intf, &af9005_properties, THIS_MODULE, NULL,
+ adapter_nr);
}
static struct usb_device_id af9005_usb_table[] = {
diff --git a/linux/drivers/media/dvb/dvb-usb/au6610.c b/linux/drivers/media/dvb/dvb-usb/au6610.c
--- a/linux/drivers/media/dvb/dvb-usb/au6610.c
+++ b/linux/drivers/media/dvb/dvb-usb/au6610.c
@@ -18,6 +18,8 @@ static int dvb_usb_au6610_debug;
static int dvb_usb_au6610_debug;
module_param_named(debug, dvb_usb_au6610_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static int au6610_usb_msg(struct dvb_usb_device *d, u8 operation, u8 addr,
u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen)
@@ -163,7 +165,9 @@ static int au6610_probe(struct usb_inter
if (intf->num_altsetting < AU6610_ALTSETTING_COUNT)
return -ENODEV;
- if ((ret = dvb_usb_device_init(intf, &au6610_properties, THIS_MODULE, &d)) == 0) {
+ ret = dvb_usb_device_init(intf, &au6610_properties, THIS_MODULE, &d,
+ adapter_nr);
+ if (ret == 0) {
alt = usb_altnum_to_altsetting(intf, AU6610_ALTSETTING);
if (alt == NULL) {
diff --git a/linux/drivers/media/dvb/dvb-usb/cxusb.c b/linux/drivers/media/dvb/dvb-usb/cxusb.c
--- a/linux/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/linux/drivers/media/dvb/dvb-usb/cxusb.c
@@ -40,6 +40,9 @@ static int dvb_usb_cxusb_debug;
static int dvb_usb_cxusb_debug;
module_param_named(debug, dvb_usb_cxusb_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
+
#define deb_info(args...) dprintk(dvb_usb_cxusb_debug,0x01,args)
#define deb_i2c(args...) if (d->udev->descriptor.idVendor == USB_VID_MEDION) \
dprintk(dvb_usb_cxusb_debug,0x01,args)
@@ -723,16 +726,24 @@ static int cxusb_probe(struct usb_interf
static int cxusb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_lgh064f_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_lgz201_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_dtt7579_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_dualdig4_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_nano2_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_nano2_needsfirmware_properties,THIS_MODULE,NULL) == 0) {
+ if (0 == dvb_usb_device_init(intf, &cxusb_medion_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &cxusb_bluebird_lgh064f_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &cxusb_bluebird_dee1601_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &cxusb_bluebird_lgz201_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &cxusb_bluebird_dtt7579_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &cxusb_bluebird_dualdig4_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &cxusb_bluebird_nano2_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf,
+ &cxusb_bluebird_nano2_needsfirmware_properties,
+ THIS_MODULE, NULL, adapter_nr))
return 0;
- }
return -EINVAL;
}
diff --git a/linux/drivers/media/dvb/dvb-usb/dib0700_core.c b/linux/drivers/media/dvb/dvb-usb/dib0700_core.c
--- a/linux/drivers/media/dvb/dvb-usb/dib0700_core.c
+++ b/linux/drivers/media/dvb/dvb-usb/dib0700_core.c
@@ -16,6 +16,8 @@ static int dvb_usb_dib0700_ir_proto = 1;
static int dvb_usb_dib0700_ir_proto = 1;
module_param(dvb_usb_dib0700_ir_proto, int, 0644);
MODULE_PARM_DESC(dvb_usb_dib0700_ir_proto, "set ir protocol (0=NEC, 1=RC5 (default), 2=RC6).");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
/* expecting rx buffer: request data[0] data[1] ... data[2] */
static int dib0700_ctrl_wr(struct dvb_usb_device *d, u8 *tx, u8 txlen)
@@ -289,7 +291,8 @@ static int dib0700_probe(struct usb_inte
#endif
for (i = 0; i < dib0700_device_count; i++)
- if (dvb_usb_device_init(intf, &dib0700_devices[i], THIS_MODULE, &dev) == 0)
+ if (dvb_usb_device_init(intf, &dib0700_devices[i], THIS_MODULE,
+ &dev, adapter_nr) == 0)
{
dib0700_rc_setup(dev);
return 0;
diff --git a/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c b/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c
--- a/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c
+++ b/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c
@@ -13,6 +13,8 @@
* see Documentation/dvb/README.dvb-usb for more information
*/
#include "dibusb.h"
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static int dib3000mb_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
{
@@ -107,10 +109,14 @@ static int dibusb_probe(struct usb_inter
static int dibusb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- if (dvb_usb_device_init(intf,&dibusb1_1_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&dibusb1_1_an2235_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&dibusb2_0b_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&artec_t1_usb2_properties,THIS_MODULE,NULL) == 0)
+ if (0 == dvb_usb_device_init(intf, &dibusb1_1_properties, THIS_MODULE,
+ NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &dibusb1_1_an2235_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &dibusb2_0b_properties, THIS_MODULE,
+ NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &artec_t1_usb2_properties,
+ THIS_MODULE, NULL, adapter_nr))
return 0;
return -EINVAL;
diff --git a/linux/drivers/media/dvb/dvb-usb/dibusb-mc.c b/linux/drivers/media/dvb/dvb-usb/dibusb-mc.c
--- a/linux/drivers/media/dvb/dvb-usb/dibusb-mc.c
+++ b/linux/drivers/media/dvb/dvb-usb/dibusb-mc.c
@@ -14,13 +14,16 @@
*/
#include "dibusb.h"
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
+
/* USB Driver stuff */
static struct dvb_usb_device_properties dibusb_mc_properties;
static int dibusb_mc_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&dibusb_mc_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf, &dibusb_mc_properties, THIS_MODULE,
+ NULL, adapter_nr);
}
/* do not change the order of the ID table */
diff --git a/linux/drivers/media/dvb/dvb-usb/digitv.c b/linux/drivers/media/dvb/dvb-usb/digitv.c
--- a/linux/drivers/media/dvb/dvb-usb/digitv.c
+++ b/linux/drivers/media/dvb/dvb-usb/digitv.c
@@ -20,6 +20,9 @@ static int dvb_usb_digitv_debug;
static int dvb_usb_digitv_debug;
module_param_named(debug,dvb_usb_digitv_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
+
#define deb_rc(args...) dprintk(dvb_usb_digitv_debug,0x01,args)
static int digitv_ctrl_msg(struct dvb_usb_device *d,
@@ -256,8 +259,9 @@ static int digitv_probe(struct usb_inter
const struct usb_device_id *id)
{
struct dvb_usb_device *d;
- int ret;
- if ((ret = dvb_usb_device_init(intf,&digitv_properties,THIS_MODULE,&d)) == 0) {
+ int ret = dvb_usb_device_init(intf, &digitv_properties, THIS_MODULE, &d,
+ adapter_nr);
+ if (ret == 0) {
u8 b[4] = { 0 };
if (d != NULL) { /* do that only when the firmware is loaded */
diff --git a/linux/drivers/media/dvb/dvb-usb/dtt200u.c b/linux/drivers/media/dvb/dvb-usb/dtt200u.c
--- a/linux/drivers/media/dvb/dvb-usb/dtt200u.c
+++ b/linux/drivers/media/dvb/dvb-usb/dtt200u.c
@@ -17,6 +17,8 @@ int dvb_usb_dtt200u_debug;
int dvb_usb_dtt200u_debug;
module_param_named(debug,dvb_usb_dtt200u_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2 (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static int dtt200u_power_ctrl(struct dvb_usb_device *d, int onoff)
{
@@ -101,11 +103,16 @@ static int dtt200u_usb_probe(struct usb_
static int dtt200u_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- if (dvb_usb_device_init(intf,&dtt200u_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&wt220u_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&wt220u_fc_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&wt220u_zl0353_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&wt220u_miglia_properties,THIS_MODULE,NULL) == 0)
+ if (0 == dvb_usb_device_init(intf, &dtt200u_properties, THIS_MODULE,
+ NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &wt220u_properties, THIS_MODULE,
+ NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &wt220u_fc_properties, THIS_MODULE,
+ NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &wt220u_zl0353_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &wt220u_miglia_properties,
+ THIS_MODULE, NULL, adapter_nr))
return 0;
return -ENODEV;
diff --git a/linux/drivers/media/dvb/dvb-usb/dvb-usb-common.h b/linux/drivers/media/dvb/dvb-usb/dvb-usb-common.h
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-common.h
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-common.h
@@ -40,7 +40,8 @@ extern int dvb_usb_i2c_init(struct dvb_u
extern int dvb_usb_i2c_init(struct dvb_usb_device *);
extern int dvb_usb_i2c_exit(struct dvb_usb_device *);
-extern int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap);
+extern int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap,
+ int *adapter_nums);
extern int dvb_usb_adapter_dvb_exit(struct dvb_usb_adapter *adap);
extern int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap);
extern int dvb_usb_adapter_frontend_exit(struct dvb_usb_adapter *adap);
diff --git a/linux/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c b/linux/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
@@ -77,12 +77,13 @@ static int dvb_usb_stop_feed(struct dvb_
return dvb_usb_ctrl_feed(dvbdmxfeed,0);
}
-int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap)
+int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap, int *adapter_nums)
{
- int ret;
+ int ret = dvb_register_adapter(&adap->dvb_adap, adap->dev->desc->name,
+ adap->dev->owner, &adap->dev->udev->dev,
+ adapter_nums);
- if ((ret = dvb_register_adapter(&adap->dvb_adap, adap->dev->desc->name,
- adap->dev->owner, &adap->dev->udev->dev)) < 0) {
+ if (ret < 0) {
deb_info("dvb_register_adapter failed: error %d", ret);
goto err;
}
diff --git a/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c b/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c
@@ -26,7 +26,7 @@ module_param_named(force_pid_filter_usag
module_param_named(force_pid_filter_usage, dvb_usb_force_pid_filter_usage, int, 0444);
MODULE_PARM_DESC(force_pid_filter_usage, "force all dvb-usb-devices to use a PID filter, if any (default: 0).");
-static int dvb_usb_adapter_init(struct dvb_usb_device *d)
+static int dvb_usb_adapter_init(struct dvb_usb_device *d, int *adapter_nrs)
{
struct dvb_usb_adapter *adap;
int ret,n;
@@ -72,7 +72,7 @@ static int dvb_usb_adapter_init(struct d
}
if ((ret = dvb_usb_adapter_stream_init(adap)) ||
- (ret = dvb_usb_adapter_dvb_init(adap)) ||
+ (ret = dvb_usb_adapter_dvb_init(adap, adapter_nrs)) ||
(ret = dvb_usb_adapter_frontend_init(adap))) {
return ret;
}
@@ -122,7 +122,7 @@ static int dvb_usb_exit(struct dvb_usb_d
return 0;
}
-static int dvb_usb_init(struct dvb_usb_device *d)
+static int dvb_usb_init(struct dvb_usb_device *d, int *adapter_nums)
{
int ret = 0;
@@ -143,7 +143,7 @@ static int dvb_usb_init(struct dvb_usb_d
dvb_usb_device_power_ctrl(d, 1);
if ((ret = dvb_usb_i2c_init(d)) ||
- (ret = dvb_usb_adapter_init(d))) {
+ (ret = dvb_usb_adapter_init(d, adapter_nums))) {
dvb_usb_exit(d);
return ret;
}
@@ -213,8 +213,10 @@ int dvb_usb_device_power_ctrl(struct dvb
/*
* USB
*/
-int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_device_properties
- *props, struct module *owner,struct dvb_usb_device **du)
+int dvb_usb_device_init(struct usb_interface *intf,
+ struct dvb_usb_device_properties *props,
+ struct module *owner, struct dvb_usb_device **du,
+ int *adapter_nums)
{
struct usb_device *udev = interface_to_usbdev(intf);
struct dvb_usb_device *d = NULL;
@@ -254,7 +256,7 @@ int dvb_usb_device_init(struct usb_inter
if (du != NULL)
*du = d;
- ret = dvb_usb_init(d);
+ ret = dvb_usb_init(d, adapter_nums);
if (ret == 0)
info("%s successfully initialized and connected.",desc->name);
diff --git a/linux/drivers/media/dvb/dvb-usb/dvb-usb.h b/linux/drivers/media/dvb/dvb-usb/dvb-usb.h
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb.h
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb.h
@@ -387,7 +387,10 @@ struct dvb_usb_device {
void *priv;
};
-extern int dvb_usb_device_init(struct usb_interface *, struct dvb_usb_device_properties *, struct module *, struct dvb_usb_device **);
+extern int dvb_usb_device_init(struct usb_interface *,
+ struct dvb_usb_device_properties *,
+ struct module *, struct dvb_usb_device **,
+ int *adapter_nums);
extern void dvb_usb_device_exit(struct usb_interface *);
/* the generic read/write method for device control */
diff --git a/linux/drivers/media/dvb/dvb-usb/gl861.c b/linux/drivers/media/dvb/dvb-usb/gl861.c
--- a/linux/drivers/media/dvb/dvb-usb/gl861.c
+++ b/linux/drivers/media/dvb/dvb-usb/gl861.c
@@ -15,6 +15,8 @@ static int dvb_usb_gl861_debug;
static int dvb_usb_gl861_debug;
module_param_named(debug,dvb_usb_gl861_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static int gl861_i2c_msg(struct dvb_usb_device *d, u8 addr,
u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen)
@@ -140,7 +142,9 @@ static int gl861_probe(struct usb_interf
if (intf->num_altsetting < 2)
return -ENODEV;
- if ((ret = dvb_usb_device_init(intf, &gl861_properties, THIS_MODULE, &d)) == 0) {
+ ret = dvb_usb_device_init(intf, &gl861_properties, THIS_MODULE, &d,
+ adapter_nr);
+ if (ret == 0) {
alt = usb_altnum_to_altsetting(intf, 0);
if (alt == NULL) {
diff --git a/linux/drivers/media/dvb/dvb-usb/gp8psk.c b/linux/drivers/media/dvb/dvb-usb/gp8psk.c
--- a/linux/drivers/media/dvb/dvb-usb/gp8psk.c
+++ b/linux/drivers/media/dvb/dvb-usb/gp8psk.c
@@ -21,6 +21,8 @@ int dvb_usb_gp8psk_debug;
int dvb_usb_gp8psk_debug;
module_param_named(debug,dvb_usb_gp8psk_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
int gp8psk_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen)
{
@@ -208,7 +210,8 @@ static int gp8psk_usb_probe(struct usb_i
{
int ret;
struct usb_device *udev = interface_to_usbdev(intf);
- ret = dvb_usb_device_init(intf,&gp8psk_properties,THIS_MODULE,NULL);
+ ret = dvb_usb_device_init(intf, &gp8psk_properties, THIS_MODULE, NULL,
+ adapter_nr);
if (ret == 0) {
info("found Genpix USB device pID = %x (hex)",
le16_to_cpu(udev->descriptor.idProduct));
diff --git a/linux/drivers/media/dvb/dvb-usb/m920x.c b/linux/drivers/media/dvb/dvb-usb/m920x.c
--- a/linux/drivers/media/dvb/dvb-usb/m920x.c
+++ b/linux/drivers/media/dvb/dvb-usb/m920x.c
@@ -21,6 +21,8 @@ static int dvb_usb_m920x_debug;
static int dvb_usb_m920x_debug;
module_param_named(debug,dvb_usb_m920x_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static int m920x_set_filter(struct dvb_usb_device *d, int type, int idx, int pid);
@@ -618,27 +620,31 @@ static int m920x_probe(struct usb_interf
* multi-tuner device
*/
- if ((ret = dvb_usb_device_init(intf, &megasky_properties,
- THIS_MODULE, &d)) == 0) {
+ ret = dvb_usb_device_init(intf, &megasky_properties,
+ THIS_MODULE, &d, adapter_nr);
+ if (ret == 0) {
rc_init_seq = megasky_rc_init;
goto found;
}
- if ((ret = dvb_usb_device_init(intf, &digivox_mini_ii_properties,
- THIS_MODULE, &d)) == 0) {
+ ret = dvb_usb_device_init(intf, &digivox_mini_ii_properties,
+ THIS_MODULE, &d, adapter_nr);
+ if (ret == 0) {
/* No remote control, so no rc_init_seq */
goto found;
}
/* This configures both tuners on the TV Walker Twin */
- if ((ret = dvb_usb_device_init(intf, &tvwalkertwin_properties,
- THIS_MODULE, &d)) == 0) {
+ ret = dvb_usb_device_init(intf, &tvwalkertwin_properties,
+ THIS_MODULE, &d, adapter_nr);
+ if (ret == 0) {
rc_init_seq = tvwalkertwin_rc_init;
goto found;
}
- if ((ret = dvb_usb_device_init(intf, &dposh_properties,
- THIS_MODULE, &d)) == 0) {
+ ret = dvb_usb_device_init(intf, &dposh_properties,
+ THIS_MODULE, &d, adapter_nr);
+ if (ret == 0) {
/* Remote controller not supported yet. */
goto found;
}
diff --git a/linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c b/linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c
--- a/linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c
+++ b/linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c
@@ -14,6 +14,8 @@ static int debug;
static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc,2=eeprom (|-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define deb_rc(args...) dprintk(debug,0x01,args)
#define deb_ee(args...) dprintk(debug,0x02,args)
@@ -142,7 +144,8 @@ static int nova_t_probe(struct usb_inter
static int nova_t_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&nova_t_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf, &nova_t_properties, THIS_MODULE, NULL,
+ adapter_nr);
}
/* do not change the order of the ID table */
diff --git a/linux/drivers/media/dvb/dvb-usb/opera1.c b/linux/drivers/media/dvb/dvb-usb/opera1.c
--- a/linux/drivers/media/dvb/dvb-usb/opera1.c
+++ b/linux/drivers/media/dvb/dvb-usb/opera1.c
@@ -45,6 +45,9 @@ MODULE_PARM_DESC(debug,
MODULE_PARM_DESC(debug,
"set debugging level (1=info,xfer=2,pll=4,ts=8,err=16,rc=32,fw=64 (or-able))."
DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
+
#if 0
struct mutex mymutex;
#endif
@@ -559,7 +562,8 @@ static int opera1_probe(struct usb_inter
return -EINVAL;
}
- if (dvb_usb_device_init(intf, &opera1_properties, THIS_MODULE, NULL) != 0)
+ if (0 != dvb_usb_device_init(intf, &opera1_properties, THIS_MODULE,
+ NULL, adapter_nr))
return -EINVAL;
return 0;
}
diff --git a/linux/drivers/media/dvb/dvb-usb/ttusb2.c b/linux/drivers/media/dvb/dvb-usb/ttusb2.c
--- a/linux/drivers/media/dvb/dvb-usb/ttusb2.c
+++ b/linux/drivers/media/dvb/dvb-usb/ttusb2.c
@@ -36,6 +36,8 @@ static int dvb_usb_ttusb2_debug;
#define deb_info(args...) dprintk(dvb_usb_ttusb2_debug,0x01,args)
module_param_named(debug,dvb_usb_ttusb2_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
struct ttusb2_state {
u8 id;
@@ -186,7 +188,8 @@ static int ttusb2_probe(struct usb_inter
static int ttusb2_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&ttusb2_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf, &ttusb2_properties, THIS_MODULE, NULL,
+ adapter_nr);
}
static struct usb_device_id ttusb2_table [] = {
diff --git a/linux/drivers/media/dvb/dvb-usb/umt-010.c b/linux/drivers/media/dvb/dvb-usb/umt-010.c
--- a/linux/drivers/media/dvb/dvb-usb/umt-010.c
+++ b/linux/drivers/media/dvb/dvb-usb/umt-010.c
@@ -12,6 +12,8 @@
#include "dibusb.h"
#include "mt352.h"
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static int umt_mt352_demod_init(struct dvb_frontend *fe)
{
@@ -75,7 +77,8 @@ static int umt_probe(struct usb_interfac
static int umt_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- if (dvb_usb_device_init(intf,&umt_properties,THIS_MODULE,NULL) == 0)
+ if (0 == dvb_usb_device_init(intf, &umt_properties, THIS_MODULE, NULL,
+ adapter_nr))
return 0;
return -EINVAL;
}
diff --git a/linux/drivers/media/dvb/dvb-usb/vp702x.c b/linux/drivers/media/dvb/dvb-usb/vp702x.c
--- a/linux/drivers/media/dvb/dvb-usb/vp702x.c
+++ b/linux/drivers/media/dvb/dvb-usb/vp702x.c
@@ -20,6 +20,8 @@ int dvb_usb_vp702x_debug;
int dvb_usb_vp702x_debug;
module_param_named(debug,dvb_usb_vp702x_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
struct vp702x_state {
int pid_filter_count;
@@ -285,7 +287,8 @@ static int vp702x_usb_probe(struct usb_i
static int vp702x_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&vp702x_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf, &vp702x_properties, THIS_MODULE, NULL,
+ adapter_nr);
}
static struct usb_device_id vp702x_usb_table [] = {
diff --git a/linux/drivers/media/dvb/dvb-usb/vp7045.c b/linux/drivers/media/dvb/dvb-usb/vp7045.c
--- a/linux/drivers/media/dvb/dvb-usb/vp7045.c
+++ b/linux/drivers/media/dvb/dvb-usb/vp7045.c
@@ -18,6 +18,9 @@ static int dvb_usb_vp7045_debug;
static int dvb_usb_vp7045_debug;
module_param_named(debug,dvb_usb_vp7045_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
+
#define deb_info(args...) dprintk(dvb_usb_vp7045_debug,0x01,args)
#define deb_xfer(args...) dprintk(dvb_usb_vp7045_debug,0x02,args)
#define deb_rc(args...) dprintk(dvb_usb_vp7045_debug,0x04,args)
@@ -227,7 +230,8 @@ static int vp7045_usb_probe(struct usb_i
static int vp7045_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&vp7045_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf, &vp7045_properties, THIS_MODULE, NULL,
+ adapter_nr);
}
static struct usb_device_id vp7045_usb_table [] = {
diff --git a/linux/drivers/media/dvb/pluto2/pluto2.c b/linux/drivers/media/dvb/pluto2/pluto2.c
--- a/linux/drivers/media/dvb/pluto2/pluto2.c
+++ b/linux/drivers/media/dvb/pluto2/pluto2.c
@@ -38,6 +38,8 @@
#include "dvb_net.h"
#include "dvbdev.h"
#include "tda1004x.h"
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define DRIVER_NAME "pluto2"
@@ -666,7 +668,8 @@ static int __devinit pluto2_probe(struct
goto err_pluto_hw_exit;
/* dvb */
- ret = dvb_register_adapter(&pluto->dvb_adapter, DRIVER_NAME, THIS_MODULE, &pdev->dev);
+ ret = dvb_register_adapter(&pluto->dvb_adapter, DRIVER_NAME,
+ THIS_MODULE, &pdev->dev, adapter_nr);
if (ret < 0)
goto err_i2c_del_adapter;
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c
--- a/linux/drivers/media/dvb/ttpci/av7110.c
+++ b/linux/drivers/media/dvb/ttpci/av7110.c
@@ -111,6 +111,8 @@ MODULE_PARM_DESC(wss_cfg_16_9, "WSS 16:9
MODULE_PARM_DESC(wss_cfg_16_9, "WSS 16:9 - default 0x0007 - bit 15: disable, 14: burst mode, 13..0: wss data");
module_param(tv_standard, int, 0444);
MODULE_PARM_DESC(tv_standard, "TV standard: 0 PAL (default), 1 NTSC");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static void restart_feeds(struct av7110 *av7110);
@@ -2461,7 +2463,7 @@ static int __devinit av7110_attach(struc
goto err_kfree_0;
ret = dvb_register_adapter(&av7110->dvb_adapter, av7110->card_name,
- THIS_MODULE, &dev->pci->dev);
+ THIS_MODULE, &dev->pci->dev, adapter_nr);
if (ret < 0)
goto err_put_firmware_1;
diff --git a/linux/drivers/media/dvb/ttpci/budget-core.c b/linux/drivers/media/dvb/ttpci/budget-core.c
--- a/linux/drivers/media/dvb/ttpci/budget-core.c
+++ b/linux/drivers/media/dvb/ttpci/budget-core.c
@@ -56,6 +56,8 @@ module_param_named(bufsize, dma_buffer_s
module_param_named(bufsize, dma_buffer_size, int, 0444);
MODULE_PARM_DESC(debug, "Turn on/off budget debugging (default:off).");
MODULE_PARM_DESC(bufsize, "DMA buffer size in KB, default: 188, min: 188, max: 1410 (Activy: 564)");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
/****************************************************************************
* TT budget / WinTV Nova
@@ -471,9 +473,10 @@ int ttpci_budget_init(struct budget *bud
budget->buffer_width, budget->buffer_height);
printk("%s: dma buffer size %u\n", budget->dev->name, budget->buffer_size);
- if ((ret = dvb_register_adapter(&budget->dvb_adapter, budget->card->name, owner, &budget->dev->pci->dev)) < 0) {
+ ret = dvb_register_adapter(&budget->dvb_adapter, budget->card->name,
+ owner, &budget->dev->pci->dev, adapter_nr);
+ if (ret < 0)
return ret;
- }
/* set dd1 stream a & b */
saa7146_write(dev, DD1_STREAM_B, 0x00000000);
diff --git a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
--- a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -59,9 +59,10 @@
*/
static int debug;
-
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define dprintk(x...) do { if (debug) printk(KERN_DEBUG x); } while (0)
@@ -1681,7 +1682,10 @@ static int ttusb_probe(struct usb_interf
mutex_unlock(&ttusb->semi2c);
- if ((result = dvb_register_adapter(&ttusb->adapter, "Technotrend/Hauppauge Nova-USB", THIS_MODULE, &udev->dev)) < 0) {
+ result = dvb_register_adapter(&ttusb->adapter,
+ "Technotrend/Hauppauge Nova-USB",
+ THIS_MODULE, &udev->dev, adapter_nr);
+ if (result < 0) {
ttusb_free_iso_urbs(ttusb);
kfree(ttusb);
return result;
diff --git a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
--- a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
+++ b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
@@ -54,6 +54,8 @@ MODULE_PARM_DESC(output_pva, "Output PVA
MODULE_PARM_DESC(output_pva, "Output PVA from dvr device (default:off)");
module_param(enable_rc, int, 0644);
MODULE_PARM_DESC(enable_rc, "Turn on/off IR remote control(default: off)");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define dprintk if (debug) printk
@@ -1456,7 +1458,9 @@ static int ttusb_dec_init_dvb(struct ttu
dprintk("%s\n", __FUNCTION__);
if ((result = dvb_register_adapter(&dec->adapter,
- dec->model_name, THIS_MODULE, &dec->udev->dev)) < 0) {
+ dec->model_name, THIS_MODULE,
+ &dec->udev->dev,
+ adapter_nr)) < 0) {
printk("%s: dvb_register_adapter failed: error %d\n",
__FUNCTION__, result);
diff --git a/linux/drivers/media/video/cx23885/cx23885-dvb.c b/linux/drivers/media/video/cx23885/cx23885-dvb.c
--- a/linux/drivers/media/video/cx23885/cx23885-dvb.c
+++ b/linux/drivers/media/video/cx23885/cx23885-dvb.c
@@ -54,6 +54,8 @@ static unsigned int alt_tuner;
static unsigned int alt_tuner;
module_param(alt_tuner, int, 0644);
MODULE_PARM_DESC(alt_tuner, "Enable alternate tuner configuration");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
/* ------------------------------------------------------------------ */
@@ -334,7 +336,7 @@ static int dvb_register(struct cx23885_t
/* register everything */
return videobuf_dvb_register(&port->dvb, THIS_MODULE, port,
- &dev->pci->dev);
+ &dev->pci->dev, adapter_nr);
}
int cx23885_dvb_register(struct cx23885_tsport *port)
diff --git a/linux/drivers/media/video/cx88/cx88-dvb.c b/linux/drivers/media/video/cx88/cx88-dvb.c
--- a/linux/drivers/media/video/cx88/cx88-dvb.c
+++ b/linux/drivers/media/video/cx88/cx88-dvb.c
@@ -58,6 +58,8 @@ static unsigned int debug;
static unsigned int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug,"enable debug messages [dvb]");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define dprintk(level,fmt, arg...) if (debug >= level) \
printk(KERN_DEBUG "%s/2-dvb: " fmt, core->name, ## arg)
@@ -869,7 +871,8 @@ static int dvb_register(struct cx8802_de
cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL);
/* register everything */
- return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, &dev->pci->dev);
+ return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev,
+ &dev->pci->dev, adapter_nr);
}
/* ----------------------------------------------------------- */
diff --git a/linux/drivers/media/video/saa7134/saa7134-dvb.c b/linux/drivers/media/video/saa7134/saa7134-dvb.c
--- a/linux/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/linux/drivers/media/video/saa7134/saa7134-dvb.c
@@ -64,6 +64,8 @@ static int debug;
static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off module debugging (default:off).");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define dprintk(fmt, arg...) do { if (debug) \
printk(KERN_DEBUG "%s/dvb: " fmt, dev->name , ## arg); } while(0)
@@ -1264,7 +1266,8 @@ static int dvb_init(struct saa7134_dev *
}
/* register everything else */
- ret = videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, &dev->pci->dev);
+ ret = videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, &dev->pci->dev,
+ adapter_nr);
/* this sequence is necessary to make the tda1004x load its firmware
* and to enter analog mode of hybrid boards
diff --git a/linux/drivers/media/video/videobuf-dvb.c b/linux/drivers/media/video/videobuf-dvb.c
--- a/linux/drivers/media/video/videobuf-dvb.c
+++ b/linux/drivers/media/video/videobuf-dvb.c
@@ -144,14 +144,16 @@ int videobuf_dvb_register(struct videobu
int videobuf_dvb_register(struct videobuf_dvb *dvb,
struct module *module,
void *adapter_priv,
- struct device *device)
+ struct device *device,
+ int *adapter_nr)
{
int result;
mutex_init(&dvb->lock);
/* register adapter */
- result = dvb_register_adapter(&dvb->adapter, dvb->name, module, device);
+ result = dvb_register_adapter(&dvb->adapter, dvb->name, module, device,
+ adapter_nr);
if (result < 0) {
printk(KERN_WARNING "%s: dvb_register_adapter failed (errno = %d)\n",
dvb->name, result);
diff --git a/linux/include/media/videobuf-dvb.h b/linux/include/media/videobuf-dvb.h
--- a/linux/include/media/videobuf-dvb.h
+++ b/linux/include/media/videobuf-dvb.h
@@ -35,7 +35,8 @@ int videobuf_dvb_register(struct videobu
int videobuf_dvb_register(struct videobuf_dvb *dvb,
struct module *module,
void *adapter_priv,
- struct device *device);
+ struct device *device,
+ int *adapter_nr);
void videobuf_dvb_unregister(struct videobuf_dvb *dvb);
/*
[-- Attachment #3: Type: text/plain, Size: 150 bytes --]
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-03-30 18:17 ` Janne Grunau
@ 2008-04-08 8:30 ` Janne Grunau
2008-04-08 9:13 ` Andreas
0 siblings, 1 reply; 24+ messages in thread
From: Janne Grunau @ 2008-04-08 8:30 UTC (permalink / raw)
To: linux-dvb
On Sunday 30 March 2008 20:17:49 Janne Grunau wrote:
> On Sunday 30 March 2008 13:53:33 Janne Grunau wrote:
> > I agree. Fixed, updated patch attached.
>
> Next try:
>
> replaced module option definition in each driver by a macro,
> fixed all checkpatch.pl error and warning
> added Signed-off-by line and patch description
ping.
Any interest in this change? Anything speaking against merging this
except the potential duplication of udev functinality?
Janne
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-04-08 8:30 ` Janne Grunau
@ 2008-04-08 9:13 ` Andreas
2008-04-08 15:18 ` Michael Krufky
0 siblings, 1 reply; 24+ messages in thread
From: Andreas @ 2008-04-08 9:13 UTC (permalink / raw)
To: linux-dvb
Am Dienstag, 08. April 2008 01:30:04 schrieb Janne Grunau:
> ping.
pong
> Any interest in this change? Anything speaking against merging this
> except the potential duplication of udev functinality?
Janne, I have no clue at all how a udev rule can be written that reflects
the structure of adapter[n]/frontend[n]. And if Google is any indicator,
this is either not possible or it is a lost art. Speaking as a user of
mythtv & subsequently the linux dvb drivers, I would like to see this patch
integrated rather sooner than later.
Thanks for creating the patch!
--
Gruß
Andreas
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-04-08 9:13 ` Andreas
@ 2008-04-08 15:18 ` Michael Krufky
2008-04-08 22:22 ` Oliver Endriss
2008-04-09 19:28 ` Janne Grunau
0 siblings, 2 replies; 24+ messages in thread
From: Michael Krufky @ 2008-04-08 15:18 UTC (permalink / raw)
To: Janne Grunau; +Cc: linux-dvb
On Tue, Apr 8, 2008 at 5:13 AM, Andreas <linuxdreas@launchnet.com> wrote:
> Am Dienstag, 08. April 2008 01:30:04 schrieb Janne Grunau:
> > ping.
>
> pong
>
>
> > Any interest in this change? Anything speaking against merging this
> > except the potential duplication of udev functinality?
>
> Janne, I have no clue at all how a udev rule can be written that reflects
> the structure of adapter[n]/frontend[n]. And if Google is any indicator,
> this is either not possible or it is a lost art. Speaking as a user of
> mythtv & subsequently the linux dvb drivers, I would like to see this patch
> integrated rather sooner than later.
>
> Thanks for creating the patch!
I would really like to see this patch get merged.
If nobody has an issue with this, I plan to push this into a mercurial
tree at the end of the week and request that it be merged into the
master branch.
Regards,
Mike
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-04-08 15:18 ` Michael Krufky
@ 2008-04-08 22:22 ` Oliver Endriss
2008-04-09 9:21 ` Janne Grunau
2008-04-09 19:28 ` Janne Grunau
1 sibling, 1 reply; 24+ messages in thread
From: Oliver Endriss @ 2008-04-08 22:22 UTC (permalink / raw)
To: linux-dvb
Michael Krufky wrote:
> On Tue, Apr 8, 2008 at 5:13 AM, Andreas <linuxdreas@launchnet.com> wrote:
> > Am Dienstag, 08. April 2008 01:30:04 schrieb Janne Grunau:
> > > ping.
> >
> > pong
> >
> >
> > > Any interest in this change? Anything speaking against merging this
> > > except the potential duplication of udev functinality?
> >
> > Janne, I have no clue at all how a udev rule can be written that reflects
> > the structure of adapter[n]/frontend[n]. And if Google is any indicator,
> > this is either not possible or it is a lost art. Speaking as a user of
> > mythtv & subsequently the linux dvb drivers, I would like to see this patch
> > integrated rather sooner than later.
> >
> > Thanks for creating the patch!
>
> I would really like to see this patch get merged.
>
> If nobody has an issue with this, I plan to push this into a mercurial
> tree at the end of the week and request that it be merged into the
> master branch.
Correct me if I'm wrong, but afaik the option should be named
'adapter_no', not 'adapter_nr'.
CU
Oliver
--
----------------------------------------------------------------
VDR Remote Plugin 0.4.0: http://www.escape-edv.de/endriss/vdr/
----------------------------------------------------------------
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-04-08 22:22 ` Oliver Endriss
@ 2008-04-09 9:21 ` Janne Grunau
2008-04-09 14:44 ` Michael Krufky
2008-04-09 14:45 ` Michael Krufky
0 siblings, 2 replies; 24+ messages in thread
From: Janne Grunau @ 2008-04-09 9:21 UTC (permalink / raw)
To: linux-dvb
On Wednesday 09 April 2008 00:22:40 Oliver Endriss wrote:
> Michael Krufky wrote:
> >
> > I would really like to see this patch get merged.
> >
> > If nobody has an issue with this, I plan to push this into a
> > mercurial tree at the end of the week and request that it be merged
> > into the master branch.
>
> Correct me if I'm wrong, but afaik the option should be named
> 'adapter_no', not 'adapter_nr'.
The usual english abbreviation for number is no. OTOH the respective V4L
options are also called video|radio|vbi _nr, so calling it adapter_nr
would be consistent with V4L.
I'm not sure which argument is more important but it won't be much work
to change it o adapter_no.
Janne
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-04-09 9:21 ` Janne Grunau
@ 2008-04-09 14:44 ` Michael Krufky
2008-04-09 23:25 ` Nick Andrew
2008-04-09 14:45 ` Michael Krufky
1 sibling, 1 reply; 24+ messages in thread
From: Michael Krufky @ 2008-04-09 14:44 UTC (permalink / raw)
To: Janne Grunau; +Cc: linux-dvb
On Wed, Apr 9, 2008 at 5:21 AM, Janne Grunau <janne-dvb@grunau.be> wrote:
> On Wednesday 09 April 2008 00:22:40 Oliver Endriss wrote:
>
> > Michael Krufky wrote:
> > >
> > > I would really like to see this patch get merged.
> > >
> > > If nobody has an issue with this, I plan to push this into a
> > > mercurial tree at the end of the week and request that it be merged
> > > into the master branch.
> >
> > Correct me if I'm wrong, but afaik the option should be named
> > 'adapter_no', not 'adapter_nr'.
>
> The usual english abbreviation for number is no. OTOH the respective V4L
> options are also called video|radio|vbi _nr, so calling it adapter_nr
> would be consistent with V4L.
>
> I'm not sure which argument is more important but it won't be much work
> to change it o adapter_no.
I believe that the "nr" abbreviation comes from the German language.
(correct me if I'm wrong)
Perhaps the abbreviation, "no" is more correct, since it is based on
the English language, but to me this is of no significance, since v4l
uses the "nr" abbreviation and this is globally understood.
If Oliver perfers "adapter_no" then lets go with it. Otherwise, it's
fine as-is.
-Mike
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-04-09 9:21 ` Janne Grunau
2008-04-09 14:44 ` Michael Krufky
@ 2008-04-09 14:45 ` Michael Krufky
2008-04-09 16:50 ` Oliver Endriss
1 sibling, 1 reply; 24+ messages in thread
From: Michael Krufky @ 2008-04-09 14:45 UTC (permalink / raw)
To: Janne Grunau; +Cc: linux-dvb
(sorry for the double-email -- accidentally sent from the wrong email account)
On Wed, Apr 9, 2008 at 5:21 AM, Janne Grunau <janne-dvb@grunau.be> wrote:
> On Wednesday 09 April 2008 00:22:40 Oliver Endriss wrote:
>
> > Michael Krufky wrote:
> > >
> > > I would really like to see this patch get merged.
> > >
> > > If nobody has an issue with this, I plan to push this into a
> > > mercurial tree at the end of the week and request that it be merged
> > > into the master branch.
> >
> > Correct me if I'm wrong, but afaik the option should be named
> > 'adapter_no', not 'adapter_nr'.
>
> The usual english abbreviation for number is no. OTOH the respective V4L
> options are also called video|radio|vbi _nr, so calling it adapter_nr
> would be consistent with V4L.
>
> I'm not sure which argument is more important but it won't be much work
> to change it o adapter_no.
>
> Janne
I believe that the "nr" abbreviation comes from the German language.
(correct me if I'm wrong)
Perhaps the abbreviation, "no" is more correct, since it is based on
the English language, but to me this is of no significance, since v4l
uses the "nr" abbreviation and this is globally understood.
If Oliver perfers "adapter_no" then lets go with it. Otherwise, it's
fine as-is.
-Mike
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-03-29 21:40 [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try Janne Grunau
2008-03-30 6:02 ` Michael Krufky
@ 2008-04-09 15:07 ` Manu Abraham
2008-04-09 16:00 ` Michael Krufky
1 sibling, 1 reply; 24+ messages in thread
From: Manu Abraham @ 2008-04-09 15:07 UTC (permalink / raw)
To: Janne Grunau; +Cc: linux-dvb
Janne Grunau wrote:
> Hi,
>
> I resubmit this patch since I still think it is a good idea to the this
> driver option. There is still no udev recipe to guaranty stable dvb
> adapter numbers. I've tried to come up with some rules but it's tricky
> due to the multiple device nodes in a subdirectory. I won't claim that
> it is impossible to get udev to assign driver or hardware specific
> stable dvb adapter numbers but I think this patch is easier and more
> clean than a udev based solution.
>
> I'll drop this patch if a simple udev solution is found in a reasonable
> amount of time. But if there is no I would like to see the attached
> patch merged.
As i wrote sometime back, adding adapter numbers to adapters is bad.
In fact, when the kernel advocates udev, working around it is no
solution, but finding the problem and fixing the basic problem is more
important, rather than workarounds.
http://www.gentoo.org/doc/en/udev-guide.xml
http://reactivated.net/writing_udev_rules.html
If there is a general udev issue, it should be taken up with udev and
not working around within adapter drivers.
Regards,
Manu
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-04-09 15:07 ` Manu Abraham
@ 2008-04-09 16:00 ` Michael Krufky
2008-04-09 16:14 ` Rudy Zijlstra
0 siblings, 1 reply; 24+ messages in thread
From: Michael Krufky @ 2008-04-09 16:00 UTC (permalink / raw)
To: Manu Abraham; +Cc: linux-dvb
On Wed, Apr 9, 2008 at 11:07 AM, Manu Abraham <abraham.manu@gmail.com> wrote:
> Janne Grunau wrote:
> > Hi,
> >
> > I resubmit this patch since I still think it is a good idea to the this
> > driver option. There is still no udev recipe to guaranty stable dvb
> > adapter numbers. I've tried to come up with some rules but it's tricky
> > due to the multiple device nodes in a subdirectory. I won't claim that
> > it is impossible to get udev to assign driver or hardware specific
> > stable dvb adapter numbers but I think this patch is easier and more
> > clean than a udev based solution.
> >
> > I'll drop this patch if a simple udev solution is found in a reasonable
> > amount of time. But if there is no I would like to see the attached
> > patch merged.
>
> As i wrote sometime back, adding adapter numbers to adapters is bad.
>
> In fact, when the kernel advocates udev, working around it is no
> solution, but finding the problem and fixing the basic problem is more
> important, rather than workarounds.
>
> http://www.gentoo.org/doc/en/udev-guide.xml
> http://reactivated.net/writing_udev_rules.html
>
> If there is a general udev issue, it should be taken up with udev and
> not working around within adapter drivers.
Regardless of how broken the issue is within udev, udev is not user-friendly.
Under the current situation, users that have media recording servers
that receive broadcasts from differing delivery systems have no way
ensure that they are using the correct device for their recordings.
For instance:
Users might have VSB devices and QAM devices in their system, both to
receive OTA broadcasts and digital cable. Likewise, someone else
might have DVB-S devices and DVB-T devices in the same system.
If said user has VSB devices as adapters 0 and 1, QAM-capable devices
as adapters 2 and 3, and DVB-S devices as adapters 5 and 6, they need
to be able to configure their software to know which device to use
when attempting to receive broadcasts from the respective media type.
The argument that "udev should do this -- fix udev instead" is weak,
in my opinion. Even if udev can be fixed, the understanding of how to
configure it is hopeless.
When support for cx88-alsa and saa7134-alsa appeared, at first, I lost
functionality of my sound card. I fixed the issue by setting my alsa
driver "index" module option for each respecting device in my build
scripts. If I didn't have the ability to rectify that issue, I simply
would have yanked out the conflicting device (ie: use NO video card in
the system) or just reboot into Windows and ditch Linux, altogether.
This is a simple patch that adds the same functionality that v4l and
alsa have -- the ability to declare the adapter number of the device
at attach-time, based on a module option. The change has minimal
impact on the source code, and adds great benefits to the users, and
requires zero maintenance.
The arguments against applying this change are "fix udev instead" and
"we'll have to remove this in kernel 2.7" ... Well, rather than to
have everybody wait around for a "fix" that requires programming
skills in order to use, I say we merge this now, so that people can
use their systems properly TODAY. If we have to remove this in the
future as a result of some other kernel-wide requirements, then we
will cross that bridge when we come to it.
I see absolutely no harm in implementing this feature now.
-Mike
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-04-09 16:00 ` Michael Krufky
@ 2008-04-09 16:14 ` Rudy Zijlstra
2008-04-09 16:30 ` Steven Toth
0 siblings, 1 reply; 24+ messages in thread
From: Rudy Zijlstra @ 2008-04-09 16:14 UTC (permalink / raw)
To: Michael Krufky; +Cc: linux-dvb, Manu Abraham
On Wed, 9 Apr 2008, Michael Krufky wrote:
> On Wed, Apr 9, 2008 at 11:07 AM, Manu Abraham <abraham.manu@gmail.com> wrote:
>> Janne Grunau wrote:
>> > Hi,
>> >
>> > I resubmit this patch since I still think it is a good idea to the this
>> > driver option. There is still no udev recipe to guaranty stable dvb
>> > adapter numbers. I've tried to come up with some rules but it's tricky
>> > due to the multiple device nodes in a subdirectory. I won't claim that
>> > it is impossible to get udev to assign driver or hardware specific
>> > stable dvb adapter numbers but I think this patch is easier and more
>> > clean than a udev based solution.
>> >
>> > I'll drop this patch if a simple udev solution is found in a reasonable
>> > amount of time. But if there is no I would like to see the attached
>> > patch merged.
>>
>> As i wrote sometime back, adding adapter numbers to adapters is bad.
>>
>> In fact, when the kernel advocates udev, working around it is no
>> solution, but finding the problem and fixing the basic problem is more
>> important, rather than workarounds.
>>
>> http://www.gentoo.org/doc/en/udev-guide.xml
>> http://reactivated.net/writing_udev_rules.html
>>
>> If there is a general udev issue, it should be taken up with udev and
>> not working around within adapter drivers.
>
> Regardless of how broken the issue is within udev, udev is not user-friendly.
>
> Under the current situation, users that have media recording servers
> that receive broadcasts from differing delivery systems have no way
> ensure that they are using the correct device for their recordings.
>
> For instance:
>
> Users might have VSB devices and QAM devices in their system, both to
> receive OTA broadcasts and digital cable. Likewise, someone else
> might have DVB-S devices and DVB-T devices in the same system.
>
> If said user has VSB devices as adapters 0 and 1, QAM-capable devices
> as adapters 2 and 3, and DVB-S devices as adapters 5 and 6, they need
> to be able to configure their software to know which device to use
> when attempting to receive broadcasts from the respective media type.
>
> The argument that "udev should do this -- fix udev instead" is weak,
> in my opinion. Even if udev can be fixed, the understanding of how to
> configure it is hopeless.
>
> When support for cx88-alsa and saa7134-alsa appeared, at first, I lost
> functionality of my sound card. I fixed the issue by setting my alsa
> driver "index" module option for each respecting device in my build
> scripts. If I didn't have the ability to rectify that issue, I simply
> would have yanked out the conflicting device (ie: use NO video card in
> the system) or just reboot into Windows and ditch Linux, altogether.
>
> This is a simple patch that adds the same functionality that v4l and
> alsa have -- the ability to declare the adapter number of the device
> at attach-time, based on a module option. The change has minimal
> impact on the source code, and adds great benefits to the users, and
> requires zero maintenance.
>
> The arguments against applying this change are "fix udev instead" and
> "we'll have to remove this in kernel 2.7" ... Well, rather than to
> have everybody wait around for a "fix" that requires programming
> skills in order to use, I say we merge this now, so that people can
> use their systems properly TODAY. If we have to remove this in the
> future as a result of some other kernel-wide requirements, then we
> will cross that bridge when we come to it.
>
> I see absolutely no harm in implementing this feature now.
>
> -Mike
>
+1
For MythTv setups this is very much needed... for the reasons Mike very
clearly stated.
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-04-09 16:14 ` Rudy Zijlstra
@ 2008-04-09 16:30 ` Steven Toth
0 siblings, 0 replies; 24+ messages in thread
From: Steven Toth @ 2008-04-09 16:30 UTC (permalink / raw)
To: linux-dvb; +Cc: Michael Krufky, Manu Abraham
>> The arguments against applying this change are "fix udev instead" and
>> "we'll have to remove this in kernel 2.7" ... Well, rather than to
>> have everybody wait around for a "fix" that requires programming
>> skills in order to use, I say we merge this now, so that people can
>> use their systems properly TODAY. If we have to remove this in the
>> future as a result of some other kernel-wide requirements, then we
>> will cross that bridge when we come to it.
>>
>> I see absolutely no harm in implementing this feature now.
>>
>> -Mike
>>
>
> +1
>
> For MythTv setups this is very much needed... for the reasons Mike very
> clearly stated.
Either someone steps up and writes a bullet proof udev configuration
mechanism for v4l/dvb, or the patches gets merged.
Given that nobody has done the former, I suggest we do the latter.
- Steve
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-04-09 14:45 ` Michael Krufky
@ 2008-04-09 16:50 ` Oliver Endriss
0 siblings, 0 replies; 24+ messages in thread
From: Oliver Endriss @ 2008-04-09 16:50 UTC (permalink / raw)
To: linux-dvb
Michael Krufky wrote:
> (sorry for the double-email -- accidentally sent from the wrong email account)
>
> On Wed, Apr 9, 2008 at 5:21 AM, Janne Grunau <janne-dvb@grunau.be> wrote:
> > On Wednesday 09 April 2008 00:22:40 Oliver Endriss wrote:
> >
> > > Michael Krufky wrote:
> > > >
> > > > I would really like to see this patch get merged.
> > > >
> > > > If nobody has an issue with this, I plan to push this into a
> > > > mercurial tree at the end of the week and request that it be merged
> > > > into the master branch.
> > >
> > > Correct me if I'm wrong, but afaik the option should be named
> > > 'adapter_no', not 'adapter_nr'.
> >
> > The usual english abbreviation for number is no. OTOH the respective V4L
> > options are also called video|radio|vbi _nr, so calling it adapter_nr
> > would be consistent with V4L.
> >
> > I'm not sure which argument is more important but it won't be much work
> > to change it o adapter_no.
> >
> > Janne
>
> I believe that the "nr" abbreviation comes from the German language.
> (correct me if I'm wrong)
Yep.
> Perhaps the abbreviation, "no" is more correct, since it is based on
> the English language, but to me this is of no significance, since v4l
> uses the "nr" abbreviation and this is globally understood.
>
> If Oliver perfers "adapter_no" then lets go with it. Otherwise, it's
> fine as-is.
Basically _I_ don't care at all, but obviously there are some guys who
search the code for typos. I guess they will find this one sooner or
later, and we have to change it anyway.
But if you'd like to use nr it is ok for me.
CU
Oliver
--
----------------------------------------------------------------
VDR Remote Plugin 0.4.0: http://www.escape-edv.de/endriss/vdr/
----------------------------------------------------------------
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-04-08 15:18 ` Michael Krufky
2008-04-08 22:22 ` Oliver Endriss
@ 2008-04-09 19:28 ` Janne Grunau
2008-04-10 1:21 ` Michael Krufky
1 sibling, 1 reply; 24+ messages in thread
From: Janne Grunau @ 2008-04-09 19:28 UTC (permalink / raw)
To: Michael Krufky; +Cc: linux-dvb
[-- Attachment #1: Type: text/plain, Size: 506 bytes --]
On Tuesday 08 April 2008 17:18:10 Michael Krufky wrote:
>
> I would really like to see this patch get merged.
>
> If nobody has an issue with this, I plan to push this into a
> mercurial tree at the end of the week and request that it be merged
> into the master branch.
updated patch attached:
-resolved a reject in the ttusb2 driver
-changed type of the adapter num array from int to short
I didn't changed the module option name since to me consistency with the
V4L options is more important.
Janne
[-- Attachment #2: modoption_adapter_numbers5.diff --]
[-- Type: text/x-diff, Size: 40152 bytes --]
# HG changeset patch
# User janne-dvb@grunau.be
# Date 1207768393 -7200
# Node ID e21afd5f2f5f9665ebba126b7bbc6d9989491cb9
# Parent 6e0ba8a3aa320c1c6a498e3a9d00bd0b674e2456
Adds selectable adapter numbers as per module option
From: Janne Grunau <janne-dvb@grunau.be>
The adapter_nr module options can be used to allocate static adapter numbers
on a driver level. It avoid problems with changing DVB apdapter numbers after
warm/cold boot or device unplugging and repluging.
Each driver holds DVB_MAX_ADAPTER long array of the preffered order of adapter
numbers.
options dvb-usb-dib0700 adapter_nr=7,6,5,4,3,2,1,0 would result in a
reversed allocation of adapter numbers.
With adapter_nr=2,5 it tries first to get adapter number 2 and 5. If
both are already in use it will allocate the lowest free adapter
number.
Signed-off-by: Janne Grunau <janne-dvb@grunau.be>
diff --git a/linux/drivers/media/dvb/b2c2/flexcop.c b/linux/drivers/media/dvb/b2c2/flexcop.c
--- a/linux/drivers/media/dvb/b2c2/flexcop.c
+++ b/linux/drivers/media/dvb/b2c2/flexcop.c
@@ -49,6 +49,8 @@ MODULE_PARM_DESC(debug, "set debug level
MODULE_PARM_DESC(debug, "set debug level (1=info,2=tuner,4=i2c,8=ts,16=sram,32=reg (|-able))." DEBSTATUS);
#undef DEBSTATUS
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
+
/* global zero for ibi values */
flexcop_ibi_value ibi_zero;
@@ -66,8 +68,10 @@ static int flexcop_dvb_stop_feed(struct
static int flexcop_dvb_init(struct flexcop_device *fc)
{
- int ret;
- if ((ret = dvb_register_adapter(&fc->dvb_adapter,"FlexCop Digital TV device",fc->owner,fc->dev)) < 0) {
+ int ret = dvb_register_adapter(&fc->dvb_adapter,
+ "FlexCop Digital TV device", fc->owner,
+ fc->dev, adapter_nr);
+ if (ret < 0) {
err("error registering DVB adapter");
return ret;
}
diff --git a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
--- a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -40,6 +40,8 @@ static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define dprintk( args... ) \
do { \
@@ -718,7 +720,10 @@ static int __devinit dvb_bt8xx_load_card
{
int result;
- if ((result = dvb_register_adapter(&card->dvb_adapter, card->card_name, THIS_MODULE, &card->bt->dev->dev)) < 0) {
+ result = dvb_register_adapter(&card->dvb_adapter, card->card_name,
+ THIS_MODULE, &card->bt->dev->dev,
+ adapter_nr);
+ if (result < 0) {
printk("dvb_bt8xx: dvb_register_adapter failed (errno = %d)\n", result);
return result;
}
diff --git a/linux/drivers/media/dvb/cinergyT2/cinergyT2.c b/linux/drivers/media/dvb/cinergyT2/cinergyT2.c
--- a/linux/drivers/media/dvb/cinergyT2/cinergyT2.c
+++ b/linux/drivers/media/dvb/cinergyT2/cinergyT2.c
@@ -60,6 +60,8 @@ static int debug;
static int debug;
module_param_named(debug, debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
#define dprintk(level, args...) \
@@ -1004,7 +1006,10 @@ static int cinergyt2_probe (struct usb_i
return -ENOMEM;
}
- if ((err = dvb_register_adapter(&cinergyt2->adapter, DRIVER_NAME, THIS_MODULE, &cinergyt2->udev->dev)) < 0) {
+ err = dvb_register_adapter(&cinergyt2->adapter, DRIVER_NAME,
+ THIS_MODULE, &cinergyt2->udev->dev,
+ adapter_nr);
+ if (err < 0) {
kfree(cinergyt2);
return err;
}
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.c b/linux/drivers/media/dvb/dvb-core/dvbdev.c
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c
@@ -52,7 +52,6 @@ static const char * const dnames[] = {
"net", "osd"
};
-#define DVB_MAX_ADAPTERS 8
#define DVB_MAX_IDS 4
#define nums2minor(num,type,id) ((num << 6) | (id << 4) | type)
#define MAX_DVB_MINORS (DVB_MAX_ADAPTERS*64)
@@ -277,18 +276,25 @@ void dvb_unregister_device(struct dvb_de
}
EXPORT_SYMBOL(dvb_unregister_device);
+static int dvbdev_check_free_adapter_num(int num)
+{
+ struct list_head *entry;
+ list_for_each(entry, &dvb_adapter_list) {
+ struct dvb_adapter *adap;
+ adap = list_entry(entry, struct dvb_adapter, list_head);
+ if (adap->num == num)
+ return 0;
+ }
+ return 1;
+}
static int dvbdev_get_free_adapter_num (void)
{
int num = 0;
while (num < DVB_MAX_ADAPTERS) {
- struct dvb_adapter *adap;
- list_for_each_entry(adap, &dvb_adapter_list, list_head)
- if (adap->num == num)
- goto skip;
- return num;
-skip:
+ if (dvbdev_check_free_adapter_num(num))
+ return num;
num++;
}
@@ -296,13 +302,28 @@ skip:
}
-int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct module *module, struct device *device)
+int dvb_register_adapter(struct dvb_adapter *adap, const char *name,
+ struct module *module, struct device *device,
+ short *adapter_nums)
{
- int num;
+ int i, num;
mutex_lock(&dvbdev_register_lock);
- if ((num = dvbdev_get_free_adapter_num ()) < 0) {
+ for (i = 0; i < DVB_MAX_ADAPTERS; ++i) {
+ num = adapter_nums[i];
+ if (num >= 0 && num < DVB_MAX_ADAPTERS) {
+ /* use the one the driver asked for */
+ if (dvbdev_check_free_adapter_num(num))
+ break;
+ } else {
+ num = dvbdev_get_free_adapter_num();
+ break;
+ }
+ num = -1;
+ }
+
+ if (num < 0) {
mutex_unlock(&dvbdev_register_lock);
return -ENFILE;
}
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.h b/linux/drivers/media/dvb/dvb-core/dvbdev.h
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.h
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.h
@@ -31,6 +31,10 @@
#define DVB_MAJOR 212
+#define DVB_MAX_ADAPTERS 8
+
+#define DVB_UNSET (-1)
+
#define DVB_DEVICE_VIDEO 0
#define DVB_DEVICE_AUDIO 1
#define DVB_DEVICE_SEC 2
@@ -41,6 +45,11 @@
#define DVB_DEVICE_NET 7
#define DVB_DEVICE_OSD 8
+#define DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr) \
+ static short adapter_nr[] = \
+ {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET }; \
+ module_param_array(adapter_nr, short, NULL, 0444); \
+ MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers")
struct dvb_adapter {
int num;
@@ -78,7 +87,9 @@ struct dvb_device {
};
-extern int dvb_register_adapter (struct dvb_adapter *adap, const char *name, struct module *module, struct device *device);
+extern int dvb_register_adapter(struct dvb_adapter *adap, const char *name,
+ struct module *module, struct device *device,
+ short *adapter_nums);
extern int dvb_unregister_adapter (struct dvb_adapter *adap);
extern int dvb_register_device (struct dvb_adapter *adap,
diff --git a/linux/drivers/media/dvb/dvb-usb/a800.c b/linux/drivers/media/dvb/dvb-usb/a800.c
--- a/linux/drivers/media/dvb/dvb-usb/a800.c
+++ b/linux/drivers/media/dvb/dvb-usb/a800.c
@@ -18,6 +18,9 @@ static int debug;
static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (rc=1 (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
+
#define deb_rc(args...) dprintk(debug,0x01,args)
static int a800_power_ctrl(struct dvb_usb_device *d, int onoff)
@@ -94,7 +97,8 @@ static int a800_probe(struct usb_interfa
static int a800_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&a800_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf, &a800_properties, THIS_MODULE, NULL,
+ adapter_nr);
}
/* do not change the order of the ID table */
diff --git a/linux/drivers/media/dvb/dvb-usb/af9005.c b/linux/drivers/media/dvb/dvb-usb/af9005.c
--- a/linux/drivers/media/dvb/dvb-usb/af9005.c
+++ b/linux/drivers/media/dvb/dvb-usb/af9005.c
@@ -38,6 +38,8 @@ int dvb_usb_af9005_dump_eeprom = 0;
int dvb_usb_af9005_dump_eeprom = 0;
module_param_named(dump_eeprom, dvb_usb_af9005_dump_eeprom, int, 0);
MODULE_PARM_DESC(dump_eeprom, "dump contents of the eeprom.");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
/* remote control decoder */
int (*rc_decode) (struct dvb_usb_device * d, u8 * data, int len, u32 * event,
@@ -1020,7 +1022,8 @@ static int af9005_usb_probe(struct usb_i
static int af9005_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf, &af9005_properties, THIS_MODULE, NULL);
+ return dvb_usb_device_init(intf, &af9005_properties, THIS_MODULE, NULL,
+ adapter_nr);
}
static struct usb_device_id af9005_usb_table[] = {
diff --git a/linux/drivers/media/dvb/dvb-usb/au6610.c b/linux/drivers/media/dvb/dvb-usb/au6610.c
--- a/linux/drivers/media/dvb/dvb-usb/au6610.c
+++ b/linux/drivers/media/dvb/dvb-usb/au6610.c
@@ -18,6 +18,8 @@ static int dvb_usb_au6610_debug;
static int dvb_usb_au6610_debug;
module_param_named(debug, dvb_usb_au6610_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static int au6610_usb_msg(struct dvb_usb_device *d, u8 operation, u8 addr,
u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen)
@@ -163,7 +165,9 @@ static int au6610_probe(struct usb_inter
if (intf->num_altsetting < AU6610_ALTSETTING_COUNT)
return -ENODEV;
- if ((ret = dvb_usb_device_init(intf, &au6610_properties, THIS_MODULE, &d)) == 0) {
+ ret = dvb_usb_device_init(intf, &au6610_properties, THIS_MODULE, &d,
+ adapter_nr);
+ if (ret == 0) {
alt = usb_altnum_to_altsetting(intf, AU6610_ALTSETTING);
if (alt == NULL) {
diff --git a/linux/drivers/media/dvb/dvb-usb/cxusb.c b/linux/drivers/media/dvb/dvb-usb/cxusb.c
--- a/linux/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/linux/drivers/media/dvb/dvb-usb/cxusb.c
@@ -40,6 +40,9 @@ static int dvb_usb_cxusb_debug;
static int dvb_usb_cxusb_debug;
module_param_named(debug, dvb_usb_cxusb_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
+
#define deb_info(args...) dprintk(dvb_usb_cxusb_debug,0x01,args)
#define deb_i2c(args...) if (d->udev->descriptor.idVendor == USB_VID_MEDION) \
dprintk(dvb_usb_cxusb_debug,0x01,args)
@@ -723,16 +726,24 @@ static int cxusb_probe(struct usb_interf
static int cxusb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_lgh064f_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_lgz201_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_dtt7579_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_dualdig4_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_nano2_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&cxusb_bluebird_nano2_needsfirmware_properties,THIS_MODULE,NULL) == 0) {
+ if (0 == dvb_usb_device_init(intf, &cxusb_medion_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &cxusb_bluebird_lgh064f_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &cxusb_bluebird_dee1601_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &cxusb_bluebird_lgz201_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &cxusb_bluebird_dtt7579_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &cxusb_bluebird_dualdig4_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &cxusb_bluebird_nano2_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf,
+ &cxusb_bluebird_nano2_needsfirmware_properties,
+ THIS_MODULE, NULL, adapter_nr))
return 0;
- }
return -EINVAL;
}
diff --git a/linux/drivers/media/dvb/dvb-usb/dib0700_core.c b/linux/drivers/media/dvb/dvb-usb/dib0700_core.c
--- a/linux/drivers/media/dvb/dvb-usb/dib0700_core.c
+++ b/linux/drivers/media/dvb/dvb-usb/dib0700_core.c
@@ -16,6 +16,8 @@ int dvb_usb_dib0700_ir_proto = 1;
int dvb_usb_dib0700_ir_proto = 1;
module_param(dvb_usb_dib0700_ir_proto, int, 0644);
MODULE_PARM_DESC(dvb_usb_dib0700_ir_proto, "set ir protocol (0=NEC, 1=RC5 (default), 2=RC6).");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
/* expecting rx buffer: request data[0] data[1] ... data[2] */
static int dib0700_ctrl_wr(struct dvb_usb_device *d, u8 *tx, u8 txlen)
@@ -289,7 +291,8 @@ static int dib0700_probe(struct usb_inte
#endif
for (i = 0; i < dib0700_device_count; i++)
- if (dvb_usb_device_init(intf, &dib0700_devices[i], THIS_MODULE, &dev) == 0)
+ if (dvb_usb_device_init(intf, &dib0700_devices[i], THIS_MODULE,
+ &dev, adapter_nr) == 0)
{
dib0700_rc_setup(dev);
return 0;
diff --git a/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c b/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c
--- a/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c
+++ b/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c
@@ -13,6 +13,8 @@
* see Documentation/dvb/README.dvb-usb for more information
*/
#include "dibusb.h"
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static int dib3000mb_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
{
@@ -107,10 +109,14 @@ static int dibusb_probe(struct usb_inter
static int dibusb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- if (dvb_usb_device_init(intf,&dibusb1_1_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&dibusb1_1_an2235_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&dibusb2_0b_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&artec_t1_usb2_properties,THIS_MODULE,NULL) == 0)
+ if (0 == dvb_usb_device_init(intf, &dibusb1_1_properties, THIS_MODULE,
+ NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &dibusb1_1_an2235_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &dibusb2_0b_properties, THIS_MODULE,
+ NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &artec_t1_usb2_properties,
+ THIS_MODULE, NULL, adapter_nr))
return 0;
return -EINVAL;
diff --git a/linux/drivers/media/dvb/dvb-usb/dibusb-mc.c b/linux/drivers/media/dvb/dvb-usb/dibusb-mc.c
--- a/linux/drivers/media/dvb/dvb-usb/dibusb-mc.c
+++ b/linux/drivers/media/dvb/dvb-usb/dibusb-mc.c
@@ -14,13 +14,16 @@
*/
#include "dibusb.h"
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
+
/* USB Driver stuff */
static struct dvb_usb_device_properties dibusb_mc_properties;
static int dibusb_mc_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&dibusb_mc_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf, &dibusb_mc_properties, THIS_MODULE,
+ NULL, adapter_nr);
}
/* do not change the order of the ID table */
diff --git a/linux/drivers/media/dvb/dvb-usb/digitv.c b/linux/drivers/media/dvb/dvb-usb/digitv.c
--- a/linux/drivers/media/dvb/dvb-usb/digitv.c
+++ b/linux/drivers/media/dvb/dvb-usb/digitv.c
@@ -20,6 +20,9 @@ static int dvb_usb_digitv_debug;
static int dvb_usb_digitv_debug;
module_param_named(debug,dvb_usb_digitv_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
+
#define deb_rc(args...) dprintk(dvb_usb_digitv_debug,0x01,args)
static int digitv_ctrl_msg(struct dvb_usb_device *d,
@@ -256,8 +259,9 @@ static int digitv_probe(struct usb_inter
const struct usb_device_id *id)
{
struct dvb_usb_device *d;
- int ret;
- if ((ret = dvb_usb_device_init(intf,&digitv_properties,THIS_MODULE,&d)) == 0) {
+ int ret = dvb_usb_device_init(intf, &digitv_properties, THIS_MODULE, &d,
+ adapter_nr);
+ if (ret == 0) {
u8 b[4] = { 0 };
if (d != NULL) { /* do that only when the firmware is loaded */
diff --git a/linux/drivers/media/dvb/dvb-usb/dtt200u.c b/linux/drivers/media/dvb/dvb-usb/dtt200u.c
--- a/linux/drivers/media/dvb/dvb-usb/dtt200u.c
+++ b/linux/drivers/media/dvb/dvb-usb/dtt200u.c
@@ -17,6 +17,8 @@ int dvb_usb_dtt200u_debug;
int dvb_usb_dtt200u_debug;
module_param_named(debug,dvb_usb_dtt200u_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2 (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static int dtt200u_power_ctrl(struct dvb_usb_device *d, int onoff)
{
@@ -101,11 +103,16 @@ static int dtt200u_usb_probe(struct usb_
static int dtt200u_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- if (dvb_usb_device_init(intf,&dtt200u_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&wt220u_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&wt220u_fc_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&wt220u_zl0353_properties,THIS_MODULE,NULL) == 0 ||
- dvb_usb_device_init(intf,&wt220u_miglia_properties,THIS_MODULE,NULL) == 0)
+ if (0 == dvb_usb_device_init(intf, &dtt200u_properties, THIS_MODULE,
+ NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &wt220u_properties, THIS_MODULE,
+ NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &wt220u_fc_properties, THIS_MODULE,
+ NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &wt220u_zl0353_properties,
+ THIS_MODULE, NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &wt220u_miglia_properties,
+ THIS_MODULE, NULL, adapter_nr))
return 0;
return -ENODEV;
diff --git a/linux/drivers/media/dvb/dvb-usb/dvb-usb-common.h b/linux/drivers/media/dvb/dvb-usb/dvb-usb-common.h
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-common.h
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-common.h
@@ -40,7 +40,8 @@ extern int dvb_usb_i2c_init(struct dvb_u
extern int dvb_usb_i2c_init(struct dvb_usb_device *);
extern int dvb_usb_i2c_exit(struct dvb_usb_device *);
-extern int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap);
+extern int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap,
+ short *adapter_nums);
extern int dvb_usb_adapter_dvb_exit(struct dvb_usb_adapter *adap);
extern int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap);
extern int dvb_usb_adapter_frontend_exit(struct dvb_usb_adapter *adap);
diff --git a/linux/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c b/linux/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
@@ -77,12 +77,13 @@ static int dvb_usb_stop_feed(struct dvb_
return dvb_usb_ctrl_feed(dvbdmxfeed,0);
}
-int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap)
+int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap, short *adapter_nums)
{
- int ret;
+ int ret = dvb_register_adapter(&adap->dvb_adap, adap->dev->desc->name,
+ adap->dev->owner, &adap->dev->udev->dev,
+ adapter_nums);
- if ((ret = dvb_register_adapter(&adap->dvb_adap, adap->dev->desc->name,
- adap->dev->owner, &adap->dev->udev->dev)) < 0) {
+ if (ret < 0) {
deb_info("dvb_register_adapter failed: error %d", ret);
goto err;
}
diff --git a/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c b/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c
@@ -26,7 +26,7 @@ module_param_named(force_pid_filter_usag
module_param_named(force_pid_filter_usage, dvb_usb_force_pid_filter_usage, int, 0444);
MODULE_PARM_DESC(force_pid_filter_usage, "force all dvb-usb-devices to use a PID filter, if any (default: 0).");
-static int dvb_usb_adapter_init(struct dvb_usb_device *d)
+static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
{
struct dvb_usb_adapter *adap;
int ret,n;
@@ -72,7 +72,7 @@ static int dvb_usb_adapter_init(struct d
}
if ((ret = dvb_usb_adapter_stream_init(adap)) ||
- (ret = dvb_usb_adapter_dvb_init(adap)) ||
+ (ret = dvb_usb_adapter_dvb_init(adap, adapter_nrs)) ||
(ret = dvb_usb_adapter_frontend_init(adap))) {
return ret;
}
@@ -122,7 +122,7 @@ static int dvb_usb_exit(struct dvb_usb_d
return 0;
}
-static int dvb_usb_init(struct dvb_usb_device *d)
+static int dvb_usb_init(struct dvb_usb_device *d, short *adapter_nums)
{
int ret = 0;
@@ -143,7 +143,7 @@ static int dvb_usb_init(struct dvb_usb_d
dvb_usb_device_power_ctrl(d, 1);
if ((ret = dvb_usb_i2c_init(d)) ||
- (ret = dvb_usb_adapter_init(d))) {
+ (ret = dvb_usb_adapter_init(d, adapter_nums))) {
dvb_usb_exit(d);
return ret;
}
@@ -213,8 +213,10 @@ int dvb_usb_device_power_ctrl(struct dvb
/*
* USB
*/
-int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_device_properties
- *props, struct module *owner,struct dvb_usb_device **du)
+int dvb_usb_device_init(struct usb_interface *intf,
+ struct dvb_usb_device_properties *props,
+ struct module *owner, struct dvb_usb_device **du,
+ short *adapter_nums)
{
struct usb_device *udev = interface_to_usbdev(intf);
struct dvb_usb_device *d = NULL;
@@ -254,7 +256,7 @@ int dvb_usb_device_init(struct usb_inter
if (du != NULL)
*du = d;
- ret = dvb_usb_init(d);
+ ret = dvb_usb_init(d, adapter_nums);
if (ret == 0)
info("%s successfully initialized and connected.",desc->name);
diff --git a/linux/drivers/media/dvb/dvb-usb/dvb-usb.h b/linux/drivers/media/dvb/dvb-usb/dvb-usb.h
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb.h
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb.h
@@ -387,7 +387,10 @@ struct dvb_usb_device {
void *priv;
};
-extern int dvb_usb_device_init(struct usb_interface *, struct dvb_usb_device_properties *, struct module *, struct dvb_usb_device **);
+extern int dvb_usb_device_init(struct usb_interface *,
+ struct dvb_usb_device_properties *,
+ struct module *, struct dvb_usb_device **,
+ short *adapter_nums);
extern void dvb_usb_device_exit(struct usb_interface *);
/* the generic read/write method for device control */
diff --git a/linux/drivers/media/dvb/dvb-usb/gl861.c b/linux/drivers/media/dvb/dvb-usb/gl861.c
--- a/linux/drivers/media/dvb/dvb-usb/gl861.c
+++ b/linux/drivers/media/dvb/dvb-usb/gl861.c
@@ -15,6 +15,8 @@ static int dvb_usb_gl861_debug;
static int dvb_usb_gl861_debug;
module_param_named(debug,dvb_usb_gl861_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static int gl861_i2c_msg(struct dvb_usb_device *d, u8 addr,
u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen)
@@ -140,7 +142,9 @@ static int gl861_probe(struct usb_interf
if (intf->num_altsetting < 2)
return -ENODEV;
- if ((ret = dvb_usb_device_init(intf, &gl861_properties, THIS_MODULE, &d)) == 0) {
+ ret = dvb_usb_device_init(intf, &gl861_properties, THIS_MODULE, &d,
+ adapter_nr);
+ if (ret == 0) {
alt = usb_altnum_to_altsetting(intf, 0);
if (alt == NULL) {
diff --git a/linux/drivers/media/dvb/dvb-usb/gp8psk.c b/linux/drivers/media/dvb/dvb-usb/gp8psk.c
--- a/linux/drivers/media/dvb/dvb-usb/gp8psk.c
+++ b/linux/drivers/media/dvb/dvb-usb/gp8psk.c
@@ -21,6 +21,8 @@ int dvb_usb_gp8psk_debug;
int dvb_usb_gp8psk_debug;
module_param_named(debug,dvb_usb_gp8psk_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
int gp8psk_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen)
{
@@ -208,7 +210,8 @@ static int gp8psk_usb_probe(struct usb_i
{
int ret;
struct usb_device *udev = interface_to_usbdev(intf);
- ret = dvb_usb_device_init(intf,&gp8psk_properties,THIS_MODULE,NULL);
+ ret = dvb_usb_device_init(intf, &gp8psk_properties, THIS_MODULE, NULL,
+ adapter_nr);
if (ret == 0) {
info("found Genpix USB device pID = %x (hex)",
le16_to_cpu(udev->descriptor.idProduct));
diff --git a/linux/drivers/media/dvb/dvb-usb/m920x.c b/linux/drivers/media/dvb/dvb-usb/m920x.c
--- a/linux/drivers/media/dvb/dvb-usb/m920x.c
+++ b/linux/drivers/media/dvb/dvb-usb/m920x.c
@@ -21,6 +21,8 @@ static int dvb_usb_m920x_debug;
static int dvb_usb_m920x_debug;
module_param_named(debug,dvb_usb_m920x_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static int m920x_set_filter(struct dvb_usb_device *d, int type, int idx, int pid);
@@ -618,27 +620,31 @@ static int m920x_probe(struct usb_interf
* multi-tuner device
*/
- if ((ret = dvb_usb_device_init(intf, &megasky_properties,
- THIS_MODULE, &d)) == 0) {
+ ret = dvb_usb_device_init(intf, &megasky_properties,
+ THIS_MODULE, &d, adapter_nr);
+ if (ret == 0) {
rc_init_seq = megasky_rc_init;
goto found;
}
- if ((ret = dvb_usb_device_init(intf, &digivox_mini_ii_properties,
- THIS_MODULE, &d)) == 0) {
+ ret = dvb_usb_device_init(intf, &digivox_mini_ii_properties,
+ THIS_MODULE, &d, adapter_nr);
+ if (ret == 0) {
/* No remote control, so no rc_init_seq */
goto found;
}
/* This configures both tuners on the TV Walker Twin */
- if ((ret = dvb_usb_device_init(intf, &tvwalkertwin_properties,
- THIS_MODULE, &d)) == 0) {
+ ret = dvb_usb_device_init(intf, &tvwalkertwin_properties,
+ THIS_MODULE, &d, adapter_nr);
+ if (ret == 0) {
rc_init_seq = tvwalkertwin_rc_init;
goto found;
}
- if ((ret = dvb_usb_device_init(intf, &dposh_properties,
- THIS_MODULE, &d)) == 0) {
+ ret = dvb_usb_device_init(intf, &dposh_properties,
+ THIS_MODULE, &d, adapter_nr);
+ if (ret == 0) {
/* Remote controller not supported yet. */
goto found;
}
diff --git a/linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c b/linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c
--- a/linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c
+++ b/linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c
@@ -14,6 +14,8 @@ static int debug;
static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=rc,2=eeprom (|-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define deb_rc(args...) dprintk(debug,0x01,args)
#define deb_ee(args...) dprintk(debug,0x02,args)
@@ -142,7 +144,8 @@ static int nova_t_probe(struct usb_inter
static int nova_t_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&nova_t_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf, &nova_t_properties, THIS_MODULE, NULL,
+ adapter_nr);
}
/* do not change the order of the ID table */
diff --git a/linux/drivers/media/dvb/dvb-usb/opera1.c b/linux/drivers/media/dvb/dvb-usb/opera1.c
--- a/linux/drivers/media/dvb/dvb-usb/opera1.c
+++ b/linux/drivers/media/dvb/dvb-usb/opera1.c
@@ -45,6 +45,9 @@ MODULE_PARM_DESC(debug,
MODULE_PARM_DESC(debug,
"set debugging level (1=info,xfer=2,pll=4,ts=8,err=16,rc=32,fw=64 (or-able))."
DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
+
#if 0
struct mutex mymutex;
#endif
@@ -559,7 +562,8 @@ static int opera1_probe(struct usb_inter
return -EINVAL;
}
- if (dvb_usb_device_init(intf, &opera1_properties, THIS_MODULE, NULL) != 0)
+ if (0 != dvb_usb_device_init(intf, &opera1_properties, THIS_MODULE,
+ NULL, adapter_nr))
return -EINVAL;
return 0;
}
diff --git a/linux/drivers/media/dvb/dvb-usb/ttusb2.c b/linux/drivers/media/dvb/dvb-usb/ttusb2.c
--- a/linux/drivers/media/dvb/dvb-usb/ttusb2.c
+++ b/linux/drivers/media/dvb/dvb-usb/ttusb2.c
@@ -36,6 +36,8 @@ static int dvb_usb_ttusb2_debug;
#define deb_info(args...) dprintk(dvb_usb_ttusb2_debug,0x01,args)
module_param_named(debug,dvb_usb_ttusb2_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
struct ttusb2_state {
u8 id;
@@ -187,8 +189,10 @@ static int ttusb2_probe(struct usb_inter
static int ttusb2_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- if (dvb_usb_device_init(intf, &ttusb2_properties, THIS_MODULE, NULL) == 0 ||
- dvb_usb_device_init(intf, &ttusb2_properties_s2400, THIS_MODULE, NULL) == 0)
+ if (0 == dvb_usb_device_init(intf, &ttusb2_properties, THIS_MODULE,
+ NULL, adapter_nr) ||
+ 0 == dvb_usb_device_init(intf, &ttusb2_properties_s2400,
+ THIS_MODULE, NULL, adapter_nr))
return 0;
return -ENODEV;
}
diff --git a/linux/drivers/media/dvb/dvb-usb/umt-010.c b/linux/drivers/media/dvb/dvb-usb/umt-010.c
--- a/linux/drivers/media/dvb/dvb-usb/umt-010.c
+++ b/linux/drivers/media/dvb/dvb-usb/umt-010.c
@@ -12,6 +12,8 @@
#include "dibusb.h"
#include "mt352.h"
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static int umt_mt352_demod_init(struct dvb_frontend *fe)
{
@@ -75,7 +77,8 @@ static int umt_probe(struct usb_interfac
static int umt_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- if (dvb_usb_device_init(intf,&umt_properties,THIS_MODULE,NULL) == 0)
+ if (0 == dvb_usb_device_init(intf, &umt_properties, THIS_MODULE, NULL,
+ adapter_nr))
return 0;
return -EINVAL;
}
diff --git a/linux/drivers/media/dvb/dvb-usb/vp702x.c b/linux/drivers/media/dvb/dvb-usb/vp702x.c
--- a/linux/drivers/media/dvb/dvb-usb/vp702x.c
+++ b/linux/drivers/media/dvb/dvb-usb/vp702x.c
@@ -20,6 +20,8 @@ int dvb_usb_vp702x_debug;
int dvb_usb_vp702x_debug;
module_param_named(debug,dvb_usb_vp702x_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
struct vp702x_state {
int pid_filter_count;
@@ -285,7 +287,8 @@ static int vp702x_usb_probe(struct usb_i
static int vp702x_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&vp702x_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf, &vp702x_properties, THIS_MODULE, NULL,
+ adapter_nr);
}
static struct usb_device_id vp702x_usb_table [] = {
diff --git a/linux/drivers/media/dvb/dvb-usb/vp7045.c b/linux/drivers/media/dvb/dvb-usb/vp7045.c
--- a/linux/drivers/media/dvb/dvb-usb/vp7045.c
+++ b/linux/drivers/media/dvb/dvb-usb/vp7045.c
@@ -18,6 +18,9 @@ static int dvb_usb_vp7045_debug;
static int dvb_usb_vp7045_debug;
module_param_named(debug,dvb_usb_vp7045_debug, int, 0644);
MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS);
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
+
#define deb_info(args...) dprintk(dvb_usb_vp7045_debug,0x01,args)
#define deb_xfer(args...) dprintk(dvb_usb_vp7045_debug,0x02,args)
#define deb_rc(args...) dprintk(dvb_usb_vp7045_debug,0x04,args)
@@ -227,7 +230,8 @@ static int vp7045_usb_probe(struct usb_i
static int vp7045_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
- return dvb_usb_device_init(intf,&vp7045_properties,THIS_MODULE,NULL);
+ return dvb_usb_device_init(intf, &vp7045_properties, THIS_MODULE, NULL,
+ adapter_nr);
}
static struct usb_device_id vp7045_usb_table [] = {
diff --git a/linux/drivers/media/dvb/pluto2/pluto2.c b/linux/drivers/media/dvb/pluto2/pluto2.c
--- a/linux/drivers/media/dvb/pluto2/pluto2.c
+++ b/linux/drivers/media/dvb/pluto2/pluto2.c
@@ -38,6 +38,8 @@
#include "dvb_net.h"
#include "dvbdev.h"
#include "tda1004x.h"
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define DRIVER_NAME "pluto2"
@@ -666,7 +668,8 @@ static int __devinit pluto2_probe(struct
goto err_pluto_hw_exit;
/* dvb */
- ret = dvb_register_adapter(&pluto->dvb_adapter, DRIVER_NAME, THIS_MODULE, &pdev->dev);
+ ret = dvb_register_adapter(&pluto->dvb_adapter, DRIVER_NAME,
+ THIS_MODULE, &pdev->dev, adapter_nr);
if (ret < 0)
goto err_i2c_del_adapter;
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c
--- a/linux/drivers/media/dvb/ttpci/av7110.c
+++ b/linux/drivers/media/dvb/ttpci/av7110.c
@@ -111,6 +111,8 @@ MODULE_PARM_DESC(wss_cfg_16_9, "WSS 16:9
MODULE_PARM_DESC(wss_cfg_16_9, "WSS 16:9 - default 0x0007 - bit 15: disable, 14: burst mode, 13..0: wss data");
module_param(tv_standard, int, 0444);
MODULE_PARM_DESC(tv_standard, "TV standard: 0 PAL (default), 1 NTSC");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static void restart_feeds(struct av7110 *av7110);
@@ -2461,7 +2463,7 @@ static int __devinit av7110_attach(struc
goto err_kfree_0;
ret = dvb_register_adapter(&av7110->dvb_adapter, av7110->card_name,
- THIS_MODULE, &dev->pci->dev);
+ THIS_MODULE, &dev->pci->dev, adapter_nr);
if (ret < 0)
goto err_put_firmware_1;
diff --git a/linux/drivers/media/dvb/ttpci/budget-core.c b/linux/drivers/media/dvb/ttpci/budget-core.c
--- a/linux/drivers/media/dvb/ttpci/budget-core.c
+++ b/linux/drivers/media/dvb/ttpci/budget-core.c
@@ -56,6 +56,8 @@ module_param_named(bufsize, dma_buffer_s
module_param_named(bufsize, dma_buffer_size, int, 0444);
MODULE_PARM_DESC(debug, "Turn on/off budget debugging (default:off).");
MODULE_PARM_DESC(bufsize, "DMA buffer size in KB, default: 188, min: 188, max: 1410 (Activy: 564)");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
/****************************************************************************
* TT budget / WinTV Nova
@@ -471,9 +473,10 @@ int ttpci_budget_init(struct budget *bud
budget->buffer_width, budget->buffer_height);
printk("%s: dma buffer size %u\n", budget->dev->name, budget->buffer_size);
- if ((ret = dvb_register_adapter(&budget->dvb_adapter, budget->card->name, owner, &budget->dev->pci->dev)) < 0) {
+ ret = dvb_register_adapter(&budget->dvb_adapter, budget->card->name,
+ owner, &budget->dev->pci->dev, adapter_nr);
+ if (ret < 0)
return ret;
- }
/* set dd1 stream a & b */
saa7146_write(dev, DD1_STREAM_B, 0x00000000);
diff --git a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
--- a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -59,9 +59,10 @@
*/
static int debug;
-
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define dprintk(x...) do { if (debug) printk(KERN_DEBUG x); } while (0)
@@ -1681,7 +1682,10 @@ static int ttusb_probe(struct usb_interf
mutex_unlock(&ttusb->semi2c);
- if ((result = dvb_register_adapter(&ttusb->adapter, "Technotrend/Hauppauge Nova-USB", THIS_MODULE, &udev->dev)) < 0) {
+ result = dvb_register_adapter(&ttusb->adapter,
+ "Technotrend/Hauppauge Nova-USB",
+ THIS_MODULE, &udev->dev, adapter_nr);
+ if (result < 0) {
ttusb_free_iso_urbs(ttusb);
kfree(ttusb);
return result;
diff --git a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
--- a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
+++ b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
@@ -54,6 +54,8 @@ MODULE_PARM_DESC(output_pva, "Output PVA
MODULE_PARM_DESC(output_pva, "Output PVA from dvr device (default:off)");
module_param(enable_rc, int, 0644);
MODULE_PARM_DESC(enable_rc, "Turn on/off IR remote control(default: off)");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define dprintk if (debug) printk
@@ -1456,7 +1458,9 @@ static int ttusb_dec_init_dvb(struct ttu
dprintk("%s\n", __FUNCTION__);
if ((result = dvb_register_adapter(&dec->adapter,
- dec->model_name, THIS_MODULE, &dec->udev->dev)) < 0) {
+ dec->model_name, THIS_MODULE,
+ &dec->udev->dev,
+ adapter_nr)) < 0) {
printk("%s: dvb_register_adapter failed: error %d\n",
__FUNCTION__, result);
diff --git a/linux/drivers/media/video/cx23885/cx23885-dvb.c b/linux/drivers/media/video/cx23885/cx23885-dvb.c
--- a/linux/drivers/media/video/cx23885/cx23885-dvb.c
+++ b/linux/drivers/media/video/cx23885/cx23885-dvb.c
@@ -54,6 +54,8 @@ static unsigned int alt_tuner;
static unsigned int alt_tuner;
module_param(alt_tuner, int, 0644);
MODULE_PARM_DESC(alt_tuner, "Enable alternate tuner configuration");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
/* ------------------------------------------------------------------ */
@@ -334,7 +336,7 @@ static int dvb_register(struct cx23885_t
/* register everything */
return videobuf_dvb_register(&port->dvb, THIS_MODULE, port,
- &dev->pci->dev);
+ &dev->pci->dev, adapter_nr);
}
int cx23885_dvb_register(struct cx23885_tsport *port)
diff --git a/linux/drivers/media/video/cx88/cx88-dvb.c b/linux/drivers/media/video/cx88/cx88-dvb.c
--- a/linux/drivers/media/video/cx88/cx88-dvb.c
+++ b/linux/drivers/media/video/cx88/cx88-dvb.c
@@ -58,6 +58,8 @@ static unsigned int debug;
static unsigned int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug,"enable debug messages [dvb]");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define dprintk(level,fmt, arg...) if (debug >= level) \
printk(KERN_DEBUG "%s/2-dvb: " fmt, core->name, ## arg)
@@ -869,7 +871,8 @@ static int dvb_register(struct cx8802_de
cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL);
/* register everything */
- return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, &dev->pci->dev);
+ return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev,
+ &dev->pci->dev, adapter_nr);
}
/* ----------------------------------------------------------- */
diff --git a/linux/drivers/media/video/saa7134/saa7134-dvb.c b/linux/drivers/media/video/saa7134/saa7134-dvb.c
--- a/linux/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/linux/drivers/media/video/saa7134/saa7134-dvb.c
@@ -64,6 +64,8 @@ static int debug;
static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off module debugging (default:off).");
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define dprintk(fmt, arg...) do { if (debug) \
printk(KERN_DEBUG "%s/dvb: " fmt, dev->name , ## arg); } while(0)
@@ -1264,7 +1266,8 @@ static int dvb_init(struct saa7134_dev *
}
/* register everything else */
- ret = videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, &dev->pci->dev);
+ ret = videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, &dev->pci->dev,
+ adapter_nr);
/* this sequence is necessary to make the tda1004x load its firmware
* and to enter analog mode of hybrid boards
diff --git a/linux/drivers/media/video/videobuf-dvb.c b/linux/drivers/media/video/videobuf-dvb.c
--- a/linux/drivers/media/video/videobuf-dvb.c
+++ b/linux/drivers/media/video/videobuf-dvb.c
@@ -144,14 +144,16 @@ int videobuf_dvb_register(struct videobu
int videobuf_dvb_register(struct videobuf_dvb *dvb,
struct module *module,
void *adapter_priv,
- struct device *device)
+ struct device *device,
+ short *adapter_nr)
{
int result;
mutex_init(&dvb->lock);
/* register adapter */
- result = dvb_register_adapter(&dvb->adapter, dvb->name, module, device);
+ result = dvb_register_adapter(&dvb->adapter, dvb->name, module, device,
+ adapter_nr);
if (result < 0) {
printk(KERN_WARNING "%s: dvb_register_adapter failed (errno = %d)\n",
dvb->name, result);
diff --git a/linux/include/media/videobuf-dvb.h b/linux/include/media/videobuf-dvb.h
--- a/linux/include/media/videobuf-dvb.h
+++ b/linux/include/media/videobuf-dvb.h
@@ -35,7 +35,8 @@ int videobuf_dvb_register(struct videobu
int videobuf_dvb_register(struct videobuf_dvb *dvb,
struct module *module,
void *adapter_priv,
- struct device *device);
+ struct device *device,
+ short *adapter_nr);
void videobuf_dvb_unregister(struct videobuf_dvb *dvb);
/*
[-- Attachment #3: Type: text/plain, Size: 150 bytes --]
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-04-09 14:44 ` Michael Krufky
@ 2008-04-09 23:25 ` Nick Andrew
2008-04-09 23:44 ` Nick Andrew
0 siblings, 1 reply; 24+ messages in thread
From: Nick Andrew @ 2008-04-09 23:25 UTC (permalink / raw)
To: Michael Krufky; +Cc: linux-dvb
On Wed, Apr 09, 2008 at 10:44:23AM -0400, Michael Krufky wrote:
> I believe that the "nr" abbreviation comes from the German language.
> (correct me if I'm wrong)
It also works in English as an abbreviation of NumbeR.
> Perhaps the abbreviation, "no" is more correct, since it is based on
> the English language, but to me this is of no significance, since v4l
> uses the "nr" abbreviation and this is globally understood.
I personally prefer 'nr' as an abbreviation for 'number' because it
uses letters in the word whereas with 'no' we have no bar to go under
the 'o' which is the correct printed form of the abbreviation. Also
'no' can be confused with the english word No.
However the complete kernel source uses '_no' about twice as much as
'_nr' and so for consistency with the rest of the kernel I can agree
with '_no'.
Nick.
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-04-09 23:25 ` Nick Andrew
@ 2008-04-09 23:44 ` Nick Andrew
2008-04-10 0:55 ` hermann pitton
0 siblings, 1 reply; 24+ messages in thread
From: Nick Andrew @ 2008-04-09 23:44 UTC (permalink / raw)
To: Michael Krufky; +Cc: linux-dvb
On Thu, Apr 10, 2008 at 09:25:44AM +1000, Nick Andrew wrote:
> with 'no' we have no bar to go under
> the 'o' which is the correct printed form of the abbreviation.
http://en.wikipedia.org/wiki/Numero_sign
It's 'Numero' ... hence the 'o' ... № № № № № № (it displays with
double character width in kde / konsole / vim)
Nick.
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-04-09 23:44 ` Nick Andrew
@ 2008-04-10 0:55 ` hermann pitton
[not found] ` <20080411164608.GB28897@tull.net>
0 siblings, 1 reply; 24+ messages in thread
From: hermann pitton @ 2008-04-10 0:55 UTC (permalink / raw)
To: Nick Andrew; +Cc: linux-dvb
Am Donnerstag, den 10.04.2008, 09:44 +1000 schrieb Nick Andrew:
> On Thu, Apr 10, 2008 at 09:25:44AM +1000, Nick Andrew wrote:
> > with 'no' we have no bar to go under
> > the 'o' which is the correct printed form of the abbreviation.
>
> http://en.wikipedia.org/wiki/Numero_sign
>
> It's 'Numero' ... hence the 'o' ... № № № № № № (it displays with
> double character width in kde / konsole / vim)
>
> Nick.
>
It is totally uninteresting and fully OT I think.
We can replace English with Latin.
And Latin with Greece.
And Greece with whatsoever previously ...
How came Pidgin English to happen ;)
Cheers,
Hermann
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-04-09 19:28 ` Janne Grunau
@ 2008-04-10 1:21 ` Michael Krufky
2008-04-10 23:25 ` hermann pitton
0 siblings, 1 reply; 24+ messages in thread
From: Michael Krufky @ 2008-04-10 1:21 UTC (permalink / raw)
To: Janne Grunau; +Cc: linux-dvb
Janne Grunau wrote:
> On Tuesday 08 April 2008 17:18:10 Michael Krufky wrote:
>> I would really like to see this patch get merged.
>>
>> If nobody has an issue with this, I plan to push this into a
>> mercurial tree at the end of the week and request that it be merged
>> into the master branch.
>
> updated patch attached:
> -resolved a reject in the ttusb2 driver
> -changed type of the adapter num array from int to short
>
> I didn't changed the module option name since to me consistency with the
> V4L options is more important.
>
> Janne
I've pushed the current patch to my mercurial repository
at the following location:
http://linuxtv.org/hg/~mkrufky/dvb
...anybody that wishes to try it out should feel free to pull
from this tree or apply Janne's patch manually.
Likewise, anybody that wishes to add their ack / reviewed-by
tag has the opportunity to reply with it to this thread -- I
will add it to the changeset inside the repository.
I intend to issue a pull request to Mauro for this patch to
be merged on Friday morning, before I leave for the office.
-Mike
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
2008-04-10 1:21 ` Michael Krufky
@ 2008-04-10 23:25 ` hermann pitton
0 siblings, 0 replies; 24+ messages in thread
From: hermann pitton @ 2008-04-10 23:25 UTC (permalink / raw)
To: Michael Krufky; +Cc: linux-dvb
Hi,
Am Mittwoch, den 09.04.2008, 21:21 -0400 schrieb Michael Krufky:
> Janne Grunau wrote:
> > On Tuesday 08 April 2008 17:18:10 Michael Krufky wrote:
> >> I would really like to see this patch get merged.
> >>
> >> If nobody has an issue with this, I plan to push this into a
> >> mercurial tree at the end of the week and request that it be merged
> >> into the master branch.
> >
> > updated patch attached:
> > -resolved a reject in the ttusb2 driver
> > -changed type of the adapter num array from int to short
> >
> > I didn't changed the module option name since to me consistency with the
> > V4L options is more important.
> >
> > Janne
>
> I've pushed the current patch to my mercurial repository
> at the following location:
>
> http://linuxtv.org/hg/~mkrufky/dvb
>
> ...anybody that wishes to try it out should feel free to pull
> from this tree or apply Janne's patch manually.
>
> Likewise, anybody that wishes to add their ack / reviewed-by
> tag has the opportunity to reply with it to this thread -- I
> will add it to the changeset inside the repository.
>
> I intend to issue a pull request to Mauro for this patch to
> be merged on Friday morning, before I leave for the office.
>
> -Mike
>
in the current situation it seems to be very useful.
Acked-by and tested-by: Hermann Pitton <hermann.pitton@arcor.de>
Cheers,
Hermann
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try
[not found] ` <20080411164608.GB28897@tull.net>
@ 2008-04-11 23:02 ` hermann pitton
0 siblings, 0 replies; 24+ messages in thread
From: hermann pitton @ 2008-04-11 23:02 UTC (permalink / raw)
To: Nick Andrew; +Cc: linux-dvb
Am Samstag, den 12.04.2008, 02:46 +1000 schrieb Nick Andrew:
> On Thu, Apr 10, 2008 at 02:55:41AM +0200, hermann pitton wrote:
> > It is totally uninteresting and fully OT I think.
>
> Sorry Hermann, I'll try to stick to the topic in future.
>
> Nick.
Hi Nick,
seems it is my turn now, please excuse!
The above rant was not meant such seriously and I thought that we can
live with some "Pidgin English ;)".
You and everyone has of course all and any rights to rise such questions
and I'm not against fixes and patches at all. We even must thank native
speakers to care for it.
In fact, it is really often very interesting to follow history, as it is
preserved in the different languages. We had a nice case previously with
old SECAM L´ in France.
We just should keep it on a level, similar like whitespace cleanups or
what we have currently with checkpatch.pl on older code, which _was
reviewed_, and stay relaxed.
To be honest, I still expected Manu to NACK this, as usual, also
previously for associating the PCI bridges and i2c masters with the
frontends.
If the arguments are good, I still do accept them.
Cheers,
Hermann
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2008-04-11 23:02 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-29 21:40 [linux-dvb] [PATCH] Add driver specific module option to choose dvb adapter numbers, second try Janne Grunau
2008-03-30 6:02 ` Michael Krufky
2008-03-30 11:53 ` Janne Grunau
2008-03-30 18:17 ` Janne Grunau
2008-04-08 8:30 ` Janne Grunau
2008-04-08 9:13 ` Andreas
2008-04-08 15:18 ` Michael Krufky
2008-04-08 22:22 ` Oliver Endriss
2008-04-09 9:21 ` Janne Grunau
2008-04-09 14:44 ` Michael Krufky
2008-04-09 23:25 ` Nick Andrew
2008-04-09 23:44 ` Nick Andrew
2008-04-10 0:55 ` hermann pitton
[not found] ` <20080411164608.GB28897@tull.net>
2008-04-11 23:02 ` hermann pitton
2008-04-09 14:45 ` Michael Krufky
2008-04-09 16:50 ` Oliver Endriss
2008-04-09 19:28 ` Janne Grunau
2008-04-10 1:21 ` Michael Krufky
2008-04-10 23:25 ` hermann pitton
2008-04-09 15:07 ` Manu Abraham
2008-04-09 16:00 ` Michael Krufky
2008-04-09 16:14 ` Rudy Zijlstra
2008-04-09 16:30 ` Steven Toth
-- strict thread matches above, loose matches on Subject: below --
2008-03-30 8:50 Eduard Huguet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox