Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
firedtv-avc.c File Reference
#include <linux/bug.h>
#include <linux/crc32.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/moduleparam.h>
#include <linux/mutex.h>
#include <linux/string.h>
#include <linux/stringify.h>
#include <linux/wait.h>
#include <linux/workqueue.h>
#include <dvb_frontend.h>
#include "firedtv.h"

Go to the source code of this file.

Data Structures

struct  avc_command_frame
 
struct  avc_response_frame
 

Macros

#define FCP_COMMAND_REGISTER   0xfffff0000b00ULL
 
#define AVC_CTYPE_CONTROL   0x0
 
#define AVC_CTYPE_STATUS   0x1
 
#define AVC_CTYPE_NOTIFY   0x3
 
#define AVC_RESPONSE_ACCEPTED   0x9
 
#define AVC_RESPONSE_STABLE   0xc
 
#define AVC_RESPONSE_CHANGED   0xd
 
#define AVC_RESPONSE_INTERIM   0xf
 
#define AVC_SUBUNIT_TYPE_TUNER   (0x05 << 3)
 
#define AVC_SUBUNIT_TYPE_UNIT   (0x1f << 3)
 
#define AVC_OPCODE_VENDOR   0x00
 
#define AVC_OPCODE_READ_DESCRIPTOR   0x09
 
#define AVC_OPCODE_DSIT   0xc8
 
#define AVC_OPCODE_DSD   0xcb
 
#define DESCRIPTOR_TUNER_STATUS   0x80
 
#define DESCRIPTOR_SUBUNIT_IDENTIFIER   0x00
 
#define SFE_VENDOR_DE_COMPANYID_0   0x00 /* OUI of Digital Everywhere */
 
#define SFE_VENDOR_DE_COMPANYID_1   0x12
 
#define SFE_VENDOR_DE_COMPANYID_2   0x87
 
#define SFE_VENDOR_OPCODE_REGISTER_REMOTE_CONTROL   0x0a
 
#define SFE_VENDOR_OPCODE_LNB_CONTROL   0x52
 
#define SFE_VENDOR_OPCODE_TUNE_QPSK   0x58 /* for DVB-S */
 
#define SFE_VENDOR_OPCODE_GET_FIRMWARE_VERSION   0x00
 
#define SFE_VENDOR_OPCODE_HOST2CA   0x56
 
#define SFE_VENDOR_OPCODE_CA2HOST   0x57
 
#define SFE_VENDOR_OPCODE_CISTATUS   0x59
 
#define SFE_VENDOR_OPCODE_TUNE_QPSK2   0x60 /* for DVB-S2 */
 
#define SFE_VENDOR_TAG_CA_RESET   0x00
 
#define SFE_VENDOR_TAG_CA_APPLICATION_INFO   0x01
 
#define SFE_VENDOR_TAG_CA_PMT   0x02
 
#define SFE_VENDOR_TAG_CA_DATE_TIME   0x04
 
#define SFE_VENDOR_TAG_CA_MMI   0x05
 
#define SFE_VENDOR_TAG_CA_ENTER_MENU   0x07
 
#define EN50221_LIST_MANAGEMENT_ONLY   0x03
 
#define EN50221_TAG_APP_INFO   0x9f8021
 
#define EN50221_TAG_CA_INFO   0x9f8031
 
#define LAST_OPERAND   (509 - 1)
 
#define AVC_DEBUG_READ_DESCRIPTOR   0x0001
 
#define AVC_DEBUG_DSIT   0x0002
 
#define AVC_DEBUG_DSD   0x0004
 
#define AVC_DEBUG_REGISTER_REMOTE_CONTROL   0x0008
 
#define AVC_DEBUG_LNB_CONTROL   0x0010
 
#define AVC_DEBUG_TUNE_QPSK   0x0020
 
#define AVC_DEBUG_TUNE_QPSK2   0x0040
 
#define AVC_DEBUG_HOST2CA   0x0080
 
