aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/firewire/firedtv.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/firewire/firedtv.h')
-rw-r--r--drivers/media/dvb/firewire/firedtv.h257
1 files changed, 106 insertions, 151 deletions
diff --git a/drivers/media/dvb/firewire/firedtv.h b/drivers/media/dvb/firewire/firedtv.h
index 2a34028ccbcd..d48530b81e61 100644
--- a/drivers/media/dvb/firewire/firedtv.h
+++ b/drivers/media/dvb/firewire/firedtv.h
@@ -29,95 +29,35 @@
29#include <dvb_net.h> 29#include <dvb_net.h>
30#include <dvbdev.h> 30#include <dvbdev.h>
31 31
32#include <linux/version.h> 32struct firedtv_tuner_status {
33#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 25) 33 unsigned active_system:8;
34#define DVB_REGISTER_ADAPTER(x, y, z, w, v) dvb_register_adapter(x, y, z, w, v) 34 unsigned searching:1;
35#else 35 unsigned moving:1;
36#define DVB_REGISTER_ADAPTER(x, y, z, w, v) dvb_register_adapter(x, y, z, w) 36 unsigned no_rf:1;
37#define DVB_DEFINE_MOD_OPT_ADAPTER_NR(x) 37 unsigned input:1;
38#endif 38 unsigned selected_antenna:7;
39 39 unsigned ber:32;
40/***************************************************************** 40 unsigned signal_strength:8;
41 * CA message command constants from en50221_app_tags.h of libdvb 41 unsigned raster_frequency:2;
42 *****************************************************************/ 42 unsigned rf_frequency:22;
43/* Resource Manager */ 43 unsigned man_dep_info_length:8;
44#define TAG_PROFILE_ENQUIRY 0x9f8010 44 unsigned front_end_error:1;
45#define TAG_PROFILE 0x9f8011 45 unsigned antenna_error:1;
46#define TAG_PROFILE_CHANGE 0x9f8012 46 unsigned front_end_power_status:1;
47 47 unsigned power_supply:1;
48/* Application Info */ 48 unsigned carrier_noise_ratio:16;
49#define TAG_APP_INFO_ENQUIRY 0x9f8020 49 unsigned power_supply_voltage:8;
50#define TAG_APP_INFO 0x9f8021 50 unsigned antenna_voltage:8;
51#define TAG_ENTER_MENU 0x9f8022 51 unsigned firewire_bus_voltage:8;
52 52 unsigned ca_mmi:1;
53/* CA Support */ 53 unsigned ca_pmt_reply:1;
54#define TAG_CA_INFO_ENQUIRY 0x9f8030 54 unsigned ca_date_time_request:1;
55#define TAG_CA_INFO 0x9f8031 55 unsigned ca_application_info:1;
56#define TAG_CA_PMT 0x9f8032 56 unsigned ca_module_present_status:1;
57#define TAG_CA_PMT_REPLY 0x9f8033 57 unsigned ca_dvb_flag:1;
58 58 unsigned ca_error_flag:1;
59/* Host Control */ 59 unsigned ca_initialization_status:1;
60#define TAG_TUNE 0x9f8400 60};
61#define TAG_REPLACE 0x9f8401
62#define TAG_CLEAR_REPLACE 0x9f8402
63#define TAG_ASK_RELEASE 0x9f8403
64
65/* Date and Time */
66#define TAG_DATE_TIME_ENQUIRY 0x9f8440
67#define TAG_DATE_TIME 0x9f8441
68
69/* Man Machine Interface (MMI) */
70#define TAG_CLOSE_MMI 0x9f8800
71#define TAG_DISPLAY_CONTROL 0x9f8801
72#define TAG_DISPLAY_REPLY 0x9f8802
73#define TAG_TEXT_LAST 0x9f8803
74#define TAG_TEXT_MORE 0x9f8804
75#define TAG_KEYPAD_CONTROL 0x9f8805
76#define TAG_KEYPRESS 0x9f8806
77#define TAG_ENQUIRY 0x9f8807
78#define TAG_ANSWER 0x9f8808
79#define TAG_MENU_LAST 0x9f8809
80#define TAG_MENU_MORE 0x9f880a
81#define TAG_MENU_ANSWER 0x9f880b
82#define TAG_LIST_LAST 0x9f880c
83#define TAG_LIST_MORE 0x9f880d
84#define TAG_SUBTITLE_SEGMENT_LAST 0x9f880e
85#define TAG_SUBTITLE_SEGMENT_MORE 0x9f880f
86#define TAG_DISPLAY_MESSAGE 0x9f8810
87#define TAG_SCENE_END_MARK 0x9f8811
88#define TAG_SCENE_DONE 0x9f8812
89#define TAG_SCENE_CONTROL 0x9f8813
90#define TAG_SUBTITLE_DOWNLOAD_LAST 0x9f8814
91#define TAG_SUBTITLE_DOWNLOAD_MORE 0x9f8815
92#define TAG_FLUSH_DOWNLOAD 0x9f8816
93#define TAG_DOWNLOAD_REPLY 0x9f8817
94
95/* Low Speed Communications */
96#define TAG_COMMS_COMMAND 0x9f8c00
97#define TAG_CONNECTION_DESCRIPTOR 0x9f8c01
98#define TAG_COMMS_REPLY 0x9f8c02
99#define TAG_COMMS_SEND_LAST 0x9f8c03
100#define TAG_COMMS_SEND_MORE 0x9f8c04
101#define TAG_COMMS_RECV_LAST 0x9f8c05
102#define TAG_COMMS_RECV_MORE 0x9f8c06
103
104/* Authentication */
105#define TAG_AUTH_REQ 0x9f8200
106#define TAG_AUTH_RESP 0x9f8201
107
108/* Teletext */
109#define TAG_TELETEXT_EBU 0x9f9000
110
111/* Smartcard */
112#define TAG_SMARTCARD_COMMAND 0x9f8e00
113#define TAG_SMARTCARD_REPLY 0x9f8e01
114#define TAG_SMARTCARD_SEND 0x9f8e02
115#define TAG_SMARTCARD_RCV 0x9f8e03
116
117/* EPG */
118#define TAG_EPG_ENQUIRY 0x9f8f00
119#define TAG_EPG_REPLY 0x9f8f01
120
121 61
122enum model_type { 62enum model_type {
123 FIREDTV_UNKNOWN = 0, 63 FIREDTV_UNKNOWN = 0,
@@ -127,11 +67,22 @@ enum model_type {
127 FIREDTV_DVB_S2 = 4, 67 FIREDTV_DVB_S2 = 4,
128}; 68};
129 69
70struct device;
130struct input_dev; 71struct input_dev;
131struct hpsb_iso; 72struct firedtv;
132struct unit_directory; 73
74struct firedtv_backend {
75 int (*lock)(struct firedtv *fdtv, u64 addr, void *data, __be32 arg);
76 int (*read)(struct firedtv *fdtv, u64 addr, void *data, size_t len);
77 int (*write)(struct firedtv *fdtv, u64 addr, void *data, size_t len);
78 int (*start_iso)(struct firedtv *fdtv);
79 void (*stop_iso)(struct firedtv *fdtv);
80};
133 81
134struct firedtv { 82struct firedtv {
83 struct device *device;
84 struct list_head list;
85
135 struct dvb_adapter adapter; 86 struct dvb_adapter adapter;
136 struct dmxdev dmxdev; 87 struct dmxdev dmxdev;
137 struct dvb_demux demux; 88 struct dvb_demux demux;
@@ -149,79 +100,83 @@ struct firedtv {
149 struct work_struct remote_ctrl_work; 100 struct work_struct remote_ctrl_work;
150 struct input_dev *remote_ctrl_dev; 101 struct input_dev *remote_ctrl_dev;
151 102
152 struct firedtv_channel { 103 enum model_type type;
153 bool active; 104 char subunit;
154 int pid; 105 char isochannel;
155 } channel[16]; 106 fe_sec_voltage_t voltage;
156 struct mutex demux_mutex; 107 fe_sec_tone_mode_t tone;
157 108
158 struct unit_directory *ud; 109 const struct firedtv_backend *backend;
110 void *backend_data;
159 111
160 enum model_type type; 112 struct mutex demux_mutex;
161 char subunit; 113 unsigned long channel_active;
162 fe_sec_voltage_t voltage; 114 u16 channel_pid[16];
163 fe_sec_tone_mode_t tone;
164
165 int isochannel;
166 struct hpsb_iso *iso_handle;
167
168 struct list_head list;
169 115
170 /* needed by avc_api */ 116 size_t response_length;
171 int resp_length; 117 u8 response[512];
172 u8 respfrm[512];
173}; 118};
174 119
175struct firewireheader { 120/* firedtv-1394.c */
176 union { 121#ifdef CONFIG_DVB_FIREDTV_IEEE1394
177 struct { 122int fdtv_1394_init(struct ieee1394_device_id id_table[]);
178 __u8 tcode:4; 123void fdtv_1394_exit(void);
179 __u8 sy:4; 124#else
180 __u8 tag:2; 125static inline int fdtv_1394_init(struct ieee1394_device_id it[]) { return 0; }
181 __u8 channel:6; 126static inline void fdtv_1394_exit(void) {}
182 127#endif
183 __u8 length_l;
184 __u8 length_h;
185 } hdr;
186 __u32 val;
187 };
188};
189
190struct CIPHeader {
191 union {
192 struct {
193 __u8 syncbits:2;
194 __u8 sid:6;
195 __u8 dbs;
196 __u8 fn:2;
197 __u8 qpc:3;
198 __u8 sph:1;
199 __u8 rsv:2;
200 __u8 dbc;
201 __u8 syncbits2:2;
202 __u8 fmt:6;
203 __u32 fdf:24;
204 } cip;
205 __u64 val;
206 };
207};
208
209extern const char *fdtv_model_names[];
210extern struct list_head fdtv_list;
211extern spinlock_t fdtv_list_lock;
212 128
213struct device; 129/* firedtv-avc.c */
130int avc_recv(struct firedtv *fdtv, void *data, size_t length);
131int avc_tuner_status(struct firedtv *fdtv, struct firedtv_tuner_status *stat);
132struct dvb_frontend_parameters;
133int avc_tuner_dsd(struct firedtv *fdtv, struct dvb_frontend_parameters *params);
134int avc_tuner_set_pids(struct firedtv *fdtv, unsigned char pidc, u16 pid[]);
135int avc_tuner_get_ts(struct firedtv *fdtv);
136int avc_identify_subunit(struct firedtv *fdtv);
137struct dvb_diseqc_master_cmd;
138int avc_lnb_control(struct firedtv *fdtv, char voltage, char burst,
139 char conttone, char nrdiseq,
140 struct dvb_diseqc_master_cmd *diseqcmd);
141void avc_remote_ctrl_work(struct work_struct *work);
142int avc_register_remote_control(struct firedtv *fdtv);
143int avc_ca_app_info(struct firedtv *fdtv, char *app_info, unsigned int *len);
144int avc_ca_info(struct firedtv *fdtv, char *app_info, unsigned int *len);
145int avc_ca_reset(struct firedtv *fdtv);
146int avc_ca_pmt(struct firedtv *fdtv, char *app_info, int length);
147int avc_ca_get_time_date(struct firedtv *fdtv, int *interval);
148int avc_ca_enter_menu(struct firedtv *fdtv);
149int avc_ca_get_mmi(struct firedtv *fdtv, char *mmi_object, unsigned int *len);
150int cmp_establish_pp_connection(struct firedtv *fdtv, int plug, int channel);
151void cmp_break_pp_connection(struct firedtv *fdtv, int plug, int channel);
152
153/* firedtv-ci.c */
154int fdtv_ca_register(struct firedtv *fdtv);
155void fdtv_ca_release(struct firedtv *fdtv);
214 156
215/* firedtv-dvb.c */ 157/* firedtv-dvb.c */
216int fdtv_start_feed(struct dvb_demux_feed *dvbdmxfeed); 158int fdtv_start_feed(struct dvb_demux_feed *dvbdmxfeed);
217int fdtv_stop_feed(struct dvb_demux_feed *dvbdmxfeed); 159int fdtv_stop_feed(struct dvb_demux_feed *dvbdmxfeed);
218int fdtv_dvbdev_init(struct firedtv *fdtv, struct device *dev); 160int fdtv_dvb_register(struct firedtv *fdtv);
161void fdtv_dvb_unregister(struct firedtv *fdtv);
162struct firedtv *fdtv_alloc(struct device *dev,
163 const struct firedtv_backend *backend,
164 const char *name, size_t name_len);
165extern const char *fdtv_model_names[];
219 166
220/* firedtv-fe.c */ 167/* firedtv-fe.c */
221void fdtv_frontend_init(struct firedtv *fdtv); 168void fdtv_frontend_init(struct firedtv *fdtv);
222 169
223/* firedtv-iso.c */ 170/* firedtv-rc.c */
224int setup_iso_channel(struct firedtv *fdtv); 171#ifdef CONFIG_DVB_FIREDTV_INPUT
225void tear_down_iso_channel(struct firedtv *fdtv); 172int fdtv_register_rc(struct firedtv *fdtv, struct device *dev);
173void fdtv_unregister_rc(struct firedtv *fdtv);
174void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code);
175#else
176static inline int fdtv_register_rc(struct firedtv *fdtv,
177 struct device *dev) { return 0; }
178static inline void fdtv_unregister_rc(struct firedtv *fdtv) {}
179static inline void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code) {}
180#endif
226 181
227#endif /* _FIREDTV_H */ 182#endif /* _FIREDTV_H */