Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 1 | .. -*- coding: utf-8; mode: rst -*- |
| 2 | |
| 3 | .. _gen_errors: |
| 4 | |
| 5 | ******************* |
| 6 | Generic Error Codes |
| 7 | ******************* |
| 8 | |
| 9 | |
| 10 | .. _gen-errors: |
| 11 | |
Mauro Carvalho Chehab | 42858b5 | 2016-08-19 09:46:28 -0300 | [diff] [blame] | 12 | .. tabularcolumns:: |p{2.5cm}|p{15.0cm}| |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame] | 13 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 14 | .. flat-table:: Generic error codes |
| 15 | :header-rows: 0 |
| 16 | :stub-columns: 0 |
Mauro Carvalho Chehab | df94711 | 2016-07-06 07:58:20 -0300 | [diff] [blame] | 17 | :widths: 1 16 |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 18 | |
| 19 | |
| 20 | - .. row 1 |
| 21 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 22 | - ``EAGAIN`` (aka ``EWOULDBLOCK``) |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 23 | |
| 24 | - The ioctl can't be handled because the device is in state where it |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 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. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 29 | |
| 30 | - .. row 2 |
| 31 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 32 | - ``EBADF`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 33 | |
| 34 | - The file descriptor is not a valid. |
| 35 | |
| 36 | - .. row 3 |
| 37 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 38 | - ``EBUSY`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 39 | |
| 40 | - The ioctl can't be handled because the device is busy. This is |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 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). |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 46 | |
| 47 | - .. row 4 |
| 48 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 49 | - ``EFAULT`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 50 | |
| 51 | - There was a failure while copying data from/to userspace, probably |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 52 | caused by an invalid pointer reference. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 53 | |
| 54 | - .. row 5 |
| 55 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 56 | - ``EINVAL`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 57 | |
| 58 | - One or more of the ioctl parameters are invalid or out of the |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 59 | allowed range. This is a widely used error code. See the |
| 60 | individual ioctl requests for specific causes. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 61 | |
| 62 | - .. row 6 |
| 63 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 64 | - ``ENODEV`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 65 | |
| 66 | - Device not found or was removed. |
| 67 | |
| 68 | - .. row 7 |
| 69 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 70 | - ``ENOMEM`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 71 | |
| 72 | - There's not enough memory to handle the desired operation. |
| 73 | |
| 74 | - .. row 8 |
| 75 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 76 | - ``ENOTTY`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 77 | |
| 78 | - The ioctl is not supported by the driver, actually meaning that |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 79 | the required functionality is not available, or the file |
| 80 | descriptor is not for a media device. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 81 | |
| 82 | - .. row 9 |
| 83 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 84 | - ``ENOSPC`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 85 | |
| 86 | - On USB devices, the stream ioctl's can return this error, meaning |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 87 | that this request would overcommit the usb bandwidth reserved for |
| 88 | periodic transfers (up to 80% of the USB bandwidth). |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 89 | |
| 90 | - .. row 10 |
| 91 | |
Mauro Carvalho Chehab | cdb4af0 | 2016-07-03 11:53:09 -0300 | [diff] [blame] | 92 | - ``EPERM`` |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 93 | |
| 94 | - Permission denied. Can be returned if the device needs write |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 95 | permission, or some special capabilities is needed (e. g. root) |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 96 | |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 97 | .. note:: |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 98 | |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 99 | #. 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 Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 103 | |
Mauro Carvalho Chehab | 706f8a9 | 2016-07-10 11:57:43 -0300 | [diff] [blame] | 104 | #. Request-specific error codes are listed in the individual |
| 105 | requests descriptions. |