#define AVC_DEBUG_CA2HOST   0x0100
 
#define AVC_DEBUG_APPLICATION_PMT   0x4000
 
#define AVC_DEBUG_FCP_PAYLOADS   0x8000
 
#define SIZEOF_ANTENNA_INPUT_INFO   22
 
#define CMP_OUTPUT_PLUG_CONTROL_REG_0   0xfffff0000904ULL
 
#define get_opcr_online(v)   get_opcr((v), 0x1, 31)
 
#define get_opcr_p2p_connections(v)   get_opcr((v), 0x3f, 24)
 
#define get_opcr_channel(v)   get_opcr((v), 0x3f, 16)
 
#define set_opcr_p2p_connections(p, v)   set_opcr((p), (v), 0x3f, 24)
 
#define set_opcr_channel(p, v)   set_opcr((p), (v), 0x3f, 16)
 
#define set_opcr_data_rate(p, v)   set_opcr((p), (v), 0x3, 14)
 
#define set_opcr_overhead_id(p, v)   set_opcr((p), (v), 0xf, 10)
 

Functions

 module_param_named (debug, avc_debug, int, 0644)
 
 MODULE_PARM_DESC (debug,"Verbose logging (none = 0"", FCP subactions"": READ DESCRIPTOR = "__stringify(AVC_DEBUG_READ_DESCRIPTOR)", DSIT = "__stringify(AVC_DEBUG_DSIT)", REGISTER_REMOTE_CONTROL = "__stringify(AVC_DEBUG_REGISTER_REMOTE_CONTROL)", LNB CONTROL = "__stringify(AVC_DEBUG_LNB_CONTROL)", TUNE QPSK = "__stringify(AVC_DEBUG_TUNE_QPSK)", TUNE QPSK2 = "__stringify(AVC_DEBUG_TUNE_QPSK2)", HOST2CA = "__stringify(AVC_DEBUG_HOST2CA)", CA2HOST = "__stringify(AVC_DEBUG_CA2HOST)"; Application sent PMT = "__stringify(AVC_DEBUG_APPLICATION_PMT)", FCP payloads = "__stringify(AVC_DEBUG_FCP_PAYLOADS)", or a combination, or all = -1)")
 
 module_param_array (fake_ca_system_ids, int,&num_fake_ca_system_ids, 0644)
 
 MODULE_PARM_DESC (fake_ca_system_ids,"If your CAM application manufacturer ""does not have the same ca_system_id as your CAS, you can ""override what ca_system_ids are presented to the ""application by setting this field to an array of ids.")
 
int avc_recv (struct firedtv *fdtv, void *data, size_t length)
 
int avc_tuner_dsd (struct firedtv *fdtv, struct dtv_frontend_properties *p)
 
int avc_tuner_set_pids (struct firedtv *fdtv, unsigned char pidc, u16 pid[])
 
int avc_tuner_get_ts (struct firedtv *fdtv)
 
int avc_identify_subunit (struct firedtv *fdtv)
 
int avc_tuner_status (struct firedtv *fdtv, struct firedtv_tuner_status *stat)
 
int avc_lnb_control (struct firedtv *fdtv, char voltage, char burst, char conttone, char nrdiseq, struct dvb_diseqc_master_cmd *diseqcmd)
 
int avc_register_remote_control (struct firedtv *fdtv)
 
void avc_remote_ctrl_work (struct work_struct *work)
 
int avc_ca_app_info (struct firedtv *fdtv, char *app_info, unsigned int *len)
 
int avc_ca_info (struct firedtv *fdtv, char *app_info, unsigned int *len)
 
int avc_ca_reset (struct firedtv *fdtv)
 
int avc_ca_pmt (struct firedtv *fdtv, char *msg, int length)
 
int avc_ca_get_time_date (struct firedtv *fdtv, int *interval)
 
int avc_ca_enter_menu (struct firedtv *fdtv)
 
