summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/firesat/firesat_dvb.c
diff options
context:
space:
mode:
authorHenrik Kurelid <henke@kurelid.se>2008-08-01 10:00:45 +0200
committerStefan Richter <stefanr@s5r6.in-berlin.de>2009-02-24 14:51:26 +0100
commitdf4846c35247a0d038c5359d502cddd59d04bc40 (patch)
tree40c58c28c389f238e3d26230f264782e8f4bcb1e /drivers/media/dvb/firesat/firesat_dvb.c
parent2c22861459f094e899c034515a9bb92ac307ceae (diff)
firesat: update isochronous interface, add CI support
I have finally managed to get the CI support for the card working. The implementation is a bare minimum to get encrypted channels to work in kaffeine. It works fine with my T/CI card. Now and then I get an AVC timeout and have to retune a channel in order to get it to work. Once the CAM seemed to hang so I needed to remove and insert it again. I.e. there are a number of glitches. The latest version contains the following changes: - Implemented the new hpsb iso interface so that data can be received from the card - Reduced some timers for demux setup which caused scanning to timeout - Added possibility to unload driver - Added support for getting C/N ratio - Added two debug parameters to the driver; ca_debug and avc_comm_debug. - Added CI support that works for me in kaffeine - Started working on CI MMI support. It now supports: o Enter menu o Receiving MMI objects - Added support for 64-bit platforms - Corrected DVB-C modulations problems Signed-off-by: Henrik Kurelid <henrik@kurelid.se> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (rebased, whitespace)
Diffstat (limited to 'drivers/media/dvb/firesat/firesat_dvb.c')
-rw-r--r--drivers/media/dvb/firesat/firesat_dvb.c49
1 files changed, 32 insertions, 17 deletions
diff --git a/drivers/media/dvb/firesat/firesat_dvb.c b/drivers/media/dvb/firesat/firesat_dvb.c
index 38aad081288..9e87402289a 100644
--- a/drivers/media/dvb/firesat/firesat_dvb.c
+++ b/drivers/media/dvb/firesat/firesat_dvb.c
@@ -1,3 +1,15 @@
+/*
+ * FireSAT DVB driver
+ *
+ * Copyright (c) ?
+ * Copyright (c) 2008 Henrik Kurelid <henrik@kurelid.se>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ */
+
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/wait.h>
@@ -6,7 +18,6 @@
#include <linux/time.h>
#include <linux/errno.h>
#include <linux/interrupt.h>
-#include <linux/semaphore.h>
#include <ieee1394_hotplug.h>
#include <nodemgr.h>
#include <highlevel.h>
@@ -26,13 +37,13 @@ static struct firesat_channel *firesat_channel_allocate(struct firesat *firesat)
{
int k;
- printk(KERN_INFO "%s\n", __func__);
+ //printk(KERN_INFO "%s\n", __func__);
if (down_interruptible(&firesat->demux_sem))
return NULL;
for (k = 0; k < 16; k++) {
- printk(KERN_INFO "%s: channel %d: active = %d, pid = 0x%x\n",__func__,k,firesat->channel[k].active,firesat->channel[k].pid);
+ //printk(KERN_INFO "%s: channel %d: active = %d, pid = 0x%x\n",__func__,k,firesat->channel[k].active,firesat->channel[k].pid);
if (firesat->channel[k].active == 0) {
firesat->channel[k].active = 1;
@@ -82,14 +93,15 @@ int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed)
int pidc,k;
u16 pids[16];
- printk(KERN_INFO "%s (pid %u)\n",__func__,dvbdmxfeed->pid);
+// printk(KERN_INFO "%s (pid %u)\n", __func__, dvbdmxfeed->pid);
switch (dvbdmxfeed->type) {
case DMX_TYPE_TS:
case DMX_TYPE_SEC:
break;
default:
- printk("%s: invalid type %u\n",__func__,dvbdmxfeed->type);
+ printk(KERN_ERR "%s: invalid type %u\n",
+ __func__, dvbdmxfeed->type);
return -EINVAL;
}
@@ -110,7 +122,8 @@ int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed)
channel = firesat_channel_allocate(firesat);
break;
default:
- printk("%s: invalid pes type %u\n",__func__, dvbdmxfeed->pes_type);
+ printk(KERN_ERR "%s: invalid pes type %u\n",
+ __func__, dvbdmxfeed->pes_type);
return -EINVAL;
}
} else {
@@ -118,7 +131,7 @@ int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed)
}
if (!channel) {
- printk("%s: busy!\n", __func__);
+ printk(KERN_ERR "%s: busy!\n", __func__);
return -EBUSY;
}
@@ -131,22 +144,23 @@ int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed)
if (firesat_channel_collect(firesat, &pidc, pids)) {
firesat_channel_release(firesat, channel);
+ printk(KERN_ERR "%s: could not collect pids!\n", __func__);
return -EINTR;
}
if(dvbdmxfeed->pid == 8192) {
- if((k=AVCTuner_GetTS(firesat))) {
+ if((k = AVCTuner_GetTS(firesat))) {
firesat_channel_release(firesat, channel);
printk("%s: AVCTuner_GetTS failed with error %d\n",
- __func__,k);
+ __func__, k);
return k;
}
}
else {
- if((k=AVCTuner_SetPIDs(firesat, pidc, pids))) {
+ if((k = AVCTuner_SetPIDs(firesat, pidc, pids))) {
firesat_channel_release(firesat, channel);
printk("%s: AVCTuner_SetPIDs failed with error %d\n",
- __func__,k);
+ __func__, k);
return k;
}
}
@@ -161,7 +175,7 @@ int firesat_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
int k, l = 0;
u16 pids[16];
- printk(KERN_INFO "%s (pid %u)\n", __func__, dvbdmxfeed->pid);
+ //printk(KERN_INFO "%s (pid %u)\n", __func__, dvbdmxfeed->pid);
if (dvbdmxfeed->type == DMX_TYPE_TS && !((dvbdmxfeed->ts_type & TS_PACKET) &&
(demux->dmx.frontend->source != DMX_MEMORY_FE))) {
@@ -189,12 +203,13 @@ int firesat_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
// list except channel to be removed
for (k = 0; k < 16; k++)
- if (firesat->channel[k].active == 1)
+ if (firesat->channel[k].active == 1) {
if (&firesat->channel[k] !=
(struct firesat_channel *)dvbdmxfeed->priv)
pids[l++] = firesat->channel[k].pid;
else
firesat->channel[k].active = 0;
+ }
if ((k = AVCTuner_SetPIDs(firesat, l, pids))) {
up(&firesat->demux_sem);
@@ -214,8 +229,6 @@ int firesat_dvbdev_init(struct firesat *firesat,
{
int result;
- firesat->has_ci = 1; // TEMP workaround
-
#if 0
switch (firesat->type) {
case FireSAT_DVB_S:
@@ -254,7 +267,7 @@ int firesat_dvbdev_init(struct firesat *firesat,
return -ENOMEM;
}
- if ((result = dvb_register_adapter(firesat->adapter,
+ if ((result = DVB_REGISTER_ADAPTER(firesat->adapter,
firesat->model_name,
THIS_MODULE,
dev, adapter_nr)) < 0) {
@@ -271,6 +284,7 @@ int firesat_dvbdev_init(struct firesat *firesat,
return result;
}
+ memset(&firesat->demux, 0, sizeof(struct dvb_demux));
firesat->demux.dmx.capabilities = 0/*DMX_TS_FILTERING | DMX_SECTION_FILTERING*/;
firesat->demux.priv = (void *)firesat;
@@ -343,8 +357,9 @@ int firesat_dvbdev_init(struct firesat *firesat,
return result;
}
- if (firesat->has_ci)
firesat_ca_init(firesat);
return 0;
}
+
+