]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - Documentation/media/uapi/gen-errors.rst
Merge branches 'for-4.11/upstream-fixes', 'for-4.12/accutouch', 'for-4.12/cp2112...
[mirror_ubuntu-artful-kernel.git] / Documentation / media / uapi / gen-errors.rst
CommitLineData
5377d91f
MH
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _gen_errors:
4
5*******************
6Generic Error Codes
7*******************
8
9
10.. _gen-errors:
11
42858b55 12.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
5bd4bb78 13
5377d91f
MH
14.. flat-table:: Generic error codes
15 :header-rows: 0
16 :stub-columns: 0
df94711d 17 :widths: 1 16
5377d91f
MH
18
19
20 - .. row 1
21
cdb4af0f 22 - ``EAGAIN`` (aka ``EWOULDBLOCK``)
5377d91f
MH
23
24 - The ioctl can't be handled because the device is in state where it
0579e6e3
MCC
25 can't perform it. This could happen for example in case where
26 device is sleeping and ioctl is performed to query statistics. It
27 is also returned when the ioctl would need to wait for an event,
28 but the device was opened in non-blocking mode.
5377d91f
MH
29
30 - .. row 2
31
cdb4af0f 32 - ``EBADF``
5377d91f
MH
33
34 - The file descriptor is not a valid.
35
36 - .. row 3
37
cdb4af0f 38 - ``EBUSY``
5377d91f
MH
39
40 - The ioctl can't be handled because the device is busy. This is
0579e6e3
MCC
41 typically return while device is streaming, and an ioctl tried to
42 change something that would affect the stream, or would require
43 the usage of a hardware resource that was already allocated. The
44 ioctl must not be retried without performing another action to fix
45 the problem first (typically: stop the stream before retrying).
5377d91f
MH
46
47 - .. row 4
48
cdb4af0f 49 - ``EFAULT``
5377d91f
MH
50
51 - There was a failure while copying data from/to userspace, probably
0579e6e3 52 caused by an invalid pointer reference.
5377d91f
MH
53
54 - .. row 5
55
cdb4af0f 56 - ``EINVAL``
5377d91f
MH
57
58 - One or more of the ioctl parameters are invalid or out of the
0579e6e3
MCC
59 allowed range. This is a widely used error code. See the
60 individual ioctl requests for specific causes.
5377d91f
MH
61
62 - .. row 6
63
cdb4af0f 64 - ``ENODEV``
5377d91f
MH
65
66 - Device not found or was removed.
67
68 - .. row 7
69
cdb4af0f 70 - ``ENOMEM``
5377d91f
MH
71
72 - There's not enough memory to handle the desired operation.
73
74 - .. row 8
75
cdb4af0f 76 - ``ENOTTY``
5377d91f
MH
77
78 - The ioctl is not supported by the driver, actually meaning that
0579e6e3
MCC
79 the required functionality is not available, or the file
80 descriptor is not for a media device.
5377d91f
MH
81
82 - .. row 9
83
cdb4af0f 84 - ``ENOSPC``
5377d91f
MH
85
86 - On USB devices, the stream ioctl's can return this error, meaning
0579e6e3
MCC
87 that this request would overcommit the usb bandwidth reserved for
88 periodic transfers (up to 80% of the USB bandwidth).
5377d91f
MH
89
90 - .. row 10
91
cdb4af0f 92 - ``EPERM``
5377d91f
MH
93
94 - Permission denied. Can be returned if the device needs write
0579e6e3 95 permission, or some special capabilities is needed (e. g. root)
5377d91f 96
05a89739
HV
97 - .. row 11
98
99 - ``EIO``
100
101 - I/O error. Typically used when there are problems communicating with
102 a hardware device. This could indicate broken or flaky hardware.
103 It's a 'Something is wrong, I give up!' type of error.
104
706f8a99 105.. note::
5377d91f 106
05a89739 107 #. This list is not exhaustive; ioctls may return other error codes.
706f8a99
MCC
108 Since errors may have side effects such as a driver reset,
109 applications should abort on unexpected errors, or otherwise
110 assume that the device is in a bad state.
5377d91f 111
706f8a99
MCC
112 #. Request-specific error codes are listed in the individual
113 requests descriptions.