diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-23 15:13:56 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-25 01:05:24 -0400 |
commit | b57e5578f913a304e97cb66aa0044a894ca47f2f (patch) | |
tree | 2f0210661e2f42e10e121311092b6cd1c948914a /drivers/media/dvb | |
parent | 45f87a21735804760dd7db0e2e3c609c332b15e3 (diff) |
Fixes some sync issues between V4L/DVB development and GIT
Some changes didn't went ok to -git, probably due to changes at merging
patches.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/bt8xx/dst_ca.c | 205 |
1 files changed, 7 insertions, 198 deletions
diff --git a/drivers/media/dvb/bt8xx/dst_ca.c b/drivers/media/dvb/bt8xx/dst_ca.c index 6b2437501caf..fa923b9b346e 100644 --- a/drivers/media/dvb/bt8xx/dst_ca.c +++ b/drivers/media/dvb/bt8xx/dst_ca.c | |||
@@ -308,100 +308,6 @@ 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 */ | ||
312 | static 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 | */ | ||
330 | static 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 | */ | ||
347 | static 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 | |||
365 | static 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 | |||
391 | static 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 | } | ||
405 | 311 | ||
406 | static int ca_get_message(struct dst_state *state, struct ca_msg *p_ca_message, void __user *arg) | 312 | static int ca_get_message(struct dst_state *state, struct ca_msg *p_ca_message, void __user *arg) |
407 | { | 313 | { |
@@ -512,100 +418,6 @@ static int debug_string(u8 *msg, u32 length, u32 offset) | |||
512 | return 0; | 418 | return 0; |
513 | } | 419 | } |
514 | 420 | ||
515 | /* MMI */ | ||
516 | static int ca_get_mmi(struct dst_state *state, struct ca_msg *hw_msg, struct ca_msg *mmi_msg) | ||
517 | { | ||
518 | static u8 get_mmi[] = { 0x07, 0x40, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x0f }; | ||
519 | |||
520 | put_checksum(&get_mmi[0], 7); | ||
521 | if ((dst_put_ci(state, get_mmi, sizeof (get_mmi), hw_msg->msg, GET_REPLY)) < 0) { | ||
522 | dprintk(verbose, DST_CA_ERROR, 1, " -->dst_put_ci FAILED !"); | ||
523 | return -1; | ||
524 | } | ||
525 | dprintk(verbose, DST_CA_NOTICE, 1, " -->dst_put_ci SUCCESS !"); | ||
526 | memcpy(mmi_msg->msg, hw_msg->msg, hw_msg->msg[4]); | ||
527 | |||
528 | return 0; | ||
529 | } | ||
530 | |||
531 | /** | ||
532 | * Get Menu should be the first MMI function (like open !) | ||
533 | */ | ||
534 | static int ca_get_menu(struct dst_state *state) | ||
535 | { | ||
536 | static u8 get_menu[] = { 0x07, 0x40, 0x00, 0x00, 0x09, 0x00, 0x00, 0xff }; | ||
537 | |||
538 | put_checksum(&get_menu[0], 7); | ||
539 | if ((dst_put_ci(state, get_menu, sizeof (get_menu), get_menu, NO_REPLY)) < 0) { | ||
540 | dprintk(verbose, DST_CA_ERROR, 1, " -->dst_put_ci FAILED !"); | ||
541 | return -1; | ||
542 | } | ||
543 | dprintk(verbose, DST_CA_NOTICE, 1, " -->dst_put_ci SUCCESS !"); | ||
544 | |||
545 | return 0; | ||
546 | } | ||
547 | |||
548 | /** | ||
549 | * MMI Enq (Enquire the application to allow user input) | ||
550 | */ | ||
551 | static int ca_answer_menu(struct dst_state *state, struct ca_msg *hw_msg, struct ca_msg *menu_answ) | ||
552 | { | ||
553 | u8 choice = 0; | ||
554 | |||
555 | static u8 answer_menu[] = { 0x08, 0x40, 0x00, 0x00, 0x0b, 0x01, 0x00, 0x01, 0xff }; | ||
556 | |||
557 | /* derive answer from menu (This comes from the user) */ | ||
558 | answer_menu[7] = choice; | ||
559 | put_checksum(&answer_menu[0], 7); | ||
560 | if ((dst_put_ci(state, answer_menu, sizeof (answer_menu), hw_msg->msg, NO_REPLY)) < 0) { | ||
561 | dprintk(verbose, DST_CA_ERROR, 1, " -->dst_put_ci FAILED !"); | ||
562 | return -1; | ||
563 | } | ||
564 | dprintk(verbose, DST_CA_NOTICE, 1, " -->dst_put_ci SUCCESS !"); | ||
565 | |||
566 | return 0; | ||
567 | } | ||
568 | |||
569 | static int ca_answer_mmi(struct dst_state *state, struct ca_msg *hw_msg, struct ca_msg *answ_msg) | ||
570 | { | ||
571 | u8 answer =0, length = 0; | ||
572 | |||
573 | static u8 answer_mmi[] = { 0x08, 0x40, 0x00, 0x00, 0x08, 0x01, 0x00, 0x01, 0xff }; | ||
574 | |||
575 | /* derive answer from answ_msg (This comes from the user) */ | ||
576 | if (answer == 0) /* 0x00 == Cancel */ | ||
577 | answer_mmi[7] = 0x00; | ||
578 | else { /* 0x01 == Answer */ | ||
579 | length = strlen(answ_msg->msg); | ||
580 | memcpy(&answer_mmi[8], answ_msg->msg, length); | ||
581 | answer_mmi[0] += length; | ||
582 | answer_mmi[5] += length; | ||
583 | } | ||
584 | put_checksum(&answer_mmi[0], (8 + length)); | ||
585 | if ((dst_put_ci(state, answer_mmi, sizeof (answer_mmi), hw_msg->msg, GET_REPLY)) < 0) { | ||
586 | dprintk(verbose, DST_CA_NOTICE, 1, " -->dst_put_ci FAILED !"); | ||
587 | |||
588 | return -1; | ||
589 | } | ||
590 | dprintk(verbose, DST_CA_NOTICE, 1, " -->dst_put_ci SUCCESS !"); | ||
591 | |||
592 | return 0; | ||
593 | } | ||
594 | |||
595 | static int ca_close_mmi(struct dst_state *state, struct ca_msg *hw_msg) | ||
596 | { | ||
597 | static u8 close_mmi[] = { 0x07, 0x40, 0x00, 0x00, 0x0e, 0x00, 0x00, 0xff }; | ||
598 | |||
599 | put_checksum(&close_mmi[0], 7); | ||
600 | if ((dst_put_ci(state, close_mmi, sizeof (close_mmi), hw_msg->msg, NO_REPLY)) < 0) { | ||
601 | dprintk(verbose, DST_CA_ERROR, 1, " -->dst_put_ci FAILED !"); | ||
602 | |||
603 | return -1; | ||
604 | } | ||
605 | dprintk(verbose, DST_CA_NOTICE, 1, " -->dst_put_ci SUCCESS !"); | ||
606 | |||
607 | return 0; | ||
608 | } | ||
609 | 421 | ||
610 | static int ca_set_pmt(struct dst_state *state, struct ca_msg *p_ca_message, struct ca_msg *hw_buffer, u8 reply, u8 query) | 422 | static int ca_set_pmt(struct dst_state *state, struct ca_msg *p_ca_message, struct ca_msg *hw_buffer, u8 reply, u8 query) |
611 | { | 423 | { |
@@ -750,18 +562,15 @@ static int dst_ca_ioctl(struct inode *inode, struct file *file, unsigned int cmd | |||
750 | void __user *arg = (void __user *)ioctl_arg; | 562 | void __user *arg = (void __user *)ioctl_arg; |
751 | int result = 0; | 563 | int result = 0; |
752 | 564 | ||
753 | if ((p_ca_message = (struct ca_msg *) kmalloc(sizeof (struct ca_msg), GFP_KERNEL)) == NULL) { | 565 | p_ca_message = kmalloc(sizeof (struct ca_msg), GFP_KERNEL); |
754 | dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure"); | 566 | p_ca_slot_info = kmalloc(sizeof (struct ca_slot_info), GFP_KERNEL); |
755 | return -ENOMEM; | 567 | p_ca_caps = kmalloc(sizeof (struct ca_caps), GFP_KERNEL); |
756 | } | 568 | if (!p_ca_message || !p_ca_slot_info || !p_ca_caps) { |
757 | if ((p_ca_slot_info = (struct ca_slot_info *) kmalloc(sizeof (struct ca_slot_info), GFP_KERNEL)) == NULL) { | ||
758 | dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure"); | 569 | dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure"); |
759 | return -ENOMEM; | 570 | result = -ENOMEM; |
760 | } | 571 | goto free_mem_and_exit; |
761 | if ((p_ca_caps = (struct ca_caps *) kmalloc(sizeof (struct ca_caps), GFP_KERNEL)) == NULL) { | ||
762 | dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure"); | ||
763 | return -ENOMEM; | ||
764 | } | 572 | } |
573 | |||
765 | /* We have now only the standard ioctl's, the driver is upposed to handle internals. */ | 574 | /* We have now only the standard ioctl's, the driver is upposed to handle internals. */ |
766 | switch (cmd) { | 575 | switch (cmd) { |
767 | case CA_SEND_MSG: | 576 | case CA_SEND_MSG: |