[linux-dvb] [RFC PATCH] Choose dvb adapter number with a driver specific module option

Manu Abraham abraham.manu at gmail.com
Sat Aug 4 00:02:29 CEST 2007


On 8/2/07, Janne Grunau <janne-dvb at grunau.be> wrote:
> Hi,
>
> Dynamic loading of modules by udev on startup (aka coldplugging) doesn't
> result in deterministic dvb adapter numbers.
>
> 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.
>
> Besides following changes in dvb-core and dvb-usb core the patch adds to
> all drivers
>
> +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");
>
> and modifies the dvb_register_adapter call. Full patch is attached as
> compressed file.

Do we really want to have adapter numbers in DVB bridge drivers ?
IMHO, it doesn't look pleasing to have that.

Is there any other possible better alternatives ? If it is that
absolute a necessity, can we hide the ugliness in dvb-core at least ?

(Although dvb-core is becoming a nightmare, with lot of cruft, i don't
see anything that's going to clear up any time soon, but rather
increase over time, with backward compatibility and things like that)



More information about the linux-dvb mailing list