blob: 6dc76b2461df9d01f5b0c8e506aebfc2829ee770 [file] [log] [blame]
Markus Heiser5377d912016-06-30 15:18:56 +02001.. -*- coding: utf-8; mode: rst -*-
2
3.. _gen_errors:
4
5*******************
6Generic Error Codes
7*******************
8
9
10.. _gen-errors:
11
12.. flat-table:: Generic error codes
13 :header-rows: 0
14 :stub-columns: 0
15
16
17 - .. row 1
18
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030019 - ``EAGAIN`` (aka ``EWOULDBLOCK``)
Markus Heiser5377d912016-06-30 15:18:56 +020020
21 - The ioctl can't be handled because the device is in state where it
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030022 can't perform it. This could happen for example in case where
23 device is sleeping and ioctl is performed to query statistics. It
24 is also returned when the ioctl would need to wait for an event,
25 but the device was opened in non-blocking mode.
Markus Heiser5377d912016-06-30 15:18:56 +020026
27 - .. row 2
28
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030029 - ``EBADF``
Markus Heiser5377d912016-06-30 15:18:56 +020030
31 - The file descriptor is not a valid.
32
33 - .. row 3
34
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030035 - ``EBUSY``
Markus Heiser5377d912016-06-30 15:18:56 +020036
37 - The ioctl can't be handled because the device is busy. This is
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030038 typically return while device is streaming, and an ioctl tried to
39 change something that would affect the stream, or would require
40 the usage of a hardware resource that was already allocated. The
41 ioctl must not be retried without performing another action to fix
42 the problem first (typically: stop the stream before retrying).
Markus Heiser5377d912016-06-30 15:18:56 +020043
44 - .. row 4
45
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030046 - ``EFAULT``
Markus Heiser5377d912016-06-30 15:18:56 +020047
48 - There was a failure while copying data from/to userspace, probably
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030049 caused by an invalid pointer reference.
Markus Heiser5377d912016-06-30 15:18:56 +020050
51 - .. row 5
52
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030053 - ``EINVAL``
Markus Heiser5377d912016-06-30 15:18:56 +020054
55 - One or more of the ioctl parameters are invalid or out of the
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030056 allowed range. This is a widely used error code. See the
57 individual ioctl requests for specific causes.
Markus Heiser5377d912016-06-30 15:18:56 +020058
59 - .. row 6
60
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030061 - ``ENODEV``
Markus Heiser5377d912016-06-30 15:18:56 +020062
63 - Device not found or was removed.
64
65 - .. row 7
66
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030067 - ``ENOMEM``
Markus Heiser5377d912016-06-30 15:18:56 +020068
69 - There's not enough memory to handle the desired operation.
70
71 - .. row 8
72
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030073 - ``ENOTTY``
Markus Heiser5377d912016-06-30 15:18:56 +020074
75 - The ioctl is not supported by the driver, actually meaning that
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030076 the required functionality is not available, or the file
77 descriptor is not for a media device.
Markus Heiser5377d912016-06-30 15:18:56 +020078
79 - .. row 9
80
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030081 - ``ENOSPC``
Markus Heiser5377d912016-06-30 15:18:56 +020082
83 - On USB devices, the stream ioctl's can return this error, meaning
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030084 that this request would overcommit the usb bandwidth reserved for
85 periodic transfers (up to 80% of the USB bandwidth).
Markus Heiser5377d912016-06-30 15:18:56 +020086
87 - .. row 10
88
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030089 - ``EPERM``
Markus Heiser5377d912016-06-30 15:18:56 +020090
91 - Permission denied. Can be returned if the device needs write
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030092 permission, or some special capabilities is needed (e. g. root)
Markus Heiser5377d912016-06-30 15:18:56 +020093
94
95Note 1: ioctls may return other error codes. Since errors may have side
96effects such as a driver reset, applications should abort on unexpected
97errors.
98
99Note 2: Request-specific error codes are listed in the individual
100requests descriptions.