Path: blob/master/Documentation/DocBook/dvb/kdapi.xml
10823 views
<title>Kernel Demux API</title>1<para>The kernel demux API defines a driver-internal interface for registering low-level,2hardware specific driver to a hardware independent demux layer. It is only of interest for3DVB device driver writers. The header file for this API is named <emphasis role="tt">demux.h</emphasis> and located in4<emphasis role="tt">drivers/media/dvb/dvb-core</emphasis>.5</para>6<para>Maintainer note: This section must be reviewed. It is probably out of date.7</para>89<section id="kernel_demux_data_types">10<title>Kernel Demux Data Types</title>111213<section id="dmx_success_t">14<title>dmx_success_t</title>15<programlisting>16typedef enum {17DMX_OK = 0, /⋆ Received Ok ⋆/18DMX_LENGTH_ERROR, /⋆ Incorrect length ⋆/19DMX_OVERRUN_ERROR, /⋆ Receiver ring buffer overrun ⋆/20DMX_CRC_ERROR, /⋆ Incorrect CRC ⋆/21DMX_FRAME_ERROR, /⋆ Frame alignment error ⋆/22DMX_FIFO_ERROR, /⋆ Receiver FIFO overrun ⋆/23DMX_MISSED_ERROR /⋆ Receiver missed packet ⋆/24} dmx_success_t;25</programlisting>2627</section>28<section id="ts_filter_types">29<title>TS filter types</title>30<programlisting>31/⋆--------------------------------------------------------------------------⋆/32/⋆ TS packet reception ⋆/33/⋆--------------------------------------------------------------------------⋆/3435/⋆ TS filter type for set_type() ⋆/3637#define TS_PACKET 1 /⋆ send TS packets (188 bytes) to callback (default) ⋆/38#define TS_PAYLOAD_ONLY 2 /⋆ in case TS_PACKET is set, only send the TS39payload (<=184 bytes per packet) to callback ⋆/40#define TS_DECODER 4 /⋆ send stream to built-in decoder (if present) ⋆/41</programlisting>4243</section>44<section id="dmx_ts_pes_t">45<title>dmx_ts_pes_t</title>46<para>The structure47</para>48<programlisting>49typedef enum50{51DMX_TS_PES_AUDIO, /⋆ also send packets to audio decoder (if it exists) ⋆/52DMX_TS_PES_VIDEO, /⋆ ... ⋆/53DMX_TS_PES_TELETEXT,54DMX_TS_PES_SUBTITLE,55DMX_TS_PES_PCR,56DMX_TS_PES_OTHER,57} dmx_ts_pes_t;58</programlisting>59<para>describes the PES type for filters which write to a built-in decoder. The correspond (and60should be kept identical) to the types in the demux device.61</para>62<programlisting>63struct dmx_ts_feed_s {64int is_filtering; /⋆ Set to non-zero when filtering in progress ⋆/65struct dmx_demux_s⋆ parent; /⋆ Back-pointer ⋆/66void⋆ priv; /⋆ Pointer to private data of the API client ⋆/67int (⋆set) (struct dmx_ts_feed_s⋆ feed,68__u16 pid,69size_t callback_length,70size_t circular_buffer_size,71int descramble,72struct timespec timeout);73int (⋆start_filtering) (struct dmx_ts_feed_s⋆ feed);74int (⋆stop_filtering) (struct dmx_ts_feed_s⋆ feed);75int (⋆set_type) (struct dmx_ts_feed_s⋆ feed,76int type,77dmx_ts_pes_t pes_type);78};7980typedef struct dmx_ts_feed_s dmx_ts_feed_t;81</programlisting>82<programlisting>83/⋆--------------------------------------------------------------------------⋆/84/⋆ PES packet reception (not supported yet) ⋆/85/⋆--------------------------------------------------------------------------⋆/8687typedef struct dmx_pes_filter_s {88struct dmx_pes_s⋆ parent; /⋆ Back-pointer ⋆/89void⋆ priv; /⋆ Pointer to private data of the API client ⋆/90} dmx_pes_filter_t;91</programlisting>92<programlisting>93typedef struct dmx_pes_feed_s {94int is_filtering; /⋆ Set to non-zero when filtering in progress ⋆/95struct dmx_demux_s⋆ parent; /⋆ Back-pointer ⋆/96void⋆ priv; /⋆ Pointer to private data of the API client ⋆/97int (⋆set) (struct dmx_pes_feed_s⋆ feed,98__u16 pid,99size_t circular_buffer_size,100int descramble,101struct timespec timeout);102int (⋆start_filtering) (struct dmx_pes_feed_s⋆ feed);103int (⋆stop_filtering) (struct dmx_pes_feed_s⋆ feed);104int (⋆allocate_filter) (struct dmx_pes_feed_s⋆ feed,105dmx_pes_filter_t⋆⋆ filter);106int (⋆release_filter) (struct dmx_pes_feed_s⋆ feed,107dmx_pes_filter_t⋆ filter);108} dmx_pes_feed_t;109</programlisting>110<programlisting>111typedef struct {112__u8 filter_value [DMX_MAX_FILTER_SIZE];113__u8 filter_mask [DMX_MAX_FILTER_SIZE];114struct dmx_section_feed_s⋆ parent; /⋆ Back-pointer ⋆/115void⋆ priv; /⋆ Pointer to private data of the API client ⋆/116} dmx_section_filter_t;117</programlisting>118<programlisting>119struct dmx_section_feed_s {120int is_filtering; /⋆ Set to non-zero when filtering in progress ⋆/121struct dmx_demux_s⋆ parent; /⋆ Back-pointer ⋆/122void⋆ priv; /⋆ Pointer to private data of the API client ⋆/123int (⋆set) (struct dmx_section_feed_s⋆ feed,124__u16 pid,125size_t circular_buffer_size,126int descramble,127int check_crc);128int (⋆allocate_filter) (struct dmx_section_feed_s⋆ feed,129dmx_section_filter_t⋆⋆ filter);130int (⋆release_filter) (struct dmx_section_feed_s⋆ feed,131dmx_section_filter_t⋆ filter);132int (⋆start_filtering) (struct dmx_section_feed_s⋆ feed);133int (⋆stop_filtering) (struct dmx_section_feed_s⋆ feed);134};135typedef struct dmx_section_feed_s dmx_section_feed_t;136137/⋆--------------------------------------------------------------------------⋆/138/⋆ Callback functions ⋆/139/⋆--------------------------------------------------------------------------⋆/140141typedef int (⋆dmx_ts_cb) ( __u8 ⋆ buffer1,142size_t buffer1_length,143__u8 ⋆ buffer2,144size_t buffer2_length,145dmx_ts_feed_t⋆ source,146dmx_success_t success);147148typedef int (⋆dmx_section_cb) ( __u8 ⋆ buffer1,149size_t buffer1_len,150__u8 ⋆ buffer2,151size_t buffer2_len,152dmx_section_filter_t ⋆ source,153dmx_success_t success);154155typedef int (⋆dmx_pes_cb) ( __u8 ⋆ buffer1,156size_t buffer1_len,157__u8 ⋆ buffer2,158size_t buffer2_len,159dmx_pes_filter_t⋆ source,160dmx_success_t success);161162/⋆--------------------------------------------------------------------------⋆/163/⋆ DVB Front-End ⋆/164/⋆--------------------------------------------------------------------------⋆/165166typedef enum {167DMX_OTHER_FE = 0,168DMX_SATELLITE_FE,169DMX_CABLE_FE,170DMX_TERRESTRIAL_FE,171DMX_LVDS_FE,172DMX_ASI_FE, /⋆ DVB-ASI interface ⋆/173DMX_MEMORY_FE174} dmx_frontend_source_t;175176typedef struct {177/⋆ The following char⋆ fields point to NULL terminated strings ⋆/178char⋆ id; /⋆ Unique front-end identifier ⋆/179char⋆ vendor; /⋆ Name of the front-end vendor ⋆/180char⋆ model; /⋆ Name of the front-end model ⋆/181struct list_head connectivity_list; /⋆ List of front-ends that can182be connected to a particular183demux ⋆/184void⋆ priv; /⋆ Pointer to private data of the API client ⋆/185dmx_frontend_source_t source;186} dmx_frontend_t;187188/⋆--------------------------------------------------------------------------⋆/189/⋆ MPEG-2 TS Demux ⋆/190/⋆--------------------------------------------------------------------------⋆/191192/⋆193⋆ Flags OR'ed in the capabilites field of struct dmx_demux_s.194⋆/195196#define DMX_TS_FILTERING 1197#define DMX_PES_FILTERING 2198#define DMX_SECTION_FILTERING 4199#define DMX_MEMORY_BASED_FILTERING 8 /⋆ write() available ⋆/200#define DMX_CRC_CHECKING 16201#define DMX_TS_DESCRAMBLING 32202#define DMX_SECTION_PAYLOAD_DESCRAMBLING 64203#define DMX_MAC_ADDRESS_DESCRAMBLING 128204</programlisting>205206</section>207<section id="demux_demux_t">208<title>demux_demux_t</title>209<programlisting>210/⋆211⋆ DMX_FE_ENTRY(): Casts elements in the list of registered212⋆ front-ends from the generic type struct list_head213⋆ to the type ⋆ dmx_frontend_t214⋆.215⋆/216217#define DMX_FE_ENTRY(list) list_entry(list, dmx_frontend_t, connectivity_list)218219struct dmx_demux_s {220/⋆ The following char⋆ fields point to NULL terminated strings ⋆/221char⋆ id; /⋆ Unique demux identifier ⋆/222char⋆ vendor; /⋆ Name of the demux vendor ⋆/223char⋆ model; /⋆ Name of the demux model ⋆/224__u32 capabilities; /⋆ Bitfield of capability flags ⋆/225dmx_frontend_t⋆ frontend; /⋆ Front-end connected to the demux ⋆/226struct list_head reg_list; /⋆ List of registered demuxes ⋆/227void⋆ priv; /⋆ Pointer to private data of the API client ⋆/228int users; /⋆ Number of users ⋆/229int (⋆open) (struct dmx_demux_s⋆ demux);230int (⋆close) (struct dmx_demux_s⋆ demux);231int (⋆write) (struct dmx_demux_s⋆ demux, const char⋆ buf, size_t count);232int (⋆allocate_ts_feed) (struct dmx_demux_s⋆ demux,233dmx_ts_feed_t⋆⋆ feed,234dmx_ts_cb callback);235int (⋆release_ts_feed) (struct dmx_demux_s⋆ demux,236dmx_ts_feed_t⋆ feed);237int (⋆allocate_pes_feed) (struct dmx_demux_s⋆ demux,238dmx_pes_feed_t⋆⋆ feed,239dmx_pes_cb callback);240int (⋆release_pes_feed) (struct dmx_demux_s⋆ demux,241dmx_pes_feed_t⋆ feed);242int (⋆allocate_section_feed) (struct dmx_demux_s⋆ demux,243dmx_section_feed_t⋆⋆ feed,244dmx_section_cb callback);245int (⋆release_section_feed) (struct dmx_demux_s⋆ demux,246dmx_section_feed_t⋆ feed);247int (⋆descramble_mac_address) (struct dmx_demux_s⋆ demux,248__u8⋆ buffer1,249size_t buffer1_length,250__u8⋆ buffer2,251size_t buffer2_length,252__u16 pid);253int (⋆descramble_section_payload) (struct dmx_demux_s⋆ demux,254__u8⋆ buffer1,255size_t buffer1_length,256__u8⋆ buffer2, size_t buffer2_length,257__u16 pid);258int (⋆add_frontend) (struct dmx_demux_s⋆ demux,259dmx_frontend_t⋆ frontend);260int (⋆remove_frontend) (struct dmx_demux_s⋆ demux,261dmx_frontend_t⋆ frontend);262struct list_head⋆ (⋆get_frontends) (struct dmx_demux_s⋆ demux);263int (⋆connect_frontend) (struct dmx_demux_s⋆ demux,264dmx_frontend_t⋆ frontend);265int (⋆disconnect_frontend) (struct dmx_demux_s⋆ demux);266267268/⋆ added because js cannot keep track of these himself ⋆/269int (⋆get_pes_pids) (struct dmx_demux_s⋆ demux, __u16 ⋆pids);270};271typedef struct dmx_demux_s dmx_demux_t;272</programlisting>273274</section>275<section id="demux_directory">276<title>Demux directory</title>277<programlisting>278/⋆279⋆ DMX_DIR_ENTRY(): Casts elements in the list of registered280⋆ demuxes from the generic type struct list_head⋆ to the type dmx_demux_t281⋆.282⋆/283284#define DMX_DIR_ENTRY(list) list_entry(list, dmx_demux_t, reg_list)285286int dmx_register_demux (dmx_demux_t⋆ demux);287int dmx_unregister_demux (dmx_demux_t⋆ demux);288struct list_head⋆ dmx_get_demuxes (void);289</programlisting>290</section></section>291<section id="demux_directory_api">292<title>Demux Directory API</title>293<para>The demux directory is a Linux kernel-wide facility for registering and accessing the294MPEG-2 TS demuxes in the system. Run-time registering and unregistering of demux drivers295is possible using this API.296</para>297<para>All demux drivers in the directory implement the abstract interface dmx_demux_t.298</para>299300<section301role="subsection"><title>dmx_register_demux()</title>302<para>DESCRIPTION303</para>304<informaltable><tgroup cols="1"><tbody><row><entry305align="char">306<para>This function makes a demux driver interface available to the Linux kernel. It is307usually called by the init_module() function of the kernel module that contains308the demux driver. The caller of this function is responsible for allocating309dynamic or static memory for the demux structure and for initializing its fields310before calling this function. The memory allocated for the demux structure311must not be freed before calling dmx_unregister_demux(),</para>312</entry>313</row></tbody></tgroup></informaltable>314<para>SYNOPSIS315</para>316<informaltable><tgroup cols="1"><tbody><row><entry317align="char">318<para>int dmx_register_demux ( dmx_demux_t ⋆demux )</para>319</entry>320</row></tbody></tgroup></informaltable>321<para>PARAMETERS322</para>323<informaltable><tgroup cols="2"><tbody><row><entry324align="char">325<para>dmx_demux_t*326demux</para>327</entry><entry328align="char">329<para>Pointer to the demux structure.</para>330</entry>331</row></tbody></tgroup></informaltable>332<para>RETURNS333</para>334<informaltable><tgroup cols="2"><tbody><row><entry335align="char">336<para>0</para>337</entry><entry338align="char">339<para>The function was completed without errors.</para>340</entry>341</row><row><entry342align="char">343<para>-EEXIST</para>344</entry><entry345align="char">346<para>A demux with the same value of the id field already stored347in the directory.</para>348</entry>349</row><row><entry350align="char">351<para>-ENOSPC</para>352</entry><entry353align="char">354<para>No space left in the directory.</para>355</entry>356</row></tbody></tgroup></informaltable>357358</section><section359role="subsection"><title>dmx_unregister_demux()</title>360<para>DESCRIPTION361</para>362<informaltable><tgroup cols="1"><tbody><row><entry363align="char">364<para>This function is called to indicate that the given demux interface is no365longer available. The caller of this function is responsible for freeing the366memory of the demux structure, if it was dynamically allocated before calling367dmx_register_demux(). The cleanup_module() function of the kernel module368that contains the demux driver should call this function. Note that this function369fails if the demux is currently in use, i.e., release_demux() has not been called370for the interface.</para>371</entry>372</row></tbody></tgroup></informaltable>373<para>SYNOPSIS374</para>375<informaltable><tgroup cols="1"><tbody><row><entry376align="char">377<para>int dmx_unregister_demux ( dmx_demux_t ⋆demux )</para>378</entry>379</row></tbody></tgroup></informaltable>380<para>PARAMETERS381</para>382<informaltable><tgroup cols="2"><tbody><row><entry383align="char">384<para>dmx_demux_t*385demux</para>386</entry><entry387align="char">388<para>Pointer to the demux structure which is to be389unregistered.</para>390</entry>391</row></tbody></tgroup></informaltable>392<para>RETURNS393</para>394<informaltable><tgroup cols="2"><tbody><row><entry395align="char">396<para>0</para>397</entry><entry398align="char">399<para>The function was completed without errors.</para>400</entry>401</row><row><entry402align="char">403<para>ENODEV</para>404</entry><entry405align="char">406<para>The specified demux is not registered in the demux407directory.</para>408</entry>409</row><row><entry410align="char">411<para>EBUSY</para>412</entry><entry413align="char">414<para>The specified demux is currently in use.</para>415</entry>416</row></tbody></tgroup></informaltable>417418</section><section419role="subsection"><title>dmx_get_demuxes()</title>420<para>DESCRIPTION421</para>422<informaltable><tgroup cols="1"><tbody><row><entry423align="char">424<para>Provides the caller with the list of registered demux interfaces, using the425standard list structure defined in the include file linux/list.h. The include file426demux.h defines the macro DMX_DIR_ENTRY() for converting an element of427the generic type struct list_head* to the type dmx_demux_t*. The caller must428not free the memory of any of the elements obtained via this function call.</para>429</entry>430</row></tbody></tgroup></informaltable>431<para>SYNOPSIS432</para>433<informaltable><tgroup cols="1"><tbody><row><entry434align="char">435<para>struct list_head ⋆dmx_get_demuxes ()</para>436</entry>437</row></tbody></tgroup></informaltable>438<para>PARAMETERS439</para>440<informaltable><tgroup cols="2"><tbody><row><entry441align="char">442<para>none</para>443</entry>444</row></tbody></tgroup></informaltable>445<para>RETURNS446</para>447<informaltable><tgroup cols="2"><tbody><row><entry448align="char">449<para>struct list_head *</para>450</entry><entry451align="char">452<para>A list of demux interfaces, or NULL in the case of an453empty list.</para>454</entry>455</row></tbody></tgroup></informaltable>456</section></section>457<section id="demux_api">458<title>Demux API</title>459<para>The demux API should be implemented for each demux in the system. It is used to select460the TS source of a demux and to manage the demux resources. When the demux461client allocates a resource via the demux API, it receives a pointer to the API of that462resource.463</para>464<para>Each demux receives its TS input from a DVB front-end or from memory, as set via the465demux API. In a system with more than one front-end, the API can be used to select one of466the DVB front-ends as a TS source for a demux, unless this is fixed in the HW platform. The467demux API only controls front-ends regarding their connections with demuxes; the APIs468used to set the other front-end parameters, such as tuning, are not defined in this469document.470</para>471<para>The functions that implement the abstract interface demux should be defined static or472module private and registered to the Demux Directory for external access. It is not necessary473to implement every function in the demux_t struct, however (for example, a demux interface474might support Section filtering, but not TS or PES filtering). The API client is expected to475check the value of any function pointer before calling the function: the value of NULL means476“function not available”.477</para>478<para>Whenever the functions of the demux API modify shared data, the possibilities of lost479update and race condition problems should be addressed, e.g. by protecting parts of code with480mutexes. This is especially important on multi-processor hosts.481</para>482<para>Note that functions called from a bottom half context must not sleep, at least in the 2.2.x483kernels. Even a simple memory allocation can result in a kernel thread being put to sleep if484swapping is needed. For example, the Linux kernel calls the functions of a network device485interface from a bottom half context. Thus, if a demux API function is called from network486device code, the function must not sleep.487</para>488489490<section id="kdapi_fopen">491<title>open()</title>492<para>DESCRIPTION493</para>494<informaltable><tgroup cols="1"><tbody><row><entry495align="char">496<para>This function reserves the demux for use by the caller and, if necessary,497initializes the demux. When the demux is no longer needed, the function close()498should be called. It should be possible for multiple clients to access the demux499at the same time. Thus, the function implementation should increment the500demux usage count when open() is called and decrement it when close() is501called.</para>502</entry>503</row></tbody></tgroup></informaltable>504<para>SYNOPSIS505</para>506<informaltable><tgroup cols="1"><tbody><row><entry507align="char">508<para>int open ( demux_t⋆ demux );</para>509</entry>510</row></tbody></tgroup></informaltable>511<para>PARAMETERS512</para>513<informaltable><tgroup cols="2"><tbody><row><entry514align="char">515<para>demux_t* demux</para>516</entry><entry517align="char">518<para>Pointer to the demux API and instance data.</para>519</entry>520</row></tbody></tgroup></informaltable>521<para>RETURNS522</para>523<informaltable><tgroup cols="2"><tbody><row><entry524align="char">525<para>0</para>526</entry><entry527align="char">528<para>The function was completed without errors.</para>529</entry>530</row><row><entry531align="char">532<para>-EUSERS</para>533</entry><entry534align="char">535<para>Maximum usage count reached.</para>536</entry>537</row><row><entry538align="char">539<para>-EINVAL</para>540</entry><entry541align="char">542<para>Bad parameter.</para>543</entry>544</row></tbody></tgroup></informaltable>545546</section>547<section id="kdapi_fclose">548<title>close()</title>549<para>DESCRIPTION550</para>551<informaltable><tgroup cols="1"><tbody><row><entry552align="char">553<para>This function reserves the demux for use by the caller and, if necessary,554initializes the demux. When the demux is no longer needed, the function close()555should be called. It should be possible for multiple clients to access the demux556at the same time. Thus, the function implementation should increment the557demux usage count when open() is called and decrement it when close() is558called.</para>559</entry>560</row></tbody></tgroup></informaltable>561<para>SYNOPSIS562</para>563<informaltable><tgroup cols="1"><tbody><row><entry564align="char">565<para>int close(demux_t⋆ demux);</para>566</entry>567</row></tbody></tgroup></informaltable>568<para>PARAMETERS569</para>570<informaltable><tgroup cols="2"><tbody><row><entry571align="char">572<para>demux_t* demux</para>573</entry><entry574align="char">575<para>Pointer to the demux API and instance data.</para>576</entry>577</row></tbody></tgroup></informaltable>578<para>RETURNS579</para>580<informaltable><tgroup cols="2"><tbody><row><entry581align="char">582<para>0</para>583</entry><entry584align="char">585<para>The function was completed without errors.</para>586</entry>587</row><row><entry588align="char">589<para>-ENODEV</para>590</entry><entry591align="char">592<para>The demux was not in use.</para>593</entry>594</row><row><entry595align="char">596<para>-EINVAL</para>597</entry><entry598align="char">599<para>Bad parameter.</para>600</entry>601</row></tbody></tgroup></informaltable>602603</section>604<section id="kdapi_fwrite">605<title>write()</title>606<para>DESCRIPTION607</para>608<informaltable><tgroup cols="1"><tbody><row><entry609align="char">610<para>This function provides the demux driver with a memory buffer containing TS611packets. Instead of receiving TS packets from the DVB front-end, the demux612driver software will read packets from memory. Any clients of this demux613with active TS, PES or Section filters will receive filtered data via the Demux614callback API (see 0). The function returns when all the data in the buffer has615been consumed by the demux. Demux hardware typically cannot read TS from616memory. If this is the case, memory-based filtering has to be implemented617entirely in software.</para>618</entry>619</row></tbody></tgroup></informaltable>620<para>SYNOPSIS621</para>622<informaltable><tgroup cols="1"><tbody><row><entry623align="char">624<para>int write(demux_t⋆ demux, const char⋆ buf, size_t625count);</para>626</entry>627</row></tbody></tgroup></informaltable>628<para>PARAMETERS629</para>630<informaltable><tgroup cols="2"><tbody><row><entry631align="char">632<para>demux_t* demux</para>633</entry><entry634align="char">635<para>Pointer to the demux API and instance data.</para>636</entry>637</row><row><entry638align="char">639<para>const char* buf</para>640</entry><entry641align="char">642<para>Pointer to the TS data in kernel-space memory.</para>643</entry>644</row><row><entry645align="char">646<para>size_t length</para>647</entry><entry648align="char">649<para>Length of the TS data.</para>650</entry>651</row></tbody></tgroup></informaltable>652<para>RETURNS653</para>654<informaltable><tgroup cols="2"><tbody><row><entry655align="char">656<para>0</para>657</entry><entry658align="char">659<para>The function was completed without errors.</para>660</entry>661</row><row><entry662align="char">663<para>-ENOSYS</para>664</entry><entry665align="char">666<para>The command is not implemented.</para>667</entry>668</row><row><entry669align="char">670<para>-EINVAL</para>671</entry><entry672align="char">673<para>Bad parameter.</para>674</entry>675</row></tbody></tgroup></informaltable>676677</section><section678role="subsection"><title>allocate_ts_feed()</title>679<para>DESCRIPTION680</para>681<informaltable><tgroup cols="1"><tbody><row><entry682align="char">683<para>Allocates a new TS feed, which is used to filter the TS packets carrying a684certain PID. The TS feed normally corresponds to a hardware PID filter on the685demux chip.</para>686</entry>687</row></tbody></tgroup></informaltable>688<para>SYNOPSIS689</para>690<informaltable><tgroup cols="1"><tbody><row><entry691align="char">692<para>int allocate_ts_feed(dmx_demux_t⋆ demux,693dmx_ts_feed_t⋆⋆ feed, dmx_ts_cb callback);</para>694</entry>695</row></tbody></tgroup></informaltable>696<para>PARAMETERS697</para>698<informaltable><tgroup cols="2"><tbody><row><entry699align="char">700<para>demux_t* demux</para>701</entry><entry702align="char">703<para>Pointer to the demux API and instance data.</para>704</entry>705</row><row><entry706align="char">707<para>dmx_ts_feed_t**708feed</para>709</entry><entry710align="char">711<para>Pointer to the TS feed API and instance data.</para>712</entry>713</row><row><entry714align="char">715<para>dmx_ts_cb callback</para>716</entry><entry717align="char">718<para>Pointer to the callback function for passing received TS719packet</para>720</entry>721</row></tbody></tgroup></informaltable>722<para>RETURNS723</para>724<informaltable><tgroup cols="2"><tbody><row><entry725align="char">726<para>0</para>727</entry><entry728align="char">729<para>The function was completed without errors.</para>730</entry>731</row><row><entry732align="char">733<para>-EBUSY</para>734</entry><entry735align="char">736<para>No more TS feeds available.</para>737</entry>738</row><row><entry739align="char">740<para>-ENOSYS</para>741</entry><entry742align="char">743<para>The command is not implemented.</para>744</entry>745</row><row><entry746align="char">747<para>-EINVAL</para>748</entry><entry749align="char">750<para>Bad parameter.</para>751</entry>752</row></tbody></tgroup></informaltable>753754</section><section755role="subsection"><title>release_ts_feed()</title>756<para>DESCRIPTION757</para>758<informaltable><tgroup cols="1"><tbody><row><entry759align="char">760<para>Releases the resources allocated with allocate_ts_feed(). Any filtering in761progress on the TS feed should be stopped before calling this function.</para>762</entry>763</row></tbody></tgroup></informaltable>764<para>SYNOPSIS765</para>766<informaltable><tgroup cols="1"><tbody><row><entry767align="char">768<para>int release_ts_feed(dmx_demux_t⋆ demux,769dmx_ts_feed_t⋆ feed);</para>770</entry>771</row></tbody></tgroup></informaltable>772<para>PARAMETERS773</para>774<informaltable><tgroup cols="2"><tbody><row><entry775align="char">776<para>demux_t* demux</para>777</entry><entry778align="char">779<para>Pointer to the demux API and instance data.</para>780</entry>781</row><row><entry782align="char">783<para>dmx_ts_feed_t* feed</para>784</entry><entry785align="char">786<para>Pointer to the TS feed API and instance data.</para>787</entry>788</row></tbody></tgroup></informaltable>789<para>RETURNS790</para>791<informaltable><tgroup cols="2"><tbody><row><entry792align="char">793<para>0</para>794</entry><entry795align="char">796<para>The function was completed without errors.</para>797</entry>798</row><row><entry799align="char">800<para>-EINVAL</para>801</entry><entry802align="char">803<para>Bad parameter.</para>804</entry>805</row></tbody></tgroup></informaltable>806807</section><section808role="subsection"><title>allocate_section_feed()</title>809<para>DESCRIPTION810</para>811<informaltable><tgroup cols="1"><tbody><row><entry812align="char">813<para>Allocates a new section feed, i.e. a demux resource for filtering and receiving814sections. On platforms with hardware support for section filtering, a section815feed is directly mapped to the demux HW. On other platforms, TS packets are816first PID filtered in hardware and a hardware section filter then emulated in817software. The caller obtains an API pointer of type dmx_section_feed_t as an818out parameter. Using this API the caller can set filtering parameters and start819receiving sections.</para>820</entry>821</row></tbody></tgroup></informaltable>822<para>SYNOPSIS823</para>824<informaltable><tgroup cols="1"><tbody><row><entry825align="char">826<para>int allocate_section_feed(dmx_demux_t⋆ demux,827dmx_section_feed_t ⋆⋆feed, dmx_section_cb callback);</para>828</entry>829</row></tbody></tgroup></informaltable>830<para>PARAMETERS831</para>832<informaltable><tgroup cols="2"><tbody><row><entry833align="char">834<para>demux_t *demux</para>835</entry><entry836align="char">837<para>Pointer to the demux API and instance data.</para>838</entry>839</row><row><entry840align="char">841<para>dmx_section_feed_t842**feed</para>843</entry><entry844align="char">845<para>Pointer to the section feed API and instance data.</para>846</entry>847</row><row><entry848align="char">849<para>dmx_section_cb850callback</para>851</entry><entry852align="char">853<para>Pointer to the callback function for passing received854sections.</para>855</entry>856</row></tbody></tgroup></informaltable>857<para>RETURNS858</para>859<informaltable><tgroup cols="2"><tbody><row><entry860align="char">861<para>0</para>862</entry><entry863align="char">864<para>The function was completed without errors.</para>865</entry>866</row><row><entry867align="char">868<para>-EBUSY</para>869</entry><entry870align="char">871<para>No more section feeds available.</para>872</entry>873</row><row><entry874align="char">875<para>-ENOSYS</para>876</entry><entry877align="char">878<para>The command is not implemented.</para>879</entry>880</row><row><entry881align="char">882<para>-EINVAL</para>883</entry><entry884align="char">885<para>Bad parameter.</para>886</entry>887</row></tbody></tgroup></informaltable>888889</section><section890role="subsection"><title>release_section_feed()</title>891<para>DESCRIPTION892</para>893<informaltable><tgroup cols="1"><tbody><row><entry894align="char">895<para>Releases the resources allocated with allocate_section_feed(), including896allocated filters. Any filtering in progress on the section feed should be stopped897before calling this function.</para>898</entry>899</row></tbody></tgroup></informaltable>900<para>SYNOPSIS901</para>902<informaltable><tgroup cols="1"><tbody><row><entry903align="char">904<para>int release_section_feed(dmx_demux_t⋆ demux,905dmx_section_feed_t ⋆feed);</para>906</entry>907</row></tbody></tgroup></informaltable>908<para>PARAMETERS909</para>910<informaltable><tgroup cols="2"><tbody><row><entry911align="char">912<para>demux_t *demux</para>913</entry><entry914align="char">915<para>Pointer to the demux API and instance data.</para>916</entry>917</row><row><entry918align="char">919<para>dmx_section_feed_t920*feed</para>921</entry><entry922align="char">923<para>Pointer to the section feed API and instance data.</para>924</entry>925</row></tbody></tgroup></informaltable>926<para>RETURNS927</para>928<informaltable><tgroup cols="2"><tbody><row><entry929align="char">930<para>0</para>931</entry><entry932align="char">933<para>The function was completed without errors.</para>934</entry>935</row><row><entry936align="char">937<para>-EINVAL</para>938</entry><entry939align="char">940<para>Bad parameter.</para>941</entry>942</row></tbody></tgroup></informaltable>943944</section><section945role="subsection"><title>descramble_mac_address()</title>946<para>DESCRIPTION947</para>948<informaltable><tgroup cols="1"><tbody><row><entry949align="char">950<para>This function runs a descrambling algorithm on the destination MAC951address field of a DVB Datagram Section, replacing the original address952with its un-encrypted version. Otherwise, the description on the function953descramble_section_payload() applies also to this function.</para>954</entry>955</row></tbody></tgroup></informaltable>956<para>SYNOPSIS957</para>958<informaltable><tgroup cols="1"><tbody><row><entry959align="char">960<para>int descramble_mac_address(dmx_demux_t⋆ demux, __u8961⋆buffer1, size_t buffer1_length, __u8 ⋆buffer2,962size_t buffer2_length, __u16 pid);</para>963</entry>964</row></tbody></tgroup></informaltable>965<para>PARAMETERS966</para>967<informaltable><tgroup cols="2"><tbody><row><entry968align="char">969<para>dmx_demux_t970*demux</para>971</entry><entry972align="char">973<para>Pointer to the demux API and instance data.</para>974</entry>975</row><row><entry976align="char">977<para>__u8 *buffer1</para>978</entry><entry979align="char">980<para>Pointer to the first byte of the section.</para>981</entry>982</row><row><entry983align="char">984<para>size_t buffer1_length</para>985</entry><entry986align="char">987<para>Length of the section data, including headers and CRC,988in buffer1.</para>989</entry>990</row><row><entry991align="char">992<para>__u8* buffer2</para>993</entry><entry994align="char">995<para>Pointer to the tail of the section data, or NULL. The996pointer has a non-NULL value if the section wraps past997the end of a circular buffer.</para>998</entry>999</row><row><entry1000align="char">1001<para>size_t buffer2_length</para>1002</entry><entry1003align="char">1004<para>Length of the section data, including headers and CRC,1005in buffer2.</para>1006</entry>1007</row><row><entry1008align="char">1009<para>__u16 pid</para>1010</entry><entry1011align="char">1012<para>The PID on which the section was received. Useful1013for obtaining the descrambling key, e.g. from a DVB1014Common Access facility.</para>1015</entry>1016</row></tbody></tgroup></informaltable>1017<para>RETURNS1018</para>1019<informaltable><tgroup cols="2"><tbody><row><entry1020align="char">1021<para>0</para>1022</entry><entry1023align="char">1024<para>The function was completed without errors.</para>1025</entry>1026</row><row><entry1027align="char">1028<para>-ENOSYS</para>1029</entry><entry1030align="char">1031<para>No descrambling facility available.</para>1032</entry>1033</row><row><entry1034align="char">1035<para>-EINVAL</para>1036</entry><entry1037align="char">1038<para>Bad parameter.</para>1039</entry>1040</row></tbody></tgroup></informaltable>10411042</section><section1043role="subsection"><title>descramble_section_payload()</title>1044<para>DESCRIPTION1045</para>1046<informaltable><tgroup cols="1"><tbody><row><entry1047align="char">1048<para>This function runs a descrambling algorithm on the payload of a DVB1049Datagram Section, replacing the original payload with its un-encrypted1050version. The function will be called from the demux API implementation;1051the API client need not call this function directly. Section-level scrambling1052algorithms are currently standardized only for DVB-RCC (return channel1053over 2-directional cable TV network) systems. For all other DVB networks,1054encryption schemes are likely to be proprietary to each data broadcaster. Thus,1055it is expected that this function pointer will have the value of NULL (i.e.,1056function not available) in most demux API implementations. Nevertheless, it1057should be possible to use the function pointer as a hook for dynamically adding1058a “plug-in” descrambling facility to a demux driver.</para>1059</entry>1060</row><row><entry1061align="char">1062<para>While this function is not needed with hardware-based section descrambling,1063the descramble_section_payload function pointer can be used to override the1064default hardware-based descrambling algorithm: if the function pointer has a1065non-NULL value, the corresponding function should be used instead of any1066descrambling hardware.</para>1067</entry>1068</row></tbody></tgroup></informaltable>1069<para>SYNOPSIS1070</para>1071<informaltable><tgroup cols="1"><tbody><row><entry1072align="char">1073<para>int descramble_section_payload(dmx_demux_t⋆ demux,1074__u8 ⋆buffer1, size_t buffer1_length, __u8 ⋆buffer2,1075size_t buffer2_length, __u16 pid);</para>1076</entry>1077</row></tbody></tgroup></informaltable>1078<para>PARAMETERS1079</para>1080<informaltable><tgroup cols="2"><tbody><row><entry1081align="char">1082<para>dmx_demux_t1083*demux</para>1084</entry><entry1085align="char">1086<para>Pointer to the demux API and instance data.</para>1087</entry>1088</row><row><entry1089align="char">1090<para>__u8 *buffer1</para>1091</entry><entry1092align="char">1093<para>Pointer to the first byte of the section.</para>1094</entry>1095</row><row><entry1096align="char">1097<para>size_t buffer1_length</para>1098</entry><entry1099align="char">1100<para>Length of the section data, including headers and CRC,1101in buffer1.</para>1102</entry>1103</row><row><entry1104align="char">1105<para>__u8 *buffer2</para>1106</entry><entry1107align="char">1108<para>Pointer to the tail of the section data, or NULL. The1109pointer has a non-NULL value if the section wraps past1110the end of a circular buffer.</para>1111</entry>1112</row><row><entry1113align="char">1114<para>size_t buffer2_length</para>1115</entry><entry1116align="char">1117<para>Length of the section data, including headers and CRC,1118in buffer2.</para>1119</entry>1120</row><row><entry1121align="char">1122<para>__u16 pid</para>1123</entry><entry1124align="char">1125<para>The PID on which the section was received. Useful1126for obtaining the descrambling key, e.g. from a DVB1127Common Access facility.</para>1128</entry>1129</row></tbody></tgroup></informaltable>1130<para>RETURNS1131</para>1132<informaltable><tgroup cols="2"><tbody><row><entry1133align="char">1134<para>0</para>1135</entry><entry1136align="char">1137<para>The function was completed without errors.</para>1138</entry>1139</row><row><entry1140align="char">1141<para>-ENOSYS</para>1142</entry><entry1143align="char">1144<para>No descrambling facility available.</para>1145</entry>1146</row><row><entry1147align="char">1148<para>-EINVAL</para>1149</entry><entry1150align="char">1151<para>Bad parameter.</para>1152</entry>1153</row></tbody></tgroup></informaltable>11541155</section><section1156role="subsection"><title>add_frontend()</title>1157<para>DESCRIPTION1158</para>1159<informaltable><tgroup cols="1"><tbody><row><entry1160align="char">1161<para>Registers a connectivity between a demux and a front-end, i.e., indicates that1162the demux can be connected via a call to connect_frontend() to use the given1163front-end as a TS source. The client of this function has to allocate dynamic or1164static memory for the frontend structure and initialize its fields before calling1165this function. This function is normally called during the driver initialization.1166The caller must not free the memory of the frontend struct before successfully1167calling remove_frontend().</para>1168</entry>1169</row></tbody></tgroup></informaltable>1170<para>SYNOPSIS1171</para>1172<informaltable><tgroup cols="1"><tbody><row><entry1173align="char">1174<para>int add_frontend(dmx_demux_t ⋆demux, dmx_frontend_t1175⋆frontend);</para>1176</entry>1177</row></tbody></tgroup></informaltable>1178<para>PARAMETERS1179</para>1180<informaltable><tgroup cols="2"><tbody><row><entry1181align="char">1182<para>dmx_demux_t*1183demux</para>1184</entry><entry1185align="char">1186<para>Pointer to the demux API and instance data.</para>1187</entry>1188</row><row><entry1189align="char">1190<para>dmx_frontend_t*1191frontend</para>1192</entry><entry1193align="char">1194<para>Pointer to the front-end instance data.</para>1195</entry>1196</row></tbody></tgroup></informaltable>1197<para>RETURNS1198</para>1199<informaltable><tgroup cols="2"><tbody><row><entry1200align="char">1201<para>0</para>1202</entry><entry1203align="char">1204<para>The function was completed without errors.</para>1205</entry>1206</row><row><entry1207align="char">1208<para>-EEXIST</para>1209</entry><entry1210align="char">1211<para>A front-end with the same value of the id field already1212registered.</para>1213</entry>1214</row><row><entry1215align="char">1216<para>-EINUSE</para>1217</entry><entry1218align="char">1219<para>The demux is in use.</para>1220</entry>1221</row><row><entry1222align="char">1223<para>-ENOMEM</para>1224</entry><entry1225align="char">1226<para>No more front-ends can be added.</para>1227</entry>1228</row><row><entry1229align="char">1230<para>-EINVAL</para>1231</entry><entry1232align="char">1233<para>Bad parameter.</para>1234</entry>1235</row></tbody></tgroup></informaltable>12361237</section><section1238role="subsection"><title>remove_frontend()</title>1239<para>DESCRIPTION1240</para>1241<informaltable><tgroup cols="1"><tbody><row><entry1242align="char">1243<para>Indicates that the given front-end, registered by a call to add_frontend(), can1244no longer be connected as a TS source by this demux. The function should be1245called when a front-end driver or a demux driver is removed from the system.1246If the front-end is in use, the function fails with the return value of -EBUSY.1247After successfully calling this function, the caller can free the memory of1248the frontend struct if it was dynamically allocated before the add_frontend()1249operation.</para>1250</entry>1251</row></tbody></tgroup></informaltable>1252<para>SYNOPSIS1253</para>1254<informaltable><tgroup cols="1"><tbody><row><entry1255align="char">1256<para>int remove_frontend(dmx_demux_t⋆ demux,1257dmx_frontend_t⋆ frontend);</para>1258</entry>1259</row></tbody></tgroup></informaltable>1260<para>PARAMETERS1261</para>1262<informaltable><tgroup cols="2"><tbody><row><entry1263align="char">1264<para>dmx_demux_t*1265demux</para>1266</entry><entry1267align="char">1268<para>Pointer to the demux API and instance data.</para>1269</entry>1270</row><row><entry1271align="char">1272<para>dmx_frontend_t*1273frontend</para>1274</entry><entry1275align="char">1276<para>Pointer to the front-end instance data.</para>1277</entry>1278</row></tbody></tgroup></informaltable>1279<para>RETURNS1280</para>1281<informaltable><tgroup cols="2"><tbody><row><entry1282align="char">1283<para>0</para>1284</entry><entry1285align="char">1286<para>The function was completed without errors.</para>1287</entry>1288</row><row><entry1289align="char">1290<para>-EINVAL</para>1291</entry><entry1292align="char">1293<para>Bad parameter.</para>1294</entry>1295</row><row><entry1296align="char">1297<para>-EBUSY</para>1298</entry><entry1299align="char">1300<para>The front-end is in use, i.e. a call to connect_frontend()1301has not been followed by a call to disconnect_frontend().</para>1302</entry>1303</row></tbody></tgroup></informaltable>13041305</section><section1306role="subsection"><title>get_frontends()</title>1307<para>DESCRIPTION1308</para>1309<informaltable><tgroup cols="1"><tbody><row><entry1310align="char">1311<para>Provides the APIs of the front-ends that have been registered for this demux.1312Any of the front-ends obtained with this call can be used as a parameter for1313connect_frontend().</para>1314</entry>1315</row><row><entry1316align="char">1317<para>The include file demux.h contains the macro DMX_FE_ENTRY() for1318converting an element of the generic type struct list_head* to the type1319dmx_frontend_t*. The caller must not free the memory of any of the elements1320obtained via this function call.</para>1321</entry>1322</row></tbody></tgroup></informaltable>1323<para>SYNOPSIS1324</para>1325<informaltable><tgroup cols="1"><tbody><row><entry1326align="char">1327<para>struct list_head⋆ get_frontends(dmx_demux_t⋆ demux);</para>1328</entry>1329</row></tbody></tgroup></informaltable>1330<para>PARAMETERS1331</para>1332<informaltable><tgroup cols="2"><tbody><row><entry1333align="char">1334<para>dmx_demux_t*1335demux</para>1336</entry><entry1337align="char">1338<para>Pointer to the demux API and instance data.</para>1339</entry>1340</row></tbody></tgroup></informaltable>1341<para>RETURNS1342</para>1343<informaltable><tgroup cols="2"><tbody><row><entry1344align="char">1345<para>dmx_demux_t*</para>1346</entry><entry1347align="char">1348<para>A list of front-end interfaces, or NULL in the case of an1349empty list.</para>1350</entry>1351</row></tbody></tgroup></informaltable>13521353</section><section1354role="subsection"><title>connect_frontend()</title>1355<para>DESCRIPTION1356</para>1357<informaltable><tgroup cols="1"><tbody><row><entry1358align="char">1359<para>Connects the TS output of the front-end to the input of the demux. A demux1360can only be connected to a front-end registered to the demux with the function1361add_frontend().</para>1362</entry>1363</row><row><entry1364align="char">1365<para>It may or may not be possible to connect multiple demuxes to the same1366front-end, depending on the capabilities of the HW platform. When not used,1367the front-end should be released by calling disconnect_frontend().</para>1368</entry>1369</row></tbody></tgroup></informaltable>1370<para>SYNOPSIS1371</para>1372<informaltable><tgroup cols="1"><tbody><row><entry1373align="char">1374<para>int connect_frontend(dmx_demux_t⋆ demux,1375dmx_frontend_t⋆ frontend);</para>1376</entry>1377</row></tbody></tgroup></informaltable>1378<para>PARAMETERS1379</para>1380<informaltable><tgroup cols="2"><tbody><row><entry1381align="char">1382<para>dmx_demux_t*1383demux</para>1384</entry><entry1385align="char">1386<para>Pointer to the demux API and instance data.</para>1387</entry>1388</row><row><entry1389align="char">1390<para>dmx_frontend_t*1391frontend</para>1392</entry><entry1393align="char">1394<para>Pointer to the front-end instance data.</para>1395</entry>1396</row></tbody></tgroup></informaltable>1397<para>RETURNS1398</para>1399<informaltable><tgroup cols="2"><tbody><row><entry1400align="char">1401<para>0</para>1402</entry><entry1403align="char">1404<para>The function was completed without errors.</para>1405</entry>1406</row><row><entry1407align="char">1408<para>-EINVAL</para>1409</entry><entry1410align="char">1411<para>Bad parameter.</para>1412</entry>1413</row><row><entry1414align="char">1415<para>-EBUSY</para>1416</entry><entry1417align="char">1418<para>The front-end is in use.</para>1419</entry>1420</row></tbody></tgroup></informaltable>14211422</section><section1423role="subsection"><title>disconnect_frontend()</title>1424<para>DESCRIPTION1425</para>1426<informaltable><tgroup cols="1"><tbody><row><entry1427align="char">1428<para>Disconnects the demux and a front-end previously connected by a1429connect_frontend() call.</para>1430</entry>1431</row></tbody></tgroup></informaltable>1432<para>SYNOPSIS1433</para>1434<informaltable><tgroup cols="1"><tbody><row><entry1435align="char">1436<para>int disconnect_frontend(dmx_demux_t⋆ demux);</para>1437</entry>1438</row></tbody></tgroup></informaltable>1439<para>PARAMETERS1440</para>1441<informaltable><tgroup cols="2"><tbody><row><entry1442align="char">1443<para>dmx_demux_t*1444demux</para>1445</entry><entry1446align="char">1447<para>Pointer to the demux API and instance data.</para>1448</entry>1449</row></tbody></tgroup></informaltable>1450<para>RETURNS1451</para>1452<informaltable><tgroup cols="2"><tbody><row><entry1453align="char">1454<para>0</para>1455</entry><entry1456align="char">1457<para>The function was completed without errors.</para>1458</entry>1459</row><row><entry1460align="char">1461<para>-EINVAL</para>1462</entry><entry1463align="char">1464<para>Bad parameter.</para>1465</entry>1466</row></tbody></tgroup></informaltable>1467</section></section>1468<section id="demux_callback_api">1469<title>Demux Callback API</title>1470<para>This kernel-space API comprises the callback functions that deliver filtered data to the1471demux client. Unlike the other APIs, these API functions are provided by the client and called1472from the demux code.1473</para>1474<para>The function pointers of this abstract interface are not packed into a structure as in the1475other demux APIs, because the callback functions are registered and used independent1476of each other. As an example, it is possible for the API client to provide several1477callback functions for receiving TS packets and no callbacks for PES packets or1478sections.1479</para>1480<para>The functions that implement the callback API need not be re-entrant: when a demux1481driver calls one of these functions, the driver is not allowed to call the function again before1482the original call returns. If a callback is triggered by a hardware interrupt, it is recommended1483to use the Linux “bottom half” mechanism or start a tasklet instead of making the callback1484function call directly from a hardware interrupt.1485</para>14861487<section1488role="subsection"><title>dmx_ts_cb()</title>1489<para>DESCRIPTION1490</para>1491<informaltable><tgroup cols="1"><tbody><row><entry1492align="char">1493<para>This function, provided by the client of the demux API, is called from the1494demux code. The function is only called when filtering on this TS feed has1495been enabled using the start_filtering() function.</para>1496</entry>1497</row><row><entry1498align="char">1499<para>Any TS packets that match the filter settings are copied to a circular buffer. The1500filtered TS packets are delivered to the client using this callback function. The1501size of the circular buffer is controlled by the circular_buffer_size parameter1502of the set() function in the TS Feed API. It is expected that the buffer1 and1503buffer2 callback parameters point to addresses within the circular buffer, but1504other implementations are also possible. Note that the called party should not1505try to free the memory the buffer1 and buffer2 parameters point to.</para>1506</entry>1507</row><row><entry1508align="char">1509<para>When this function is called, the buffer1 parameter typically points to the1510start of the first undelivered TS packet within a circular buffer. The buffer21511buffer parameter is normally NULL, except when the received TS packets have1512crossed the last address of the circular buffer and ”wrapped” to the beginning1513of the buffer. In the latter case the buffer1 parameter would contain an address1514within the circular buffer, while the buffer2 parameter would contain the first1515address of the circular buffer.</para>1516</entry>1517</row><row><entry1518align="char">1519<para>The number of bytes delivered with this function (i.e. buffer1_length +1520buffer2_length) is usually equal to the value of callback_length parameter1521given in the set() function, with one exception: if a timeout occurs before1522receiving callback_length bytes of TS data, any undelivered packets are1523immediately delivered to the client by calling this function. The timeout1524duration is controlled by the set() function in the TS Feed API.</para>1525</entry>1526</row><row><entry1527align="char">1528<para>If a TS packet is received with errors that could not be fixed by the TS-level1529forward error correction (FEC), the Transport_error_indicator flag of the TS1530packet header should be set. The TS packet should not be discarded, as1531the error can possibly be corrected by a higher layer protocol. If the called1532party is slow in processing the callback, it is possible that the circular buffer1533eventually fills up. If this happens, the demux driver should discard any TS1534packets received while the buffer is full. The error should be indicated to the1535client on the next callback by setting the success parameter to the value of1536DMX_OVERRUN_ERROR.</para>1537</entry>1538</row><row><entry1539align="char">1540<para>The type of data returned to the callback can be selected by the new1541function int (*set_type) (struct dmx_ts_feed_s* feed, int type, dmx_ts_pes_t1542pes_type) which is part of the dmx_ts_feed_s struct (also cf. to the1543include file ost/demux.h) The type parameter decides if the raw TS packet1544(TS_PACKET) or just the payload (TS_PACKET—TS_PAYLOAD_ONLY)1545should be returned. If additionally the TS_DECODER bit is set the stream1546will also be sent to the hardware MPEG decoder. In this case, the second1547flag decides as what kind of data the stream should be interpreted. The1548possible choices are one of DMX_TS_PES_AUDIO, DMX_TS_PES_VIDEO,1549DMX_TS_PES_TELETEXT, DMX_TS_PES_SUBTITLE,1550DMX_TS_PES_PCR, or DMX_TS_PES_OTHER.</para>1551</entry>1552</row></tbody></tgroup></informaltable>1553<para>SYNOPSIS1554</para>1555<informaltable><tgroup cols="1"><tbody><row><entry1556align="char">1557<para>int dmx_ts_cb(__u8⋆ buffer1, size_t buffer1_length,1558__u8⋆ buffer2, size_t buffer2_length, dmx_ts_feed_t⋆1559source, dmx_success_t success);</para>1560</entry>1561</row></tbody></tgroup></informaltable>1562<para>PARAMETERS1563</para>1564<informaltable><tgroup cols="2"><tbody><row><entry1565align="char">1566<para>__u8* buffer1</para>1567</entry><entry1568align="char">1569<para>Pointer to the start of the filtered TS packets.</para>1570</entry>1571</row><row><entry1572align="char">1573<para>size_t buffer1_length</para>1574</entry><entry1575align="char">1576<para>Length of the TS data in buffer1.</para>1577</entry>1578</row><row><entry1579align="char">1580<para>__u8* buffer2</para>1581</entry><entry1582align="char">1583<para>Pointer to the tail of the filtered TS packets, or NULL.</para>1584</entry>1585</row><row><entry1586align="char">1587<para>size_t buffer2_length</para>1588</entry><entry1589align="char">1590<para>Length of the TS data in buffer2.</para>1591</entry>1592</row><row><entry1593align="char">1594<para>dmx_ts_feed_t*1595source</para>1596</entry><entry1597align="char">1598<para>Indicates which TS feed is the source of the callback.</para>1599</entry>1600</row><row><entry1601align="char">1602<para>dmx_success_t1603success</para>1604</entry><entry1605align="char">1606<para>Indicates if there was an error in TS reception.</para>1607</entry>1608</row></tbody></tgroup></informaltable>1609<para>RETURNS1610</para>1611<informaltable><tgroup cols="2"><tbody><row><entry1612align="char">1613<para>0</para>1614</entry><entry1615align="char">1616<para>Continue filtering.</para>1617</entry>1618</row><row><entry1619align="char">1620<para>-1</para>1621</entry><entry1622align="char">1623<para>Stop filtering - has the same effect as a call to1624stop_filtering() on the TS Feed API.</para>1625</entry>1626</row></tbody></tgroup></informaltable>16271628</section><section1629role="subsection"><title>dmx_section_cb()</title>1630<para>DESCRIPTION1631</para>1632<informaltable><tgroup cols="1"><tbody><row><entry1633align="char">1634<para>This function, provided by the client of the demux API, is called from the1635demux code. The function is only called when filtering of sections has been1636enabled using the function start_filtering() of the section feed API. When the1637demux driver has received a complete section that matches at least one section1638filter, the client is notified via this callback function. Normally this function is1639called for each received section; however, it is also possible to deliver multiple1640sections with one callback, for example when the system load is high. If an1641error occurs while receiving a section, this function should be called with1642the corresponding error type set in the success field, whether or not there is1643data to deliver. The Section Feed implementation should maintain a circular1644buffer for received sections. However, this is not necessary if the Section Feed1645API is implemented as a client of the TS Feed API, because the TS Feed1646implementation then buffers the received data. The size of the circular buffer1647can be configured using the set() function in the Section Feed API. If there1648is no room in the circular buffer when a new section is received, the section1649must be discarded. If this happens, the value of the success parameter should1650be DMX_OVERRUN_ERROR on the next callback.</para>1651</entry>1652</row></tbody></tgroup></informaltable>1653<para>SYNOPSIS1654</para>1655<informaltable><tgroup cols="1"><tbody><row><entry1656align="char">1657<para>int dmx_section_cb(__u8⋆ buffer1, size_t1658buffer1_length, __u8⋆ buffer2, size_t1659buffer2_length, dmx_section_filter_t⋆ source,1660dmx_success_t success);</para>1661</entry>1662</row></tbody></tgroup></informaltable>1663<para>PARAMETERS1664</para>1665<informaltable><tgroup cols="2"><tbody><row><entry1666align="char">1667<para>__u8* buffer1</para>1668</entry><entry1669align="char">1670<para>Pointer to the start of the filtered section, e.g. within the1671circular buffer of the demux driver.</para>1672</entry>1673</row><row><entry1674align="char">1675<para>size_t buffer1_length</para>1676</entry><entry1677align="char">1678<para>Length of the filtered section data in buffer1, including1679headers and CRC.</para>1680</entry>1681</row><row><entry1682align="char">1683<para>__u8* buffer2</para>1684</entry><entry1685align="char">1686<para>Pointer to the tail of the filtered section data, or NULL.1687Useful to handle the wrapping of a circular buffer.</para>1688</entry>1689</row><row><entry1690align="char">1691<para>size_t buffer2_length</para>1692</entry><entry1693align="char">1694<para>Length of the filtered section data in buffer2, including1695headers and CRC.</para>1696</entry>1697</row><row><entry1698align="char">1699<para>dmx_section_filter_t*1700filter</para>1701</entry><entry1702align="char">1703<para>Indicates the filter that triggered the callback.</para>1704</entry>1705</row><row><entry1706align="char">1707<para>dmx_success_t1708success</para>1709</entry><entry1710align="char">1711<para>Indicates if there was an error in section reception.</para>1712</entry>1713</row></tbody></tgroup></informaltable>1714<para>RETURNS1715</para>1716<informaltable><tgroup cols="2"><tbody><row><entry1717align="char">1718<para>0</para>1719</entry><entry1720align="char">1721<para>Continue filtering.</para>1722</entry>1723</row><row><entry1724align="char">1725<para>-1</para>1726</entry><entry1727align="char">1728<para>Stop filtering - has the same effect as a call to1729stop_filtering() on the Section Feed API.</para>1730</entry>1731</row></tbody></tgroup></informaltable>1732</section></section>1733<section id="ts_feed_api">1734<title>TS Feed API</title>1735<para>A TS feed is typically mapped to a hardware PID filter on the demux chip.1736Using this API, the client can set the filtering properties to start/stop filtering TS1737packets on a particular TS feed. The API is defined as an abstract interface of the type1738dmx_ts_feed_t.1739</para>1740<para>The functions that implement the interface should be defined static or module private. The1741client can get the handle of a TS feed API by calling the function allocate_ts_feed() in the1742demux API.1743</para>17441745<section1746role="subsection"><title>set()</title>1747<para>DESCRIPTION1748</para>1749<informaltable><tgroup cols="1"><tbody><row><entry1750align="char">1751<para>This function sets the parameters of a TS feed. Any filtering in progress on the1752TS feed must be stopped before calling this function.</para>1753</entry>1754</row></tbody></tgroup></informaltable>1755<para>SYNOPSIS1756</para>1757<informaltable><tgroup cols="1"><tbody><row><entry1758align="char">1759<para>int set ( dmx_ts_feed_t⋆ feed, __u16 pid, size_t1760callback_length, size_t circular_buffer_size, int1761descramble, struct timespec timeout);</para>1762</entry>1763</row></tbody></tgroup></informaltable>1764<para>PARAMETERS1765</para>1766<informaltable><tgroup cols="2"><tbody><row><entry1767align="char">1768<para>dmx_ts_feed_t* feed</para>1769</entry><entry1770align="char">1771<para>Pointer to the TS feed API and instance data.</para>1772</entry>1773</row><row><entry1774align="char">1775<para>__u16 pid</para>1776</entry><entry1777align="char">1778<para>PID value to filter. Only the TS packets carrying the1779specified PID will be passed to the API client.</para>1780</entry>1781</row><row><entry1782align="char">1783<para>size_t1784callback_length</para>1785</entry><entry1786align="char">1787<para>Number of bytes to deliver with each call to the1788dmx_ts_cb() callback function. The value of this1789parameter should be a multiple of 188.</para>1790</entry>1791</row><row><entry1792align="char">1793<para>size_t1794circular_buffer_size</para>1795</entry><entry1796align="char">1797<para>Size of the circular buffer for the filtered TS packets.</para>1798</entry>1799</row><row><entry1800align="char">1801<para>int descramble</para>1802</entry><entry1803align="char">1804<para>If non-zero, descramble the filtered TS packets.</para>1805</entry>1806</row><row><entry1807align="char">1808<para>struct timespec1809timeout</para>1810</entry><entry1811align="char">1812<para>Maximum time to wait before delivering received TS1813packets to the client.</para>1814</entry>1815</row></tbody></tgroup></informaltable>1816<para>RETURNS1817</para>1818<informaltable><tgroup cols="2"><tbody><row><entry1819align="char">1820<para>0</para>1821</entry><entry1822align="char">1823<para>The function was completed without errors.</para>1824</entry>1825</row><row><entry1826align="char">1827<para>-ENOMEM</para>1828</entry><entry1829align="char">1830<para>Not enough memory for the requested buffer size.</para>1831</entry>1832</row><row><entry1833align="char">1834<para>-ENOSYS</para>1835</entry><entry1836align="char">1837<para>No descrambling facility available for TS.</para>1838</entry>1839</row><row><entry1840align="char">1841<para>-EINVAL</para>1842</entry><entry1843align="char">1844<para>Bad parameter.</para>1845</entry>1846</row></tbody></tgroup></informaltable>18471848</section><section1849role="subsection"><title>start_filtering()</title>1850<para>DESCRIPTION1851</para>1852<informaltable><tgroup cols="1"><tbody><row><entry1853align="char">1854<para>Starts filtering TS packets on this TS feed, according to its settings. The PID1855value to filter can be set by the API client. All matching TS packets are1856delivered asynchronously to the client, using the callback function registered1857with allocate_ts_feed().</para>1858</entry>1859</row></tbody></tgroup></informaltable>1860<para>SYNOPSIS1861</para>1862<informaltable><tgroup cols="1"><tbody><row><entry1863align="char">1864<para>int start_filtering(dmx_ts_feed_t⋆ feed);</para>1865</entry>1866</row></tbody></tgroup></informaltable>1867<para>PARAMETERS1868</para>1869<informaltable><tgroup cols="2"><tbody><row><entry1870align="char">1871<para>dmx_ts_feed_t* feed</para>1872</entry><entry1873align="char">1874<para>Pointer to the TS feed API and instance data.</para>1875</entry>1876</row></tbody></tgroup></informaltable>1877<para>RETURNS1878</para>1879<informaltable><tgroup cols="2"><tbody><row><entry1880align="char">1881<para>0</para>1882</entry><entry1883align="char">1884<para>The function was completed without errors.</para>1885</entry>1886</row><row><entry1887align="char">1888<para>-EINVAL</para>1889</entry><entry1890align="char">1891<para>Bad parameter.</para>1892</entry>1893</row></tbody></tgroup></informaltable>18941895</section><section1896role="subsection"><title>stop_filtering()</title>1897<para>DESCRIPTION1898</para>1899<informaltable><tgroup cols="1"><tbody><row><entry1900align="char">1901<para>Stops filtering TS packets on this TS feed.</para>1902</entry>1903</row></tbody></tgroup></informaltable>1904<para>SYNOPSIS1905</para>1906<informaltable><tgroup cols="1"><tbody><row><entry1907align="char">1908<para>int stop_filtering(dmx_ts_feed_t⋆ feed);</para>1909</entry>1910</row></tbody></tgroup></informaltable>1911<para>PARAMETERS1912</para>1913<informaltable><tgroup cols="2"><tbody><row><entry1914align="char">1915<para>dmx_ts_feed_t* feed</para>1916</entry><entry1917align="char">1918<para>Pointer to the TS feed API and instance data.</para>1919</entry>1920</row></tbody></tgroup></informaltable>1921<para>RETURNS1922</para>1923<informaltable><tgroup cols="2"><tbody><row><entry1924align="char">1925<para>0</para>1926</entry><entry1927align="char">1928<para>The function was completed without errors.</para>1929</entry>1930</row><row><entry1931align="char">1932<para>-EINVAL</para>1933</entry><entry1934align="char">1935<para>Bad parameter.</para>1936</entry>1937</row></tbody></tgroup></informaltable>1938</section></section>1939<section id="section_feed_api">1940<title>Section Feed API</title>1941<para>A section feed is a resource consisting of a PID filter and a set of section filters. Using this1942API, the client can set the properties of a section feed and to start/stop filtering. The API is1943defined as an abstract interface of the type dmx_section_feed_t. The functions that implement1944the interface should be defined static or module private. The client can get the handle of1945a section feed API by calling the function allocate_section_feed() in the demux1946API.1947</para>1948<para>On demux platforms that provide section filtering in hardware, the Section Feed API1949implementation provides a software wrapper for the demux hardware. Other platforms may1950support only PID filtering in hardware, requiring that TS packets are converted to sections in1951software. In the latter case the Section Feed API implementation can be a client of the TS1952Feed API.1953</para>19541955</section>1956<section id="kdapi_set">1957<title>set()</title>1958<para>DESCRIPTION1959</para>1960<informaltable><tgroup cols="1"><tbody><row><entry1961align="char">1962<para>This function sets the parameters of a section feed. Any filtering in progress on1963the section feed must be stopped before calling this function. If descrambling1964is enabled, the payload_scrambling_control and address_scrambling_control1965fields of received DVB datagram sections should be observed. If either one is1966non-zero, the section should be descrambled either in hardware or using the1967functions descramble_mac_address() and descramble_section_payload() of the1968demux API. Note that according to the MPEG-2 Systems specification, only1969the payloads of private sections can be scrambled while the rest of the section1970data must be sent in the clear.</para>1971</entry>1972</row></tbody></tgroup></informaltable>1973<para>SYNOPSIS1974</para>1975<informaltable><tgroup cols="1"><tbody><row><entry1976align="char">1977<para>int set(dmx_section_feed_t⋆ feed, __u16 pid, size_t1978circular_buffer_size, int descramble, int1979check_crc);</para>1980</entry>1981</row></tbody></tgroup></informaltable>1982<para>PARAMETERS1983</para>1984<informaltable><tgroup cols="2"><tbody><row><entry1985align="char">1986<para>dmx_section_feed_t*1987feed</para>1988</entry><entry1989align="char">1990<para>Pointer to the section feed API and instance data.</para>1991</entry>1992</row><row><entry1993align="char">1994<para>__u16 pid</para>1995</entry><entry1996align="char">1997<para>PID value to filter; only the TS packets carrying the1998specified PID will be accepted.</para>1999</entry>2000</row><row><entry2001align="char">2002<para>size_t2003circular_buffer_size</para>2004</entry><entry2005align="char">2006<para>Size of the circular buffer for filtered sections.</para>2007</entry>2008</row><row><entry2009align="char">2010<para>int descramble</para>2011</entry><entry2012align="char">2013<para>If non-zero, descramble any sections that are scrambled.</para>2014</entry>2015</row><row><entry2016align="char">2017<para>int check_crc</para>2018</entry><entry2019align="char">2020<para>If non-zero, check the CRC values of filtered sections.</para>2021</entry>2022</row></tbody></tgroup></informaltable>2023<para>RETURNS2024</para>2025<informaltable><tgroup cols="2"><tbody><row><entry2026align="char">2027<para>0</para>2028</entry><entry2029align="char">2030<para>The function was completed without errors.</para>2031</entry>2032</row><row><entry2033align="char">2034<para>-ENOMEM</para>2035</entry><entry2036align="char">2037<para>Not enough memory for the requested buffer size.</para>2038</entry>2039</row><row><entry2040align="char">2041<para>-ENOSYS</para>2042</entry><entry2043align="char">2044<para>No descrambling facility available for sections.</para>2045</entry>2046</row><row><entry2047align="char">2048<para>-EINVAL</para>2049</entry><entry2050align="char">2051<para>Bad parameters.</para>2052</entry>2053</row></tbody></tgroup></informaltable>20542055</section><section2056role="subsection"><title>allocate_filter()</title>2057<para>DESCRIPTION2058</para>2059<informaltable><tgroup cols="1"><tbody><row><entry2060align="char">2061<para>This function is used to allocate a section filter on the demux. It should only be2062called when no filtering is in progress on this section feed. If a filter cannot be2063allocated, the function fails with -ENOSPC. See in section ?? for the format of2064the section filter.</para>2065</entry>2066</row><row><entry2067align="char">2068<para>The bitfields filter_mask and filter_value should only be modified when no2069filtering is in progress on this section feed. filter_mask controls which bits of2070filter_value are compared with the section headers/payload. On a binary value2071of 1 in filter_mask, the corresponding bits are compared. The filter only accepts2072sections that are equal to filter_value in all the tested bit positions. Any changes2073to the values of filter_mask and filter_value are guaranteed to take effect only2074when the start_filtering() function is called next time. The parent pointer in2075the struct is initialized by the API implementation to the value of the feed2076parameter. The priv pointer is not used by the API implementation, and can2077thus be freely utilized by the caller of this function. Any data pointed to by the2078priv pointer is available to the recipient of the dmx_section_cb() function call.</para>2079</entry>2080</row><row><entry2081align="char">2082<para>While the maximum section filter length (DMX_MAX_FILTER_SIZE) is2083currently set at 16 bytes, hardware filters of that size are not available on all2084platforms. Therefore, section filtering will often take place first in hardware,2085followed by filtering in software for the header bytes that were not covered2086by a hardware filter. The filter_mask field can be checked to determine how2087many bytes of the section filter are actually used, and if the hardware filter will2088suffice. Additionally, software-only section filters can optionally be allocated2089to clients when all hardware section filters are in use. Note that on most demux2090hardware it is not possible to filter on the section_length field of the section2091header – thus this field is ignored, even though it is included in filter_value and2092filter_mask fields.</para>2093</entry>2094</row></tbody></tgroup></informaltable>2095<para>SYNOPSIS2096</para>2097<informaltable><tgroup cols="1"><tbody><row><entry2098align="char">2099<para>int allocate_filter(dmx_section_feed_t⋆ feed,2100dmx_section_filter_t⋆⋆ filter);</para>2101</entry>2102</row></tbody></tgroup></informaltable>2103<para>PARAMETERS2104</para>2105<informaltable><tgroup cols="2"><tbody><row><entry2106align="char">2107<para>dmx_section_feed_t*2108feed</para>2109</entry><entry2110align="char">2111<para>Pointer to the section feed API and instance data.</para>2112</entry>2113</row><row><entry2114align="char">2115<para>dmx_section_filter_t**2116filter</para>2117</entry><entry2118align="char">2119<para>Pointer to the allocated filter.</para>2120</entry>2121</row></tbody></tgroup></informaltable>2122<para>RETURNS2123</para>2124<informaltable><tgroup cols="2"><tbody><row><entry2125align="char">2126<para>0</para>2127</entry><entry2128align="char">2129<para>The function was completed without errors.</para>2130</entry>2131</row><row><entry2132align="char">2133<para>-ENOSPC</para>2134</entry><entry2135align="char">2136<para>No filters of given type and length available.</para>2137</entry>2138</row><row><entry2139align="char">2140<para>-EINVAL</para>2141</entry><entry2142align="char">2143<para>Bad parameters.</para>2144</entry>2145</row></tbody></tgroup></informaltable>21462147</section><section2148role="subsection"><title>release_filter()</title>2149<para>DESCRIPTION2150</para>2151<informaltable><tgroup cols="1"><tbody><row><entry2152align="char">2153<para>This function releases all the resources of a previously allocated section filter.2154The function should not be called while filtering is in progress on this section2155feed. After calling this function, the caller should not try to dereference the2156filter pointer.</para>2157</entry>2158</row></tbody></tgroup></informaltable>2159<para>SYNOPSIS2160</para>2161<informaltable><tgroup cols="1"><tbody><row><entry2162align="char">2163<para>int release_filter ( dmx_section_feed_t⋆ feed,2164dmx_section_filter_t⋆ filter);</para>2165</entry>2166</row></tbody></tgroup></informaltable>2167<para>PARAMETERS2168</para>2169<informaltable><tgroup cols="2"><tbody><row><entry2170align="char">2171<para>dmx_section_feed_t*2172feed</para>2173</entry><entry2174align="char">2175<para>Pointer to the section feed API and instance data.</para>2176</entry>2177</row><row><entry2178align="char">2179<para>dmx_section_filter_t*2180filter</para>2181</entry><entry2182align="char">2183<para>I/O Pointer to the instance data of a section filter.</para>2184</entry>2185</row></tbody></tgroup></informaltable>2186<para>RETURNS2187</para>2188<informaltable><tgroup cols="2"><tbody><row><entry2189align="char">2190<para>0</para>2191</entry><entry2192align="char">2193<para>The function was completed without errors.</para>2194</entry>2195</row><row><entry2196align="char">2197<para>-ENODEV</para>2198</entry><entry2199align="char">2200<para>No such filter allocated.</para>2201</entry>2202</row><row><entry2203align="char">2204<para>-EINVAL</para>2205</entry><entry2206align="char">2207<para>Bad parameter.</para>2208</entry>2209</row></tbody></tgroup></informaltable>22102211</section><section2212role="subsection"><title>start_filtering()</title>2213<para>DESCRIPTION2214</para>2215<informaltable><tgroup cols="1"><tbody><row><entry2216align="char">2217<para>Starts filtering sections on this section feed, according to its settings. Sections2218are first filtered based on their PID and then matched with the section2219filters allocated for this feed. If the section matches the PID filter and2220at least one section filter, it is delivered to the API client. The section2221is delivered asynchronously using the callback function registered with2222allocate_section_feed().</para>2223</entry>2224</row></tbody></tgroup></informaltable>2225<para>SYNOPSIS2226</para>2227<informaltable><tgroup cols="1"><tbody><row><entry2228align="char">2229<para>int start_filtering ( dmx_section_feed_t⋆ feed );</para>2230</entry>2231</row></tbody></tgroup></informaltable>2232<para>PARAMETERS2233</para>2234<informaltable><tgroup cols="2"><tbody><row><entry2235align="char">2236<para>dmx_section_feed_t*2237feed</para>2238</entry><entry2239align="char">2240<para>Pointer to the section feed API and instance data.</para>2241</entry>2242</row></tbody></tgroup></informaltable>2243<para>RETURNS2244</para>2245<informaltable><tgroup cols="2"><tbody><row><entry2246align="char">2247<para>0</para>2248</entry><entry2249align="char">2250<para>The function was completed without errors.</para>2251</entry>2252</row><row><entry2253align="char">2254<para>-EINVAL</para>2255</entry><entry2256align="char">2257<para>Bad parameter.</para>2258</entry>2259</row></tbody></tgroup></informaltable>22602261</section><section2262role="subsection"><title>stop_filtering()</title>2263<para>DESCRIPTION2264</para>2265<informaltable><tgroup cols="1"><tbody><row><entry2266align="char">2267<para>Stops filtering sections on this section feed. Note that any changes to the2268filtering parameters (filter_value, filter_mask, etc.) should only be made when2269filtering is stopped.</para>2270</entry>2271</row></tbody></tgroup></informaltable>2272<para>SYNOPSIS2273</para>2274<informaltable><tgroup cols="1"><tbody><row><entry2275align="char">2276<para>int stop_filtering ( dmx_section_feed_t⋆ feed );</para>2277</entry>2278</row></tbody></tgroup></informaltable>2279<para>PARAMETERS2280</para>2281<informaltable><tgroup cols="2"><tbody><row><entry2282align="char">2283<para>dmx_section_feed_t*2284feed</para>2285</entry><entry2286align="char">2287<para>Pointer to the section feed API and instance data.</para>2288</entry>2289</row></tbody></tgroup></informaltable>2290<para>RETURNS2291</para>2292<informaltable><tgroup cols="2"><tbody><row><entry2293align="char">2294<para>0</para>2295</entry><entry2296align="char">2297<para>The function was completed without errors.</para>2298</entry>2299</row><row><entry2300align="char">2301<para>-EINVAL</para>2302</entry><entry2303align="char">2304<para>Bad parameter.</para>2305</entry>2306</row></tbody></tgroup></informaltable>23072308</section>230923102311