📄 cx18-driver.h
字号:
struct mutex feedlock;};struct cx18; /* forward reference */struct cx18_scb; /* forward reference */#define CX18_INVALID_TASK_HANDLE 0xffffffffstruct cx18_stream { /* These first four fields are always set, even if the stream is not actually created. */ struct video_device *v4l2dev; /* NULL when stream not created */ struct cx18 *cx; /* for ease of use */ const char *name; /* name of the stream */ int type; /* stream type */ u32 handle; /* task handle */ unsigned mdl_offset; u32 id; spinlock_t qlock; /* locks access to the queues */ unsigned long s_flags; /* status flags, see above */ int dma; /* can be PCI_DMA_TODEVICE, PCI_DMA_FROMDEVICE or PCI_DMA_NONE */ u64 dma_pts; wait_queue_head_t waitq; /* Buffer Stats */ u32 buffers; u32 buf_size; /* Buffer Queues */ struct cx18_queue q_free; /* free buffers */ struct cx18_queue q_full; /* full buffers */ struct cx18_queue q_io; /* waiting for I/O */ /* DVB / Digital Transport */ struct cx18_dvb dvb;};struct cx18_open_id { u32 open_id; int type; enum v4l2_priority prio; struct cx18 *cx;};/* forward declaration of struct defined in cx18-cards.h */struct cx18_card;#define CX18_VBI_FRAMES 32/* VBI data */struct vbi_info { u32 enc_size; u32 frame; u8 cc_data_odd[256]; u8 cc_data_even[256]; int cc_pos; u8 cc_no_update; u8 vps[5]; u8 vps_found; int wss; u8 wss_found; u8 wss_no_update; u32 raw_decoder_line_size; u8 raw_decoder_sav_odd_field; u8 raw_decoder_sav_even_field; u32 sliced_decoder_line_size; u8 sliced_decoder_sav_odd_field; u8 sliced_decoder_sav_even_field; struct v4l2_format in; /* convenience pointer to sliced struct in vbi_in union */ struct v4l2_sliced_vbi_format *sliced_in; u32 service_set_in; int insert_mpeg; /* Buffer for the maximum of 2 * 18 * packet_size sliced VBI lines. One for /dev/vbi0 and one for /dev/vbi8 */ struct v4l2_sliced_vbi_data sliced_data[36]; /* Buffer for VBI data inserted into MPEG stream. The first byte is a dummy byte that's never used. The next 16 bytes contain the MPEG header for the VBI data, the remainder is the actual VBI data. The max size accepted by the MPEG VBI reinsertion turns out to be 1552 bytes, which happens to be 4 + (1 + 42) * (2 * 18) bytes, where 4 is a four byte header, 42 is the max sliced VBI payload, 1 is a single line header byte and 2 * 18 is the number of VBI lines per frame. However, it seems that the data must be 1K aligned, so we have to pad the data until the 1 or 2 K boundary. This pointer array will allocate 2049 bytes to store each VBI frame. */ u8 *sliced_mpeg_data[CX18_VBI_FRAMES]; u32 sliced_mpeg_size[CX18_VBI_FRAMES]; struct cx18_buffer sliced_mpeg_buf; u32 inserted_frame; u32 start[2], count; u32 raw_size; u32 sliced_size;};/* Per cx23418, per I2C bus private algo callback data */struct cx18_i2c_algo_callback_data { struct cx18 *cx; int bus_index; /* 0 or 1 for the cx23418's 1st or 2nd I2C bus */};#define CX18_MAX_MMIO_RETRIES 10struct cx18_mmio_stats { atomic_t retried_write[CX18_MAX_MMIO_RETRIES+1]; atomic_t retried_read[CX18_MAX_MMIO_RETRIES+1];};/* Struct to hold info about cx18 cards */struct cx18 { int num; /* board number, -1 during init! */ char name[8]; /* board name for printk and interrupts (e.g. 'cx180') */ struct pci_dev *dev; /* PCI device */ const struct cx18_card *card; /* card information */ const char *card_name; /* full name of the card */ const struct cx18_card_tuner_i2c *card_i2c; /* i2c addresses to probe for tuner */ u8 is_50hz; u8 is_60hz; u8 is_out_50hz; u8 is_out_60hz; u8 nof_inputs; /* number of video inputs */ u8 nof_audio_inputs; /* number of audio inputs */ u16 buffer_id; /* buffer ID counter */ u32 v4l2_cap; /* V4L2 capabilities of card */ u32 hw_flags; /* Hardware description of the board */ unsigned mdl_offset; struct cx18_scb __iomem *scb; /* pointer to SCB */ struct cx18_av_state av_state; /* codec settings */ struct cx2341x_mpeg_params params; u32 filter_mode; u32 temporal_strength; u32 spatial_strength; /* dualwatch */ unsigned long dualwatch_jiffies; u16 dualwatch_stereo_mode; /* Digitizer type */ int digitizer; /* 0x00EF = saa7114 0x00FO = saa7115 0x0106 = mic */ struct mutex serialize_lock; /* mutex used to serialize open/close/start/stop/ioctl operations */ struct cx18_options options; /* User options */ int stream_buf_size[CX18_MAX_STREAMS]; /* Stream buffer size */ struct cx18_stream streams[CX18_MAX_STREAMS]; /* Stream data */ unsigned long i_flags; /* global cx18 flags */ atomic_t ana_capturing; /* count number of active analog capture streams */ atomic_t tot_capturing; /* total count number of active capture streams */ spinlock_t lock; /* lock access to this struct */ int search_pack_header; spinlock_t dma_reg_lock; /* lock access to DMA engine registers */ int open_id; /* incremented each time an open occurs, used as unique ID. Starts at 1, so 0 can be used as uninitialized value in the stream->id. */ u32 base_addr; struct v4l2_prio_state prio; u8 card_rev; void __iomem *enc_mem, *reg_mem; struct vbi_info vbi; u32 pgm_info_offset; u32 pgm_info_num; u32 pgm_info_write_idx; u32 pgm_info_read_idx; struct v4l2_enc_idx_entry pgm_info[CX18_MAX_PGM_INDEX]; u64 mpg_data_received; u64 vbi_data_inserted; wait_queue_head_t mb_apu_waitq; wait_queue_head_t mb_cpu_waitq; wait_queue_head_t mb_epu_waitq; wait_queue_head_t mb_hpu_waitq; wait_queue_head_t cap_w; /* when the current DMA is finished this queue is woken up */ wait_queue_head_t dma_waitq; /* i2c */ struct i2c_adapter i2c_adap[2]; struct i2c_algo_bit_data i2c_algo[2]; struct cx18_i2c_algo_callback_data i2c_algo_cb_data[2]; struct i2c_client i2c_client[2]; struct mutex i2c_bus_lock[2]; struct i2c_client *i2c_clients[I2C_CLIENTS_MAX]; /* gpio */ u32 gpio_dir; u32 gpio_val; struct mutex gpio_lock; /* Statistics */ struct cx18_mmio_stats mmio_stats; /* v4l2 and User settings */ /* codec settings */ u32 audio_input; u32 active_input; u32 active_output; v4l2_std_id std; v4l2_std_id tuner_std; /* The norm of the tuner (fixed) */};/* Globals */extern struct cx18 *cx18_cards[];extern int cx18_cards_active;extern int cx18_first_minor;extern spinlock_t cx18_cards_lock;/*==============Prototypes==================*//* Return non-zero if a signal is pending */int cx18_msleep_timeout(unsigned int msecs, int intr);/* Read Hauppauge eeprom */struct tveeprom; /* forward reference */void cx18_read_eeprom(struct cx18 *cx, struct tveeprom *tv);/* First-open initialization: load firmware, etc. */int cx18_init_on_first_open(struct cx18 *cx);#endif /* CX18_DRIVER_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -