Hi All, Attached is a diff at my first go at multi protocol support at dvb-core. Comments ? Thanks, Manu
diff -Naurp 7-Apr-06/v4l-dvb/linux/drivers/media/dvb/dvb-core/demux.h 7-Apr-06-stb0899-tree/v4l-dvb/linux/drivers/media/dvb/dvb-core/demux.h --- 7-Apr-06/v4l-dvb/linux/drivers/media/dvb/dvb-core/demux.h 2006-04-07 11:52:40.000000000 +0400 +++ 7-Apr-06-stb0899-tree/v4l-dvb/linux/drivers/media/dvb/dvb-core/demux.h 2006-04-07 13:24:42.000000000 +0400 @@ -273,6 +273,8 @@ struct dmx_demux { int (*get_stc) (struct dmx_demux* demux, unsigned int num, u64 *stc, unsigned int *base); + + int (*dmx_set_protocol) (struct dmx_demux *demux, const dmx_protocol_t *protocol); }; #endif /* #ifndef __DEMUX_H */ diff -Naurp 7-Apr-06/v4l-dvb/linux/drivers/media/dvb/dvb-core/dmxdev.c 7-Apr-06-stb0899-tree/v4l-dvb/linux/drivers/media/dvb/dvb-core/dmxdev.c --- 7-Apr-06/v4l-dvb/linux/drivers/media/dvb/dvb-core/dmxdev.c 2006-04-07 11:52:40.000000000 +0400 +++ 7-Apr-06-stb0899-tree/v4l-dvb/linux/drivers/media/dvb/dvb-core/dmxdev.c 2006-04-07 13:25:14.000000000 +0400 @@ -907,6 +907,14 @@ static int dvb_demux_do_ioctl(struct ino &((struct dmx_stc *)parg)->base); break; + case DMX_SET_PROTOCOL: + if (!dmxdev->demux->dmx_set_protocol(dmxdev->demux, parg)) { + ret = -EINVAL; + break; + } + ret = dmxdev->demux->dmx_set_protocol(dmxdev->demux, parg); + break; + default: ret = -EINVAL; break; diff -Naurp 7-Apr-06/v4l-dvb/linux/drivers/media/dvb/dvb-core/dvb_frontend.c 7-Apr-06-stb0899-tree/v4l-dvb/linux/drivers/media/dvb/dvb-core/dvb_frontend.c --- 7-Apr-06/v4l-dvb/linux/drivers/media/dvb/dvb-core/dvb_frontend.c 2006-04-07 11:52:40.000000000 +0400 +++ 7-Apr-06-stb0899-tree/v4l-dvb/linux/drivers/media/dvb/dvb-core/dvb_frontend.c 2006-04-07 13:26:05.000000000 +0400 @@ -957,6 +957,11 @@ static int dvb_frontend_ioctl(struct ino case FE_SET_FRONTEND_TUNE_MODE: fepriv->tune_mode_flags = (unsigned long) parg; break; + + case FE_SET_PROTOCOL: + if (fe->ops->fe_set_protocol) + err = fe->ops->fe_set_protocol(fe, (fe_protocol_t) parg); + break; }; up (&fepriv->sem); diff -Naurp 7-Apr-06/v4l-dvb/linux/drivers/media/dvb/dvb-core/dvb_frontend.h 7-Apr-06-stb0899-tree/v4l-dvb/linux/drivers/media/dvb/dvb-core/dvb_frontend.h --- 7-Apr-06/v4l-dvb/linux/drivers/media/dvb/dvb-core/dvb_frontend.h 2006-04-07 11:52:40.000000000 +0400 +++ 7-Apr-06-stb0899-tree/v4l-dvb/linux/drivers/media/dvb/dvb-core/dvb_frontend.h 2006-04-07 13:25:50.000000000 +0400 @@ -86,6 +86,7 @@ struct dvb_frontend_ops { int (*enable_high_lnb_voltage)(struct dvb_frontend* fe, long arg); int (*dishnetwork_send_legacy_command)(struct dvb_frontend* fe, unsigned long cmd); int (*i2c_gate_ctrl)(struct dvb_frontend* fe, int enable); + int (*fe_set_protocol)(struct dvb_frontend *fe, fe_protocol_t protocol); }; #define MAX_EVENT 8 diff -Naurp 7-Apr-06/v4l-dvb/linux/include/linux/dvb/dmx.h 7-Apr-06-stb0899-tree/v4l-dvb/linux/include/linux/dvb/dmx.h --- 7-Apr-06/v4l-dvb/linux/include/linux/dvb/dmx.h 2006-04-07 11:52:41.000000000 +0400 +++ 7-Apr-06-stb0899-tree/v4l-dvb/linux/include/linux/dvb/dmx.h 2006-04-11 14:00:05.000000000 +0400 @@ -140,6 +140,21 @@ struct dmx_stc { __u64 stc; /* output: stc in 'base'*90 kHz units */ }; +typedef enum { + DMX_PROTO_DVB_S, + DMX_PROTO_DVB_C, + DMX_PROTO_DVB_T, + DMX_PROTO_DSS, + DMX_PROTO_ATSC, + DMX_PROTO_DVB_S2 +} dmx_protocol_t; + +typedef enum { + DMX_TRANSPORT, + DMX_GENERIC_PACKET, + DMX_GENERIC_CONTINUOUS, + DMX_RESERVED +} dmx_bbheader_t; #define DMX_START _IO('o', 41) #define DMX_STOP _IO('o', 42) @@ -150,5 +165,6 @@ struct dmx_stc { #define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t) #define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t) #define DMX_GET_STC _IOWR('o', 50, struct dmx_stc) +#define DMX_SET_PROTOCOL _IOW('o', 51, dmx_protocol_t) #endif /*_DVBDMX_H_*/ diff -Naurp 7-Apr-06/v4l-dvb/linux/include/linux/dvb/frontend.h 7-Apr-06-stb0899-tree/v4l-dvb/linux/include/linux/dvb/frontend.h --- 7-Apr-06/v4l-dvb/linux/include/linux/dvb/frontend.h 2006-04-07 11:52:41.000000000 +0400 +++ 7-Apr-06-stb0899-tree/v4l-dvb/linux/include/linux/dvb/frontend.h 2006-04-12 14:36:17.000000000 +0400 @@ -239,6 +239,21 @@ struct dvb_frontend_event { struct dvb_frontend_parameters parameters; }; +typedef enum { + FE_PROTO_DVB_S, + FE_PROTO_DVB_C, + FE_PROTO_DVB_T, + FE_PROTO_DSS, + FE_PROTO_ATSC, + FE_PROTO_DVB_S2 +} fe_protocol_t; + +typedef enum { + FE_TRANSPORT, + FE_GENERIC_PACKET, + FE_GENERIC_CONTINUOUS, + FE_RESERVED +} fe_bbheader_t; /** * When set, this flag will disable any zigzagging or other "normal" tuning @@ -273,5 +288,6 @@ struct dvb_frontend_event { #define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event) #define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */ +#define FE_SET_PROTOCOL _IOW('o', 81, fe_protocol_t) #endif /*_DVBFRONTEND_H_*/
_______________________________________________ linux-dvb@xxxxxxxxxxx http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb