computes log2 of a value; the result is shifted left by 24 bits
Parameters
Description
to use rational values you can use the following method:
intlog2(value) = intlog2(value * 2^x) - x * 2^24
Some usecase examples:
intlog2(8) will give 3 << 24 = 3 * 2^24
intlog2(9) will give 3 << 24 + ... = 3.16... * 2^24
intlog2(1.5) = intlog2(3) - 2^24 = 0.584... * 2^24
Return
log2(value) * 2^24
computes log10 of a value; the result is shifted left by 24 bits
Parameters
Description
to use rational values you can use the following method:
intlog10(value) = intlog10(value * 10^x) - x * 2^24
An usecase example:
intlog10(1000) will give 3 << 24 = 3 * 2^24due to the implementation intlog10(1000) might be not exactly 3 * 2^24
look at intlog2 for similar examples
Return
log10(value) * 2^24
represents a Digital TV adapter using Linux DVB API
Definition
struct dvb_adapter {
int num;
struct list_head list_head;
struct list_head device_list;
const char * name;
u8 proposed_mac[6];
void * priv;
struct device * device;
struct module * module;
int mfe_shared;
struct dvb_device * mfe_dvbdev;
struct mutex mfe_lock;
#if defined(CONFIG_MEDIA_CONTROLLER_DVB)
struct media_device * mdev;
struct media_entity * conn;
struct media_pad * conn_pads;
#endif
};
Members
represents a DVB device node
Definition
struct dvb_device {
struct list_head list_head;
const struct file_operations * fops;
struct dvb_adapter * adapter;
int type;
int minor;
u32 id;
int readers;
int writers;
int users;
wait_queue_head_t wait_queue;
int (* kernel_ioctl) (struct file *file, unsigned int cmd, void *arg);
#if defined(CONFIG_MEDIA_CONTROLLER_DVB)
const char * name;
struct media_intf_devnode * intf_devnode;
unsigned tsout_num_entities;
struct media_entity * entity;
struct media_entity * tsout_entity;
struct media_pad * pads;
struct media_pad * tsout_pads;
#endif
void * priv;
};
Members
Description
This structure is used by the DVB core (frontend, CA, net, demux) in order to create the device nodes. Usually, driver should not initialize this struct diretly.
Registers a new DVB adapter
Parameters
Unregisters a DVB adapter
Parameters
Registers a new DVB device
Parameters
Remove a registered DVB device
Parameters
Description
This does not free memory. To do that, call dvb_free_device().
Free memory occupied by a DVB device.
Parameters
Description
Call dvb_unregister_device() before calling this function.
Unregisters a DVB device
Parameters
Description
This is a combination of dvb_remove_device() and dvb_free_device(). Using this function is usually a mistake, and is often an indicator for a use-after-free bug (when a userspace process keeps a file handle to a detached device).
Creates media graph for the Digital TV part of the device.
Parameters
Description
This function checks all DVB-related functions at the media controller entities and creates the needed links for the media graph. It is capable of working with multiple tuners or multiple frontends, but it won’t create links if the device has multiple tuners and multiple frontends or if the device has multiple muxes. In such case, the caller driver should manually create the remaining links.
Those routines implement ring buffers used to handle digital TV data and copy it from/to userspace.
Note
/* write @buflen: bytes */ free = dvb_ringbuffer_free(rbuf); if (free >= buflen) count = dvb_ringbuffer_write(rbuf, buffer, buflen); else /* do something */ /* read min. 1000, max. @bufsize: bytes */ avail = dvb_ringbuffer_avail(rbuf); if (avail >= 1000) count = dvb_ringbuffer_read(rbuf, buffer, min(avail, bufsize)); else /* do something */
Describes a ring buffer used at DVB framework
Definition
struct dvb_ringbuffer {
u8 * data;
ssize_t size;
ssize_t pread;
ssize_t pwrite;
int error;
wait_queue_head_t queue;
spinlock_t lock;
};
Members
initialize ring buffer, lock and queue
Parameters
test whether buffer is empty
Parameters
returns the number of free bytes in the buffer
Parameters
Return
number of free bytes in the buffer
returns the number of bytes waiting in the buffer
Parameters
Return
number of bytes waiting in the buffer
resets the ringbuffer to initial state
Parameters
Description
Resets the read and write pointers to zero and flush the buffer.
This counts as a read and write operation
flush buffer
Parameters
flush buffer protected by spinlock and wake-up waiting task(s)
Parameters
peek at byte offs in the buffer
Parameters
advance read ptr by num bytes
Parameters
Reads a buffer into a user pointer
Parameters
Description
This variant assumes that the buffer is a memory at the userspace. So, it will internally call copy_to_user().
Return
number of bytes transferred or -EFAULT
Reads a buffer into a pointer
Parameters
Description
This variant assumes that the buffer is a memory at the Kernel space
Return
number of bytes transferred or -EFAULT
write single byte to ring buffer
Parameters
Writes a buffer into the ringbuffer
Parameters
Description
This variant assumes that the buffer is a memory at the Kernel space
Return
number of bytes transferred or -EFAULT
Writes a buffer received via a user pointer
Parameters
Description
This variant assumes that the buffer is a memory at the userspace. So, it will internally call copy_from_user().
Return
number of bytes transferred or -EFAULT
Write a packet into the ringbuffer.
Parameters
Return
Number of bytes written, or -EFAULT, -ENOMEM, -EVINAL.
Read from a packet in the ringbuffer.
Parameters
Return
Number of bytes read, or -EFAULT.
Note
unlike dvb_ringbuffer_read(), this does NOT update the read pointer in the ringbuffer. You must use dvb_ringbuffer_pkt_dispose() to mark a packet as no longer required.
Read from a packet in the ringbuffer.
Parameters
Note
unlike dvb_ringbuffer_read_user(), this DOES update the read pointer in the ringbuffer.
Return
Number of bytes read, or -EFAULT.
Dispose of a packet in the ring buffer.
Parameters
Get the index of the next packet in a ringbuffer.
Parameters
The Digital TV Frontend kABI defines a driver-internal interface for registering low-level, hardware specific driver to a hardware independent frontend layer. It is only of interest for Digital TV device driver writers. The header file for this API is named dvb_frontend.h and located in drivers/media/dvb-core.
Before using the Digital TV frontend core, the bridge driver should attach the frontend demod, tuner and SEC devices and call dvb_register_frontend(), in order to register the new frontend at the subsystem. At device detach/removal, the bridge driver should call dvb_unregister_frontend() to remove the frontend from the core and then dvb_frontend_detach() to free the memory allocated by the frontend drivers.
The drivers should also call dvb_frontend_suspend() as part of their handler for the device_driver.suspend(), and dvb_frontend_resume() as part of their handler for device_driver.resume().
A few other optional functions are provided to handle some special cases.
parameters to adjust frontend tuning
Definition
struct dvb_frontend_tune_settings {
int min_delay_ms;
int step_size;
int max_drift;
};
Members
NOTE
step_size is in Hz, for terrestrial/cable or kHz for satellite
Frontend name and min/max ranges/bandwidths
Definition
struct dvb_tuner_info {
char name[128];
u32 frequency_min;
u32 frequency_max;
u32 frequency_step;
u32 bandwidth_min;
u32 bandwidth_max;
u32 bandwidth_step;
};
Members
NOTE
frequency parameters are in Hz, for terrestrial/cable or kHz for satellite.
Parameters to tune into an analog/radio channel
Definition
struct analog_parameters {
unsigned int frequency;
unsigned int mode;
unsigned int audmode;
u64 std;
};
Members
Description
Hybrid tuners should be supported by both V4L2 and DVB APIs. This struct contains the data that are used by the V4L2 side. To avoid dependencies from V4L2 headers, all enums here are declared as integers.
defines the algorithm used to tune into a channel
Constants
search callback possible return status
Constants
Tuner information and callbacks
Definition
struct dvb_tuner_ops {
struct dvb_tuner_info info;
void (* release) (struct dvb_frontend *fe);
int (* init) (struct dvb_frontend *fe);
int (* sleep) (struct dvb_frontend *fe);
int (* suspend) (struct dvb_frontend *fe);
int (* resume) (struct dvb_frontend *fe);
int (* set_params) (struct dvb_frontend *fe);
int (* set_analog_params) (struct dvb_frontend *fe, struct analog_parameters *p);
int (* set_config) (struct dvb_frontend *fe, void *priv_cfg);
int (* get_frequency) (struct dvb_frontend *fe, u32 *frequency);
int (* get_bandwidth) (struct dvb_frontend *fe, u32 *bandwidth);
int (* get_if_frequency) (struct dvb_frontend *fe, u32 *frequency);
#define TUNER_STATUS_LOCKED 1
#define TUNER_STATUS_STEREO 2
int (* get_status) (struct dvb_frontend *fe, u32 *status);
int (* get_rf_strength) (struct dvb_frontend *fe, u16 *strength);
int (* get_afc) (struct dvb_frontend *fe, s32 *afc);
int (* calc_regs) (struct dvb_frontend *fe, u8 *buf, int buf_len);
int (* set_frequency) (struct dvb_frontend *fe, u32 frequency);
int (* set_bandwidth) (struct dvb_frontend *fe, u32 bandwidth);
};
Members
NOTE
frequencies used on get_frequency and set_frequency are in Hz for terrestrial/cable or kHz for satellite.
Information struct for analog TV part of the demod
Definition
struct analog_demod_info {
char * name;
};
Members
Demodulation information and callbacks for analog TV and radio
Definition
struct analog_demod_ops {
struct analog_demod_info info;
void (* set_params) (struct dvb_frontend *fe,struct analog_parameters *params);
int (* has_signal) (struct dvb_frontend *fe, u16 *signal);
int (* get_afc) (struct dvb_frontend *fe, s32 *afc);
void (* tuner_status) (struct dvb_frontend *fe);
void (* standby) (struct dvb_frontend *fe);
void (* release) (struct dvb_frontend *fe);
int (* i2c_gate_ctrl) (struct dvb_frontend *fe, int enable);
int (* set_config) (struct dvb_frontend *fe, void *priv_cfg);
};
Members
Demodulation information and callbacks for ditialt TV
Definition
struct dvb_frontend_ops {
struct dvb_frontend_info info;
u8 delsys[MAX_DELSYS];
void (* detach) (struct dvb_frontend *fe);
void (* release) (struct dvb_frontend* fe);
void (* release_sec) (struct dvb_frontend* fe);
int (* init) (struct dvb_frontend* fe);
int (* sleep) (struct dvb_frontend* fe);
int (* write) (struct dvb_frontend* fe, const u8 buf[], int len);
int (* tune) (struct dvb_frontend* fe,bool re_tune,unsigned int mode_flags,unsigned int *delay,enum fe_status *status);
enum dvbfe_algo (* get_frontend_algo) (struct dvb_frontend *fe);
int (* set_frontend) (struct dvb_frontend *fe);
int (* get_tune_settings) (struct dvb_frontend* fe, struct dvb_frontend_tune_settings* settings);
int (* get_frontend) (struct dvb_frontend *fe,struct dtv_frontend_properties *props);
int (* read_status) (struct dvb_frontend *fe, enum fe_status *status);
int (* read_ber) (struct dvb_frontend* fe, u32* ber);
int (* read_signal_strength) (struct dvb_frontend* fe, u16* strength);
int (* read_snr) (struct dvb_frontend* fe, u16* snr);
int (* read_ucblocks) (struct dvb_frontend* fe, u32* ucblocks);
int (* diseqc_reset_overload) (struct dvb_frontend* fe);
int (* diseqc_send_master_cmd) (struct dvb_frontend* fe, struct dvb_diseqc_master_cmd* cmd);
int (* diseqc_recv_slave_reply) (struct dvb_frontend* fe, struct dvb_diseqc_slave_reply* reply);
int (* diseqc_send_burst) (struct dvb_frontend *fe,enum fe_sec_mini_cmd minicmd);
int (* set_tone) (struct dvb_frontend *fe, enum fe_sec_tone_mode tone);
int (* set_voltage) (struct dvb_frontend *fe,enum fe_sec_voltage voltage);
int (* enable_high_lnb_voltage) (struct dvb_frontend* fe, long arg);
int (* dishnetwork_send_legacy_command) (struct dvb_frontend* fe, unsigned long cmd);
int (* i2c_gate_ctrl) (struct dvb_frontend* fe, int enable);
int (* ts_bus_ctrl) (struct dvb_frontend* fe, int acquire);
int (* set_lna) (struct dvb_frontend *);
enum dvbfe_search (* search) (struct dvb_frontend *fe);
struct dvb_tuner_ops tuner_ops;
struct analog_demod_ops analog_ops;
int (* set_property) (struct dvb_frontend* fe, struct dtv_property* tvp);
int (* get_property) (struct dvb_frontend* fe, struct dtv_property* tvp);
};
Members
contains a list of properties that are specific to a digital TV standard.
Definition
struct dtv_frontend_properties {
u32 frequency;
enum fe_modulation modulation;
enum fe_sec_voltage voltage;
enum fe_sec_tone_mode sectone;
enum fe_spectral_inversion inversion;
enum fe_code_rate fec_inner;
enum fe_transmit_mode transmission_mode;
u32 bandwidth_hz;
enum fe_guard_interval guard_interval;
enum fe_hierarchy hierarchy;
u32 symbol_rate;
enum fe_code_rate code_rate_HP;
enum fe_code_rate code_rate_LP;
enum fe_pilot pilot;
enum fe_rolloff rolloff;
enum fe_delivery_system delivery_system;
enum fe_interleaving interleaving;
u8 isdbt_partial_reception;
u8 isdbt_sb_mode;
u8 isdbt_sb_subchannel;
u32 isdbt_sb_segment_idx;
u32 isdbt_sb_segment_count;
u8 isdbt_layer_enabled;
struct layer[3];
u32 stream_id;
u8 atscmh_fic_ver;
u8 atscmh_parade_id;
u8 atscmh_nog;
u8 atscmh_tnog;
u8 atscmh_sgn;
u8 atscmh_prc;
u8 atscmh_rs_frame_mode;
u8 atscmh_rs_frame_ensemble;
u8 atscmh_rs_code_mode_pri;
u8 atscmh_rs_code_mode_sec;
u8 atscmh_sccc_block_mode;
u8 atscmh_sccc_code_mode_a;
u8 atscmh_sccc_code_mode_b;
u8 atscmh_sccc_code_mode_c;
u8 atscmh_sccc_code_mode_d;
u32 lna;
struct dtv_fe_stats strength;
struct dtv_fe_stats cnr;
struct dtv_fe_stats pre_bit_error;
struct dtv_fe_stats pre_bit_count;
struct dtv_fe_stats post_bit_error;
struct dtv_fe_stats post_bit_count;
struct dtv_fe_stats block_error;
struct dtv_fe_stats block_count;
};
Members
NOTE
derivated statistics like Uncorrected Error blocks (UCE) are calculated on userspace.
Only a subset of the properties are needed for a given delivery system. For more info, consult the media_api.html with the documentation of the Userspace API.
Frontend structure to be used on drivers.
Definition
struct dvb_frontend {
struct dvb_frontend_ops ops;
struct dvb_adapter * dvb;
void * demodulator_priv;
void * tuner_priv;
void * frontend_priv;
void * sec_priv;
void * analog_demod_priv;
struct dtv_frontend_properties dtv_property_cache;
#define DVB_FRONTEND_COMPONENT_TUNER 0
#define DVB_FRONTEND_COMPONENT_DEMOD 1
int (* callback) (void *adapter_priv, int component, int cmd, int arg);
int id;
unsigned int exit;
};
Members
Registers a DVB frontend at the adapter
Parameters
Description
Allocate and initialize the private data needed by the frontend core to manage the frontend and calls dvb_register_device() to register a new frontend. It also cleans the property cache that stores the frontend parameters and selects the first available delivery system.
Unregisters a DVB frontend
Parameters
Description
Stops the frontend kthread, calls dvb_unregister_device() and frees the private frontend data allocated by dvb_register_frontend().
NOTE
This function doesn’t frees the memory allocated by the demod, by the SEC driver and by the tuner. In order to free it, an explicit call to dvb_frontend_detach() is needed, after calling this function.
Detaches and frees frontend specific data
Parameters
Description
This function should be called after dvb_unregister_frontend(). It calls the SEC, tuner and demod release functions: dvb_frontend_ops.release_sec, dvb_frontend_ops.tuner_ops.release, dvb_frontend_ops.analog_ops.release and dvb_frontend_ops.release.
If the driver is compiled with CONFIG_MEDIA_ATTACH, it also decreases the module reference count, needed to allow userspace to remove the previously used DVB frontend modules.
Suspends a Digital TV frontend
Parameters
Description
This function prepares a Digital TV frontend to suspend.
In order to prepare the tuner to suspend, if dvb_frontend_ops.tuner_ops.suspend() is available, it calls it. Otherwise, it will call dvb_frontend_ops.tuner_ops.sleep(), if available.
It will also call dvb_frontend_ops.sleep() to put the demod to suspend.
The drivers should also call dvb_frontend_suspend() as part of their handler for the device_driver.suspend().
Resumes a Digital TV frontend
Parameters
Description
This function resumes the usual operation of the tuner after resume.
In order to resume the frontend, it calls the demod dvb_frontend_ops.init().
If dvb_frontend_ops.tuner_ops.resume() is available, It, it calls it. Otherwise,t will call dvb_frontend_ops.tuner_ops.init(), if available.
Once tuner and demods are resumed, it will enforce that the SEC voltage and tone are restored to their previous values and wake up the frontend’s kthread in order to retune the frontend.
The drivers should also call dvb_frontend_resume() as part of their handler for the device_driver.resume().
forces a reinitialisation at the frontend
Parameters
Description
Calls dvb_frontend_ops.init() and dvb_frontend_ops.tuner_ops.init(), and resets SEC tone and voltage (for Satellite systems).
NOTE
Currently, this function is used only by one driver (budget-av). It seems to be due to address some special issue with that specific frontend.
Sleep for the amount of time given by add_usec parameter
Parameters
Description
This function is used to measure the time required for the FE_DISHNETWORK_SEND_LEGACY_CMD ioctl to work. It needs to be as precise as possible, as it affects the detection of the dish tone command at the satellite subsystem.
Its used internally by the DVB frontend core, in order to emulate FE_DISHNETWORK_SEND_LEGACY_CMD using the dvb_frontend_ops.set_voltage() callback.
NOTE
it should not be used at the drivers, as the emulation for the legacy callback is provided by the Kernel. The only situation where this should be at the drivers is when there are some bugs at the hardware that would prevent the core emulation to work. On such cases, the driver would be writing a dvb_frontend_ops.dishnetwork_send_legacy_command() and calling this function directly.
The Kernel Digital TV Demux kABI defines a driver-internal interface for registering low-level, hardware specific driver to a hardware independent demux layer. It is only of interest for Digital TV device driver writers. The header file for this kABI is named demux.h and located in drivers/media/dvb-core.
The demux kABI should be implemented for each demux in the system. It is used to select the TS source of a demux and to manage the demux resources. When the demux client allocates a resource via the demux kABI, it receives a pointer to the kABI of that resource.
Each demux receives its TS input from a DVB front-end or from memory, as set via this demux kABI. In a system with more than one front-end, the kABI can be used to select one of the DVB front-ends as a TS source for a demux, unless this is fixed in the HW platform.
The demux kABI only controls front-ends regarding to their connections with demuxes; the kABI used to set the other front-end parameters, such as tuning, are devined via the Digital TV Frontend kABI.
The functions that implement the abstract interface demux should be defined static or module private and registered to the Demux core for external access. It is not necessary to implement every function in the struct &dmx_demux. For example, a demux interface might support Section filtering, but not PES filtering. The kABI client is expected to check the value of any function pointer before calling the function: the value of NULL means that the function is not available.
Whenever the functions of the demux API modify shared data, the possibilities of lost update and race condition problems should be addressed, e.g. by protecting parts of code with mutexes.
Note that functions called from a bottom half context must not sleep. Even a simple memory allocation without using GFP_ATOMIC can result in a kernel thread being put to sleep if swapping is needed. For example, the Linux Kernel calls the functions of a network device interface from a bottom half context. Thus, if a demux kABI function is called from network device code, the function must not sleep.
This kernel-space API comprises the callback functions that deliver filtered data to the demux client. Unlike the other DVB kABIs, these functions are provided by the client and called from the demux code.
The function pointers of this abstract interface are not packed into a structure as in the other demux APIs, because the callback functions are registered and used independent of each other. As an example, it is possible for the API client to provide several callback functions for receiving TS packets and no callbacks for PES packets or sections.
The functions that implement the callback API need not be re-entrant: when a demux driver calls one of these functions, the driver is not allowed to call the function again before the original call returns. If a callback is triggered by a hardware interrupt, it is recommended to use the Linux bottom half mechanism or start a tasklet instead of making the callback function call directly from a hardware interrupt.
This mechanism is implemented by dmx_ts_cb() and dmx_section_cb() callbacks.
filter type bitmap for dmx_ts_feed.set()
Constants
Structure that contains a TS feed filter
Definition
struct dmx_ts_feed {
int is_filtering;
struct dmx_demux * parent;
void * priv;
int (* set) (struct dmx_ts_feed *feed,u16 pid,int type,enum dmx_ts_pes pes_type,ktime_t timeout);
int (* start_filtering) (struct dmx_ts_feed *feed);
int (* stop_filtering) (struct dmx_ts_feed *feed);
};
Members
Description
A TS feed is typically mapped to a hardware PID filter on the demux chip. Using this API, the client can set the filtering properties to start/stop filtering TS packets on a particular TS feed.
Structure that describes a section filter
Definition
struct dmx_section_filter {
u8 filter_value[DMX_MAX_FILTER_SIZE];
u8 filter_mask[DMX_MAX_FILTER_SIZE];
u8 filter_mode[DMX_MAX_FILTER_SIZE];
struct dmx_section_feed * parent;
void * priv;
};
Members
Description
The filter_mask controls which bits of filter_value are compared with the section headers/payload. On a binary value of 1 in filter_mask, the corresponding bits are compared. The filter only accepts sections that are equal to filter_value in all the tested bit positions.
Structure that contains a section feed filter
Definition
struct dmx_section_feed {
int is_filtering;
struct dmx_demux * parent;
void * priv;
int check_crc;
int (* set) (struct dmx_section_feed *feed,u16 pid,int check_crc);
int (* allocate_filter) (struct dmx_section_feed *feed,struct dmx_section_filter **filter);
int (* release_filter) (struct dmx_section_feed *feed,struct dmx_section_filter *filter);
int (* start_filtering) (struct dmx_section_feed *feed);
int (* stop_filtering) (struct dmx_section_feed *feed);
};
Members
Description
A TS feed is typically mapped to a hardware PID filter on the demux chip. Using this API, the client can set the filtering properties to start/stop filtering TS packets on a particular TS feed.
Typedef: DVB demux TS filter callback function prototype
Syntax
int dmx_ts_cb (const u8 * buffer1, size_t buffer1_length, const u8 * buffer2, size_t buffer2_length, struct dmx_ts_feed * source);
Parameters
Description
This function callback prototype, provided by the client of the demux API, is called from the demux code. The function is only called when filtering on a TS feed has been enabled using the start_filtering() function at the dmx_demux. Any TS packets that match the filter settings are copied to a circular buffer. The filtered TS packets are delivered to the client using this callback function. It is expected that the buffer1 and buffer2 callback parameters point to addresses within the circular buffer, but other implementations are also possible. Note that the called party should not try to free the memory the buffer1 and buffer2 parameters point to.
When this function is called, the buffer1 parameter typically points to the start of the first undelivered TS packet within a circular buffer. The buffer2 buffer parameter is normally NULL, except when the received TS packets have crossed the last address of the circular buffer and ”wrapped” to the beginning of the buffer. In the latter case the buffer1 parameter would contain an address within the circular buffer, while the buffer2 parameter would contain the first address of the circular buffer. The number of bytes delivered with this function (i.e. buffer1_length + buffer2_length) is usually equal to the value of callback_length parameter given in the set() function, with one exception: if a timeout occurs before receiving callback_length bytes of TS data, any undelivered packets are immediately delivered to the client by calling this function. The timeout duration is controlled by the set() function in the TS Feed API.
If a TS packet is received with errors that could not be fixed by the TS-level forward error correction (FEC), the Transport_error_indicator flag of the TS packet header should be set. The TS packet should not be discarded, as the error can possibly be corrected by a higher layer protocol. If the called party is slow in processing the callback, it is possible that the circular buffer eventually fills up. If this happens, the demux driver should discard any TS packets received while the buffer is full and return -EOVERFLOW.
The type of data returned to the callback can be selected by the dmx_ts_feed.**set** function. The type parameter decides if the raw TS packet (TS_PACKET) or just the payload (TS_PACKET|TS_PAYLOAD_ONLY) should be returned. If additionally the TS_DECODER bit is set the stream will also be sent to the hardware MPEG decoder.
Return
Typedef: DVB demux TS filter callback function prototype
Syntax
int dmx_section_cb (const u8 * buffer1, size_t buffer1_len, const u8 * buffer2, size_t buffer2_len, struct dmx_section_filter * source);
Parameters
Description
This function callback prototype, provided by the client of the demux API, is called from the demux code. The function is only called when filtering of sections has been enabled using the function dmx_ts_feed.**start_filtering**. When the demux driver has received a complete section that matches at least one section filter, the client is notified via this callback function. Normally this function is called for each received section; however, it is also possible to deliver multiple sections with one callback, for example when the system load is high. If an error occurs while receiving a section, this function should be called with the corresponding error type set in the success field, whether or not there is data to deliver. The Section Feed implementation should maintain a circular buffer for received sections. However, this is not necessary if the Section Feed API is implemented as a client of the TS Feed API, because the TS Feed implementation then buffers the received data. The size of the circular buffer can be configured using the dmx_ts_feed.**set** function in the Section Feed API. If there is no room in the circular buffer when a new section is received, the section must be discarded. If this happens, the value of the success parameter should be DMX_OVERRUN_ERROR on the next callback.
Used to identify the type of frontend
Constants
Structure that lists the frontends associated with a demux
Definition
struct dmx_frontend {
struct list_head connectivity_list;
enum dmx_frontend_source source;
};
Members
Description
MPEG-2 TS Demux capabilities bitmap
Constants
Description
Those flags are OR’ed in the dmx_demux.capabilities field
Casts elements in the list of registered front-ends from the generic type struct list_head to the type * struct dmx_frontend
Parameters
Structure that contains the demux capabilities and callbacks.
Definition
struct dmx_demux {
enum dmx_demux_caps capabilities;
struct dmx_frontend * frontend;
void * priv;
int (* open) (struct dmx_demux *demux);
int (* close) (struct dmx_demux *demux);
int (* write) (struct dmx_demux *demux, const char __user *buf,size_t count);
int (* allocate_ts_feed) (struct dmx_demux *demux,struct dmx_ts_feed **feed,dmx_ts_cb callback);
int (* release_ts_feed) (struct dmx_demux *demux,struct dmx_ts_feed *feed);
int (* allocate_section_feed) (struct dmx_demux *demux,struct dmx_section_feed **feed,dmx_section_cb callback);
int (* release_section_feed) (struct dmx_demux *demux,struct dmx_section_feed *feed);
int (* add_frontend) (struct dmx_demux *demux,struct dmx_frontend *frontend);
int (* remove_frontend) (struct dmx_demux *demux,struct dmx_frontend *frontend);
struct list_head *(* get_frontends) (struct dmx_demux *demux);
int (* connect_frontend) (struct dmx_demux *demux,struct dmx_frontend *frontend);
int (* disconnect_frontend) (struct dmx_demux *demux);
int (* get_pes_pids) (struct dmx_demux *demux, u16 *pids);
};
Members
Structure describing a CA interface
Definition
struct dvb_ca_en50221 {
struct module * owner;
int (* read_attribute_mem) (struct dvb_ca_en50221 *ca,int slot, int address);
int (* write_attribute_mem) (struct dvb_ca_en50221 *ca,int slot, int address, u8 value);
int (* read_cam_control) (struct dvb_ca_en50221 *ca,int slot, u8 address);
int (* write_cam_control) (struct dvb_ca_en50221 *ca,int slot, u8 address, u8 value);
int (* slot_reset) (struct dvb_ca_en50221 *ca, int slot);
int (* slot_shutdown) (struct dvb_ca_en50221 *ca, int slot);
int (* slot_ts_enable) (struct dvb_ca_en50221 *ca, int slot);
int (* poll_slot_status) (struct dvb_ca_en50221 *ca, int slot, int open);
void * data;
void * private;
};
Members
NOTE
the read_*, write_* and poll_slot_status functions will be called for different slots concurrently and need to use locks where and if appropriate. There will be no concurrent access to one slot.
A CAMCHANGE IRQ has occurred.
Parameters
A CAMREADY IRQ has occurred.
Parameters
An FR or a DA IRQ has occurred.
Parameters
Initialise a new DVB CA device.
Parameters
Description
return 0 on success, nonzero on failure
Release a DVB CA device.
Parameters