31 #include <linux/kernel.h>
32 #include <linux/types.h>
36 #include <linux/poll.h>
46 dprintk(8,
"av7110:%p\n",av7110);
52 if (data[2] != 1 && data[2] != 2)
96 for (
p = tab; *
p;
p++) {
129 u8 msg[8] = { 0x00, 0x06, 0x00, 0x00, 0xff, 0x02, 0x00, 0x00 };
131 for (i = 0; i < 2; i++) {
132 if (slots & (1 << i))
139 for (i = 0; i < 2; i++) {
140 if (slots & (1 << i)) {
151 const char __user *
buf,
size_t count, loff_t *ppos)
170 if (count + 2 > free) {
190 char __user *buf,
size_t count, loff_t *ppos)
196 if (!cibuf->
data || !count)
208 if (avail < len + 2 || count < len)
215 static int dvb_ca_open(
struct inode *
inode,
struct file *file)
221 dprintk(8,
"av7110:%p\n",av7110);
229 static unsigned int dvb_ca_poll (
struct file *file,
poll_table *
wait)
232 struct av7110 *av7110 = dvbdev->
priv;
235 unsigned int mask = 0;
237 dprintk(8,
"av7110:%p\n",av7110);
239 poll_wait(file, &rbuf->
queue, wait);
240 poll_wait(file, &wbuf->
queue, wait);
251 static int dvb_ca_ioctl(
struct file *file,
unsigned int cmd,
void *parg)
254 struct av7110 *av7110 = dvbdev->
priv;
255 unsigned long arg = (
unsigned long) parg;
257 dprintk(8,
"av7110:%p\n",av7110);
272 memcpy(parg, &cap,
sizeof(cap));
280 if (info->
num < 0 || info->
num > 1)
301 memcpy(parg, &info,
sizeof (info));
309 if (descr->
index >= 16)
315 (descr->
cw[0]<<8)|descr->
cw[1],
316 (descr->
cw[2]<<8)|descr->
cw[3],
317 (descr->
cw[4]<<8)|descr->
cw[5],
318 (descr->
cw[6]<<8)|descr->
cw[7]);
328 static ssize_t dvb_ca_write(
struct file *file,
const char __user *buf,
329 size_t count, loff_t *ppos)
332 struct av7110 *av7110 = dvbdev->
priv;
334 dprintk(8,
"av7110:%p\n",av7110);
335 return ci_ll_write(&av7110->
ci_wbuffer, file, buf, count, ppos);
338 static ssize_t dvb_ca_read(
struct file *file,
char __user *buf,
339 size_t count, loff_t *ppos)
342 struct av7110 *av7110 = dvbdev->
priv;
344 dprintk(8,
"av7110:%p\n",av7110);
345 return ci_ll_read(&av7110->
ci_rbuffer, file, buf, count, ppos);
351 .write = dvb_ca_write,
363 .fops = &dvb_ca_fops,
364 .kernel_ioctl = dvb_ca_ioctl,