blob: 6e983b9880fce2df7112e7f3b14365057a6db3da [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
Mauro Carvalho Chehab42858b52016-08-19 09:46:28 -030012.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
Mauro Carvalho Chehab5bd4bb72016-08-17 08:14:19 -030013
Markus Heiser5377d912016-06-30 15:18:56 +020014.. flat-table:: Generic error codes
15 :header-rows: 0
16 :stub-columns: 0
Mauro Carvalho Chehabdf947112016-07-06 07:58:20 -030017 :widths: 1 16
Markus Heiser5377d912016-06-30 15:18:56 +020018
19
20 - .. row 1
21
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030022 - ``EAGAIN`` (aka ``EWOULDBLOCK``)
Markus Heiser5377d912016-06-30 15:18:56 +020023
24 - The ioctl can't be handled because the device is in state where it
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030025 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.
Markus Heiser5377d912016-06-30 15:18:56 +020029
30 - .. row 2
31
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030032 - ``EBADF``
Markus Heiser5377d912016-06-30 15:18:56 +020033
34 - The file descriptor is not a valid.
35
36 - .. row 3
37
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030038 - ``EBUSY``
Markus Heiser5377d912016-06-30 15:18:56 +020039
40 - The ioctl can't be handled because the device is busy. This is
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030041 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).
Markus Heiser5377d912016-06-30 15:18:56 +020046
47 - .. row 4
48
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030049 - ``EFAULT``
Markus Heiser5377d912016-06-30 15:18:56 +020050
51 - There was a failure while copying data from/to userspace, probably
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030052 caused by an invalid pointer reference.
Markus Heiser5377d912016-06-30 15:18:56 +020053
54 - .. row 5
55
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030056 - ``EINVAL``
Markus Heiser5377d912016-06-30 15:18:56 +020057
58 - One or more of the ioctl parameters are invalid or out of the
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030059 allowed range. This is a widely used error code. See the
60 individual ioctl requests for specific causes.
Markus Heiser5377d912016-06-30 15:18:56 +020061
62 - .. row 6
63
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030064 - ``ENODEV``
Markus Heiser5377d912016-06-30 15:18:56 +020065
66 - Device not found or was removed.
67
68 - .. row 7
69
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030070 - ``ENOMEM``
Markus Heiser5377d912016-06-30 15:18:56 +020071
72 - There's not enough memory to handle the desired operation.
73
74 - .. row 8
75
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030076 - ``ENOTTY``
Markus Heiser5377d912016-06-30 15:18:56 +020077
78 - The ioctl is not supported by the driver, actually meaning that
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030079 the required functionality is not available, or the file
80 descriptor is not for a media device.
Markus Heiser5377d912016-06-30 15:18:56 +020081
82 - .. row 9
83
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030084 - ``ENOSPC``
Markus Heiser5377d912016-06-30 15:18:56 +020085
86 - On USB devices, the stream ioctl's can return this error, meaning
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030087 that this request would overcommit the usb bandwidth reserved for
88 periodic transfers (up to 80% of the USB bandwidth).
Markus Heiser5377d912016-06-30 15:18:56 +020089
90 - .. row 10
91
Mauro Carvalho Chehabcdb4af02016-07-03 11:53:09 -030092 - ``EPERM``
Markus Heiser5377d912016-06-30 15:18:56 +020093
94 - Permission denied. Can be returned if the device needs write
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030095 permission, or some special capabilities is needed (e. g. root)
Markus Heiser5377d912016-06-30 15:18:56 +020096
Mauro Carvalho Chehab706f8a92016-07-10 11:57:43 -030097.. note::
Markus Heiser5377d912016-06-30 15:18:56 +020098
Mauro Carvalho Chehab706f8a92016-07-10 11:57:43 -030099 #. This list is not exaustive; ioctls may return other error codes.
100 Since errors may have side effects such as a driver reset,
101 applications should abort on unexpected errors, or otherwise
102 assume that the device is in a bad state.
Markus Heiser5377d912016-06-30 15:18:56 +0200103
Mauro Carvalho Chehab706f8a92016-07-10 11:57:43 -0300104 #. Request-specific error codes are listed in the individual
105 requests descriptions.