int avc_ca_get_mmi (struct firedtv *fdtv, char *mmi_object, unsigned int *len)
 
int cmp_establish_pp_connection (struct firedtv *fdtv, int plug, int channel)
 
void cmp_break_pp_connection (struct firedtv *fdtv, int plug, int channel)
 

Macro Definition Documentation

#define AVC_CTYPE_CONTROL   0x0

Definition at line 33 of file firedtv-avc.c.

#define AVC_CTYPE_NOTIFY   0x3

Definition at line 35 of file firedtv-avc.c.

#define AVC_CTYPE_STATUS   0x1

Definition at line 34 of file firedtv-avc.c.

#define AVC_DEBUG_APPLICATION_PMT   0x4000

Definition at line 116 of file firedtv-avc.c.

#define AVC_DEBUG_CA2HOST   0x0100

Definition at line 115 of file firedtv-avc.c.

#define AVC_DEBUG_DSD   0x0004

Definition at line 109 of file firedtv-avc.c.

#define AVC_DEBUG_DSIT   0x0002

Definition at line 108 of file firedtv-avc.c.

#define AVC_DEBUG_FCP_PAYLOADS   0x8000

Definition at line 117 of file firedtv-avc.c.

#define AVC_DEBUG_HOST2CA   0x0080

Definition at line 114 of file firedtv-avc.c.

#define AVC_DEBUG_LNB_CONTROL   0x0010

Definition at line 111 of file firedtv-avc.c.

#define AVC_DEBUG_READ_DESCRIPTOR   0x0001

Definition at line 107 of file firedtv-avc.c.

#define AVC_DEBUG_REGISTER_REMOTE_CONTROL   0x0008

Definition at line 110 of file firedtv-avc.c.

#define AVC_DEBUG_TUNE_QPSK   0x0020

Definition at line 112 of file firedtv-avc.c.

#define AVC_DEBUG_TUNE_QPSK2   0x0040

Definition at line 113 of file firedtv-avc.c.

#define AVC_OPCODE_DSD   0xcb

Definition at line 48 of file firedtv-avc.c.

#define AVC_OPCODE_DSIT   0xc8

Definition at line 47 of file firedtv-avc.c.

#define AVC_OPCODE_READ_DESCRIPTOR   0x09

Definition at line 46 of file firedtv-avc.c.

#define AVC_OPCODE_VENDOR   0x00

Definition at line 45 of file firedtv-avc.c.

#define AVC_RESPONSE_ACCEPTED   0x9

Definition at line 37 of file firedtv-avc.c.

#define AVC_RESPONSE_CHANGED   0xd

Definition at line 39 of file firedtv-avc.c.

#define AVC_RESPONSE_INTERIM   0xf

Definition at line 40 of file firedtv-avc.c.

#define AVC_RESPONSE_STABLE   0xc

Definition at line 38 of file firedtv-avc.c.

#define AVC_SUBUNIT_TYPE_TUNER   (0x05 << 3)

Definition at line 42 of file firedtv-avc.c.

#define AVC_SUBUNIT_TYPE_UNIT   (0x1f << 3)

Definition at line 43 of file firedtv-avc.c.

#define CMP_OUTPUT_PLUG_CONTROL_REG_0   0xfffff0000904ULL

Definition at line 1317 of file firedtv-avc.c.

#define DESCRIPTOR_SUBUNIT_IDENTIFIER   0x00

Definition at line 51 of file firedtv-avc.c.

#define DESCRIPTOR_TUNER_STATUS   0x80

Definition at line 50 of file firedtv-avc.c.

#define EN50221_LIST_MANAGEMENT_ONLY   0x03

Definition at line 74 of file firedtv-avc.c.

#define EN50221_TAG_APP_INFO   0x9f8021

Definition at line 75 of file firedtv-avc.c.

#define EN50221_TAG_CA_INFO   0x9f8031

Definition at line 76 of file firedtv-avc.c.

#define FCP_COMMAND_REGISTER   0xfffff0000b00ULL

