aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/dvb-usb-init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dvb-usb-init.c')
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-init.c39
1 files changed, 25 insertions, 14 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-init.c b/drivers/media/dvb/dvb-usb/dvb-usb-init.c
index f9af3484834f..169196ec2d4e 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-init.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-init.c
@@ -29,7 +29,7 @@ MODULE_PARM_DESC(force_pid_filter_usage, "force all dvb-usb-devices to use a PID
29static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs) 29static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
30{ 30{
31 struct dvb_usb_adapter *adap; 31 struct dvb_usb_adapter *adap;
32 int ret, n; 32 int ret, n, o;
33 33
34 for (n = 0; n < d->props.num_adapters; n++) { 34 for (n = 0; n < d->props.num_adapters; n++) {
35 adap = &d->adapter[n]; 35 adap = &d->adapter[n];
@@ -38,31 +38,42 @@ static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
38 38
39 memcpy(&adap->props, &d->props.adapter[n], sizeof(struct dvb_usb_adapter_properties)); 39 memcpy(&adap->props, &d->props.adapter[n], sizeof(struct dvb_usb_adapter_properties));
40 40
41 for (o = 0; o < adap->props.num_frontends; o++) {
42 struct dvb_usb_adapter_fe_properties *props = &adap->props.fe[o];
41 /* speed - when running at FULL speed we need a HW PID filter */ 43 /* speed - when running at FULL speed we need a HW PID filter */
42 if (d->udev->speed == USB_SPEED_FULL && !(adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER)) { 44 if (d->udev->speed == USB_SPEED_FULL && !(props->caps & DVB_USB_ADAP_HAS_PID_FILTER)) {
43 err("This USB2.0 device cannot be run on a USB1.1 port. (it lacks a hardware PID filter)"); 45 err("This USB2.0 device cannot be run on a USB1.1 port. (it lacks a hardware PID filter)");
44 return -ENODEV; 46 return -ENODEV;
45 } 47 }
46 48
47 if ((d->udev->speed == USB_SPEED_FULL && adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER) || 49 if ((d->udev->speed == USB_SPEED_FULL && props->caps & DVB_USB_ADAP_HAS_PID_FILTER) ||
48 (adap->props.caps & DVB_USB_ADAP_NEED_PID_FILTERING)) { 50 (props->caps & DVB_USB_ADAP_NEED_PID_FILTERING)) {
49 info("will use the device's hardware PID filter (table count: %d).", adap->props.pid_filter_count); 51 info("will use the device's hardware PID filter (table count: %d).", props->pid_filter_count);
50 adap->pid_filtering = 1; 52 adap->fe_adap[o].pid_filtering = 1;
51 adap->max_feed_count = adap->props.pid_filter_count; 53 adap->fe_adap[o].max_feed_count = props->pid_filter_count;
52 } else { 54 } else {
53 info("will pass the complete MPEG2 transport stream to the software demuxer."); 55 info("will pass the complete MPEG2 transport stream to the software demuxer.");
54 adap->pid_filtering = 0; 56 adap->fe_adap[o].pid_filtering = 0;
55 adap->max_feed_count = 255; 57 adap->fe_adap[o].max_feed_count = 255;
56 } 58 }
57 59
58 if (!adap->pid_filtering && 60 if (!adap->fe_adap[o].pid_filtering &&
59 dvb_usb_force_pid_filter_usage && 61 dvb_usb_force_pid_filter_usage &&
60 adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER) { 62 props->caps & DVB_USB_ADAP_HAS_PID_FILTER) {
61 info("pid filter enabled by module option."); 63 info("pid filter enabled by module option.");
62 adap->pid_filtering = 1; 64 adap->fe_adap[o].pid_filtering = 1;
63 adap->max_feed_count = adap->props.pid_filter_count; 65 adap->fe_adap[o].max_feed_count = props->pid_filter_count;
64 } 66 }
65 67
68 if (props->size_of_priv > 0) {
69 adap->fe_adap[o].priv = kzalloc(props->size_of_priv, GFP_KERNEL);
70 if (adap->fe_adap[o].priv == NULL) {
71 err("no memory for priv for adapter %d fe %d.", n, o);
72 return -ENOMEM;
73 }
74 }
75 }
76
66 if (adap->props.size_of_priv > 0) { 77 if (adap->props.size_of_priv > 0) {
67 adap->priv = kzalloc(adap->props.size_of_priv, GFP_KERNEL); 78 adap->priv = kzalloc(adap->props.size_of_priv, GFP_KERNEL);
68 if (adap->priv == NULL) { 79 if (adap->priv == NULL) {
@@ -78,7 +89,7 @@ static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
78 } 89 }
79 90
80 /* use exclusive FE lock if there is multiple shared FEs */ 91 /* use exclusive FE lock if there is multiple shared FEs */
81 if (adap->fe[1]) 92 if (adap->fe_adap[1].fe)
82 adap->dvb_adap.mfe_shared = 1; 93 adap->dvb_adap.mfe_shared = 1;
83 94
84 d->num_adapters_initialized++; 95 d->num_adapters_initialized++;