From e09b41010ba33a20a87472ee821fa407a5b8da36 Mon Sep 17 00:00:00 2001 From: José Pekkarinen Date: Mon, 11 Apr 2016 10:41:07 +0300 Subject: These changes are the raw update to linux-4.4.6-rt14. Kernel sources are taken from kernel.org, and rt patch from the rt wiki download page. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During the rebasing, the following patch collided: Force tick interrupt and get rid of softirq magic(I70131fb85). Collisions have been removed because its logic was found on the source already. Change-Id: I7f57a4081d9deaa0d9ccfc41a6c8daccdee3b769 Signed-off-by: José Pekkarinen --- kernel/Documentation/DocBook/media/.gitignore | 1 + kernel/Documentation/DocBook/media/Makefile | 89 +- kernel/Documentation/DocBook/media/dvb/audio.xml | 6 +- kernel/Documentation/DocBook/media/dvb/ca.xml | 4 +- kernel/Documentation/DocBook/media/dvb/demux.xml | 61 +- kernel/Documentation/DocBook/media/dvb/dvbapi.xml | 35 +- .../DocBook/media/dvb/dvbproperty.xml | 1117 ++++++---- .../Documentation/DocBook/media/dvb/examples.xml | 6 +- .../media/dvb/fe-diseqc-recv-slave-reply.xml | 78 + .../DocBook/media/dvb/fe-diseqc-reset-overload.xml | 51 + .../DocBook/media/dvb/fe-diseqc-send-burst.xml | 89 + .../media/dvb/fe-diseqc-send-master-cmd.xml | 72 + .../media/dvb/fe-enable-high-lnb-voltage.xml | 61 + .../DocBook/media/dvb/fe-get-info.xml | 266 +++ .../DocBook/media/dvb/fe-get-property.xml | 81 + .../DocBook/media/dvb/fe-read-status.xml | 107 + .../media/dvb/fe-set-frontend-tune-mode.xml | 64 + .../DocBook/media/dvb/fe-set-tone.xml | 91 + .../DocBook/media/dvb/fe-set-voltage.xml | 69 + .../Documentation/DocBook/media/dvb/frontend.xml | 1747 ++------------- .../DocBook/media/dvb/frontend_legacy_api.xml | 654 ++++++ kernel/Documentation/DocBook/media/dvb/intro.xml | 33 +- kernel/Documentation/DocBook/media/dvb/kdapi.xml | 2309 -------------------- kernel/Documentation/DocBook/media/dvb/net.xml | 374 ++-- kernel/Documentation/DocBook/media/dvb/video.xml | 10 +- .../DocBook/media/typical_media_device.svg | 28 + kernel/Documentation/DocBook/media/v4l/biblio.xml | 18 + kernel/Documentation/DocBook/media/v4l/compat.xml | 20 + .../Documentation/DocBook/media/v4l/controls.xml | 20 +- kernel/Documentation/DocBook/media/v4l/dev-sdr.xml | 32 +- kernel/Documentation/DocBook/media/v4l/io.xml | 36 +- .../DocBook/media/v4l/media-func-open.xml | 2 +- .../DocBook/media/v4l/media-ioc-device-info.xml | 2 +- .../DocBook/media/v4l/pixfmt-y16-be.xml | 81 + kernel/Documentation/DocBook/media/v4l/pixfmt.xml | 245 ++- .../DocBook/media/v4l/remote_controllers.xml | 2 +- .../DocBook/media/v4l/subdev-formats.xml | 12 +- .../media/v4l/subdev-image-processing-crop.svg | 63 + .../media/v4l/subdev-image-processing-full.svg | 163 ++ ...ubdev-image-processing-scaling-multi-source.svg | 116 + kernel/Documentation/DocBook/media/v4l/v4l2.xml | 13 +- .../DocBook/media/v4l/vidioc-create-bufs.xml | 3 +- .../DocBook/media/v4l/vidioc-decoder-cmd.xml | 12 +- .../DocBook/media/v4l/vidioc-dqevent.xml | 5 +- .../DocBook/media/v4l/vidioc-encoder-cmd.xml | 10 +- .../media/v4l/vidioc-enum-frameintervals.xml | 3 +- .../DocBook/media/v4l/vidioc-enum-framesizes.xml | 3 +- .../DocBook/media/v4l/vidioc-expbuf.xml | 41 +- .../DocBook/media/v4l/vidioc-g-dv-timings.xml | 4 +- .../DocBook/media/v4l/vidioc-g-edid.xml | 11 +- .../DocBook/media/v4l/vidioc-g-ext-ctrls.xml | 7 + .../DocBook/media/v4l/vidioc-g-fmt.xml | 2 +- .../DocBook/media/v4l/vidioc-g-modulator.xml | 14 +- .../DocBook/media/v4l/vidioc-g-parm.xml | 2 +- .../DocBook/media/v4l/vidioc-g-selection.xml | 2 +- .../DocBook/media/v4l/vidioc-g-tuner.xml | 16 + .../DocBook/media/v4l/vidioc-qbuf.xml | 10 + .../DocBook/media/v4l/vidioc-query-dv-timings.xml | 3 +- .../DocBook/media/v4l/vidioc-querybuf.xml | 3 +- .../DocBook/media/v4l/vidioc-querycap.xml | 6 + .../DocBook/media/v4l/vidioc-queryctrl.xml | 23 +- .../DocBook/media/v4l/vidioc-reqbufs.xml | 4 +- .../DocBook/media/v4l/vidioc-subscribe-event.xml | 3 +- 63 files changed, 3983 insertions(+), 4532 deletions(-) create mode 100644 kernel/Documentation/DocBook/media/.gitignore create mode 100644 kernel/Documentation/DocBook/media/dvb/fe-diseqc-recv-slave-reply.xml create mode 100644 kernel/Documentation/DocBook/media/dvb/fe-diseqc-reset-overload.xml create mode 100644 kernel/Documentation/DocBook/media/dvb/fe-diseqc-send-burst.xml create mode 100644 kernel/Documentation/DocBook/media/dvb/fe-diseqc-send-master-cmd.xml create mode 100644 kernel/Documentation/DocBook/media/dvb/fe-enable-high-lnb-voltage.xml create mode 100644 kernel/Documentation/DocBook/media/dvb/fe-get-info.xml create mode 100644 kernel/Documentation/DocBook/media/dvb/fe-get-property.xml create mode 100644 kernel/Documentation/DocBook/media/dvb/fe-read-status.xml create mode 100644 kernel/Documentation/DocBook/media/dvb/fe-set-frontend-tune-mode.xml create mode 100644 kernel/Documentation/DocBook/media/dvb/fe-set-tone.xml create mode 100644 kernel/Documentation/DocBook/media/dvb/fe-set-voltage.xml create mode 100644 kernel/Documentation/DocBook/media/dvb/frontend_legacy_api.xml delete mode 100644 kernel/Documentation/DocBook/media/dvb/kdapi.xml create mode 100644 kernel/Documentation/DocBook/media/typical_media_device.svg create mode 100644 kernel/Documentation/DocBook/media/v4l/pixfmt-y16-be.xml create mode 100644 kernel/Documentation/DocBook/media/v4l/subdev-image-processing-crop.svg create mode 100644 kernel/Documentation/DocBook/media/v4l/subdev-image-processing-full.svg create mode 100644 kernel/Documentation/DocBook/media/v4l/subdev-image-processing-scaling-multi-source.svg (limited to 'kernel/Documentation/DocBook/media') diff --git a/kernel/Documentation/DocBook/media/.gitignore b/kernel/Documentation/DocBook/media/.gitignore new file mode 100644 index 000000000..e461c585f --- /dev/null +++ b/kernel/Documentation/DocBook/media/.gitignore @@ -0,0 +1 @@ +!*.svg diff --git a/kernel/Documentation/DocBook/media/Makefile b/kernel/Documentation/DocBook/media/Makefile index 8bf7c6191..08527e7ea 100644 --- a/kernel/Documentation/DocBook/media/Makefile +++ b/kernel/Documentation/DocBook/media/Makefile @@ -65,29 +65,31 @@ IOCTLS = \ $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/dvb/video.h) \ $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/media.h) \ $(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/v4l2-subdev.h) \ - VIDIOC_SUBDEV_G_FRAME_INTERVAL \ - VIDIOC_SUBDEV_S_FRAME_INTERVAL \ - VIDIOC_SUBDEV_ENUM_MBUS_CODE \ - VIDIOC_SUBDEV_ENUM_FRAME_SIZE \ - VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL \ - VIDIOC_SUBDEV_G_SELECTION \ - VIDIOC_SUBDEV_S_SELECTION \ + +DEFINES = \ + $(shell perl -ne 'print "$$1 " if /\#define\s+(DTV_[^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/frontend.h) \ TYPES = \ - $(shell perl -ne 'print "$$1 " if /^typedef\s+[^\s]+\s+([^\s]+)\;/' $(srctree)/include/uapi/linux/videodev2.h) \ - $(shell perl -ne 'print "$$1 " if /^}\s+([a-z0-9_]+_t)/' $(srctree)/include/uapi/linux/dvb/frontend.h) + $(shell perl -ne 'print "$$1 " if /^typedef\s+.*\s+(\S+)\;/' $(srctree)/include/uapi/linux/videodev2.h) \ + $(shell perl -ne 'print "$$1 " if /^typedef\s+.*\s+(\S+)\;/' $(srctree)/include/uapi/linux/dvb/frontend.h) ENUMS = \ - $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/videodev2.h) \ - $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/audio.h) \ - $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/ca.h) \ - $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/dmx.h) \ - $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/frontend.h) \ - $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/net.h) \ - $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/video.h) \ - $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/media.h) \ - $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-mediabus.h) \ - $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-subdev.h) + $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' \ + $(srctree)/include/uapi/linux/videodev2.h \ + $(srctree)/include/uapi/linux/dvb/audio.h \ + $(srctree)/include/uapi/linux/dvb/ca.h \ + $(srctree)/include/uapi/linux/dvb/dmx.h \ + $(srctree)/include/uapi/linux/dvb/frontend.h \ + $(srctree)/include/uapi/linux/dvb/net.h \ + $(srctree)/include/uapi/linux/dvb/video.h \ + $(srctree)/include/uapi/linux/media.h \ + $(srctree)/include/uapi/linux/v4l2-mediabus.h \ + $(srctree)/include/uapi/linux/v4l2-subdev.h) + +ENUM_DEFS = \ + $(shell perl -e 'open IN,"cat @ARGV| cpp -fpreprocessed |"; while () { if ($$enum) {print "$$1\n" if (/\s*([A-Z]\S+)\b/); } $$enum = 0 if ($$enum && /^\}/); $$enum = 1 if(/^\s*enum\s/); }; close IN;' \ + $(srctree)/include/uapi/linux/dvb/dmx.h \ + $(srctree)/include/uapi/linux/dvb/frontend.h) STRUCTS = \ $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/videodev2.h) \ @@ -95,7 +97,7 @@ STRUCTS = \ $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/ca.h) \ $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/dmx.h) \ $(shell perl -ne 'print "$$1 " if (!/dtv\_cmds\_h/ && /^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/frontend.h) \ - $(shell perl -ne 'print "$$1 " if (/^struct\s+([A-Z][^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/net.h) \ + $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/ && !/_old/)' $(srctree)/include/uapi/linux/dvb/net.h) \ $(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/video.h) \ $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/media.h) \ $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-subdev.h) \ @@ -179,7 +181,6 @@ DOCUMENTED = \ -e "s/v4l2\-mpeg\-vbi\-ITV0/v4l2-mpeg-vbi-itv0-1/g" DVB_DOCUMENTED = \ - -e "s/\(linkend\=\"\)FE_SET_PROPERTY/\1FE_GET_PROPERTY/g" \ -e "s,\(struct\s\+\)\([a-z0-9_]\+\)\(\s\+{\),\1\\2\<\/link\>\3,g" \ -e "s,\(}\s\+\)\([a-z0-9_]\+_t\+\),\1\\2\<\/link\>,g" \ -e "s,\(define\s\+\)\(DTV_[A-Z0-9_]\+\)\(\s\+[0-9]\+\),\1\\2\<\/link\>\3,g" \ @@ -188,14 +189,18 @@ DVB_DOCUMENTED = \ -e "s,\(audio-mixer\|audio-karaoke\|audio-status\|ca-slot-info\|ca-descr-info\|ca-caps\|ca-msg\|ca-descr\|ca-pid\|dmx-filter\|dmx-caps\|video-system\|video-highlight\|video-spu\|video-spu-palette\|video-navi-pack\)-t,\1,g" \ -e "s,DTV-ISDBT-LAYER[A-C],DTV-ISDBT-LAYER,g" \ -e "s,\(define\s\+\)\([A-Z0-9_]\+\)\(\s\+_IO\),\1\\2\<\/link\>\3,g" \ + -e "s,\(define\s\+\)\(DTV_[A-Z0-9_]\+\)\(\s\+\),\1\\2\<\/link\>\3,g" \ -e "s,\(__.*_OLD\)<\/link>,\1,g" \ + -e "s/\(linkend\=\"\)FE_SET_PROPERTY/\1FE_GET_PROPERTY/g" \ + -e "s,\(DTV_ISDBS_TS_ID_LEGACY\|DTV_MAX_COMMAND\|DTV_IOCTL_MAX_MSGS\)<\/link>,\1,g" \ # # Media targets and dependencies # install_media_images = \ - $(Q)-cp $(OBJIMGFILES) $(MEDIA_SRC_DIR)/v4l/*.svg $(MEDIA_OBJ_DIR)/media_api + $(Q)-mkdir $(MEDIA_OBJ_DIR)/media_api; \ + cp $(OBJIMGFILES) $(MEDIA_SRC_DIR)/*.svg $(MEDIA_SRC_DIR)/v4l/*.svg $(MEDIA_OBJ_DIR)/media_api $(MEDIA_OBJ_DIR)/%: $(MEDIA_SRC_DIR)/%.b64 $(Q)base64 -d $< >$@ @@ -243,9 +248,14 @@ $(MEDIA_OBJ_DIR)/dmx.h.xml: $(srctree)/include/uapi/linux/dvb/dmx.h $(MEDIA_OBJ_ @( \ echo "") > $@ @( \ + for ident in $(ENUM_DEFS) ; do \ + entity=`echo $$ident | tr _ -` ; \ + r="$$r s/([^\w\-])$$ident([^\w\-])/\1\&$$entity\;\2/g;";\ + done; \ expand --tabs=8 < $< | \ sed $(ESCAPE) $(DVB_DOCUMENTED) | \ - sed 's/i\.e\./&ie;/') >> $@ + sed 's/i\.e\./&ie;/' | \ + perl -ne "$$r print $$_;") >> $@ @( \ echo "") >> $@ @@ -254,9 +264,14 @@ $(MEDIA_OBJ_DIR)/frontend.h.xml: $(srctree)/include/uapi/linux/dvb/frontend.h $( @( \ echo "") > $@ @( \ + for ident in $(ENUM_DEFS) ; do \ + entity=`echo $$ident | tr _ -` ; \ + r="$$r s/([^\w\-])$$ident([^\w\-])/\1\&$$entity\;\2/g;";\ + done; \ expand --tabs=8 < $< | \ sed $(ESCAPE) $(DVB_DOCUMENTED) | \ - sed 's/i\.e\./&ie;/') >> $@ + sed 's/i\.e\./&ie;/' | \ + perl -ne "$$r print $$_;") >> $@ @( \ echo "") >> $@ @@ -298,11 +313,22 @@ $(MEDIA_OBJ_DIR)/media-entities.tmpl: $(MEDIA_OBJ_DIR)/v4l2.xml @( \ echo -e "\n") >>$@ @( \ - for ident in $(IOCTLS) ; do \ + for ident in `echo $(IOCTLS) | sed -e "s,VIDIOC_RESERVED,,"`; do\ entity=`echo $$ident | tr _ -` ; \ - id=`grep "$$ident" $(MEDIA_OBJ_DIR)/vidioc-*.xml $(MEDIA_OBJ_DIR)/media-ioc-*.xml | sed -r s,"^.*/(.*).xml.*","\1",` ; \ - echo "$$ident" -e "
$$ident\">" \ + >>$@ ; else \ + echo "Warning: undocumented ioctl: $$ident. Please document it at the media DocBook!" >&2; \ + fi; \ + done) + @( \ + echo -e "\n") >>$@ + @( \ + for ident in $(DEFINES) ; do \ + entity=`echo $$ident | tr _ -` ; \ + echo "$$ident\">" \ >>$@ ; \ done) @( \ @@ -322,6 +348,15 @@ $(MEDIA_OBJ_DIR)/media-entities.tmpl: $(MEDIA_OBJ_DIR)/v4l2.xml "linkend='$$entity'>$$ident\">" >>$@ ; \ done) @( \ + echo -e "\n") >>$@ + @( \ + for ident in $(ENUM_DEFS) ; do \ + entity=`echo $$ident | tr _ -` ; \ + echo "$$ident\">" \ + >>$@ ; \ + done) + @( \ echo -e "\n") >>$@ @( \ for ident in $(STRUCTS) ; do \ diff --git a/kernel/Documentation/DocBook/media/dvb/audio.xml b/kernel/Documentation/DocBook/media/dvb/audio.xml index a7ea56c71..ea56743dd 100644 --- a/kernel/Documentation/DocBook/media/dvb/audio.xml +++ b/kernel/Documentation/DocBook/media/dvb/audio.xml @@ -1,7 +1,7 @@ DVB Audio Device The DVB audio device controls the MPEG2 audio decoder of the DVB hardware. It -can be accessed through /dev/dvb/adapter0/audio0. Data types and and -ioctl definitions can be accessed by including linux/dvb/audio.h in your +can be accessed through /dev/dvb/adapter?/audio?. Data types and and +ioctl definitions can be accessed by including linux/dvb/audio.h in your application. Please note that some DVB cards don’t have their own MPEG decoder, which results in @@ -32,7 +32,7 @@ typedef enum { AUDIO_SOURCE_DEMUX selects the demultiplexer (fed either by the frontend or the DVR device) as the source of the video stream. If AUDIO_SOURCE_MEMORY -is selected the stream comes from the application through the write() system +is selected the stream comes from the application through the write() system call. diff --git a/kernel/Documentation/DocBook/media/dvb/ca.xml b/kernel/Documentation/DocBook/media/dvb/ca.xml index 85eaf4fe2..d0b07e763 100644 --- a/kernel/Documentation/DocBook/media/dvb/ca.xml +++ b/kernel/Documentation/DocBook/media/dvb/ca.xml @@ -1,7 +1,7 @@ DVB CA Device The DVB CA device controls the conditional access hardware. It can be accessed through -/dev/dvb/adapter0/ca0. Data types and and ioctl definitions can be accessed by -including linux/dvb/ca.h in your application. +/dev/dvb/adapter?/ca?. Data types and and ioctl definitions can be accessed by +including linux/dvb/ca.h in your application.
diff --git a/kernel/Documentation/DocBook/media/dvb/demux.xml b/kernel/Documentation/DocBook/media/dvb/demux.xml index c8683d66f..34f2fb1cd 100644 --- a/kernel/Documentation/DocBook/media/dvb/demux.xml +++ b/kernel/Documentation/DocBook/media/dvb/demux.xml @@ -1,33 +1,50 @@ DVB Demux Device The DVB demux device controls the filters of the DVB hardware/software. It can be -accessed through /dev/adapter0/demux0. Data types and and ioctl definitions can be -accessed by including linux/dvb/dmx.h in your application. +accessed through /dev/adapter?/demux?. Data types and and ioctl definitions can be +accessed by including linux/dvb/dmx.h in your application.
Demux Data Types
-dmx_output_t - -typedef enum -{ - DMX_OUT_DECODER, /⋆ Streaming directly to decoder. ⋆/ - DMX_OUT_TAP, /⋆ Output going to a memory buffer ⋆/ - /⋆ (to be retrieved via the read command).⋆/ - DMX_OUT_TS_TAP, /⋆ Output multiplexed into a new TS ⋆/ - /⋆ (to be retrieved by reading from the ⋆/ - /⋆ logical DVR device). ⋆/ - DMX_OUT_TSDEMUX_TAP /⋆ Like TS_TAP but retrieved from the DMX device ⋆/ -} dmx_output_t; - -DMX_OUT_TAP delivers the stream output to the demux device on which the ioctl is -called. - -DMX_OUT_TS_TAP routes output to the logical DVR device /dev/dvb/adapter0/dvr0, -which delivers a TS multiplexed from all filters for which DMX_OUT_TS_TAP was -specified. - +Output for the demux + + + enum dmx_output + + &cs-def; + + + ID + Description + + + + + DMX_OUT_DECODER + Streaming directly to decoder. + + DMX_OUT_TAP + Output going to a memory buffer (to be retrieved via the + read command). Delivers the stream output to the demux + device on which the ioctl is called. + + DMX_OUT_TS_TAP + Output multiplexed into a new TS (to be retrieved by + reading from the logical DVR device). Routes output to the + logical DVR device /dev/dvb/adapter?/dvr?, + which delivers a TS multiplexed from all filters for which + DMX_OUT_TS_TAP was specified. + + DMX_OUT_TSDEMUX_TAP + Like &DMX-OUT-TS-TAP; but retrieved from the DMX + device. + + + +
+
diff --git a/kernel/Documentation/DocBook/media/dvb/dvbapi.xml b/kernel/Documentation/DocBook/media/dvb/dvbapi.xml index 4c15396c6..8576481e2 100644 --- a/kernel/Documentation/DocBook/media/dvb/dvbapi.xml +++ b/kernel/Documentation/DocBook/media/dvb/dvbapi.xml @@ -28,12 +28,22 @@ Convergence GmbH - 2009-2014 + 2009-2015 Mauro Carvalho Chehab + + 2.1.0 + 2015-05-29 + mcc + + DocBook improvements and cleanups, in order to document the + system calls on a more standard way and provide more description + about the current DVB API. + + 2.0.4 2011-05-06 @@ -95,20 +105,25 @@ Added ISDB-T test originally written by Patrick Boettcher &sub-demux; - - &sub-video; - - - &sub-audio; - &sub-ca; - + &sub-net; - - &sub-kdapi; + + DVB Deprecated APIs + The APIs described here are kept only for historical reasons. There's + just one driver for a very legacy hardware that uses this API. No + modern drivers should use it. Instead, audio and video should be using + the V4L2 and ALSA APIs, and the pipelines should be set using the + Media Controller API +
+ &sub-video; +
+
+ &sub-audio; +
&sub-examples; diff --git a/kernel/Documentation/DocBook/media/dvb/dvbproperty.xml b/kernel/Documentation/DocBook/media/dvb/dvbproperty.xml index 3018564dd..08227d4e9 100644 --- a/kernel/Documentation/DocBook/media/dvb/dvbproperty.xml +++ b/kernel/Documentation/DocBook/media/dvb/dvbproperty.xml @@ -1,14 +1,88 @@ -
-<constant>FE_GET_PROPERTY/FE_SET_PROPERTY</constant> -This section describes the DVB version 5 extension of the DVB-API, also -called "S2API", as this API were added to provide support for DVB-S2. It was -designed to be able to replace the old frontend API. Yet, the DISEQC and -the capability ioctls weren't implemented yet via the new way. -The typical usage for the FE_GET_PROPERTY/FE_SET_PROPERTY -API is to replace the ioctl's were the -struct dvb_frontend_parameters were used. +
+DVB Frontend properties +Tuning into a Digital TV physical channel and starting decoding it + requires changing a set of parameters, in order to control the + tuner, the demodulator, the Linear Low-noise Amplifier (LNA) and to set the + antenna subsystem via Satellite Equipment Control (SEC), on satellite + systems. The actual parameters are specific to each particular digital + TV standards, and may change as the digital TV specs evolves. +In the past, the strategy used was to have a union with the parameters + needed to tune for DVB-S, DVB-C, DVB-T and ATSC delivery systems grouped + there. The problem is that, as the second generation standards appeared, + those structs were not big enough to contain the additional parameters. + Also, the union didn't have any space left to be expanded without breaking + userspace. So, the decision was to deprecate the legacy union/struct based + approach, in favor of a properties set approach. + +NOTE: on Linux DVB API version 3, setting a frontend were done via + struct dvb_frontend_parameters. + This got replaced on version 5 (also called "S2API", as this API were + added originally_enabled to provide support for DVB-S2), because the old + API has a very limited support to new standards and new hardware. This + section describes the new and recommended way to set the frontend, with + suppports all digital TV delivery systems. + +Example: with the properties based approach, in order to set the tuner + to a DVB-C channel at 651 kHz, modulated with 256-QAM, FEC 3/4 and symbol + rate of 5.217 Mbauds, those properties should be sent to + FE_SET_PROPERTY ioctl: + + &DTV-DELIVERY-SYSTEM; = SYS_DVBC_ANNEX_A + &DTV-FREQUENCY; = 651000000 + &DTV-MODULATION; = QAM_256 + &DTV-INVERSION; = INVERSION_AUTO + &DTV-SYMBOL-RATE; = 5217000 + &DTV-INNER-FEC; = FEC_3_4 + &DTV-TUNE; + + +The code that would do the above is: + +#include <stdio.h> +#include <fcntl.h> +#include <sys/ioctl.h> +#include <linux/dvb/frontend.h> + +static struct dtv_property props[] = { + { .cmd = DTV_DELIVERY_SYSTEM, .u.data = SYS_DVBC_ANNEX_A }, + { .cmd = DTV_FREQUENCY, .u.data = 651000000 }, + { .cmd = DTV_MODULATION, .u.data = QAM_256 }, + { .cmd = DTV_INVERSION, .u.data = INVERSION_AUTO }, + { .cmd = DTV_SYMBOL_RATE, .u.data = 5217000 }, + { .cmd = DTV_INNER_FEC, .u.data = FEC_3_4 }, + { .cmd = DTV_TUNE } +}; + +static struct dtv_properties dtv_prop = { + .num = 6, .props = props +}; + +int main(void) +{ + int fd = open("/dev/dvb/adapter0/frontend0", O_RDWR); + + if (!fd) { + perror ("open"); + return -1; + } + if (ioctl(fd, FE_SET_PROPERTY, &dtv_prop) == -1) { + perror("ioctl"); + return -1; + } + printf("Frontend set\n"); + return 0; +} + + +NOTE: While it is possible to directly call the Kernel code like the + above example, it is strongly recommended to use + libdvbv5, + as it provides abstraction to work with the supported digital TV standards + and provides methods for usual operations like program scanning and to + read/write channel descriptor files. +
-DTV stats type +struct <structname>dtv_stats</structname> struct dtv_stats { __u8 scale; /* enum fecap_scale_params type */ @@ -20,19 +94,19 @@ struct dtv_stats {
-DTV stats type +struct <structname>dtv_fe_stats</structname> #define MAX_DTV_STATS 4 struct dtv_fe_stats { __u8 len; - struct dtv_stats stat[MAX_DTV_STATS]; + &dtv-stats; stat[MAX_DTV_STATS]; } __packed;
-DTV property type +struct <structname>dtv_property</structname> /* Reserved fields should be set to 0 */ @@ -41,7 +115,7 @@ struct dtv_property { __u32 reserved[3]; union { __u32 data; - struct dtv_fe_stats st; + &dtv-fe-stats; st; struct { __u8 data[32]; __u32 len; @@ -57,115 +131,19 @@ struct dtv_property {
-DTV properties type +struct <structname>dtv_properties</structname> struct dtv_properties { __u32 num; - struct dtv_property *props; + &dtv-property; *props; };
-
-FE_GET_PROPERTY -DESCRIPTION - - -This ioctl call returns one or more frontend properties. This call only - requires read-only access to the device. - - -SYNOPSIS - - -int ioctl(int fd, int request = FE_GET_PROPERTY, - dtv_properties ⋆props); - - -PARAMETERS - - -int fd - -File descriptor returned by a previous call to open(). - - -int num - -Equals FE_GET_PROPERTY for this command. - - -struct dtv_property *props - -Points to the location where the front-end property commands are stored. - - -&return-value-dvb; - - EOPNOTSUPP - Property type not supported. - -
- -
-FE_SET_PROPERTY -DESCRIPTION - - -This ioctl call sets one or more frontend properties. This call - requires read/write access to the device. - - -SYNOPSIS - - -int ioctl(int fd, int request = FE_SET_PROPERTY, - dtv_properties ⋆props); - - -PARAMETERS - - -int fd - -File descriptor returned by a previous call to open(). - - -int num - -Equals FE_SET_PROPERTY for this command. - - -struct dtv_property *props - -Points to the location where the front-end property commands are stored. - - -&return-value-dvb; - - EOPNOTSUPP - Property type not supported. - -
-
Property types -On FE_GET_PROPERTY/FE_SET_PROPERTY, +On FE_GET_PROPERTY and FE_SET_PROPERTY, the actual action is determined by the dtv_property cmd/data pairs. With one single ioctl, is possible to get/set up to 64 properties. The actual meaning of each property is described on the next sections. @@ -193,7 +171,7 @@ get/set up to 64 properties. The actual meaning of each property is described on Central frequency of the channel. Notes: - 1)For satellital delivery systems, it is measured in kHz. + 1)For satellite delivery systems, it is measured in kHz. For the other ones, it is measured in Hz. 2)For ISDB-T, the channels are usually transmitted with an offset of 143kHz. E.g. a valid frequency could be 474143 kHz. The stepping is bound to the bandwidth of @@ -205,25 +183,78 @@ get/set up to 64 properties. The actual meaning of each property is described on
<constant>DTV_MODULATION</constant> -Specifies the frontend modulation type for cable and satellite types. The modulation can be one of the types bellow: - - typedef enum fe_modulation { - QPSK, - QAM_16, - QAM_32, - QAM_64, - QAM_128, - QAM_256, - QAM_AUTO, - VSB_8, - VSB_16, - PSK_8, - APSK_16, - APSK_32, - DQPSK, - QAM_4_NR, - } fe_modulation_t; - +Specifies the frontend modulation type for delivery systems that supports + more than one modulation type. The modulation can be one of the types + defined by &fe-modulation;. + + +
+Modulation property + +Most of the digital TV standards currently offers more than one possible + modulation (sometimes called as "constellation" on some standards). This + enum contains the values used by the Kernel. Please note that not all + modulations are supported by a given standard. + + + enum fe_modulation + + &cs-def; + + + ID + Description + + + + + QPSK + QPSK modulation + + QAM_16 + 16-QAM modulation + + QAM_32 + 32-QAM modulation + + QAM_64 + 64-QAM modulation + + QAM_128 + 128-QAM modulation + + QAM_256 + 256-QAM modulation + + QAM_AUTO + Autodetect QAM modulation + + VSB_8 + 8-VSB modulation + + VSB_16 + 16-VSB modulation + + PSK_8 + 8-PSK modulation + + APSK_16 + 16-APSK modulation + + APSK_32 + 32-APSK modulation + + DQPSK + DQPSK modulation + + QAM_4_NR + 4-QAM-NR modulation + + + +
+
+
<constant>DTV_BANDWIDTH_HZ</constant> @@ -253,19 +284,45 @@ get/set up to 64 properties. The actual meaning of each property is described on
<constant>DTV_INVERSION</constant> - The Inversion field can take one of these values: - - - typedef enum fe_spectral_inversion { - INVERSION_OFF, - INVERSION_ON, - INVERSION_AUTO - } fe_spectral_inversion_t; - - It indicates if spectral inversion should be presumed or not. In the automatic setting - (INVERSION_AUTO) the hardware will try to figure out the correct setting by - itself. - + + Specifies if the frontend should do spectral inversion or not. + +
+enum fe_modulation: Frontend spectral inversion + +This parameter indicates if spectral inversion should be presumed or not. + In the automatic setting (INVERSION_AUTO) the hardware + will try to figure out the correct setting by itself. If the hardware + doesn't support, the DVB core will try to lock at the carrier first with + inversion off. If it fails, it will try to enable inversion. + + + + enum fe_modulation + + &cs-def; + + + ID + Description + + + + + INVERSION_OFF + Don't do spectral band inversion. + + INVERSION_ON + Do spectral band inversion. + + INVERSION_AUTO + Autodetect spectral band inversion. + + + +
+
+
<constant>DTV_DISEQC_MASTER</constant> @@ -279,25 +336,64 @@ get/set up to 64 properties. The actual meaning of each property is described on <constant>DTV_INNER_FEC</constant> Used cable/satellite transmissions. The acceptable values are: - -typedef enum fe_code_rate { - FEC_NONE = 0, - FEC_1_2, - FEC_2_3, - FEC_3_4, - FEC_4_5, - FEC_5_6, - FEC_6_7, - FEC_7_8, - FEC_8_9, - FEC_AUTO, - FEC_3_5, - FEC_9_10, - FEC_2_5, -} fe_code_rate_t; - - which correspond to error correction rates of 1/2, 2/3, etc., - no error correction or auto detection. +
+enum fe_code_rate: type of the Forward Error Correction. + + + enum fe_code_rate + + &cs-def; + + + ID + Description + + + + + FEC_NONE + No Forward Error Correction Code + + FEC_AUTO + Autodetect Error Correction Code + + FEC_1_2 + Forward Error Correction Code 1/2 + + FEC_2_3 + Forward Error Correction Code 2/3 + + FEC_3_4 + Forward Error Correction Code 3/4 + + FEC_4_5 + Forward Error Correction Code 4/5 + + FEC_5_6 + Forward Error Correction Code 5/6 + + FEC_6_7 + Forward Error Correction Code 6/7 + + FEC_7_8 + Forward Error Correction Code 7/8 + + FEC_8_9 + Forward Error Correction Code 8/9 + + FEC_9_10 + Forward Error Correction Code 9/10 + + FEC_2_5 + Forward Error Correction Code 2/5 + + FEC_3_5 + Forward Error Correction Code 3/5 + + + +
+
<constant>DTV_VOLTAGE</constant> @@ -305,12 +401,31 @@ typedef enum fe_code_rate { the polarzation (horizontal/vertical). When using DiSEqC epuipment this voltage has to be switched consistently to the DiSEqC commands as described in the DiSEqC spec. - - typedef enum fe_sec_voltage { - SEC_VOLTAGE_13, - SEC_VOLTAGE_18 - } fe_sec_voltage_t; - + + + enum fe_sec_voltage + + &cs-def; + + + ID + Description + + + + + SEC_VOLTAGE_13 + Set DC voltage level to 13V + + SEC_VOLTAGE_18 + Set DC voltage level to 18V + + SEC_VOLTAGE_OFF + Don't send any voltage to the antenna + + + +
<constant>DTV_TONE</constant> @@ -321,13 +436,30 @@ typedef enum fe_code_rate { Sets DVB-S2 pilot
fe_pilot type - -typedef enum fe_pilot { - PILOT_ON, - PILOT_OFF, - PILOT_AUTO, -} fe_pilot_t; - + + enum fe_pilot + + &cs-def; + + + ID + Description + + + + + PILOT_ON + Pilot tones enabled + + PILOT_OFF + Pilot tones disabled + + PILOT_AUTO + Autodetect pilot tones + + + +
@@ -336,14 +468,33 @@ typedef enum fe_pilot {
fe_rolloff type - -typedef enum fe_rolloff { - ROLLOFF_35, /* Implied value in DVB-S, default for DVB-S2 */ - ROLLOFF_20, - ROLLOFF_25, - ROLLOFF_AUTO, -} fe_rolloff_t; - + + enum fe_rolloff + + &cs-def; + + + ID + Description + + + + + ROLLOFF_35 + Roloff factor: α=35% + + ROLLOFF_20 + Roloff factor: α=20% + + ROLLOFF_25 + Roloff factor: α=25% + + ROLLOFF_AUTO + Auto-detect the roloff factor. + + + +
@@ -364,31 +515,82 @@ typedef enum fe_rolloff {
fe_delivery_system type Possible values: - -typedef enum fe_delivery_system { - SYS_UNDEFINED, - SYS_DVBC_ANNEX_A, - SYS_DVBC_ANNEX_B, - SYS_DVBT, - SYS_DSS, - SYS_DVBS, - SYS_DVBS2, - SYS_DVBH, - SYS_ISDBT, - SYS_ISDBS, - SYS_ISDBC, - SYS_ATSC, - SYS_ATSCMH, - SYS_DTMB, - SYS_CMMB, - SYS_DAB, - SYS_DVBT2, - SYS_TURBO, - SYS_DVBC_ANNEX_C, -} fe_delivery_system_t; - -
+ + enum fe_delivery_system + + &cs-def; + + + ID + Description + + + + + SYS_UNDEFINED + Undefined standard. Generally, indicates an error + + SYS_DVBC_ANNEX_A + Cable TV: DVB-C following ITU-T J.83 Annex A spec + + SYS_DVBC_ANNEX_B + Cable TV: DVB-C following ITU-T J.83 Annex B spec (ClearQAM) + + SYS_DVBC_ANNEX_C + Cable TV: DVB-C following ITU-T J.83 Annex C spec + + SYS_ISDBC + Cable TV: ISDB-C (no drivers yet) + + SYS_DVBT + Terrestral TV: DVB-T + + SYS_DVBT2 + Terrestral TV: DVB-T2 + + SYS_ISDBT + Terrestral TV: ISDB-T + + SYS_ATSC + Terrestral TV: ATSC + + SYS_ATSCMH + Terrestral TV (mobile): ATSC-M/H + + SYS_DTMB + Terrestrial TV: DTMB + + SYS_DVBS + Satellite TV: DVB-S + + SYS_DVBS2 + Satellite TV: DVB-S2 + + SYS_TURBO + Satellite TV: DVB-S Turbo + + SYS_ISDBS + Satellite TV: ISDB-S + + SYS_DAB + Digital audio: DAB (not fully supported) + + SYS_DSS + Satellite TV:"DSS (not fully supported) + + SYS_CMMB + Terrestral TV (mobile):CMMB (not fully supported) + + SYS_DVBH + Terrestral TV (mobile): DVB-H (standard deprecated) + + + +
+ + +
<constant>DTV_ISDBT_PARTIAL_RECEPTION</constant> @@ -630,114 +832,177 @@ typedef enum fe_delivery_system {
<constant>DTV_ATSCMH_RS_FRAME_MODE</constant> - RS frame mode. + Reed Solomon (RS) frame mode. Possible values are: - - -typedef enum atscmh_rs_frame_mode { - ATSCMH_RSFRAME_PRI_ONLY = 0, - ATSCMH_RSFRAME_PRI_SEC = 1, -} atscmh_rs_frame_mode_t; - - + + enum atscmh_rs_frame_mode + + &cs-def; + + + ID + Description + + + + + ATSCMH_RSFRAME_PRI_ONLY + Single Frame: There is only a primary RS Frame for all + Group Regions. + + ATSCMH_RSFRAME_PRI_SEC + Dual Frame: There are two separate RS Frames: Primary RS + Frame for Group Region A and B and Secondary RS Frame for Group + Region C and D. + + + +
<constant>DTV_ATSCMH_RS_FRAME_ENSEMBLE</constant> - RS frame ensemble. + Reed Solomon(RS) frame ensemble. Possible values are: - - -typedef enum atscmh_rs_frame_ensemble { - ATSCMH_RSFRAME_ENS_PRI = 0, - ATSCMH_RSFRAME_ENS_SEC = 1, -} atscmh_rs_frame_ensemble_t; - - + + enum atscmh_rs_frame_ensemble + + &cs-def; + + + ID + Description + + + + + ATSCMH_RSFRAME_ENS_PRI + Primary Ensemble. + + AATSCMH_RSFRAME_PRI_SEC + Secondary Ensemble. + + AATSCMH_RSFRAME_RES + Reserved. Shouldn't be used. + + + +
<constant>DTV_ATSCMH_RS_CODE_MODE_PRI</constant> - RS code mode (primary). + Reed Solomon (RS) code mode (primary). Possible values are: - - -typedef enum atscmh_rs_code_mode { - ATSCMH_RSCODE_211_187 = 0, - ATSCMH_RSCODE_223_187 = 1, - ATSCMH_RSCODE_235_187 = 2, -} atscmh_rs_code_mode_t; - - + + enum atscmh_rs_code_mode + + &cs-def; + + + ID + Description + + + + + ATSCMH_RSCODE_211_187 + Reed Solomon code (211,187). + + ATSCMH_RSCODE_223_187 + Reed Solomon code (223,187). + + ATSCMH_RSCODE_235_187 + Reed Solomon code (235,187). + + ATSCMH_RSCODE_RES + Reserved. Shouldn't be used. + + + +
<constant>DTV_ATSCMH_RS_CODE_MODE_SEC</constant> - RS code mode (secondary). - Possible values are: - -typedef enum atscmh_rs_code_mode { - ATSCMH_RSCODE_211_187 = 0, - ATSCMH_RSCODE_223_187 = 1, - ATSCMH_RSCODE_235_187 = 2, -} atscmh_rs_code_mode_t; - + Reed Solomon (RS) code mode (secondary). + Possible values are the same as documented on + &atscmh-rs-code-mode;:
<constant>DTV_ATSCMH_SCCC_BLOCK_MODE</constant> Series Concatenated Convolutional Code Block Mode. Possible values are: - - -typedef enum atscmh_sccc_block_mode { - ATSCMH_SCCC_BLK_SEP = 0, - ATSCMH_SCCC_BLK_COMB = 1, -} atscmh_sccc_block_mode_t; - - + + enum atscmh_scc_block_mode + + &cs-def; + + + ID + Description + + + + + ATSCMH_SCCC_BLK_SEP + Separate SCCC: the SCCC outer code mode shall be set independently + for each Group Region (A, B, C, D) + + ATSCMH_SCCC_BLK_COMB + Combined SCCC: all four Regions shall have the same SCCC outer + code mode. + + ATSCMH_SCCC_BLK_RES + Reserved. Shouldn't be used. + + + +
<constant>DTV_ATSCMH_SCCC_CODE_MODE_A</constant> Series Concatenated Convolutional Code Rate. Possible values are: - - -typedef enum atscmh_sccc_code_mode { - ATSCMH_SCCC_CODE_HLF = 0, - ATSCMH_SCCC_CODE_QTR = 1, -} atscmh_sccc_code_mode_t; - - + + enum atscmh_sccc_code_mode + + &cs-def; + + + ID + Description + + + + + ATSCMH_SCCC_CODE_HLF + The outer code rate of a SCCC Block is 1/2 rate. + + ATSCMH_SCCC_CODE_QTR + The outer code rate of a SCCC Block is 1/4 rate. + + ATSCMH_SCCC_CODE_RES + to be documented. + + + +
<constant>DTV_ATSCMH_SCCC_CODE_MODE_B</constant> Series Concatenated Convolutional Code Rate. - Possible values are: - -typedef enum atscmh_sccc_code_mode { - ATSCMH_SCCC_CODE_HLF = 0, - ATSCMH_SCCC_CODE_QTR = 1, -} atscmh_sccc_code_mode_t; - + Possible values are the same as documented on + &atscmh-sccc-code-mode;.
<constant>DTV_ATSCMH_SCCC_CODE_MODE_C</constant> Series Concatenated Convolutional Code Rate. - Possible values are: - -typedef enum atscmh_sccc_code_mode { - ATSCMH_SCCC_CODE_HLF = 0, - ATSCMH_SCCC_CODE_QTR = 1, -} atscmh_sccc_code_mode_t; - + Possible values are the same as documented on + &atscmh-sccc-code-mode;.
<constant>DTV_ATSCMH_SCCC_CODE_MODE_D</constant> Series Concatenated Convolutional Code Rate. - Possible values are: - -typedef enum atscmh_sccc_code_mode { - ATSCMH_SCCC_CODE_HLF = 0, - ATSCMH_SCCC_CODE_QTR = 1, -} atscmh_sccc_code_mode_t; - + Possible values are the same as documented on + &atscmh-sccc-code-mode;.
@@ -746,65 +1011,74 @@ typedef enum atscmh_sccc_code_mode {
<constant>DTV_CODE_RATE_HP</constant> - Used on terrestrial transmissions. The acceptable values are: + Used on terrestrial transmissions. The acceptable values are + the ones described at &fe-transmit-mode-t;. - -typedef enum fe_code_rate { - FEC_NONE = 0, - FEC_1_2, - FEC_2_3, - FEC_3_4, - FEC_4_5, - FEC_5_6, - FEC_6_7, - FEC_7_8, - FEC_8_9, - FEC_AUTO, - FEC_3_5, - FEC_9_10, -} fe_code_rate_t; -
<constant>DTV_CODE_RATE_LP</constant> - Used on terrestrial transmissions. The acceptable values are: + Used on terrestrial transmissions. The acceptable values are + the ones described at &fe-transmit-mode-t;. - -typedef enum fe_code_rate { - FEC_NONE = 0, - FEC_1_2, - FEC_2_3, - FEC_3_4, - FEC_4_5, - FEC_5_6, - FEC_6_7, - FEC_7_8, - FEC_8_9, - FEC_AUTO, - FEC_3_5, - FEC_9_10, -} fe_code_rate_t; - +
+
<constant>DTV_GUARD_INTERVAL</constant> Possible values are: - -typedef enum fe_guard_interval { - GUARD_INTERVAL_1_32, - GUARD_INTERVAL_1_16, - GUARD_INTERVAL_1_8, - GUARD_INTERVAL_1_4, - GUARD_INTERVAL_AUTO, - GUARD_INTERVAL_1_128, - GUARD_INTERVAL_19_128, - GUARD_INTERVAL_19_256, - GUARD_INTERVAL_PN420, - GUARD_INTERVAL_PN595, - GUARD_INTERVAL_PN945, -} fe_guard_interval_t; - + +
+Modulation guard interval + + + enum fe_guard_interval + + &cs-def; + + + ID + Description + + + + + GUARD_INTERVAL_AUTO + Autodetect the guard interval + + GUARD_INTERVAL_1_128 + Guard interval 1/128 + + GUARD_INTERVAL_1_32 + Guard interval 1/32 + + GUARD_INTERVAL_1_16 + Guard interval 1/16 + + GUARD_INTERVAL_1_8 + Guard interval 1/8 + + GUARD_INTERVAL_1_4 + Guard interval 1/4 + + GUARD_INTERVAL_19_128 + Guard interval 19/128 + + GUARD_INTERVAL_19_256 + Guard interval 19/256 + + GUARD_INTERVAL_PN420 + PN length 420 (1/4) + + GUARD_INTERVAL_PN595 + PN length 595 (1/6) + + GUARD_INTERVAL_PN945 + PN length 945 (1/9) + + + +
Notes: 1) If DTV_GUARD_INTERVAL is set the GUARD_INTERVAL_AUTO the hardware will @@ -812,26 +1086,64 @@ typedef enum fe_guard_interval { in the missing parameters. 2) Intervals 1/128, 19/128 and 19/256 are used only for DVB-T2 at present 3) DTMB specifies PN420, PN595 and PN945. +
<constant>DTV_TRANSMISSION_MODE</constant> - Specifies the number of carriers used by the standard + Specifies the number of carriers used by the standard. + This is used only on OFTM-based standards, e. g. + DVB-T/T2, ISDB-T, DTMB + +
+enum fe_transmit_mode: Number of carriers per channel + + + enum fe_transmit_mode + + &cs-def; + + + ID + Description + + + + + TRANSMISSION_MODE_AUTO + Autodetect transmission mode. The hardware will try to find + the correct FFT-size (if capable) to fill in the missing + parameters. + + TRANSMISSION_MODE_1K + Transmission mode 1K + + TRANSMISSION_MODE_2K + Transmission mode 2K + + TRANSMISSION_MODE_8K + Transmission mode 8K + + TRANSMISSION_MODE_4K + Transmission mode 4K + + TRANSMISSION_MODE_16K + Transmission mode 16K + + TRANSMISSION_MODE_32K + Transmission mode 32K + + TRANSMISSION_MODE_C1 + Single Carrier (C=1) transmission mode (DTMB) + + TRANSMISSION_MODE_C3780 + Multi Carrier (C=3780) transmission mode (DTMB) + + + +
+ - Possible values are: - -typedef enum fe_transmit_mode { - TRANSMISSION_MODE_2K, - TRANSMISSION_MODE_8K, - TRANSMISSION_MODE_AUTO, - TRANSMISSION_MODE_4K, - TRANSMISSION_MODE_1K, - TRANSMISSION_MODE_16K, - TRANSMISSION_MODE_32K, - TRANSMISSION_MODE_C1, - TRANSMISSION_MODE_C3780, -} fe_transmit_mode_t; - Notes: 1) ISDB-T supports three carrier/symbol-size: 8K, 4K, 2K. It is called 'mode' in the standard: Mode 1 is 2K, mode 2 is 4K, mode 3 is 8K @@ -842,19 +1154,48 @@ typedef enum fe_transmit_mode { 3) DVB-T specifies 2K and 8K as valid sizes. 4) DVB-T2 specifies 1K, 2K, 4K, 8K, 16K and 32K. 5) DTMB specifies C1 and C3780. +
<constant>DTV_HIERARCHY</constant> Frontend hierarchy - -typedef enum fe_hierarchy { - HIERARCHY_NONE, - HIERARCHY_1, - HIERARCHY_2, - HIERARCHY_4, - HIERARCHY_AUTO - } fe_hierarchy_t; - + + +
+Frontend hierarchy + + + enum fe_hierarchy + + &cs-def; + + + ID + Description + + + + + HIERARCHY_NONE + No hierarchy + + HIERARCHY_AUTO + Autodetect hierarchy (if supported) + + HIERARCHY_1 + Hierarchy 1 + + HIERARCHY_2 + Hierarchy 2 + + HIERARCHY_4 + Hierarchy 4 + + + +
+
+
<constant>DTV_STREAM_ID</constant> @@ -891,15 +1232,37 @@ typedef enum fe_hierarchy {
<constant>DTV_INTERLEAVING</constant> - Interleaving mode - -enum fe_interleaving { - INTERLEAVING_NONE, - INTERLEAVING_AUTO, - INTERLEAVING_240, - INTERLEAVING_720, -}; - + +Time interleaving to be used. Currently, used only on DTMB. + + + enum fe_interleaving + + &cs-def; + + + ID + Description + + + + + INTERLEAVING_NONE + No interleaving. + + INTERLEAVING_AUTO + Auto-detect interleaving. + + INTERLEAVING_240 + Interleaving of 240 symbols. + + INTERLEAVING_720 + Interleaving of 720 symbols. + + + +
+
<constant>DTV_LNA</constant> @@ -921,7 +1284,7 @@ enum fe_interleaving { For most delivery systems, dtv_property.stat.len will be 1 if the stats is supported, and the properties will return a single value for each parameter. - It should be noticed, however, that new OFDM delivery systems + It should be noted, however, that new OFDM delivery systems like ISDB can use different modulation types for each group of carriers. On such standards, up to 3 groups of statistics can be provided, and dtv_property.stat.len is updated @@ -940,10 +1303,10 @@ enum fe_interleaving { and uvalue is for unsigned values (counters, relative scale) scale - Scale for the value. It can be: - FE_SCALE_NOT_AVAILABLE - The parameter is supported by the frontend, but it was not possible to collect it (could be a transitory or permanent condition) - FE_SCALE_DECIBEL - parameter is a signed value, measured in 1/1000 dB - FE_SCALE_RELATIVE - parameter is a unsigned value, where 0 means 0% and 65535 means 100%. - FE_SCALE_COUNTER - parameter is a unsigned value that counts the occurrence of an event, like bit error, block error, or lapsed time. + FE_SCALE_NOT_AVAILABLE - The parameter is supported by the frontend, but it was not possible to collect it (could be a transitory or permanent condition) + FE_SCALE_DECIBEL - parameter is a signed value, measured in 1/1000 dB + FE_SCALE_RELATIVE - parameter is a unsigned value, where 0 means 0% and 65535 means 100%. + FE_SCALE_COUNTER - parameter is a unsigned value that counts the occurrence of an event, like bit error, block error, or lapsed time. @@ -953,7 +1316,7 @@ enum fe_interleaving { Possible scales for this metric are: FE_SCALE_NOT_AVAILABLE - it failed to measure it, or the measurement was not complete yet. - FE_SCALE_DECIBEL - signal strength is in 0.0001 dBm units, power measured in miliwatts. This value is generally negative. + FE_SCALE_DECIBEL - signal strength is in 0.001 dBm units, power measured in miliwatts. This value is generally negative. FE_SCALE_RELATIVE - The frontend provides a 0% to 100% measurement for power (actually, 0 to 65535).
@@ -963,7 +1326,7 @@ enum fe_interleaving { Possible scales for this metric are: FE_SCALE_NOT_AVAILABLE - it failed to measure it, or the measurement was not complete yet. - FE_SCALE_DECIBEL - Signal/Noise ratio is in 0.0001 dB units. + FE_SCALE_DECIBEL - Signal/Noise ratio is in 0.001 dB units. FE_SCALE_RELATIVE - The frontend provides a 0% to 100% measurement for Signal/Noise (actually, 0 to 65535).
@@ -985,7 +1348,7 @@ enum fe_interleaving { <constant>DTV_STAT_PRE_TOTAL_BIT_COUNT</constant> Measures the amount of bits received before the inner code block, during the same period as DTV_STAT_PRE_ERROR_BIT_COUNT measurement was taken. - It should be noticed that this measurement can be smaller than the total amount of bits on the transport stream, + It should be noted that this measurement can be smaller than the total amount of bits on the transport stream, as the frontend may need to manually restart the measurement, losing some data between each measurement interval. This measurement is monotonically increased, as the frontend gets more bit count measurements. The frontend may reset it when a channel/transponder is tuned. @@ -1014,7 +1377,7 @@ enum fe_interleaving { <constant>DTV_STAT_POST_TOTAL_BIT_COUNT</constant> Measures the amount of bits received after the inner coding, during the same period as DTV_STAT_POST_ERROR_BIT_COUNT measurement was taken. - It should be noticed that this measurement can be smaller than the total amount of bits on the transport stream, + It should be noted that this measurement can be smaller than the total amount of bits on the transport stream, as the frontend may need to manually restart the measurement, losing some data between each measurement interval. This measurement is monotonically increased, as the frontend gets more bit count measurements. The frontend may reset it when a channel/transponder is tuned. @@ -1255,8 +1618,8 @@ enum fe_interleaving { In addition, the DTV QoS statistics are also valid.
-
- Properties used on satellital delivery systems +
+ Properties used on satellite delivery systems
DVB-S delivery system The following parameters are valid for DVB-S: diff --git a/kernel/Documentation/DocBook/media/dvb/examples.xml b/kernel/Documentation/DocBook/media/dvb/examples.xml index f037e568e..c9f68c718 100644 --- a/kernel/Documentation/DocBook/media/dvb/examples.xml +++ b/kernel/Documentation/DocBook/media/dvb/examples.xml @@ -1,8 +1,10 @@ Examples In this section we would like to present some examples for using the DVB API. -Maintainer note: This section is out of date. Please refer to the sample programs packaged -with the driver distribution from . +NOTE: This section is out of date, and the code below won't even + compile. Please refer to the + libdvbv5 + for updated/recommended examples.
diff --git a/kernel/Documentation/DocBook/media/dvb/fe-diseqc-recv-slave-reply.xml b/kernel/Documentation/DocBook/media/dvb/fe-diseqc-recv-slave-reply.xml new file mode 100644 index 000000000..4595dbfff --- /dev/null +++ b/kernel/Documentation/DocBook/media/dvb/fe-diseqc-recv-slave-reply.xml @@ -0,0 +1,78 @@ + + + ioctl FE_DISEQC_RECV_SLAVE_REPLY + &manvol; + + + + FE_DISEQC_RECV_SLAVE_REPLY + Receives reply from a DiSEqC 2.0 command + + + + + + int ioctl + int fd + int request + struct dvb_diseqc_slave_reply *argp + + + + + + Arguments + + + fd + + &fe_fd; + + + + request + + FE_DISEQC_RECV_SLAVE_REPLY + + + + argp + + pointer to &dvb-diseqc-slave-reply; + + + + + + + Description + + Receives reply from a DiSEqC 2.0 command. +&return-value-dvb; + + + struct <structname>dvb_diseqc_slave_reply</structname> + + &cs-str; + + + uint8_t + msg[4] + DiSEqC message (framing, data[3]) + + uint8_t + msg_len + Length of the DiSEqC message. Valid values are 0 to 4, + where 0 means no msg + + int + timeout + Return from ioctl after timeout ms with errorcode when no + message was received + + + +
+ +
+
diff --git a/kernel/Documentation/DocBook/media/dvb/fe-diseqc-reset-overload.xml b/kernel/Documentation/DocBook/media/dvb/fe-diseqc-reset-overload.xml new file mode 100644 index 000000000..c104df77e --- /dev/null +++ b/kernel/Documentation/DocBook/media/dvb/fe-diseqc-reset-overload.xml @@ -0,0 +1,51 @@ + + + ioctl FE_DISEQC_RESET_OVERLOAD + &manvol; + + + + FE_DISEQC_RESET_OVERLOAD + Restores the power to the antenna subsystem, if it was powered + off due to power overload. + + + + + + int ioctl + int fd + int request + NULL + + + + + + Arguments + + + fd + + &fe_fd; + + + + request + + FE_DISEQC_RESET_OVERLOAD + + + + + + + Description + + If the bus has been automatically powered off due to power overload, this ioctl + call restores the power to the bus. The call requires read/write access to the + device. This call has no effect if the device is manually powered off. Not all + DVB adapters support this ioctl. +&return-value-dvb; + + diff --git a/kernel/Documentation/DocBook/media/dvb/fe-diseqc-send-burst.xml b/kernel/Documentation/DocBook/media/dvb/fe-diseqc-send-burst.xml new file mode 100644 index 000000000..9f6a68f32 --- /dev/null +++ b/kernel/Documentation/DocBook/media/dvb/fe-diseqc-send-burst.xml @@ -0,0 +1,89 @@ + + + ioctl FE_DISEQC_SEND_BURST + &manvol; + + + + FE_DISEQC_SEND_BURST + Sends a 22KHz tone burst for 2x1 mini DiSEqC satellite selection. + + + + + + int ioctl + int fd + int request + enum fe_sec_mini_cmd *tone + + + + + + Arguments + + + fd + + &fe_fd; + + + + request + + FE_DISEQC_SEND_BURST + + + + tone + + pointer to &fe-sec-mini-cmd; + + + + + + + Description + +This ioctl is used to set the generation of a 22kHz tone burst for mini + DiSEqC satellite + selection for 2x1 switches. + This call requires read/write permissions. +It provides support for what's specified at + Digital Satellite Equipment Control + (DiSEqC) - Simple "ToneBurst" Detection Circuit specification. + +&return-value-dvb; + + + +enum fe_sec_mini_cmd + + + enum fe_sec_mini_cmd + + &cs-def; + + + ID + Description + + + + + SEC_MINI_A + Sends a mini-DiSEqC 22kHz '0' Tone Burst to + select satellite-A + + SEC_MINI_B + Sends a mini-DiSEqC 22kHz '1' Data Burst to + select satellite-B + + + +
+
+ +
diff --git a/kernel/Documentation/DocBook/media/dvb/fe-diseqc-send-master-cmd.xml b/kernel/Documentation/DocBook/media/dvb/fe-diseqc-send-master-cmd.xml new file mode 100644 index 000000000..38cf313e1 --- /dev/null +++ b/kernel/Documentation/DocBook/media/dvb/fe-diseqc-send-master-cmd.xml @@ -0,0 +1,72 @@ + + + ioctl FE_DISEQC_SEND_MASTER_CMD + &manvol; + + + + FE_DISEQC_SEND_MASTER_CMD + Sends a DiSEqC command + + + + + + int ioctl + int fd + int request + struct dvb_diseqc_master_cmd *argp + + + + + + Arguments + + + fd + + &fe_fd; + + + + request + + FE_DISEQC_SEND_MASTER_CMD + + + + argp + + pointer to &dvb-diseqc-master-cmd; + + + + + + + Description + + Sends a DiSEqC command to the antenna subsystem. +&return-value-dvb; + + + struct <structname>dvb_diseqc_master_cmd</structname> + + &cs-str; + + + uint8_t + msg[6] + DiSEqC message (framing, address, command, data[3]) + + uint8_t + msg_len + Length of the DiSEqC message. Valid values are 3 to 6 + + + +
+ +
+
diff --git a/kernel/Documentation/DocBook/media/dvb/fe-enable-high-lnb-voltage.xml b/kernel/Documentation/DocBook/media/dvb/fe-enable-high-lnb-voltage.xml new file mode 100644 index 000000000..c11890b18 --- /dev/null +++ b/kernel/Documentation/DocBook/media/dvb/fe-enable-high-lnb-voltage.xml @@ -0,0 +1,61 @@ + + + ioctl FE_ENABLE_HIGH_LNB_VOLTAGE + &manvol; + + + + FE_ENABLE_HIGH_LNB_VOLTAGE + Select output DC level between normal LNBf voltages or higher + LNBf voltages. + + + + + + int ioctl + int fd + int request + unsigned int high + + + + + + Arguments + + + fd + + &fe_fd; + + + + request + + FE_ENABLE_HIGH_LNB_VOLTAGE + + + + high + + Valid flags: + + 0 - normal 13V and 18V. + >0 - enables slightly higher voltages instead of + 13/18V, in order to compensate for long antenna cables. + + + + + + + + Description + + Select output DC level between normal LNBf voltages or higher + LNBf voltages between 0 (normal) or a value grater than 0 for higher + voltages. +&return-value-dvb; + + diff --git a/kernel/Documentation/DocBook/media/dvb/fe-get-info.xml b/kernel/Documentation/DocBook/media/dvb/fe-get-info.xml new file mode 100644 index 000000000..ed0eeb29d --- /dev/null +++ b/kernel/Documentation/DocBook/media/dvb/fe-get-info.xml @@ -0,0 +1,266 @@ + + + ioctl FE_GET_INFO + &manvol; + + + + FE_GET_INFO + Query DVB frontend capabilities and returns information about + the front-end. This call only requires read-only access to the device + + + + + + int ioctl + int fd + int request + struct dvb_frontend_info *argp + + + + + + Arguments + + + fd + + &fe_fd; + + + + request + + FE_GET_INFO + + + + argp + + pointer to struct &dvb-frontend-info; + + + + + + + Description + + All DVB frontend devices support the +FE_GET_INFO ioctl. It is used to identify +kernel devices compatible with this specification and to obtain +information about driver and hardware capabilities. The ioctl takes a +pointer to dvb_frontend_info which is filled by the driver. When the +driver is not compatible with this specification the ioctl returns an error. + +&return-value-dvb; + + + struct <structname>dvb_frontend_info</structname> + + &cs-str; + + + char + name[128] + Name of the frontend + + fe_type_t + type + DEPRECATED. DVBv3 type. Should not be used on modern programs, as a + frontend may have more than one type. So, the DVBv5 API should + be used instead to enumerate and select the frontend type. + + uint32_t + frequency_min + Minimal frequency supported by the frontend + + uint32_t + frequency_max + Maximal frequency supported by the frontend + + uint32_t + frequency_stepsize + Frequency step - all frequencies are multiple of this value + + uint32_t + frequency_tolerance + Tolerance of the frequency + + uint32_t + symbol_rate_min + Minimal symbol rate (for Cable/Satellite systems), in bauds + + uint32_t + symbol_rate_max + Maximal symbol rate (for Cable/Satellite systems), in bauds + + uint32_t + symbol_rate_tolerance + Maximal symbol rate tolerance, in ppm + + uint32_t + notifier_delay + DEPRECATED. Not used by any driver. + + &fe-caps; + caps + Capabilities supported by the frontend + + + +
+ + NOTE: The frequencies are specified in Hz for Terrestrial and Cable + systems. They're specified in kHz for Satellite systems +
+ + +frontend capabilities + +Capabilities describe what a frontend can do. Some capabilities are + supported only on some specific frontend types. + + + enum fe_caps + + &cs-def; + + + ID + Description + + + + + FE_IS_STUPID + There's something wrong at the frontend, and it can't + report its capabilities + + + FE_CAN_INVERSION_AUTO + The frontend is capable of auto-detecting inversion + + + FE_CAN_FEC_1_2 + The frontend supports FEC 1/2 + + + FE_CAN_FEC_2_3 + The frontend supports FEC 2/3 + + + FE_CAN_FEC_3_4 + The frontend supports FEC 3/4 + + + FE_CAN_FEC_4_5 + The frontend supports FEC 4/5 + + + FE_CAN_FEC_5_6 + The frontend supports FEC 5/6 + + + FE_CAN_FEC_6_7 + The frontend supports FEC 6/7 + + + FE_CAN_FEC_7_8 + The frontend supports FEC 7/8 + + + FE_CAN_FEC_8_9 + The frontend supports FEC 8/9 + + + FE_CAN_FEC_AUTO + The frontend can autodetect FEC. + + + FE_CAN_QPSK + The frontend supports QPSK modulation + + + FE_CAN_QAM_16 + The frontend supports 16-QAM modulation + + + FE_CAN_QAM_32 + The frontend supports 32-QAM modulation + + + FE_CAN_QAM_64 + The frontend supports 64-QAM modulation + + + FE_CAN_QAM_128 + The frontend supports 128-QAM modulation + + + FE_CAN_QAM_256 + The frontend supports 256-QAM modulation + + + FE_CAN_QAM_AUTO + The frontend can autodetect modulation + + + FE_CAN_TRANSMISSION_MODE_AUTO + The frontend can autodetect the transmission mode + + + FE_CAN_BANDWIDTH_AUTO + The frontend can autodetect the bandwidth + + + FE_CAN_GUARD_INTERVAL_AUTO + The frontend can autodetect the guard interval + + + FE_CAN_HIERARCHY_AUTO + The frontend can autodetect hierarch + + + FE_CAN_8VSB + The frontend supports 8-VSB modulation + + + FE_CAN_16VSB + The frontend supports 16-VSB modulation + + + FE_HAS_EXTENDED_CAPS + Currently, unused + + + FE_CAN_MULTISTREAM + The frontend supports multistream filtering + + + FE_CAN_TURBO_FEC + The frontend supports turbo FEC modulation + + + FE_CAN_2G_MODULATION + The frontend supports "2nd generation modulation" (DVB-S2/T2)> + + + FE_NEEDS_BENDING + Not supported anymore, don't use it + + + FE_CAN_RECOVER + The frontend can recover from a cable unplug automatically + + + FE_CAN_MUTE_TS + The frontend can stop spurious TS data output + + + +
+
+
diff --git a/kernel/Documentation/DocBook/media/dvb/fe-get-property.xml b/kernel/Documentation/DocBook/media/dvb/fe-get-property.xml new file mode 100644 index 000000000..53a170ed3 --- /dev/null +++ b/kernel/Documentation/DocBook/media/dvb/fe-get-property.xml @@ -0,0 +1,81 @@ + + + ioctl FE_SET_PROPERTY, FE_GET_PROPERTY + &manvol; + + + + FE_SET_PROPERTY + FE_GET_PROPERTY + FE_SET_PROPERTY sets one or more frontend properties. + FE_GET_PROPERTY returns one or more frontend properties. + + + + + + int ioctl + int fd + int request + struct dtv_properties *argp + + + + + + Arguments + + + fd + + &fe_fd; + + + + request + + FE_SET_PROPERTY, FE_GET_PROPERTY + + + + argp + + pointer to &dtv-properties; + + + + + + + Description + + All DVB frontend devices support the +FE_SET_PROPERTY and FE_GET_PROPERTY +ioctls. The supported properties and statistics depends on the delivery system +and on the device: + + + FE_SET_PROPERTY: + +This ioctl is used to set one or more + frontend properties. +This is the basic command to request the frontend to tune into some + frequency and to start decoding the digital TV signal. +This call requires read/write access to the device. +At return, the values are updated to reflect the + actual parameters used. + + + + FE_GET_PROPERTY: + +This ioctl is used to get properties and +statistics from the frontend. +No properties are changed, and statistics aren't reset. +This call only requires read-only access to the device. + + + +&return-value-dvb; + + diff --git a/kernel/Documentation/DocBook/media/dvb/fe-read-status.xml b/kernel/Documentation/DocBook/media/dvb/fe-read-status.xml new file mode 100644 index 000000000..bc0dc2a55 --- /dev/null +++ b/kernel/Documentation/DocBook/media/dvb/fe-read-status.xml @@ -0,0 +1,107 @@ + + + ioctl FE_READ_STATUS + &manvol; + + + + FE_READ_STATUS + Returns status information about the front-end. This call only + requires read-only access to the device + + + + + + int ioctl + int fd + int request + unsigned int *status + + + + + + Arguments + + + fd + + &fe_fd; + + + + request + + FE_READ_STATUS + + + + status + + pointer to a bitmask integer filled with the values defined by + &fe-status;. + + + + + + + Description + + All DVB frontend devices support the +FE_READ_STATUS ioctl. It is used to check about the +locking status of the frontend after being tuned. The ioctl takes a +pointer to an integer where the status will be written. + +NOTE: the size of status is actually sizeof(enum fe_status), with varies + according with the architecture. This needs to be fixed in the future. +&return-value-dvb; + + + +int fe_status + +The fe_status parameter is used to indicate the current state + and/or state changes of the frontend hardware. It is produced using + the &fe-status; values on a bitmask + + + enum fe_status + + &cs-def; + + + ID + Description + + + + + FE_HAS_SIGNAL + The frontend has found something above the noise level + + FE_HAS_CARRIER + The frontend has found a DVB signal + + FE_HAS_VITERBI + The frontend FEC inner coding (Viterbi, LDPC or other inner code) is stable + + FE_HAS_SYNC + Synchronization bytes was found + + FE_HAS_LOCK + The DVB were locked and everything is working + + FE_TIMEDOUT + no lock within the last about 2 seconds + + FE_REINIT + The frontend was reinitialized, application is + recommended to reset DiSEqC, tone and parameters + + + +
+
+
diff --git a/kernel/Documentation/DocBook/media/dvb/fe-set-frontend-tune-mode.xml b/kernel/Documentation/DocBook/media/dvb/fe-set-frontend-tune-mode.xml new file mode 100644 index 000000000..99fa8a015 --- /dev/null +++ b/kernel/Documentation/DocBook/media/dvb/fe-set-frontend-tune-mode.xml @@ -0,0 +1,64 @@ + + + ioctl FE_SET_FRONTEND_TUNE_MODE + &manvol; + + + + FE_SET_FRONTEND_TUNE_MODE + Allow setting tuner mode flags to the frontend. + + + + + + int ioctl + int fd + int request + unsigned int flags + + + + + + Arguments + + + fd + + &fe_fd; + + + + request + + FE_SET_FRONTEND_TUNE_MODE + + + + flags + + Valid flags: + + 0 - normal tune mode + FE_TUNE_MODE_ONESHOT - When set, this flag will + disable any zigzagging or other "normal" tuning behaviour. + Additionally, there will be no automatic monitoring of the + lock status, and hence no frontend events will be + generated. If a frontend device is closed, this flag will + be automatically turned off when the device is reopened + read-write. + + + + + + + + Description + + Allow setting tuner mode flags to the frontend, between 0 (normal) + or FE_TUNE_MODE_ONESHOT mode +&return-value-dvb; + + diff --git a/kernel/Documentation/DocBook/media/dvb/fe-set-tone.xml b/kernel/Documentation/DocBook/media/dvb/fe-set-tone.xml new file mode 100644 index 000000000..62d44e4cc --- /dev/null +++ b/kernel/Documentation/DocBook/media/dvb/fe-set-tone.xml @@ -0,0 +1,91 @@ + + + ioctl FE_SET_TONE + &manvol; + + + + FE_SET_TONE + Sets/resets the generation of the continuous 22kHz tone. + + + + + + int ioctl + int fd + int request + enum fe_sec_tone_mode *tone + + + + + + Arguments + + + fd + + &fe_fd; + + + + request + + FE_SET_TONE + + + + tone + + pointer to &fe-sec-tone-mode; + + + + + + + Description + +This ioctl is used to set the generation of the continuous 22kHz tone. + This call requires read/write permissions. +Usually, satellite antenna subsystems require that the digital TV + device to send a 22kHz tone in order to select between high/low band on + some dual-band LNBf. It is also used to send signals to DiSEqC equipment, + but this is done using the DiSEqC ioctls. +NOTE: if more than one device is connected to the same antenna, + setting a tone may interfere on other devices, as they may lose + the capability of selecting the band. So, it is recommended that + applications would change to SEC_TONE_OFF when the device is not used. + +&return-value-dvb; + + + +enum fe_sec_tone_mode + + + enum fe_sec_tone_mode + + &cs-def; + + + ID + Description + + + + + SEC_TONE_ON + Sends a 22kHz tone burst to the antenna + + SEC_TONE_OFF + Don't send a 22kHz tone to the antenna + (except if the FE_DISEQC_* ioctls are called) + + + +
+
+ +
diff --git a/kernel/Documentation/DocBook/media/dvb/fe-set-voltage.xml b/kernel/Documentation/DocBook/media/dvb/fe-set-voltage.xml new file mode 100644 index 000000000..c89a6f79b --- /dev/null +++ b/kernel/Documentation/DocBook/media/dvb/fe-set-voltage.xml @@ -0,0 +1,69 @@ + + + ioctl FE_SET_VOLTAGE + &manvol; + + + + FE_SET_VOLTAGE + Allow setting the DC level sent to the antenna subsystem. + + + + + + int ioctl + int fd + int request + enum fe_sec_voltage *voltage + + + + + + Arguments + + + fd + + &fe_fd; + + + + request + + FE_SET_VOLTAGE + + + + voltage + + pointer to &fe-sec-voltage; + Valid values are described at &fe-sec-voltage;. + + + + + + + Description + +This ioctl allows to set the DC voltage level sent through the antenna + cable to 13V, 18V or off. +Usually, a satellite antenna subsystems require that the digital TV + device to send a DC voltage to feed power to the LNBf. Depending on the + LNBf type, the polarization or the intermediate frequency (IF) of the LNBf + can controlled by the voltage level. Other devices (for example, the ones + that implement DISEqC and multipoint LNBf's don't need to control the + voltage level, provided that either 13V or 18V is sent to power up the + LNBf. +NOTE: if more than one device is connected to the same antenna, + setting a voltage level may interfere on other devices, as they may lose + the capability of setting polarization or IF. So, on those + cases, setting the voltage to SEC_VOLTAGE_OFF while the device is not is + used is recommended. + +&return-value-dvb; + + + diff --git a/kernel/Documentation/DocBook/media/dvb/frontend.xml b/kernel/Documentation/DocBook/media/dvb/frontend.xml index 8a6a6ff27..01210b33c 100644 --- a/kernel/Documentation/DocBook/media/dvb/frontend.xml +++ b/kernel/Documentation/DocBook/media/dvb/frontend.xml @@ -1,485 +1,112 @@ DVB Frontend API -The DVB frontend device controls the tuner and DVB demodulator -hardware. It can be accessed through /dev/dvb/adapter0/frontend0. Data types and and -ioctl definitions can be accessed by including linux/dvb/frontend.h in your application. - -DVB frontends come in three varieties: DVB-S (satellite), DVB-C -(cable) and DVB-T (terrestrial). Transmission via the internet (DVB-IP) -is not yet handled by this API but a future extension is possible. For -DVB-S the frontend device also supports satellite equipment control -(SEC) via DiSEqC and V-SEC protocols. The DiSEqC (digital SEC) -specification is available from +The DVB frontend API was designed to support three types of delivery systems: + + Terrestrial systems: DVB-T, DVB-T2, ATSC, ATSC M/H, ISDB-T, DVB-H, DTMB, CMMB + Cable systems: DVB-C Annex A/C, ClearQAM (DVB-C Annex B), ISDB-C + Satellite systems: DVB-S, DVB-S2, DVB Turbo, ISDB-S, DSS + +The DVB frontend controls several sub-devices including: + + Tuner + Digital TV demodulator + Low noise amplifier (LNA) + Satellite Equipment Control (SEC) hardware (only for Satellite). + +The frontend can be accessed through + /dev/dvb/adapter?/frontend?. Data types and + ioctl definitions can be accessed by including + linux/dvb/frontend.h in your application. + + +NOTE: Transmission via the internet (DVB-IP) + is not yet handled by this API but a future extension is possible. +On Satellite systems, the API support for the Satellite Equipment Control + (SEC) allows to power control and to send/receive signals to control the + antenna subsystem, selecting the polarization and choosing the Intermediate + Frequency IF) of the Low Noise Block Converter Feed Horn (LNBf). It + supports the DiSEqC and V-SEC protocols. The DiSEqC (digital SEC) +specification is available at Eutelsat. -Note that the DVB API may also be used for MPEG decoder-only PCI -cards, in which case there exists no frontend device. - -
-Frontend Data Types - -
-Frontend type - -For historical reasons, frontend types are named by the type of modulation used in -transmission. The fontend types are given by fe_type_t type, defined as: - - -Frontend types - - &cs-def; - - - fe_type - Description - DTV_DELIVERY_SYSTEM equivalent type - - - - - FE_QPSK - For DVB-S standard - SYS_DVBS - - - FE_QAM - For DVB-C annex A standard - SYS_DVBC_ANNEX_A - - - FE_OFDM - For DVB-T standard - SYS_DVBT - - - FE_ATSC - For ATSC standard (terrestrial) or for DVB-C Annex B (cable) used in US. - SYS_ATSC (terrestrial) or SYS_DVBC_ANNEX_B (cable) - -
- -Newer formats like DVB-S2, ISDB-T, ISDB-S and DVB-T2 are not described at the above, as they're -supported via the new FE_GET_PROPERTY/FE_GET_SET_PROPERTY ioctl's, using the DTV_DELIVERY_SYSTEM parameter. - - -The usage of this field is deprecated, as it doesn't report all supported standards, and -will provide an incomplete information for frontends that support multiple delivery systems. -Please use DTV_ENUM_DELSYS instead. -
- -
-frontend capabilities - -Capabilities describe what a frontend can do. Some capabilities can only be supported for -a specific frontend type. - - typedef enum fe_caps { - FE_IS_STUPID = 0, - FE_CAN_INVERSION_AUTO = 0x1, - FE_CAN_FEC_1_2 = 0x2, - FE_CAN_FEC_2_3 = 0x4, - FE_CAN_FEC_3_4 = 0x8, - FE_CAN_FEC_4_5 = 0x10, - FE_CAN_FEC_5_6 = 0x20, - FE_CAN_FEC_6_7 = 0x40, - FE_CAN_FEC_7_8 = 0x80, - FE_CAN_FEC_8_9 = 0x100, - FE_CAN_FEC_AUTO = 0x200, - FE_CAN_QPSK = 0x400, - FE_CAN_QAM_16 = 0x800, - FE_CAN_QAM_32 = 0x1000, - FE_CAN_QAM_64 = 0x2000, - FE_CAN_QAM_128 = 0x4000, - FE_CAN_QAM_256 = 0x8000, - FE_CAN_QAM_AUTO = 0x10000, - FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000, - FE_CAN_BANDWIDTH_AUTO = 0x40000, - FE_CAN_GUARD_INTERVAL_AUTO = 0x80000, - FE_CAN_HIERARCHY_AUTO = 0x100000, - FE_CAN_8VSB = 0x200000, - FE_CAN_16VSB = 0x400000, - FE_HAS_EXTENDED_CAPS = 0x800000, - FE_CAN_MULTISTREAM = 0x4000000, - FE_CAN_TURBO_FEC = 0x8000000, - FE_CAN_2G_MODULATION = 0x10000000, - FE_NEEDS_BENDING = 0x20000000, - FE_CAN_RECOVER = 0x40000000, - FE_CAN_MUTE_TS = 0x80000000 - } fe_caps_t; - -
- -
-frontend information - -Information about the frontend ca be queried with - FE_GET_INFO. - - - struct dvb_frontend_info { - char name[128]; - fe_type_t type; - uint32_t frequency_min; - uint32_t frequency_max; - uint32_t frequency_stepsize; - uint32_t frequency_tolerance; - uint32_t symbol_rate_min; - uint32_t symbol_rate_max; - uint32_t symbol_rate_tolerance; /⋆ ppm ⋆/ - uint32_t notifier_delay; /⋆ ms ⋆/ - fe_caps_t caps; - }; - -
- -
-diseqc master command - -A message sent from the frontend to DiSEqC capable equipment. - - struct dvb_diseqc_master_cmd { - uint8_t msg [6]; /⋆ { framing, address, command, data[3] } ⋆/ - uint8_t msg_len; /⋆ valid values are 3...6 ⋆/ - }; - -
-
-diseqc slave reply - -A reply to the frontend from DiSEqC 2.0 capable equipment. - - struct dvb_diseqc_slave_reply { - uint8_t msg [4]; /⋆ { framing, data [3] } ⋆/ - uint8_t msg_len; /⋆ valid values are 0...4, 0 means no msg ⋆/ - int timeout; /⋆ return from ioctl after timeout ms with ⋆/ - }; /⋆ errorcode when no message was received ⋆/ - -
- -
-diseqc slave reply -The voltage is usually used with non-DiSEqC capable LNBs to switch the polarzation -(horizontal/vertical). When using DiSEqC epuipment this voltage has to be switched -consistently to the DiSEqC commands as described in the DiSEqC spec. - - typedef enum fe_sec_voltage { - SEC_VOLTAGE_13, - SEC_VOLTAGE_18 - } fe_sec_voltage_t; - -
- -
-SEC continuous tone +
+Querying frontend information -The continuous 22KHz tone is usually used with non-DiSEqC capable LNBs to switch the -high/low band of a dual-band LNB. When using DiSEqC epuipment this voltage has to -be switched consistently to the DiSEqC commands as described in the DiSEqC -spec. - - typedef enum fe_sec_tone_mode { - SEC_TONE_ON, - SEC_TONE_OFF - } fe_sec_tone_mode_t; - +Usually, the first thing to do when the frontend is opened is to + check the frontend capabilities. This is done using FE_GET_INFO. This ioctl will enumerate + the DVB API version and other characteristics about the frontend, and + can be opened either in read only or read/write mode.
-
-SEC tone burst - -The 22KHz tone burst is usually used with non-DiSEqC capable switches to select -between two connected LNBs/satellites. When using DiSEqC epuipment this voltage has to -be switched consistently to the DiSEqC commands as described in the DiSEqC -spec. - - typedef enum fe_sec_mini_cmd { - SEC_MINI_A, - SEC_MINI_B - } fe_sec_mini_cmd_t; - - - -
- -
-frontend status -Several functions of the frontend device use the fe_status data type defined -by - -typedef enum fe_status { - FE_HAS_SIGNAL = 0x01, - FE_HAS_CARRIER = 0x02, - FE_HAS_VITERBI = 0x04, - FE_HAS_SYNC = 0x08, - FE_HAS_LOCK = 0x10, - FE_TIMEDOUT = 0x20, - FE_REINIT = 0x40, -} fe_status_t; - -to indicate the current state and/or state changes of the frontend hardware: - - - - -FE_HAS_SIGNAL -The frontend has found something above the noise level - -FE_HAS_CARRIER -The frontend has found a DVB signal - -FE_HAS_VITERBI -The frontend FEC inner coding (Viterbi, LDPC or other inner code) is stable - -FE_HAS_SYNC -Synchronization bytes was found - -FE_HAS_LOCK -The DVB were locked and everything is working - -FE_TIMEDOUT -no lock within the last about 2 seconds - -FE_REINIT -The frontend was reinitialized, application is -recommended to reset DiSEqC, tone and parameters - - +
+Querying frontend status and statistics +Once FE_SET_PROPERTY + is called, the frontend will run a kernel thread that will periodically + check for the tuner lock status and provide statistics about the quality + of the signal. +The information about the frontend tuner locking status can be queried + using FE_READ_STATUS. +Signal statistics are provided via FE_GET_PROPERTY. + Please note that several statistics require the demodulator to be fully + locked (e. g. with FE_HAS_LOCK bit set). See + Frontend statistics indicators + for more details.
-
-frontend parameters -The kind of parameters passed to the frontend device for tuning depend on -the kind of hardware you are using. -The struct dvb_frontend_parameters uses an -union with specific per-system parameters. However, as newer delivery systems -required more data, the structure size weren't enough to fit, and just -extending its size would break the existing applications. So, those parameters -were replaced by the usage of -FE_GET_PROPERTY/FE_SET_PROPERTY ioctl's. The -new API is flexible enough to add new parameters to existing delivery systems, -and to add newer delivery systems. -So, newer applications should use -FE_GET_PROPERTY/FE_SET_PROPERTY instead, in -order to be able to support the newer System Delivery like DVB-S2, DVB-T2, -DVB-C2, ISDB, etc. -All kinds of parameters are combined as an union in the FrontendParameters structure: - -struct dvb_frontend_parameters { - uint32_t frequency; /⋆ (absolute) frequency in Hz for QAM/OFDM ⋆/ - /⋆ intermediate frequency in kHz for QPSK ⋆/ - fe_spectral_inversion_t inversion; - union { - struct dvb_qpsk_parameters qpsk; - struct dvb_qam_parameters qam; - struct dvb_ofdm_parameters ofdm; - struct dvb_vsb_parameters vsb; - } u; -}; - -In the case of QPSK frontends the frequency field specifies the intermediate -frequency, i.e. the offset which is effectively added to the local oscillator frequency (LOF) of -the LNB. The intermediate frequency has to be specified in units of kHz. For QAM and -OFDM frontends the frequency specifies the absolute frequency and is given in Hz. - - -
-QPSK parameters -For satellite QPSK frontends you have to use the dvb_qpsk_parameters structure: - - struct dvb_qpsk_parameters { - uint32_t symbol_rate; /⋆ symbol rate in Symbols per second ⋆/ - fe_code_rate_t fec_inner; /⋆ forward error correction (see above) ⋆/ - }; - -
-
-QAM parameters -for cable QAM frontend you use the dvb_qam_parameters structure: - - struct dvb_qam_parameters { - uint32_t symbol_rate; /⋆ symbol rate in Symbols per second ⋆/ - fe_code_rate_t fec_inner; /⋆ forward error correction (see above) ⋆/ - fe_modulation_t modulation; /⋆ modulation type (see above) ⋆/ - }; - -
-
-VSB parameters -ATSC frontends are supported by the dvb_vsb_parameters structure: - -struct dvb_vsb_parameters { - fe_modulation_t modulation; /⋆ modulation type (see above) ⋆/ -}; - -
-
-OFDM parameters -DVB-T frontends are supported by the dvb_ofdm_parameters structure: - - struct dvb_ofdm_parameters { - fe_bandwidth_t bandwidth; - fe_code_rate_t code_rate_HP; /⋆ high priority stream code rate ⋆/ - fe_code_rate_t code_rate_LP; /⋆ low priority stream code rate ⋆/ - fe_modulation_t constellation; /⋆ modulation type (see above) ⋆/ - fe_transmit_mode_t transmission_mode; - fe_guard_interval_t guard_interval; - fe_hierarchy_t hierarchy_information; - }; - -
-
-frontend spectral inversion -The Inversion field can take one of these values: - - -typedef enum fe_spectral_inversion { - INVERSION_OFF, - INVERSION_ON, - INVERSION_AUTO -} fe_spectral_inversion_t; - -It indicates if spectral inversion should be presumed or not. In the automatic setting -(INVERSION_AUTO) the hardware will try to figure out the correct setting by -itself. - -
-
-frontend code rate -The possible values for the fec_inner field used on -struct dvb_qpsk_parameters and -struct dvb_qam_parameters are: - - -typedef enum fe_code_rate { - FEC_NONE = 0, - FEC_1_2, - FEC_2_3, - FEC_3_4, - FEC_4_5, - FEC_5_6, - FEC_6_7, - FEC_7_8, - FEC_8_9, - FEC_AUTO, - FEC_3_5, - FEC_9_10, -} fe_code_rate_t; - -which correspond to error correction rates of 1/2, 2/3, etc., no error correction or auto -detection. - -
-
-frontend modulation type for QAM, OFDM and VSB -For cable and terrestrial frontends, e. g. for -struct dvb_qpsk_parameters, -struct dvb_qam_parameters and -struct dvb_qam_parameters, -it needs to specify the quadrature modulation mode which can be one of the following: - - - typedef enum fe_modulation { - QPSK, - QAM_16, - QAM_32, - QAM_64, - QAM_128, - QAM_256, - QAM_AUTO, - VSB_8, - VSB_16, - PSK_8, - APSK_16, - APSK_32, - DQPSK, - } fe_modulation_t; - -
-
-More OFDM parameters -
-Number of carriers per channel - -typedef enum fe_transmit_mode { - TRANSMISSION_MODE_2K, - TRANSMISSION_MODE_8K, - TRANSMISSION_MODE_AUTO, - TRANSMISSION_MODE_4K, - TRANSMISSION_MODE_1K, - TRANSMISSION_MODE_16K, - TRANSMISSION_MODE_32K, - } fe_transmit_mode_t; - -
-
-frontend bandwidth - -typedef enum fe_bandwidth { - BANDWIDTH_8_MHZ, - BANDWIDTH_7_MHZ, - BANDWIDTH_6_MHZ, - BANDWIDTH_AUTO, - BANDWIDTH_5_MHZ, - BANDWIDTH_10_MHZ, - BANDWIDTH_1_712_MHZ, -} fe_bandwidth_t; - -
-
-frontend guard inverval - -typedef enum fe_guard_interval { - GUARD_INTERVAL_1_32, - GUARD_INTERVAL_1_16, - GUARD_INTERVAL_1_8, - GUARD_INTERVAL_1_4, - GUARD_INTERVAL_AUTO, - GUARD_INTERVAL_1_128, - GUARD_INTERVAL_19_128, - GUARD_INTERVAL_19_256, -} fe_guard_interval_t; - -
-
-frontend hierarchy - -typedef enum fe_hierarchy { - HIERARCHY_NONE, - HIERARCHY_1, - HIERARCHY_2, - HIERARCHY_4, - HIERARCHY_AUTO - } fe_hierarchy_t; - -
-
- -
- -
-frontend events - - struct dvb_frontend_event { - fe_status_t status; - struct dvb_frontend_parameters parameters; - }; - -
-
- +&sub-dvbproperty;
Frontend Function Calls -
-open() -DESCRIPTION - - -This system call opens a named frontend device (/dev/dvb/adapter0/frontend0) + + + DVB frontend 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 can either be + O_RDWR or O_RDONLY. + Multiple opens are allowed with O_RDONLY. In this mode, only query and read ioctls are allowed. + Only one open is allowed in O_RDWR. In this mode, all ioctls are allowed. + When the O_NONBLOCK flag is given, the system calls may return &EAGAIN; when no data is available or when the device driver is temporarily busy. + Other flags have no effect. + + + + + + Description + This system call opens a named frontend device (/dev/dvb/adapter?/frontend?) for subsequent use. Usually the first thing to do after a successful open is to find out the frontend type with FE_GET_INFO. The device can be opened in read-only mode, which only allows monitoring of @@ -497,1052 +124,146 @@ typedef enum fe_hierarchy { 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. - - -
- -
-close() -DESCRIPTION - - + + + + Return Value + + 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 the device driver 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. + + + + ENODEV + + The device got removed. + + + + + + + + + DVB frontend 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. - - -
- -
-FE_READ_STATUS -DESCRIPTION - - -This ioctl call returns status information about the front-end. This call only - requires read-only access to the device. - - -SYNOPSIS - - -int ioctl(int fd, int request = FE_READ_STATUS, - fe_status_t ⋆status); - - -PARAMETERS - - - -int fd - -File descriptor returned by a previous call to open(). - - -int request - -Equals FE_READ_STATUS for this command. - - -struct fe_status_t - *status - -Points to the location where the front-end status word is - to be stored. - - -RETURN VALUE - -EBADF - -fd is not a valid open file descriptor. - - -EFAULT - -status points to invalid address. - - -
- -
-FE_READ_BER -DESCRIPTION - - -This ioctl call returns the bit error rate for the signal currently - received/demodulated by the front-end. For this command, read-only access to - the device is sufficient. - - -SYNOPSIS - - -int ioctl(int fd, int request = FE_READ_BER, - uint32_t ⋆ber); - - -PARAMETERS - - -int fd - -File descriptor returned by a previous call to open(). - - -int request - -Equals FE_READ_BER for this command. - - -uint32_t *ber - -The bit error rate is stored into *ber. - - - -&return-value-dvb; -
- -
-FE_READ_SNR - -DESCRIPTION - - -This ioctl call returns the signal-to-noise ratio for the signal currently received - by the front-end. For this command, read-only access to the device is sufficient. - - -SYNOPSIS - - -int ioctl(int fd, int request = FE_READ_SNR, uint16_t - ⋆snr); - - -PARAMETERS - - -int fd - -File descriptor returned by a previous call to open(). - - -int request - -Equals FE_READ_SNR for this command. - - -uint16_t *snr - -The signal-to-noise ratio is stored into *snr. - - - -&return-value-dvb; -
- -
-FE_READ_SIGNAL_STRENGTH -DESCRIPTION - - -This ioctl call returns the signal strength value for the signal currently received - by the front-end. For this command, read-only access to the device is sufficient. - - -SYNOPSIS - - -int ioctl( int fd, int request = - FE_READ_SIGNAL_STRENGTH, uint16_t ⋆strength); - - - -PARAMETERS - - -int fd - -File descriptor returned by a previous call to open(). - - -int request - -Equals FE_READ_SIGNAL_STRENGTH for this - command. - - -uint16_t *strength - -The signal strength value is stored into *strength. - - - -&return-value-dvb; -
- -
-FE_READ_UNCORRECTED_BLOCKS -DESCRIPTION - - -This ioctl call returns the number of uncorrected blocks detected by the device - driver during its lifetime. For meaningful measurements, the increment in block - count during a specific time interval should be calculated. For this command, - read-only access to the device is sufficient. - - -Note that the counter will wrap to zero after its maximum count has been - reached. - - -SYNOPSIS - - -int ioctl( int fd, int request = - FE_READ_UNCORRECTED_BLOCKS, uint32_t ⋆ublocks); - - -PARAMETERS - - -int fd - -File descriptor returned by a previous call to open(). - - -int request - -Equals FE_READ_UNCORRECTED_BLOCKS for this - command. - - -uint32_t *ublocks - -The total number of uncorrected blocks seen by the driver - so far. - - - -&return-value-dvb; -
- -
-FE_SET_FRONTEND -DESCRIPTION - - -This ioctl call starts a tuning operation using specified parameters. The result - of this call will be successful if the parameters were valid and the tuning could - be initiated. The result of the tuning operation in itself, however, will arrive - asynchronously as an event (see documentation for FE_GET_EVENT and - FrontendEvent.) If a new FE_SET_FRONTEND operation is initiated before - the previous one was completed, the previous operation will be aborted in favor - of the new one. This command requires read/write access to the device. - - - -SYNOPSIS - - -int ioctl(int fd, int request = FE_SET_FRONTEND, - struct dvb_frontend_parameters ⋆p); - - -PARAMETERS - - -int fd - -File descriptor returned by a previous call to open(). - - -int request - -Equals FE_SET_FRONTEND for this command. - - -struct - dvb_frontend_parameters - *p - -Points to parameters for tuning operation. - - - -&return-value-dvb; - -EINVAL - -Maximum supported symbol rate reached. - - -
- -
-FE_GET_FRONTEND -DESCRIPTION - - -This ioctl call queries the currently effective frontend parameters. For this - command, read-only access to the device is sufficient. - - - -SYNOPSIS - - -int ioctl(int fd, int request = FE_GET_FRONTEND, - struct dvb_frontend_parameters ⋆p); - - - -PARAMETERS - - -int fd - -File descriptor returned by a previous call to open(). - - -int request - -Equals FE_SET_FRONTEND for this command. - - -struct - dvb_frontend_parameters - *p - -Points to parameters for tuning operation. - - - -&return-value-dvb; - -EINVAL - -Maximum supported symbol rate reached. - - - -
- -
-FE_GET_EVENT -DESCRIPTION - - -This ioctl call returns a frontend event if available. If an event is not - available, the behavior depends on whether the device is in blocking or - non-blocking mode. In the latter case, the call fails immediately with errno - set to EWOULDBLOCK. In the former case, the call blocks until an event - becomes available. - - -The standard Linux poll() and/or select() system calls can be used with the - device file descriptor to watch for new events. For select(), the file descriptor - should be included in the exceptfds argument, and for poll(), POLLPRI should - be specified as the wake-up condition. Since the event queue allocated is - rather small (room for 8 events), the queue must be serviced regularly to avoid - overflow. If an overflow happens, the oldest event is discarded from the queue, - and an error (EOVERFLOW) occurs the next time the queue is read. After - reporting the error condition in this fashion, subsequent - FE_GET_EVENT - calls will return events from the queue as usual. - - -For the sake of implementation simplicity, this command requires read/write - access to the device. - - - -SYNOPSIS - - -int ioctl(int fd, int request = QPSK_GET_EVENT, - struct dvb_frontend_event ⋆ev); - - - -PARAMETERS - - -int fd - -File descriptor returned by a previous call to open(). - - -int request - -Equals FE_GET_EVENT for this command. - - -struct - dvb_frontend_event - *ev - -Points to the location where the event, - - - -if any, is to be stored. - - - -&return-value-dvb; - -EWOULDBLOCK - -There is no event pending, and the device is in - non-blocking mode. - - -EOVERFLOW - -Overflow in event queue - one or more events were lost. - - -
- -
-FE_GET_INFO -DESCRIPTION - - -This ioctl call returns information about the front-end. This call only requires - read-only access to the device. - - -SYNOPSIS - - - - int ioctl(int fd, int request = FE_GET_INFO, struct - dvb_frontend_info ⋆info); - - -PARAMETERS - - - -int fd - -File descriptor returned by a previous call to open(). - - -int request - -Equals FE_GET_INFO for this command. - - -struct - dvb_frontend_info - *info - -Points to the location where the front-end information is - to be stored. - - -&return-value-dvb; -
- -
-FE_DISEQC_RESET_OVERLOAD -DESCRIPTION - - -If the bus has been automatically powered off due to power overload, this ioctl - call restores the power to the bus. The call requires read/write access to the - device. This call has no effect if the device is manually powered off. Not all - DVB adapters support this ioctl. - - - -SYNOPSIS - - -int ioctl(int fd, int request = - FE_DISEQC_RESET_OVERLOAD); - - -PARAMETERS - - -int fd - -File descriptor returned by a previous call to open(). - - -int request - -Equals FE_DISEQC_RESET_OVERLOAD for this - command. - - - -&return-value-dvb; -
- -
-FE_DISEQC_SEND_MASTER_CMD -DESCRIPTION - - -This ioctl call is used to send a a DiSEqC command. - - -SYNOPSIS - - -int ioctl(int fd, int request = - FE_DISEQC_SEND_MASTER_CMD, struct - dvb_diseqc_master_cmd ⋆cmd); - - - -PARAMETERS - - -int fd - -File descriptor returned by a previous call to open(). - - -int request - -Equals FE_DISEQC_SEND_MASTER_CMD for this - command. - - -struct - dvb_diseqc_master_cmd - *cmd - -Pointer to the command to be transmitted. - - - -&return-value-dvb; + + + 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; +&sub-fe-get-property; +&sub-fe-diseqc-reset-overload; +&sub-fe-diseqc-send-master-cmd; +&sub-fe-diseqc-recv-slave-reply; +&sub-fe-diseqc-send-burst; +&sub-fe-set-tone; +&sub-fe-set-voltage; +&sub-fe-enable-high-lnb-voltage; +&sub-fe-set-frontend-tune-mode; + +
+ +
+DVB Frontend legacy API (a. k. a. DVBv3) +The usage of this API is deprecated, as it doesn't support all digital + TV standards, doesn't provide good statistics measurements and provides + incomplete information. This is kept only to support legacy applications. + +&sub-frontend_legacy_api;
- -
-FE_DISEQC_RECV_SLAVE_REPLY -DESCRIPTION - - -This ioctl call is used to receive reply to a DiSEqC 2.0 command. - - - -SYNOPSIS - - -int ioctl(int fd, int request = - FE_DISEQC_RECV_SLAVE_REPLY, struct - dvb_diseqc_slave_reply ⋆reply); - - - -PARAMETERS - - -int fd - -File descriptor returned by a previous call to open(). - - -int request - -Equals FE_DISEQC_RECV_SLAVE_REPLY for this - command. - - -struct - dvb_diseqc_slave_reply - *reply - -Pointer to the command to be received. - - -&return-value-dvb; -
- -
-FE_DISEQC_SEND_BURST -DESCRIPTION - - -This ioctl call is used to send a 22KHz tone burst. - - - -SYNOPSIS - - -int ioctl(int fd, int request = - FE_DISEQC_SEND_BURST, fe_sec_mini_cmd_t burst); - - - -PARAMETERS - - -int fd - -File descriptor returned by a previous call to open(). - - -int request - -Equals FE_DISEQC_SEND_BURST for this command. - - -fe_sec_mini_cmd_t - burst - -burst A or B. - - - -&return-value-dvb; -
- -
-FE_SET_TONE -DESCRIPTION - - -This call is used to set the generation of the continuous 22kHz tone. This call - requires read/write permissions. - - -SYNOPSIS - - -int ioctl(int fd, int request = FE_SET_TONE, - fe_sec_tone_mode_t tone); - - -PARAMETERS - - -int fd - -File descriptor returned by a previous call to open(). - - -int request - -Equals FE_SET_TONE for this command. - - -fe_sec_tone_mode_t - tone - -The requested tone generation mode (on/off). - - -&return-value-dvb; -
- -
-FE_SET_VOLTAGE -DESCRIPTION - - -This call is used to set the bus voltage. This call requires read/write - permissions. - - -SYNOPSIS - - -int ioctl(int fd, int request = FE_SET_VOLTAGE, - fe_sec_voltage_t voltage); - - - -PARAMETERS - - -int fd - -File descriptor returned by a previous call to open(). - - -int request - -Equals FE_SET_VOLTAGE for this command. - - -fe_sec_voltage_t - voltage - -The requested bus voltage. - - - -&return-value-dvb; -
- -
-FE_ENABLE_HIGH_LNB_VOLTAGE -DESCRIPTION - - -If high != 0 enables slightly higher voltages instead of 13/18V (to compensate - for long cables). This call requires read/write permissions. Not all DVB - adapters support this ioctl. - - - -SYNOPSIS - - -int ioctl(int fd, int request = - FE_ENABLE_HIGH_LNB_VOLTAGE, int high); - - - -PARAMETERS - - -int fd - -File descriptor returned by a previous call to open(). - - -int request - -Equals FE_SET_VOLTAGE for this command. - - -int high - -The requested bus voltage. - - - -&return-value-dvb; -
- -
-FE_SET_FRONTEND_TUNE_MODE -DESCRIPTION - - -Allow setting tuner mode flags to the frontend. - - - -SYNOPSIS - - -int ioctl(int fd, int request = -FE_SET_FRONTEND_TUNE_MODE, unsigned int flags); - - - -PARAMETERS - - - unsigned int flags - - - -FE_TUNE_MODE_ONESHOT When set, this flag will disable any zigzagging or other "normal" tuning behaviour. Additionally, there will be no automatic monitoring of the lock status, and hence no frontend events will be generated. If a frontend device is closed, this flag will be automatically turned off when the device is reopened read-write. - - - - -&return-value-dvb; -
- -
- FE_DISHNETWORK_SEND_LEGACY_CMD -DESCRIPTION - - -WARNING: This is a very obscure legacy command, used only at stv0299 driver. Should not be used on newer drivers. -It provides a non-standard method for selecting Diseqc voltage on the frontend, for Dish Network legacy switches. -As support for this ioctl were added in 2004, this means that such dishes were already legacy in 2004. - - - -SYNOPSIS - - -int ioctl(int fd, int request = - FE_DISHNETWORK_SEND_LEGACY_CMD, unsigned long cmd); - - - -PARAMETERS - - - unsigned long cmd - - - -sends the specified raw cmd to the dish via DISEqC. - - - - -&return-value-dvb; -
- -
- -&sub-dvbproperty; diff --git a/kernel/Documentation/DocBook/media/dvb/frontend_legacy_api.xml b/kernel/Documentation/DocBook/media/dvb/frontend_legacy_api.xml new file mode 100644 index 000000000..8fadf3a4b --- /dev/null +++ b/kernel/Documentation/DocBook/media/dvb/frontend_legacy_api.xml @@ -0,0 +1,654 @@ +
+Frontend Legacy Data Types + +
+Frontend type + +For historical reasons, frontend types are named by the type of modulation + used in transmission. The fontend types are given by fe_type_t type, defined as: + + +Frontend types + + &cs-def; + + + fe_type + Description + DTV_DELIVERY_SYSTEM equivalent type + + + + + FE_QPSK + For DVB-S standard + SYS_DVBS + + + FE_QAM + For DVB-C annex A standard + SYS_DVBC_ANNEX_A + + + FE_OFDM + For DVB-T standard + SYS_DVBT + + + FE_ATSC + For ATSC standard (terrestrial) or for DVB-C Annex B (cable) used in US. + SYS_ATSC (terrestrial) or SYS_DVBC_ANNEX_B (cable) + +
+ +Newer formats like DVB-S2, ISDB-T, ISDB-S and DVB-T2 are not described at the above, as they're +supported via the new FE_GET_PROPERTY/FE_GET_SET_PROPERTY ioctl's, using the DTV_DELIVERY_SYSTEM parameter. + + +In the old days, &dvb-frontend-info; used to contain + fe_type_t field to indicate the delivery systems, + filled with either FE_QPSK, FE_QAM, FE_OFDM or FE_ATSC. While this is + still filled to keep backward compatibility, the usage of this + field is deprecated, as it can report just one delivery system, but some + devices support multiple delivery systems. Please use + DTV_ENUM_DELSYS instead. + +On devices that support multiple delivery systems, + &dvb-frontend-info;::fe_type_t is filled with the + currently standard, as selected by the last call to + FE_SET_PROPERTY + using the &DTV-DELIVERY-SYSTEM; property. +
+ +
+Frontend bandwidth + + + enum fe_bandwidth + + &cs-def; + + + ID + Description + + + + + BANDWIDTH_AUTO + Autodetect bandwidth (if supported) + + BANDWIDTH_1_712_MHZ + 1.712 MHz + + BANDWIDTH_5_MHZ + 5 MHz + + BANDWIDTH_6_MHZ + 6 MHz + + BANDWIDTH_7_MHZ + 7 MHz + + BANDWIDTH_8_MHZ + 8 MHz + + BANDWIDTH_10_MHZ + 10 MHz + + + +
+ +
+ +
+frontend parameters +The kind of parameters passed to the frontend device for tuning depend on +the kind of hardware you are using. +The struct dvb_frontend_parameters uses an +union with specific per-system parameters. However, as newer delivery systems +required more data, the structure size weren't enough to fit, and just +extending its size would break the existing applications. So, those parameters +were replaced by the usage of +FE_GET_PROPERTY/FE_SET_PROPERTY ioctl's. The +new API is flexible enough to add new parameters to existing delivery systems, +and to add newer delivery systems. +So, newer applications should use +FE_GET_PROPERTY/FE_SET_PROPERTY instead, in +order to be able to support the newer System Delivery like DVB-S2, DVB-T2, +DVB-C2, ISDB, etc. +All kinds of parameters are combined as an union in the FrontendParameters structure: + +struct dvb_frontend_parameters { + uint32_t frequency; /⋆ (absolute) frequency in Hz for QAM/OFDM ⋆/ + /⋆ intermediate frequency in kHz for QPSK ⋆/ + &fe-spectral-inversion-t; inversion; + union { + struct dvb_qpsk_parameters qpsk; + struct dvb_qam_parameters qam; + struct dvb_ofdm_parameters ofdm; + struct dvb_vsb_parameters vsb; + } u; +}; + +In the case of QPSK frontends the frequency field specifies the intermediate +frequency, i.e. the offset which is effectively added to the local oscillator frequency (LOF) of +the LNB. The intermediate frequency has to be specified in units of kHz. For QAM and +OFDM frontends the frequency specifies the absolute frequency and is given in Hz. + + +
+QPSK parameters +For satellite QPSK frontends you have to use the dvb_qpsk_parameters structure: + + struct dvb_qpsk_parameters { + uint32_t symbol_rate; /⋆ symbol rate in Symbols per second ⋆/ + &fe-code-rate-t; fec_inner; /⋆ forward error correction (see above) ⋆/ + }; + +
+ +
+QAM parameters +for cable QAM frontend you use the dvb_qam_parameters structure: + + struct dvb_qam_parameters { + uint32_t symbol_rate; /⋆ symbol rate in Symbols per second ⋆/ + &fe-code-rate-t; fec_inner; /⋆ forward error correction (see above) ⋆/ + &fe-modulation-t; modulation; /⋆ modulation type (see above) ⋆/ + }; + +
+ +
+VSB parameters +ATSC frontends are supported by the dvb_vsb_parameters structure: + +struct dvb_vsb_parameters { + &fe-modulation-t; modulation; /⋆ modulation type (see above) ⋆/ +}; + +
+ +
+OFDM parameters +DVB-T frontends are supported by the dvb_ofdm_parameters structure: + + struct dvb_ofdm_parameters { + &fe-bandwidth-t; bandwidth; + &fe-code-rate-t; code_rate_HP; /⋆ high priority stream code rate ⋆/ + &fe-code-rate-t; code_rate_LP; /⋆ low priority stream code rate ⋆/ + &fe-modulation-t; constellation; /⋆ modulation type (see above) ⋆/ + &fe-transmit-mode-t; transmission_mode; + &fe-guard-interval-t; guard_interval; + &fe-hierarchy-t; hierarchy_information; + }; + +
+
+ +
+frontend events + + struct dvb_frontend_event { + fe_status_t status; + struct dvb_frontend_parameters parameters; + }; + +
+
+ +
+Frontend Legacy Function Calls + +Those functions are defined at DVB version 3. The support is kept in + the kernel due to compatibility issues only. Their usage is strongly + not recommended + +
+FE_READ_BER +DESCRIPTION + + +This ioctl call returns the bit error rate for the signal currently + received/demodulated by the front-end. For this command, read-only access to + the device is sufficient. + + +SYNOPSIS + + +int ioctl(int fd, int request = FE_READ_BER, + uint32_t ⋆ber); + + +PARAMETERS + + +int fd + +File descriptor returned by a previous call to open(). + + +int request + +Equals FE_READ_BER for this command. + + +uint32_t *ber + +The bit error rate is stored into *ber. + + + +&return-value-dvb; +
+ +
+FE_READ_SNR + +DESCRIPTION + + +This ioctl call returns the signal-to-noise ratio for the signal currently received + by the front-end. For this command, read-only access to the device is sufficient. + + +SYNOPSIS + + +int ioctl(int fd, int request = FE_READ_SNR, uint16_t + ⋆snr); + + +PARAMETERS + + +int fd + +File descriptor returned by a previous call to open(). + + +int request + +Equals FE_READ_SNR for this command. + + +uint16_t *snr + +The signal-to-noise ratio is stored into *snr. + + + +&return-value-dvb; +
+ +
+FE_READ_SIGNAL_STRENGTH +DESCRIPTION + + +This ioctl call returns the signal strength value for the signal currently received + by the front-end. For this command, read-only access to the device is sufficient. + + +SYNOPSIS + + +int ioctl( int fd, int request = + FE_READ_SIGNAL_STRENGTH, uint16_t ⋆strength); + + + +PARAMETERS + + +int fd + +File descriptor returned by a previous call to open(). + + +int request + +Equals FE_READ_SIGNAL_STRENGTH for this + command. + + +uint16_t *strength + +The signal strength value is stored into *strength. + + + +&return-value-dvb; +
+ +
+FE_READ_UNCORRECTED_BLOCKS +DESCRIPTION + + +This ioctl call returns the number of uncorrected blocks detected by the device + driver during its lifetime. For meaningful measurements, the increment in block + count during a specific time interval should be calculated. For this command, + read-only access to the device is sufficient. + + +Note that the counter will wrap to zero after its maximum count has been + reached. + + +SYNOPSIS + + +int ioctl( int fd, int request = + FE_READ_UNCORRECTED_BLOCKS, uint32_t ⋆ublocks); + + +PARAMETERS + + +int fd + +File descriptor returned by a previous call to open(). + + +int request + +Equals FE_READ_UNCORRECTED_BLOCKS for this + command. + + +uint32_t *ublocks + +The total number of uncorrected blocks seen by the driver + so far. + + + +&return-value-dvb; +
+ +
+FE_SET_FRONTEND +DESCRIPTION + + +This ioctl call starts a tuning operation using specified parameters. The result + of this call will be successful if the parameters were valid and the tuning could + be initiated. The result of the tuning operation in itself, however, will arrive + asynchronously as an event (see documentation for FE_GET_EVENT and + FrontendEvent.) If a new FE_SET_FRONTEND operation is initiated before + the previous one was completed, the previous operation will be aborted in favor + of the new one. This command requires read/write access to the device. + + + +SYNOPSIS + + +int ioctl(int fd, int request = FE_SET_FRONTEND, + struct dvb_frontend_parameters ⋆p); + + +PARAMETERS + + +int fd + +File descriptor returned by a previous call to open(). + + +int request + +Equals FE_SET_FRONTEND for this command. + + +struct + dvb_frontend_parameters + *p + +Points to parameters for tuning operation. + + + +&return-value-dvb; + +EINVAL + +Maximum supported symbol rate reached. + + +
+ +
+FE_GET_FRONTEND +DESCRIPTION + + +This ioctl call queries the currently effective frontend parameters. For this + command, read-only access to the device is sufficient. + + + +SYNOPSIS + + +int ioctl(int fd, int request = FE_GET_FRONTEND, + struct dvb_frontend_parameters ⋆p); + + + +PARAMETERS + + +int fd + +File descriptor returned by a previous call to open(). + + +int request + +Equals FE_SET_FRONTEND for this command. + + +struct + dvb_frontend_parameters + *p + +Points to parameters for tuning operation. + + + +&return-value-dvb; + +EINVAL + +Maximum supported symbol rate reached. + + + +
+ +
+FE_GET_EVENT +DESCRIPTION + + +This ioctl call returns a frontend event if available. If an event is not + available, the behavior depends on whether the device is in blocking or + non-blocking mode. In the latter case, the call fails immediately with errno + set to EWOULDBLOCK. In the former case, the call blocks until an event + becomes available. + + +The standard Linux poll() and/or select() system calls can be used with the + device file descriptor to watch for new events. For select(), the file descriptor + should be included in the exceptfds argument, and for poll(), POLLPRI should + be specified as the wake-up condition. Since the event queue allocated is + rather small (room for 8 events), the queue must be serviced regularly to avoid + overflow. If an overflow happens, the oldest event is discarded from the queue, + and an error (EOVERFLOW) occurs the next time the queue is read. After + reporting the error condition in this fashion, subsequent + FE_GET_EVENT + calls will return events from the queue as usual. + + +For the sake of implementation simplicity, this command requires read/write + access to the device. + + + +SYNOPSIS + + +int ioctl(int fd, int request = QPSK_GET_EVENT, + struct dvb_frontend_event ⋆ev); + + + +PARAMETERS + + +int fd + +File descriptor returned by a previous call to open(). + + +int request + +Equals FE_GET_EVENT for this command. + + +struct + dvb_frontend_event + *ev + +Points to the location where the event, + + + +if any, is to be stored. + + + +&return-value-dvb; + +EWOULDBLOCK + +There is no event pending, and the device is in + non-blocking mode. + + +EOVERFLOW + +Overflow in event queue - one or more events were lost. + + +
+ +
+ FE_DISHNETWORK_SEND_LEGACY_CMD +DESCRIPTION + + +WARNING: This is a very obscure legacy command, used only at stv0299 driver. Should not be used on newer drivers. +It provides a non-standard method for selecting Diseqc voltage on the frontend, for Dish Network legacy switches. +As support for this ioctl were added in 2004, this means that such dishes were already legacy in 2004. + + + +SYNOPSIS + + +int ioctl(int fd, int request = + FE_DISHNETWORK_SEND_LEGACY_CMD, unsigned long cmd); + + + +PARAMETERS + + + unsigned long cmd + + + +sends the specified raw cmd to the dish via DISEqC. + + + + +&return-value-dvb; +
+ +
diff --git a/kernel/Documentation/DocBook/media/dvb/intro.xml b/kernel/Documentation/DocBook/media/dvb/intro.xml index 2048b53d1..51db15648 100644 --- a/kernel/Documentation/DocBook/media/dvb/intro.xml +++ b/kernel/Documentation/DocBook/media/dvb/intro.xml @@ -129,43 +129,42 @@ hardware. It can depend on the individual security requirements of the platform, if and how many of the CA functions are made available to the application through this device. -All devices can be found in the /dev -tree under /dev/dvb. The individual devices +All devices can be found in the /dev +tree under /dev/dvb. The individual devices are called: -/dev/dvb/adapterN/audioM, +/dev/dvb/adapterN/audioM, -/dev/dvb/adapterN/videoM, +/dev/dvb/adapterN/videoM, -/dev/dvb/adapterN/frontendM, +/dev/dvb/adapterN/frontendM, -/dev/dvb/adapterN/netM, +/dev/dvb/adapterN/netM, -/dev/dvb/adapterN/demuxM, +/dev/dvb/adapterN/demuxM, -/dev/dvb/adapterN/dvrM, +/dev/dvb/adapterN/dvrM, -/dev/dvb/adapterN/caM, +/dev/dvb/adapterN/caM, where N enumerates the DVB PCI cards in a system starting from 0, and M enumerates the devices of each type within each -adapter, starting from 0, too. We will omit the “/dev/dvb/adapterN/” in the further dicussion -of these devices. The naming scheme for the devices is the same wheter -devfs is used or not. +adapter, starting from 0, too. We will omit the “ +/dev/dvb/adapterN/” in the further discussion +of these devices. More details about the data structures and function calls of all the devices are described in the following chapters. @@ -202,10 +201,10 @@ a partial path like: To enable applications to support different API version, an -additional include file linux/dvb/version.h exists, which defines the -constant DVB_API_VERSION. This document -describes DVB_API_VERSION 5.8. +additional include file +linux/dvb/version.h exists, which defines the +constant DVB_API_VERSION. This document +describes DVB_API_VERSION 5.10.
diff --git a/kernel/Documentation/DocBook/media/dvb/kdapi.xml b/kernel/Documentation/DocBook/media/dvb/kdapi.xml deleted file mode 100644 index 6c11ec52c..000000000 --- a/kernel/Documentation/DocBook/media/dvb/kdapi.xml +++ /dev/null @@ -1,2309 +0,0 @@ -Kernel Demux API -The kernel demux API defines a driver-internal interface for registering low-level, -hardware specific driver to a hardware independent demux layer. It is only of interest for -DVB device driver writers. The header file for this API is named demux.h and located in -drivers/media/dvb-core. - -Maintainer note: This section must be reviewed. It is probably out of date. - - -
-Kernel Demux Data Types - - -
-dmx_success_t - - typedef enum { - DMX_OK = 0, /⋆ Received Ok ⋆/ - DMX_LENGTH_ERROR, /⋆ Incorrect length ⋆/ - DMX_OVERRUN_ERROR, /⋆ Receiver ring buffer overrun ⋆/ - DMX_CRC_ERROR, /⋆ Incorrect CRC ⋆/ - DMX_FRAME_ERROR, /⋆ Frame alignment error ⋆/ - DMX_FIFO_ERROR, /⋆ Receiver FIFO overrun ⋆/ - DMX_MISSED_ERROR /⋆ Receiver missed packet ⋆/ - } dmx_success_t; - - -
-
-TS filter types - - /⋆--------------------------------------------------------------------------⋆/ - /⋆ TS packet reception ⋆/ - /⋆--------------------------------------------------------------------------⋆/ - - /⋆ TS filter type for set_type() ⋆/ - - #define TS_PACKET 1 /⋆ send TS packets (188 bytes) to callback (default) ⋆/ - #define TS_PAYLOAD_ONLY 2 /⋆ in case TS_PACKET is set, only send the TS - payload (<=184 bytes per packet) to callback ⋆/ - #define TS_DECODER 4 /⋆ send stream to built-in decoder (if present) ⋆/ - - -
-
-dmx_ts_pes_t -The structure - - - typedef enum - { - DMX_TS_PES_AUDIO, /⋆ also send packets to audio decoder (if it exists) ⋆/ - DMX_TS_PES_VIDEO, /⋆ ... ⋆/ - DMX_TS_PES_TELETEXT, - DMX_TS_PES_SUBTITLE, - DMX_TS_PES_PCR, - DMX_TS_PES_OTHER, - } dmx_ts_pes_t; - -describes the PES type for filters which write to a built-in decoder. The correspond (and -should be kept identical) to the types in the demux device. - - - struct dmx_ts_feed_s { - int is_filtering; /⋆ Set to non-zero when filtering in progress ⋆/ - struct dmx_demux_s⋆ parent; /⋆ Back-pointer ⋆/ - void⋆ priv; /⋆ Pointer to private data of the API client ⋆/ - int (⋆set) (struct dmx_ts_feed_s⋆ feed, - __u16 pid, - size_t callback_length, - size_t circular_buffer_size, - int descramble, - struct timespec timeout); - int (⋆start_filtering) (struct dmx_ts_feed_s⋆ feed); - int (⋆stop_filtering) (struct dmx_ts_feed_s⋆ feed); - int (⋆set_type) (struct dmx_ts_feed_s⋆ feed, - int type, - dmx_ts_pes_t pes_type); - }; - - typedef struct dmx_ts_feed_s dmx_ts_feed_t; - - - /⋆--------------------------------------------------------------------------⋆/ - /⋆ PES packet reception (not supported yet) ⋆/ - /⋆--------------------------------------------------------------------------⋆/ - - typedef struct dmx_pes_filter_s { - struct dmx_pes_s⋆ parent; /⋆ Back-pointer ⋆/ - void⋆ priv; /⋆ Pointer to private data of the API client ⋆/ - } dmx_pes_filter_t; - - - typedef struct dmx_pes_feed_s { - int is_filtering; /⋆ Set to non-zero when filtering in progress ⋆/ - struct dmx_demux_s⋆ parent; /⋆ Back-pointer ⋆/ - void⋆ priv; /⋆ Pointer to private data of the API client ⋆/ - int (⋆set) (struct dmx_pes_feed_s⋆ feed, - __u16 pid, - size_t circular_buffer_size, - int descramble, - struct timespec timeout); - int (⋆start_filtering) (struct dmx_pes_feed_s⋆ feed); - int (⋆stop_filtering) (struct dmx_pes_feed_s⋆ feed); - int (⋆allocate_filter) (struct dmx_pes_feed_s⋆ feed, - dmx_pes_filter_t⋆⋆ filter); - int (⋆release_filter) (struct dmx_pes_feed_s⋆ feed, - dmx_pes_filter_t⋆ filter); - } dmx_pes_feed_t; - - - typedef struct { - __u8 filter_value [DMX_MAX_FILTER_SIZE]; - __u8 filter_mask [DMX_MAX_FILTER_SIZE]; - struct dmx_section_feed_s⋆ parent; /⋆ Back-pointer ⋆/ - void⋆ priv; /⋆ Pointer to private data of the API client ⋆/ - } dmx_section_filter_t; - - - struct dmx_section_feed_s { - int is_filtering; /⋆ Set to non-zero when filtering in progress ⋆/ - struct dmx_demux_s⋆ parent; /⋆ Back-pointer ⋆/ - void⋆ priv; /⋆ Pointer to private data of the API client ⋆/ - int (⋆set) (struct dmx_section_feed_s⋆ feed, - __u16 pid, - size_t circular_buffer_size, - int descramble, - int check_crc); - int (⋆allocate_filter) (struct dmx_section_feed_s⋆ feed, - dmx_section_filter_t⋆⋆ filter); - int (⋆release_filter) (struct dmx_section_feed_s⋆ feed, - dmx_section_filter_t⋆ filter); - int (⋆start_filtering) (struct dmx_section_feed_s⋆ feed); - int (⋆stop_filtering) (struct dmx_section_feed_s⋆ feed); - }; - typedef struct dmx_section_feed_s dmx_section_feed_t; - - /⋆--------------------------------------------------------------------------⋆/ - /⋆ Callback functions ⋆/ - /⋆--------------------------------------------------------------------------⋆/ - - typedef int (⋆dmx_ts_cb) ( __u8 ⋆ buffer1, - size_t buffer1_length, - __u8 ⋆ buffer2, - size_t buffer2_length, - dmx_ts_feed_t⋆ source, - dmx_success_t success); - - typedef int (⋆dmx_section_cb) ( __u8 ⋆ buffer1, - size_t buffer1_len, - __u8 ⋆ buffer2, - size_t buffer2_len, - dmx_section_filter_t ⋆ source, - dmx_success_t success); - - typedef int (⋆dmx_pes_cb) ( __u8 ⋆ buffer1, - size_t buffer1_len, - __u8 ⋆ buffer2, - size_t buffer2_len, - dmx_pes_filter_t⋆ source, - dmx_success_t success); - - /⋆--------------------------------------------------------------------------⋆/ - /⋆ DVB Front-End ⋆/ - /⋆--------------------------------------------------------------------------⋆/ - - typedef enum { - DMX_OTHER_FE = 0, - DMX_SATELLITE_FE, - DMX_CABLE_FE, - DMX_TERRESTRIAL_FE, - DMX_LVDS_FE, - DMX_ASI_FE, /⋆ DVB-ASI interface ⋆/ - DMX_MEMORY_FE - } dmx_frontend_source_t; - - typedef struct { - /⋆ The following char⋆ fields point to NULL terminated strings ⋆/ - char⋆ id; /⋆ Unique front-end identifier ⋆/ - char⋆ vendor; /⋆ Name of the front-end vendor ⋆/ - char⋆ model; /⋆ Name of the front-end model ⋆/ - struct list_head connectivity_list; /⋆ List of front-ends that can - be connected to a particular - demux ⋆/ - void⋆ priv; /⋆ Pointer to private data of the API client ⋆/ - dmx_frontend_source_t source; - } dmx_frontend_t; - - /⋆--------------------------------------------------------------------------⋆/ - /⋆ MPEG-2 TS Demux ⋆/ - /⋆--------------------------------------------------------------------------⋆/ - - /⋆ - ⋆ Flags OR'ed in the capabilites field of struct dmx_demux_s. - ⋆/ - - #define DMX_TS_FILTERING 1 - #define DMX_PES_FILTERING 2 - #define DMX_SECTION_FILTERING 4 - #define DMX_MEMORY_BASED_FILTERING 8 /⋆ write() available ⋆/ - #define DMX_CRC_CHECKING 16 - #define DMX_TS_DESCRAMBLING 32 - #define DMX_SECTION_PAYLOAD_DESCRAMBLING 64 - #define DMX_MAC_ADDRESS_DESCRAMBLING 128 - - -
-
-demux_demux_t - - /⋆ - ⋆ DMX_FE_ENTRY(): Casts elements in the list of registered - ⋆ front-ends from the generic type struct list_head - ⋆ to the type ⋆ dmx_frontend_t - ⋆. - ⋆/ - - #define DMX_FE_ENTRY(list) list_entry(list, dmx_frontend_t, connectivity_list) - - struct dmx_demux_s { - /⋆ The following char⋆ fields point to NULL terminated strings ⋆/ - char⋆ id; /⋆ Unique demux identifier ⋆/ - char⋆ vendor; /⋆ Name of the demux vendor ⋆/ - char⋆ model; /⋆ Name of the demux model ⋆/ - __u32 capabilities; /⋆ Bitfield of capability flags ⋆/ - dmx_frontend_t⋆ frontend; /⋆ Front-end connected to the demux ⋆/ - struct list_head reg_list; /⋆ List of registered demuxes ⋆/ - void⋆ priv; /⋆ Pointer to private data of the API client ⋆/ - int users; /⋆ Number of users ⋆/ - int (⋆open) (struct dmx_demux_s⋆ demux); - int (⋆close) (struct dmx_demux_s⋆ demux); - int (⋆write) (struct dmx_demux_s⋆ demux, const char⋆ buf, size_t count); - int (⋆allocate_ts_feed) (struct dmx_demux_s⋆ demux, - dmx_ts_feed_t⋆⋆ feed, - dmx_ts_cb callback); - int (⋆release_ts_feed) (struct dmx_demux_s⋆ demux, - dmx_ts_feed_t⋆ feed); - int (⋆allocate_pes_feed) (struct dmx_demux_s⋆ demux, - dmx_pes_feed_t⋆⋆ feed, - dmx_pes_cb callback); - int (⋆release_pes_feed) (struct dmx_demux_s⋆ demux, - dmx_pes_feed_t⋆ feed); - int (⋆allocate_section_feed) (struct dmx_demux_s⋆ demux, - dmx_section_feed_t⋆⋆ feed, - dmx_section_cb callback); - int (⋆release_section_feed) (struct dmx_demux_s⋆ demux, - dmx_section_feed_t⋆ feed); - int (⋆descramble_mac_address) (struct dmx_demux_s⋆ demux, - __u8⋆ buffer1, - size_t buffer1_length, - __u8⋆ buffer2, - size_t buffer2_length, - __u16 pid); - int (⋆descramble_section_payload) (struct dmx_demux_s⋆ demux, - __u8⋆ buffer1, - size_t buffer1_length, - __u8⋆ buffer2, size_t buffer2_length, - __u16 pid); - int (⋆add_frontend) (struct dmx_demux_s⋆ demux, - dmx_frontend_t⋆ frontend); - int (⋆remove_frontend) (struct dmx_demux_s⋆ demux, - dmx_frontend_t⋆ frontend); - struct list_head⋆ (⋆get_frontends) (struct dmx_demux_s⋆ demux); - int (⋆connect_frontend) (struct dmx_demux_s⋆ demux, - dmx_frontend_t⋆ frontend); - int (⋆disconnect_frontend) (struct dmx_demux_s⋆ demux); - - - /⋆ added because js cannot keep track of these himself ⋆/ - int (⋆get_pes_pids) (struct dmx_demux_s⋆ demux, __u16 ⋆pids); - }; - typedef struct dmx_demux_s dmx_demux_t; - - -
-
-Demux directory - - /⋆ - ⋆ DMX_DIR_ENTRY(): Casts elements in the list of registered - ⋆ demuxes from the generic type struct list_head⋆ to the type dmx_demux_t - ⋆. - ⋆/ - - #define DMX_DIR_ENTRY(list) list_entry(list, dmx_demux_t, reg_list) - - int dmx_register_demux (dmx_demux_t⋆ demux); - int dmx_unregister_demux (dmx_demux_t⋆ demux); - struct list_head⋆ dmx_get_demuxes (void); - -
-
-Demux Directory API -The demux directory is a Linux kernel-wide facility for registering and accessing the -MPEG-2 TS demuxes in the system. Run-time registering and unregistering of demux drivers -is possible using this API. - -All demux drivers in the directory implement the abstract interface dmx_demux_t. - - -
dmx_register_demux() -DESCRIPTION - - -This function makes a demux driver interface available to the Linux kernel. It is - usually called by the init_module() function of the kernel module that contains - the demux driver. The caller of this function is responsible for allocating - dynamic or static memory for the demux structure and for initializing its fields - before calling this function. The memory allocated for the demux structure - must not be freed before calling dmx_unregister_demux(), - - -SYNOPSIS - - -int dmx_register_demux ( dmx_demux_t ⋆demux ) - - -PARAMETERS - - -dmx_demux_t* - demux - -Pointer to the demux structure. - - -RETURNS - - -0 - -The function was completed without errors. - - --EEXIST - -A demux with the same value of the id field already stored - in the directory. - - --ENOSPC - -No space left in the directory. - - - -
dmx_unregister_demux() -DESCRIPTION - - -This function is called to indicate that the given demux interface is no - longer available. The caller of this function is responsible for freeing the - memory of the demux structure, if it was dynamically allocated before calling - dmx_register_demux(). The cleanup_module() function of the kernel module - that contains the demux driver should call this function. Note that this function - fails if the demux is currently in use, i.e., release_demux() has not been called - for the interface. - - -SYNOPSIS - - -int dmx_unregister_demux ( dmx_demux_t ⋆demux ) - - -PARAMETERS - - -dmx_demux_t* - demux - -Pointer to the demux structure which is to be - unregistered. - - -RETURNS - - -0 - -The function was completed without errors. - - -ENODEV - -The specified demux is not registered in the demux - directory. - - -EBUSY - -The specified demux is currently in use. - - - -
dmx_get_demuxes() -DESCRIPTION - - -Provides the caller with the list of registered demux interfaces, using the - standard list structure defined in the include file linux/list.h. The include file - demux.h defines the macro DMX_DIR_ENTRY() for converting an element of - the generic type struct list_head* to the type dmx_demux_t*. The caller must - not free the memory of any of the elements obtained via this function call. - - -SYNOPSIS - - -struct list_head ⋆dmx_get_demuxes () - - -PARAMETERS - - -none - - -RETURNS - - -struct list_head * - -A list of demux interfaces, or NULL in the case of an - empty list. - - -
-
-Demux API -The demux API should be implemented for each demux in the system. It is used to select -the TS source of a demux and to manage the demux resources. When the demux -client allocates a resource via the demux API, it receives a pointer to the API of that -resource. - -Each demux receives its TS input from a DVB front-end or from memory, as set via the -demux API. In a system with more than one front-end, the API can be used to select one of -the DVB front-ends as a TS source for a demux, unless this is fixed in the HW platform. The -demux API only controls front-ends regarding their connections with demuxes; the APIs -used to set the other front-end parameters, such as tuning, are not defined in this -document. - -The functions that implement the abstract interface demux should be defined static or -module private and registered to the Demux Directory for external access. It is not necessary -to implement every function in the demux_t struct, however (for example, a demux interface -might support Section filtering, but not TS or PES filtering). The API client is expected to -check the value of any function pointer before calling the function: the value of NULL means -“function not available”. - -Whenever the functions of the demux API modify shared data, the possibilities of lost -update and race condition problems should be addressed, e.g. by protecting parts of code with -mutexes. This is especially important on multi-processor hosts. - -Note that functions called from a bottom half context must not sleep, at least in the 2.2.x -kernels. Even a simple memory allocation can result in a kernel thread being put to sleep if -swapping is needed. For example, the Linux kernel calls the functions of a network device -interface from a bottom half context. Thus, if a demux API function is called from network -device code, the function must not sleep. - - - -
-open() -DESCRIPTION - - -This function reserves the demux for use by the caller and, if necessary, - initializes the demux. When the demux is no longer needed, the function close() - should be called. It should be possible for multiple clients to access the demux - at the same time. Thus, the function implementation should increment the - demux usage count when open() is called and decrement it when close() is - called. - - -SYNOPSIS - - -int open ( demux_t⋆ demux ); - - -PARAMETERS - - -demux_t* demux - -Pointer to the demux API and instance data. - - -RETURNS - - -0 - -The function was completed without errors. - - --EUSERS - -Maximum usage count reached. - - --EINVAL - -Bad parameter. - - - -
-
-close() -DESCRIPTION - - -This function reserves the demux for use by the caller and, if necessary, - initializes the demux. When the demux is no longer needed, the function close() - should be called. It should be possible for multiple clients to access the demux - at the same time. Thus, the function implementation should increment the - demux usage count when open() is called and decrement it when close() is - called. - - -SYNOPSIS - - -int close(demux_t⋆ demux); - - -PARAMETERS - - -demux_t* demux - -Pointer to the demux API and instance data. - - -RETURNS - - -0 - -The function was completed without errors. - - --ENODEV - -The demux was not in use. - - --EINVAL - -Bad parameter. - - - -
-
-write() -DESCRIPTION - - -This function provides the demux driver with a memory buffer containing TS - packets. Instead of receiving TS packets from the DVB front-end, the demux - driver software will read packets from memory. Any clients of this demux - with active TS, PES or Section filters will receive filtered data via the Demux - callback API (see 0). The function returns when all the data in the buffer has - been consumed by the demux. Demux hardware typically cannot read TS from - memory. If this is the case, memory-based filtering has to be implemented - entirely in software. - - -SYNOPSIS - - -int write(demux_t⋆ demux, const char⋆ buf, size_t - count); - - -PARAMETERS - - -demux_t* demux - -Pointer to the demux API and instance data. - - -const char* buf - -Pointer to the TS data in kernel-space memory. - - -size_t length - -Length of the TS data. - - -RETURNS - - -0 - -The function was completed without errors. - - --ENOSYS - -The command is not implemented. - - --EINVAL - -Bad parameter. - - - -
allocate_ts_feed() -DESCRIPTION - - -Allocates a new TS feed, which is used to filter the TS packets carrying a - certain PID. The TS feed normally corresponds to a hardware PID filter on the - demux chip. - - -SYNOPSIS - - -int allocate_ts_feed(dmx_demux_t⋆ demux, - dmx_ts_feed_t⋆⋆ feed, dmx_ts_cb callback); - - -PARAMETERS - - -demux_t* demux - -Pointer to the demux API and instance data. - - -dmx_ts_feed_t** - feed - -Pointer to the TS feed API and instance data. - - -dmx_ts_cb callback - -Pointer to the callback function for passing received TS - packet - - -RETURNS - - -0 - -The function was completed without errors. - - --EBUSY - -No more TS feeds available. - - --ENOSYS - -The command is not implemented. - - --EINVAL - -Bad parameter. - - - -
release_ts_feed() -DESCRIPTION - - -Releases the resources allocated with allocate_ts_feed(). Any filtering in - progress on the TS feed should be stopped before calling this function. - - -SYNOPSIS - - -int release_ts_feed(dmx_demux_t⋆ demux, - dmx_ts_feed_t⋆ feed); - - -PARAMETERS - - -demux_t* demux - -Pointer to the demux API and instance data. - - -dmx_ts_feed_t* feed - -Pointer to the TS feed API and instance data. - - -RETURNS - - -0 - -The function was completed without errors. - - --EINVAL - -Bad parameter. - - - -
allocate_section_feed() -DESCRIPTION - - -Allocates a new section feed, i.e. a demux resource for filtering and receiving - sections. On platforms with hardware support for section filtering, a section - feed is directly mapped to the demux HW. On other platforms, TS packets are - first PID filtered in hardware and a hardware section filter then emulated in - software. The caller obtains an API pointer of type dmx_section_feed_t as an - out parameter. Using this API the caller can set filtering parameters and start - receiving sections. - - -SYNOPSIS - - -int allocate_section_feed(dmx_demux_t⋆ demux, - dmx_section_feed_t ⋆⋆feed, dmx_section_cb callback); - - -PARAMETERS - - -demux_t *demux - -Pointer to the demux API and instance data. - - -dmx_section_feed_t - **feed - -Pointer to the section feed API and instance data. - - -dmx_section_cb - callback - -Pointer to the callback function for passing received - sections. - - -RETURNS - - -0 - -The function was completed without errors. - - --EBUSY - -No more section feeds available. - - --ENOSYS - -The command is not implemented. - - --EINVAL - -Bad parameter. - - - -
release_section_feed() -DESCRIPTION - - -Releases the resources allocated with allocate_section_feed(), including - allocated filters. Any filtering in progress on the section feed should be stopped - before calling this function. - - -SYNOPSIS - - -int release_section_feed(dmx_demux_t⋆ demux, - dmx_section_feed_t ⋆feed); - - -PARAMETERS - - -demux_t *demux - -Pointer to the demux API and instance data. - - -dmx_section_feed_t - *feed - -Pointer to the section feed API and instance data. - - -RETURNS - - -0 - -The function was completed without errors. - - --EINVAL - -Bad parameter. - - - -
descramble_mac_address() -DESCRIPTION - - -This function runs a descrambling algorithm on the destination MAC - address field of a DVB Datagram Section, replacing the original address - with its un-encrypted version. Otherwise, the description on the function - descramble_section_payload() applies also to this function. - - -SYNOPSIS - - -int descramble_mac_address(dmx_demux_t⋆ demux, __u8 - ⋆buffer1, size_t buffer1_length, __u8 ⋆buffer2, - size_t buffer2_length, __u16 pid); - - -PARAMETERS - - -dmx_demux_t - *demux - -Pointer to the demux API and instance data. - - -__u8 *buffer1 - -Pointer to the first byte of the section. - - -size_t buffer1_length - -Length of the section data, including headers and CRC, - in buffer1. - - -__u8* buffer2 - -Pointer to the tail of the section data, or NULL. The - pointer has a non-NULL value if the section wraps past - the end of a circular buffer. - - -size_t buffer2_length - -Length of the section data, including headers and CRC, - in buffer2. - - -__u16 pid - -The PID on which the section was received. Useful - for obtaining the descrambling key, e.g. from a DVB - Common Access facility. - - -RETURNS - - -0 - -The function was completed without errors. - - --ENOSYS - -No descrambling facility available. - - --EINVAL - -Bad parameter. - - - -
descramble_section_payload() -DESCRIPTION - - -This function runs a descrambling algorithm on the payload of a DVB - Datagram Section, replacing the original payload with its un-encrypted - version. The function will be called from the demux API implementation; - the API client need not call this function directly. Section-level scrambling - algorithms are currently standardized only for DVB-RCC (return channel - over 2-directional cable TV network) systems. For all other DVB networks, - encryption schemes are likely to be proprietary to each data broadcaster. Thus, - it is expected that this function pointer will have the value of NULL (i.e., - function not available) in most demux API implementations. Nevertheless, it - should be possible to use the function pointer as a hook for dynamically adding - a “plug-in” descrambling facility to a demux driver. - - -While this function is not needed with hardware-based section descrambling, - the descramble_section_payload function pointer can be used to override the - default hardware-based descrambling algorithm: if the function pointer has a - non-NULL value, the corresponding function should be used instead of any - descrambling hardware. - - -SYNOPSIS - - -int descramble_section_payload(dmx_demux_t⋆ demux, - __u8 ⋆buffer1, size_t buffer1_length, __u8 ⋆buffer2, - size_t buffer2_length, __u16 pid); - - -PARAMETERS - - -dmx_demux_t - *demux - -Pointer to the demux API and instance data. - - -__u8 *buffer1 - -Pointer to the first byte of the section. - - -size_t buffer1_length - -Length of the section data, including headers and CRC, - in buffer1. - - -__u8 *buffer2 - -Pointer to the tail of the section data, or NULL. The - pointer has a non-NULL value if the section wraps past - the end of a circular buffer. - - -size_t buffer2_length - -Length of the section data, including headers and CRC, - in buffer2. - - -__u16 pid - -The PID on which the section was received. Useful - for obtaining the descrambling key, e.g. from a DVB - Common Access facility. - - -RETURNS - - -0 - -The function was completed without errors. - - --ENOSYS - -No descrambling facility available. - - --EINVAL - -Bad parameter. - - - -
add_frontend() -DESCRIPTION - - -Registers a connectivity between a demux and a front-end, i.e., indicates that - the demux can be connected via a call to connect_frontend() to use the given - front-end as a TS source. The client of this function has to allocate dynamic or - static memory for the frontend structure and initialize its fields before calling - this function. This function is normally called during the driver initialization. - The caller must not free the memory of the frontend struct before successfully - calling remove_frontend(). - - -SYNOPSIS - - -int add_frontend(dmx_demux_t ⋆demux, dmx_frontend_t - ⋆frontend); - - -PARAMETERS - - -dmx_demux_t* - demux - -Pointer to the demux API and instance data. - - -dmx_frontend_t* - frontend - -Pointer to the front-end instance data. - - -RETURNS - - -0 - -The function was completed without errors. - - --EEXIST - -A front-end with the same value of the id field already - registered. - - --EINUSE - -The demux is in use. - - --ENOMEM - -No more front-ends can be added. - - --EINVAL - -Bad parameter. - - - -
remove_frontend() -DESCRIPTION - - -Indicates that the given front-end, registered by a call to add_frontend(), can - no longer be connected as a TS source by this demux. The function should be - called when a front-end driver or a demux driver is removed from the system. - If the front-end is in use, the function fails with the return value of -EBUSY. - After successfully calling this function, the caller can free the memory of - the frontend struct if it was dynamically allocated before the add_frontend() - operation. - - -SYNOPSIS - - -int remove_frontend(dmx_demux_t⋆ demux, - dmx_frontend_t⋆ frontend); - - -PARAMETERS - - -dmx_demux_t* - demux - -Pointer to the demux API and instance data. - - -dmx_frontend_t* - frontend - -Pointer to the front-end instance data. - - -RETURNS - - -0 - -The function was completed without errors. - - --EINVAL - -Bad parameter. - - --EBUSY - -The front-end is in use, i.e. a call to connect_frontend() - has not been followed by a call to disconnect_frontend(). - - - -
get_frontends() -DESCRIPTION - - -Provides the APIs of the front-ends that have been registered for this demux. - Any of the front-ends obtained with this call can be used as a parameter for - connect_frontend(). - - -The include file demux.h contains the macro DMX_FE_ENTRY() for - converting an element of the generic type struct list_head* to the type - dmx_frontend_t*. The caller must not free the memory of any of the elements - obtained via this function call. - - -SYNOPSIS - - -struct list_head⋆ get_frontends(dmx_demux_t⋆ demux); - - -PARAMETERS - - -dmx_demux_t* - demux - -Pointer to the demux API and instance data. - - -RETURNS - - -dmx_demux_t* - -A list of front-end interfaces, or NULL in the case of an - empty list. - - - -
connect_frontend() -DESCRIPTION - - -Connects the TS output of the front-end to the input of the demux. A demux - can only be connected to a front-end registered to the demux with the function - add_frontend(). - - -It may or may not be possible to connect multiple demuxes to the same - front-end, depending on the capabilities of the HW platform. When not used, - the front-end should be released by calling disconnect_frontend(). - - -SYNOPSIS - - -int connect_frontend(dmx_demux_t⋆ demux, - dmx_frontend_t⋆ frontend); - - -PARAMETERS - - -dmx_demux_t* - demux - -Pointer to the demux API and instance data. - - -dmx_frontend_t* - frontend - -Pointer to the front-end instance data. - - -RETURNS - - -0 - -The function was completed without errors. - - --EINVAL - -Bad parameter. - - --EBUSY - -The front-end is in use. - - - -
disconnect_frontend() -DESCRIPTION - - -Disconnects the demux and a front-end previously connected by a - connect_frontend() call. - - -SYNOPSIS - - -int disconnect_frontend(dmx_demux_t⋆ demux); - - -PARAMETERS - - -dmx_demux_t* - demux - -Pointer to the demux API and instance data. - - -RETURNS - - -0 - -The function was completed without errors. - - --EINVAL - -Bad parameter. - - -
-
-Demux Callback API -This kernel-space API comprises the callback functions that deliver filtered data to the -demux client. Unlike the other APIs, these API functions are provided by the client and called -from the demux code. - -The function pointers of this abstract interface are not packed into a structure as in the -other demux APIs, because the callback functions are registered and used independent -of each other. As an example, it is possible for the API client to provide several -callback functions for receiving TS packets and no callbacks for PES packets or -sections. - -The functions that implement the callback API need not be re-entrant: when a demux -driver calls one of these functions, the driver is not allowed to call the function again before -the original call returns. If a callback is triggered by a hardware interrupt, it is recommended -to use the Linux “bottom half” mechanism or start a tasklet instead of making the callback -function call directly from a hardware interrupt. - - -
dmx_ts_cb() -DESCRIPTION - - -This function, provided by the client of the demux API, is called from the - demux code. The function is only called when filtering on this TS feed has - been enabled using the start_filtering() function. - - -Any TS packets that match the filter settings are copied to a circular buffer. The - filtered TS packets are delivered to the client using this callback function. The - size of the circular buffer is controlled by the circular_buffer_size parameter - of the set() function in the TS Feed API. It is expected that the buffer1 and - buffer2 callback parameters point to addresses within the circular buffer, but - other implementations are also possible. Note that the called party should not - try to free the memory the buffer1 and buffer2 parameters point to. - - -When this function is called, the buffer1 parameter typically points to the - start of the first undelivered TS packet within a circular buffer. The buffer2 - buffer parameter is normally NULL, except when the received TS packets have - crossed the last address of the circular buffer and ”wrapped” to the beginning - of the buffer. In the latter case the buffer1 parameter would contain an address - within the circular buffer, while the buffer2 parameter would contain the first - address of the circular buffer. - - -The number of bytes delivered with this function (i.e. buffer1_length + - buffer2_length) is usually equal to the value of callback_length parameter - given in the set() function, with one exception: if a timeout occurs before - receiving callback_length bytes of TS data, any undelivered packets are - immediately delivered to the client by calling this function. The timeout - duration is controlled by the set() function in the TS Feed API. - - -If a TS packet is received with errors that could not be fixed by the TS-level - forward error correction (FEC), the Transport_error_indicator flag of the TS - packet header should be set. The TS packet should not be discarded, as - the error can possibly be corrected by a higher layer protocol. If the called - party is slow in processing the callback, it is possible that the circular buffer - eventually fills up. If this happens, the demux driver should discard any TS - packets received while the buffer is full. The error should be indicated to the - client on the next callback by setting the success parameter to the value of - DMX_OVERRUN_ERROR. - - -The type of data returned to the callback can be selected by the new - function int (*set_type) (struct dmx_ts_feed_s* feed, int type, dmx_ts_pes_t - pes_type) which is part of the dmx_ts_feed_s struct (also cf. to the - include file ost/demux.h) The type parameter decides if the raw TS packet - (TS_PACKET) or just the payload (TS_PACKET—TS_PAYLOAD_ONLY) - should be returned. If additionally the TS_DECODER bit is set the stream - will also be sent to the hardware MPEG decoder. In this case, the second - flag decides as what kind of data the stream should be interpreted. The - possible choices are one of DMX_TS_PES_AUDIO, DMX_TS_PES_VIDEO, - DMX_TS_PES_TELETEXT, DMX_TS_PES_SUBTITLE, - DMX_TS_PES_PCR, or DMX_TS_PES_OTHER. - - -SYNOPSIS - - -int dmx_ts_cb(__u8⋆ buffer1, size_t buffer1_length, - __u8⋆ buffer2, size_t buffer2_length, dmx_ts_feed_t⋆ - source, dmx_success_t success); - - -PARAMETERS - - -__u8* buffer1 - -Pointer to the start of the filtered TS packets. - - -size_t buffer1_length - -Length of the TS data in buffer1. - - -__u8* buffer2 - -Pointer to the tail of the filtered TS packets, or NULL. - - -size_t buffer2_length - -Length of the TS data in buffer2. - - -dmx_ts_feed_t* - source - -Indicates which TS feed is the source of the callback. - - -dmx_success_t - success - -Indicates if there was an error in TS reception. - - -RETURNS - - -0 - -Continue filtering. - - --1 - -Stop filtering - has the same effect as a call to - stop_filtering() on the TS Feed API. - - - -
dmx_section_cb() -DESCRIPTION - - -This function, provided by the client of the demux API, is called from the - demux code. The function is only called when filtering of sections has been - enabled using the function start_filtering() of the section feed API. When the - demux driver has received a complete section that matches at least one section - filter, the client is notified via this callback function. Normally this function is - called for each received section; however, it is also possible to deliver multiple - sections with one callback, for example when the system load is high. If an - error occurs while receiving a section, this function should be called with - the corresponding error type set in the success field, whether or not there is - data to deliver. The Section Feed implementation should maintain a circular - buffer for received sections. However, this is not necessary if the Section Feed - API is implemented as a client of the TS Feed API, because the TS Feed - implementation then buffers the received data. The size of the circular buffer - can be configured using the set() function in the Section Feed API. If there - is no room in the circular buffer when a new section is received, the section - must be discarded. If this happens, the value of the success parameter should - be DMX_OVERRUN_ERROR on the next callback. - - -SYNOPSIS - - -int dmx_section_cb(__u8⋆ buffer1, size_t - buffer1_length, __u8⋆ buffer2, size_t - buffer2_length, dmx_section_filter_t⋆ source, - dmx_success_t success); - - -PARAMETERS - - -__u8* buffer1 - -Pointer to the start of the filtered section, e.g. within the - circular buffer of the demux driver. - - -size_t buffer1_length - -Length of the filtered section data in buffer1, including - headers and CRC. - - -__u8* buffer2 - -Pointer to the tail of the filtered section data, or NULL. - Useful to handle the wrapping of a circular buffer. - - -size_t buffer2_length - -Length of the filtered section data in buffer2, including - headers and CRC. - - -dmx_section_filter_t* - filter - -Indicates the filter that triggered the callback. - - -dmx_success_t - success - -Indicates if there was an error in section reception. - - -RETURNS - - -0 - -Continue filtering. - - --1 - -Stop filtering - has the same effect as a call to - stop_filtering() on the Section Feed API. - - -
-
-TS Feed API -A TS feed is typically mapped to a hardware PID filter on the demux chip. -Using this API, the client can set the filtering properties to start/stop filtering TS -packets on a particular TS feed. The API is defined as an abstract interface of the type -dmx_ts_feed_t. - -The functions that implement the interface should be defined static or module private. The -client can get the handle of a TS feed API by calling the function allocate_ts_feed() in the -demux API. - - -
set() -DESCRIPTION - - -This function sets the parameters of a TS feed. Any filtering in progress on the - TS feed must be stopped before calling this function. - - -SYNOPSIS - - -int set ( dmx_ts_feed_t⋆ feed, __u16 pid, size_t - callback_length, size_t circular_buffer_size, int - descramble, struct timespec timeout); - - -PARAMETERS - - -dmx_ts_feed_t* feed - -Pointer to the TS feed API and instance data. - - -__u16 pid - -PID value to filter. Only the TS packets carrying the - specified PID will be passed to the API client. - - -size_t - callback_length - -Number of bytes to deliver with each call to the - dmx_ts_cb() callback function. The value of this - parameter should be a multiple of 188. - - -size_t - circular_buffer_size - -Size of the circular buffer for the filtered TS packets. - - -int descramble - -If non-zero, descramble the filtered TS packets. - - -struct timespec - timeout - -Maximum time to wait before delivering received TS - packets to the client. - - -RETURNS - - -0 - -The function was completed without errors. - - --ENOMEM - -Not enough memory for the requested buffer size. - - --ENOSYS - -No descrambling facility available for TS. - - --EINVAL - -Bad parameter. - - - -
start_filtering() -DESCRIPTION - - -Starts filtering TS packets on this TS feed, according to its settings. The PID - value to filter can be set by the API client. All matching TS packets are - delivered asynchronously to the client, using the callback function registered - with allocate_ts_feed(). - - -SYNOPSIS - - -int start_filtering(dmx_ts_feed_t⋆ feed); - - -PARAMETERS - - -dmx_ts_feed_t* feed - -Pointer to the TS feed API and instance data. - - -RETURNS - - -0 - -The function was completed without errors. - - --EINVAL - -Bad parameter. - - - -
stop_filtering() -DESCRIPTION - - -Stops filtering TS packets on this TS feed. - - -SYNOPSIS - - -int stop_filtering(dmx_ts_feed_t⋆ feed); - - -PARAMETERS - - -dmx_ts_feed_t* feed - -Pointer to the TS feed API and instance data. - - -RETURNS - - -0 - -The function was completed without errors. - - --EINVAL - -Bad parameter. - - -
-
-Section Feed API -A section feed is a resource consisting of a PID filter and a set of section filters. Using this -API, the client can set the properties of a section feed and to start/stop filtering. The API is -defined as an abstract interface of the type dmx_section_feed_t. The functions that implement -the interface should be defined static or module private. The client can get the handle of -a section feed API by calling the function allocate_section_feed() in the demux -API. - -On demux platforms that provide section filtering in hardware, the Section Feed API -implementation provides a software wrapper for the demux hardware. Other platforms may -support only PID filtering in hardware, requiring that TS packets are converted to sections in -software. In the latter case the Section Feed API implementation can be a client of the TS -Feed API. - - -
-
-set() -DESCRIPTION - - -This function sets the parameters of a section feed. Any filtering in progress on - the section feed must be stopped before calling this function. If descrambling - is enabled, the payload_scrambling_control and address_scrambling_control - fields of received DVB datagram sections should be observed. If either one is - non-zero, the section should be descrambled either in hardware or using the - functions descramble_mac_address() and descramble_section_payload() of the - demux API. Note that according to the MPEG-2 Systems specification, only - the payloads of private sections can be scrambled while the rest of the section - data must be sent in the clear. - - -SYNOPSIS - - -int set(dmx_section_feed_t⋆ feed, __u16 pid, size_t - circular_buffer_size, int descramble, int - check_crc); - - -PARAMETERS - - -dmx_section_feed_t* - feed - -Pointer to the section feed API and instance data. - - -__u16 pid - -PID value to filter; only the TS packets carrying the - specified PID will be accepted. - - -size_t - circular_buffer_size - -Size of the circular buffer for filtered sections. - - -int descramble - -If non-zero, descramble any sections that are scrambled. - - -int check_crc - -If non-zero, check the CRC values of filtered sections. - - -RETURNS - - -0 - -The function was completed without errors. - - --ENOMEM - -Not enough memory for the requested buffer size. - - --ENOSYS - -No descrambling facility available for sections. - - --EINVAL - -Bad parameters. - - - -
allocate_filter() -DESCRIPTION - - -This function is used to allocate a section filter on the demux. It should only be - called when no filtering is in progress on this section feed. If a filter cannot be - allocated, the function fails with -ENOSPC. See in section ?? for the format of - the section filter. - - -The bitfields filter_mask and filter_value should only be modified when no - filtering is in progress on this section feed. filter_mask controls which bits of - filter_value are compared with the section headers/payload. On a binary value - of 1 in filter_mask, the corresponding bits are compared. The filter only accepts - sections that are equal to filter_value in all the tested bit positions. Any changes - to the values of filter_mask and filter_value are guaranteed to take effect only - when the start_filtering() function is called next time. The parent pointer in - the struct is initialized by the API implementation to the value of the feed - parameter. The priv pointer is not used by the API implementation, and can - thus be freely utilized by the caller of this function. Any data pointed to by the - priv pointer is available to the recipient of the dmx_section_cb() function call. - - -While the maximum section filter length (DMX_MAX_FILTER_SIZE) is - currently set at 16 bytes, hardware filters of that size are not available on all - platforms. Therefore, section filtering will often take place first in hardware, - followed by filtering in software for the header bytes that were not covered - by a hardware filter. The filter_mask field can be checked to determine how - many bytes of the section filter are actually used, and if the hardware filter will - suffice. Additionally, software-only section filters can optionally be allocated - to clients when all hardware section filters are in use. Note that on most demux - hardware it is not possible to filter on the section_length field of the section - header – thus this field is ignored, even though it is included in filter_value and - filter_mask fields. - - -SYNOPSIS - - -int allocate_filter(dmx_section_feed_t⋆ feed, - dmx_section_filter_t⋆⋆ filter); - - -PARAMETERS - - -dmx_section_feed_t* - feed - -Pointer to the section feed API and instance data. - - -dmx_section_filter_t** - filter - -Pointer to the allocated filter. - - -RETURNS - - -0 - -The function was completed without errors. - - --ENOSPC - -No filters of given type and length available. - - --EINVAL - -Bad parameters. - - - -
release_filter() -DESCRIPTION - - -This function releases all the resources of a previously allocated section filter. - The function should not be called while filtering is in progress on this section - feed. After calling this function, the caller should not try to dereference the - filter pointer. - - -SYNOPSIS - - -int release_filter ( dmx_section_feed_t⋆ feed, - dmx_section_filter_t⋆ filter); - - -PARAMETERS - - -dmx_section_feed_t* - feed - -Pointer to the section feed API and instance data. - - -dmx_section_filter_t* - filter - -I/O Pointer to the instance data of a section filter. - - -RETURNS - - -0 - -The function was completed without errors. - - --ENODEV - -No such filter allocated. - - --EINVAL - -Bad parameter. - - - -
start_filtering() -DESCRIPTION - - -Starts filtering sections on this section feed, according to its settings. Sections - are first filtered based on their PID and then matched with the section - filters allocated for this feed. If the section matches the PID filter and - at least one section filter, it is delivered to the API client. The section - is delivered asynchronously using the callback function registered with - allocate_section_feed(). - - -SYNOPSIS - - -int start_filtering ( dmx_section_feed_t⋆ feed ); - - -PARAMETERS - - -dmx_section_feed_t* - feed - -Pointer to the section feed API and instance data. - - -RETURNS - - -0 - -The function was completed without errors. - - --EINVAL - -Bad parameter. - - - -
stop_filtering() -DESCRIPTION - - -Stops filtering sections on this section feed. Note that any changes to the - filtering parameters (filter_value, filter_mask, etc.) should only be made when - filtering is stopped. - - -SYNOPSIS - - -int stop_filtering ( dmx_section_feed_t⋆ feed ); - - -PARAMETERS - - -dmx_section_feed_t* - feed - -Pointer to the section feed API and instance data. - - -RETURNS - - -0 - -The function was completed without errors. - - --EINVAL - -Bad parameter. - - - -
diff --git a/kernel/Documentation/DocBook/media/dvb/net.xml b/kernel/Documentation/DocBook/media/dvb/net.xml index a193e8694..d2e44b7e0 100644 --- a/kernel/Documentation/DocBook/media/dvb/net.xml +++ b/kernel/Documentation/DocBook/media/dvb/net.xml @@ -1,156 +1,238 @@ DVB Network API -The DVB net device enables feeding of MPE (multi protocol encapsulation) packets -received via DVB into the Linux network protocol stack, e.g. for internet via satellite -applications. It can be accessed through /dev/dvb/adapter0/net0. Data types and -and ioctl definitions can be accessed by including linux/dvb/net.h in your -application. - -
-DVB Net Data Types - -
-struct dvb_net_if - -struct dvb_net_if { - __u16 pid; - __u16 if_num; - __u8 feedtype; -#define DVB_NET_FEEDTYPE_MPE 0 /⋆ multi protocol encapsulation ⋆/ -#define DVB_NET_FEEDTYPE_ULE 1 /⋆ ultra lightweight encapsulation ⋆/ -}; - -
+The DVB net device controls the mapping of data packages that are + part of a transport stream to be mapped into a virtual network interface, + visible through the standard Linux network protocol stack. +Currently, two encapsulations are supported: + + + Multi Protocol Encapsulation (MPE) + + Ultra Lightweight Encapsulation (ULE) + + +In order to create the Linux virtual network interfaces, an application + needs to tell to the Kernel what are the PIDs and the encapsulation types + that are present on the transport stream. This is done through + /dev/dvb/adapter?/net? device node. + The data will be available via virtual dvb?_? + network interfaces, and will be controled/routed via the standard + ip tools (like ip, route, netstat, ifconfig, etc). + Data types and and ioctl definitions are defined via + linux/dvb/net.h header. -
DVB net Function Calls -To be written… - - -
NET_ADD_IF -DESCRIPTION - - -This ioctl is undocumented. Documentation is welcome. - - -SYNOPSIS - - -int ioctl(fd, int request = NET_ADD_IF, - struct dvb_net_if *if); - - -PARAMETERS - - -int fd - -File descriptor returned by a previous call to open(). - - -int request - -Equals NET_ADD_IF for this command. - - -struct dvb_net_if *if - - -Undocumented. - - + + + + + ioctl NET_ADD_IF + &manvol; + + + + NET_ADD_IF + Creates a new network interface for a given Packet ID. + + + + + + int ioctl + int fd + int request + struct dvb_net_if *net_if + + + + + + Arguments + + + fd + + &fe_fd; + + + + request + + FE_SET_TONE + + + + net_if + + pointer to &dvb-net-if; + + + + + + + Description + +The NET_ADD_IF ioctl system call selects the Packet ID (PID) that + contains a TCP/IP traffic, the type of encapsulation to be used (MPE or ULE) + and the interface number for the new interface to be created. When the + system call successfully returns, a new virtual network interface is created. +The &dvb-net-if;::ifnum field will be filled with the number of the + created interface. + &return-value-dvb; -
+ + + +struct <structname>dvb_net_if</structname> description + + + struct <structname>dvb_net_if</structname> + + &cs-def; + + + ID + Description + + + + + pid + Packet ID (PID) of the MPEG-TS that contains + data + + ifnum + number of the DVB interface. + + feedtype + Encapsulation type of the feed. It can be: + DVB_NET_FEEDTYPE_MPE for MPE encoding + or + DVB_NET_FEEDTYPE_ULE for ULE encoding. + + + + +
+
+ + + + + ioctl NET_REMOVE_IF + &manvol; + + + + NET_REMOVE_IF + Removes a network interface. + + + + + + int ioctl + int fd + int request + int ifnum + + + + + + Arguments + + + fd + + &fe_fd; + + + + request + + FE_SET_TONE + + + + net_if + + number of the interface to be removed + + + + + + + Description + +The NET_REMOVE_IF ioctl deletes an interface previously created + via &NET-ADD-IF;. -
NET_REMOVE_IF -DESCRIPTION - - -This ioctl is undocumented. Documentation is welcome. - - -SYNOPSIS - - -int ioctl(fd, int request = NET_REMOVE_IF); - - - -PARAMETERS - - -int fd - -File descriptor returned by a previous call to open(). - - -int request - -Equals NET_REMOVE_IF for this command. - - &return-value-dvb; -
+
+
+ + + + + ioctl NET_GET_IF + &manvol; + + + + NET_GET_IF + Read the configuration data of an interface created via + &NET-ADD-IF;. + + + + + + int ioctl + int fd + int request + struct dvb_net_if *net_if + + + + + + Arguments + + + fd + + &fe_fd; + + + + request + + FE_SET_TONE + + + + net_if + + pointer to &dvb-net-if; + + + + + + + Description + +The NET_GET_IF ioctl uses the interface number given by the + &dvb-net-if;::ifnum field and fills the content of &dvb-net-if; with + the packet ID and encapsulation type used on such interface. If the + interface was not created yet with &NET-ADD-IF;, it will return -1 and + fill the errno with EINVAL + error code. -
NET_GET_IF -DESCRIPTION - - -This ioctl is undocumented. Documentation is welcome. - - -SYNOPSIS - - -int ioctl(fd, int request = NET_GET_IF, - struct dvb_net_if *if); - - -PARAMETERS - - -int fd - -File descriptor returned by a previous call to open(). - - -int request - -Equals NET_GET_IF for this command. - - -struct dvb_net_if *if - - -Undocumented. - - &return-value-dvb; -
+
+
diff --git a/kernel/Documentation/DocBook/media/dvb/video.xml b/kernel/Documentation/DocBook/media/dvb/video.xml index 3ea1ca7e7..71547fcd7 100644 --- a/kernel/Documentation/DocBook/media/dvb/video.xml +++ b/kernel/Documentation/DocBook/media/dvb/video.xml @@ -1,12 +1,12 @@ DVB Video Device The DVB video device controls the MPEG2 video decoder of the DVB hardware. It -can be accessed through /dev/dvb/adapter0/video0. Data types and and -ioctl definitions can be accessed by including linux/dvb/video.h in your +can be accessed through /dev/dvb/adapter0/video0. Data types and and +ioctl definitions can be accessed by including linux/dvb/video.h in your application. Note that the DVB video device only controls decoding of the MPEG video stream, not its presentation on the TV or computer screen. On PCs this is typically handled by an -associated video4linux device, e.g. /dev/video, which allows scaling and defining output +associated video4linux device, e.g. /dev/video, which allows scaling and defining output windows. Some DVB cards don’t have their own MPEG decoder, which results in the omission of @@ -24,7 +24,7 @@ have been created to replace that functionality.
video_format_t -The video_format_t data type defined by +The video_format_t data type defined by typedef enum { @@ -74,7 +74,7 @@ typedef enum { VIDEO_SOURCE_DEMUX selects the demultiplexer (fed either by the frontend or the DVR device) as the source of the video stream. If VIDEO_SOURCE_MEMORY -is selected the stream comes from the application through the write() system +is selected the stream comes from the application through the write() system call.
diff --git a/kernel/Documentation/DocBook/media/typical_media_device.svg b/kernel/Documentation/DocBook/media/typical_media_device.svg new file mode 100644 index 000000000..f0c82f72c --- /dev/null +++ b/kernel/Documentation/DocBook/media/typical_media_device.svg @@ -0,0 +1,28 @@ + +Audio decoder +Video decoder +Audio encoder +Button Key/IR input logic +EEPROM +Sensor +System Bus +Demux +Conditional Access Module +Video encoder +Radio / Analog TV +Digital TV +PS.: picture is not complete: other blocks may be present +Webcam +Processing blocks +Smartcard +TunerFM/TV +Satellite Equipment Control (SEC) +Demod +I2C Bus (control bus) +Digital TV Frontend + +CPU +PCI, USB, SPI, I2C, ... +Bridge + DMA + diff --git a/kernel/Documentation/DocBook/media/v4l/biblio.xml b/kernel/Documentation/DocBook/media/v4l/biblio.xml index fdee6b3f3..9beb30f00 100644 --- a/kernel/Documentation/DocBook/media/v4l/biblio.xml +++ b/kernel/Documentation/DocBook/media/v4l/biblio.xml @@ -177,6 +177,24 @@ Signal - NTSC for Studio Applications" 1125-Line High-Definition Production" + + SMPTE RP 431-2 + + Society of Motion Picture and Television Engineers +(http://www.smpte.org) + + SMPTE RP 431-2:2011 "D-Cinema Quality - Reference Projector and Environment" + + + + SMPTE ST 2084 + + Society of Motion Picture and Television Engineers +(http://www.smpte.org) + + SMPTE ST 2084:2014 "High Dynamic Range Electro-Optical Transfer Function of Master Reference Displays" + + sRGB diff --git a/kernel/Documentation/DocBook/media/v4l/compat.xml b/kernel/Documentation/DocBook/media/v4l/compat.xml index a0aef85d3..5701a08ed 100644 --- a/kernel/Documentation/DocBook/media/v4l/compat.xml +++ b/kernel/Documentation/DocBook/media/v4l/compat.xml @@ -2591,6 +2591,26 @@ and &v4l2-mbus-framefmt;.
+
+ V4L2 in Linux 4.4 + + + Renamed V4L2_TUNER_ADC to +V4L2_TUNER_SDR. The use of +V4L2_TUNER_ADC is deprecated now. + + + + Added V4L2_CID_RF_TUNER_RF_GAIN +RF Tuner control. + + + Added transmitter support for Software Defined Radio (SDR) +Interface. + + +
+
Relation of V4L2 to other Linux multimedia APIs diff --git a/kernel/Documentation/DocBook/media/v4l/controls.xml b/kernel/Documentation/DocBook/media/v4l/controls.xml index 4e9462f1a..f13a42909 100644 --- a/kernel/Documentation/DocBook/media/v4l/controls.xml +++ b/kernel/Documentation/DocBook/media/v4l/controls.xml @@ -3414,7 +3414,7 @@ giving priority to the center of the metered area. V4L2_EXPOSURE_METERING_MATRIX  A multi-zone metering. The light intensity is measured -in several points of the frame and the the results are combined. The +in several points of the frame and the results are combined. The algorithm of the zones selection and their significance in calculating the final value is device dependent. @@ -4863,7 +4863,7 @@ interface and may change in the future. - The Image Source control class is intended for low-level control of + The Image Process control class is intended for low-level control of image processing functions. Unlike V4L2_CID_IMAGE_SOURCE_CLASS, the controls in this class affect processing the image, and do not control capturing @@ -4871,7 +4871,7 @@ interface and may change in the future. - Image Source Control IDs + Image Process Control IDs @@ -5417,6 +5417,18 @@ set. Unit is in Hz. The range and step are driver-specific. Enables/disables IF automatic gain control (AGC) + + V4L2_CID_RF_TUNER_RF_GAIN  + integer + + + The RF amplifier is the very first +amplifier on the receiver signal path, just right after the antenna input. +The difference between the LNA gain and the RF gain in this document is that +the LNA gain is integrated in the tuner chip while the RF gain is a separate +chip. There may be both RF and LNA gain controls in the same device. +The range and step are driver-specific. + V4L2_CID_RF_TUNER_LNA_GAIN  integer @@ -5425,6 +5437,8 @@ set. Unit is in Hz. The range and step are driver-specific. LNA (low noise amplifier) gain is first gain stage on the RF tuner signal path. It is located very close to tuner antenna input. Used when V4L2_CID_RF_TUNER_LNA_GAIN_AUTO is not set. +See V4L2_CID_RF_TUNER_RF_GAIN to understand how RF gain +and LNA gain differs from the each others. The range and step are driver-specific. diff --git a/kernel/Documentation/DocBook/media/v4l/dev-sdr.xml b/kernel/Documentation/DocBook/media/v4l/dev-sdr.xml index f8903568a..a659771f7 100644 --- a/kernel/Documentation/DocBook/media/v4l/dev-sdr.xml +++ b/kernel/Documentation/DocBook/media/v4l/dev-sdr.xml @@ -28,6 +28,16 @@ Devices supporting the SDR receiver interface set the capabilities field of &v4l2-capability; returned by the &VIDIOC-QUERYCAP; ioctl. That flag means the device has an Analog to Digital Converter (ADC), which is a mandatory element for the SDR receiver. + + +Devices supporting the SDR transmitter interface set the +V4L2_CAP_SDR_OUTPUT and +V4L2_CAP_MODULATOR flag in the +capabilities field of &v4l2-capability; +returned by the &VIDIOC-QUERYCAP; ioctl. That flag means the device has an +Digital to Analog Converter (DAC), which is a mandatory element for the SDR transmitter. + + At least one of the read/write, streaming or asynchronous I/O methods must be supported. @@ -39,15 +49,16 @@ be supported. SDR devices can support controls, and must support the tuner ioctls. Tuner ioctls are used -for setting the ADC sampling rate (sampling frequency) and the possible RF tuner -frequency. +for setting the ADC/DAC sampling rate (sampling frequency) and the possible +radio frequency (RF). -The V4L2_TUNER_ADC tuner type is used for ADC tuners, and -the V4L2_TUNER_RF tuner type is used for RF tuners. The -tuner index of the RF tuner (if any) must always follow the ADC tuner index. -Normally the ADC tuner is #0 and the RF tuner is #1. +The V4L2_TUNER_SDR tuner type is used for setting SDR +device ADC/DAC frequency, and the V4L2_TUNER_RF +tuner type is used for setting radio frequency. +The tuner index of the RF tuner (if any) must always follow the SDR tuner index. +Normally the SDR tuner is #0 and the RF tuner is #1. @@ -59,9 +70,9 @@ The &VIDIOC-S-HW-FREQ-SEEK; ioctl is not supported. Data Format Negotiation -The SDR capture device uses the format ioctls to -select the capture format. Both the sampling resolution and the data streaming -format are bound to that selectable format. In addition to the basic +The SDR device uses the format ioctls to +select the capture and output format. Both the sampling resolution and the data +streaming format are bound to that selectable format. In addition to the basic format ioctls, the &VIDIOC-ENUM-FMT; ioctl must be supported as well. @@ -69,7 +80,8 @@ must be supported as well. To use the format ioctls applications set the type field of a &v4l2-format; to -V4L2_BUF_TYPE_SDR_CAPTURE and use the &v4l2-sdr-format; +V4L2_BUF_TYPE_SDR_CAPTURE or +V4L2_BUF_TYPE_SDR_OUTPUT and use the &v4l2-sdr-format; sdr member of the fmt union as needed per the desired operation. Currently there is two fields, pixelformat and diff --git a/kernel/Documentation/DocBook/media/v4l/io.xml b/kernel/Documentation/DocBook/media/v4l/io.xml index 1c17f802b..da654031e 100644 --- a/kernel/Documentation/DocBook/media/v4l/io.xml +++ b/kernel/Documentation/DocBook/media/v4l/io.xml @@ -841,15 +841,15 @@ is the file descriptor associated with a DMABUF buffer. __u32 reserved2 - A place holder for future extensions. Applications -should set this to 0. + A place holder for future extensions. Drivers and applications +must set this to 0. __u32 reserved - A place holder for future extensions. Applications -should set this to 0. + A place holder for future extensions. Drivers and applications +must set this to 0. @@ -930,8 +930,8 @@ should set this to 0.__u32reserved[11] - Reserved for future use. Should be zeroed by an - application. + Reserved for future use. Should be zeroed by drivers and + applications. @@ -1006,8 +1006,14 @@ should set this to 0. V4L2_BUF_TYPE_SDR_CAPTURE 11 - Buffer for Software Defined Radio (SDR), see . + Buffer for Software Defined Radio (SDR) capture stream, see + . + + + V4L2_BUF_TYPE_SDR_OUTPUT + 12 + Buffer for Software Defined Radio (SDR) output stream, see + . @@ -1127,6 +1133,18 @@ passed on to a DMA-capable hardware unit for further processing or output. Typically applications shall use this flag for output buffers if the data in this buffer has not been created by the CPU but by some DMA-capable unit, in which case caches have not been used. + + + V4L2_BUF_FLAG_LAST + 0x00100000 + Last buffer produced by the hardware. mem2mem codec drivers +set this flag on the capture queue for the last buffer when the +VIDIOC_QUERYBUF or +VIDIOC_DQBUF ioctl is called. Due to hardware +limitations, the last buffer may be empty. In this case the driver will set the +bytesused field to 0, regardless of the format. Any +Any subsequent call to the VIDIOC_DQBUF ioctl +will not block anymore, but return an &EPIPE;. V4L2_BUF_FLAG_TIMESTAMP_MASK @@ -1155,7 +1173,7 @@ in which case caches have not been used. The buffer timestamp has been taken from the CLOCK_MONOTONIC clock. To access the same clock outside V4L2, use - clock_gettime(2) . + clock_gettime(2). V4L2_BUF_FLAG_TIMESTAMP_COPY diff --git a/kernel/Documentation/DocBook/media/v4l/media-func-open.xml b/kernel/Documentation/DocBook/media/v4l/media-func-open.xml index f7df034dc..122374a3e 100644 --- a/kernel/Documentation/DocBook/media/v4l/media-func-open.xml +++ b/kernel/Documentation/DocBook/media/v4l/media-func-open.xml @@ -44,7 +44,7 @@ To open a media device applications call open() with the desired device name. The function has no side effects; the device configuration remain unchanged. - When the device is opened in read-only mode, attemps to modify its + When the device is opened in read-only mode, attempts to modify its configuration will result in an error, and errno will be set to EBADF. diff --git a/kernel/Documentation/DocBook/media/v4l/media-ioc-device-info.xml b/kernel/Documentation/DocBook/media/v4l/media-ioc-device-info.xml index 2ce521419..b0a21ac30 100644 --- a/kernel/Documentation/DocBook/media/v4l/media-ioc-device-info.xml +++ b/kernel/Documentation/DocBook/media/v4l/media-ioc-device-info.xml @@ -102,7 +102,7 @@ __u32 - media_version + driver_version Media device driver version, formatted with the KERNEL_VERSION() macro. Together with the driver field this identifies a particular diff --git a/kernel/Documentation/DocBook/media/v4l/pixfmt-y16-be.xml b/kernel/Documentation/DocBook/media/v4l/pixfmt-y16-be.xml new file mode 100644 index 000000000..cea53e1ea --- /dev/null +++ b/kernel/Documentation/DocBook/media/v4l/pixfmt-y16-be.xml @@ -0,0 +1,81 @@ + + + V4L2_PIX_FMT_Y16_BE ('Y16 ' | (1 << 31)) + &manvol; + + + V4L2_PIX_FMT_Y16_BE + Grey-scale image + + + Description + + This is a grey-scale image with a depth of 16 bits per +pixel. The most significant byte is stored at lower memory addresses +(big-endian). Note the actual sampling precision may be lower than +16 bits, for example 10 bits per pixel with values in range 0 to +1023. + + + <constant>V4L2_PIX_FMT_Y16_BE</constant> 4 × 4 +pixel image + + + Byte Order. + Each cell is one byte. + + + + + + start + 0: + Y'00high + Y'00low + Y'01high + Y'01low + Y'02high + Y'02low + Y'03high + Y'03low + + + start + 8: + Y'10high + Y'10low + Y'11high + Y'11low + Y'12high + Y'12low + Y'13high + Y'13low + + + start + 16: + Y'20high + Y'20low + Y'21high + Y'21low + Y'22high + Y'22low + Y'23high + Y'23low + + + start + 24: + Y'30high + Y'30low + Y'31high + Y'31low + Y'32high + Y'32low + Y'33high + Y'33low + + + + + + + + + diff --git a/kernel/Documentation/DocBook/media/v4l/pixfmt.xml b/kernel/Documentation/DocBook/media/v4l/pixfmt.xml index fcde4e202..d871245d2 100644 --- a/kernel/Documentation/DocBook/media/v4l/pixfmt.xml +++ b/kernel/Documentation/DocBook/media/v4l/pixfmt.xml @@ -155,6 +155,14 @@ see . This information supplements the colorspace and must be set by the driver for capture streams and by the application for output streams, +see . + + + &v4l2-xfer-func; + xfer_func + This information supplements the +colorspace and must be set by the driver for +capture streams and by the application for output streams, see . @@ -190,8 +198,8 @@ see . __u16 reserved[6] - Reserved for future extensions. Should be zeroed by the - application. + Reserved for future extensions. Should be zeroed by drivers and + applications. @@ -262,13 +270,21 @@ see . This information supplements the colorspace and must be set by the driver for capture streams and by the application for output streams, +see . + + + &v4l2-xfer-func; + xfer_func + This information supplements the +colorspace and must be set by the driver for +capture streams and by the application for output streams, see . __u8 - reserved[8] - Reserved for future extensions. Should be zeroed by the - application. + reserved[7] + Reserved for future extensions. Should be zeroed by drivers + and applications. @@ -476,15 +492,16 @@ is also very useful.
Defining Colorspaces in V4L2 - In V4L2 colorspaces are defined by three values. The first is the colorspace -identifier (&v4l2-colorspace;) which defines the chromaticities, the transfer + In V4L2 colorspaces are defined by four values. The first is the colorspace +identifier (&v4l2-colorspace;) which defines the chromaticities, the default transfer function, the default Y'CbCr encoding and the default quantization method. The second -is the Y'CbCr encoding identifier (&v4l2-ycbcr-encoding;) to specify non-standard -Y'CbCr encodings and the third is the quantization identifier (&v4l2-quantization;) -to specify non-standard quantization methods. Most of the time only the colorspace -field of &v4l2-pix-format; or &v4l2-pix-format-mplane; needs to be filled in. Note -that the default R'G'B' quantization is full range for all colorspaces except for -BT.2020 which uses limited range R'G'B' quantization. +is the transfer function identifier (&v4l2-xfer-func;) to specify non-standard +transfer functions. The third is the Y'CbCr encoding identifier (&v4l2-ycbcr-encoding;) +to specify non-standard Y'CbCr encodings and the fourth is the quantization identifier +(&v4l2-quantization;) to specify non-standard quantization methods. Most of the time +only the colorspace field of &v4l2-pix-format; or &v4l2-pix-format-mplane; needs to +be filled in. Note that the default R'G'B' quantization is full range for all +colorspaces except for BT.2020 which uses limited range R'G'B' quantization.
V4L2 Colorspaces @@ -497,6 +514,11 @@ BT.2020 which uses limited range R'G'B' quantization. + + V4L2_COLORSPACE_DEFAULT + The default colorspace. This can be used by applications to let the + driver fill in the colorspace. + V4L2_COLORSPACE_SMPTE170M See . @@ -517,6 +539,10 @@ BT.2020 which uses limited range R'G'B' quantization. V4L2_COLORSPACE_BT2020 See . + + V4L2_COLORSPACE_DCI_P3 + See . + V4L2_COLORSPACE_SMPTE240M See . @@ -533,6 +559,60 @@ BT.2020 which uses limited range R'G'B' quantization. V4L2_COLORSPACE_JPEG See . + + V4L2_COLORSPACE_RAW + The raw colorspace. This is used for raw image capture where + the image is minimally processed and is using the internal colorspace + of the device. The software that processes an image using this + 'colorspace' will have to know the internals of the capture device. + + + +
+ + + V4L2 Transfer Function + + &cs-def; + + + Identifier + Details + + + + + V4L2_XFER_FUNC_DEFAULT + Use the default transfer function as defined by the colorspace. + + + V4L2_XFER_FUNC_709 + Use the Rec. 709 transfer function. + + + V4L2_XFER_FUNC_SRGB + Use the sRGB transfer function. + + + V4L2_XFER_FUNC_ADOBERGB + Use the AdobeRGB transfer function. + + + V4L2_XFER_FUNC_SMPTE240M + Use the SMPTE 240M transfer function. + + + V4L2_XFER_FUNC_NONE + Do not use a transfer function (i.e. use linear RGB values). + + + V4L2_XFER_FUNC_DCI_P3 + Use the DCI-P3 transfer function. + + + V4L2_XFER_FUNC_SMPTE2084 + Use the SMPTE 2084 transfer function. +
@@ -624,7 +704,8 @@ is mapped to [16…235]. Cb and Cr are mapped from [-0.5…0.5] to [16
Colorspace SMPTE 170M (<constant>V4L2_COLORSPACE_SMPTE170M</constant>) The standard defines the colorspace used by NTSC and PAL and by SDTV -in general. The default Y'CbCr encoding is V4L2_YCBCR_ENC_601. +in general. The default transfer function is V4L2_XFER_FUNC_709. +The default Y'CbCr encoding is V4L2_YCBCR_ENC_601. The default Y'CbCr quantization is limited range. The chromaticities of the primary colors and the white reference are: @@ -706,7 +787,8 @@ rarely seen.
Colorspace Rec. 709 (<constant>V4L2_COLORSPACE_REC709</constant>) - The standard defines the colorspace used by HDTV in general. The default + The standard defines the colorspace used by HDTV in general. +The default transfer function is V4L2_XFER_FUNC_709. The default Y'CbCr encoding is V4L2_YCBCR_ENC_709. The default Y'CbCr quantization is limited range. The chromaticities of the primary colors and the white reference are:
@@ -817,9 +899,11 @@ The xvYCC encodings always use full range quantization.
Colorspace sRGB (<constant>V4L2_COLORSPACE_SRGB</constant>) - The standard defines the colorspace used by most webcams and computer graphics. The -default Y'CbCr encoding is V4L2_YCBCR_ENC_SYCC. The default Y'CbCr quantization -is full range. The chromaticities of the primary colors and the white reference are: + The standard defines the colorspace used by most webcams +and computer graphics. The default transfer function is V4L2_XFER_FUNC_SRGB. +The default Y'CbCr encoding is V4L2_YCBCR_ENC_SYCC. The default Y'CbCr +quantization is full range. The chromaticities of the primary colors and the white +reference are:
sRGB Chromaticities @@ -896,6 +980,7 @@ values before quantization, but this encoding does not do that. Colorspace Adobe RGB (<constant>V4L2_COLORSPACE_ADOBERGB</constant>) The standard defines the colorspace used by computer graphics that use the AdobeRGB colorspace. This is also known as the standard. +The default transfer function is V4L2_XFER_FUNC_ADOBERGB. The default Y'CbCr encoding is V4L2_YCBCR_ENC_601. The default Y'CbCr quantization is limited range. The chromaticities of the primary colors and the white reference are: @@ -967,7 +1052,8 @@ SMPTE 170M/BT.601. The Y'CbCr quantization is limited range.
Colorspace BT.2020 (<constant>V4L2_COLORSPACE_BT2020</constant>) The standard defines the colorspace used by Ultra-high definition -television (UHDTV). The default Y'CbCr encoding is V4L2_YCBCR_ENC_BT2020. +television (UHDTV). The default transfer function is V4L2_XFER_FUNC_709. +The default Y'CbCr encoding is V4L2_YCBCR_ENC_BT2020. The default R'G'B' quantization is limited range (!), and so is the default Y'CbCr quantization. The chromaticities of the primary colors and the white reference are:
@@ -1080,10 +1166,74 @@ clamped to the range [-0.5…0.5]. The Y'CbCr quantization is limited range clamped to the range [-0.5…0.5]. The Yc'CbcCrc quantization is limited range. +
+ Colorspace DCI-P3 (<constant>V4L2_COLORSPACE_DCI_P3</constant>) + The standard defines the colorspace used by cinema +projectors that use the DCI-P3 colorspace. +The default transfer function is V4L2_XFER_FUNC_DCI_P3. +The default Y'CbCr encoding is V4L2_YCBCR_ENC_709. Note that this +colorspace does not specify a Y'CbCr encoding since it is not meant to be encoded +to Y'CbCr. So this default Y'CbCr encoding was picked because it is the HDTV +encoding. The default Y'CbCr quantization is limited range. The chromaticities of +the primary colors and the white reference are: +
+ DCI-P3 Chromaticities + + &cs-str; + + + Color + x + y + + + + + Red + 0.6800 + 0.3200 + + + Green + 0.2650 + 0.6900 + + + Blue + 0.1500 + 0.0600 + + + White Reference + 0.3140 + 0.3510 + + + +
+ + + Transfer function: + + L' = L1/2.6 + + + + Inverse Transfer function: + + L = L'2.6 + + + + Y'CbCr encoding is not specified. V4L2 defaults to Rec. 709. +
+
Colorspace SMPTE 240M (<constant>V4L2_COLORSPACE_SMPTE240M</constant>) - The standard was an interim standard used during the early days of HDTV (1988-1998). -It has been superseded by Rec. 709. The default Y'CbCr encoding is V4L2_YCBCR_ENC_SMPTE240M. + The standard was an interim standard used during +the early days of HDTV (1988-1998). It has been superseded by Rec. 709. +The default transfer function is V4L2_XFER_FUNC_SMPTE240M. +The default Y'CbCr encoding is V4L2_YCBCR_ENC_SMPTE240M. The default Y'CbCr quantization is limited range. The chromaticities of the primary colors and the white reference are: @@ -1156,8 +1306,10 @@ clamped to the range [-0.5…0.5]. The Y'CbCr quantization is limited range
Colorspace NTSC 1953 (<constant>V4L2_COLORSPACE_470_SYSTEM_M</constant>) This standard defines the colorspace used by NTSC in 1953. In practice this -colorspace is obsolete and SMPTE 170M should be used instead. The default Y'CbCr encoding -is V4L2_YCBCR_ENC_601. The default Y'CbCr quantization is limited range. +colorspace is obsolete and SMPTE 170M should be used instead. +The default transfer function is V4L2_XFER_FUNC_709. +The default Y'CbCr encoding is V4L2_YCBCR_ENC_601. +The default Y'CbCr quantization is limited range. The chromaticities of the primary colors and the white reference are:
NTSC 1953 Chromaticities @@ -1234,8 +1386,10 @@ This transform is identical to one defined in SMPTE 170M/BT.601.
Colorspace EBU Tech. 3213 (<constant>V4L2_COLORSPACE_470_SYSTEM_BG</constant>) The standard defines the colorspace used by PAL/SECAM in 1975. In practice this -colorspace is obsolete and SMPTE 170M should be used instead. The default Y'CbCr encoding -is V4L2_YCBCR_ENC_601. The default Y'CbCr quantization is limited range. +colorspace is obsolete and SMPTE 170M should be used instead. +The default transfer function is V4L2_XFER_FUNC_709. +The default Y'CbCr encoding is V4L2_YCBCR_ENC_601. +The default Y'CbCr quantization is limited range. The chromaticities of the primary colors and the white reference are:
EBU Tech. 3213 Chromaticities @@ -1308,7 +1462,8 @@ This transform is identical to one defined in SMPTE 170M/BT.601.
Colorspace JPEG (<constant>V4L2_COLORSPACE_JPEG</constant>) This colorspace defines the colorspace used by most (Motion-)JPEG formats. The chromaticities -of the primary colors and the white reference are identical to sRGB. The Y'CbCr encoding is +of the primary colors and the white reference are identical to sRGB. The transfer +function use is V4L2_XFER_FUNC_SRGB. The Y'CbCr encoding is V4L2_YCBCR_ENC_601 with full range quantization where Y' is scaled to [0…255] and Cb/Cr are scaled to [-128…128] and then clipped to [-128…127]. @@ -1321,6 +1476,41 @@ and V4L2_QUANTIZATION_FULL_RANGE.
+
+ Detailed Transfer Function Descriptions +
+ Transfer Function SMPTE 2084 (<constant>V4L2_XFER_FUNC_SMPTE2084</constant>) + The standard defines the transfer function used by +High Dynamic Range content. + + + Constants: + + m1 = (2610 / 4096) / 4 + m2 = (2523 / 4096) * 128 + c1 = 3424 / 4096 + c2 = (2413 / 4096) * 32 + c3 = (2392 / 4096) * 32 + + + + Transfer function: + + L' = ((c1 + c2 * Lm1) / (1 + c3 * Lm1))m2 + + + + + + Inverse Transfer function: + + L = (max(L'1/m2 - c1, 0) / (c2 - c3 * L'1/m2))1/m1 + + + +
+
+
Indexed Format @@ -1429,6 +1619,7 @@ information. &sub-y12; &sub-y10b; &sub-y16; + &sub-y16-be; &sub-uv8; &sub-yuyv; &sub-uyvy; @@ -1541,7 +1732,7 @@ extended control V4L2_CID_MPEG_STREAM_TYPE, see
SDR Formats - These formats are used for SDR Capture + These formats are used for SDR interface only. &sub-sdr-cu08; diff --git a/kernel/Documentation/DocBook/media/v4l/remote_controllers.xml b/kernel/Documentation/DocBook/media/v4l/remote_controllers.xml index 5124a6c4d..b86844e80 100644 --- a/kernel/Documentation/DocBook/media/v4l/remote_controllers.xml +++ b/kernel/Documentation/DocBook/media/v4l/remote_controllers.xml @@ -284,7 +284,7 @@ different IR's. Due to that, V4L2 API now specifies a standard for mapping Media
-It should be noticed that, sometimes, there some fundamental missing keys at some cheaper IR's. Due to that, it is recommended to: +It should be noted that, sometimes, there some fundamental missing keys at some cheaper IR's. Due to that, it is recommended to: Notes diff --git a/kernel/Documentation/DocBook/media/v4l/subdev-formats.xml b/kernel/Documentation/DocBook/media/v4l/subdev-formats.xml index 2588ad781..4e73345e3 100644 --- a/kernel/Documentation/DocBook/media/v4l/subdev-formats.xml +++ b/kernel/Documentation/DocBook/media/v4l/subdev-formats.xml @@ -50,8 +50,16 @@ capture streams and by the application for output streams, see . - __u32 - reserved[6] + &v4l2-xfer-func; + xfer_func + This information supplements the +colorspace and must be set by the driver for +capture streams and by the application for output streams, +see . + + + __u16 + reserved[11] Reserved for future extensions. Applications and drivers must set the array to zero. diff --git a/kernel/Documentation/DocBook/media/v4l/subdev-image-processing-crop.svg b/kernel/Documentation/DocBook/media/v4l/subdev-image-processing-crop.svg new file mode 100644 index 000000000..18b0f5de9 --- /dev/null +++ b/kernel/Documentation/DocBook/media/v4l/subdev-image-processing-crop.svg @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + sink + crop + selection + + + + + + sink media + bus format + + + source media + bus format + + + + + + + + + + + + + + + + + + + + + pad 1 (source) + + + + + + + + + + + + + pad 0 (sink) + + diff --git a/kernel/Documentation/DocBook/media/v4l/subdev-image-processing-full.svg b/kernel/Documentation/DocBook/media/v4l/subdev-image-processing-full.svg new file mode 100644 index 000000000..3322cf4c0 --- /dev/null +++ b/kernel/Documentation/DocBook/media/v4l/subdev-image-processing-full.svg @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pad 0 (sink) + + + pad 2 (source) + + + + + + + + + + + + + + sink media + bus format + + + + + + + + + + + sink compose + selection (scaling) + + + + + + + source media + bus format + + + + + + + + + + + sink compose + bounds selection + + + + + + + + + + + + + pad 1 (sink) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pad 3 (source) + + + sink + crop + selection + + + source + crop + selection + + + + + + + + + + + + + + + + + + + + + + diff --git a/kernel/Documentation/DocBook/media/v4l/subdev-image-processing-scaling-multi-source.svg b/kernel/Documentation/DocBook/media/v4l/subdev-image-processing-scaling-multi-source.svg new file mode 100644 index 000000000..2340c0f8b --- /dev/null +++ b/kernel/Documentation/DocBook/media/v4l/subdev-image-processing-scaling-multi-source.svg @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + sink + crop + selection + + + + + + sink media + bus format + + + + + + + + + + + sink compose + selection (scaling) + + + + + + + source + crop + selection + + + source media + bus format + + + + + + + + + + + + + + + + + + + + + pad 1 (source) + + + + + + + + + + + + + pad 0 (sink) + + + + + + + + + + + + + + + + + + + + + + pad 2 (source) + + + + + + + + + + + + diff --git a/kernel/Documentation/DocBook/media/v4l/v4l2.xml b/kernel/Documentation/DocBook/media/v4l/v4l2.xml index e98caa1c3..7e6164335 100644 --- a/kernel/Documentation/DocBook/media/v4l/v4l2.xml +++ b/kernel/Documentation/DocBook/media/v4l/v4l2.xml @@ -151,9 +151,18 @@ Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab, structs, ioctls) must be noted in more detail in the history chapter (compat.xml), along with the possible impact on existing drivers and applications. --> + + 4.4 + 2015-05-26 + ap + Renamed V4L2_TUNER_ADC to V4L2_TUNER_SDR. +Added V4L2_CID_RF_TUNER_RF_GAIN control. +Added transmitter support for Software Defined Radio (SDR) Interface. + + - 3.21 + 4.1 2015-02-13 mcc Fix documentation for media controller device nodes and add support for DVB device nodes. @@ -557,7 +566,7 @@ and discussions on the V4L mailing list. Video for Linux Two API Specification - Revision 3.19 + Revision 4.4 &sub-common; diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml index 9b700a5f4..8ffe74f84 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml @@ -134,7 +134,8 @@ information. __u32 reserved[8] - A place holder for future extensions. + A place holder for future extensions. Drivers and applications +must set the array to zero. diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml index 9215627b0..73eb5cfe6 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml @@ -197,7 +197,17 @@ be muted when playing back at a non-standard speed. this command does nothing. This command has two flags: if V4L2_DEC_CMD_STOP_TO_BLACK is set, then the decoder will set the picture to black after it stopped decoding. Otherwise the last image will -repeat. If V4L2_DEC_CMD_STOP_IMMEDIATELY is set, then the decoder +repeat. mem2mem decoders will stop producing new frames altogether. They will send +a V4L2_EVENT_EOS event when the last frame has been decoded +and all frames are ready to be dequeued and will set the +V4L2_BUF_FLAG_LAST buffer flag on the last buffer of the +capture queue to indicate there will be no new buffers produced to dequeue. This +buffer may be empty, indicated by the driver setting the +bytesused field to 0. Once the +V4L2_BUF_FLAG_LAST flag was set, the +VIDIOC_DQBUF ioctl will not block anymore, +but return an &EPIPE;. +If V4L2_DEC_CMD_STOP_IMMEDIATELY is set, then the decoder stops immediately (ignoring the pts value), otherwise it will keep decoding until timestamp >= pts or until the last of the pending data from its internal buffers was decoded. diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-dqevent.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-dqevent.xml index 50ccd3394..c9c3c7713 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-dqevent.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-dqevent.xml @@ -133,7 +133,10 @@ struct timespec timestamp - Event timestamp. + Event timestamp. The timestamp has been taken from the + CLOCK_MONOTONIC clock. To access the + same clock outside V4L2, use clock_gettime(2). + u32 diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml index 0619ca5d2..70a4a08e9 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml @@ -129,7 +129,15 @@ this command. encoding will continue until the end of the current Group Of Pictures, otherwise encoding will stop immediately. When the encoder is already stopped, this command does -nothing. +nothing. mem2mem encoders will send a V4L2_EVENT_EOS event +when the last frame has been encoded and all frames are ready to be dequeued and +will set the V4L2_BUF_FLAG_LAST buffer flag on the last +buffer of the capture queue to indicate there will be no new buffers produced to +dequeue. This buffer may be empty, indicated by the driver setting the +bytesused field to 0. Once the +V4L2_BUF_FLAG_LAST flag was set, the +VIDIOC_DQBUF ioctl will not block anymore, +but return an &EPIPE;. V4L2_ENC_CMD_PAUSE diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-enum-frameintervals.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-enum-frameintervals.xml index 5fd72c4c3..7c839ab0a 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-enum-frameintervals.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-enum-frameintervals.xml @@ -217,7 +217,8 @@ enumerated. __u32 reserved[2] - Reserved space for future use. + Reserved space for future use. Must be zeroed by drivers and + applications. diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml index a78454b5a..9ed68ac8f 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-enum-framesizes.xml @@ -223,7 +223,8 @@ application should zero out all members except for the __u32 reserved[2] - Reserved space for future use. + Reserved space for future use. Must be zeroed by drivers and + applications. diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-expbuf.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-expbuf.xml index 4165e7bfa..0ae0b6a91 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-expbuf.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-expbuf.xml @@ -62,28 +62,28 @@ buffer as a DMABUF file at any time after buffers have been allocated with the &VIDIOC-REQBUFS; ioctl. To export a buffer, applications fill &v4l2-exportbuffer;. The - type field is set to the same buffer type as was -previously used with &v4l2-requestbuffers; type . -Applications must also set the index field. Valid +type field is set to the same buffer type as was +previously used with &v4l2-requestbuffers; type. +Applications must also set the index field. Valid index numbers range from zero to the number of buffers allocated with -&VIDIOC-REQBUFS; (&v4l2-requestbuffers; count ) -minus one. For the multi-planar API, applications set the plane - field to the index of the plane to be exported. Valid planes +&VIDIOC-REQBUFS; (&v4l2-requestbuffers; count) +minus one. For the multi-planar API, applications set the plane +field to the index of the plane to be exported. Valid planes range from zero to the maximal number of valid planes for the currently active -format. For the single-planar API, applications must set plane - to zero. Additional flags may be posted in the -flags field. Refer to a manual for open() for details. +format. For the single-planar API, applications must set plane +to zero. Additional flags may be posted in the flags +field. Refer to a manual for open() for details. Currently only O_CLOEXEC, O_RDONLY, O_WRONLY, and O_RDWR are supported. All other fields must be set to zero. In the case of multi-planar API, every plane is exported separately using -multiple VIDIOC_EXPBUF calls. +multiple VIDIOC_EXPBUF calls. - After calling VIDIOC_EXPBUF the fd - field will be set by a driver. This is a DMABUF file +After calling VIDIOC_EXPBUF the fd +field will be set by a driver. This is a DMABUF file descriptor. The application may pass it to other DMABUF-aware devices. Refer to DMABUF importing for details about importing DMABUF files into V4L2 nodes. It is recommended to close a DMABUF file when it -is no longer used to allow the associated memory to be reclaimed. +is no longer used to allow the associated memory to be reclaimed. @@ -170,9 +170,9 @@ multi-planar API. Otherwise this value must be set to zero. __u32 flags - Flags for the newly created file, currently only -O_CLOEXEC , O_RDONLY, O_WRONLY -, and O_RDWR are supported, refer to the manual + Flags for the newly created file, currently only +O_CLOEXEC, O_RDONLY, O_WRONLY, +and O_RDWR are supported, refer to the manual of open() for more details. @@ -184,7 +184,8 @@ of open() for more details. __u32 reserved[11] - Reserved field for future use. Must be set to zero. + Reserved field for future use. Drivers and applications must +set the array to zero. @@ -199,9 +200,9 @@ of open() for more details. EINVAL A queue is not in MMAP mode or DMABUF exporting is not -supported or flags or type - or index or plane - fields are invalid. +supported or flags or type +or index or plane fields +are invalid. diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml index 764b635ed..06952d7cc 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml @@ -7,6 +7,8 @@ VIDIOC_G_DV_TIMINGS VIDIOC_S_DV_TIMINGS + VIDIOC_SUBDEV_G_DV_TIMINGS + VIDIOC_SUBDEV_S_DV_TIMINGS Get or set DV timings for input or output @@ -34,7 +36,7 @@ request - VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS + VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS, VIDIOC_SUBDEV_G_DV_TIMINGS, VIDIOC_SUBDEV_S_DV_TIMINGS diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-g-edid.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-g-edid.xml index 6df40db4c..2702536bb 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-g-edid.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-g-edid.xml @@ -7,6 +7,8 @@ VIDIOC_G_EDID VIDIOC_S_EDID + VIDIOC_SUBDEV_G_EDID + VIDIOC_SUBDEV_S_EDID Get or set the EDID of a video receiver/transmitter @@ -42,7 +44,7 @@ request - VIDIOC_G_EDID, VIDIOC_S_EDID + VIDIOC_G_EDID, VIDIOC_S_EDID, VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_S_EDID @@ -82,6 +84,13 @@ If blocks have to be retrieved from the sink, then this call will block until they have been read. + If start_block and blocks are + both set to 0 when VIDIOC_G_EDID is called, then the driver will + set blocks to the total number of available EDID blocks + and it will return 0 without copying any data. This is an easy way to discover how many + EDID blocks there are. Note that if there are no EDID blocks available at all, then + the driver will set blocks to 0 and it returns 0. + To set the EDID blocks of a receiver the application has to fill in the pad, blocks and edid fields and set start_block to 0. It is not possible to set part of an EDID, diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml index c5bdbfcc4..842536aae 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml @@ -197,6 +197,13 @@ Valid if this control is of type V4L2_CTRL_TYPE_U8. p_u16 A pointer to a matrix control of unsigned 16-bit values. Valid if this control is of type V4L2_CTRL_TYPE_U16. + + + + __u32 * + p_u32 + A pointer to a matrix control of unsigned 32-bit values. +Valid if this control is of type V4L2_CTRL_TYPE_U32. diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml index 4fe19a7a9..ffcb44825 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-g-fmt.xml @@ -175,7 +175,7 @@ capture and output devices. &v4l2-sdr-format; sdr Definition of a data format, see -, used by SDR capture devices. +, used by SDR capture and output devices. diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml index 7068b599a..96e17b344 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-g-modulator.xml @@ -78,6 +78,12 @@ different audio modulation if the request cannot be satisfied. However this is a write-only ioctl, it does not return the actual audio modulation selected. + SDR specific modulator types are +V4L2_TUNER_SDR and V4L2_TUNER_RF. +For SDR devices txsubchans field must be +initialized to zero. +The term 'modulator' means SDR transmitter in this context. + To change the radio frequency the &VIDIOC-S-FREQUENCY; ioctl is available. @@ -140,7 +146,13 @@ indicator, for example a stereo pilot tone. __u32 - reserved[4] + type + Type of the modulator, see . + + + __u32 + reserved[3] Reserved for future extensions. Drivers and applications must set the array to zero. diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-g-parm.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-g-parm.xml index f4e28e7d4..721728745 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-g-parm.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-g-parm.xml @@ -267,7 +267,7 @@ is intended for still imaging applications. The idea is to get the best possible image quality that the hardware can deliver. It is not defined how the driver writer may achieve that; it will depend on the hardware and the ingenuity of the driver writer. High quality mode is -a different mode from the the regular motion video capture modes. In +a different mode from the regular motion video capture modes. In high quality mode: The driver may be able to capture higher diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-g-selection.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-g-selection.xml index 0bb5c060d..786535168 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-g-selection.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-g-selection.xml @@ -199,7 +199,7 @@ exist no rectangle that satisfies the constraints. __u32 reserved[9] - Reserved fields for future use. + Reserved fields for future use. Drivers and applications must zero this array. diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml index b0d865933..459b7e561 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-g-tuner.xml @@ -80,6 +80,12 @@ if the requested mode is invalid or unsupported. Since this is a write-only ioctl, it does not return the actually selected audio mode. + SDR specific tuner types are +V4L2_TUNER_SDR and V4L2_TUNER_RF. +For SDR devices audmode field must be +initialized to zero. +The term 'tuner' means SDR receiver in this context. + To change the radio frequency the &VIDIOC-S-FREQUENCY; ioctl is available. @@ -261,6 +267,16 @@ applications must set the array to zero. 2 + + V4L2_TUNER_SDR + 4 + + + + V4L2_TUNER_RF + 5 + +
diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-qbuf.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-qbuf.xml index 3504a7f2f..8b98a0e42 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-qbuf.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-qbuf.xml @@ -187,6 +187,16 @@ continue streaming.
+ + EPIPE + + VIDIOC_DQBUF returns this on an empty +capture queue for mem2mem codecs if a buffer with the +V4L2_BUF_FLAG_LAST was already dequeued and no new buffers +are expected to become available. + + + diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-query-dv-timings.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-query-dv-timings.xml index e185f149e..e9c70a8f3 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-query-dv-timings.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-query-dv-timings.xml @@ -6,6 +6,7 @@ VIDIOC_QUERY_DV_TIMINGS + VIDIOC_SUBDEV_QUERY_DV_TIMINGS Sense the DV preset received by the current input @@ -34,7 +35,7 @@ input request - VIDIOC_QUERY_DV_TIMINGS + VIDIOC_QUERY_DV_TIMINGS, VIDIOC_SUBDEV_QUERY_DV_TIMINGS diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-querybuf.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-querybuf.xml index a597155c0..50bfcb5e8 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-querybuf.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-querybuf.xml @@ -60,7 +60,8 @@ buffer at any time after buffers have been allocated with the field. Valid index numbers range from zero to the number of buffers allocated with &VIDIOC-REQBUFS; (&v4l2-requestbuffers; count) minus one. -The reserved field should to set to 0. +The reserved and reserved2 +fields must be set to 0. When using the multi-planar API, the m.planes field must contain a userspace pointer to an array of &v4l2-plane; and the length field has diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-querycap.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-querycap.xml index 20fda75a0..cd82148de 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-querycap.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-querycap.xml @@ -306,6 +306,12 @@ modulator programming see 0x00200000 The device supports the &v4l2-pix-format; extended fields. + + + V4L2_CAP_SDR_OUTPUT + 0x00400000 + The device supports the +SDR Output interface. V4L2_CAP_READWRITE diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml index dc83ad70f..55b7582cf 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml @@ -101,8 +101,9 @@ prematurely end the enumeration). next supported non-compound control, or EINVAL if there is none. In addition, the V4L2_CTRL_FLAG_NEXT_COMPOUND flag can be specified to enumerate all compound controls (i.e. controls -with type ≥ V4L2_CTRL_COMPOUND_TYPES). Specify both -V4L2_CTRL_FLAG_NEXT_CTRL and +with type ≥ V4L2_CTRL_COMPOUND_TYPES and/or array +control, in other words controls that contain more than one value). +Specify both V4L2_CTRL_FLAG_NEXT_CTRL and V4L2_CTRL_FLAG_NEXT_COMPOUND in order to enumerate all controls, compound or not. Drivers which do not support these flags yet always return EINVAL. @@ -422,7 +423,7 @@ the array to zero. any An integer-valued control ranging from minimum to maximum inclusive. The step value indicates the increment between -values which are actually different on the hardware. +values. V4L2_CTRL_TYPE_BOOLEAN @@ -518,7 +519,7 @@ Older drivers which do not support this feature return an any An unsigned 8-bit valued control ranging from minimum to maximum inclusive. The step value indicates the increment between -values which are actually different on the hardware. +values. @@ -528,7 +529,17 @@ values which are actually different on the hardware. any An unsigned 16-bit valued control ranging from minimum to maximum inclusive. The step value indicates the increment between -values which are actually different on the hardware. +values. + + + + V4L2_CTRL_TYPE_U32 + any + any + any + An unsigned 32-bit valued control ranging from minimum to +maximum inclusive. The step value indicates the increment between +values. @@ -616,7 +627,7 @@ pointer to memory containing the payload of the control. V4L2_CTRL_FLAG_EXECUTE_ON_WRITE 0x0200 The value provided to the control will be propagated to the driver -even if remains constant. This is required when the control represents an action +even if it remains constant. This is required when the control represents an action on the hardware. For example: clearing an error flag or triggering the flash. All the controls of the type V4L2_CTRL_TYPE_BUTTON have this flag set. diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml index 78a06a9a5..0f193fda0 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-reqbufs.xml @@ -112,8 +112,8 @@ as the &v4l2-format; type field. See __u32 reserved[2] - A place holder for future extensions. This array should -be zeroed by applications. + A place holder for future extensions. Drivers and applications +must set the array to zero. diff --git a/kernel/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml b/kernel/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml index d0332f610..5fd0ee78f 100644 --- a/kernel/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml +++ b/kernel/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml @@ -5,7 +5,8 @@ - VIDIOC_SUBSCRIBE_EVENT, VIDIOC_UNSUBSCRIBE_EVENT + VIDIOC_SUBSCRIBE_EVENT + VIDIOC_UNSUBSCRIBE_EVENT Subscribe or unsubscribe event -- cgit 1.2.3-korg