23 MODULE_PARM_DESC(disable_rc_polling,
"disable remote control polling (default: 0).");
25 static int dvb_usb_force_pid_filter_usage;
27 MODULE_PARM_DESC(force_pid_filter_usage,
"force all dvb-usb-devices to use a PID filter, if any (default: 0).");
29 static int dvb_usb_adapter_init(
struct dvb_usb_device *
d,
short *adapter_nrs)
34 for (n = 0; n < d->
props.num_adapters; n++) {
41 for (o = 0; o < adap->
props.num_frontends; o++) {
45 err(
"This USB2.0 device cannot be run on a USB1.1 port. (it lacks a hardware PID filter)");
52 adap->
fe_adap[o].pid_filtering = 1;
55 info(
"will pass the complete MPEG2 transport stream to the software demuxer.");
56 adap->
fe_adap[o].pid_filtering = 0;
57 adap->
fe_adap[o].max_feed_count = 255;
60 if (!adap->
fe_adap[o].pid_filtering &&
61 dvb_usb_force_pid_filter_usage &&
63 info(
"pid filter enabled by module option.");
64 adap->
fe_adap[o].pid_filtering = 1;
71 err(
"no memory for priv for adapter %d fe %d.", n, o);
77 if (adap->
props.size_of_priv > 0) {
80 err(
"no memory for priv for adapter %d.", n);
103 if (d->
props.generic_bulk_ctrl_endpoint != 0) {
132 dvb_usb_adapter_exit(d);
141 static int dvb_usb_init(
struct dvb_usb_device *d,
short *adapter_nums)
150 if (d->
props.size_of_priv > 0) {
153 err(
"no memory for priv in 'struct dvb_usb_device'");
162 (ret = dvb_usb_adapter_init(d, adapter_nums))) {
168 err(
"could not initialize remote control.");
186 deb_info(
"check for cold %x %x\n", props->
devices[i].cold_ids[j]->idVendor, props->
devices[i].cold_ids[j]->idProduct);
187 if (props->
devices[i].cold_ids[j]->idVendor ==
le16_to_cpu(udev->descriptor.idVendor) &&
188 props->
devices[i].cold_ids[j]->idProduct ==
le16_to_cpu(udev->descriptor.idProduct)) {
199 deb_info(
"check for warm %x %x\n", props->
devices[i].warm_ids[j]->idVendor, props->
devices[i].warm_ids[j]->idProduct);
200 if (props->
devices[i].warm_ids[j]->idVendor ==
le16_to_cpu(udev->descriptor.idVendor) &&
201 props->
devices[i].warm_ids[j]->idProduct ==
le16_to_cpu(udev->descriptor.idProduct)) {
223 deb_info(
"power control: %d\n", onoff);
224 if (d->
props.power_ctrl)
225 return d->
props.power_ctrl(d, onoff);
238 struct usb_device *udev = interface_to_usbdev(intf);
242 int ret = -
ENOMEM, cold = 0;
247 if ((desc = dvb_usb_find_device(udev, props, &cold)) ==
NULL) {
248 deb_err(
"something went very wrong, device was not found in current device list - let's see what comes next.\n");
253 info(
"found a '%s' in cold state, will try to load a firmware", desc->
name);
259 info(
"found a '%s' in warm state.", desc->
name);
262 err(
"no memory for 'struct dvb_usb_device'");
271 usb_set_intfdata(intf, d);
276 ret = dvb_usb_init(d, adapter_nums);
279 info(
"%s successfully initialized and connected.", desc->
name);
281 info(
"%s error while loading driver (%d)", desc->
name, ret);
289 const char *
name =
"generic DVB-USB module";
291 usb_set_intfdata(intf,
NULL);
293 name = d->
desc->name;
296 info(
"%s successfully deinitialized and disconnected.", name);
303 MODULE_DESCRIPTION(
"A library module containing commonly used USB and DVB function USB DVB devices");