1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Digital TV (DVB) devices</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Device Drivers"><link rel="up" href="mediadev.html" title="Chapter 6. Media Devices"><link rel="prev" href="API-struct-vb2-vmarea-handler.html" title="struct vb2_vmarea_handler"><link rel="next" href="API-struct-dvb-ca-en50221.html" title="struct dvb_ca_en50221"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Digital TV (DVB) devices</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-struct-vb2-vmarea-handler.html">Prev</a> </td><th width="60%" align="center">Chapter 6. Media Devices</th><td width="20%" align="right"> <a accesskey="n" href="API-struct-dvb-ca-en50221.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id-1.8.3"></a>Digital TV (DVB) devices</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-struct-dvb-ca-en50221.html"><span class="phrase">struct dvb_ca_en50221</span></a></span><span class="refpurpose"> — 2 Structure describing a CA interface 3 </span></dt><dt><span class="refentrytitle"><a href="API-dvb-ca-en50221-camchange-irq.html"><span class="phrase">dvb_ca_en50221_camchange_irq</span></a></span><span class="refpurpose"> — 4 A CAMCHANGE IRQ has occurred. 5 </span></dt><dt><span class="refentrytitle"><a href="API-dvb-ca-en50221-camready-irq.html"><span class="phrase">dvb_ca_en50221_camready_irq</span></a></span><span class="refpurpose"> — 6 A CAMREADY IRQ has occurred. 7 </span></dt><dt><span class="refentrytitle"><a href="API-dvb-ca-en50221-frda-irq.html"><span class="phrase">dvb_ca_en50221_frda_irq</span></a></span><span class="refpurpose"> — 8 An FR or a DA IRQ has occurred. 9 </span></dt><dt><span class="refentrytitle"><a href="API-dvb-ca-en50221-init.html"><span class="phrase">dvb_ca_en50221_init</span></a></span><span class="refpurpose"> — 10 Initialise a new DVB CA device. 11 </span></dt><dt><span class="refentrytitle"><a href="API-dvb-ca-en50221-release.html"><span class="phrase">dvb_ca_en50221_release</span></a></span><span class="refpurpose"> — 12 Release a DVB CA device. 13 </span></dt><dt><span class="refentrytitle"><a href="API-struct-dvb-frontend-tune-settings.html"><span class="phrase">struct dvb_frontend_tune_settings</span></a></span><span class="refpurpose"> — 14 parameters to adjust frontend tuning 15 </span></dt><dt><span class="refentrytitle"><a href="API-struct-dvb-tuner-info.html"><span class="phrase">struct dvb_tuner_info</span></a></span><span class="refpurpose"> — 16 Frontend name and min/max ranges/bandwidths 17 </span></dt><dt><span class="refentrytitle"><a href="API-struct-analog-parameters.html"><span class="phrase">struct analog_parameters</span></a></span><span class="refpurpose"> — 18 Parameters to tune into an analog/radio channel 19 </span></dt><dt><span class="refentrytitle"><a href="API-enum-dvbfe-algo.html"><span class="phrase">enum dvbfe_algo</span></a></span><span class="refpurpose"> — 20 defines the algorithm used to tune into a channel 21 </span></dt><dt><span class="refentrytitle"><a href="API-enum-dvbfe-search.html"><span class="phrase">enum dvbfe_search</span></a></span><span class="refpurpose"> — 22 search callback possible return status 23 </span></dt><dt><span class="refentrytitle"><a href="API-struct-dvb-tuner-ops.html"><span class="phrase">struct dvb_tuner_ops</span></a></span><span class="refpurpose"> — 24 Tuner information and callbacks 25 </span></dt><dt><span class="refentrytitle"><a href="API-struct-analog-demod-info.html"><span class="phrase">struct analog_demod_info</span></a></span><span class="refpurpose"> — 26 Information struct for analog TV part of the demod 27 </span></dt><dt><span class="refentrytitle"><a href="API-struct-analog-demod-ops.html"><span class="phrase">struct analog_demod_ops</span></a></span><span class="refpurpose"> — 28 Demodulation information and callbacks for analog TV and radio 29 </span></dt><dt><span class="refentrytitle"><a href="API-struct-dvb-frontend-ops.html"><span class="phrase">struct dvb_frontend_ops</span></a></span><span class="refpurpose"> — 30 Demodulation information and callbacks for ditialt TV 31 </span></dt><dt><span class="refentrytitle"><a href="API-struct-dtv-frontend-properties.html"><span class="phrase">struct dtv_frontend_properties</span></a></span><span class="refpurpose"> — 32 contains a list of properties that are specific to a digital TV standard. 33 </span></dt><dt><span class="refentrytitle"><a href="API-struct-dvb-frontend.html"><span class="phrase">struct dvb_frontend</span></a></span><span class="refpurpose"> — 34 Frontend structure to be used on drivers. 35 </span></dt><dt><span class="refentrytitle"><a href="API-intlog2.html"><span class="phrase">intlog2</span></a></span><span class="refpurpose"> — 36 computes log2 of a value; the result is shifted left by 24 bits 37 </span></dt><dt><span class="refentrytitle"><a href="API-intlog10.html"><span class="phrase">intlog10</span></a></span><span class="refpurpose"> — 38 computes log10 of a value; the result is shifted left by 24 bits 39 </span></dt><dt><span class="refentrytitle"><a href="API-dvb-ringbuffer-pkt-write.html"><span class="phrase">dvb_ringbuffer_pkt_write</span></a></span><span class="refpurpose"> — 40 Write a packet into the ringbuffer. 41 </span></dt><dt><span class="refentrytitle"><a href="API-dvb-ringbuffer-pkt-read-user.html"><span class="phrase">dvb_ringbuffer_pkt_read_user</span></a></span><span class="refpurpose"> — 42 Read from a packet in the ringbuffer. 43 </span></dt><dt><span class="refentrytitle"><a href="API-dvb-ringbuffer-pkt-read.html"><span class="phrase">dvb_ringbuffer_pkt_read</span></a></span><span class="refpurpose"> — 44 Read from a packet in the ringbuffer. 45 </span></dt><dt><span class="refentrytitle"><a href="API-dvb-ringbuffer-pkt-dispose.html"><span class="phrase">dvb_ringbuffer_pkt_dispose</span></a></span><span class="refpurpose"> — 46 Dispose of a packet in the ring buffer. 47 </span></dt><dt><span class="refentrytitle"><a href="API-dvb-ringbuffer-pkt-next.html"><span class="phrase">dvb_ringbuffer_pkt_next</span></a></span><span class="refpurpose"> — 48 Get the index of the next packet in a ringbuffer. 49 </span></dt><dt><span class="refentrytitle"><a href="API-struct-dvb-adapter.html"><span class="phrase">struct dvb_adapter</span></a></span><span class="refpurpose"> — 50 represents a Digital TV adapter using Linux DVB API 51 </span></dt><dt><span class="refentrytitle"><a href="API-struct-dvb-device.html"><span class="phrase">struct dvb_device</span></a></span><span class="refpurpose"> — 52 represents a DVB device node 53 </span></dt><dt><span class="refentrytitle"><a href="API-dvb-register-adapter.html"><span class="phrase">dvb_register_adapter</span></a></span><span class="refpurpose"> — 54 Registers a new DVB adapter 55 </span></dt><dt><span class="refentrytitle"><a href="API-dvb-unregister-adapter.html"><span class="phrase">dvb_unregister_adapter</span></a></span><span class="refpurpose"> — 56 Unregisters a DVB adapter 57 </span></dt><dt><span class="refentrytitle"><a href="API-dvb-register-device.html"><span class="phrase">dvb_register_device</span></a></span><span class="refpurpose"> — 58 Registers a new DVB device 59 </span></dt><dt><span class="refentrytitle"><a href="API-dvb-unregister-device.html"><span class="phrase">dvb_unregister_device</span></a></span><span class="refpurpose"> — 60 Unregisters a DVB device 61 </span></dt><dt><span class="sect1"><a href="ch06s02.html#id-1.8.3.32">Digital TV Demux API</a></span></dt><dt><span class="section"><a href="ch06s02.html#demux_callback_api">Demux Callback API</a></span></dt><dt><span class="refentrytitle"><a href="API-enum-ts-filter-type.html"><span class="phrase">enum ts_filter_type</span></a></span><span class="refpurpose"> — 62 filter type bitmap for dmx_ts_feed.<code class="function">set</code> 63 </span></dt><dt><span class="refentrytitle"><a href="API-struct-dmx-ts-feed.html"><span class="phrase">struct dmx_ts_feed</span></a></span><span class="refpurpose"> — 64 Structure that contains a TS feed filter 65 </span></dt><dt><span class="refentrytitle"><a href="API-struct-dmx-section-filter.html"><span class="phrase">struct dmx_section_filter</span></a></span><span class="refpurpose"> — 66 Structure that describes a section filter 67 </span></dt><dt><span class="refentrytitle"><a href="API-struct-dmx-section-feed.html"><span class="phrase">struct dmx_section_feed</span></a></span><span class="refpurpose"> — 68 Structure that contains a section feed filter 69 </span></dt><dt><span class="refentrytitle"><a href="API-dmx-ts-cb.html"><span class="phrase">dmx_ts_cb</span></a></span><span class="refpurpose"> — 70 DVB demux TS filter callback function prototype 71 </span></dt><dt><span class="refentrytitle"><a href="API-dmx-section-cb.html"><span class="phrase">dmx_section_cb</span></a></span><span class="refpurpose"> — 72 DVB demux TS filter callback function prototype 73 </span></dt><dt><span class="refentrytitle"><a href="API-enum-dmx-frontend-source.html"><span class="phrase">enum dmx_frontend_source</span></a></span><span class="refpurpose"> — 74 Used to identify the type of frontend 75 </span></dt><dt><span class="refentrytitle"><a href="API-struct-dmx-frontend.html"><span class="phrase">struct dmx_frontend</span></a></span><span class="refpurpose"> — 76 Structure that lists the frontends associated with a demux 77 </span></dt><dt><span class="refentrytitle"><a href="API-enum-dmx-demux-caps.html"><span class="phrase">enum dmx_demux_caps</span></a></span><span class="refpurpose"> — 78 MPEG-2 TS Demux capabilities bitmap 79 </span></dt><dt><span class="refentrytitle"><a href="API-struct-dmx-demux.html"><span class="phrase">struct dmx_demux</span></a></span><span class="refpurpose"> — 80 Structure that contains the demux capabilities and callbacks. 81 </span></dt></dl></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id-1.8.3.32"></a>Digital TV Demux API</h2></div></div></div><p>The kernel demux API defines a driver-internal interface for 82 registering low-level, hardware specific driver to a hardware 83 independent demux layer. It is only of interest for Digital TV 84 device driver writers. The header file for this API is named 85 <code class="constant">demux.h</code> and located in 86 <code class="constant">drivers/media/dvb-core</code>.</p><p>The demux API should be implemented for each demux in the 87 system. It is used to select the TS source of a demux and to manage 88 the demux resources. When the demux client allocates a resource via 89 the demux API, it receives a pointer to the API of that 90 resource.</p><p>Each demux receives its TS input from a DVB front-end or from 91 memory, as set via this demux API. In a system with more than one 92 front-end, the API can be used to select one of the DVB front-ends 93 as a TS source for a demux, unless this is fixed in the HW platform. 94 The demux API only controls front-ends regarding to their connections 95 with demuxes; the APIs used to set the other front-end parameters, 96 such as tuning, are not defined in this document.</p><p>The functions that implement the abstract interface demux should 97 be defined static or module private and registered to the Demux 98 core for external access. It is not necessary to implement every 99 function in the struct <code class="constant">dmx_demux</code>. For example, 100 a demux interface might support Section filtering, but not PES 101 filtering. The API client is expected to check the value of any 102 function pointer before calling the function: the value of NULL means 103 that the “function is not available”.</p><p>Whenever the functions of the demux API modify shared data, 104 the possibilities of lost update and race condition problems should 105 be addressed, e.g. by protecting parts of code with mutexes.</p><p>Note that functions called from a bottom half context must not 106 sleep. Even a simple memory allocation without using GFP_ATOMIC can 107 result in a kernel thread being put to sleep if swapping is needed. 108 For example, the Linux kernel calls the functions of a network device 109 interface from a bottom half context. Thus, if a demux API function 110 is called from network device code, the function must not sleep. 111 </p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="demux_callback_api"></a>Demux Callback API</h2></div></div></div><p>This kernel-space API comprises the callback functions that 112 deliver filtered data to the demux client. Unlike the other DVB 113 kABIs, these functions are provided by the client and called from 114 the demux code.</p><p>The function pointers of this abstract interface are not 115 packed into a structure as in the other demux APIs, because the 116 callback functions are registered and used independent of each 117 other. As an example, it is possible for the API client to provide 118 several callback functions for receiving TS packets and no 119 callbacks for PES packets or sections.</p><p>The functions that implement the callback API need not be 120 re-entrant: when a demux driver calls one of these functions, 121 the driver is not allowed to call the function again before 122 the original call returns. If a callback is triggered by a 123 hardware interrupt, it is recommended to use the Linux 124 “bottom half” mechanism or start a tasklet instead of 125 making the callback function call directly from a hardware 126 interrupt.</p><p>This mechanism is implemented by 127 <a class="link" href="API-dmx-ts-cb.html" title="dmx_ts_cb">dmx_ts_cb()</a> and 128 <a class="link" href="API-dmx-section-cb.html" title="dmx_section_cb">dmx_section_cb()</a>.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-struct-vb2-vmarea-handler.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="mediadev.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-struct-dvb-ca-en50221.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">struct vb2_vmarea_handler</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">struct dvb_ca_en50221</span></td></tr></table></div></body></html> 129