xref: /OK3568_Linux_fs/kernel/Documentation/userspace-api/media/mediactl/media-request-ioc-reinit.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later
2*4882a593Smuzhiyun.. c:namespace:: MC
3*4882a593Smuzhiyun
4*4882a593Smuzhiyun.. _media_request_ioc_reinit:
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun******************************
7*4882a593Smuzhiyunioctl MEDIA_REQUEST_IOC_REINIT
8*4882a593Smuzhiyun******************************
9*4882a593Smuzhiyun
10*4882a593SmuzhiyunName
11*4882a593Smuzhiyun====
12*4882a593Smuzhiyun
13*4882a593SmuzhiyunMEDIA_REQUEST_IOC_REINIT - Re-initialize a request
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunSynopsis
16*4882a593Smuzhiyun========
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun.. c:macro:: MEDIA_REQUEST_IOC_REINIT
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun``int ioctl(int request_fd, MEDIA_REQUEST_IOC_REINIT)``
21*4882a593Smuzhiyun
22*4882a593SmuzhiyunArguments
23*4882a593Smuzhiyun=========
24*4882a593Smuzhiyun
25*4882a593Smuzhiyun``request_fd``
26*4882a593Smuzhiyun    File descriptor returned by :ref:`MEDIA_IOC_REQUEST_ALLOC`.
27*4882a593Smuzhiyun
28*4882a593SmuzhiyunDescription
29*4882a593Smuzhiyun===========
30*4882a593Smuzhiyun
31*4882a593SmuzhiyunIf the media device supports :ref:`requests <media-request-api>`, then
32*4882a593Smuzhiyunthis request ioctl can be used to re-initialize a previously allocated
33*4882a593Smuzhiyunrequest.
34*4882a593Smuzhiyun
35*4882a593SmuzhiyunRe-initializing a request will clear any existing data from the request.
36*4882a593SmuzhiyunThis avoids having to :c:func:`close()` a completed
37*4882a593Smuzhiyunrequest and allocate a new request. Instead the completed request can just
38*4882a593Smuzhiyunbe re-initialized and it is ready to be used again.
39*4882a593Smuzhiyun
40*4882a593SmuzhiyunA request can only be re-initialized if it either has not been queued
41*4882a593Smuzhiyunyet, or if it was queued and completed. Otherwise it will set ``errno``
42*4882a593Smuzhiyunto ``EBUSY``. No other error codes can be returned.
43*4882a593Smuzhiyun
44*4882a593SmuzhiyunReturn Value
45*4882a593Smuzhiyun============
46*4882a593Smuzhiyun
47*4882a593SmuzhiyunOn success 0 is returned, on error -1 and the ``errno`` variable is set
48*4882a593Smuzhiyunappropriately.
49*4882a593Smuzhiyun
50*4882a593SmuzhiyunEBUSY
51*4882a593Smuzhiyun    The request is queued but not yet completed.
52