summaryrefslogtreecommitdiff
path: root/drivers/media/dvb/firesat/firesat-ci.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2008-03-07 08:30:23 +0300
committerStefan Richter <stefanr@s5r6.in-berlin.de>2009-02-24 16:51:25 +0300
commitc81c8b68b46752721b0c1addfabb828da27e1489 (patch)
tree59d2a336150ce59780b73ba8dc59a829e217b2d0 /drivers/media/dvb/firesat/firesat-ci.c
parentf7e603ad8f78cd3b59e33fa72707da0cbabdf699 (diff)
downloadlinux-c81c8b68b46752721b0c1addfabb828da27e1489.tar.xz
DVB: add firesat driver
Original code written by Christian Dolzer <c.dolzer@digital-everywhere.com> Cleaned up by Greg. Major cleanup and reorg by Manu Abraham <manu@linuxtv.org> Additions also by Ben Backx <ben@bbackx.com> Cc: Christian Dolzer <c.dolzer@digital-everywhere.com> Cc: Andreas Monitzer <andy@monitzer.com> Cc: Manu Abraham <manu@linuxtv.org> Cc: Fabio De Lorenzo <delorenzo.fabio@gmail.com> Cc: Robert Berger <robert.berger@reliableembeddedsystems.com> Signed-off-by: Ben Backx <ben@bbackx.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Added missing dependency to dvb/firesat/Kconfig, Reported-by: Randy Dunlap <randy.dunlap@oracle.com> Tweaked dvb/Makefile. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/media/dvb/firesat/firesat-ci.c')
-rw-r--r--drivers/media/dvb/firesat/firesat-ci.c95
1 files changed, 95 insertions, 0 deletions
diff --git a/drivers/media/dvb/firesat/firesat-ci.c b/drivers/media/dvb/firesat/firesat-ci.c
new file mode 100644
index 000000000000..862d9553c5bc
--- /dev/null
+++ b/drivers/media/dvb/firesat/firesat-ci.c
@@ -0,0 +1,95 @@
+#include "firesat-ci.h"
+#include "firesat.h"
+#include "avc_api.h"
+
+#include <linux/dvb/ca.h>
+#include <dvbdev.h>
+/*
+static int firesat_ca_do_ioctl(struct inode *inode, struct file *file, unsigned int cmd, void *parg) {
+ //struct firesat *firesat = (struct firesat*)((struct dvb_device*)file->private_data)->priv;
+ int err;
+
+// printk(KERN_INFO "%s: ioctl %d\n",__func__,cmd);
+
+ switch(cmd) {
+ case CA_RESET:
+ // TODO: Needs to be implemented with new AVC Vendor commands
+ break;
+ case CA_GET_CAP: {
+ ca_caps_t *cap=(ca_caps_t*)parg;
+ cap->slot_num = 1;
+ cap->slot_type = CA_CI_LINK;
+ cap->descr_num = 1;
+ cap->descr_type = CA_DSS;
+
+ err = 0;
+ break;
+ }
+ case CA_GET_SLOT_INFO: {
+ ca_slot_info_t *slot=(ca_slot_info_t*)parg;
+ if(slot->num == 0) {
+ slot->type = CA_CI | CA_CI_LINK | CA_DESCR;
+ slot->flags = CA_CI_MODULE_PRESENT | CA_CI_MODULE_READY;
+ } else {
+ slot->type = 0;
+ slot->flags = 0;
+ }
+ err = 0;
+ break;
+ }
+ default:
+ err=-EINVAL;
+ }
+ return err;
+}
+*/
+
+static int firesat_ca_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) {
+ //return dvb_usercopy(inode, file, cmd, arg, firesat_ca_do_ioctl);
+ return dvb_generic_ioctl(inode, file, cmd, arg);
+}
+
+static int firesat_ca_io_open(struct inode *inode, struct file *file) {
+ printk(KERN_INFO "%s!\n",__func__);
+ return dvb_generic_open(inode, file);
+}
+
+static int firesat_ca_io_release(struct inode *inode, struct file *file) {
+ printk(KERN_INFO "%s!\n",__func__);
+ return dvb_generic_release(inode, file);
+}
+
+static unsigned int firesat_ca_io_poll(struct file *file, poll_table *wait) {
+// printk(KERN_INFO "%s!\n",__func__);
+ return POLLIN;
+}
+
+static struct file_operations firesat_ca_fops = {
+ .owner = THIS_MODULE,
+ .read = NULL, // There is no low level read anymore
+ .write = NULL, // There is no low level write anymore
+ .ioctl = firesat_ca_ioctl,
+ .open = firesat_ca_io_open,
+ .release = firesat_ca_io_release,
+ .poll = firesat_ca_io_poll,
+};
+
+static struct dvb_device firesat_ca = {
+ .priv = NULL,
+ .users = 1,
+ .readers = 1,
+ .writers = 1,
+ .fops = &firesat_ca_fops,
+};
+
+int firesat_ca_init(struct firesat *firesat) {
+ int ret = dvb_register_device(firesat->adapter, &firesat->cadev, &firesat_ca, firesat, DVB_DEVICE_CA);
+ if(ret) return ret;
+
+ // avoid unnecessary delays, we're not talking to the CI yet anyways
+ return 0;
+}
+
+void firesat_ca_release(struct firesat *firesat) {
+ dvb_unregister_device(firesat->cadev);
+}