^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) .. c:namespace:: MC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) .. _media_request_ioc_reinit:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) ******************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) ioctl MEDIA_REQUEST_IOC_REINIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) ******************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) Name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) ====
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) MEDIA_REQUEST_IOC_REINIT - Re-initialize a request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) Synopsis
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) ========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) .. c:macro:: MEDIA_REQUEST_IOC_REINIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) ``int ioctl(int request_fd, MEDIA_REQUEST_IOC_REINIT)``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) Arguments
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) ``request_fd``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) File descriptor returned by :ref:`MEDIA_IOC_REQUEST_ALLOC`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) ===========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) If the media device supports :ref:`requests <media-request-api>`, then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) this request ioctl can be used to re-initialize a previously allocated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) request.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) Re-initializing a request will clear any existing data from the request.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) This avoids having to :c:func:`close()` a completed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) request and allocate a new request. Instead the completed request can just
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) be re-initialized and it is ready to be used again.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) A request can only be re-initialized if it either has not been queued
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) yet, or if it was queued and completed. Otherwise it will set ``errno``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) to ``EBUSY``. No other error codes can be returned.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) Return Value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) On success 0 is returned, on error -1 and the ``errno`` variable is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) appropriately.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) EBUSY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) The request is queued but not yet completed.