summaryrefslogtreecommitdiffstats
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 @@
#include <dvb_net.h>
#include <dvbdev.h>
-#include <linux/version.h>
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 25)
-#define DVB_REGISTER_ADAPTER(x, y, z, w, v) dvb_register_adapter(x, y, z, w, v)
-#else
-#define DVB_REGISTER_ADAPTER(x, y, z, w, v) dvb_register_adapter(x, y, z, w)
-#define DVB_DEFINE_MOD_OPT_ADAPTER_NR(x)
-#endif
-
-/*****************************************************************
- * CA message command constants from en50221_app_tags.h of libdvb
- *****************************************************************/
-/* Resource Manager */
-#define TAG_PROFILE_ENQUIRY 0x9f8010
-#define TAG_PROFILE 0x9f8011
-#define TAG_PROFILE_CHANGE 0x9f8012
-
-/* Application Info */
-#define TAG_APP_INFO_ENQUIRY 0x9f8020
-#define TAG_APP_INFO 0x9f8021
-#define TAG_ENTER_MENU 0x9f8022
-
-/* CA Support */
-#define TAG_CA_INFO_ENQUIRY 0x9f8030
-#define TAG_CA_INFO 0x9f8031
-#define TAG_CA_PMT 0x9f8032
-#define TAG_CA_PMT_REPLY 0x9f8033
-
-/* Host Control */
-#define TAG_TUNE 0x9f8400
-#define TAG_REPLACE 0x9f8401
-#define TAG_CLEAR_REPLACE 0x9f8402
-#define TAG_ASK_RELEASE 0x9f8403
-
-/* Date and Time */
-#define TAG_DATE_TIME_ENQUIRY 0x9f8440
-#define TAG_DATE_TIME 0x9f8441
-
-/* Man Machine Interface (MMI) */
-#define TAG_CLOSE_MMI 0x9f8800
-#define TAG_DISPLAY_CONTROL 0x9f8801
-#define TAG_DISPLAY_REPLY 0x9f8802
-#define TAG_TEXT_LAST 0x9f8803
-#define TAG_TEXT_MORE 0x9f8804
-#define TAG_KEYPAD_CONTROL 0x9f8805
-#define TAG_KEYPRESS 0x9f8806
-#define TAG_ENQUIRY 0x9f8807
-#define TAG_ANSWER 0x9f8808
-#define TAG_MENU_LAST 0x9f8809
-#define TAG_MENU_MORE 0x9f880a
-#define TAG_MENU_ANSWER 0x9f880b
-#define TAG_LIST_LAST 0x9f880c
-#define TAG_LIST_MORE 0x9f880d
-#define TAG_SUBTITLE_SEGMENT_LAST 0x9f880e
-#define TAG_SUBTITLE_SEGMENT_MORE 0x9f880f
-#define TAG_DISPLAY_MESSAGE 0x9f8810
-#define TAG_SCENE_END_MARK 0x9f8811
-#define TAG_SCENE_DONE 0x9f8812
-#define TAG_SCENE_CONTROL 0x9f8813
-#define TAG_SUBTITLE_DOWNLOAD_LAST 0x9f8814
-#define TAG_SUBTITLE_DOWNLOAD_MORE 0x9f8815
-#define TAG_FLUSH_DOWNLOAD 0x9f8816
-#define TAG_DOWNLOAD_REPLY 0x9f8817
-
-/* Low Speed Communications */
-#define TAG_COMMS_COMMAND 0x9f8c00
-#define TAG_CONNECTION_DESCRIPTOR 0x9f8c01
-#define TAG_COMMS_REPLY 0x9f8c02
-#define TAG_COMMS_SEND_LAST 0x9f8c03
-#define TAG_COMMS_SEND_MORE 0x9f8c04
-#define TAG_COMMS_RECV_LAST 0x9f8c05
-#define TAG_COMMS_RECV_MORE 0x9f8c06
-
-/* Authentication */
-#define TAG_AUTH_REQ 0x9f8200
-#define TAG_AUTH_RESP 0x9f8201
-
-/* Teletext */
-#define TAG_TELETEXT_EBU 0x9f9000
-
-/* Smartcard */
-#define TAG_SMARTCARD_COMMAND 0x9f8e00
-#define TAG_SMARTCARD_REPLY 0x9f8e01
-#define TAG_SMARTCARD_SEND 0x9f8e02
-#define TAG_SMARTCARD_RCV 0x9f8e03
-
-/* EPG */
-#define TAG_EPG_ENQUIRY 0x9f8f00
-#define TAG_EPG_REPLY 0x9f8f01
-
+struct firedtv_tuner_status {
+ unsigned active_system:8;
+ unsigned searching:1;
+ unsigned moving:1;
+ unsigned no_rf:1;
+ unsigned input:1;
+ unsigned selected_antenna:7;
+ unsigned ber:32;
+ unsigned signal_strength:8;
+ unsigned raster_frequency:2;
+ unsigned rf_frequency:22;
+ unsigned man_dep_info_length:8;
+ unsigned front_end_error:1;
+ unsigned antenna_error:1;
+ unsigned front_end_power_status:1;
+ unsigned power_supply:1;
+ unsigned carrier_noise_ratio:16;
+ unsigned power_supply_voltage:8;
+ unsigned antenna_voltage:8;
+ unsigned firewire_bus_voltage:8;
+ unsigned ca_mmi:1;
+ unsigned ca_pmt_reply:1;
+ unsigned ca_date_time_request:1;
+ unsigned ca_application_info:1;
+ unsigned ca_module_present_status:1;
+ unsigned ca_dvb_flag:1;
+ unsigned ca_error_flag:1;
+ unsigned ca_initialization_status:1;
+};
enum model_type {
FIREDTV_UNKNOWN = 0,
@@ -127,11 +67,22 @@ enum model_type {
FIREDTV_DVB_S2 = 4,
};
+struct device;
struct input_dev;
-struct hpsb_iso;
-struct unit_directory;
+struct firedtv;
+
+struct firedtv_backend {
+ int (*lock)(struct firedtv *fdtv, u64 addr, void *data, __be32 arg);
+ int (*read)(struct firedtv *fdtv, u64 addr, void *data, size_t len);
+ int (*write)(struct firedtv *fdtv, u64 addr, void *data, size_t len);
+ int (*start_iso)(struct firedtv *fdtv);
+ void (*stop_iso)(struct firedtv *fdtv);
+};
struct firedtv {
+ struct device *device;
+ struct list_head list;
+
struct dvb_adapter adapter;
struct dmxdev dmxdev;
struct dvb_demux demux;
@@ -149,79 +100,83 @@ struct firedtv {
struct work_struct remote_ctrl_work;
struct input_dev *remote_ctrl_dev;
- struct firedtv_channel {
- bool active;
- int pid;
- } channel[16];
- struct mutex demux_mutex;
+ enum model_type type;
+ char subunit;
+ char isochannel;
+ fe_sec_voltage_t voltage;
+ fe_sec_tone_mode_t tone;
- struct unit_directory *ud;
+ const struct firedtv_backend *backend;
+ void *backend_data;
- enum model_type type;
- char subunit;
- fe_sec_voltage_t voltage;
- fe_sec_tone_mode_t tone;
-
- int isochannel;
- struct hpsb_iso *iso_handle;
-
- struct list_head list;
+ struct mutex demux_mutex;
+ unsigned long channel_active;
+ u16 channel_pid[16];
- /* needed by avc_api */
- int resp_length;
- u8 respfrm[512];
+ size_t response_length;
+ u8 response[512];
};
-struct firewireheader {
- union {
- struct {
- __u8 tcode:4;
- __u8 sy:4;
- __u8 tag:2;
- __u8 channel:6;
-
- __u8 length_l;
- __u8 length_h;
- } hdr;
- __u32 val;
- };
-};
-
-struct CIPHeader {
- union {
- struct {
- __u8 syncbits:2;
- __u8 sid:6;
- __u8 dbs;
- __u8 fn:2;
- __u8 qpc:3;
- __u8 sph:1;
- __u8 rsv:2;
- __u8 dbc;
- __u8 syncbits2:2;
- __u8 fmt:6;
- __u32 fdf:24;
- } cip;
- __u64 val;
- };
-};
-
-extern const char *fdtv_model_names[];
-extern struct list_head fdtv_list;
-extern spinlock_t fdtv_list_lock;
+/* firedtv-1394.c */
+#ifdef CONFIG_DVB_FIREDTV_IEEE1394
+int fdtv_1394_init(struct ieee1394_device_id id_table[]);
+void fdtv_1394_exit(void);
+#else
+static inline int fdtv_1394_init(struct ieee1394_device_id it[]) { return 0; }
+static inline void fdtv_1394_exit(void) {}
+#endif
-struct device;
+/* firedtv-avc.c */
+int avc_recv(struct firedtv *fdtv, void *data, size_t length);
+int avc_tuner_status(struct firedtv *fdtv, struct firedtv_tuner_status *stat);
+struct dvb_frontend_parameters;
+int avc_tuner_dsd(struct firedtv *fdtv, struct dvb_frontend_parameters *params);
+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);
+struct dvb_diseqc_master_cmd;
+int avc_lnb_control(struct firedtv *fdtv, char voltage, char burst,
+ char conttone, char nrdiseq,
+ struct dvb_diseqc_master_cmd *diseqcmd);
+void avc_remote_ctrl_work(struct work_struct *work);
+int avc_register_remote_control(struct firedtv *fdtv);
+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 *app_info, 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);
+
+/* firedtv-ci.c */
+int fdtv_ca_register(struct firedtv *fdtv);
+void fdtv_ca_release(struct firedtv *fdtv);
/* firedtv-dvb.c */
int fdtv_start_feed(struct dvb_demux_feed *dvbdmxfeed);
int fdtv_stop_feed(struct dvb_demux_feed *dvbdmxfeed);
-int fdtv_dvbdev_init(struct firedtv *fdtv, struct device *dev);
+int fdtv_dvb_register(struct firedtv *fdtv);
+void fdtv_dvb_unregister(struct firedtv *fdtv);
+struct firedtv *fdtv_alloc(struct device *dev,
+ const struct firedtv_backend *backend,
+ const char *name, size_t name_len);
+extern const char *fdtv_model_names[];
/* firedtv-fe.c */
void fdtv_frontend_init(struct firedtv *fdtv);
-/* firedtv-iso.c */
-int setup_iso_channel(struct firedtv *fdtv);
-void tear_down_iso_channel(struct firedtv *fdtv);
+/* firedtv-rc.c */
+#ifdef CONFIG_DVB_FIREDTV_INPUT
+int fdtv_register_rc(struct firedtv *fdtv, struct device *dev);
+void fdtv_unregister_rc(struct firedtv *fdtv);
+void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code);
+#else
+static inline int fdtv_register_rc(struct firedtv *fdtv,
+ struct device *dev) { return 0; }
+static inline void fdtv_unregister_rc(struct firedtv *fdtv) {}
+static inline void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code) {}
+#endif
#endif /* _FIREDTV_H */
OpenPOWER on IntegriCloud