From 9f3d28b196712c71fb5d757d2148d03fd4ace6af Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 16 Sep 2009 11:24:39 -0300 Subject: dvb-spec: Compile from Documentation/DocBook From: Mauro Carvalho Chehab Priority: normal Signed-off-by: Mauro Carvalho Chehab --- dvb-spec/dvbapi/Makefile | 152 ++++++++++++++++++++++++++++++ dvb-spec/dvbapi/README | 11 +++ dvb-spec/dvbapi/ca.sgml | 221 ++++++++++++++++++++++++++++++++++++++++++++ dvb-spec/dvbapi/custom.dsl | 52 +++++++++++ dvb-spec/dvbapi/custom.xsl | 29 ++++++ dvb-spec/dvbapi/dvbapi.sgml | 101 ++++++++++++++++++++ 6 files changed, 566 insertions(+) create mode 100644 dvb-spec/dvbapi/Makefile create mode 100644 dvb-spec/dvbapi/README create mode 100644 dvb-spec/dvbapi/ca.sgml create mode 100644 dvb-spec/dvbapi/custom.dsl create mode 100644 dvb-spec/dvbapi/custom.xsl create mode 100644 dvb-spec/dvbapi/dvbapi.sgml (limited to 'dvb-spec/dvbapi') diff --git a/dvb-spec/dvbapi/Makefile b/dvb-spec/dvbapi/Makefile new file mode 100644 index 000000000..9a1363da1 --- /dev/null +++ b/dvb-spec/dvbapi/Makefile @@ -0,0 +1,152 @@ +SHELL=/bin/bash + +SGMLS = \ + dvbapi.sgml \ + intro.xml \ + frontend.xml \ + demux.xml \ + video.xml \ + audio.xml \ + ca.xml \ + net.xml \ + kdapi.xml \ + examples.xml \ + fdl-appendix.xml \ + entities.xml \ + +PDFPICS = \ + dvbstb.pdf \ + +GIFPICS = \ + dvbstb.png \ + +# Some Jade warnings for authors. +WARN = +#WARN = -w all -w duplicate -w net + +# Stylesheet customization. + # docbook/db2 syntax +CUSTOM_HTML = --dsl custom.dsl\#html +CUSTOM_PRINT = --dsl custom.dsl\#print + # xmlto syntax +CUSTOM_HTML_XMLTO = -m custom.xsl +CUSTOM_PRINT_XMLTO = -m custom.xsl + +all: html-single + +html: html-build.stamp + +html-single: html-single-build.stamp + +pdf: pdf-build.stamp + +man: man-build.stamp + +man_install: man-build.stamp + install -d /usr/local/man/man2 + install -b man/* /usr/local/man/man2 + +.PHONY: links + +$(SGMLS): links +$(PDFPICS): links +$(GIFPICS): links + +links:: + ln -sf ../../linux/Documentation/DocBook/dvb/* . + ln -sf ../../linux/Documentation/DocBook/v4l/fdl-appendix.xml . + +entities.xml: Makefile $(SGMLS) + echo "" >$@ + echo -e "\n" >>$@ + for file in $(SGMLS) ; do \ + entity=`echo "$$file" | sed 's/.xml//;s/\./-/g'` ; \ + if ! echo "$$file" | \ + grep -q -E -e '^(func|vidioc|pixfmt)-' ; then \ + echo "" >>$@ ; \ + fi ; \ + done + +# Jade can auto-generate a list-of-tables, which includes all structs, +# but we only want data types, all types, and sorted please. +indices.xml: Makefile $(SGMLS) + echo "" >$@ + echo -e "\nList of Types" >>$@ + for ident in $(TYPES) ; do \ + id=`echo $$ident | tr _ -` ; \ + echo "$$ident" >>$@ ; \ + done + for ident in $(ENUMS) ; do \ + echo "enum $$ident" >>$@ ; \ + done + for ident in $(STRUCTS) ; do \ + id=`echo $$ident | tr _ -` ; \ + echo "struct $$ident" >>$@ ; \ + done + echo "" >>$@ + +# HTML version. +html-build.stamp: Makefile $(SGMLS) $(GIFPICS) + rm -rf dvbapi + if which xmlto >/dev/null ; then \ + xmlto xhtml $(WARN) $(CUSTOM_HTML_XMLTO) -o dvbapi dvbapi.sgml ; \ + elif which docbook2html >/dev/null ; then \ + export DCL="--dcl `find /usr/share/sgml -name xml.dcl |head -1`"; \ + docbook2html $(WARN) $$DCL $(CUSTOM_HTML) --output dvbapi dvbapi.sgml ; \ + else \ + export DCL="--dcl `find /usr/share/sgml -name xml.dcl |head -1`"; \ + db2html $(WARN) $$DCL $(CUSTOM_HTML) --output dvbapi dvbapi.sgml ; \ + fi + cp $(GIFPICS) dvbapi/ + cd dvbapi ; \ + test -e index.html || ln -s book1.htm index.html ; \ + test -e capture-example.html || \ + ln -s `grep -l getopt_long *.htm` capture-example.html + chmod a+rX -R dvbapi + touch html-build.stamp + +# For online version. When you have a dial-up connection a single file +# is more convenient than clicking through dozens of pages. +html-single-build.stamp: Makefile $(SGMLS) $(GIFPICS) + rm -rf dvbapi-single + if which xmlto >/dev/null ; then \ + xmlto html-nochunks $(WARN) $(CUSTOM_HTML_XMLTO) -o dvbapi-single dvbapi.sgml ; \ + elif which docbook2html >/dev/null ; then \ + export DCL="--dcl `find /usr/share/sgml -name xml.dcl |head -1`"; \ + docbook2html $$DCL $(WARN) $(CUSTOM_HTML) --nochunks \ + --output dvbapi-single dvbapi.sgml ; \ + else \ + export DCL="--dcl `find /usr/share/sgml -name xml.dcl |head -1`"; \ + db2html $$DCL $(WARN) $(CUSTOM_HTML) --nochunks \ + --output dvbapi-single dvbapi.sgml ; \ + fi + cp $(GIFPICS) dvbapi-single/ + chmod a+rX -R dvbapi-single + touch html-single-build.stamp + +# For printing. +pdf-build.stamp: Makefile $(SGMLS) $(PDFPICS) + if which db2pdf >/dev/null ; then \ + export DCL="--dcl `find /usr/share/sgml -name xml.dcl|head -1`"; \ + db2pdf $$DCL $(WARN) $(CUSTOM_PRINT) dvbapi.sgml ; \ + elif which xmlto >/dev/null ; then \ + xmlto pdf $(WARN) $(CUSTOM_HTML_XMLTO) -o dvbapi-single dvbapi.sgml ; \ + else \ + export DCL="--dcl `find /usr/share/sgml -name xml.dcl |head -1`"; \ + docbook2pdf $$DCL $(WARN) $(CUSTOM_PRINT) dvbapi.sgml ; \ + fi + touch pdf-build.stamp + + +# For man +man-build.stamp: Makefile $(SGMLS) $(PDFPICS) + xmlto man $(WARN) $(CUSTOM_HTML_XMLTO) -o man dvbapi.sgml + +distclean clean: + rm -f *.stamp + rm -f indices.xml entities.xml + find . -type l -exec rm '{}' \; + diff --git a/dvb-spec/dvbapi/README b/dvb-spec/dvbapi/README new file mode 100644 index 000000000..7d908c8c8 --- /dev/null +++ b/dvb-spec/dvbapi/README @@ -0,0 +1,11 @@ +This directory doesn't contain the official DVB API. + +It contains a port from LaTex to Docbook XML 4.1.2 + +It is still a work undergoing. Contributions are welcome. + +CURRENT STATUS: + +All chapters were converted. The resulting pdf and html are close to the +original LaTex book. Yet, it lacks some efforts to improve +the output layout and it lacks a topic index. diff --git a/dvb-spec/dvbapi/ca.sgml b/dvb-spec/dvbapi/ca.sgml new file mode 100644 index 000000000..b1f1d2fad --- /dev/null +++ b/dvb-spec/dvbapi/ca.sgml @@ -0,0 +1,221 @@ +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. + + +
+CA Data Types + + +
+ca_slot_info_t + + /⋆ slot interface types and info ⋆/ + + typedef struct ca_slot_info_s { + int num; /⋆ slot number ⋆/ + + int type; /⋆ CA interface this slot supports ⋆/ + #define CA_CI 1 /⋆ CI high level interface ⋆/ + #define CA_CI_LINK 2 /⋆ CI link layer level interface ⋆/ + #define CA_CI_PHYS 4 /⋆ CI physical layer level interface ⋆/ + #define CA_SC 128 /⋆ simple smart card interface ⋆/ + + unsigned int flags; + #define CA_CI_MODULE_PRESENT 1 /⋆ module (or card) inserted ⋆/ + #define CA_CI_MODULE_READY 2 + } ca_slot_info_t; + + +
+
+ca_descr_info_t + + typedef struct ca_descr_info_s { + unsigned int num; /⋆ number of available descramblers (keys) ⋆/ + unsigned int type; /⋆ type of supported scrambling system ⋆/ + #define CA_ECD 1 + #define CA_NDS 2 + #define CA_DSS 4 + } ca_descr_info_t; + + +
+
+ca_cap_t + + typedef struct ca_cap_s { + unsigned int slot_num; /⋆ total number of CA card and module slots ⋆/ + unsigned int slot_type; /⋆ OR of all supported types ⋆/ + unsigned int descr_num; /⋆ total number of descrambler slots (keys) ⋆/ + unsigned int descr_type;/⋆ OR of all supported types ⋆/ + } ca_cap_t; + + +
+
+ca_msg_t + + /⋆ a message to/from a CI-CAM ⋆/ + typedef struct ca_msg_s { + unsigned int index; + unsigned int type; + unsigned int length; + unsigned char msg[256]; + } ca_msg_t; + + +
+
+ca_descr_t + + typedef struct ca_descr_s { + unsigned int index; + unsigned int parity; + unsigned char cw[8]; + } ca_descr_t; + +
+
+CA Function Calls + + +
+open() +DESCRIPTION + + +This system call opens a named ca device (e.g. /dev/ost/ca) for subsequent use. +When an open() call has succeeded, the device will be ready for use. + The significance of blocking or non-blocking mode is described in the + documentation for functions where there is a difference. It does not affect the + semantics of the open() call itself. A device opened in blocking mode can later + be put into non-blocking mode (and vice versa) using the F_SETFL command + of the fcntl system call. This is a standard system call, documented in the Linux + manual page for fcntl. Only one user can open the CA Device in O_RDWR + mode. All other attempts to open the device in this mode will fail, and an error + code will be returned. + + +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) + + +ERRORS + + +ENODEV + +Device driver not loaded/available. + + +EINTERNAL + +Internal error. + + +EBUSY + +Device or resource busy. + + +EINVAL + +Invalid argument. + + + +
+
+close() +DESCRIPTION + + +This system call closes a previously opened audio device. + + +SYNOPSIS + + +int close(int fd); + + +PARAMETERS + + +int fd + +File descriptor returned by a previous call to open(). + + +ERRORS + + +EBADF + +fd is not a valid open file descriptor. + + +
+
diff --git a/dvb-spec/dvbapi/custom.dsl b/dvb-spec/dvbapi/custom.dsl new file mode 100644 index 000000000..12a5e91d4 --- /dev/null +++ b/dvb-spec/dvbapi/custom.dsl @@ -0,0 +1,52 @@ + + + +]]> + + +]]> +]> + + + + + + + +(define %generate-reference-toc% #t) +(define %refentry-new-page% #t) +(define %number-programlisting-lines% #f) +(define %section-autolabel% #t) +(define bop-footnotes #t) + +(define ($generate-book-lot-list$) + (list (normalize "figure") + (normalize "example"))) + +(define %paper-type% "A4") + + + + + + + + +(define %generate-reference-toc% #t) +(define %number-programlisting-lines% #f) +(define %section-autolabel% #t) +(define bop-footnotes #t) + +(define ($generate-book-lot-list$) + (list (normalize "figure") + (normalize "example"))) + + + + + + + diff --git a/dvb-spec/dvbapi/custom.xsl b/dvb-spec/dvbapi/custom.xsl new file mode 100644 index 000000000..e1556c37c --- /dev/null +++ b/dvb-spec/dvbapi/custom.xsl @@ -0,0 +1,29 @@ + + + + + + + +1 +0 +0 +0 + +1 + +1 +1 +1 + +ansi +80 +1 + +1 +1 +1 +3 + +A4 + diff --git a/dvb-spec/dvbapi/dvbapi.sgml b/dvb-spec/dvbapi/dvbapi.sgml new file mode 100644 index 000000000..377fe8fba --- /dev/null +++ b/dvb-spec/dvbapi/dvbapi.sgml @@ -0,0 +1,101 @@ + + %entities; +2C"> +]> + + + +LINUX DVB API +Version 3 + + +Ralph +Metzler +J. K. +
rjkm@metzlerbros.de
+
+ +Marcus +Metzler +O. C. +
rjkm@metzlerbros.de
+
+ +Mauro +Chehab +Carvalho +
mchehab@infradead.org
+Ported document to Docbook XML. +
+
+ + +2002 +2003 +2009 +Convergence GmbH + + + +Permission is granted to copy, distribute and/or modify +this document under the terms of the GNU Free Documentation License, +Version 1.1 or any later version published by the Free Software +Foundation. A copy of the license is included in the chapter entitled +"GNU Free Documentation License" + + + + + +2.0.0 +2009-09-06 +mcc +Conversion from LaTex to DocBook XML. The +contents is the same as the original LaTex version. + + +1.0.0 +2003-07-24 +rjkm +Initial revision on LaTEX. + + + +
+ + + + + + &sub-intro; + + + &sub-frontend; + + + &sub-demux; + + + &sub-video; + + + &sub-audio; + + + &sub-ca; + + + &sub-net; + + + &sub-kdapi; + + + &sub-examples; + + + &sub-fdl-appendix; + +
-- cgit v1.2.3