diff options
author | Antti Palosaari | 2012-05-29 23:05:40 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab | 2012-08-04 12:56:24 +0200 |
commit | e46c5b66da84d8eccf4566216f0582964a28b73e (patch) | |
tree | 273c1eff34c2c988bc715bf118acb1fbfe3e53b1 /drivers/media/dvb/dvb-usb/dvb_usb_init.c | |
parent | [media] dvb_usb_v2: move (struct usb_data_stream_properties) to upper level (diff) | |
download | kernel-qcow2-linux-e46c5b66da84d8eccf4566216f0582964a28b73e.tar.gz kernel-qcow2-linux-e46c5b66da84d8eccf4566216f0582964a28b73e.tar.xz kernel-qcow2-linux-e46c5b66da84d8eccf4566216f0582964a28b73e.zip |
[media] dvb_usb_v2: move PID filters from frontend to adapter
Filtering given PIDs from the transport stream is done by the
DVB USB bridge. It is highly possible there is limitations what
kind of stream DVB USB bridge can PID filter, but it still does
not make sense to define filters for each frontend as frontend
could offer different stream types for different standards.
Likely new way is to enable / disable PID filters are needed to
make decision at runtime (callback). PID filters are quite legacy
stuff as those are aimed cut stream smaller to fit for the USB1.1...
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dvb_usb_init.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb_usb_init.c | 74 |
1 files changed, 27 insertions, 47 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb_usb_init.c b/drivers/media/dvb/dvb-usb/dvb_usb_init.c index 1441324a9115..0e26299c19ca 100644 --- a/drivers/media/dvb/dvb-usb/dvb_usb_init.c +++ b/drivers/media/dvb/dvb-usb/dvb_usb_init.c @@ -34,7 +34,7 @@ MODULE_PARM_DESC(force_pid_filter_usage, "force all dvb-usb-devices to use a" \ static int dvb_usb_adapter_init(struct dvb_usb_device *d) { struct dvb_usb_adapter *adap; - int ret, n, o, adapter_count; + int ret, n, adapter_count; /* resolve adapter count */ adapter_count = d->props.num_adapters; @@ -54,57 +54,37 @@ static int dvb_usb_adapter_init(struct dvb_usb_device *d) memcpy(&adap->props, &d->props.adapter[n], sizeof(struct dvb_usb_adapter_properties)); - for (o = 0; o < adap->props.num_frontends; o++) { - struct dvb_usb_adapter_fe_properties *props = - &adap->props.fe[o]; - /* speed - when running at FULL speed we need a HW - * PID filter */ - if (d->udev->speed == USB_SPEED_FULL && - !(props->caps & DVB_USB_ADAP_HAS_PID_FILTER)) { - err("This USB2.0 device cannot be run on a" \ - " USB1.1 port. (it lacks a" \ - " hardware PID filter)"); - return -ENODEV; - } - - if ((d->udev->speed == USB_SPEED_FULL && - props->caps & DVB_USB_ADAP_HAS_PID_FILTER) || - (props->caps & DVB_USB_ADAP_NEED_PID_FILTERING)) { - info("will use the device's hardware PID" \ - " filter (table count: %d).", - props->pid_filter_count); - adap->fe_adap[o].pid_filtering = 1; - adap->fe_adap[o].max_feed_count = - props->pid_filter_count; - } else { - info("will pass the complete MPEG2 transport" \ - " stream to the software demuxer."); - adap->fe_adap[o].pid_filtering = 0; - adap->fe_adap[o].max_feed_count = 255; - } + /* speed - when running at FULL speed we need a HW PID filter */ + if (d->udev->speed == USB_SPEED_FULL && + !(adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER)) { + err("This USB2.0 device cannot be run on a" \ + " USB1.1 port. (it lacks a" \ + " hardware PID filter)"); + return -ENODEV; + } else if ((d->udev->speed == USB_SPEED_FULL && + adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER) || + (adap->props.caps & DVB_USB_ADAP_NEED_PID_FILTERING)) { + info("will use the device's hardware PID" \ + " filter (table count: %d).", + adap->props.pid_filter_count); + adap->pid_filtering = 1; + adap->max_feed_count = adap->props.pid_filter_count; + } else { + info("will pass the complete MPEG2 transport" \ + " stream to the software demuxer."); + adap->pid_filtering = 0; + adap->max_feed_count = 255; + } - if (!adap->fe_adap[o].pid_filtering && - dvb_usb_force_pid_filter_usage && - props->caps & DVB_USB_ADAP_HAS_PID_FILTER) { + if (!adap->pid_filtering && dvb_usb_force_pid_filter_usage && + adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER) { info("pid filter enabled by module option."); - adap->fe_adap[o].pid_filtering = 1; - adap->fe_adap[o].max_feed_count = - props->pid_filter_count; - } - - if (props->size_of_priv > 0) { - adap->fe_adap[o].priv = kzalloc(props->size_of_priv, GFP_KERNEL); - if (adap->fe_adap[o].priv == NULL) { - err("no memory for priv for adapter" \ - " %d fe %d.", n, o); - return -ENOMEM; - } - } + adap->pid_filtering = 1; + adap->max_feed_count = adap->props.pid_filter_count; } if (adap->props.size_of_priv > 0) { - adap->priv = kzalloc(adap->props.size_of_priv, - GFP_KERNEL); + adap->priv = kzalloc(adap->props.size_of_priv, GFP_KERNEL); if (adap->priv == NULL) { err("no memory for priv for adapter %d.", n); return -ENOMEM; |