* @stream: configuration of the USB streaming
*/
struct dvb_usb_adapter_fe_properties {
-#define DVB_USB_ADAP_HAS_PID_FILTER 0x01
-#define DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF 0x02
-#define DVB_USB_ADAP_NEED_PID_FILTERING 0x04
-#define DVB_USB_ADAP_RECEIVES_204_BYTE_TS 0x08
-#define DVB_USB_ADAP_RECEIVES_RAW_PAYLOAD 0x10
- int caps;
- int pid_filter_count;
-
int (*streaming_ctrl) (struct dvb_usb_adapter *, int);
- int (*pid_filter_ctrl) (struct dvb_usb_adapter *, int);
- int (*pid_filter) (struct dvb_usb_adapter *, int, u16, int);
int (*frontend_attach) (struct dvb_usb_adapter *);
int (*tuner_attach) (struct dvb_usb_adapter *);
#define MAX_NO_OF_FE_PER_ADAP 3
struct dvb_usb_adapter_properties {
+#define DVB_USB_ADAP_HAS_PID_FILTER 0x01
+#define DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF 0x02
+#define DVB_USB_ADAP_NEED_PID_FILTERING 0x04
+#define DVB_USB_ADAP_RECEIVES_204_BYTE_TS 0x08
+#define DVB_USB_ADAP_RECEIVES_RAW_PAYLOAD 0x10
+ int caps;
int size_of_priv;
+ int pid_filter_count;
+ int (*pid_filter_ctrl) (struct dvb_usb_adapter *, int);
+ int (*pid_filter) (struct dvb_usb_adapter *, int, u16, int);
+
int (*frontend_ctrl) (struct dvb_frontend *, int);
int (*fe_ioctl_override) (struct dvb_frontend *,
unsigned int, void *, unsigned int);
int (*fe_init) (struct dvb_frontend *);
int (*fe_sleep) (struct dvb_frontend *);
- int pid_filtering;
- int max_feed_count;
-
void *priv;
};
struct dvb_usb_adapter {
- struct dvb_usb_device *dev;
- struct dvb_usb_adapter_properties props;
- struct usb_data_stream stream;
-
#define DVB_USB_ADAP_STATE_INIT 0x000
#define DVB_USB_ADAP_STATE_DVB 0x001
int state;
-
+ struct dvb_usb_device *dev;
+ struct dvb_usb_adapter_properties props;
+ struct usb_data_stream stream;
u8 id;
+ int pid_filtering;
int feedcount;
+ int max_feed_count;
/* dvb */
struct dvb_adapter dvb_adap;
/* activate the pid on the device specific pid_filter */
deb_ts("setting pid (%s): %5d %04x at index %d '%s'\n",
- adap->fe_adap[adap->active_fe].pid_filtering ?
+ adap->pid_filtering ?
"yes" : "no", dvbdmxfeed->pid, dvbdmxfeed->pid,
dvbdmxfeed->index, onoff ? "on" : "off");
- if (adap->props.fe[adap->active_fe].caps & DVB_USB_ADAP_HAS_PID_FILTER &&
- adap->fe_adap[adap->active_fe].pid_filtering &&
- adap->props.fe[adap->active_fe].pid_filter != NULL)
- adap->props.fe[adap->active_fe].pid_filter(adap,
- dvbdmxfeed->index, dvbdmxfeed->pid, onoff);
+ if (adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER &&
+ adap->pid_filtering &&
+ adap->props.pid_filter != NULL)
+ adap->props.pid_filter(adap, dvbdmxfeed->index,
+ dvbdmxfeed->pid, onoff);
/* start the feed if this was the first feed and there is still a feed
* for reception.
usb_urb_submit(&adap->stream, &stream_props);
deb_ts("controlling pid parser\n");
- if (adap->props.fe[adap->active_fe].caps & DVB_USB_ADAP_HAS_PID_FILTER &&
- adap->props.fe[adap->active_fe].caps &
+ if (adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER &&
+ adap->props.caps &
DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF &&
- adap->props.fe[adap->active_fe].pid_filter_ctrl != NULL) {
- ret = adap->props.fe[adap->active_fe].pid_filter_ctrl(
+ adap->props.pid_filter_ctrl != NULL) {
+ ret = adap->props.pid_filter_ctrl(
adap,
- adap->fe_adap[adap->active_fe].pid_filtering);
+ adap->pid_filtering);
if (ret < 0) {
err("could not handle pid_parser");
return ret;
adap->demux.filternum = 0;
for (i = 0; i < adap->props.num_frontends; i++) {
- if (adap->demux.filternum < adap->fe_adap[i].max_feed_count)
- adap->demux.filternum = adap->fe_adap[i].max_feed_count;
+ if (adap->demux.filternum < adap->max_feed_count)
+ adap->demux.filternum = adap->max_feed_count;
}
adap->demux.feednum = adap->demux.filternum;
adap->demux.start_feed = dvb_usb_start_feed;
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;
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;