Mauro Carvalho Chehab | 5b3b8c8 | 2017-09-19 16:54:15 -0400 | [diff] [blame] | 1 | Digital TV Common functions |
| 2 | --------------------------- |
| 3 | |
| 4 | Math functions |
| 5 | ~~~~~~~~~~~~~~ |
| 6 | |
| 7 | Provide some commonly-used math functions, usually required in order to |
| 8 | estimate signal strength and signal to noise measurements in dB. |
| 9 | |
Mauro Carvalho Chehab | fada193 | 2017-12-28 13:03:51 -0500 | [diff] [blame] | 10 | .. kernel-doc:: include/media/dvb_math.h |
Mauro Carvalho Chehab | 5b3b8c8 | 2017-09-19 16:54:15 -0400 | [diff] [blame] | 11 | |
| 12 | |
| 13 | DVB devices |
| 14 | ~~~~~~~~~~~ |
| 15 | |
| 16 | Those functions are responsible for handling the DVB device nodes. |
| 17 | |
Mauro Carvalho Chehab | fada193 | 2017-12-28 13:03:51 -0500 | [diff] [blame] | 18 | .. kernel-doc:: include/media/dvbdev.h |
Mauro Carvalho Chehab | 5b3b8c8 | 2017-09-19 16:54:15 -0400 | [diff] [blame] | 19 | |
| 20 | Digital TV Ring buffer |
| 21 | ~~~~~~~~~~~~~~~~~~~~~~ |
| 22 | |
| 23 | Those routines implement ring buffers used to handle digital TV data and |
| 24 | copy it from/to userspace. |
| 25 | |
| 26 | .. note:: |
| 27 | |
| 28 | 1) For performance reasons read and write routines don't check buffer sizes |
| 29 | and/or number of bytes free/available. This has to be done before these |
| 30 | routines are called. For example: |
| 31 | |
| 32 | .. code-block:: c |
| 33 | |
| 34 | /* write @buflen: bytes */ |
| 35 | free = dvb_ringbuffer_free(rbuf); |
| 36 | if (free >= buflen) |
| 37 | count = dvb_ringbuffer_write(rbuf, buffer, buflen); |
| 38 | else |
| 39 | /* do something */ |
| 40 | |
| 41 | /* read min. 1000, max. @bufsize: bytes */ |
| 42 | avail = dvb_ringbuffer_avail(rbuf); |
| 43 | if (avail >= 1000) |
| 44 | count = dvb_ringbuffer_read(rbuf, buffer, min(avail, bufsize)); |
| 45 | else |
| 46 | /* do something */ |
| 47 | |
| 48 | 2) If there is exactly one reader and one writer, there is no need |
| 49 | to lock read or write operations. |
| 50 | Two or more readers must be locked against each other. |
| 51 | Flushing the buffer counts as a read operation. |
| 52 | Resetting the buffer counts as a read and write operation. |
| 53 | Two or more writers must be locked against each other. |
| 54 | |
Mauro Carvalho Chehab | fada193 | 2017-12-28 13:03:51 -0500 | [diff] [blame] | 55 | .. kernel-doc:: include/media/dvb_ringbuffer.h |
Mauro Carvalho Chehab | 9f577d6 | 2017-12-29 08:23:41 -0500 | [diff] [blame] | 56 | |
| 57 | Digital TV VB2 handler |
| 58 | ~~~~~~~~~~~~~~~~~~~~~~ |
| 59 | |
| 60 | .. kernel-doc:: include/media/dvb_vb2.h |