Commit abfc97f7 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] demux.h: make checkpatch.ph happy

There are lots of CodingStyle violations here. Now that we're
touching a log on this header files, adding the documentation
here, make sure that this will follow the Kernel CodingStyle.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 548e5ae0
...@@ -32,9 +32,9 @@ ...@@ -32,9 +32,9 @@
#include <linux/time.h> #include <linux/time.h>
#include <linux/dvb/dmx.h> #include <linux/dvb/dmx.h>
/*--------------------------------------------------------------------------*/ /*
/* Common definitions */ * Common definitions
/*--------------------------------------------------------------------------*/ */
/* /*
* DMX_MAX_FILTER_SIZE: Maximum length (in bytes) of a section/PES filter. * DMX_MAX_FILTER_SIZE: Maximum length (in bytes) of a section/PES filter.
...@@ -45,7 +45,8 @@ ...@@ -45,7 +45,8 @@
#endif #endif
/* /*
* DMX_MAX_SECFEED_SIZE: Maximum length (in bytes) of a private section feed filter. * DMX_MAX_SECFEED_SIZE: Maximum length (in bytes) of a private section feed
* filter.
*/ */
#ifndef DMX_MAX_SECTION_SIZE #ifndef DMX_MAX_SECTION_SIZE
...@@ -55,18 +56,30 @@ ...@@ -55,18 +56,30 @@
#define DMX_MAX_SECFEED_SIZE (DMX_MAX_SECTION_SIZE + 188) #define DMX_MAX_SECFEED_SIZE (DMX_MAX_SECTION_SIZE + 188)
#endif #endif
/*--------------------------------------------------------------------------*/ /*
/* TS packet reception */ * TS packet reception
/*--------------------------------------------------------------------------*/ */
/* TS filter type for set() */ /* TS filter type for set() */
#define TS_PACKET 1 /* send TS packets (188 bytes) to callback (default) */ #define TS_PACKET 1 /*
#define TS_PAYLOAD_ONLY 2 /* in case TS_PACKET is set, only send the TS * send TS packets (188 bytes) to callback
payload (<=184 bytes per packet) to callback */ * (default)
#define TS_DECODER 4 /* send stream to built-in decoder (if present) */ */
#define TS_DEMUX 8 /* in case TS_PACKET is set, send the TS to
the demux device, not to the dvr device */ #define TS_PAYLOAD_ONLY 2 /*
* in case TS_PACKET is set, only send the TS
* payload (<=184 bytes per packet) to callback
*/
#define TS_DECODER 4 /*
* send stream to built-in decoder (if present)
*/
#define TS_DEMUX 8 /*
* in case TS_PACKET is set, send the TS to
* the demux device, not to the dvr device
*/
/** /**
* struct dmx_ts_feed - Structure that contains a TS feed filter * struct dmx_ts_feed - Structure that contains a TS feed filter
...@@ -86,19 +99,19 @@ struct dmx_ts_feed { ...@@ -86,19 +99,19 @@ struct dmx_ts_feed {
int is_filtering; int is_filtering;
struct dmx_demux *parent; struct dmx_demux *parent;
void *priv; void *priv;
int (*set) (struct dmx_ts_feed *feed, int (*set)(struct dmx_ts_feed *feed,
u16 pid, u16 pid,
int type, int type,
enum dmx_ts_pes pes_type, enum dmx_ts_pes pes_type,
size_t circular_buffer_size, size_t circular_buffer_size,
struct timespec timeout); struct timespec timeout);
int (*start_filtering) (struct dmx_ts_feed* feed); int (*start_filtering)(struct dmx_ts_feed *feed);
int (*stop_filtering) (struct dmx_ts_feed* feed); int (*stop_filtering)(struct dmx_ts_feed *feed);
}; };
/*--------------------------------------------------------------------------*/ /*
/* Section reception */ * Section reception
/*--------------------------------------------------------------------------*/ */
/** /**
* struct dmx_section_filter - Structure that describes a section filter * struct dmx_section_filter - Structure that describes a section filter
...@@ -119,11 +132,11 @@ struct dmx_ts_feed { ...@@ -119,11 +132,11 @@ struct dmx_ts_feed {
* equal to filter_value in all the tested bit positions. * equal to filter_value in all the tested bit positions.
*/ */
struct dmx_section_filter { struct dmx_section_filter {
u8 filter_value [DMX_MAX_FILTER_SIZE]; u8 filter_value[DMX_MAX_FILTER_SIZE];
u8 filter_mask [DMX_MAX_FILTER_SIZE]; u8 filter_mask[DMX_MAX_FILTER_SIZE];
u8 filter_mode [DMX_MAX_FILTER_SIZE]; u8 filter_mode[DMX_MAX_FILTER_SIZE];
struct dmx_section_feed* parent; /* Back-pointer */ struct dmx_section_feed *parent; /* Back-pointer */
void* priv; /* Pointer to private data of the API client */ void *priv; /* Pointer to private data of the API client */
}; };
/** /**
...@@ -153,8 +166,8 @@ struct dmx_section_filter { ...@@ -153,8 +166,8 @@ struct dmx_section_filter {
*/ */
struct dmx_section_feed { struct dmx_section_feed {
int is_filtering; int is_filtering;
struct dmx_demux* parent; struct dmx_demux *parent;
void* priv; void *priv;
int check_crc; int check_crc;
...@@ -166,33 +179,33 @@ struct dmx_section_feed { ...@@ -166,33 +179,33 @@ struct dmx_section_feed {
u16 secbufp, seclen, tsfeedp; u16 secbufp, seclen, tsfeedp;
/* public: */ /* public: */
int (*set) (struct dmx_section_feed* feed, int (*set)(struct dmx_section_feed *feed,
u16 pid, u16 pid,
size_t circular_buffer_size, size_t circular_buffer_size,
int check_crc); int check_crc);
int (*allocate_filter) (struct dmx_section_feed* feed, int (*allocate_filter)(struct dmx_section_feed *feed,
struct dmx_section_filter** filter); struct dmx_section_filter **filter);
int (*release_filter) (struct dmx_section_feed* feed, int (*release_filter)(struct dmx_section_feed *feed,
struct dmx_section_filter* filter); struct dmx_section_filter *filter);
int (*start_filtering) (struct dmx_section_feed* feed); int (*start_filtering)(struct dmx_section_feed *feed);
int (*stop_filtering) (struct dmx_section_feed* feed); int (*stop_filtering)(struct dmx_section_feed *feed);
}; };
/*--------------------------------------------------------------------------*/ /*
/* Callback functions */ * Callback functions
/*--------------------------------------------------------------------------*/ */
typedef int (*dmx_ts_cb) ( const u8 * buffer1, typedef int (*dmx_ts_cb)(const u8 *buffer1,
size_t buffer1_length, size_t buffer1_length,
const u8 * buffer2, const u8 *buffer2,
size_t buffer2_length, size_t buffer2_length,
struct dmx_ts_feed* source); struct dmx_ts_feed *source);
typedef int (*dmx_section_cb) ( const u8 * buffer1, typedef int (*dmx_section_cb)(const u8 *buffer1,
size_t buffer1_len, size_t buffer1_len,
const u8 * buffer2, const u8 *buffer2,
size_t buffer2_len, size_t buffer2_len,
struct dmx_section_filter * source); struct dmx_section_filter *source);
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/* DVB Front-End */ /* DVB Front-End */
...@@ -229,9 +242,9 @@ struct dmx_frontend { ...@@ -229,9 +242,9 @@ struct dmx_frontend {
enum dmx_frontend_source source; enum dmx_frontend_source source;
}; };
/*--------------------------------------------------------------------------*/ /*
/* MPEG-2 TS Demux */ * MPEG-2 TS Demux
/*--------------------------------------------------------------------------*/ */
/* /*
* Flags OR'ed in the capabilities field of struct dmx_demux. * Flags OR'ed in the capabilities field of struct dmx_demux.
...@@ -255,7 +268,8 @@ struct dmx_frontend { ...@@ -255,7 +268,8 @@ struct dmx_frontend {
*. *.
*/ */
#define DMX_FE_ENTRY(list) list_entry(list, struct dmx_frontend, connectivity_list) #define DMX_FE_ENTRY(list) \
list_entry(list, struct dmx_frontend, connectivity_list)
/** /**
* struct dmx_demux - Structure that contains the demux capabilities and * struct dmx_demux - Structure that contains the demux capabilities and
...@@ -450,43 +464,44 @@ struct dmx_frontend { ...@@ -450,43 +464,44 @@ struct dmx_frontend {
struct dmx_demux { struct dmx_demux {
u32 capabilities; u32 capabilities;
struct dmx_frontend* frontend; struct dmx_frontend *frontend;
void* priv; void *priv;
int (*open) (struct dmx_demux* demux); int (*open)(struct dmx_demux *demux);
int (*close) (struct dmx_demux* demux); int (*close)(struct dmx_demux *demux);
int (*write) (struct dmx_demux* demux, const char __user *buf, size_t count); int (*write)(struct dmx_demux *demux, const char __user *buf,
int (*allocate_ts_feed) (struct dmx_demux* demux, size_t count);
struct dmx_ts_feed** feed, int (*allocate_ts_feed)(struct dmx_demux *demux,
struct dmx_ts_feed **feed,
dmx_ts_cb callback); dmx_ts_cb callback);
int (*release_ts_feed) (struct dmx_demux* demux, int (*release_ts_feed)(struct dmx_demux *demux,
struct dmx_ts_feed* feed); struct dmx_ts_feed *feed);
int (*allocate_section_feed) (struct dmx_demux* demux, int (*allocate_section_feed)(struct dmx_demux *demux,
struct dmx_section_feed** feed, struct dmx_section_feed **feed,
dmx_section_cb callback); dmx_section_cb callback);
int (*release_section_feed) (struct dmx_demux* demux, int (*release_section_feed)(struct dmx_demux *demux,
struct dmx_section_feed* feed); struct dmx_section_feed *feed);
int (*add_frontend) (struct dmx_demux* demux, int (*add_frontend)(struct dmx_demux *demux,
struct dmx_frontend* frontend); struct dmx_frontend *frontend);
int (*remove_frontend) (struct dmx_demux* demux, int (*remove_frontend)(struct dmx_demux *demux,
struct dmx_frontend* frontend); struct dmx_frontend *frontend);
struct list_head* (*get_frontends) (struct dmx_demux* demux); struct list_head *(*get_frontends)(struct dmx_demux *demux);
int (*connect_frontend) (struct dmx_demux* demux, int (*connect_frontend)(struct dmx_demux *demux,
struct dmx_frontend* frontend); struct dmx_frontend *frontend);
int (*disconnect_frontend) (struct dmx_demux* demux); int (*disconnect_frontend)(struct dmx_demux *demux);
int (*get_pes_pids) (struct dmx_demux* demux, u16 *pids); int (*get_pes_pids)(struct dmx_demux *demux, u16 *pids);
/* private: Not used upstream and never documented */ /* private: Not used upstream and never documented */
#if 0 #if 0
int (*get_caps) (struct dmx_demux* demux, struct dmx_caps *caps); int (*get_caps)(struct dmx_demux *demux, struct dmx_caps *caps);
int (*set_source) (struct dmx_demux* demux, const dmx_source_t *src); int (*set_source)(struct dmx_demux *demux, const dmx_source_t *src);
#endif #endif
/* /*
* private: Only used at av7110, to read some data from firmware. * private: Only used at av7110, to read some data from firmware.
* As this was never documented, we have no clue about what's * As this was never documented, we have no clue about what's
* there, and its usage on other drivers aren't encouraged. * there, and its usage on other drivers aren't encouraged.
*/ */
int (*get_stc) (struct dmx_demux* demux, unsigned int num, int (*get_stc)(struct dmx_demux *demux, unsigned int num,
u64 *stc, unsigned int *base); u64 *stc, unsigned int *base);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment