2.1. Digital TV Common functions¶
2.1.1. Math functions¶
Provide some commonly-used math functions, usually required in order to estimate signal strength and signal to noise measurements in dB.
-
unsigned int
intlog2(u32 value)¶ computes log2 of a value; the result is shifted left by 24 bits
Parameters
u32 valueThe value (must be != 0)
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
-
unsigned int
intlog10(u32 value)¶ computes log10 of a value; the result is shifted left by 24 bits
Parameters
u32 valueThe value (must be != 0)
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^24
due to the implementation intlog10(1000) might be not exactly 3 * 2^24
look at intlog2 for similar examples
Return
log10(value) * 2^24
2.1.2. DVB devices¶
Those functions are responsible for handling the DVB device nodes.
-
enum
dvb_device_type¶ type of the Digital TV device
Constants
DVB_DEVICE_SECDigital TV standalone Common Interface (CI)
DVB_DEVICE_FRONTENDDigital TV frontend.
DVB_DEVICE_DEMUXDigital TV demux.
DVB_DEVICE_DVRDigital TV digital video record (DVR).
DVB_DEVICE_CADigital TV Conditional Access (CA).
DVB_DEVICE_NETDigital TV network.
DVB_DEVICE_VIDEODigital TV video decoder. Deprecated. Used only on av7110-av.
DVB_DEVICE_AUDIODigital TV audio decoder. Deprecated. Used only on av7110-av.
DVB_DEVICE_OSDDigital TV On Screen Display (OSD). Deprecated. Used only on av7110.
-
struct
dvb_adapter¶ 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 mutex mdev_lock;
struct media_device *mdev;
struct media_entity *conn;
struct media_pad *conn_pads;
#endif;
};
Members
numNumber of the adapter
list_headList with the DVB adapters
device_listList with the DVB devices
nameName of the adapter
proposed_macproposed MAC address for the adapter
privprivate data
devicepointer to
struct devicemodulepointer to struct module
mfe_sharedindicates mutually exclusive frontends. Use of this flag is currently deprecated.
mfe_dvbdevFrontend device in use, in the case of MFE
mfe_lockLock to prevent using the other frontends when MFE is used.
mdev_lockProtect access to the mdev pointer.
mdevpointer to
struct media_device, used when the media controller is used.connRF connector. Used only if the device has no separate tuner.
conn_padspointer to
struct media_padassociated with conn;
-
struct
dvb_device¶ represents a DVB device node
Definition
struct dvb_device {
struct list_head list_head;
const struct file_operations *fops;
struct dvb_adapter *adapter;
enum dvb_device_type 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, *tsout_entity;
struct media_pad *pads, *tsout_pads;
#endif;
void *priv;
};
Members
list_headList head with all DVB devices
fopspointer to struct file_operations
adapterpointer to the adapter that holds this device node
typetype of the device, as defined by
enum dvb_device_type.minordevnode minor number. Major number is always DVB_MAJOR.
iddevice ID number, inside the adapter
readersInitialized by the caller. Each call to open() in Read Only mode decreases this counter by one.
writersInitialized by the caller. Each call to open() in Read/Write mode decreases this counter by one.
usersInitialized by the caller. Each call to open() in any mode decreases this counter by one.
wait_queuewait queue, used to wait for certain events inside one of the DVB API callers
kernel_ioctlcallback function used to handle ioctl calls from userspace.
nameName to be used for the device at the Media Controller
intf_devnodePointer to media_intf_devnode. Used by the dvbdev core to store the MC device node interface
tsout_num_entitiesNumber of Transport Stream output entities
entitypointer to
struct media_entityassociated with the device nodetsout_entityarray with MC entities associated to each TS output node
padspointer to
struct media_padassociated with entity;tsout_padsarray with the source pads for each tsout_entity
privprivate data
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.
-
int
dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct module *module, struct device *device, short *adapter_nums)¶ Registers a new DVB adapter
Parameters
struct dvb_adapter *adappointer to
struct dvb_adapterconst char *nameAdapter’s name
struct module *moduleinitialized with THIS_MODULE at the caller
struct device *devicepointer to
struct devicethat corresponds to the device drivershort *adapter_numsArray with a list of the numbers for dvb_register_adapter; to select among them. Typically, initialized with: DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nums)
-
int
dvb_unregister_adapter(struct dvb_adapter *adap)¶ Unregisters a DVB adapter
Parameters
struct dvb_adapter *adappointer to
struct dvb_adapter
-
int
dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, const struct dvb_device *template, void *priv, enum dvb_device_type type, int demux_sink_pads)¶ Registers a new DVB device
Parameters
struct dvb_adapter *adappointer to
struct dvb_adapterstruct dvb_device **pdvbdevpointer to the place where the new
struct dvb_devicewill be storedconst struct dvb_device *templateTemplate used to create
pdvbdev;void *privprivate data
enum dvb_device_type typetype of the device, as defined by
enum dvb_device_type.int demux_sink_padsNumber of demux outputs, to be used to create the TS outputs via the Media Controller.
-
void
dvb_remove_device(struct dvb_device *dvbdev)¶ Remove a registered DVB device
Parameters
struct dvb_device *dvbdevpointer to
struct dvb_device
Description
This does not free memory. To do that, call dvb_free_device().
-
void
dvb_free_device(struct dvb_device *dvbdev)¶ Free memory occupied by a DVB device.
Parameters
struct dvb_device *dvbdevpointer to
struct dvb_device
Description
Call dvb_unregister_device() before calling this function.
-
void
dvb_unregister_device(struct dvb_device *dvbdev)¶ Unregisters a DVB device
Parameters
struct dvb_device *dvbdevpointer to
struct dvb_device
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).
-
int
dvb_create_media_graph(struct dvb_adapter *adap, bool create_rf_connector)¶ Creates media graph for the Digital TV part of the device.
Parameters
struct dvb_adapter *adappointer to
struct dvb_adapterbool create_rf_connectorif true, it creates the RF connector too
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.
-
void
dvb_register_media_controller(struct dvb_adapter *adap, struct media_device *mdev)¶ registers a media controller at DVB adapter
Parameters
struct dvb_adapter *adappointer to
struct dvb_adapterstruct media_device *mdevpointer to
struct media_device
-
struct media_device *
dvb_get_media_controller(struct dvb_adapter *adap)¶ gets the associated media controller
Parameters
struct dvb_adapter *adappointer to
struct dvb_adapter
-
int
dvb_generic_open(struct inode *inode, struct file *file)¶ Digital TV open function, used by DVB devices
Parameters
struct inode *inodepointer to
struct inode.struct file *filepointer to
struct file.
Description
Checks if a DVB devnode is still valid, and if the permissions are OK and increment negative use count.
-
int
dvb_generic_release(struct inode *inode, struct file *file)¶ Digital TV close function, used by DVB devices
Parameters
struct inode *inodepointer to
struct inode.struct file *filepointer to
struct file.
Description
Checks if a DVB devnode is still valid, and if the permissions are OK and decrement negative use count.
-
long
dvb_generic_ioctl(struct file *file, unsigned int cmd, unsigned long arg)¶ Digital TV close function, used by DVB devices
Parameters
struct file *filepointer to
struct file.unsigned int cmdIoctl name.
unsigned long argIoctl argument.
Description
Checks if a DVB devnode and struct dvbdev.kernel_ioctl is still valid.
If so, calls dvb_usercopy().
-
int
dvb_usercopy(struct file *file, unsigned int cmd, unsigned long arg, int (*func)(struct file *file, unsigned int cmd, void *arg))¶ copies data from/to userspace memory when an ioctl is issued.
Parameters
struct file *filePointer to struct
file.unsigned int cmdIoctl name.
unsigned long argIoctl argument.
int (*func)(struct file *file, unsigned int cmd, void *arg)function that will actually handle the ioctl
Description
Ancillary function that uses ioctl direction and size to copy from userspace. Then, it calls func, and, if needed, data is copied back to userspace.
-
struct i2c_client *
dvb_module_probe(const char *module_name, const char *name, struct i2c_adapter *adap, unsigned char addr, void *platform_data)¶ helper routine to probe an I2C module
Parameters
const char *module_nameName of the I2C module to be probed
const char *nameOptional name for the I2C module. Used for debug purposes. If
NULL, defaults to module_name.struct i2c_adapter *adappointer to
struct i2c_adapterthat describes the I2C adapter where the module will be bound.unsigned char addrI2C address of the adapter, in 7-bit notation.
void *platform_dataPlatform data to be passed to the I2C module probed.
Description
This function binds an I2C device into the DVB core. Should be used by
all drivers that use I2C bus to control the hardware. A module bound
with dvb_module_probe() should use dvb_module_release() to unbind.
Note
In the past, DVB modules (mainly, frontends) were bound via dvb_attach()
macro, with does an ugly hack, using I2C low level functions. Such
usage is deprecated and will be removed soon. Instead, use this routine.
Return
On success, return an
struct i2c_client, pointing to the bound I2C device.NULLotherwise.
-
void
dvb_module_release(struct i2c_client *client)¶ releases an I2C device allocated with
dvb_module_probe().
Parameters
struct i2c_client *clientpointer to
struct i2c_clientwith the I2C client to be released. can beNULL.
Description
This function should be used to free all resources reserved by
dvb_module_probe() and unbinding the I2C hardware.
-
dvb_attach¶
dvb_attach (FUNCTION, ARGS...)
attaches a DVB frontend into the DVB core.
Parameters
FUNCTIONfunction on a frontend module to be called.
ARGS...FUNCTION arguments.
Description
This ancillary function loads a frontend module in runtime and runs
the FUNCTION function there, with ARGS.
As it increments symbol usage cont, at unregister, dvb_detach()
should be called.
Note
In the past, DVB modules (mainly, frontends) were bound via dvb_attach()
macro, with does an ugly hack, using I2C low level functions. Such
usage is deprecated and will be removed soon. Instead, you should use
dvb_module_probe().
-
dvb_detach¶
dvb_detach (FUNC)
detaches a DVB frontend loaded via
dvb_attach()
Parameters
FUNCattach function
Description
Decrements usage count for a function previously called via dvb_attach().
2.1.3. Digital TV Ring buffer¶
Those routines implement ring buffers used to handle digital TV data and copy it from/to userspace.
Note
For performance reasons read and write routines don’t check buffer sizes and/or number of bytes free/available. This has to be done before these routines are called. For example:
/* 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 */
If there is exactly one reader and one writer, there is no need to lock read or write operations. Two or more readers must be locked against each other. Flushing the buffer counts as a read operation. Resetting the buffer counts as a read and write operation. Two or more writers must be locked against each other.
-
struct
dvb_ringbuffer¶ 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
dataArea were the ringbuffer data is written
sizesize of the ringbuffer
preadnext position to read
pwritenext position to write
errorused by ringbuffer clients to indicate that an error happened.
queueWait queue used by ringbuffer clients to indicate when buffer was filled
lockSpinlock used to protect the ringbuffer
-
void
dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data, size_t len)¶ initialize ring buffer, lock and queue
Parameters
struct dvb_ringbuffer *rbufpointer to
struct dvb_ringbuffervoid *datapointer to the buffer where the data will be stored
size_t lenbytes from ring buffer into buf
-
int
dvb_ringbuffer_empty(struct dvb_ringbuffer *rbuf)¶ test whether buffer is empty
Parameters
struct dvb_ringbuffer *rbufpointer to
struct dvb_ringbuffer
-
ssize_t
dvb_ringbuffer_free(struct dvb_ringbuffer *rbuf)¶ returns the number of free bytes in the buffer
Parameters
struct dvb_ringbuffer *rbufpointer to
struct dvb_ringbuffer
Return
number of free bytes in the buffer
-
ssize_t
dvb_ringbuffer_avail(struct dvb_ringbuffer *rbuf)¶ returns the number of bytes waiting in the buffer
Parameters
struct dvb_ringbuffer *rbufpointer to
struct dvb_ringbuffer
Return
number of bytes waiting in the buffer
-
void
dvb_ringbuffer_reset(struct dvb_ringbuffer *rbuf)¶ resets the ringbuffer to initial state
Parameters
struct dvb_ringbuffer *rbufpointer to
struct dvb_ringbuffer
Description
Resets the read and write pointers to zero and flush the buffer.
This counts as a read and write operation
-
void
dvb_ringbuffer_flush(struct dvb_ringbuffer *rbuf)¶ flush buffer
Parameters
struct dvb_ringbuffer *rbufpointer to
struct dvb_ringbuffer
-
void
dvb_ringbuffer_flush_spinlock_wakeup(struct dvb_ringbuffer *rbuf)¶ flush buffer protected by spinlock and wake-up waiting task(s)
Parameters
struct dvb_ringbuffer *rbufpointer to
struct dvb_ringbuffer
-
DVB_RINGBUFFER_PEEK¶
DVB_RINGBUFFER_PEEK (rbuf, offs)
peek at byte offs in the buffer
Parameters
rbufpointer to
struct dvb_ringbufferoffsoffset inside the ringbuffer
-
DVB_RINGBUFFER_SKIP¶
DVB_RINGBUFFER_SKIP (rbuf, num)
advance read ptr by num bytes
Parameters
rbufpointer to
struct dvb_ringbuffernumnumber of bytes to advance
-
ssize_t
dvb_ringbuffer_read_user(struct dvb_ringbuffer *rbuf, u8 __user *buf, size_t len)¶ Reads a buffer into a user pointer
Parameters
struct dvb_ringbuffer *rbufpointer to
struct dvb_ringbufferu8 __user *bufpointer to the buffer where the data will be stored
size_t lenbytes from ring buffer into buf
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
-
void
dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf, size_t len)¶ Reads a buffer into a pointer
Parameters
struct dvb_ringbuffer *rbufpointer to
struct dvb_ringbufferu8 *bufpointer to the buffer where the data will be stored
size_t lenbytes from ring buffer into buf
Description
This variant assumes that the buffer is a memory at the Kernel space
Return
number of bytes transferred or -EFAULT
-
DVB_RINGBUFFER_WRITE_BYTE¶
DVB_RINGBUFFER_WRITE_BYTE (rbuf, byte)
write single byte to ring buffer
Parameters
rbufpointer to
struct dvb_ringbufferbytebyte to write
-
ssize_t
dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, size_t len)¶ Writes a buffer into the ringbuffer
Parameters
struct dvb_ringbuffer *rbufpointer to
struct dvb_ringbufferconst u8 *bufpointer to the buffer where the data will be read
size_t lenbytes from ring buffer into buf
Description
This variant assumes that the buffer is a memory at the Kernel space
Return
number of bytes transferred or -EFAULT
-
ssize_t
dvb_ringbuffer_write_user(struct dvb_ringbuffer *rbuf, const u8 __user *buf, size_t len)¶ Writes a buffer received via a user pointer
Parameters
struct dvb_ringbuffer *rbufpointer to
struct dvb_ringbufferconst u8 __user *bufpointer to the buffer where the data will be read
size_t lenbytes from ring buffer into buf
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
-
ssize_t
dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8 *buf, size_t len)¶ Write a packet into the ringbuffer.
Parameters
struct dvb_ringbuffer *rbufRingbuffer to write to.
u8 *bufBuffer to write.
size_t lenLength of buffer (currently limited to 65535 bytes max).
Return
Number of bytes written, or -EFAULT, -ENOMEM, -EVINAL.
-
ssize_t
dvb_ringbuffer_pkt_read_user(struct dvb_ringbuffer *rbuf, size_t idx, int offset, u8 __user *buf, size_t len)¶ Read from a packet in the ringbuffer.
Parameters
struct dvb_ringbuffer *rbufRingbuffer concerned.
size_t idxPacket index as returned by
dvb_ringbuffer_pkt_next().int offsetOffset into packet to read from.
u8 __user *bufDestination buffer for data.
size_t lenSize of destination buffer.
Return
Number of bytes read, or -EFAULT.
Description
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.
-
ssize_t
dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx, int offset, u8 *buf, size_t len)¶ Read from a packet in the ringbuffer.
Parameters
struct dvb_ringbuffer *rbufRingbuffer concerned.
size_t idxPacket index as returned by
dvb_ringbuffer_pkt_next().int offsetOffset into packet to read from.
u8 *bufDestination buffer for data.
size_t lenSize of destination buffer.
Note
unlike dvb_ringbuffer_read_user(), this DOES update the read pointer
in the ringbuffer.
Return
Number of bytes read, or -EFAULT.
-
void
dvb_ringbuffer_pkt_dispose(struct dvb_ringbuffer *rbuf, size_t idx)¶ Dispose of a packet in the ring buffer.
Parameters
struct dvb_ringbuffer *rbufRing buffer concerned.
size_t idxPacket index as returned by
dvb_ringbuffer_pkt_next().
-
ssize_t
dvb_ringbuffer_pkt_next(struct dvb_ringbuffer *rbuf, size_t idx, size_t *pktlen)¶ Get the index of the next packet in a ringbuffer.
Parameters
struct dvb_ringbuffer *rbufRingbuffer concerned.
size_t idxPrevious packet index, or -1 to return the first packet index.
size_t *pktlenOn success, will be updated to contain the length of the packet in bytes. returns Packet index (if >=0), or -1 if no packets available.
2.1.4. Digital TV VB2 handler¶
-
enum
dvb_buf_type¶ types of Digital TV memory-mapped buffers
Constants
DVB_BUF_TYPE_CAPTUREbuffer is filled by the Kernel, with a received Digital TV stream
-
enum
dvb_vb2_states¶ states to control VB2 state machine
Constants
DVB_VB2_STATE_NONEVB2 engine not initialized yet, init failed or VB2 was released.
DVB_VB2_STATE_INITVB2 engine initialized.
DVB_VB2_STATE_REQBUFSBuffers were requested
DVB_VB2_STATE_STREAMONVB2 is streaming. Callers should not check it directly. Instead, they should use
dvb_vb2_is_streaming().
Note
Description
Callers should not touch at the state machine directly. This is handled inside dvb_vb2.c.
-
struct
dvb_buffer¶ video buffer information for v4l2.
Definition
struct dvb_buffer {
struct vb2_buffer vb;
struct list_head list;
};
Members
vbembedded struct
vb2_buffer.listlist of
struct dvb_buffer.
-
struct
dvb_vb2_ctx¶ control struct for VB2 handler
Definition
struct dvb_vb2_ctx {
struct vb2_queue vb_q;
struct mutex mutex;
spinlock_t slock;
struct list_head dvb_q;
struct dvb_buffer *buf;
int offset;
int remain;
int state;
int buf_siz;
int buf_cnt;
int nonblocking;
enum dmx_buffer_flags flags;
u32 count;
char name[DVB_VB2_NAME_MAX + 1];
};
Members
vb_qpointer to
struct vb2_queuewith videobuf2 queue.mutexmutex to serialize vb2 operations. Used by vb2 core
wait_prepareandwait_finishoperations.slockspin lock used to protect buffer filling at dvb_vb2.c.
dvb_qList of buffers that are not filled yet.
bufPointer to the buffer that are currently being filled.
offsetindex to the next position at the buf to be filled.
remainHow many bytes are left to be filled at buf.
statebitmask of buffer states as defined by
enum dvb_vb2_states.buf_sizsize of each VB2 buffer.
buf_cntnumber of VB2 buffers.
nonblockingIf different than zero, device is operating on non-blocking mode.
flagsbuffer flags as defined by
enum dmx_buffer_flags. Filled only atDMX_DQBUF.DMX_QBUFshould zero this field.countmonotonic counter for filled buffers. Helps to identify data stream loses. Filled only at
DMX_DQBUF.DMX_QBUFshould zero this field.namename of the device type. Currently, it can either be “dvr” or “demux_filter”.
-
int
dvb_vb2_init(struct dvb_vb2_ctx *ctx, const char *name, int non_blocking)¶ initializes VB2 handler
Parameters
struct dvb_vb2_ctx *ctxcontrol struct for VB2 handler
const char *namename for the VB2 handler
int non_blockingif not zero, it means that the device is at non-blocking mode
-
int
dvb_vb2_release(struct dvb_vb2_ctx *ctx)¶ Releases the VB2 handler allocated resources and put ctx at DVB_VB2_STATE_NONE state.
Parameters
struct dvb_vb2_ctx *ctxcontrol struct for VB2 handler
-
int
dvb_vb2_is_streaming(struct dvb_vb2_ctx *ctx)¶ checks if the VB2 handler is streaming
Parameters
struct dvb_vb2_ctx *ctxcontrol struct for VB2 handler
Return
0 if not streaming, 1 otherwise.
-
int
dvb_vb2_fill_buffer(struct dvb_vb2_ctx *ctx, const unsigned char *src, int len, enum dmx_buffer_flags *buffer_flags)¶ fills a VB2 buffer
Parameters
struct dvb_vb2_ctx *ctxcontrol struct for VB2 handler
const unsigned char *srcplace where the data is stored
int lennumber of bytes to be copied from src
enum dmx_buffer_flags *buffer_flagspointer to buffer flags as defined by
enum dmx_buffer_flags. can be NULL.
-
__poll_t
dvb_vb2_poll(struct dvb_vb2_ctx *ctx, struct file *file, poll_table *wait)¶ Wrapper to
vb2_core_streamon()for Digital TV buffer handling.
Parameters
struct dvb_vb2_ctx *ctxcontrol struct for VB2 handler
struct file *filestruct fileargument passed to the poll file operation handler.poll_table *waitpoll_tablewait argument passed to the poll file operation handler.
Description
Implements poll syscall() logic.
-
int
dvb_vb2_stream_on(struct dvb_vb2_ctx *ctx)¶ Wrapper to
vb2_core_streamon()for Digital TV buffer handling.
Parameters
struct dvb_vb2_ctx *ctxcontrol struct for VB2 handler
Description
Starts dvb streaming
-
int
dvb_vb2_stream_off(struct dvb_vb2_ctx *ctx)¶ Wrapper to
vb2_core_streamoff()for Digital TV buffer handling.
Parameters
struct dvb_vb2_ctx *ctxcontrol struct for VB2 handler
Description
Stops dvb streaming
-
int
dvb_vb2_reqbufs(struct dvb_vb2_ctx *ctx, struct dmx_requestbuffers *req)¶ Wrapper to
vb2_core_reqbufs()for Digital TV buffer handling.
Parameters
struct dvb_vb2_ctx *ctxcontrol struct for VB2 handler
struct dmx_requestbuffers *reqstruct dmx_requestbufferspassed from userspace in order to handleDMX_REQBUFS.
Description
Initiate streaming by requesting a number of buffers. Also used to
free previously requested buffers, is req->count is zero.
-
int
dvb_vb2_querybuf(struct dvb_vb2_ctx *ctx, struct dmx_buffer *b)¶ Wrapper to
vb2_core_querybuf()for Digital TV buffer handling.
Parameters
struct dvb_vb2_ctx *ctxcontrol struct for VB2 handler
struct dmx_buffer *bstruct dmx_bufferpassed from userspace in order to handleDMX_QUERYBUF.
-
int
dvb_vb2_expbuf(struct dvb_vb2_ctx *ctx, struct dmx_exportbuffer *exp)¶ Wrapper to
vb2_core_expbuf()for Digital TV buffer handling.
Parameters
struct dvb_vb2_ctx *ctxcontrol struct for VB2 handler
struct dmx_exportbuffer *expstruct dmx_exportbufferpassed from userspace in order to handleDMX_EXPBUF.
Description
Export a buffer as a file descriptor.
-
int
dvb_vb2_qbuf(struct dvb_vb2_ctx *ctx, struct dmx_buffer *b)¶ Wrapper to
vb2_core_qbuf()for Digital TV buffer handling.
Parameters
struct dvb_vb2_ctx *ctxcontrol struct for VB2 handler
struct dmx_buffer *bstruct dmx_bufferpassed from userspace in order to handleDMX_QBUF.
Description
Queue a Digital TV buffer as requested by userspace
-
int
dvb_vb2_dqbuf(struct dvb_vb2_ctx *ctx, struct dmx_buffer *b)¶ Wrapper to
vb2_core_dqbuf()for Digital TV buffer handling.
Parameters
struct dvb_vb2_ctx *ctxcontrol struct for VB2 handler
struct dmx_buffer *bstruct dmx_bufferpassed from userspace in order to handleDMX_DQBUF.
Description
Dequeue a Digital TV buffer to the userspace
-
int
dvb_vb2_mmap(struct dvb_vb2_ctx *ctx, struct vm_area_struct *vma)¶ Wrapper to
vb2_mmap()for Digital TV buffer handling.
Parameters
struct dvb_vb2_ctx *ctxcontrol struct for VB2 handler
struct vm_area_struct *vmapointer to
struct vm_area_structwith the vma passed to the mmap file operation handler in the driver.
Description
map Digital TV video buffers into application address space.