From dc9ef7d11207a04514ca195f0c9f4d2ac56696e1 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 31 May 2015 09:59:12 -0300 Subject: [PATCH] [media] DocBook media: rewrite frontend open/close To fix the last xmllint errors the open and close function reference description was rewritten based on the v4l2 open and close functions. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Documentation/DocBook/media/dvb/frontend.xml | 279 +++++++++++-------- 1 file changed, 158 insertions(+), 121 deletions(-) diff --git a/Documentation/DocBook/media/dvb/frontend.xml b/Documentation/DocBook/media/dvb/frontend.xml index ab42d8c6d11a..c7fa3d8bff5c 100644 --- a/Documentation/DocBook/media/dvb/frontend.xml +++ b/Documentation/DocBook/media/dvb/frontend.xml @@ -59,11 +59,54 @@ specification is available at
Frontend Function Calls -
-open() -DESCRIPTION - - + + + open() + &manvol; + + + + fe-open + Open a frontend device + + + + + #include <fcntl.h> + + int open + const char *device_name + int flags + + + + + + Arguments + + + + device_name + + Device to be opened. + + + + flags + + Open flags. Access mode must be +O_RDWR. This is just a technicality, input devices +still support only reading and output devices only writing. + When the O_NONBLOCK flag is +given, the read() function will return the &EAGAIN; when no data is available, +otherwise these functions block until data becomes +available. Other flags have no effect. + + + + + + Description This system call opens a named frontend device (/dev/dvb/adapter0/frontend0) for subsequent use. Usually the first thing to do after a successful open is to find out the frontend type with FE_GET_INFO. @@ -82,127 +125,121 @@ specification is available at for use in the specified mode. This implies that the corresponding hardware is powered up, and that other front-ends may have been powered down to make that possible. - - + -SYNOPSIS - -int open(const char ⋆deviceName, int flags); - - -PARAMETERS - - -const char - *deviceName - -Name of specific video device. - - -int flags - -A bit-wise OR of the following flags: - - - -O_RDONLY read-only access - - - -O_RDWR read/write access - - - -O_NONBLOCK open in non-blocking mode - - - -(blocking mode is the default) - - -RETURN VALUE - -ENODEV - -Device driver not loaded/available. - - -EINTERNAL - -Internal error. - - -EBUSY - -Device or resource busy. - - -EINVAL - -Invalid argument. - - -
+ + Return Value -
-close() -DESCRIPTION - - + On success open returns the new file +descriptor. On error -1 is returned, and the errno +variable is set appropriately. Possible error codes are: + + + + EACCES + + The caller has no permission to access the +device. + + + + EBUSY + + The driver does not support multiple opens and the +device is already in use. + + + + ENXIO + + No device corresponding to this device special file +exists. + + + + ENOMEM + + Not enough kernel memory was available to complete the +request. + + + + EMFILE + + The process already has the maximum number of +files open. + + + + ENFILE + + The limit on the total number of files open on the +system has been reached. + + + + + + + + + close() + &manvol; + + + + fe-close + Close a frontend device + + + + + #include <unistd.h> + + int close + int fd + + + + + + Arguments + + + + fd + + &fd; + + + + + + + Description This system call closes a previously opened front-end device. After closing a front-end device, its corresponding hardware might be powered down automatically. - - -SYNOPSIS - - -int close(int fd); - - -PARAMETERS - - -int fd - -File descriptor returned by a previous call to open(). - - -RETURN VALUE - -EBADF - -fd is not a valid open file descriptor. - - -
+
+ + Return Value + + The function returns 0 on +success, -1 on failure and the +errno is set appropriately. Possible error +codes: + + + + EBADF + + fd is not a valid open file +descriptor. + + + + + &sub-fe-get-info; &sub-fe-read-status;