Definition at line 31 of file firedtv-avc.c.

#define get_opcr_channel (   v)    get_opcr((v), 0x3f, 16)

Definition at line 1354 of file firedtv-avc.c.

#define get_opcr_online (   v)    get_opcr((v), 0x1, 31)

Definition at line 1352 of file firedtv-avc.c.

#define get_opcr_p2p_connections (   v)    get_opcr((v), 0x3f, 24)

Definition at line 1353 of file firedtv-avc.c.

#define LAST_OPERAND   (509 - 1)

Definition at line 92 of file firedtv-avc.c.

#define set_opcr_channel (   p,
  v 
)    set_opcr((p), (v), 0x3f, 16)

Definition at line 1357 of file firedtv-avc.c.

#define set_opcr_data_rate (   p,
  v 
)    set_opcr((p), (v), 0x3, 14)

Definition at line 1358 of file firedtv-avc.c.

#define set_opcr_overhead_id (   p,
  v 
)    set_opcr((p), (v), 0xf, 10)

Definition at line 1359 of file firedtv-avc.c.

#define set_opcr_p2p_connections (   p,
  v 
)    set_opcr((p), (v), 0x3f, 24)

Definition at line 1356 of file firedtv-avc.c.

#define SFE_VENDOR_DE_COMPANYID_0   0x00 /* OUI of Digital Everywhere */

Definition at line 53 of file firedtv-avc.c.

#define SFE_VENDOR_DE_COMPANYID_1   0x12

Definition at line 54 of file firedtv-avc.c.

#define SFE_VENDOR_DE_COMPANYID_2   0x87

Definition at line 55 of file firedtv-avc.c.

#define SFE_VENDOR_OPCODE_CA2HOST   0x57

Definition at line 63 of file firedtv-avc.c.

#define SFE_VENDOR_OPCODE_CISTATUS   0x59

Definition at line 64 of file firedtv-avc.c.

#define SFE_VENDOR_OPCODE_GET_FIRMWARE_VERSION   0x00

Definition at line 61 of file firedtv-avc.c.

#define SFE_VENDOR_OPCODE_HOST2CA   0x56

Definition at line 62 of file firedtv-avc.c.

#define SFE_VENDOR_OPCODE_LNB_CONTROL   0x52

Definition at line 58 of file firedtv-avc.c.

#define SFE_VENDOR_OPCODE_REGISTER_REMOTE_CONTROL   0x0a

Definition at line 57 of file firedtv-avc.c.

#define SFE_VENDOR_OPCODE_TUNE_QPSK   0x58 /* for DVB-S */

Definition at line 59 of file firedtv-avc.c.

#define SFE_VENDOR_OPCODE_TUNE_QPSK2   0x60 /* for DVB-S2 */

Definition at line 65 of file firedtv-avc.c.

#define SFE_VENDOR_TAG_CA_APPLICATION_INFO   0x01

Definition at line 68 of file firedtv-avc.c.

#define SFE_VENDOR_TAG_CA_DATE_TIME   0x04

Definition at line 70 of file firedtv-avc.c.

#define SFE_VENDOR_TAG_CA_ENTER_MENU   0x07

Definition at line 72 of file firedtv-avc.c.

#define SFE_VENDOR_TAG_CA_MMI   0x05

Definition at line 71 of file firedtv-avc.c.

#define SFE_VENDOR_TAG_CA_PMT   0x02

Definition at line 69 of file firedtv-avc.c.

#define SFE_VENDOR_TAG_CA_RESET   0x00

Definition at line 67 of file firedtv-avc.c.

#define SIZEOF_ANTENNA_INPUT_INFO   22

Definition at line 751 of file firedtv-avc.c.

Function Documentation

int avc_ca_app_info ( struct firedtv fdtv,
char app_info,
unsigned int len 
)

Definition at line 971 of file firedtv-avc.c.

int avc_ca_enter_menu ( struct firedtv fdtv)

