18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later
28c2ecf20Sopenharmony_ci.. c:namespace:: MC
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci.. _media_request_ioc_reinit:
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci******************************
78c2ecf20Sopenharmony_ciioctl MEDIA_REQUEST_IOC_REINIT
88c2ecf20Sopenharmony_ci******************************
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ciName
118c2ecf20Sopenharmony_ci====
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ciMEDIA_REQUEST_IOC_REINIT - Re-initialize a request
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ciSynopsis
168c2ecf20Sopenharmony_ci========
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci.. c:macro:: MEDIA_REQUEST_IOC_REINIT
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci``int ioctl(int request_fd, MEDIA_REQUEST_IOC_REINIT)``
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ciArguments
238c2ecf20Sopenharmony_ci=========
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci``request_fd``
268c2ecf20Sopenharmony_ci    File descriptor returned by :ref:`MEDIA_IOC_REQUEST_ALLOC`.
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ciDescription
298c2ecf20Sopenharmony_ci===========
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ciIf the media device supports :ref:`requests <media-request-api>`, then
328c2ecf20Sopenharmony_cithis request ioctl can be used to re-initialize a previously allocated
338c2ecf20Sopenharmony_cirequest.
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ciRe-initializing a request will clear any existing data from the request.
368c2ecf20Sopenharmony_ciThis avoids having to :c:func:`close()` a completed
378c2ecf20Sopenharmony_cirequest and allocate a new request. Instead the completed request can just
388c2ecf20Sopenharmony_cibe re-initialized and it is ready to be used again.
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ciA request can only be re-initialized if it either has not been queued
418c2ecf20Sopenharmony_ciyet, or if it was queued and completed. Otherwise it will set ``errno``
428c2ecf20Sopenharmony_cito ``EBUSY``. No other error codes can be returned.
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ciReturn Value
458c2ecf20Sopenharmony_ci============
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ciOn success 0 is returned, on error -1 and the ``errno`` variable is set
488c2ecf20Sopenharmony_ciappropriately.
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ciEBUSY
518c2ecf20Sopenharmony_ci    The request is queued but not yet completed.
52