2016-06-30 20:18:56 +07:00
|
|
|
.. -*- coding: utf-8; mode: rst -*-
|
|
|
|
|
2016-07-09 18:54:35 +07:00
|
|
|
.. _media_ioc_enum_entities:
|
2016-06-30 20:18:56 +07:00
|
|
|
|
|
|
|
*****************************
|
|
|
|
ioctl MEDIA_IOC_ENUM_ENTITIES
|
|
|
|
*****************************
|
|
|
|
|
2016-07-06 01:14:35 +07:00
|
|
|
Name
|
2016-07-05 17:58:48 +07:00
|
|
|
====
|
2016-06-30 20:18:56 +07:00
|
|
|
|
2016-07-05 17:58:48 +07:00
|
|
|
MEDIA_IOC_ENUM_ENTITIES - Enumerate entities and their properties
|
2016-06-30 20:18:56 +07:00
|
|
|
|
2016-07-06 01:14:35 +07:00
|
|
|
|
|
|
|
Synopsis
|
2016-06-30 20:18:56 +07:00
|
|
|
========
|
|
|
|
|
2016-08-20 02:59:55 +07:00
|
|
|
.. c:function:: int ioctl( int fd, MEDIA_IOC_ENUM_ENTITIES, struct media_entity_desc *argp )
|
|
|
|
:name: MEDIA_IOC_ENUM_ENTITIES
|
2016-06-30 20:18:56 +07:00
|
|
|
|
2016-07-05 17:58:48 +07:00
|
|
|
|
2016-07-06 01:14:35 +07:00
|
|
|
Arguments
|
2016-06-30 20:18:56 +07:00
|
|
|
=========
|
|
|
|
|
|
|
|
``fd``
|
|
|
|
File descriptor returned by :ref:`open() <media-func-open>`.
|
|
|
|
|
|
|
|
``argp``
|
|
|
|
|
|
|
|
|
2016-07-06 01:14:35 +07:00
|
|
|
Description
|
2016-06-30 20:18:56 +07:00
|
|
|
===========
|
|
|
|
|
|
|
|
To query the attributes of an entity, applications set the id field of a
|
2016-08-30 03:37:59 +07:00
|
|
|
struct :c:type:`media_entity_desc` structure and
|
2016-06-30 20:18:56 +07:00
|
|
|
call the MEDIA_IOC_ENUM_ENTITIES ioctl with a pointer to this
|
|
|
|
structure. The driver fills the rest of the structure or returns an
|
|
|
|
EINVAL error code when the id is invalid.
|
|
|
|
|
2016-07-09 18:54:35 +07:00
|
|
|
.. _media-ent-id-flag-next:
|
|
|
|
|
2016-06-30 20:18:56 +07:00
|
|
|
Entities can be enumerated by or'ing the id with the
|
|
|
|
``MEDIA_ENT_ID_FLAG_NEXT`` flag. The driver will return information
|
|
|
|
about the entity with the smallest id strictly larger than the requested
|
2016-07-03 21:53:09 +07:00
|
|
|
one ('next entity'), or the ``EINVAL`` error code if there is none.
|
2016-06-30 20:18:56 +07:00
|
|
|
|
|
|
|
Entity IDs can be non-contiguous. Applications must *not* try to
|
|
|
|
enumerate entities by calling MEDIA_IOC_ENUM_ENTITIES with increasing
|
|
|
|
id's until they get an error.
|
|
|
|
|
|
|
|
|
2016-08-30 03:37:59 +07:00
|
|
|
.. c:type:: media_entity_desc
|
2016-06-30 20:18:56 +07:00
|
|
|
|
2017-09-03 06:29:53 +07:00
|
|
|
.. tabularcolumns:: |p{1.5cm}|p{1.7cm}|p{1.6cm}|p{1.5cm}|p{11.2cm}|
|
[media] docs-rst: add tabularcolumns to all tables
LaTeX doesn't handle too well auto-width on tables, and ReST
markup requires an special tag to give it the needed hints.
As we're using A4 paper, we have 17cm of useful spaces. As
most media tables have widths, let's use it to generate the
needed via the following perl script:
my ($line_size, $table_header, $has_cols) = (17.5, 0, 0);
my $out;
my $header = "";
my @widths = ();
sub round { $_[0] > 0 ? int($_[0] + .5) : -int(-$_[0] + .5) }
while (<>) {
if (!$table_header) {
$has_cols = 1 if (m/..\s+tabularcolumns::/);
if (m/..\s+flat-table::/) {
$table_header = 1;
$header = $_;
next;
}
$out .= $_;
next;
}
$header .= $_;
@widths = split(/ /, $1) if (m/:widths:\s+(.*)/);
if (m/^\n$/) {
if (!$has_cols && @widths) {
my ($tot, $t, $i) = (0, 0, 0);
foreach my $v(@widths) { $tot += $v; };
$out .= ".. tabularcolumns:: |";
for ($i = 0; $i < scalar @widths - 1; $i++) {
my $v = $widths[$i];
my $w = round(10 * ($v * $line_size) / $tot) / 10;
$out .= sprintf "p{%.1fcm}|", $w;
$t += $w;
}
my $w = $line_size - $t;
$out .= sprintf "p{%.1fcm}|\n\n", $w;
}
$out .= $header;
$table_header = 0;
$has_cols = 0;
$header = "";
@widths = ();
}
}
print $out;
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-17 18:14:19 +07:00
|
|
|
|
2016-06-30 20:18:56 +07:00
|
|
|
.. flat-table:: struct media_entity_desc
|
|
|
|
:header-rows: 0
|
|
|
|
:stub-columns: 0
|
2016-07-06 17:55:55 +07:00
|
|
|
:widths: 1 1 1 1 8
|
2016-06-30 20:18:56 +07:00
|
|
|
|
2018-06-15 20:19:44 +07:00
|
|
|
* - __u32
|
2016-06-30 20:18:56 +07:00
|
|
|
- ``id``
|
2016-07-05 02:25:48 +07:00
|
|
|
-
|
|
|
|
-
|
2018-06-29 18:31:20 +07:00
|
|
|
- Entity ID, set by the application. When the ID is or'ed with
|
2016-07-05 02:25:48 +07:00
|
|
|
``MEDIA_ENT_ID_FLAG_NEXT``, the driver clears the flag and returns
|
2018-06-29 18:31:20 +07:00
|
|
|
the first entity with a larger ID. Do not expect that the ID will
|
|
|
|
always be the same for each instance of the device. In other words,
|
|
|
|
do not hardcode entity IDs in an application.
|
2016-06-30 20:18:56 +07:00
|
|
|
|
2018-06-15 20:19:44 +07:00
|
|
|
* - char
|
2016-07-13 18:43:30 +07:00
|
|
|
- ``name``\ [32]
|
2016-07-05 02:25:48 +07:00
|
|
|
-
|
|
|
|
-
|
2018-06-29 18:31:20 +07:00
|
|
|
- Entity name as an UTF-8 NULL-terminated string. This name must be unique
|
|
|
|
within the media topology.
|
2016-06-30 20:18:56 +07:00
|
|
|
|
2018-06-15 20:19:44 +07:00
|
|
|
* - __u32
|
2016-06-30 20:18:56 +07:00
|
|
|
- ``type``
|
2016-07-05 02:25:48 +07:00
|
|
|
-
|
|
|
|
-
|
2018-03-19 22:43:24 +07:00
|
|
|
- Entity type, see :ref:`media-entity-functions` for details.
|
2016-06-30 20:18:56 +07:00
|
|
|
|
2018-06-15 20:19:44 +07:00
|
|
|
* - __u32
|
2016-06-30 20:18:56 +07:00
|
|
|
- ``revision``
|
2016-07-05 02:25:48 +07:00
|
|
|
-
|
|
|
|
-
|
2016-06-30 20:18:56 +07:00
|
|
|
- Entity revision. Always zero (obsolete)
|
|
|
|
|
2018-06-15 20:19:44 +07:00
|
|
|
* - __u32
|
2016-06-30 20:18:56 +07:00
|
|
|
- ``flags``
|
2016-07-05 02:25:48 +07:00
|
|
|
-
|
|
|
|
-
|
2016-06-30 20:18:56 +07:00
|
|
|
- Entity flags, see :ref:`media-entity-flag` for details.
|
|
|
|
|
2018-06-15 20:19:44 +07:00
|
|
|
* - __u32
|
2016-06-30 20:18:56 +07:00
|
|
|
- ``group_id``
|
2016-07-05 02:25:48 +07:00
|
|
|
-
|
|
|
|
-
|
2016-06-30 20:18:56 +07:00
|
|
|
- Entity group ID. Always zero (obsolete)
|
|
|
|
|
2018-06-15 20:19:44 +07:00
|
|
|
* - __u16
|
2016-06-30 20:18:56 +07:00
|
|
|
- ``pads``
|
2016-07-05 02:25:48 +07:00
|
|
|
-
|
|
|
|
-
|
2016-06-30 20:18:56 +07:00
|
|
|
- Number of pads
|
|
|
|
|
2018-06-15 20:19:44 +07:00
|
|
|
* - __u16
|
2016-06-30 20:18:56 +07:00
|
|
|
- ``links``
|
2016-07-05 02:25:48 +07:00
|
|
|
-
|
|
|
|
-
|
2016-06-30 20:18:56 +07:00
|
|
|
- Total number of outbound links. Inbound links are not counted in
|
2016-07-05 02:25:48 +07:00
|
|
|
this field.
|
2016-06-30 20:18:56 +07:00
|
|
|
|
2018-06-15 20:19:44 +07:00
|
|
|
* - __u32
|
2018-02-04 01:26:07 +07:00
|
|
|
- ``reserved[4]``
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- Reserved for future extensions. Drivers and applications must set
|
|
|
|
the array to zero.
|
2016-06-30 20:18:56 +07:00
|
|
|
|
2018-06-15 20:19:44 +07:00
|
|
|
* - union
|
2018-02-04 01:26:07 +07:00
|
|
|
|
2018-06-15 20:19:44 +07:00
|
|
|
* -
|
2016-06-30 20:18:56 +07:00
|
|
|
- struct
|
|
|
|
- ``dev``
|
2016-07-05 02:25:48 +07:00
|
|
|
-
|
2016-06-30 20:18:56 +07:00
|
|
|
- Valid for (sub-)devices that create a single device node.
|
|
|
|
|
2018-06-15 20:19:44 +07:00
|
|
|
* -
|
2016-07-05 02:25:48 +07:00
|
|
|
-
|
2016-06-30 20:18:56 +07:00
|
|
|
- __u32
|
|
|
|
- ``major``
|
|
|
|
- Device node major number.
|
|
|
|
|
2018-06-15 20:19:44 +07:00
|
|
|
* -
|
2016-07-05 02:25:48 +07:00
|
|
|
-
|
2016-06-30 20:18:56 +07:00
|
|
|
- __u32
|
|
|
|
- ``minor``
|
|
|
|
- Device node minor number.
|
|
|
|
|
2018-06-15 20:19:44 +07:00
|
|
|
* -
|
2016-06-30 20:18:56 +07:00
|
|
|
- __u8
|
2016-07-13 18:43:30 +07:00
|
|
|
- ``raw``\ [184]
|
2016-07-05 02:25:48 +07:00
|
|
|
-
|
|
|
|
-
|
2016-06-30 20:18:56 +07:00
|
|
|
|
|
|
|
|
2016-07-06 01:14:35 +07:00
|
|
|
Return Value
|
2016-06-30 20:18:56 +07:00
|
|
|
============
|
|
|
|
|
|
|
|
On success 0 is returned, on error -1 and the ``errno`` variable is set
|
|
|
|
appropriately. The generic error codes are described at the
|
|
|
|
:ref:`Generic Error Codes <gen-errors>` chapter.
|
|
|
|
|
|
|
|
EINVAL
|
2016-08-30 03:37:59 +07:00
|
|
|
The struct :c:type:`media_entity_desc` ``id``
|
2016-06-30 20:18:56 +07:00
|
|
|
references a non-existing entity.
|