aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/firesat/firesat.h
diff options
context:
space:
mode:
authorHenrik Kurelid <henke@kurelid.se>2008-08-01 04:00:45 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2009-02-24 08:51:26 -0500
commitdf4846c35247a0d038c5359d502cddd59d04bc40 (patch)
tree40c58c28c389f238e3d26230f264782e8f4bcb1e /drivers/media/dvb/firesat/firesat.h
parent2c22861459f094e899c034515a9bb92ac307ceae (diff)
firesat: update isochronous interface, add CI support
I have finally managed to get the CI support for the card working. The implementation is a bare minimum to get encrypted channels to work in kaffeine. It works fine with my T/CI card. Now and then I get an AVC timeout and have to retune a channel in order to get it to work. Once the CAM seemed to hang so I needed to remove and insert it again. I.e. there are a number of glitches. The latest version contains the following changes: - Implemented the new hpsb iso interface so that data can be received from the card - Reduced some timers for demux setup which caused scanning to timeout - Added possibility to unload driver - Added support for getting C/N ratio - Added two debug parameters to the driver; ca_debug and avc_comm_debug. - Added CI support that works for me in kaffeine - Started working on CI MMI support. It now supports: o Enter menu o Receiving MMI objects - Added support for 64-bit platforms - Corrected DVB-C modulations problems Signed-off-by: Henrik Kurelid <henrik@kurelid.se> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (rebased, whitespace)
Diffstat (limited to 'drivers/media/dvb/firesat/firesat.h')
-rw-r--r--drivers/media/dvb/firesat/firesat.h174
1 files changed, 159 insertions, 15 deletions
diff --git a/drivers/media/dvb/firesat/firesat.h b/drivers/media/dvb/firesat/firesat.h
index d1e2ce37063e..1beed177d98b 100644
--- a/drivers/media/dvb/firesat/firesat.h
+++ b/drivers/media/dvb/firesat/firesat.h
@@ -1,3 +1,15 @@
1/*
2 * FireSAT DVB driver
3 *
4 * Copyright (c) ?
5 * Copyright (c) 2008 Henrik Kurelid <henrik@kurelid.se>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
11 */
12
1#ifndef __FIRESAT_H 13#ifndef __FIRESAT_H
2#define __FIRESAT_H 14#define __FIRESAT_H
3 15
@@ -6,15 +18,108 @@
6#include "dvb_demux.h" 18#include "dvb_demux.h"
7#include "dvb_net.h" 19#include "dvb_net.h"
8 20
21#include <linux/version.h>
22#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 25)
9#include <linux/semaphore.h> 23#include <linux/semaphore.h>
24#endif
10#include <linux/dvb/frontend.h> 25#include <linux/dvb/frontend.h>
11#include <linux/dvb/dmx.h> 26#include <linux/dvb/dmx.h>
27#include <iso.h>
28
29#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 25)
30#define DVB_REGISTER_ADAPTER(x, y, z, w, v) dvb_register_adapter(x, y, z, w, v)
31#else
32#define DVB_REGISTER_ADAPTER(x, y, z, w, v) dvb_register_adapter(x, y, z, w)
33#define DVB_DEFINE_MOD_OPT_ADAPTER_NR(x)
34#endif
35
36/*****************************************************************
37 * CA message command constants from en50221_app_tags.h of libdvb
38 *****************************************************************/
39/* Resource Manager */
40#define TAG_PROFILE_ENQUIRY 0x9f8010
41#define TAG_PROFILE 0x9f8011
42#define TAG_PROFILE_CHANGE 0x9f8012
43
44/* Application Info */
45#define TAG_APP_INFO_ENQUIRY 0x9f8020
46#define TAG_APP_INFO 0x9f8021
47#define TAG_ENTER_MENU 0x9f8022
48
49/* CA Support */
50#define TAG_CA_INFO_ENQUIRY 0x9f8030
51#define TAG_CA_INFO 0x9f8031
52#define TAG_CA_PMT 0x9f8032
53#define TAG_CA_PMT_REPLY 0x9f8033
54
55/* Host Control */
56#define TAG_TUNE 0x9f8400
57#define TAG_REPLACE 0x9f8401
58#define TAG_CLEAR_REPLACE 0x9f8402
59#define TAG_ASK_RELEASE 0x9f8403
60
61/* Date and Time */
62#define TAG_DATE_TIME_ENQUIRY 0x9f8440
63#define TAG_DATE_TIME 0x9f8441
64
65/* Man Machine Interface (MMI) */
66#define TAG_CLOSE_MMI 0x9f8800
67#define TAG_DISPLAY_CONTROL 0x9f8801
68#define TAG_DISPLAY_REPLY 0x9f8802
69#define TAG_TEXT_LAST 0x9f8803
70#define TAG_TEXT_MORE 0x9f8804
71#define TAG_KEYPAD_CONTROL 0x9f8805
72#define TAG_KEYPRESS 0x9f8806
73#define TAG_ENQUIRY 0x9f8807
74#define TAG_ANSWER 0x9f8808
75#define TAG_MENU_LAST 0x9f8809
76#define TAG_MENU_MORE 0x9f880a
77#define TAG_MENU_ANSWER 0x9f880b
78#define TAG_LIST_LAST 0x9f880c
79#define TAG_LIST_MORE 0x9f880d
80#define TAG_SUBTITLE_SEGMENT_LAST 0x9f880e
81#define TAG_SUBTITLE_SEGMENT_MORE 0x9f880f
82#define TAG_DISPLAY_MESSAGE 0x9f8810
83#define TAG_SCENE_END_MARK 0x9f8811
84#define TAG_SCENE_DONE 0x9f8812
85#define TAG_SCENE_CONTROL 0x9f8813
86#define TAG_SUBTITLE_DOWNLOAD_LAST 0x9f8814
87#define TAG_SUBTITLE_DOWNLOAD_MORE 0x9f8815
88#define TAG_FLUSH_DOWNLOAD 0x9f8816
89#define TAG_DOWNLOAD_REPLY 0x9f8817
90
91/* Low Speed Communications */
92#define TAG_COMMS_COMMAND 0x9f8c00
93#define TAG_CONNECTION_DESCRIPTOR 0x9f8c01
94#define TAG_COMMS_REPLY 0x9f8c02
95#define TAG_COMMS_SEND_LAST 0x9f8c03
96#define TAG_COMMS_SEND_MORE 0x9f8c04
97#define TAG_COMMS_RECV_LAST 0x9f8c05
98#define TAG_COMMS_RECV_MORE 0x9f8c06
99
100/* Authentication */
101#define TAG_AUTH_REQ 0x9f8200
102#define TAG_AUTH_RESP 0x9f8201
103
104/* Teletext */
105#define TAG_TELETEXT_EBU 0x9f9000
106
107/* Smartcard */
108#define TAG_SMARTCARD_COMMAND 0x9f8e00
109#define TAG_SMARTCARD_REPLY 0x9f8e01
110#define TAG_SMARTCARD_SEND 0x9f8e02
111#define TAG_SMARTCARD_RCV 0x9f8e03
112
113/* EPG */
114#define TAG_EPG_ENQUIRY 0x9f8f00
115#define TAG_EPG_REPLY 0x9f8f01
116
12 117
13enum model_type { 118enum model_type {
14 FireSAT_DVB_S = 1, 119 FireSAT_DVB_S = 1,
15 FireSAT_DVB_C = 2, 120 FireSAT_DVB_C = 2,
16 FireSAT_DVB_T = 3, 121 FireSAT_DVB_T = 3,
17 FireSAT_DVB_S2 = 4 122 FireSAT_DVB_S2 = 4
18}; 123};
19 124
20struct firesat { 125struct firesat {
@@ -31,12 +136,13 @@ struct firesat {
31 struct dvb_frontend *fe; 136 struct dvb_frontend *fe;
32 137
33 struct dvb_device *cadev; 138 struct dvb_device *cadev;
34 int has_ci; 139 int ca_last_command;
140 int ca_time_interval;
35 141
36 struct semaphore avc_sem; 142 struct semaphore avc_sem;
37 atomic_t avc_reply_received; 143 atomic_t avc_reply_received;
38 144
39 atomic_t reschedule_remotecontrol; 145 atomic_t reschedule_remotecontrol;
40 146
41 struct firesat_channel { 147 struct firesat_channel {
42 struct firesat *firesat; 148 struct firesat *firesat;
@@ -53,20 +159,54 @@ struct firesat {
53 void *respfrm; 159 void *respfrm;
54 int resp_length; 160 int resp_length;
55 161
56// nodeid_t nodeid; 162 struct hpsb_host *host;
57 struct hpsb_host *host;
58 u64 guid; /* GUID of this node */ 163 u64 guid; /* GUID of this node */
59 u32 guid_vendor_id; /* Top 24bits of guid */ 164 u32 guid_vendor_id; /* Top 24bits of guid */
60 struct node_entry *nodeentry; 165 struct node_entry *nodeentry;
61 166
62 enum model_type type; 167 enum model_type type;
63 char subunit; 168 char subunit;
64 fe_sec_voltage_t voltage; 169 fe_sec_voltage_t voltage;
65 fe_sec_tone_mode_t tone; 170 fe_sec_tone_mode_t tone;
66 171
67 int isochannel; 172 int isochannel;
173 struct hpsb_iso *iso_handle;
174
175 struct list_head list;
176};
177
178struct firewireheader {
179 union {
180 struct {
181 __u8 tcode:4;
182 __u8 sy:4;
183 __u8 tag:2;
184 __u8 channel:6;
185
186 __u8 length_l;
187 __u8 length_h;
188 } hdr;
189 __u32 val;
190 };
191};
68 192
69 struct list_head list; 193struct CIPHeader {
194 union {
195 struct {
196 __u8 syncbits:2;
197 __u8 sid:6;
198 __u8 dbs;
199 __u8 fn:2;
200 __u8 qpc:3;
201 __u8 sph:1;
202 __u8 rsv:2;
203 __u8 dbc;
204 __u8 syncbits2:2;
205 __u8 fmt:6;
206 __u32 fdf:24;
207 } cip;
208 __u64 val;
209 };
70}; 210};
71 211
72extern struct list_head firesat_list; 212extern struct list_head firesat_list;
@@ -76,11 +216,15 @@ extern spinlock_t firesat_list_lock;
76extern int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed); 216extern int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed);
77extern int firesat_stop_feed(struct dvb_demux_feed *dvbdmxfeed); 217extern int firesat_stop_feed(struct dvb_demux_feed *dvbdmxfeed);
78extern int firesat_dvbdev_init(struct firesat *firesat, 218extern int firesat_dvbdev_init(struct firesat *firesat,
79 struct device *dev, 219 struct device *dev,
80 struct dvb_frontend *fe); 220 struct dvb_frontend *fe);
81 221
82/* firesat_fe.c */ 222/* firesat_fe.c */
83extern int firesat_frontend_attach(struct firesat *firesat, struct dvb_frontend *fe); 223extern int firesat_frontend_attach(struct firesat *firesat,
224 struct dvb_frontend *fe);
84 225
226/* firesat_iso.c */
227extern int setup_iso_channel(struct firesat *firesat);
228extern void tear_down_iso_channel(struct firesat *firesat);
85 229
86#endif 230#endif