aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/bt8xx/dst_ca.c94
1 files changed, 94 insertions, 0 deletions
diff --git a/drivers/media/dvb/bt8xx/dst_ca.c b/drivers/media/dvb/bt8xx/dst_ca.c
index baa8c9aa212b..6b2437501caf 100644
--- a/drivers/media/dvb/bt8xx/dst_ca.c
+++ b/drivers/media/dvb/bt8xx/dst_ca.c
@@ -308,6 +308,100 @@ static int ca_get_slot_info(struct dst_state *state, struct ca_slot_info *p_ca_s
308 return 0; 308 return 0;
309} 309}
310 310
311/* MMI */
312static int ca_get_mmi(struct dst_state *state, struct ca_msg *hw_msg, struct ca_msg *mmi_msg)
313{
314 static u8 get_mmi[] = { 0x07, 0x40, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x0f };
315
316 put_checksum(&get_mmi[0], 7);
317 if ((dst_put_ci(state, get_mmi, sizeof (get_mmi), hw_msg->msg, GET_REPLY)) < 0) {
318 dprintk(verbose, DST_CA_ERROR, 1, " -->dst_put_ci FAILED !");
319 return -1;
320 }
321 dprintk(verbose, DST_CA_NOTICE, 1, " -->dst_put_ci SUCCESS !");
322 memcpy(mmi_msg->msg, hw_msg->msg, hw_msg->msg[4]);
323
324 return 0;
325}
326
327/**
328 * Get Menu should be the first MMI function (like open !)
329 */
330static int ca_get_menu(struct dst_state *state)
331{
332 static u8 get_menu[] = { 0x07, 0x40, 0x00, 0x00, 0x09, 0x00, 0x00, 0xff };
333
334 put_checksum(&get_menu[0], 7);
335 if ((dst_put_ci(state, get_menu, sizeof (get_menu), get_menu, NO_REPLY)) < 0) {
336 dprintk(verbose, DST_CA_ERROR, 1, " -->dst_put_ci FAILED !");
337 return -1;
338 }
339 dprintk(verbose, DST_CA_NOTICE, 1, " -->dst_put_ci SUCCESS !");
340
341 return 0;
342}
343
344/**
345 * MMI Enq (Enquire the application to allow user input)
346 */
347static int ca_answer_menu(struct dst_state *state, struct ca_msg *hw_msg, struct ca_msg *menu_answ)
348{
349 u8 choice = 0;
350
351 static u8 answer_menu[] = { 0x08, 0x40, 0x00, 0x00, 0x0b, 0x01, 0x00, 0x01, 0xff };
352
353 /* derive answer from menu (This comes from the user) */
354 answer_menu[7] = choice;
355 put_checksum(&answer_menu[0], 7);
356 if ((dst_put_ci(state, answer_menu, sizeof (answer_menu), hw_msg->msg, NO_REPLY)) < 0) {
357 dprintk(verbose, DST_CA_ERROR, 1, " -->dst_put_ci FAILED !");
358 return -1;
359 }
360 dprintk(verbose, DST_CA_NOTICE, 1, " -->dst_put_ci SUCCESS !");
361
362 return 0;
363}
364
365static int ca_answer_mmi(struct dst_state *state, struct ca_msg *hw_msg, struct ca_msg *answ_msg)
366{
367 u8 answer =0, length = 0;
368
369 static u8 answer_mmi[] = { 0x08, 0x40, 0x00, 0x00, 0x08, 0x01, 0x00, 0x01, 0xff };
370
371 /* derive answer from answ_msg (This comes from the user) */
372 if (answer == 0) /* 0x00 == Cancel */
373 answer_mmi[7] = 0x00;
374 else { /* 0x01 == Answer */
375 length = strlen(answ_msg->msg);
376 memcpy(&answer_mmi[8], answ_msg->msg, length);
377 answer_mmi[0] += length;
378 answer_mmi[5] += length;
379 }
380 put_checksum(&answer_mmi[0], (8 + length));
381 if ((dst_put_ci(state, answer_mmi, sizeof (answer_mmi), hw_msg->msg, GET_REPLY)) < 0) {
382 dprintk(verbose, DST_CA_NOTICE, 1, " -->dst_put_ci FAILED !");
383
384 return -1;
385 }
386 dprintk(verbose, DST_CA_NOTICE, 1, " -->dst_put_ci SUCCESS !");
387
388 return 0;
389}
390
391static int ca_close_mmi(struct dst_state *state, struct ca_msg *hw_msg)
392{
393 static u8 close_mmi[] = { 0x07, 0x40, 0x00, 0x00, 0x0e, 0x00, 0x00, 0xff };
394
395 put_checksum(&close_mmi[0], 7);
396 if ((dst_put_ci(state, close_mmi, sizeof (close_mmi), hw_msg->msg, NO_REPLY)) < 0) {
397 dprintk(verbose, DST_CA_ERROR, 1, " -->dst_put_ci FAILED !");
398
399 return -1;
400 }
401 dprintk(verbose, DST_CA_NOTICE, 1, " -->dst_put_ci SUCCESS !");
402
403 return 0;
404}
311 405
312static int ca_get_message(struct dst_state *state, struct ca_msg *p_ca_message, void __user *arg) 406static int ca_get_message(struct dst_state *state, struct ca_msg *p_ca_message, void __user *arg)
313{ 407{