Merge branch 'sh-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal...
[pandora-kernel.git] / Documentation / DocBook / media / v4l / gen-errors.xml
1 <title>Generic Error Codes</title>
2
3 <table frame="none" pgwide="1" id="gen-errors">
4   <title>Generic error codes</title>
5   <tgroup cols="2">
6     &cs-str;
7     <tbody valign="top">
8         <!-- Keep it ordered alphabetically -->
9       <row>
10         <entry>EBADF</entry>
11         <entry>The file descriptor is not a valid.</entry>
12       </row>
13       <row>
14         <entry>EBUSY</entry>
15         <entry>The ioctl can't be handled because the device is busy. This is
16                typically return while device is streaming, and an ioctl tried to
17                change something that would affect the stream, or would require the
18                usage of a hardware resource that was already allocated. The ioctl
19                must not be retried without performing another action to fix the
20                problem first (typically: stop the stream before retrying).</entry>
21       </row>
22       <row>
23         <entry>EFAULT</entry>
24         <entry>There was a failure while copying data from/to userspace,
25                probably caused by an invalid pointer reference.</entry>
26       </row>
27       <row>
28         <entry>EINVAL</entry>
29         <entry>One or more of the ioctl parameters are invalid or out of the
30                allowed range. This is a widely used error code. See the individual
31                ioctl requests for specific causes.</entry>
32       </row>
33       <row>
34         <entry>ENODEV</entry>
35         <entry>Device not found or was removed.</entry>
36       </row>
37       <row>
38         <entry>ENOMEM</entry>
39         <entry>There's not enough memory to handle the desired operation.</entry>
40       </row>
41       <row>
42         <entry>ENOTTY</entry>
43         <entry>The ioctl is not supported by the driver, actually meaning that
44                the required functionality is not available, or the file
45                descriptor is not for a media device.</entry>
46       </row>
47       <row>
48         <entry>ENOSPC</entry>
49         <entry>On USB devices, the stream ioctl's can return this error, meaning
50                that this request would overcommit the usb bandwidth reserved
51                for periodic transfers (up to 80% of the USB bandwidth).</entry>
52       </row>
53       <row>
54         <entry>ENOSYS or EOPNOTSUPP</entry>
55         <entry>Function not available for this device (dvb API only. Will likely
56                be replaced anytime soon by ENOTTY).</entry>
57       </row>
58       <row>
59         <entry>EPERM</entry>
60         <entry>Permission denied. Can be returned if the device needs write
61                 permission, or some special capabilities is needed
62                 (e. g. root)</entry>
63       </row>
64       <row>
65         <entry>EWOULDBLOCK</entry>
66         <entry>Operation would block. Used when the ioctl would need to wait
67                for an event, but the device was opened in non-blocking mode.</entry>
68       </row>
69     </tbody>
70   </tgroup>
71 </table>
72
73 <para>Note 1: ioctls may return other error codes. Since errors may have side
74 effects such as a driver reset, applications should abort on unexpected errors.
75 </para>
76
77 <para>Note 2: Request-specific error codes are listed in the individual
78 requests descriptions.</para>