diff options
author | Andrew de Quincy <devnull@localhost> | 2004-11-12 17:30:38 +0000 |
---|---|---|
committer | Andrew de Quincy <devnull@localhost> | 2004-11-12 17:30:38 +0000 |
commit | 430869ff5d0ab7c72ce5452ad06baa61a1bf2cbf (patch) | |
tree | 99f6094da5678ab5100e106828be9d9628ab37f2 /linux/drivers | |
parent | 0f191893b127c16c0a9ccfc3557ddf4dbae2f1a9 (diff) | |
download | mediapointer-dvb-s2-430869ff5d0ab7c72ce5452ad06baa61a1bf2cbf.tar.gz mediapointer-dvb-s2-430869ff5d0ab7c72ce5452ad06baa61a1bf2cbf.tar.bz2 |
Added code to ensure CAMs are still present on open()/release()
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvb_ca_en50221.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/linux/drivers/media/dvb/dvb-core/dvb_ca_en50221.c index 2f96cdf0f..3e9e5aa87 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_ca_en50221.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_ca_en50221.c @@ -1518,7 +1518,13 @@ static int dvb_ca_en50221_io_open (struct inode *inode, struct file *file) return err; for (i = 0; i < ca->slot_count; i++) { + if (ca->slot_info[i].slot_state == DVB_CA_SLOTSTATE_RUNNING) { + /* for cards without IRQs, check if we can still talk to them */ + if (!(ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE)) + if (ca->pub->read_attribute_mem(ca->pub, i, 0) < 0) + dvb_ca_en50221_slot_shutdown (ca, i); + down_write (&ca->slot_info[i].sem); dvb_ringbuffer_flush (&ca->slot_info[i].rx_buffer); up_write (&ca->slot_info[i].sem); @@ -1546,6 +1552,7 @@ static int dvb_ca_en50221_io_release (struct inode *inode, struct file *file) struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; struct dvb_ca_private *ca = (struct dvb_ca_private *) dvbdev->priv; int err; + int i; dprintk ("%s\n", __FUNCTION__); @@ -1553,6 +1560,15 @@ static int dvb_ca_en50221_io_release (struct inode *inode, struct file *file) ca->open = 0; dvb_ca_en50221_thread_update_delay (ca); + /* for cards without IRQs, check if we can still talk to them */ + for (i = 0; i < ca->slot_count; i++) { + if (ca->slot_info[i].slot_state == DVB_CA_SLOTSTATE_RUNNING) { + if (!(ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE)) + if (ca->pub->read_attribute_mem(ca->pub, i, 0) < 0) + dvb_ca_en50221_slot_shutdown (ca, i); + } + } + err = dvb_generic_release (inode, file); if (err < 0) return err; |