13 #include <linux/device.h>
16 #include <linux/module.h>
22 #define EN50221_TAG_APP_INFO_ENQUIRY 0x9f8020
23 #define EN50221_TAG_CA_INFO_ENQUIRY 0x9f8030
24 #define EN50221_TAG_CA_PMT 0x9f8032
25 #define EN50221_TAG_ENTER_MENU 0x9f8022
48 static int fdtv_ca_get_caps(
void *
arg)
59 static int fdtv_ca_get_slot_info(
struct firedtv *fdtv,
void *
arg)
73 slot->
flags = fdtv_get_ca_flags(&stat);
77 static int fdtv_ca_app_info(
struct firedtv *fdtv,
void *arg)
84 static int fdtv_ca_info(
struct firedtv *fdtv,
void *arg)
91 static int fdtv_ca_get_mmi(
struct firedtv *fdtv,
void *arg)
98 static int fdtv_ca_get_msg(
struct firedtv *fdtv,
void *arg)
105 err = fdtv_ca_app_info(fdtv, arg);
108 err = fdtv_ca_info(fdtv, arg);
115 err = fdtv_ca_get_mmi(fdtv, arg);
126 static int fdtv_ca_pmt(
struct firedtv *fdtv,
void *arg)
134 if (msg->
msg[3] & 0x80) {
136 for (i = 0; i < (msg->
msg[3] & 0x7f); i++)
137 data_length = (data_length << 8) + msg->
msg[data_pos++];
139 data_length = msg->
msg[3];
145 static int fdtv_ca_send_msg(
struct firedtv *fdtv,
void *arg)
152 (msg->
msg[0] << 16) + (msg->
msg[1] << 8) + msg->
msg[2];
155 err = fdtv_ca_pmt(fdtv, arg);
176 static int fdtv_ca_ioctl(
struct file *
file,
unsigned int cmd,
void *arg)
188 err = fdtv_ca_get_caps(arg);
191 err = fdtv_ca_get_slot_info(fdtv, arg);
194 err = fdtv_ca_get_msg(fdtv, arg);
197 err = fdtv_ca_send_msg(fdtv, arg);
210 static unsigned int fdtv_ca_io_poll(
struct file *file,
poll_table *
wait)
220 .poll = fdtv_ca_io_poll,
228 .fops = &fdtv_ca_fops,
229 .kernel_ioctl = fdtv_ca_ioctl,
240 if (!fdtv_ca_ready(&stat))