• Home
  • Raw
  • Download

Lines Matching +full:1 +full:c

4  * Copyright (C) 2004 Andreas Monitzer <andy@monitzer.com>
5 * Copyright (C) 2008 Ben Backx <ben@bbackx.com>
6 * Copyright (C) 2008 Henrik Kurelid <henrik@kurelid.se>
92 #define LAST_OPERAND (509 - 1)
94 static inline void clear_operands(struct avc_command_frame *c, int from, int to) in clear_operands() argument
96 memset(&c->operand[from], 0, to - from + 1); in clear_operands()
99 static void pad_operands(struct avc_command_frame *c, int from) in pad_operands() argument
104 clear_operands(c, from, to); in pad_operands()
133 ", or a combination, or all = -1)");
142 static int fake_ca_system_ids[4] = { -1, -1, -1, -1 };
212 subunit_type = data[1] >> 3; in debug_fcp()
213 subunit_id = data[1] & 7; in debug_fcp()
223 16, 1, data, length, false); in debug_fcp()
231 16, 1, msg, length, false); in debug_pmt()
253 * AV/C specs say that answers should be sent within 150 ms. in avc_write()
270 r->operand[1] == SFE_VENDOR_DE_COMPANYID_1 && in is_register_rc()
315 int i, n, pos = 1; in add_pid_filter()
340 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_tuner_tuneqpsk() local
342 c->opcode = AVC_OPCODE_VENDOR; in avc_tuner_tuneqpsk()
344 c->operand[0] = SFE_VENDOR_DE_COMPANYID_0; in avc_tuner_tuneqpsk()
345 c->operand[1] = SFE_VENDOR_DE_COMPANYID_1; in avc_tuner_tuneqpsk()
346 c->operand[2] = SFE_VENDOR_DE_COMPANYID_2; in avc_tuner_tuneqpsk()
348 c->operand[3] = SFE_VENDOR_OPCODE_TUNE_QPSK2; in avc_tuner_tuneqpsk()
350 c->operand[3] = SFE_VENDOR_OPCODE_TUNE_QPSK; in avc_tuner_tuneqpsk()
352 c->operand[4] = (p->frequency >> 24) & 0xff; in avc_tuner_tuneqpsk()
353 c->operand[5] = (p->frequency >> 16) & 0xff; in avc_tuner_tuneqpsk()
354 c->operand[6] = (p->frequency >> 8) & 0xff; in avc_tuner_tuneqpsk()
355 c->operand[7] = p->frequency & 0xff; in avc_tuner_tuneqpsk()
357 c->operand[8] = ((p->symbol_rate / 1000) >> 8) & 0xff; in avc_tuner_tuneqpsk()
358 c->operand[9] = (p->symbol_rate / 1000) & 0xff; in avc_tuner_tuneqpsk()
361 case FEC_1_2: c->operand[10] = 0x1; break; in avc_tuner_tuneqpsk()
362 case FEC_2_3: c->operand[10] = 0x2; break; in avc_tuner_tuneqpsk()
363 case FEC_3_4: c->operand[10] = 0x3; break; in avc_tuner_tuneqpsk()
364 case FEC_5_6: c->operand[10] = 0x4; break; in avc_tuner_tuneqpsk()
365 case FEC_7_8: c->operand[10] = 0x5; break; in avc_tuner_tuneqpsk()
369 default: c->operand[10] = 0x0; in avc_tuner_tuneqpsk()
373 c->operand[11] = 0xff; in avc_tuner_tuneqpsk()
375 c->operand[11] = 0; in avc_tuner_tuneqpsk()
377 c->operand[11] = 1; in avc_tuner_tuneqpsk()
380 c->operand[12] = 0xff; in avc_tuner_tuneqpsk()
382 c->operand[12] = 1; in avc_tuner_tuneqpsk()
384 c->operand[12] = 0; in avc_tuner_tuneqpsk()
389 case QAM_16: c->operand[13] = 0x1; break; in avc_tuner_tuneqpsk()
390 case QPSK: c->operand[13] = 0x2; break; in avc_tuner_tuneqpsk()
391 case PSK_8: c->operand[13] = 0x3; break; in avc_tuner_tuneqpsk()
392 default: c->operand[13] = 0x2; break; in avc_tuner_tuneqpsk()
395 case ROLLOFF_35: c->operand[14] = 0x2; break; in avc_tuner_tuneqpsk()
396 case ROLLOFF_20: c->operand[14] = 0x0; break; in avc_tuner_tuneqpsk()
397 case ROLLOFF_25: c->operand[14] = 0x1; break; in avc_tuner_tuneqpsk()
399 default: c->operand[14] = 0x2; break; in avc_tuner_tuneqpsk()
400 /* case ROLLOFF_NONE: c->operand[14] = 0xff; break; */ in avc_tuner_tuneqpsk()
403 case PILOT_AUTO: c->operand[15] = 0x0; break; in avc_tuner_tuneqpsk()
404 case PILOT_OFF: c->operand[15] = 0x0; break; in avc_tuner_tuneqpsk()
405 case PILOT_ON: c->operand[15] = 0x1; break; in avc_tuner_tuneqpsk()
408 c->operand[13] = 0x1; /* auto modulation */ in avc_tuner_tuneqpsk()
409 c->operand[14] = 0xff; /* disable rolloff */ in avc_tuner_tuneqpsk()
410 c->operand[15] = 0xff; /* disable pilot */ in avc_tuner_tuneqpsk()
421 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_tuner_dsd_dvb_c() local
423 c->opcode = AVC_OPCODE_DSD; in avc_tuner_dsd_dvb_c()
425 c->operand[0] = 0; /* source plug */ in avc_tuner_dsd_dvb_c()
426 c->operand[1] = 0xd2; /* subfunction replace */ in avc_tuner_dsd_dvb_c()
427 c->operand[2] = 0x20; /* system id = DVB */ in avc_tuner_dsd_dvb_c()
428 c->operand[3] = 0x00; /* antenna number */ in avc_tuner_dsd_dvb_c()
429 c->operand[4] = 0x11; /* system_specific_multiplex selection_length */ in avc_tuner_dsd_dvb_c()
432 c->operand[5] = 0 << 7 /* reserved */ in avc_tuner_dsd_dvb_c()
435 | 1 << 4 /* Frequency */ in avc_tuner_dsd_dvb_c()
436 | 1 << 3 /* Symbol_Rate */ in avc_tuner_dsd_dvb_c()
438 | (p->fec_inner != FEC_AUTO ? 1 << 1 : 0) in avc_tuner_dsd_dvb_c()
439 | (p->modulation != QAM_AUTO ? 1 << 0 : 0); in avc_tuner_dsd_dvb_c()
442 c->operand[6] = 0 << 7 /* NetworkID */ in avc_tuner_dsd_dvb_c()
445 c->operand[7] = 0x00; in avc_tuner_dsd_dvb_c()
446 c->operand[8] = 0x00; in avc_tuner_dsd_dvb_c()
447 c->operand[9] = 0x00; in avc_tuner_dsd_dvb_c()
448 c->operand[10] = 0x00; in avc_tuner_dsd_dvb_c()
450 c->operand[11] = (((p->frequency / 4000) >> 16) & 0xff) | (2 << 6); in avc_tuner_dsd_dvb_c()
451 c->operand[12] = ((p->frequency / 4000) >> 8) & 0xff; in avc_tuner_dsd_dvb_c()
452 c->operand[13] = (p->frequency / 4000) & 0xff; in avc_tuner_dsd_dvb_c()
453 c->operand[14] = ((p->symbol_rate / 1000) >> 12) & 0xff; in avc_tuner_dsd_dvb_c()
454 c->operand[15] = ((p->symbol_rate / 1000) >> 4) & 0xff; in avc_tuner_dsd_dvb_c()
455 c->operand[16] = ((p->symbol_rate / 1000) << 4) & 0xf0; in avc_tuner_dsd_dvb_c()
456 c->operand[17] = 0x00; in avc_tuner_dsd_dvb_c()
459 case FEC_1_2: c->operand[18] = 0x1; break; in avc_tuner_dsd_dvb_c()
460 case FEC_2_3: c->operand[18] = 0x2; break; in avc_tuner_dsd_dvb_c()
461 case FEC_3_4: c->operand[18] = 0x3; break; in avc_tuner_dsd_dvb_c()
462 case FEC_5_6: c->operand[18] = 0x4; break; in avc_tuner_dsd_dvb_c()
463 case FEC_7_8: c->operand[18] = 0x5; break; in avc_tuner_dsd_dvb_c()
464 case FEC_8_9: c->operand[18] = 0x6; break; in avc_tuner_dsd_dvb_c()
465 case FEC_4_5: c->operand[18] = 0x8; break; in avc_tuner_dsd_dvb_c()
467 default: c->operand[18] = 0x0; in avc_tuner_dsd_dvb_c()
471 case QAM_16: c->operand[19] = 0x08; break; in avc_tuner_dsd_dvb_c()
472 case QAM_32: c->operand[19] = 0x10; break; in avc_tuner_dsd_dvb_c()
473 case QAM_64: c->operand[19] = 0x18; break; in avc_tuner_dsd_dvb_c()
474 case QAM_128: c->operand[19] = 0x20; break; in avc_tuner_dsd_dvb_c()
475 case QAM_256: c->operand[19] = 0x28; break; in avc_tuner_dsd_dvb_c()
477 default: c->operand[19] = 0x00; in avc_tuner_dsd_dvb_c()
480 c->operand[20] = 0x00; in avc_tuner_dsd_dvb_c()
481 c->operand[21] = 0x00; in avc_tuner_dsd_dvb_c()
483 return 22 + add_pid_filter(fdtv, &c->operand[22]); in avc_tuner_dsd_dvb_c()
489 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_tuner_dsd_dvb_t() local
491 c->opcode = AVC_OPCODE_DSD; in avc_tuner_dsd_dvb_t()
493 c->operand[0] = 0; /* source plug */ in avc_tuner_dsd_dvb_t()
494 c->operand[1] = 0xd2; /* subfunction replace */ in avc_tuner_dsd_dvb_t()
495 c->operand[2] = 0x20; /* system id = DVB */ in avc_tuner_dsd_dvb_t()
496 c->operand[3] = 0x00; /* antenna number */ in avc_tuner_dsd_dvb_t()
497 c->operand[4] = 0x0c; /* system_specific_multiplex selection_length */ in avc_tuner_dsd_dvb_t()
500 c->operand[5] = in avc_tuner_dsd_dvb_t()
502 | 1 << 6 /* CenterFrequency */ in avc_tuner_dsd_dvb_t()
503 | (p->bandwidth_hz != 0 ? 1 << 5 : 0) in avc_tuner_dsd_dvb_t()
504 | (p->modulation != QAM_AUTO ? 1 << 4 : 0) in avc_tuner_dsd_dvb_t()
505 | (p->hierarchy != HIERARCHY_AUTO ? 1 << 3 : 0) in avc_tuner_dsd_dvb_t()
506 | (p->code_rate_HP != FEC_AUTO ? 1 << 2 : 0) in avc_tuner_dsd_dvb_t()
507 | (p->code_rate_LP != FEC_AUTO ? 1 << 1 : 0) in avc_tuner_dsd_dvb_t()
508 | (p->guard_interval != GUARD_INTERVAL_AUTO ? 1 << 0 : 0); in avc_tuner_dsd_dvb_t()
511 c->operand[6] = in avc_tuner_dsd_dvb_t()
513 | (p->transmission_mode != TRANSMISSION_MODE_AUTO ? 1 << 6 : 0) in avc_tuner_dsd_dvb_t()
517 c->operand[7] = 0x0; in avc_tuner_dsd_dvb_t()
518 c->operand[8] = (p->frequency / 10) >> 24; in avc_tuner_dsd_dvb_t()
519 c->operand[9] = ((p->frequency / 10) >> 16) & 0xff; in avc_tuner_dsd_dvb_t()
520 c->operand[10] = ((p->frequency / 10) >> 8) & 0xff; in avc_tuner_dsd_dvb_t()
521 c->operand[11] = (p->frequency / 10) & 0xff; in avc_tuner_dsd_dvb_t()
524 case 7000000: c->operand[12] = 0x20; break; in avc_tuner_dsd_dvb_t()
528 default: c->operand[12] = 0x00; in avc_tuner_dsd_dvb_t()
532 case QAM_16: c->operand[13] = 1 << 6; break; in avc_tuner_dsd_dvb_t()
533 case QAM_64: c->operand[13] = 2 << 6; break; in avc_tuner_dsd_dvb_t()
535 default: c->operand[13] = 0x00; in avc_tuner_dsd_dvb_t()
539 case HIERARCHY_1: c->operand[13] |= 1 << 3; break; in avc_tuner_dsd_dvb_t()
540 case HIERARCHY_2: c->operand[13] |= 2 << 3; break; in avc_tuner_dsd_dvb_t()
541 case HIERARCHY_4: c->operand[13] |= 3 << 3; break; in avc_tuner_dsd_dvb_t()
548 case FEC_2_3: c->operand[13] |= 1; break; in avc_tuner_dsd_dvb_t()
549 case FEC_3_4: c->operand[13] |= 2; break; in avc_tuner_dsd_dvb_t()
550 case FEC_5_6: c->operand[13] |= 3; break; in avc_tuner_dsd_dvb_t()
551 case FEC_7_8: c->operand[13] |= 4; break; in avc_tuner_dsd_dvb_t()
557 case FEC_2_3: c->operand[14] = 1 << 5; break; in avc_tuner_dsd_dvb_t()
558 case FEC_3_4: c->operand[14] = 2 << 5; break; in avc_tuner_dsd_dvb_t()
559 case FEC_5_6: c->operand[14] = 3 << 5; break; in avc_tuner_dsd_dvb_t()
560 case FEC_7_8: c->operand[14] = 4 << 5; break; in avc_tuner_dsd_dvb_t()
562 default: c->operand[14] = 0x00; break; in avc_tuner_dsd_dvb_t()
566 case GUARD_INTERVAL_1_16: c->operand[14] |= 1 << 3; break; in avc_tuner_dsd_dvb_t()
567 case GUARD_INTERVAL_1_8: c->operand[14] |= 2 << 3; break; in avc_tuner_dsd_dvb_t()
568 case GUARD_INTERVAL_1_4: c->operand[14] |= 3 << 3; break; in avc_tuner_dsd_dvb_t()
575 case TRANSMISSION_MODE_8K: c->operand[14] |= 1 << 1; break; in avc_tuner_dsd_dvb_t()
581 c->operand[15] = 0x00; /* network_ID[0] */ in avc_tuner_dsd_dvb_t()
582 c->operand[16] = 0x00; /* network_ID[1] */ in avc_tuner_dsd_dvb_t()
584 return 17 + add_pid_filter(fdtv, &c->operand[17]); in avc_tuner_dsd_dvb_t()
590 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_tuner_dsd() local
595 c->ctype = AVC_CTYPE_CONTROL; in avc_tuner_dsd()
596 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_tuner_dsd()
606 pad_operands(c, pos); in avc_tuner_dsd()
629 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_tuner_set_pids() local
637 c->ctype = AVC_CTYPE_CONTROL; in avc_tuner_set_pids()
638 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_tuner_set_pids()
639 c->opcode = AVC_OPCODE_DSD; in avc_tuner_set_pids()
641 c->operand[0] = 0; /* source plug */ in avc_tuner_set_pids()
642 c->operand[1] = 0xd2; /* subfunction replace */ in avc_tuner_set_pids()
643 c->operand[2] = 0x20; /* system id = DVB */ in avc_tuner_set_pids()
644 c->operand[3] = 0x00; /* antenna number */ in avc_tuner_set_pids()
645 c->operand[4] = 0x00; /* system_specific_multiplex selection_length */ in avc_tuner_set_pids()
646 c->operand[5] = pidc; /* Nr_of_dsd_sel_specs */ in avc_tuner_set_pids()
651 c->operand[pos++] = 0x13; /* flowfunction relay */ in avc_tuner_set_pids()
652 c->operand[pos++] = 0x80; /* dsd_sel_spec_valid_flags -> PID */ in avc_tuner_set_pids()
653 c->operand[pos++] = (pid[k] >> 8) & 0x1f; in avc_tuner_set_pids()
654 c->operand[pos++] = pid[k] & 0xff; in avc_tuner_set_pids()
655 c->operand[pos++] = 0x00; /* tableID */ in avc_tuner_set_pids()
656 c->operand[pos++] = 0x00; /* filter_length */ in avc_tuner_set_pids()
658 pad_operands(c, pos); in avc_tuner_set_pids()
675 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_tuner_get_ts() local
680 c->ctype = AVC_CTYPE_CONTROL; in avc_tuner_get_ts()
681 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_tuner_get_ts()
682 c->opcode = AVC_OPCODE_DSIT; in avc_tuner_get_ts()
686 c->operand[0] = 0; /* source plug */ in avc_tuner_get_ts()
687 c->operand[1] = 0xd2; /* subfunction replace */ in avc_tuner_get_ts()
688 c->operand[2] = 0xff; /* status */ in avc_tuner_get_ts()
689 c->operand[3] = 0x20; /* system id = DVB */ in avc_tuner_get_ts()
690 c->operand[4] = 0x00; /* antenna number */ in avc_tuner_get_ts()
691 c->operand[5] = 0x0; /* system_specific_search_flags */ in avc_tuner_get_ts()
692 c->operand[6] = sl; /* system_specific_multiplex selection_length */ in avc_tuner_get_ts()
695 * operand[8]: valid_flags[1] in avc_tuner_get_ts()
698 clear_operands(c, 7, 24); in avc_tuner_get_ts()
715 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_identify_subunit() local
721 c->ctype = AVC_CTYPE_CONTROL; in avc_identify_subunit()
722 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_identify_subunit()
723 c->opcode = AVC_OPCODE_READ_DESCRIPTOR; in avc_identify_subunit()
725 c->operand[0] = DESCRIPTOR_SUBUNIT_IDENTIFIER; in avc_identify_subunit()
726 c->operand[1] = 0xff; in avc_identify_subunit()
727 c->operand[2] = 0x00; in avc_identify_subunit()
728 c->operand[3] = 0x00; /* length highbyte */ in avc_identify_subunit()
729 c->operand[4] = 0x08; /* length lowbyte */ in avc_identify_subunit()
730 c->operand[5] = 0x00; /* offset highbyte */ in avc_identify_subunit()
731 c->operand[6] = 0x0d; /* offset lowbyte */ in avc_identify_subunit()
732 clear_operands(c, 7, 8); /* padding */ in avc_identify_subunit()
755 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_tuner_status() local
761 c->ctype = AVC_CTYPE_CONTROL; in avc_tuner_status()
762 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_tuner_status()
763 c->opcode = AVC_OPCODE_READ_DESCRIPTOR; in avc_tuner_status()
765 c->operand[0] = DESCRIPTOR_TUNER_STATUS; in avc_tuner_status()
766 c->operand[1] = 0xff; /* read_result_status */ in avc_tuner_status()
772 clear_operands(c, 2, 31); in avc_tuner_status()
787 if (r->operand[1] != 0x10 || length != SIZEOF_ANTENNA_INPUT_INFO) { in avc_tuner_status()
794 stat->searching = r->operand[11] >> 7 & 1; in avc_tuner_status()
795 stat->moving = r->operand[11] >> 6 & 1; in avc_tuner_status()
796 stat->no_rf = r->operand[11] >> 5 & 1; in avc_tuner_status()
797 stat->input = r->operand[12] >> 7 & 1; in avc_tuner_status()
809 stat->front_end_error = r->operand[22] >> 4 & 1; in avc_tuner_status()
810 stat->antenna_error = r->operand[22] >> 3 & 1; in avc_tuner_status()
811 stat->front_end_power_status = r->operand[22] >> 1 & 1; in avc_tuner_status()
812 stat->power_supply = r->operand[22] & 1; in avc_tuner_status()
818 stat->ca_mmi = r->operand[30] & 1; in avc_tuner_status()
819 stat->ca_pmt_reply = r->operand[31] >> 7 & 1; in avc_tuner_status()
820 stat->ca_date_time_request = r->operand[31] >> 6 & 1; in avc_tuner_status()
821 stat->ca_application_info = r->operand[31] >> 5 & 1; in avc_tuner_status()
822 stat->ca_module_present_status = r->operand[31] >> 4 & 1; in avc_tuner_status()
823 stat->ca_dvb_flag = r->operand[31] >> 3 & 1; in avc_tuner_status()
824 stat->ca_error_flag = r->operand[31] >> 2 & 1; in avc_tuner_status()
825 stat->ca_initialization_status = r->operand[31] >> 1 & 1; in avc_tuner_status()
836 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_lnb_control() local
842 c->ctype = AVC_CTYPE_CONTROL; in avc_lnb_control()
843 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_lnb_control()
844 c->opcode = AVC_OPCODE_VENDOR; in avc_lnb_control()
846 c->operand[0] = SFE_VENDOR_DE_COMPANYID_0; in avc_lnb_control()
847 c->operand[1] = SFE_VENDOR_DE_COMPANYID_1; in avc_lnb_control()
848 c->operand[2] = SFE_VENDOR_DE_COMPANYID_2; in avc_lnb_control()
849 c->operand[3] = SFE_VENDOR_OPCODE_LNB_CONTROL; in avc_lnb_control()
850 c->operand[4] = voltage; in avc_lnb_control()
851 c->operand[5] = nrdiseq; in avc_lnb_control()
855 c->operand[pos++] = diseqcmd[j].msg_len; in avc_lnb_control()
858 c->operand[pos++] = diseqcmd[j].msg[k]; in avc_lnb_control()
860 c->operand[pos++] = burst; in avc_lnb_control()
861 c->operand[pos++] = conttone; in avc_lnb_control()
862 pad_operands(c, pos); in avc_lnb_control()
881 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_register_remote_control() local
886 c->ctype = AVC_CTYPE_NOTIFY; in avc_register_remote_control()
887 c->subunit = AVC_SUBUNIT_TYPE_UNIT | 7; in avc_register_remote_control()
888 c->opcode = AVC_OPCODE_VENDOR; in avc_register_remote_control()
890 c->operand[0] = SFE_VENDOR_DE_COMPANYID_0; in avc_register_remote_control()
891 c->operand[1] = SFE_VENDOR_DE_COMPANYID_1; in avc_register_remote_control()
892 c->operand[2] = SFE_VENDOR_DE_COMPANYID_2; in avc_register_remote_control()
893 c->operand[3] = SFE_VENDOR_OPCODE_REGISTER_REMOTE_CONTROL; in avc_register_remote_control()
894 c->operand[4] = 0; /* padding */ in avc_register_remote_control()
918 struct avc_command_frame *c = (void *)fdtv->avc_data;
923 c->ctype = AVC_CTYPE_CONTROL;
924 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
925 c->opcode = AVC_OPCODE_VENDOR;
927 c->operand[0] = SFE_VENDOR_DE_COMPANYID_0;
928 c->operand[1] = SFE_VENDOR_DE_COMPANYID_1;
929 c->operand[2] = SFE_VENDOR_DE_COMPANYID_2;
930 c->operand[3] = SFE_VENDOR_OPCODE_HOST2CA;
931 c->operand[4] = 0; /* slot */
932 c->operand[5] = SFE_VENDOR_TAG_CA_APPLICATION_INFO; /* ca tag */
933 clear_operands(c, 6, 8);
948 int length = 1; in get_ca_object_pos()
952 length = (r->operand[7] & 0x7f) + 1; in get_ca_object_pos()
974 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_ca_app_info() local
980 c->ctype = AVC_CTYPE_STATUS; in avc_ca_app_info()
981 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_ca_app_info()
982 c->opcode = AVC_OPCODE_VENDOR; in avc_ca_app_info()
984 c->operand[0] = SFE_VENDOR_DE_COMPANYID_0; in avc_ca_app_info()
985 c->operand[1] = SFE_VENDOR_DE_COMPANYID_1; in avc_ca_app_info()
986 c->operand[2] = SFE_VENDOR_DE_COMPANYID_2; in avc_ca_app_info()
987 c->operand[3] = SFE_VENDOR_OPCODE_CA2HOST; in avc_ca_app_info()
988 c->operand[4] = 0; /* slot */ in avc_ca_app_info()
989 c->operand[5] = SFE_VENDOR_TAG_CA_APPLICATION_INFO; /* ca tag */ in avc_ca_app_info()
990 clear_operands(c, 6, LAST_OPERAND); in avc_ca_app_info()
1001 app_info[1] = (EN50221_TAG_APP_INFO >> 8) & 0xff; in avc_ca_app_info()
1016 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_ca_info() local
1022 c->ctype = AVC_CTYPE_STATUS; in avc_ca_info()
1023 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_ca_info()
1024 c->opcode = AVC_OPCODE_VENDOR; in avc_ca_info()
1026 c->operand[0] = SFE_VENDOR_DE_COMPANYID_0; in avc_ca_info()
1027 c->operand[1] = SFE_VENDOR_DE_COMPANYID_1; in avc_ca_info()
1028 c->operand[2] = SFE_VENDOR_DE_COMPANYID_2; in avc_ca_info()
1029 c->operand[3] = SFE_VENDOR_OPCODE_CA2HOST; in avc_ca_info()
1030 c->operand[4] = 0; /* slot */ in avc_ca_info()
1031 c->operand[5] = SFE_VENDOR_TAG_CA_APPLICATION_INFO; /* ca tag */ in avc_ca_info()
1032 clear_operands(c, 6, LAST_OPERAND); in avc_ca_info()
1043 app_info[1] = (EN50221_TAG_CA_INFO >> 8) & 0xff; in avc_ca_info()
1048 app_info[5] = r->operand[pos + 1]; in avc_ca_info()
1066 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_ca_reset() local
1071 c->ctype = AVC_CTYPE_CONTROL; in avc_ca_reset()
1072 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_ca_reset()
1073 c->opcode = AVC_OPCODE_VENDOR; in avc_ca_reset()
1075 c->operand[0] = SFE_VENDOR_DE_COMPANYID_0; in avc_ca_reset()
1076 c->operand[1] = SFE_VENDOR_DE_COMPANYID_1; in avc_ca_reset()
1077 c->operand[2] = SFE_VENDOR_DE_COMPANYID_2; in avc_ca_reset()
1078 c->operand[3] = SFE_VENDOR_OPCODE_HOST2CA; in avc_ca_reset()
1079 c->operand[4] = 0; /* slot */ in avc_ca_reset()
1080 c->operand[5] = SFE_VENDOR_TAG_CA_RESET; /* ca tag */ in avc_ca_reset()
1081 c->operand[6] = 0; /* more/last */ in avc_ca_reset()
1082 c->operand[7] = 1; /* length */ in avc_ca_reset()
1083 c->operand[8] = 0; /* force hardware reset */ in avc_ca_reset()
1097 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_ca_pmt() local
1113 c->ctype = AVC_CTYPE_CONTROL; in avc_ca_pmt()
1114 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_ca_pmt()
1115 c->opcode = AVC_OPCODE_VENDOR; in avc_ca_pmt()
1128 c->operand[0] = SFE_VENDOR_DE_COMPANYID_0; in avc_ca_pmt()
1129 c->operand[1] = SFE_VENDOR_DE_COMPANYID_1; in avc_ca_pmt()
1130 c->operand[2] = SFE_VENDOR_DE_COMPANYID_2; in avc_ca_pmt()
1131 c->operand[3] = SFE_VENDOR_OPCODE_HOST2CA; in avc_ca_pmt()
1132 c->operand[4] = 0; /* slot */ in avc_ca_pmt()
1133 c->operand[5] = SFE_VENDOR_TAG_CA_PMT; /* ca tag */ in avc_ca_pmt()
1134 c->operand[6] = 0; /* more/last */ in avc_ca_pmt()
1136 c->operand[10] = list_management; in avc_ca_pmt()
1137 c->operand[11] = 0x01; /* pmt_cmd=OK_descramble */ in avc_ca_pmt()
1141 c->operand[12] = 0x02; /* Table id=2 */ in avc_ca_pmt()
1142 c->operand[13] = 0x80; /* Section syntax + length */ in avc_ca_pmt()
1144 c->operand[15] = msg[1]; /* Program number */ in avc_ca_pmt()
1145 c->operand[16] = msg[2]; in avc_ca_pmt()
1146 c->operand[17] = msg[3]; /* Version number and current/next */ in avc_ca_pmt()
1147 c->operand[18] = 0x00; /* Section number=0 */ in avc_ca_pmt()
1148 c->operand[19] = 0x00; /* Last section number=0 */ in avc_ca_pmt()
1149 c->operand[20] = 0x1f; /* PCR_PID=1FFF */ in avc_ca_pmt()
1150 c->operand[21] = 0xff; in avc_ca_pmt()
1151 c->operand[22] = (program_info_length >> 8); /* Program info length */ in avc_ca_pmt()
1152 c->operand[23] = (program_info_length & 0xff); in avc_ca_pmt()
1159 if (pmt_cmd_id != 1 && pmt_cmd_id != 4) in avc_ca_pmt()
1162 if (program_info_length > sizeof(c->operand) - 4 - write_pos) { in avc_ca_pmt()
1167 memcpy(&c->operand[write_pos], &msg[read_pos], in avc_ca_pmt()
1173 if (write_pos + 4 >= sizeof(c->operand) - 4) { in avc_ca_pmt()
1177 c->operand[write_pos++] = msg[read_pos++]; in avc_ca_pmt()
1178 c->operand[write_pos++] = msg[read_pos++]; in avc_ca_pmt()
1179 c->operand[write_pos++] = msg[read_pos++]; in avc_ca_pmt()
1181 ((msg[read_pos] & 0x0f) << 8) + msg[read_pos + 1]; in avc_ca_pmt()
1185 c->operand[write_pos++] = es_info_length >> 8; in avc_ca_pmt()
1186 c->operand[write_pos++] = es_info_length & 0xff; in avc_ca_pmt()
1193 if (pmt_cmd_id != 1 && pmt_cmd_id != 4) in avc_ca_pmt()
1197 if (es_info_length > sizeof(c->operand) - 4 - write_pos || in avc_ca_pmt()
1203 memcpy(&c->operand[write_pos], &msg[read_pos], in avc_ca_pmt()
1211 c->operand[7] = 0x82; in avc_ca_pmt()
1212 c->operand[8] = (write_pos - 10) >> 8; in avc_ca_pmt()
1213 c->operand[9] = (write_pos - 10) & 0xff; in avc_ca_pmt()
1214 c->operand[14] = write_pos - 15; in avc_ca_pmt()
1216 crc32_csum = crc32_be(0, &c->operand[10], c->operand[12] - 1); in avc_ca_pmt()
1217 c->operand[write_pos - 4] = (crc32_csum >> 24) & 0xff; in avc_ca_pmt()
1218 c->operand[write_pos - 3] = (crc32_csum >> 16) & 0xff; in avc_ca_pmt()
1219 c->operand[write_pos - 2] = (crc32_csum >> 8) & 0xff; in avc_ca_pmt()
1220 c->operand[write_pos - 1] = (crc32_csum >> 0) & 0xff; in avc_ca_pmt()
1221 pad_operands(c, write_pos); in avc_ca_pmt()
1241 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_ca_get_time_date() local
1247 c->ctype = AVC_CTYPE_STATUS; in avc_ca_get_time_date()
1248 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_ca_get_time_date()
1249 c->opcode = AVC_OPCODE_VENDOR; in avc_ca_get_time_date()
1251 c->operand[0] = SFE_VENDOR_DE_COMPANYID_0; in avc_ca_get_time_date()
1252 c->operand[1] = SFE_VENDOR_DE_COMPANYID_1; in avc_ca_get_time_date()
1253 c->operand[2] = SFE_VENDOR_DE_COMPANYID_2; in avc_ca_get_time_date()
1254 c->operand[3] = SFE_VENDOR_OPCODE_CA2HOST; in avc_ca_get_time_date()
1255 c->operand[4] = 0; /* slot */ in avc_ca_get_time_date()
1256 c->operand[5] = SFE_VENDOR_TAG_CA_DATE_TIME; /* ca tag */ in avc_ca_get_time_date()
1257 clear_operands(c, 6, LAST_OPERAND); in avc_ca_get_time_date()
1275 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_ca_enter_menu() local
1280 c->ctype = AVC_CTYPE_STATUS; in avc_ca_enter_menu()
1281 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_ca_enter_menu()
1282 c->opcode = AVC_OPCODE_VENDOR; in avc_ca_enter_menu()
1284 c->operand[0] = SFE_VENDOR_DE_COMPANYID_0; in avc_ca_enter_menu()
1285 c->operand[1] = SFE_VENDOR_DE_COMPANYID_1; in avc_ca_enter_menu()
1286 c->operand[2] = SFE_VENDOR_DE_COMPANYID_2; in avc_ca_enter_menu()
1287 c->operand[3] = SFE_VENDOR_OPCODE_HOST2CA; in avc_ca_enter_menu()
1288 c->operand[4] = 0; /* slot */ in avc_ca_enter_menu()
1289 c->operand[5] = SFE_VENDOR_TAG_CA_ENTER_MENU; in avc_ca_enter_menu()
1290 clear_operands(c, 6, 8); in avc_ca_enter_menu()
1304 struct avc_command_frame *c = (void *)fdtv->avc_data; in avc_ca_get_mmi() local
1310 c->ctype = AVC_CTYPE_STATUS; in avc_ca_get_mmi()
1311 c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; in avc_ca_get_mmi()
1312 c->opcode = AVC_OPCODE_VENDOR; in avc_ca_get_mmi()
1314 c->operand[0] = SFE_VENDOR_DE_COMPANYID_0; in avc_ca_get_mmi()
1315 c->operand[1] = SFE_VENDOR_DE_COMPANYID_1; in avc_ca_get_mmi()
1316 c->operand[2] = SFE_VENDOR_DE_COMPANYID_2; in avc_ca_get_mmi()
1317 c->operand[3] = SFE_VENDOR_OPCODE_CA2HOST; in avc_ca_get_mmi()
1318 c->operand[4] = 0; /* slot */ in avc_ca_get_mmi()
1319 c->operand[5] = SFE_VENDOR_TAG_CA_MMI; in avc_ca_get_mmi()
1320 clear_operands(c, 6, LAST_OPERAND); in avc_ca_get_mmi()
1418 set_opcr_p2p_connections(opcr, get_opcr_p2p_connections(*opcr) + 1); in cmp_establish_pp_connection()
1420 opcr[1] = *opcr; in cmp_establish_pp_connection()
1458 set_opcr_p2p_connections(opcr, get_opcr_p2p_connections(*opcr) - 1); in cmp_break_pp_connection()
1460 opcr[1] = *opcr; in cmp_break_pp_connection()
1468 * FIXME: if old_opcr.P2P_Connections == 1, i.e. we were last in cmp_break_pp_connection()