cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

firedtv.h (5035B)


      1/* SPDX-License-Identifier: GPL-2.0-or-later */
      2/*
      3 * FireDTV driver (formerly known as FireSAT)
      4 *
      5 * Copyright (C) 2004 Andreas Monitzer <andy@monitzer.com>
      6 * Copyright (C) 2008 Henrik Kurelid <henrik@kurelid.se>
      7 */
      8
      9#ifndef _FIREDTV_H
     10#define _FIREDTV_H
     11
     12#include <linux/time.h>
     13#include <linux/dvb/dmx.h>
     14#include <linux/dvb/frontend.h>
     15#include <linux/list.h>
     16#include <linux/mod_devicetable.h>
     17#include <linux/mutex.h>
     18#include <linux/spinlock_types.h>
     19#include <linux/types.h>
     20#include <linux/wait.h>
     21#include <linux/workqueue.h>
     22
     23#include <media/demux.h>
     24#include <media/dmxdev.h>
     25#include <media/dvb_demux.h>
     26#include <media/dvb_frontend.h>
     27#include <media/dvb_net.h>
     28#include <media/dvbdev.h>
     29
     30struct firedtv_tuner_status {
     31	unsigned active_system:8;
     32	unsigned searching:1;
     33	unsigned moving:1;
     34	unsigned no_rf:1;
     35	unsigned input:1;
     36	unsigned selected_antenna:7;
     37	unsigned ber:32;
     38	unsigned signal_strength:8;
     39	unsigned raster_frequency:2;
     40	unsigned rf_frequency:22;
     41	unsigned man_dep_info_length:8;
     42	unsigned front_end_error:1;
     43	unsigned antenna_error:1;
     44	unsigned front_end_power_status:1;
     45	unsigned power_supply:1;
     46	unsigned carrier_noise_ratio:16;
     47	unsigned power_supply_voltage:8;
     48	unsigned antenna_voltage:8;
     49	unsigned firewire_bus_voltage:8;
     50	unsigned ca_mmi:1;
     51	unsigned ca_pmt_reply:1;
     52	unsigned ca_date_time_request:1;
     53	unsigned ca_application_info:1;
     54	unsigned ca_module_present_status:1;
     55	unsigned ca_dvb_flag:1;
     56	unsigned ca_error_flag:1;
     57	unsigned ca_initialization_status:1;
     58};
     59
     60enum model_type {
     61	FIREDTV_UNKNOWN = 0,
     62	FIREDTV_DVB_S   = 1,
     63	FIREDTV_DVB_C   = 2,
     64	FIREDTV_DVB_T   = 3,
     65	FIREDTV_DVB_S2  = 4,
     66};
     67
     68struct device;
     69struct input_dev;
     70struct fdtv_ir_context;
     71
     72struct firedtv {
     73	struct device *device;
     74	struct list_head list;
     75
     76	struct dvb_adapter	adapter;
     77	struct dmxdev		dmxdev;
     78	struct dvb_demux	demux;
     79	struct dmx_frontend	frontend;
     80	struct dvb_net		dvbnet;
     81	struct dvb_frontend	fe;
     82
     83	struct dvb_device	*cadev;
     84	int			ca_last_command;
     85	int			ca_time_interval;
     86
     87	struct mutex		avc_mutex;
     88	wait_queue_head_t	avc_wait;
     89	bool			avc_reply_received;
     90	struct work_struct	remote_ctrl_work;
     91	struct input_dev	*remote_ctrl_dev;
     92
     93	enum model_type		type;
     94	char			subunit;
     95	s8			isochannel;
     96	struct fdtv_ir_context	*ir_context;
     97
     98	enum fe_sec_voltage	voltage;
     99	enum fe_sec_tone_mode	tone;
    100
    101	struct mutex		demux_mutex;
    102	unsigned long		channel_active;
    103	u16			channel_pid[16];
    104
    105	int			avc_data_length;
    106	u8			avc_data[512];
    107};
    108
    109/* firedtv-avc.c */
    110int avc_recv(struct firedtv *fdtv, void *data, size_t length);
    111int avc_tuner_status(struct firedtv *fdtv, struct firedtv_tuner_status *stat);
    112struct dtv_frontend_properties;
    113int avc_tuner_dsd(struct firedtv *fdtv, struct dtv_frontend_properties *params);
    114int avc_tuner_set_pids(struct firedtv *fdtv, unsigned char pidc, u16 pid[]);
    115int avc_tuner_get_ts(struct firedtv *fdtv);
    116int avc_identify_subunit(struct firedtv *fdtv);
    117struct dvb_diseqc_master_cmd;
    118int avc_lnb_control(struct firedtv *fdtv, char voltage, char burst,
    119		    char conttone, char nrdiseq,
    120		    struct dvb_diseqc_master_cmd *diseqcmd);
    121void avc_remote_ctrl_work(struct work_struct *work);
    122int avc_register_remote_control(struct firedtv *fdtv);
    123int avc_ca_app_info(struct firedtv *fdtv, unsigned char *app_info,
    124		    unsigned int *len);
    125int avc_ca_info(struct firedtv *fdtv, unsigned char *app_info,
    126		unsigned int *len);
    127int avc_ca_reset(struct firedtv *fdtv);
    128int avc_ca_pmt(struct firedtv *fdtv, char *app_info, int length);
    129int avc_ca_get_time_date(struct firedtv *fdtv, int *interval);
    130int avc_ca_enter_menu(struct firedtv *fdtv);
    131int avc_ca_get_mmi(struct firedtv *fdtv, char *mmi_object, unsigned int *len);
    132int cmp_establish_pp_connection(struct firedtv *fdtv, int plug, int channel);
    133void cmp_break_pp_connection(struct firedtv *fdtv, int plug, int channel);
    134
    135/* firedtv-ci.c */
    136int fdtv_ca_register(struct firedtv *fdtv);
    137void fdtv_ca_release(struct firedtv *fdtv);
    138
    139/* firedtv-dvb.c */
    140int fdtv_start_feed(struct dvb_demux_feed *dvbdmxfeed);
    141int fdtv_stop_feed(struct dvb_demux_feed *dvbdmxfeed);
    142int fdtv_dvb_register(struct firedtv *fdtv, const char *name);
    143void fdtv_dvb_unregister(struct firedtv *fdtv);
    144
    145/* firedtv-fe.c */
    146void fdtv_frontend_init(struct firedtv *fdtv, const char *name);
    147
    148/* firedtv-fw.c */
    149int fdtv_lock(struct firedtv *fdtv, u64 addr, void *data);
    150int fdtv_read(struct firedtv *fdtv, u64 addr, void *data);
    151int fdtv_write(struct firedtv *fdtv, u64 addr, void *data, size_t len);
    152int fdtv_start_iso(struct firedtv *fdtv);
    153void fdtv_stop_iso(struct firedtv *fdtv);
    154
    155/* firedtv-rc.c */
    156#ifdef CONFIG_DVB_FIREDTV_INPUT
    157int fdtv_register_rc(struct firedtv *fdtv, struct device *dev);
    158void fdtv_unregister_rc(struct firedtv *fdtv);
    159void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code);
    160#else
    161static inline int fdtv_register_rc(struct firedtv *fdtv,
    162				   struct device *dev) { return 0; }
    163static inline void fdtv_unregister_rc(struct firedtv *fdtv) {}
    164static inline void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code) {}
    165#endif
    166
    167#endif /* _FIREDTV_H */