Merge tag 'usercopy-v4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
[cascardo/linux.git] / Documentation / media / uapi / dvb / fe-read-status.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _FE_READ_STATUS:
4
5 ********************
6 ioctl FE_READ_STATUS
7 ********************
8
9 Name
10 ====
11
12 FE_READ_STATUS - Returns status information about the front-end. This call only requires - read-only access to the device
13
14
15 Synopsis
16 ========
17
18 .. cpp:function:: int ioctl( int fd, int request, unsigned int *status )
19
20
21 Arguments
22 =========
23
24 ``fd``
25     File descriptor returned by :ref:`open() <frontend_f_open>`.
26
27 ``request``
28     FE_READ_STATUS
29
30 ``status``
31     pointer to a bitmask integer filled with the values defined by enum
32     :ref:`fe_status <fe-status>`.
33
34
35 Description
36 ===========
37
38 All DVB frontend devices support the ``FE_READ_STATUS`` ioctl. It is
39 used to check about the locking status of the frontend after being
40 tuned. The ioctl takes a pointer to an integer where the status will be
41 written.
42
43 .. note:: The size of status is actually sizeof(enum fe_status), with
44    varies according with the architecture. This needs to be fixed in the
45    future.
46
47
48 .. _fe-status-t:
49
50 int fe_status
51 =============
52
53 The fe_status parameter is used to indicate the current state and/or
54 state changes of the frontend hardware. It is produced using the enum
55 :ref:`fe_status <fe-status>` values on a bitmask
56
57
58 .. _fe-status:
59
60 .. flat-table:: enum fe_status
61     :header-rows:  1
62     :stub-columns: 0
63
64
65     -  .. row 1
66
67        -  ID
68
69        -  Description
70
71     -  .. row 2
72
73        -  .. _FE-HAS-SIGNAL:
74
75           ``FE_HAS_SIGNAL``
76
77        -  The frontend has found something above the noise level
78
79     -  .. row 3
80
81        -  .. _FE-HAS-CARRIER:
82
83           ``FE_HAS_CARRIER``
84
85        -  The frontend has found a DVB signal
86
87     -  .. row 4
88
89        -  .. _FE-HAS-VITERBI:
90
91           ``FE_HAS_VITERBI``
92
93        -  The frontend FEC inner coding (Viterbi, LDPC or other inner code)
94           is stable
95
96     -  .. row 5
97
98        -  .. _FE-HAS-SYNC:
99
100           ``FE_HAS_SYNC``
101
102        -  Synchronization bytes was found
103
104     -  .. row 6
105
106        -  .. _FE-HAS-LOCK:
107
108           ``FE_HAS_LOCK``
109
110        -  The DVB were locked and everything is working
111
112     -  .. row 7
113
114        -  .. _FE-TIMEDOUT:
115
116           ``FE_TIMEDOUT``
117
118        -  no lock within the last about 2 seconds
119
120     -  .. row 8
121
122        -  .. _FE-REINIT:
123
124           ``FE_REINIT``
125
126        -  The frontend was reinitialized, application is recommended to
127           reset DiSEqC, tone and parameters
128
129
130 Return Value
131 ============
132
133 On success 0 is returned, on error -1 and the ``errno`` variable is set
134 appropriately. The generic error codes are described at the
135 :ref:`Generic Error Codes <gen-errors>` chapter.