1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Frontend Function Calls</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="dvb_frontend.html" title="Chapter 9. DVB Frontend API"><link rel="prev" href="dvb_frontend.html" title="Chapter 9. DVB Frontend API"><link rel="next" href="FE_GET_SET_PROPERTY.html" title="FE_GET_PROPERTY/FE_SET_PROPERTY"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Frontend Function Calls</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="dvb_frontend.html">Prev</a> </td><th width="60%" align="center">Chapter 9. DVB Frontend API</th><td width="20%" align="right"> <a accesskey="n" href="FE_GET_SET_PROPERTY.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="frontend_fcalls"></a>Frontend Function Calls</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="frontend_fcalls.html#frontend_f_open">open()</a></span></dt><dt><span class="section"><a href="frontend_fcalls.html#frontend_f_close">close()</a></span></dt><dt><span class="section"><a href="frontend_fcalls.html#FE_READ_STATUS">FE_READ_STATUS</a></span></dt><dt><span class="section"><a href="frontend_fcalls.html#FE_READ_BER">FE_READ_BER</a></span></dt><dt><span class="section"><a href="frontend_fcalls.html#FE_READ_SNR">FE_READ_SNR</a></span></dt><dt><span class="section"><a href="frontend_fcalls.html#FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</a></span></dt><dt><span class="section"><a href="frontend_fcalls.html#FE_READ_UNCORRECTED_BLOCKS">FE_READ_UNCORRECTED_BLOCKS</a></span></dt><dt><span class="section"><a href="frontend_fcalls.html#FE_SET_FRONTEND">FE_SET_FRONTEND</a></span></dt><dt><span class="section"><a href="frontend_fcalls.html#FE_GET_FRONTEND">FE_GET_FRONTEND</a></span></dt><dt><span class="section"><a href="frontend_fcalls.html#FE_GET_EVENT">FE_GET_EVENT</a></span></dt><dt><span class="section"><a href="frontend_fcalls.html#FE_GET_INFO">FE_GET_INFO</a></span></dt><dt><span class="section"><a href="frontend_fcalls.html#FE_DISEQC_RESET_OVERLOAD">FE_DISEQC_RESET_OVERLOAD</a></span></dt><dt><span class="section"><a href="frontend_fcalls.html#FE_DISEQC_SEND_MASTER_CMD">FE_DISEQC_SEND_MASTER_CMD</a></span></dt><dt><span class="section"><a href="frontend_fcalls.html#FE_DISEQC_RECV_SLAVE_REPLY">FE_DISEQC_RECV_SLAVE_REPLY</a></span></dt><dt><span class="section"><a href="frontend_fcalls.html#FE_DISEQC_SEND_BURST">FE_DISEQC_SEND_BURST</a></span></dt><dt><span class="section"><a href="frontend_fcalls.html#FE_SET_TONE">FE_SET_TONE</a></span></dt><dt><span class="section"><a href="frontend_fcalls.html#FE_SET_VOLTAGE">FE_SET_VOLTAGE</a></span></dt><dt><span class="section"><a href="frontend_fcalls.html#FE_ENABLE_HIGH_LNB_VOLTAGE">FE_ENABLE_HIGH_LNB_VOLTAGE</a></span></dt><dt><span class="section"><a href="frontend_fcalls.html#FE_SET_FRONTEND_TUNE_MODE">FE_SET_FRONTEND_TUNE_MODE</a></span></dt><dt><span class="section"><a href="frontend_fcalls.html#FE_DISHNETWORK_SEND_LEGACY_CMD">FE_DISHNETWORK_SEND_LEGACY_CMD</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="frontend_f_open"></a>open()</h3></div></div></div><p>DESCRIPTION</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 2<p>This system call opens a named frontend device (/dev/dvb/adapter0/frontend0) 3 for subsequent use. Usually the first thing to do after a successful open is to 4 find out the frontend type with <a class="link" href="frontend_fcalls.html#FE_GET_INFO" title="FE_GET_INFO">FE_GET_INFO</a>.</p> 5<p>The device can be opened in read-only mode, which only allows monitoring of 6 device status and statistics, or read/write mode, which allows any kind of use 7 (e.g. performing tuning operations.) 8</p> 9<p>In a system with multiple front-ends, it is usually the case that multiple devices 10 cannot be open in read/write mode simultaneously. As long as a front-end 11 device is opened in read/write mode, other open() calls in read/write mode will 12 either fail or block, depending on whether non-blocking or blocking mode was 13 specified. A front-end device opened in blocking mode can later be put into 14 non-blocking mode (and vice versa) using the F_SETFL command of the fcntl 15 system call. This is a standard system call, documented in the Linux manual 16 page for fcntl. When an open() call has succeeded, the device will be ready 17 for use in the specified mode. This implies that the corresponding hardware is 18 powered up, and that other front-ends may have been powered down to make 19 that possible.</p> 20</td></tr></tbody></table></div><p>SYNOPSIS</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 21<p>int open(const char ⋆deviceName, int flags);</p> 22</td></tr></tbody></table></div><p>PARAMETERS 23</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 24<p>const char 25 *deviceName</p> 26</td><td align="char"> 27<p>Name of specific video device.</p> 28</td></tr><tr><td align="char"> 29<p>int flags</p> 30</td><td align="char"> 31<p>A bit-wise OR of the following flags:</p> 32</td></tr><tr><td align="char"> 33</td><td align="char"> 34<p>O_RDONLY read-only access</p> 35</td></tr><tr><td align="char"> 36</td><td align="char"> 37<p>O_RDWR read/write access</p> 38</td></tr><tr><td align="char"> 39</td><td align="char"> 40<p>O_NONBLOCK open in non-blocking mode</p> 41</td></tr><tr><td align="char"> 42</td><td align="char"> 43<p>(blocking mode is the default)</p> 44</td></tr></tbody></table></div><p>RETURN VALUE</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 45<p>ENODEV</p> 46</td><td align="char"> 47<p>Device driver not loaded/available.</p> 48</td></tr><tr><td align="char"> 49<p>EINTERNAL</p> 50</td><td align="char"> 51<p>Internal error.</p> 52</td></tr><tr><td align="char"> 53<p>EBUSY</p> 54</td><td align="char"> 55<p>Device or resource busy.</p> 56</td></tr><tr><td align="char"> 57<p>EINVAL</p> 58</td><td align="char"> 59<p>Invalid argument.</p> 60</td></tr></tbody></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="frontend_f_close"></a>close()</h3></div></div></div><p>DESCRIPTION 61</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 62<p>This system call closes a previously opened front-end device. After closing 63 a front-end device, its corresponding hardware might be powered down 64 automatically.</p> 65</td></tr></tbody></table></div><p>SYNOPSIS 66</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 67<p>int close(int fd);</p> 68</td></tr></tbody></table></div><p>PARAMETERS 69</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 70<p>int fd</p> 71</td><td align="char"> 72<p>File descriptor returned by a previous call to open().</p> 73</td></tr></tbody></table></div><p>RETURN VALUE</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 74<p>EBADF</p> 75</td><td align="char"> 76<p>fd is not a valid open file descriptor.</p> 77</td></tr></tbody></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="FE_READ_STATUS"></a>FE_READ_STATUS</h3></div></div></div><p>DESCRIPTION 78</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 79<p>This ioctl call returns status information about the front-end. This call only 80 requires read-only access to the device.</p> 81</td></tr></tbody></table></div><p>SYNOPSIS 82</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 83<p>int ioctl(int fd, int request = <a class="link" href="frontend_fcalls.html#FE_READ_STATUS" title="FE_READ_STATUS">FE_READ_STATUS</a>, 84 fe_status_t ⋆status);</p> 85</td></tr></tbody></table></div><p>PARAMETERS 86</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 87<p>int fd</p> 88</td><td align="char"> 89<p>File descriptor returned by a previous call to open().</p> 90</td></tr><tr><td align="char"> 91<p>int request</p> 92</td><td align="char"> 93<p>Equals <a class="link" href="frontend_fcalls.html#FE_READ_STATUS" title="FE_READ_STATUS">FE_READ_STATUS</a> for this command.</p> 94</td></tr><tr><td align="char"> 95<p>struct fe_status_t 96 *status</p> 97</td><td align="char"> 98<p>Points to the location where the front-end status word is 99 to be stored.</p> 100</td></tr></tbody></table></div><p>RETURN VALUE</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 101<p>EBADF</p> 102</td><td align="char"> 103<p>fd is not a valid open file descriptor.</p> 104</td></tr><tr><td align="char"> 105<p>EFAULT</p> 106</td><td align="char"> 107<p>status points to invalid address.</p> 108</td></tr></tbody></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="FE_READ_BER"></a>FE_READ_BER</h3></div></div></div><p>DESCRIPTION 109</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 110<p>This ioctl call returns the bit error rate for the signal currently 111 received/demodulated by the front-end. For this command, read-only access to 112 the device is sufficient.</p> 113</td></tr></tbody></table></div><p>SYNOPSIS 114</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 115<p>int ioctl(int fd, int request = <a class="link" href="frontend_fcalls.html#FE_READ_BER" title="FE_READ_BER">FE_READ_BER</a>, 116 uint32_t ⋆ber);</p> 117</td></tr></tbody></table></div><p>PARAMETERS 118</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 119<p>int fd</p> 120</td><td align="char"> 121<p>File descriptor returned by a previous call to open().</p> 122</td></tr><tr><td align="char"> 123<p>int request</p> 124</td><td align="char"> 125<p>Equals <a class="link" href="frontend_fcalls.html#FE_READ_BER" title="FE_READ_BER">FE_READ_BER</a> for this command.</p> 126</td></tr><tr><td align="char"> 127<p>uint32_t *ber</p> 128</td><td align="char"> 129<p>The bit error rate is stored into *ber.</p> 130</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="FE_READ_SNR"></a>FE_READ_SNR</h3></div></div></div><p>DESCRIPTION 131</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 132<p>This ioctl call returns the signal-to-noise ratio for the signal currently received 133 by the front-end. For this command, read-only access to the device is sufficient.</p> 134</td></tr></tbody></table></div><p>SYNOPSIS 135</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 136<p>int ioctl(int fd, int request = <a class="link" href="frontend_fcalls.html#FE_READ_SNR" title="FE_READ_SNR">FE_READ_SNR</a>, uint16_t 137 ⋆snr);</p> 138</td></tr></tbody></table></div><p>PARAMETERS 139</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 140<p>int fd</p> 141</td><td align="char"> 142<p>File descriptor returned by a previous call to open().</p> 143</td></tr><tr><td align="char"> 144<p>int request</p> 145</td><td align="char"> 146<p>Equals <a class="link" href="frontend_fcalls.html#FE_READ_SNR" title="FE_READ_SNR">FE_READ_SNR</a> for this command.</p> 147</td></tr><tr><td align="char"> 148<p>uint16_t *snr</p> 149</td><td align="char"> 150<p>The signal-to-noise ratio is stored into *snr.</p> 151</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="FE_READ_SIGNAL_STRENGTH"></a>FE_READ_SIGNAL_STRENGTH</h3></div></div></div><p>DESCRIPTION 152</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 153<p>This ioctl call returns the signal strength value for the signal currently received 154 by the front-end. For this command, read-only access to the device is sufficient.</p> 155</td></tr></tbody></table></div><p>SYNOPSIS 156</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 157<p>int ioctl( int fd, int request = 158 <a class="link" href="frontend_fcalls.html#FE_READ_SIGNAL_STRENGTH" title="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</a>, uint16_t ⋆strength);</p> 159</td></tr></tbody></table></div><p>PARAMETERS 160</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 161<p>int fd</p> 162</td><td align="char"> 163<p>File descriptor returned by a previous call to open().</p> 164</td></tr><tr><td align="char"> 165<p>int request</p> 166</td><td align="char"> 167<p>Equals <a class="link" href="frontend_fcalls.html#FE_READ_SIGNAL_STRENGTH" title="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</a> for this 168 command.</p> 169</td></tr><tr><td align="char"> 170<p>uint16_t *strength</p> 171</td><td align="char"> 172<p>The signal strength value is stored into *strength.</p> 173</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="FE_READ_UNCORRECTED_BLOCKS"></a>FE_READ_UNCORRECTED_BLOCKS</h3></div></div></div><p>DESCRIPTION 174</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 175<p>This ioctl call returns the number of uncorrected blocks detected by the device 176 driver during its lifetime. For meaningful measurements, the increment in block 177 count during a specific time interval should be calculated. For this command, 178 read-only access to the device is sufficient.</p> 179</td></tr><tr><td align="char"> 180<p>Note that the counter will wrap to zero after its maximum count has been 181 reached.</p> 182</td></tr></tbody></table></div><p>SYNOPSIS 183</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 184<p>int ioctl( int fd, int request = 185 <a class="link" href="frontend_fcalls.html#FE_READ_UNCORRECTED_BLOCKS" title="FE_READ_UNCORRECTED_BLOCKS">FE_READ_UNCORRECTED_BLOCKS</a>, uint32_t ⋆ublocks);</p> 186</td></tr></tbody></table></div><p>PARAMETERS 187</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 188<p>int fd</p> 189</td><td align="char"> 190<p>File descriptor returned by a previous call to open().</p> 191</td></tr><tr><td align="char"> 192<p>int request</p> 193</td><td align="char"> 194<p>Equals <a class="link" href="frontend_fcalls.html#FE_READ_UNCORRECTED_BLOCKS" title="FE_READ_UNCORRECTED_BLOCKS">FE_READ_UNCORRECTED_BLOCKS</a> for this 195 command.</p> 196</td></tr><tr><td align="char"> 197<p>uint32_t *ublocks</p> 198</td><td align="char"> 199<p>The total number of uncorrected blocks seen by the driver 200 so far.</p> 201</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="FE_SET_FRONTEND"></a>FE_SET_FRONTEND</h3></div></div></div><p>DESCRIPTION 202</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 203<p>This ioctl call starts a tuning operation using specified parameters. The result 204 of this call will be successful if the parameters were valid and the tuning could 205 be initiated. The result of the tuning operation in itself, however, will arrive 206 asynchronously as an event (see documentation for <a class="link" href="frontend_fcalls.html#FE_GET_EVENT" title="FE_GET_EVENT">FE_GET_EVENT</a> and 207 FrontendEvent.) If a new <a class="link" href="frontend_fcalls.html#FE_SET_FRONTEND" title="FE_SET_FRONTEND">FE_SET_FRONTEND</a> operation is initiated before 208 the previous one was completed, the previous operation will be aborted in favor 209 of the new one. This command requires read/write access to the device.</p> 210</td></tr></tbody></table></div><p>SYNOPSIS 211</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 212<p>int ioctl(int fd, int request = <a class="link" href="frontend_fcalls.html#FE_SET_FRONTEND" title="FE_SET_FRONTEND">FE_SET_FRONTEND</a>, 213 struct dvb_frontend_parameters ⋆p);</p> 214</td></tr></tbody></table></div><p>PARAMETERS 215</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 216<p>int fd</p> 217</td><td align="char"> 218<p>File descriptor returned by a previous call to open().</p> 219</td></tr><tr><td align="char"> 220<p>int request</p> 221</td><td align="char"> 222<p>Equals <a class="link" href="frontend_fcalls.html#FE_SET_FRONTEND" title="FE_SET_FRONTEND">FE_SET_FRONTEND</a> for this command.</p> 223</td></tr><tr><td align="char"> 224<p>struct 225 dvb_frontend_parameters 226 *p</p> 227</td><td align="char"> 228<p>Points to parameters for tuning operation.</p> 229</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 230<p>EINVAL</p> 231</td><td align="char"> 232<p>Maximum supported symbol rate reached.</p> 233</td></tr></tbody></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="FE_GET_FRONTEND"></a>FE_GET_FRONTEND</h3></div></div></div><p>DESCRIPTION 234</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 235<p>This ioctl call queries the currently effective frontend parameters. For this 236 command, read-only access to the device is sufficient.</p> 237</td></tr></tbody></table></div><p>SYNOPSIS 238</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 239<p>int ioctl(int fd, int request = <a class="link" href="frontend_fcalls.html#FE_GET_FRONTEND" title="FE_GET_FRONTEND">FE_GET_FRONTEND</a>, 240 struct dvb_frontend_parameters ⋆p);</p> 241</td></tr></tbody></table></div><p>PARAMETERS 242</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 243<p>int fd</p> 244</td><td align="char"> 245<p>File descriptor returned by a previous call to open().</p> 246</td></tr><tr><td align="char"> 247<p>int request</p> 248</td><td align="char"> 249<p>Equals <a class="link" href="frontend_fcalls.html#FE_SET_FRONTEND" title="FE_SET_FRONTEND">FE_SET_FRONTEND</a> for this command.</p> 250</td></tr><tr><td align="char"> 251<p>struct 252 dvb_frontend_parameters 253 *p</p> 254</td><td align="char"> 255<p>Points to parameters for tuning operation.</p> 256</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 257<p>EINVAL</p> 258</td><td align="char"> 259<p>Maximum supported symbol rate reached.</p> 260</td></tr></tbody></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="FE_GET_EVENT"></a>FE_GET_EVENT</h3></div></div></div><p>DESCRIPTION 261</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 262<p>This ioctl call returns a frontend event if available. If an event is not 263 available, the behavior depends on whether the device is in blocking or 264 non-blocking mode. In the latter case, the call fails immediately with errno 265 set to EWOULDBLOCK. In the former case, the call blocks until an event 266 becomes available.</p> 267</td></tr><tr><td align="char"> 268<p>The standard Linux poll() and/or select() system calls can be used with the 269 device file descriptor to watch for new events. For select(), the file descriptor 270 should be included in the exceptfds argument, and for poll(), POLLPRI should 271 be specified as the wake-up condition. Since the event queue allocated is 272 rather small (room for 8 events), the queue must be serviced regularly to avoid 273 overflow. If an overflow happens, the oldest event is discarded from the queue, 274 and an error (EOVERFLOW) occurs the next time the queue is read. After 275 reporting the error condition in this fashion, subsequent 276 <a class="link" href="frontend_fcalls.html#FE_GET_EVENT" title="FE_GET_EVENT">FE_GET_EVENT</a> 277 calls will return events from the queue as usual.</p> 278</td></tr><tr><td align="char"> 279<p>For the sake of implementation simplicity, this command requires read/write 280 access to the device.</p> 281</td></tr></tbody></table></div><p>SYNOPSIS 282</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 283<p>int ioctl(int fd, int request = QPSK_GET_EVENT, 284 struct dvb_frontend_event ⋆ev);</p> 285</td></tr></tbody></table></div><p>PARAMETERS 286</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 287<p>int fd</p> 288</td><td align="char"> 289<p>File descriptor returned by a previous call to open().</p> 290</td></tr><tr><td align="char"> 291<p>int request</p> 292</td><td align="char"> 293<p>Equals <a class="link" href="frontend_fcalls.html#FE_GET_EVENT" title="FE_GET_EVENT">FE_GET_EVENT</a> for this command.</p> 294</td></tr><tr><td align="char"> 295<p>struct 296 dvb_frontend_event 297 *ev</p> 298</td><td align="char"> 299<p>Points to the location where the event,</p> 300</td></tr><tr><td align="char"> 301</td><td align="char"> 302<p>if any, is to be stored.</p> 303</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 304<p>EWOULDBLOCK</p> 305</td><td align="char"> 306<p>There is no event pending, and the device is in 307 non-blocking mode.</p> 308</td></tr><tr><td align="char"> 309<p>EOVERFLOW</p> 310</td><td align="char"> 311<p>Overflow in event queue - one or more events were lost.</p> 312</td></tr></tbody></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="FE_GET_INFO"></a>FE_GET_INFO</h3></div></div></div><p>DESCRIPTION 313</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 314<p>This ioctl call returns information about the front-end. This call only requires 315 read-only access to the device.</p> 316</td></tr></tbody></table></div><p>SYNOPSIS 317</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 318<p> int ioctl(int fd, int request = <a class="link" href="frontend_fcalls.html#FE_GET_INFO" title="FE_GET_INFO">FE_GET_INFO</a>, struct 319 dvb_frontend_info ⋆info);</p> 320</td></tr></tbody></table></div><p>PARAMETERS 321</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 322<p>int fd</p> 323</td><td align="char"> 324<p>File descriptor returned by a previous call to open().</p> 325</td></tr><tr><td align="char"> 326<p>int request</p> 327</td><td align="char"> 328<p>Equals <a class="link" href="frontend_fcalls.html#FE_GET_INFO" title="FE_GET_INFO">FE_GET_INFO</a> for this command.</p> 329</td></tr><tr><td align="char"> 330<p>struct 331 dvb_frontend_info 332 *info</p> 333</td><td align="char"> 334<p>Points to the location where the front-end information is 335 to be stored.</p> 336</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="FE_DISEQC_RESET_OVERLOAD"></a>FE_DISEQC_RESET_OVERLOAD</h3></div></div></div><p>DESCRIPTION 337</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 338<p>If the bus has been automatically powered off due to power overload, this ioctl 339 call restores the power to the bus. The call requires read/write access to the 340 device. This call has no effect if the device is manually powered off. Not all 341 DVB adapters support this ioctl.</p> 342</td></tr></tbody></table></div><p>SYNOPSIS 343</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 344<p>int ioctl(int fd, int request = 345 <a class="link" href="frontend_fcalls.html#FE_DISEQC_RESET_OVERLOAD" title="FE_DISEQC_RESET_OVERLOAD">FE_DISEQC_RESET_OVERLOAD</a>);</p> 346</td></tr></tbody></table></div><p>PARAMETERS 347</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 348<p>int fd</p> 349</td><td align="char"> 350<p>File descriptor returned by a previous call to open().</p> 351</td></tr><tr><td align="char"> 352<p>int request</p> 353</td><td align="char"> 354<p>Equals <a class="link" href="frontend_fcalls.html#FE_DISEQC_RESET_OVERLOAD" title="FE_DISEQC_RESET_OVERLOAD">FE_DISEQC_RESET_OVERLOAD</a> for this 355 command.</p> 356</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="FE_DISEQC_SEND_MASTER_CMD"></a>FE_DISEQC_SEND_MASTER_CMD</h3></div></div></div><p>DESCRIPTION 357</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 358<p>This ioctl call is used to send a a DiSEqC command.</p> 359</td></tr></tbody></table></div><p>SYNOPSIS 360</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 361<p>int ioctl(int fd, int request = 362 <a class="link" href="frontend_fcalls.html#FE_DISEQC_SEND_MASTER_CMD" title="FE_DISEQC_SEND_MASTER_CMD">FE_DISEQC_SEND_MASTER_CMD</a>, struct 363 dvb_diseqc_master_cmd ⋆cmd);</p> 364</td></tr></tbody></table></div><p>PARAMETERS 365</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 366<p>int fd</p> 367</td><td align="char"> 368<p>File descriptor returned by a previous call to open().</p> 369</td></tr><tr><td align="char"> 370<p>int request</p> 371</td><td align="char"> 372<p>Equals <a class="link" href="frontend_fcalls.html#FE_DISEQC_SEND_MASTER_CMD" title="FE_DISEQC_SEND_MASTER_CMD">FE_DISEQC_SEND_MASTER_CMD</a> for this 373 command.</p> 374</td></tr><tr><td align="char"> 375<p>struct 376 dvb_diseqc_master_cmd 377 *cmd</p> 378</td><td align="char"> 379<p>Pointer to the command to be transmitted.</p> 380</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="FE_DISEQC_RECV_SLAVE_REPLY"></a>FE_DISEQC_RECV_SLAVE_REPLY</h3></div></div></div><p>DESCRIPTION 381</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 382<p>This ioctl call is used to receive reply to a DiSEqC 2.0 command.</p> 383</td></tr></tbody></table></div><p>SYNOPSIS 384</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 385<p>int ioctl(int fd, int request = 386 <a class="link" href="frontend_fcalls.html#FE_DISEQC_RECV_SLAVE_REPLY" title="FE_DISEQC_RECV_SLAVE_REPLY">FE_DISEQC_RECV_SLAVE_REPLY</a>, struct 387 dvb_diseqc_slave_reply ⋆reply);</p> 388</td></tr></tbody></table></div><p>PARAMETERS 389</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 390<p>int fd</p> 391</td><td align="char"> 392<p>File descriptor returned by a previous call to open().</p> 393</td></tr><tr><td align="char"> 394<p>int request</p> 395</td><td align="char"> 396<p>Equals <a class="link" href="frontend_fcalls.html#FE_DISEQC_RECV_SLAVE_REPLY" title="FE_DISEQC_RECV_SLAVE_REPLY">FE_DISEQC_RECV_SLAVE_REPLY</a> for this 397 command.</p> 398</td></tr><tr><td align="char"> 399<p>struct 400 dvb_diseqc_slave_reply 401 *reply</p> 402</td><td align="char"> 403<p>Pointer to the command to be received.</p> 404</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="FE_DISEQC_SEND_BURST"></a>FE_DISEQC_SEND_BURST</h3></div></div></div><p>DESCRIPTION 405</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 406<p>This ioctl call is used to send a 22KHz tone burst.</p> 407</td></tr></tbody></table></div><p>SYNOPSIS 408</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 409<p>int ioctl(int fd, int request = 410 <a class="link" href="frontend_fcalls.html#FE_DISEQC_SEND_BURST" title="FE_DISEQC_SEND_BURST">FE_DISEQC_SEND_BURST</a>, fe_sec_mini_cmd_t burst);</p> 411</td></tr></tbody></table></div><p>PARAMETERS 412</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 413<p>int fd</p> 414</td><td align="char"> 415<p>File descriptor returned by a previous call to open().</p> 416</td></tr><tr><td align="char"> 417<p>int request</p> 418</td><td align="char"> 419<p>Equals <a class="link" href="frontend_fcalls.html#FE_DISEQC_SEND_BURST" title="FE_DISEQC_SEND_BURST">FE_DISEQC_SEND_BURST</a> for this command.</p> 420</td></tr><tr><td align="char"> 421<p>fe_sec_mini_cmd_t 422 burst</p> 423</td><td align="char"> 424<p>burst A or B.</p> 425</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="FE_SET_TONE"></a>FE_SET_TONE</h3></div></div></div><p>DESCRIPTION 426</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 427<p>This call is used to set the generation of the continuous 22kHz tone. This call 428 requires read/write permissions.</p> 429</td></tr></tbody></table></div><p>SYNOPSIS 430</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 431<p>int ioctl(int fd, int request = <a class="link" href="frontend_fcalls.html#FE_SET_TONE" title="FE_SET_TONE">FE_SET_TONE</a>, 432 fe_sec_tone_mode_t tone);</p> 433</td></tr></tbody></table></div><p>PARAMETERS 434</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 435<p>int fd</p> 436</td><td align="char"> 437<p>File descriptor returned by a previous call to open().</p> 438</td></tr><tr><td align="char"> 439<p>int request</p> 440</td><td align="char"> 441<p>Equals <a class="link" href="frontend_fcalls.html#FE_SET_TONE" title="FE_SET_TONE">FE_SET_TONE</a> for this command.</p> 442</td></tr><tr><td align="char"> 443<p>fe_sec_tone_mode_t 444 tone</p> 445</td><td align="char"> 446<p>The requested tone generation mode (on/off).</p> 447</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="FE_SET_VOLTAGE"></a>FE_SET_VOLTAGE</h3></div></div></div><p>DESCRIPTION 448</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 449<p>This call is used to set the bus voltage. This call requires read/write 450 permissions.</p> 451</td></tr></tbody></table></div><p>SYNOPSIS 452</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 453<p>int ioctl(int fd, int request = <a class="link" href="frontend_fcalls.html#FE_SET_VOLTAGE" title="FE_SET_VOLTAGE">FE_SET_VOLTAGE</a>, 454 fe_sec_voltage_t voltage);</p> 455</td></tr></tbody></table></div><p>PARAMETERS 456</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 457<p>int fd</p> 458</td><td align="char"> 459<p>File descriptor returned by a previous call to open().</p> 460</td></tr><tr><td align="char"> 461<p>int request</p> 462</td><td align="char"> 463<p>Equals <a class="link" href="frontend_fcalls.html#FE_SET_VOLTAGE" title="FE_SET_VOLTAGE">FE_SET_VOLTAGE</a> for this command.</p> 464</td></tr><tr><td align="char"> 465<p>fe_sec_voltage_t 466 voltage</p> 467</td><td align="char"> 468<p>The requested bus voltage.</p> 469</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="FE_ENABLE_HIGH_LNB_VOLTAGE"></a>FE_ENABLE_HIGH_LNB_VOLTAGE</h3></div></div></div><p>DESCRIPTION 470</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 471<p>If high != 0 enables slightly higher voltages instead of 13/18V (to compensate 472 for long cables). This call requires read/write permissions. Not all DVB 473 adapters support this ioctl.</p> 474</td></tr></tbody></table></div><p>SYNOPSIS 475</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 476<p>int ioctl(int fd, int request = 477 <a class="link" href="frontend_fcalls.html#FE_ENABLE_HIGH_LNB_VOLTAGE" title="FE_ENABLE_HIGH_LNB_VOLTAGE">FE_ENABLE_HIGH_LNB_VOLTAGE</a>, int high);</p> 478</td></tr></tbody></table></div><p>PARAMETERS 479</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 480<p>int fd</p> 481</td><td align="char"> 482<p>File descriptor returned by a previous call to open().</p> 483</td></tr><tr><td align="char"> 484<p>int request</p> 485</td><td align="char"> 486<p>Equals <a class="link" href="frontend_fcalls.html#FE_SET_VOLTAGE" title="FE_SET_VOLTAGE">FE_SET_VOLTAGE</a> for this command.</p> 487</td></tr><tr><td align="char"> 488<p>int high</p> 489</td><td align="char"> 490<p>The requested bus voltage.</p> 491</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="FE_SET_FRONTEND_TUNE_MODE"></a>FE_SET_FRONTEND_TUNE_MODE</h3></div></div></div><p>DESCRIPTION</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 492<p>Allow setting tuner mode flags to the frontend.</p> 493</td></tr></tbody></table></div><p>SYNOPSIS</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 494<p>int ioctl(int fd, int request = 495<a class="link" href="frontend_fcalls.html#FE_SET_FRONTEND_TUNE_MODE" title="FE_SET_FRONTEND_TUNE_MODE">FE_SET_FRONTEND_TUNE_MODE</a>, unsigned int flags);</p> 496</td></tr></tbody></table></div><p>PARAMETERS</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 497 <p>unsigned int flags</p> 498</td><td align="char"> 499<p> 500FE_TUNE_MODE_ONESHOT When set, this flag will disable any zigzagging or other "normal" tuning behaviour. Additionally, there will be no automatic monitoring of the lock status, and hence no frontend events will be generated. If a frontend device is closed, this flag will be automatically turned off when the device is reopened read-write. 501</p> 502</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="FE_DISHNETWORK_SEND_LEGACY_CMD"></a>FE_DISHNETWORK_SEND_LEGACY_CMD</h3></div></div></div><p>DESCRIPTION</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 503<p>WARNING: This is a very obscure legacy command, used only at stv0299 driver. Should not be used on newer drivers.</p> 504<p>It provides a non-standard method for selecting Diseqc voltage on the frontend, for Dish Network legacy switches.</p> 505<p>As support for this ioctl were added in 2004, this means that such dishes were already legacy in 2004.</p> 506</td></tr></tbody></table></div><p>SYNOPSIS</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char"> 507<p>int ioctl(int fd, int request = 508 <a class="link" href="frontend_fcalls.html#FE_DISHNETWORK_SEND_LEGACY_CMD" title="FE_DISHNETWORK_SEND_LEGACY_CMD">FE_DISHNETWORK_SEND_LEGACY_CMD</a>, unsigned long cmd);</p> 509</td></tr></tbody></table></div><p>PARAMETERS</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char"> 510 <p>unsigned long cmd</p> 511</td><td align="char"> 512<p> 513sends the specified raw cmd to the dish via DISEqC. 514</p> 515</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="dvb_frontend.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="dvb_frontend.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="FE_GET_SET_PROPERTY.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 9. DVB Frontend API </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <code class="constant">FE_GET_PROPERTY/FE_SET_PROPERTY</code></td></tr></table></div></body></html> 516