diff options
author | Henrik Kurelid <henrik@kurelid.se> | 2010-03-01 06:56:42 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-22 23:35:49 -0400 |
commit | 52065c513a8a15fc0fb1fe2452256303edaece74 (patch) | |
tree | 29de3a9b7744b0d86fa59f409be2fd1f238d9435 /drivers/media | |
parent | 4363a0b8343747a429df526249d2f3194403365c (diff) |
[media] firedtv: add parameter to fake ca_system_ids in CA_INFO
The Digital Everywhere firmware have the shortcoming that ca_info_enq and
ca_info are not supported. This means that we can never retrieve the correct
ca_system_id to present in the CI message CA_INFO. Currently the driver uses
the application id retrieved using app_info_req and app_info, but this id
only match the correct ca_system_id as given in ca_info in some cases.
This patch adds a parameter to the driver in order for the user to override
what will be returned in the CA_INFO CI message. Up to four ca_system_ids can
be specified.
This is needed for users with CAMs that have different manufacturer id and
ca_system_id and that uses applications that take this into account, like
MythTV.
Signed-off-by: Henrik Kurelid <henrik@kurelid.se>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/firewire/firedtv-avc.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/drivers/media/dvb/firewire/firedtv-avc.c b/drivers/media/dvb/firewire/firedtv-avc.c index 1f3d1fbf446c..f0f1842fab60 100644 --- a/drivers/media/dvb/firewire/firedtv-avc.c +++ b/drivers/media/dvb/firewire/firedtv-avc.c | |||
@@ -132,6 +132,20 @@ MODULE_PARM_DESC(debug, "Verbose logging (none = 0" | |||
132 | ", FCP payloads = " __stringify(AVC_DEBUG_FCP_PAYLOADS) | 132 | ", FCP payloads = " __stringify(AVC_DEBUG_FCP_PAYLOADS) |
133 | ", or a combination, or all = -1)"); | 133 | ", or a combination, or all = -1)"); |
134 | 134 | ||
135 | /* | ||
136 | * This is a workaround since there is no vendor specific command to retrieve | ||
137 | * ca_info using AVC. If this parameter is not used, ca_system_id will be | ||
138 | * filled with application_manufacturer from ca_app_info. | ||
139 | * Digital Everywhere have said that adding ca_info is on their TODO list. | ||
140 | */ | ||
141 | static unsigned int num_fake_ca_system_ids; | ||
142 | static int fake_ca_system_ids[4] = { -1, -1, -1, -1 }; | ||
143 | module_param_array(fake_ca_system_ids, int, &num_fake_ca_system_ids, 0644); | ||
144 | MODULE_PARM_DESC(fake_ca_system_ids, "If your CAM application manufacturer " | ||
145 | "does not have the same ca_system_id as your CAS, you can " | ||
146 | "override what ca_system_ids are presented to the " | ||
147 | "application by setting this field to an array of ids."); | ||
148 | |||
135 | static const char *debug_fcp_ctype(unsigned int ctype) | 149 | static const char *debug_fcp_ctype(unsigned int ctype) |
136 | { | 150 | { |
137 | static const char *ctypes[] = { | 151 | static const char *ctypes[] = { |
@@ -999,7 +1013,7 @@ int avc_ca_info(struct firedtv *fdtv, char *app_info, unsigned int *len) | |||
999 | { | 1013 | { |
1000 | struct avc_command_frame *c = (void *)fdtv->avc_data; | 1014 | struct avc_command_frame *c = (void *)fdtv->avc_data; |
1001 | struct avc_response_frame *r = (void *)fdtv->avc_data; | 1015 | struct avc_response_frame *r = (void *)fdtv->avc_data; |
1002 | int pos, ret; | 1016 | int i, pos, ret; |
1003 | 1017 | ||
1004 | mutex_lock(&fdtv->avc_mutex); | 1018 | mutex_lock(&fdtv->avc_mutex); |
1005 | 1019 | ||
@@ -1026,9 +1040,18 @@ int avc_ca_info(struct firedtv *fdtv, char *app_info, unsigned int *len) | |||
1026 | app_info[0] = (EN50221_TAG_CA_INFO >> 16) & 0xff; | 1040 | app_info[0] = (EN50221_TAG_CA_INFO >> 16) & 0xff; |
1027 | app_info[1] = (EN50221_TAG_CA_INFO >> 8) & 0xff; | 1041 | app_info[1] = (EN50221_TAG_CA_INFO >> 8) & 0xff; |
1028 | app_info[2] = (EN50221_TAG_CA_INFO >> 0) & 0xff; | 1042 | app_info[2] = (EN50221_TAG_CA_INFO >> 0) & 0xff; |
1029 | app_info[3] = 2; | 1043 | if (num_fake_ca_system_ids == 0) { |
1030 | app_info[4] = r->operand[pos + 0]; | 1044 | app_info[3] = 2; |
1031 | app_info[5] = r->operand[pos + 1]; | 1045 | app_info[4] = r->operand[pos + 0]; |
1046 | app_info[5] = r->operand[pos + 1]; | ||
1047 | } else { | ||
1048 | app_info[3] = num_fake_ca_system_ids * 2; | ||
1049 | for (i = 0; i < num_fake_ca_system_ids; i++) { | ||
1050 | app_info[4 + i * 2] = | ||
1051 | (fake_ca_system_ids[i] >> 8) & 0xff; | ||
1052 | app_info[5 + i * 2] = fake_ca_system_ids[i] & 0xff; | ||
1053 | } | ||
1054 | } | ||
1032 | *len = app_info[3] + 4; | 1055 | *len = app_info[3] + 4; |
1033 | out: | 1056 | out: |
1034 | mutex_unlock(&fdtv->avc_mutex); | 1057 | mutex_unlock(&fdtv->avc_mutex); |