summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/b2c2
diff options
context:
space:
mode:
authorPatrick Boettcher <devnull@localhost>2005-04-11 15:41:29 +0000
committerPatrick Boettcher <devnull@localhost>2005-04-11 15:41:29 +0000
commit093022513d03a4d1ff5cb399dea284016ad73e2b (patch)
tree8a56a6adbcb49df4c739d6301f5bb454ce697ede /linux/drivers/media/dvb/b2c2
parent0d815a62ada470f205baa470922217fc36c6b1a3 (diff)
downloadmediapointer-dvb-s2-093022513d03a4d1ff5cb399dea284016ad73e2b.tar.gz
mediapointer-dvb-s2-093022513d03a4d1ff5cb399dea284016ad73e2b.tar.bz2
corrected the hw-filtering again. (Don't do things before breakfast)...
Diffstat (limited to 'linux/drivers/media/dvb/b2c2')
-rw-r--r--linux/drivers/media/dvb/b2c2/flexcop-common.h2
-rw-r--r--linux/drivers/media/dvb/b2c2/flexcop-hw-filter.c44
2 files changed, 32 insertions, 14 deletions
diff --git a/linux/drivers/media/dvb/b2c2/flexcop-common.h b/linux/drivers/media/dvb/b2c2/flexcop-common.h
index 534876d61..79e8581b4 100644
--- a/linux/drivers/media/dvb/b2c2/flexcop-common.h
+++ b/linux/drivers/media/dvb/b2c2/flexcop-common.h
@@ -76,8 +76,10 @@ struct flexcop_device {
struct semaphore i2c_sem;
/* options and status */
+ int extra_feedcount;
int feedcount;
int pid_filtering;
+ int fullts_streaming_state;
/* bus specific callbacks */
flexcop_ibi_value (*read_ibi_reg) (struct flexcop_device *, flexcop_ibi_register);
diff --git a/linux/drivers/media/dvb/b2c2/flexcop-hw-filter.c b/linux/drivers/media/dvb/b2c2/flexcop-hw-filter.c
index 0a5628a1d..2baf43d3c 100644
--- a/linux/drivers/media/dvb/b2c2/flexcop-hw-filter.c
+++ b/linux/drivers/media/dvb/b2c2/flexcop-hw-filter.c
@@ -136,29 +136,45 @@ static void flexcop_pid_control(struct flexcop_device *fc, int index, u16 pid,in
}
}
+static int flexcop_toggle_fullts_streaming(struct flexcop_device *fc,int onoff)
+{
+ if (fc->fullts_streaming_state != onoff) {
+ deb_ts("%s full TS transfer\n",onoff ? "enabling" : "disabling");
+ flexcop_pid_group_filter(fc, 0, 0x1fe0 * (!onoff));
+ flexcop_pid_group_filter_ctrl(fc,onoff);
+ fc->fullts_streaming_state = onoff;
+ }
+ return 0;
+}
+
int flexcop_pid_feed_control(struct flexcop_device *fc, struct dvb_demux_feed *dvbdmxfeed, int onoff)
{
int max_pid_filter = 6 + fc->has_32_hw_pid_filter*32;
- fc->feedcount += (onoff ? 1 : -1);
+ fc->feedcount += onoff ? 1 : -1;
+ if (dvbdmxfeed->index >= max_pid_filter)
+ fc->extra_feedcount += onoff ? 1 : -1;
- /* modify complete-TS-passing when:
- * - pid_filtering is not enabled and it is the first feed requested
- * - pid_filtering is enable, but the number of requested feeds is exceeded
- * - or the requested pid is 0x2000 */
- if ((!fc->pid_filtering && fc->feedcount == onoff) ||
- (fc->pid_filtering && fc->feedcount > max_pid_filter) ||
- dvbdmxfeed->pid == 0x2000) {
+ /* toggle complete-TS-streaming when:
+ * - pid_filtering is not enabled and it is the first or last feed requested
+ * - pid_filtering is enabled,
+ * - but the number of requested feeds is exceeded
+ * - or the requested pid is 0x2000 */
- deb_ts("%s full TS transfer\n",onoff ? "enabling" : "disabling");
- flexcop_pid_group_filter(fc, 0, 0x1fe0 * (!onoff));
- flexcop_pid_group_filter_ctrl(fc,onoff);
- }
+ if (!fc->pid_filtering && fc->feedcount == onoff)
+ flexcop_toggle_fullts_streaming(fc,onoff);
- /* when doing hw pid filtering, set the pid */
- if (fc->pid_filtering)
+ if (fc->pid_filtering) {
flexcop_pid_control(fc,dvbdmxfeed->index,dvbdmxfeed->pid,onoff);
+ if (fc->extra_feedcount > 0)
+ flexcop_toggle_fullts_streaming(fc,1);
+ else if (dvbdmxfeed->pid == 0x2000)
+ flexcop_toggle_fullts_streaming(fc,onoff);
+ else
+ flexcop_toggle_fullts_streaming(fc,0);
+ }
+
/* if it was the first or last feed request change the stream-status */
if (fc->feedcount == onoff) {
flexcop_rcv_data_ctrl(fc,onoff);