#ifndef _NGENE_H_
#define _NGENE_H_
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/i2c.h>
#include <asm/dma.h>
#include <linux/scatterlist.h>
#include <linux/dvb/frontend.h>
#include <linux/workqueue.h>
#include <media/dmxdev.h>
#include <media/dvbdev.h>
#include <media/dvb_demux.h>
#include <media/dvb_ca_en50221.h>
#include <media/dvb_frontend.h>
#include <media/dvb_ringbuffer.h>
#include <media/dvb_net.h>
#include "cxd2099.h"
#define DEVICE_NAME …
#define NGENE_VID …
#define NGENE_PID …
#ifndef VIDEO_CAP_VC1
#define VIDEO_CAP_AVC …
#define VIDEO_CAP_H264 …
#define VIDEO_CAP_VC1 …
#define VIDEO_CAP_WMV9 …
#define VIDEO_CAP_MPEG4 …
#endif
#define DEMOD_TYPE_STV090X …
#define DEMOD_TYPE_DRXK …
#define DEMOD_TYPE_STV0367 …
#define DEMOD_TYPE_XO2 …
#define DEMOD_TYPE_STV0910 …
#define DEMOD_TYPE_SONY_CT2 …
#define DEMOD_TYPE_SONY_ISDBT …
#define DEMOD_TYPE_SONY_C2T2 …
#define DEMOD_TYPE_ST_ATSC …
#define DEMOD_TYPE_SONY_C2T2I …
#define NGENE_XO2_TYPE_NONE …
#define NGENE_XO2_TYPE_DUOFLEX …
#define NGENE_XO2_TYPE_CI …
enum STREAM { … };
enum SMODE_BITS { … };
enum STREAM_FLAG_BITS { … };
#define PROGRAM_ROM …
#define PROGRAM_SRAM …
#define PERIPHERALS0 …
#define PERIPHERALS1 …
#define SHARED_BUFFER …
#define HOST_TO_NGENE …
#define NGENE_TO_HOST …
#define NGENE_COMMAND …
#define NGENE_COMMAND_HI …
#define NGENE_STATUS …
#define NGENE_STATUS_HI …
#define NGENE_EVENT …
#define NGENE_EVENT_HI …
#define VARIABLES …
#define NGENE_INT_COUNTS …
#define NGENE_INT_ENABLE …
#define NGENE_VBI_LINE_COUNT …
#define BUFFER_GP_XMIT …
#define BUFFER_GP_RECV …
#define EEPROM_AREA …
#define SG_V_IN_1 …
#define SG_VBI_1 …
#define SG_A_IN_1 …
#define SG_V_IN_2 …
#define SG_VBI_2 …
#define SG_A_IN_2 …
#define SG_V_OUT …
#define SG_A_OUT2 …
#define DATA_A_IN_1 …
#define DATA_A_IN_2 …
#define DATA_A_OUT …
#define DATA_V_IN_1 …
#define DATA_V_IN_2 …
#define DATA_V_OUT …
#define DATA_FIFO_AREA …
#define TIMESTAMPS …
#define SCRATCHPAD …
#define FORCE_INT …
#define FORCE_NMI …
#define INT_STATUS …
#define DEV_VER …
#define FW_DEBUG_DEFAULT …
struct SG_ADDR { … } __attribute__ ((packed));
struct SHARED_MEMORY { … } __attribute__ ((packed));
struct BUFFER_STREAM_RESULTS { … } __attribute__ ((packed));
struct HW_SCATTER_GATHER_ELEMENT { … } __attribute__ ((packed));
struct BUFFER_HEADER { … } __attribute__ ((packed));
struct EVENT_BUFFER { … } __attribute__ ((packed));
enum OPCODES { … };
enum RESPONSES { … };
struct FW_HEADER { … } __attribute__ ((packed));
struct FW_I2C_WRITE { … } __attribute__ ((packed));
struct FW_I2C_CONTINUE_WRITE { … } __attribute__ ((packed));
struct FW_I2C_READ { … } __attribute__ ((packed));
struct FW_SPI_WRITE { … } __attribute__ ((packed));
struct FW_SPI_READ { … } __attribute__ ((packed));
struct FW_FWLOAD_PREPARE { … } __attribute__ ((packed));
struct FW_FWLOAD_FINISH { … } __attribute__ ((packed));
enum FSC_MODE_BITS { … };
struct FW_STREAM_CONTROL { … } __attribute__((packed));
#define AUDIO_BLOCK_SIZE …
#define TS_BLOCK_SIZE …
struct FW_MEM_READ { … } __attribute__ ((packed));
struct FW_MEM_WRITE { … } __attribute__ ((packed));
struct FW_SFR_IRAM_READ { … } __attribute__ ((packed));
struct FW_SFR_IRAM_WRITE { … } __attribute__ ((packed));
struct FW_SET_GPIO_PIN { … } __attribute__ ((packed));
struct FW_SET_GPIO_INT { … } __attribute__ ((packed));
struct FW_SET_DEBUGMODE { … } __attribute__ ((packed));
struct FW_CONFIGURE_BUFFERS { … } __attribute__ ((packed));
enum _BUFFER_CONFIGS { … };
struct FW_CONFIGURE_FREE_BUFFERS { … } __attribute__ ((packed));
struct FW_CONFIGURE_UART { … } __attribute__ ((packed));
enum _UART_CONFIG { … };
struct FW_WRITE_UART { … } __attribute__ ((packed));
struct ngene_command { … } __attribute__ ((packed));
#define NGENE_INTERFACE_VERSION …
#define MAX_VIDEO_BUFFER_SIZE …
#define MAX_AUDIO_BUFFER_SIZE …
#define MAX_VBI_BUFFER_SIZE …
#define MAX_TS_BUFFER_SIZE …
#define MAX_HDTV_BUFFER_SIZE …
#define OVERFLOW_BUFFER_SIZE …
#define RING_SIZE_VIDEO …
#define RING_SIZE_AUDIO …
#define RING_SIZE_TS …
#define NUM_SCATTER_GATHER_ENTRIES …
#define MAX_DMA_LENGTH …
#define EVENT_QUEUE_SIZE …
struct SBufferHeader { … };
#define SIZEOF_SBufferHeader …
enum HWSTATE { … };
enum KSSTATE { … };
struct SRingBufferDescriptor { … };
enum STREAMMODEFLAGS { … };
enum BufferExchangeFlags { … };
IBufferExchange;
struct MICI_STREAMINFO { … };
#define MIXER_ADDR_TVTUNER …
#define MIXER_ADDR_LAST …
struct ngene_channel;
struct mychip { … };
struct ngene_channel { … };
struct ngene_ci { … };
struct ngene;
rx_cb_t;
tx_cb_t;
struct ngene { … };
struct ngene_info { … };
int ngene_probe(struct pci_dev *pci_dev, const struct pci_device_id *id);
void ngene_remove(struct pci_dev *pdev);
void ngene_shutdown(struct pci_dev *pdev);
int ngene_command(struct ngene *dev, struct ngene_command *com);
int ngene_command_gpio_set(struct ngene *dev, u8 select, u8 level);
void set_transfer(struct ngene_channel *chan, int state);
void FillTSBuffer(void *Buffer, int Length, u32 Flags);
int ngene_port_has_cxd2099(struct i2c_adapter *i2c, u8 *type);
int ngene_i2c_init(struct ngene *dev, int dev_nr);
extern struct dvb_device ngene_dvbdev_ci;
void *tsout_exchange(void *priv, void *buf, u32 len, u32 clock, u32 flags);
void *tsin_exchange(void *priv, void *buf, u32 len, u32 clock, u32 flags);
int ngene_start_feed(struct dvb_demux_feed *dvbdmxfeed);
int ngene_stop_feed(struct dvb_demux_feed *dvbdmxfeed);
int my_dvb_dmx_ts_card_init(struct dvb_demux *dvbdemux, char *id,
int (*start_feed)(struct dvb_demux_feed *),
int (*stop_feed)(struct dvb_demux_feed *),
void *priv);
int my_dvb_dmxdev_ts_card_init(struct dmxdev *dmxdev,
struct dvb_demux *dvbdemux,
struct dmx_frontend *hw_frontend,
struct dmx_frontend *mem_frontend,
struct dvb_adapter *dvb_adapter);
#endif