Definition at line 1253 of file firedtv-avc.c.

int avc_ca_get_mmi ( struct firedtv fdtv,
char mmi_object,
unsigned int len 
)

Definition at line 1282 of file firedtv-avc.c.

int avc_ca_get_time_date ( struct firedtv fdtv,
int interval 
)

Definition at line 1219 of file firedtv-avc.c.

int avc_ca_info ( struct firedtv fdtv,
char app_info,
unsigned int len 
)

Definition at line 1012 of file firedtv-avc.c.

int avc_ca_pmt ( struct firedtv fdtv,
char msg,
int  length 
)

Definition at line 1093 of file firedtv-avc.c.

int avc_ca_reset ( struct firedtv fdtv)

Definition at line 1062 of file firedtv-avc.c.

int avc_identify_subunit ( struct firedtv fdtv)

Definition at line 713 of file firedtv-avc.c.

int avc_lnb_control ( struct firedtv fdtv,
char  voltage,
char  burst,
char  conttone,
char  nrdiseq,
struct dvb_diseqc_master_cmd diseqcmd 
)

Definition at line 832 of file firedtv-avc.c.

int avc_recv ( struct firedtv fdtv,
void data,
size_t  length 
)

Definition at line 275 of file firedtv-avc.c.

int avc_register_remote_control ( struct firedtv fdtv)

Definition at line 879 of file firedtv-avc.c.

void avc_remote_ctrl_work ( struct work_struct work)

Definition at line 906 of file firedtv-avc.c.

int avc_tuner_dsd ( struct firedtv fdtv,
struct dtv_frontend_properties p 
)

Definition at line 587 of file firedtv-avc.c.

int avc_tuner_get_ts ( struct firedtv fdtv)

Definition at line 673 of file firedtv-avc.c.

int avc_tuner_set_pids ( struct firedtv fdtv,
unsigned char  pidc,
u16  pid[] 
)

Definition at line 627 of file firedtv-avc.c.

int avc_tuner_status ( struct firedtv fdtv,
struct firedtv_tuner_status stat 
)

Definition at line 753 of file firedtv-avc.c.

void cmp_break_pp_connection ( struct firedtv fdtv,
int  plug,
int  channel 
)

Definition at line 1421 of file firedtv-avc.c.

int cmp_establish_pp_connection ( struct firedtv fdtv,
int  plug,
int  channel 
)

Definition at line 1361 of file firedtv-avc.c.

module_param_array ( fake_ca_system_ids  ,
int  ,
num_fake_ca_system_ids,
0644   
)
module_param_named ( debug  ,
avc_debug  ,
int  ,
0644   
)
MODULE_PARM_DESC ( debug  ,
"Verbose logging (none = 0"", FCP subactions"": READ DESCRIPTOR = "__stringify(AVC_DEBUG_READ_DESCRIPTOR)", DSIT = "__stringify(AVC_DEBUG_DSIT)", REGISTER_REMOTE_CONTROL = "__stringify(AVC_DEBUG_REGISTER_REMOTE_CONTROL)", LNB CONTROL = "__stringify(AVC_DEBUG_LNB_CONTROL)", TUNE QPSK = "__stringify(AVC_DEBUG_TUNE_QPSK)", TUNE QPSK2 = "__stringify(AVC_DEBUG_TUNE_QPSK2)", HOST2CA = "__stringify(AVC_DEBUG_HOST2CA)", CA2HOST = "__stringify(AVC_DEBUG_CA2HOST)"; Application sent PMT = "__stringify(AVC_DEBUG_APPLICATION_PMT)", FCP payloads = "__stringify(AVC_DEBUG_FCP_PAYLOADS)", or a combination, or all = -1)"   
)
MODULE_PARM_DESC ( fake_ca_system_ids  ,
"If your CAM application manufacturer ""does not have the same ca_system_id as your  CAS,
you can""override what ca_system_ids are presented to the""application by setting this field to an array of ids."   
)