demux.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. /*
  2. * demux.h
  3. *
  4. * The Kernel Digital TV Demux kABI defines a driver-internal interface for
  5. * registering low-level, hardware specific driver to a hardware independent
  6. * demux layer.
  7. *
  8. * Copyright (c) 2002 Convergence GmbH
  9. *
  10. * based on code:
  11. * Copyright (c) 2000 Nokia Research Center
  12. * Tampere, FINLAND
  13. *
  14. * This program is free software; you can redistribute it and/or
  15. * modify it under the terms of the GNU Lesser General Public License
  16. * as published by the Free Software Foundation; either version 2.1
  17. * of the License, or (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. */
  25. #ifndef __DEMUX_H
  26. #define __DEMUX_H
  27. #include <linux/types.h>
  28. #include <linux/errno.h>
  29. #include <linux/list.h>
  30. #include <linux/time.h>
  31. #include <linux/dvb/dmx.h>
  32. /*
  33. * Common definitions
  34. */
  35. /*
  36. * DMX_MAX_FILTER_SIZE: Maximum length (in bytes) of a section/PES filter.
  37. */
  38. #ifndef DMX_MAX_FILTER_SIZE
  39. #define DMX_MAX_FILTER_SIZE 18
  40. #endif
  41. /*
  42. * DMX_MAX_SECFEED_SIZE: Maximum length (in bytes) of a private section feed
  43. * filter.
  44. */
  45. #ifndef DMX_MAX_SECTION_SIZE
  46. #define DMX_MAX_SECTION_SIZE 4096
  47. #endif
  48. #ifndef DMX_MAX_SECFEED_SIZE
  49. #define DMX_MAX_SECFEED_SIZE (DMX_MAX_SECTION_SIZE + 188)
  50. #endif
  51. /*
  52. * TS packet reception
  53. */
  54. /**
  55. * enum ts_filter_type - filter type bitmap for dmx_ts_feed.set\(\)
  56. *
  57. * @TS_PACKET: Send TS packets (188 bytes) to callback (default).
  58. * @TS_PAYLOAD_ONLY: In case TS_PACKET is set, only send the TS payload
  59. * (<=184 bytes per packet) to callback
  60. * @TS_DECODER: Send stream to built-in decoder (if present).
  61. * @TS_DEMUX: In case TS_PACKET is set, send the TS to the demux
  62. * device, not to the dvr device
  63. */
  64. enum ts_filter_type {
  65. TS_PACKET = 1,
  66. TS_PAYLOAD_ONLY = 2,
  67. TS_DECODER = 4,
  68. TS_DEMUX = 8,
  69. };
  70. /**
  71. * struct dmx_ts_feed - Structure that contains a TS feed filter
  72. *
  73. * @is_filtering: Set to non-zero when filtering in progress
  74. * @parent: pointer to struct dmx_demux
  75. * @priv: pointer to private data of the API client
  76. * @set: sets the TS filter
  77. * @start_filtering: starts TS filtering
  78. * @stop_filtering: stops TS filtering
  79. *
  80. * A TS feed is typically mapped to a hardware PID filter on the demux chip.
  81. * Using this API, the client can set the filtering properties to start/stop
  82. * filtering TS packets on a particular TS feed.
  83. */
  84. struct dmx_ts_feed {
  85. int is_filtering;
  86. struct dmx_demux *parent;
  87. void *priv;
  88. int (*set)(struct dmx_ts_feed *feed,
  89. u16 pid,
  90. int type,
  91. enum dmx_ts_pes pes_type,
  92. ktime_t timeout);
  93. int (*start_filtering)(struct dmx_ts_feed *feed);
  94. int (*stop_filtering)(struct dmx_ts_feed *feed);
  95. };
  96. /*
  97. * Section reception
  98. */
  99. /**
  100. * struct dmx_section_filter - Structure that describes a section filter
  101. *
  102. * @filter_value: Contains up to 16 bytes (128 bits) of the TS section header
  103. * that will be matched by the section filter
  104. * @filter_mask: Contains a 16 bytes (128 bits) filter mask with the bits
  105. * specified by @filter_value that will be used on the filter
  106. * match logic.
  107. * @filter_mode: Contains a 16 bytes (128 bits) filter mode.
  108. * @parent: Pointer to struct dmx_section_feed.
  109. * @priv: Pointer to private data of the API client.
  110. *
  111. *
  112. * The @filter_mask controls which bits of @filter_value are compared with
  113. * the section headers/payload. On a binary value of 1 in filter_mask, the
  114. * corresponding bits are compared. The filter only accepts sections that are
  115. * equal to filter_value in all the tested bit positions.
  116. */
  117. struct dmx_section_filter {
  118. u8 filter_value[DMX_MAX_FILTER_SIZE];
  119. u8 filter_mask[DMX_MAX_FILTER_SIZE];
  120. u8 filter_mode[DMX_MAX_FILTER_SIZE];
  121. struct dmx_section_feed *parent; /* Back-pointer */
  122. void *priv; /* Pointer to private data of the API client */
  123. };
  124. /**
  125. * struct dmx_section_feed - Structure that contains a section feed filter
  126. *
  127. * @is_filtering: Set to non-zero when filtering in progress
  128. * @parent: pointer to struct dmx_demux
  129. * @priv: pointer to private data of the API client
  130. * @check_crc: If non-zero, check the CRC values of filtered sections.
  131. * @set: sets the section filter
  132. * @allocate_filter: This function is used to allocate a section filter on
  133. * the demux. It should only be called when no filtering
  134. * is in progress on this section feed. If a filter cannot
  135. * be allocated, the function fails with -ENOSPC.
  136. * @release_filter: This function releases all the resources of a
  137. * previously allocated section filter. The function
  138. * should not be called while filtering is in progress
  139. * on this section feed. After calling this function,
  140. * the caller should not try to dereference the filter
  141. * pointer.
  142. * @start_filtering: starts section filtering
  143. * @stop_filtering: stops section filtering
  144. *
  145. * A TS feed is typically mapped to a hardware PID filter on the demux chip.
  146. * Using this API, the client can set the filtering properties to start/stop
  147. * filtering TS packets on a particular TS feed.
  148. */
  149. struct dmx_section_feed {
  150. int is_filtering;
  151. struct dmx_demux *parent;
  152. void *priv;
  153. int check_crc;
  154. /* private: Used internally at dvb_demux.c */
  155. u32 crc_val;
  156. u8 *secbuf;
  157. u8 secbuf_base[DMX_MAX_SECFEED_SIZE];
  158. u16 secbufp, seclen, tsfeedp;
  159. /* public: */
  160. int (*set)(struct dmx_section_feed *feed,
  161. u16 pid,
  162. int check_crc);
  163. int (*allocate_filter)(struct dmx_section_feed *feed,
  164. struct dmx_section_filter **filter);
  165. int (*release_filter)(struct dmx_section_feed *feed,
  166. struct dmx_section_filter *filter);
  167. int (*start_filtering)(struct dmx_section_feed *feed);
  168. int (*stop_filtering)(struct dmx_section_feed *feed);
  169. };
  170. /**
  171. * typedef dmx_ts_cb - DVB demux TS filter callback function prototype
  172. *
  173. * @buffer1: Pointer to the start of the filtered TS packets.
  174. * @buffer1_length: Length of the TS data in buffer1.
  175. * @buffer2: Pointer to the tail of the filtered TS packets, or NULL.
  176. * @buffer2_length: Length of the TS data in buffer2.
  177. * @source: Indicates which TS feed is the source of the callback.
  178. *
  179. * This function callback prototype, provided by the client of the demux API,
  180. * is called from the demux code. The function is only called when filtering
  181. * on a TS feed has been enabled using the start_filtering\(\) function at
  182. * the &dmx_demux.
  183. * Any TS packets that match the filter settings are copied to a circular
  184. * buffer. The filtered TS packets are delivered to the client using this
  185. * callback function.
  186. * It is expected that the @buffer1 and @buffer2 callback parameters point to
  187. * addresses within the circular buffer, but other implementations are also
  188. * possible. Note that the called party should not try to free the memory
  189. * the @buffer1 and @buffer2 parameters point to.
  190. *
  191. * When this function is called, the @buffer1 parameter typically points to
  192. * the start of the first undelivered TS packet within a circular buffer.
  193. * The @buffer2 buffer parameter is normally NULL, except when the received
  194. * TS packets have crossed the last address of the circular buffer and
  195. * ”wrapped” to the beginning of the buffer. In the latter case the @buffer1
  196. * parameter would contain an address within the circular buffer, while the
  197. * @buffer2 parameter would contain the first address of the circular buffer.
  198. * The number of bytes delivered with this function (i.e. @buffer1_length +
  199. * @buffer2_length) is usually equal to the value of callback_length parameter
  200. * given in the set() function, with one exception: if a timeout occurs before
  201. * receiving callback_length bytes of TS data, any undelivered packets are
  202. * immediately delivered to the client by calling this function. The timeout
  203. * duration is controlled by the set() function in the TS Feed API.
  204. *
  205. * If a TS packet is received with errors that could not be fixed by the
  206. * TS-level forward error correction (FEC), the Transport_error_indicator
  207. * flag of the TS packet header should be set. The TS packet should not be
  208. * discarded, as the error can possibly be corrected by a higher layer
  209. * protocol. If the called party is slow in processing the callback, it
  210. * is possible that the circular buffer eventually fills up. If this happens,
  211. * the demux driver should discard any TS packets received while the buffer
  212. * is full and return -EOVERFLOW.
  213. *
  214. * The type of data returned to the callback can be selected by the
  215. * &dmx_ts_feed.@set function. The type parameter decides if the raw
  216. * TS packet (TS_PACKET) or just the payload (TS_PACKET|TS_PAYLOAD_ONLY)
  217. * should be returned. If additionally the TS_DECODER bit is set the stream
  218. * will also be sent to the hardware MPEG decoder.
  219. *
  220. * Return:
  221. *
  222. * - 0, on success;
  223. *
  224. * - -EOVERFLOW, on buffer overflow.
  225. */
  226. typedef int (*dmx_ts_cb)(const u8 *buffer1,
  227. size_t buffer1_length,
  228. const u8 *buffer2,
  229. size_t buffer2_length,
  230. struct dmx_ts_feed *source);
  231. /**
  232. * typedef dmx_section_cb - DVB demux TS filter callback function prototype
  233. *
  234. * @buffer1: Pointer to the start of the filtered section, e.g.
  235. * within the circular buffer of the demux driver.
  236. * @buffer1_len: Length of the filtered section data in @buffer1,
  237. * including headers and CRC.
  238. * @buffer2: Pointer to the tail of the filtered section data,
  239. * or NULL. Useful to handle the wrapping of a
  240. * circular buffer.
  241. * @buffer2_len: Length of the filtered section data in @buffer2,
  242. * including headers and CRC.
  243. * @source: Indicates which section feed is the source of the
  244. * callback.
  245. *
  246. * This function callback prototype, provided by the client of the demux API,
  247. * is called from the demux code. The function is only called when
  248. * filtering of sections has been enabled using the function
  249. * &dmx_ts_feed.@start_filtering. When the demux driver has received a
  250. * complete section that matches at least one section filter, the client
  251. * is notified via this callback function. Normally this function is called
  252. * for each received section; however, it is also possible to deliver
  253. * multiple sections with one callback, for example when the system load
  254. * is high. If an error occurs while receiving a section, this
  255. * function should be called with the corresponding error type set in the
  256. * success field, whether or not there is data to deliver. The Section Feed
  257. * implementation should maintain a circular buffer for received sections.
  258. * However, this is not necessary if the Section Feed API is implemented as
  259. * a client of the TS Feed API, because the TS Feed implementation then
  260. * buffers the received data. The size of the circular buffer can be
  261. * configured using the &dmx_ts_feed.@set function in the Section Feed API.
  262. * If there is no room in the circular buffer when a new section is received,
  263. * the section must be discarded. If this happens, the value of the success
  264. * parameter should be DMX_OVERRUN_ERROR on the next callback.
  265. */
  266. typedef int (*dmx_section_cb)(const u8 *buffer1,
  267. size_t buffer1_len,
  268. const u8 *buffer2,
  269. size_t buffer2_len,
  270. struct dmx_section_filter *source);
  271. /*
  272. * DVB Front-End
  273. */
  274. /**
  275. * enum dmx_frontend_source - Used to identify the type of frontend
  276. *
  277. * @DMX_MEMORY_FE: The source of the demux is memory. It means that
  278. * the MPEG-TS to be filtered comes from userspace,
  279. * via write() syscall.
  280. *
  281. * @DMX_FRONTEND_0: The source of the demux is a frontend connected
  282. * to the demux.
  283. */
  284. enum dmx_frontend_source {
  285. DMX_MEMORY_FE,
  286. DMX_FRONTEND_0,
  287. };
  288. /**
  289. * struct dmx_frontend - Structure that lists the frontends associated with
  290. * a demux
  291. *
  292. * @connectivity_list: List of front-ends that can be connected to a
  293. * particular demux;
  294. * @source: Type of the frontend.
  295. *
  296. * FIXME: this structure should likely be replaced soon by some
  297. * media-controller based logic.
  298. */
  299. struct dmx_frontend {
  300. struct list_head connectivity_list;
  301. enum dmx_frontend_source source;
  302. };
  303. /*
  304. * MPEG-2 TS Demux
  305. */
  306. /**
  307. * enum dmx_demux_caps - MPEG-2 TS Demux capabilities bitmap
  308. *
  309. * @DMX_TS_FILTERING: set if TS filtering is supported;
  310. * @DMX_SECTION_FILTERING: set if section filtering is supported;
  311. * @DMX_MEMORY_BASED_FILTERING: set if write() available.
  312. *
  313. * Those flags are OR'ed in the &dmx_demux.capabilities field
  314. */
  315. enum dmx_demux_caps {
  316. DMX_TS_FILTERING = 1,
  317. DMX_SECTION_FILTERING = 4,
  318. DMX_MEMORY_BASED_FILTERING = 8,
  319. };
  320. /*
  321. * Demux resource type identifier.
  322. */
  323. /**
  324. * DMX_FE_ENTRY - Casts elements in the list of registered
  325. * front-ends from the generic type struct list_head
  326. * to the type * struct dmx_frontend
  327. *
  328. * @list: list of struct dmx_frontend
  329. */
  330. #define DMX_FE_ENTRY(list) \
  331. list_entry(list, struct dmx_frontend, connectivity_list)
  332. /**
  333. * struct dmx_demux - Structure that contains the demux capabilities and
  334. * callbacks.
  335. *
  336. * @capabilities: Bitfield of capability flags.
  337. *
  338. * @frontend: Front-end connected to the demux
  339. *
  340. * @priv: Pointer to private data of the API client
  341. *
  342. * @open: This function reserves the demux for use by the caller and, if
  343. * necessary, initializes the demux. When the demux is no longer needed,
  344. * the function @close should be called. It should be possible for
  345. * multiple clients to access the demux at the same time. Thus, the
  346. * function implementation should increment the demux usage count when
  347. * @open is called and decrement it when @close is called.
  348. * The @demux function parameter contains a pointer to the demux API and
  349. * instance data.
  350. * It returns:
  351. * 0 on success;
  352. * -EUSERS, if maximum usage count was reached;
  353. * -EINVAL, on bad parameter.
  354. *
  355. * @close: This function reserves the demux for use by the caller and, if
  356. * necessary, initializes the demux. When the demux is no longer needed,
  357. * the function @close should be called. It should be possible for
  358. * multiple clients to access the demux at the same time. Thus, the
  359. * function implementation should increment the demux usage count when
  360. * @open is called and decrement it when @close is called.
  361. * The @demux function parameter contains a pointer to the demux API and
  362. * instance data.
  363. * It returns:
  364. * 0 on success;
  365. * -ENODEV, if demux was not in use (e. g. no users);
  366. * -EINVAL, on bad parameter.
  367. *
  368. * @write: This function provides the demux driver with a memory buffer
  369. * containing TS packets. Instead of receiving TS packets from the DVB
  370. * front-end, the demux driver software will read packets from memory.
  371. * Any clients of this demux with active TS, PES or Section filters will
  372. * receive filtered data via the Demux callback API (see 0). The function
  373. * returns when all the data in the buffer has been consumed by the demux.
  374. * Demux hardware typically cannot read TS from memory. If this is the
  375. * case, memory-based filtering has to be implemented entirely in software.
  376. * The @demux function parameter contains a pointer to the demux API and
  377. * instance data.
  378. * The @buf function parameter contains a pointer to the TS data in
  379. * kernel-space memory.
  380. * The @count function parameter contains the length of the TS data.
  381. * It returns:
  382. * 0 on success;
  383. * -ERESTARTSYS, if mutex lock was interrupted;
  384. * -EINTR, if a signal handling is pending;
  385. * -ENODEV, if demux was removed;
  386. * -EINVAL, on bad parameter.
  387. *
  388. * @allocate_ts_feed: Allocates a new TS feed, which is used to filter the TS
  389. * packets carrying a certain PID. The TS feed normally corresponds to a
  390. * hardware PID filter on the demux chip.
  391. * The @demux function parameter contains a pointer to the demux API and
  392. * instance data.
  393. * The @feed function parameter contains a pointer to the TS feed API and
  394. * instance data.
  395. * The @callback function parameter contains a pointer to the callback
  396. * function for passing received TS packet.
  397. * It returns:
  398. * 0 on success;
  399. * -ERESTARTSYS, if mutex lock was interrupted;
  400. * -EBUSY, if no more TS feeds is available;
  401. * -EINVAL, on bad parameter.
  402. *
  403. * @release_ts_feed: Releases the resources allocated with @allocate_ts_feed.
  404. * Any filtering in progress on the TS feed should be stopped before
  405. * calling this function.
  406. * The @demux function parameter contains a pointer to the demux API and
  407. * instance data.
  408. * The @feed function parameter contains a pointer to the TS feed API and
  409. * instance data.
  410. * It returns:
  411. * 0 on success;
  412. * -EINVAL on bad parameter.
  413. *
  414. * @allocate_section_feed: Allocates a new section feed, i.e. a demux resource
  415. * for filtering and receiving sections. On platforms with hardware
  416. * support for section filtering, a section feed is directly mapped to
  417. * the demux HW. On other platforms, TS packets are first PID filtered in
  418. * hardware and a hardware section filter then emulated in software. The
  419. * caller obtains an API pointer of type dmx_section_feed_t as an out
  420. * parameter. Using this API the caller can set filtering parameters and
  421. * start receiving sections.
  422. * The @demux function parameter contains a pointer to the demux API and
  423. * instance data.
  424. * The @feed function parameter contains a pointer to the TS feed API and
  425. * instance data.
  426. * The @callback function parameter contains a pointer to the callback
  427. * function for passing received TS packet.
  428. * It returns:
  429. * 0 on success;
  430. * -EBUSY, if no more TS feeds is available;
  431. * -EINVAL, on bad parameter.
  432. *
  433. * @release_section_feed: Releases the resources allocated with
  434. * @allocate_section_feed, including allocated filters. Any filtering in
  435. * progress on the section feed should be stopped before calling this
  436. * function.
  437. * The @demux function parameter contains a pointer to the demux API and
  438. * instance data.
  439. * The @feed function parameter contains a pointer to the TS feed API and
  440. * instance data.
  441. * It returns:
  442. * 0 on success;
  443. * -EINVAL, on bad parameter.
  444. *
  445. * @add_frontend: Registers a connectivity between a demux and a front-end,
  446. * i.e., indicates that the demux can be connected via a call to
  447. * @connect_frontend to use the given front-end as a TS source. The
  448. * client of this function has to allocate dynamic or static memory for
  449. * the frontend structure and initialize its fields before calling this
  450. * function. This function is normally called during the driver
  451. * initialization. The caller must not free the memory of the frontend
  452. * struct before successfully calling @remove_frontend.
  453. * The @demux function parameter contains a pointer to the demux API and
  454. * instance data.
  455. * The @frontend function parameter contains a pointer to the front-end
  456. * instance data.
  457. * It returns:
  458. * 0 on success;
  459. * -EINVAL, on bad parameter.
  460. *
  461. * @remove_frontend: Indicates that the given front-end, registered by a call
  462. * to @add_frontend, can no longer be connected as a TS source by this
  463. * demux. The function should be called when a front-end driver or a demux
  464. * driver is removed from the system. If the front-end is in use, the
  465. * function fails with the return value of -EBUSY. After successfully
  466. * calling this function, the caller can free the memory of the frontend
  467. * struct if it was dynamically allocated before the @add_frontend
  468. * operation.
  469. * The @demux function parameter contains a pointer to the demux API and
  470. * instance data.
  471. * The @frontend function parameter contains a pointer to the front-end
  472. * instance data.
  473. * It returns:
  474. * 0 on success;
  475. * -ENODEV, if the front-end was not found,
  476. * -EINVAL, on bad parameter.
  477. *
  478. * @get_frontends: Provides the APIs of the front-ends that have been
  479. * registered for this demux. Any of the front-ends obtained with this
  480. * call can be used as a parameter for @connect_frontend. The include
  481. * file demux.h contains the macro DMX_FE_ENTRY() for converting an
  482. * element of the generic type struct &list_head * to the type
  483. * struct &dmx_frontend *. The caller must not free the memory of any of
  484. * the elements obtained via this function call.
  485. * The @demux function parameter contains a pointer to the demux API and
  486. * instance data.
  487. * It returns a struct list_head pointer to the list of front-end
  488. * interfaces, or NULL in the case of an empty list.
  489. *
  490. * @connect_frontend: Connects the TS output of the front-end to the input of
  491. * the demux. A demux can only be connected to a front-end registered to
  492. * the demux with the function @add_frontend. It may or may not be
  493. * possible to connect multiple demuxes to the same front-end, depending
  494. * on the capabilities of the HW platform. When not used, the front-end
  495. * should be released by calling @disconnect_frontend.
  496. * The @demux function parameter contains a pointer to the demux API and
  497. * instance data.
  498. * The @frontend function parameter contains a pointer to the front-end
  499. * instance data.
  500. * It returns:
  501. * 0 on success;
  502. * -EINVAL, on bad parameter.
  503. *
  504. * @disconnect_frontend: Disconnects the demux and a front-end previously
  505. * connected by a @connect_frontend call.
  506. * The @demux function parameter contains a pointer to the demux API and
  507. * instance data.
  508. * It returns:
  509. * 0 on success;
  510. * -EINVAL on bad parameter.
  511. *
  512. * @get_pes_pids: Get the PIDs for DMX_PES_AUDIO0, DMX_PES_VIDEO0,
  513. * DMX_PES_TELETEXT0, DMX_PES_SUBTITLE0 and DMX_PES_PCR0.
  514. * The @demux function parameter contains a pointer to the demux API and
  515. * instance data.
  516. * The @pids function parameter contains an array with five u16 elements
  517. * where the PIDs will be stored.
  518. * It returns:
  519. * 0 on success;
  520. * -EINVAL on bad parameter.
  521. */
  522. struct dmx_demux {
  523. enum dmx_demux_caps capabilities;
  524. struct dmx_frontend *frontend;
  525. void *priv;
  526. int (*open)(struct dmx_demux *demux);
  527. int (*close)(struct dmx_demux *demux);
  528. int (*write)(struct dmx_demux *demux, const char __user *buf,
  529. size_t count);
  530. int (*allocate_ts_feed)(struct dmx_demux *demux,
  531. struct dmx_ts_feed **feed,
  532. dmx_ts_cb callback);
  533. int (*release_ts_feed)(struct dmx_demux *demux,
  534. struct dmx_ts_feed *feed);
  535. int (*allocate_section_feed)(struct dmx_demux *demux,
  536. struct dmx_section_feed **feed,
  537. dmx_section_cb callback);
  538. int (*release_section_feed)(struct dmx_demux *demux,
  539. struct dmx_section_feed *feed);
  540. int (*add_frontend)(struct dmx_demux *demux,
  541. struct dmx_frontend *frontend);
  542. int (*remove_frontend)(struct dmx_demux *demux,
  543. struct dmx_frontend *frontend);
  544. struct list_head *(*get_frontends)(struct dmx_demux *demux);
  545. int (*connect_frontend)(struct dmx_demux *demux,
  546. struct dmx_frontend *frontend);
  547. int (*disconnect_frontend)(struct dmx_demux *demux);
  548. int (*get_pes_pids)(struct dmx_demux *demux, u16 *pids);
  549. /* private: */
  550. /*
  551. * Only used at av7110, to read some data from firmware.
  552. * As this was never documented, we have no clue about what's
  553. * there, and its usage on other drivers aren't encouraged.
  554. */
  555. int (*get_stc)(struct dmx_demux *demux, unsigned int num,
  556. u64 *stc, unsigned int *base);
  557. };
  558. #endif /* #ifndef __DEMUX_H */