#include <linux/list.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/usb.h>
#include <linux/interrupt.h>
#include <linux/firmware.h>
#include <linux/crc32.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/mutex.h>
#include <linux/workqueue.h>
#include <media/dmxdev.h>
#include <media/dvb_demux.h>
#include <media/dvb_frontend.h>
#include <media/dvb_net.h>
#include "ttusbdecfe.h"
static int debug;
static int output_pva;
static int enable_rc;
module_param(debug, int, 0644);
MODULE_PARM_DESC(…) …;
module_param(output_pva, int, 0444);
MODULE_PARM_DESC(…) …;
module_param(enable_rc, int, 0644);
MODULE_PARM_DESC(…) …;
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define dprintk …
#define DRIVER_NAME …
#define COMMAND_PIPE …
#define RESULT_PIPE …
#define IN_PIPE …
#define OUT_PIPE …
#define IRQ_PIPE …
#define COMMAND_PACKET_SIZE …
#define ARM_PACKET_SIZE …
#define IRQ_PACKET_SIZE …
#define ISO_BUF_COUNT …
#define FRAMES_PER_ISO_BUF …
#define ISO_FRAME_SIZE …
#define MAX_PVA_LENGTH …
enum ttusb_dec_model { … };
enum ttusb_dec_packet_type { … };
enum ttusb_dec_interface { … };
dvb_filter_pes2ts_cb_t;
struct dvb_filter_pes2ts { … };
struct ttusb_dec { … };
struct urb_frame { … };
struct filter_info { … };
static u16 rc_keys[] = …;
static void dvb_filter_pes2ts_init(struct dvb_filter_pes2ts *p2ts,
unsigned short pid,
dvb_filter_pes2ts_cb_t *cb, void *priv)
{ … }
static int dvb_filter_pes2ts(struct dvb_filter_pes2ts *p2ts,
unsigned char *pes, int len, int payload_start)
{ … }
static void ttusb_dec_set_model(struct ttusb_dec *dec,
enum ttusb_dec_model model);
static void ttusb_dec_handle_irq( struct urb *urb)
{ … }
static u16 crc16(u16 crc, const u8 *buf, size_t len)
{ … }
static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command,
int param_length, const u8 params[],
int *result_length, u8 cmd_result[])
{ … }
static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode,
unsigned int *model, unsigned int *version)
{ … }
static int ttusb_dec_audio_pes2ts_cb(void *priv, unsigned char *data)
{ … }
static int ttusb_dec_video_pes2ts_cb(void *priv, unsigned char *data)
{ … }
static void ttusb_dec_set_pids(struct ttusb_dec *dec)
{ … }
static void ttusb_dec_process_pva(struct ttusb_dec *dec, u8 *pva, int length)
{ … }
static void ttusb_dec_process_filter(struct ttusb_dec *dec, u8 *packet,
int length)
{ … }
static void ttusb_dec_process_packet(struct ttusb_dec *dec)
{ … }
static void swap_bytes(u8 *b, int length)
{ … }
static void ttusb_dec_process_urb_frame(struct ttusb_dec *dec, u8 *b,
int length)
{ … }
static void ttusb_dec_process_urb_frame_list(struct work_struct *t)
{ … }
static void ttusb_dec_process_urb(struct urb *urb)
{ … }
static void ttusb_dec_setup_urbs(struct ttusb_dec *dec)
{ … }
static void ttusb_dec_stop_iso_xfer(struct ttusb_dec *dec)
{ … }
static int ttusb_dec_set_interface(struct ttusb_dec *dec,
enum ttusb_dec_interface interface)
{ … }
static int ttusb_dec_start_iso_xfer(struct ttusb_dec *dec)
{ … }
static int ttusb_dec_start_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
{ … }
static int ttusb_dec_start_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
{ … }
static int ttusb_dec_start_feed(struct dvb_demux_feed *dvbdmxfeed)
{ … }
static int ttusb_dec_stop_ts_feed(struct dvb_demux_feed *dvbdmxfeed)
{ … }
static int ttusb_dec_stop_sec_feed(struct dvb_demux_feed *dvbdmxfeed)
{ … }
static int ttusb_dec_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
{ … }
static void ttusb_dec_free_iso_urbs(struct ttusb_dec *dec)
{ … }
static int ttusb_dec_alloc_iso_urbs(struct ttusb_dec *dec)
{ … }
static void ttusb_dec_init_bh_work(struct ttusb_dec *dec)
{ … }
static int ttusb_init_rc( struct ttusb_dec *dec)
{ … }
static void ttusb_dec_init_v_pes(struct ttusb_dec *dec)
{ … }
static int ttusb_dec_init_usb(struct ttusb_dec *dec)
{ … }
static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
{ … }
static int ttusb_dec_init_stb(struct ttusb_dec *dec)
{ … }
static int ttusb_dec_init_dvb(struct ttusb_dec *dec)
{ … }
static void ttusb_dec_exit_dvb(struct ttusb_dec *dec)
{ … }
static void ttusb_dec_exit_rc(struct ttusb_dec *dec)
{ … }
static void ttusb_dec_exit_usb(struct ttusb_dec *dec)
{ … }
static void ttusb_dec_exit_bh_work(struct ttusb_dec *dec)
{ … }
static void ttusb_dec_init_filters(struct ttusb_dec *dec)
{ … }
static void ttusb_dec_exit_filters(struct ttusb_dec *dec)
{ … }
static int fe_send_command(struct dvb_frontend* fe, const u8 command,
int param_length, const u8 params[],
int *result_length, u8 cmd_result[])
{ … }
static const struct ttusbdecfe_config fe_config = …;
static int ttusb_dec_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{ … }
static void ttusb_dec_disconnect(struct usb_interface *intf)
{ … }
static void ttusb_dec_set_model(struct ttusb_dec *dec,
enum ttusb_dec_model model)
{ … }
static const struct usb_device_id ttusb_dec_table[] = …;
static struct usb_driver ttusb_dec_driver = …;
module_usb_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…);
MODULE_LICENSE(…) …;
MODULE_DEVICE_TABLE(usb, ttusb_dec_table);