diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-04-09 21:13:13 +0200 |
---|---|---|
committer | Michael Krufky <mkrufky@linuxtv.org> | 2008-04-09 21:13:13 +0200 |
commit | 6085c418e42063695cf895d7af008edc36f3fde2 (patch) | |
tree | be954212c7c29c2e9a7e954ab1059373288e2dd5 /linux/drivers/media/dvb/dvb-core/dvbdev.h | |
parent | 0010cbf0481fc24cd2caef60f52e2db0fed03d8f (diff) | |
download | mediapointer-dvb-s2-6085c418e42063695cf895d7af008edc36f3fde2.tar.gz mediapointer-dvb-s2-6085c418e42063695cf895d7af008edc36f3fde2.tar.bz2 |
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 avoids problems with changing DVB apapter
numbers after warm/cold boot or device unplugging and repluging.
Each driver holds DVB_MAX_ADAPTER long array of the preferred 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>
Acked-by: Hermann Pitton <hermann.pitton@arcor.de>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/dvb/dvb-core/dvbdev.h')
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvbdev.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.h b/linux/drivers/media/dvb/dvb-core/dvbdev.h index 6dff10ebf..5f9a737c6 100644 --- 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, |